vendor: 3,773 bytes, lines 1-2
1/*! jQuery v2.2.0 | (c) jQuery Foundation | jquery.org/license */ 2!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now
vendor: 19,725 bytes, line 2
2,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return
vendor: 6,732 bytes, line 2
2h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;
2for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c); 3}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}
vendor: 6,026 bytes, line 3
3});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return this;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{}
vendor: 2,430 bytes, line 3
3,keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}}
vendor: 1,849 bytes, line 3
3,n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);
vendor: 23,316 bytes, lines 3-4
3if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]; 4},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){return n.trim(a.value)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var hb=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!hb.test(q+n.event.triggered)&&(q.indexOf(".")>
vendor: 4,892 bytes, line 4
4-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,hb.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var ib=a.location,jb=n.now(),kb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return(!c||c.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+b),c};var lb=/#.*$/,mb=/([?&])_=[^&]*/,nb=/^(.*?):[ \t]*([^\r\n]*)$/gm,ob=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,pb=/^(?:GET|HEAD)$/,qb=/^\/\//,rb={},sb={},tb="*/".concat("*"),ub=d.createElement("a");ub.href=ib.href;function vb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function wb(a,b,c,d){var e={},f=a===sb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function xb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function yb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function zb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ib.href,type:"GET",isLocal:ob.test(ib.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML}
vendor: 5,167 bytes, line 4
4,flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?xb(xb(a,n.ajaxSettings),b):xb(n.ajaxSettings,a)},ajaxPrefilter:vb(rb),ajaxTransport:vb(sb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=nb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||ib.href)+"").replace(lb,"").replace(qb,ib.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=ub.protocol+"//"+ub.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),wb(rb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!pb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(kb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=mb.test(f)?f.replace(mb,"$1_="+jb++):f+(kb.test(f)?"&":"?")+"_="+jb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tb+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=wb(sb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=yb(m,x,d)),u=zb(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Ab=/%20/g,Bb=/\[\]$/,Cb=/\r?\n/g,Db=/^(?:submit|button|image|reset|file)$/i,Eb=/^(?:input|select|textarea|keygen)/i;function Fb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Bb.test(a)?d(a,e):Fb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Fb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};
vendor: 4,210 bytes, line 4
4if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Fb(c,a[c],b,e);return d.join("&").replace(Ab,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Eb.test(this.nodeName)&&!Db.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Cb,"\r\n")}}):{name:b.name,value:c.replace(Cb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Gb={0:200,1223:204},Hb=n.ajaxSettings.xhr();l.cors=!!Hb&&"withCredentials"in Hb,l.ajax=Hb=!!Hb,n.ajaxTransport(function(b){var c,d;return l.cors||Hb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Gb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Ib=[],Jb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Ib.pop()||n.expando+"_"+jb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Jb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Jb,"$1"+e):b.jsonp!==!1&&(b.url+=(kb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Ib.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Kb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Kb)return Kb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}
4).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Lb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Lb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),d.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Lb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Mb=a.jQuery,Nb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Nb),b&&a.jQuery===n&&(a.jQuery=Mb),n},b||(a.jQuery=a.$=n),n}); 5/* 6Plugin: jQuery Parallax 7Version 1.1.3 8Author: Ian Lunn 9Twitter: @IanLunn 10Author URL: http://www.ianlunn.co.uk/ 11Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/ 12 13Dual licensed under the MIT and GPL licenses: 14http://www.opensource.org/licenses/mit-license.php 15http://www.gnu.org/licenses/gpl.html 16*/ 17 18(function( $ ){ 19 var $window = $(window); 20 var windowHeight = $window.height(); 21 22 $window.resize(function () { 23 windowHeight = $window.height(); 24 }); 25 26 $.fn.parallax = function(xpos, speedFactor, outerHeight) { 27 var $this = $(this); 28 var getHeight; 29 var firstTop; 30 var paddingTop = 0; 31 32 //get the starting position of each element to have parallax applied to it 33 $this.each(function(){ 34 firstTop = $this.offset().top; 35 }); 36 37 if (outerHeight) { 38 getHeight = function(jqo) { 39 return jqo.outerHeight(true); 40 }; 41 } else { 42 getHeight = function(jqo) { 43 return jqo.height(); 44 }; 45 } 46 47 // setup defaults if arguments aren't specified 48 if (arguments.length < 1 || xpos === null) xpos = "50%"; 49 if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1; 50 if (arguments.length < 3 || outerHeight === null) outerHeight = true; 51 52 // function to be called whenever the window is scrolled or resized
vendor: 28,060 bytes, lines 53-184
53 function update(){ 54 var pos = $window.scrollTop(); 55 56 $this.each(function(){ 57 var $element = $(this); 58 var top = $element.offset().top; 59 var height = getHeight($element); 60 61 // Check if totally above or totally below viewport 62 if (top + height < pos || top > pos + windowHeight) { 63 return; 64 } 65 66 $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); 67 }); 68 } 69 70 $window.bind('scroll', update).resize(update); 71 update(); 72 }; 73})(jQuery); 74/*! jQuery Validation Plugin - v1.19.5 - 7/1/2022 75 * https://jqueryvalidation.org/ 76 * Copyright (c) 2022 Jörn Zaefferer; Licensed MIT */ 77!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return void 0===a?"":a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()&&0===this.pendingRequest?(a(this.currentForm).trigger("submit"),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a["date"===b?"dateISO":c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(a,d){b[a]="function"==typeof d&&"normalizer"!==a?d(c):d}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var a;b[this]&&(Array.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(a=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(a[0]),Number(a[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c},maxlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d<=c},rangelength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c[0]&&d<=c[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,c){var e=a.port;"abort"===a.mode&&(d[e]&&d[e].abort(),d[e]=c)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(d[f]&&d[f].abort(),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a}); 78/** 79 * angular-slugify -- provides slugification for AngularJS 80 * 81 * Copyright © 2013 Paul Smith <[email protected]> 82 * 83 * Permission is hereby granted, free of charge, to any person obtaining a copy 84 * of this software and associated documentation files (the âSoftwareâ), to deal 85 * in the Software without restriction, including without limitation the rights 86 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 87 * copies of the Software, and to permit persons to whom the Software is 88 * furnished to do so, subject to the following conditions: 89 * 90 * The above copyright notice and this permission notice shall be included in all 91 * copies or substantial portions of the Software. 92 * 93 * THE SOFTWARE IS PROVIDED âAS ISâ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 94 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 95 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 96 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 97 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 98 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 99 * SOFTWARE. 100 */ 101 102(function() { 103 "use strict"; 104 105 var mod = angular.module("slugifier", []); 106 107 // Unicode (non-control) characters in the Latin-1 Supplement and Latin 108 // Extended-A blocks, transliterated into ASCII characters. 109 var charmap = { 110 ' ': " ", 111 '¡': "!", 112 '¢': "c", 113 '£': "lb", 114 'Â¥': "yen", 115 '¦': "|", 116 '§': "SS", 117 '¨': "\"", 118 '©': "(c)", 119 'ª': "a", 120 '«': "<<", 121 '¬': "not", 122 'Â': "-", 123 '®': "(R)", 124 '°': "^0", 125 '±': "+/-", 126 '²': "^2", 127 '³': "^3", 128 '´': "'", 129 'µ': "u", 130 '¶': "P", 131 '·': ".", 132 '¸': ",", 133 '¹': "^1", 134 'º': "o", 135 '»': ">>", 136 '¼': " 1/4 ", 137 '½': " 1/2 ", 138 '¾': " 3/4 ", 139 '¿': "?", 140 'Ã': "`A", 141 'Ã': "'A", 142 'Ã': "^A", 143 'Ã': "~A", 144 'Ã': '"A', 145 'à ': "A", 146 'Ã': "AE", 147 'Ã': "C", 148 'Ã': "`E", 149 'Ã': "'E", 150 'Ã': "^E", 151 'Ã': '"E', 152 'Ã': "`I", 153 'Ã': "'I", 154 'Ã': "^I", 155 'Ã': '"I', 156 'Ã': "D", 157 'Ã': "~N", 158 'Ã': "`O", 159 'Ã': "'O", 160 'Ã': "^O", 161 'Ã': "~O", 162 'Ã': '"O', 163 'Ã': "x", 164 'Ã': "O", 165 'Ã': "`U", 166 'Ã': "'U", 167 'Ã': "^U", 168 'Ã': '"U', 169 'Ã': "'Y", 170 'Ã': "Th", 171 'Ã': "ss", 172 'à ': "`a", 173 'á': "'a", 174 'â': "^a", 175 'ã': "~a", 176 'ä': '"a', 177 'Ã¥': "a", 178 'æ': "ae", 179 'ç': "c", 180 'è': "`e", 181 'é': "'e", 182 'ê': "^e", 183 'ë': '"e', 184 'ì': "`i",
185 'Ã': "'i", 186 'î': "^i", 187 'ï': '"i', 188 'ð': "d", 189 'ñ': "~n", 190 'ò': "`o", 191 'ó': "'o", 192 'ô': "^o", 193 'õ': "~o", 194 'ö': '"o', 195 '÷': ":", 196 'ø': "o", 197 'ù': "`u", 198 'ú': "'u", 199 'û': "^u", 200 'ü': '"u', 201 'ý': "'y", 202 'þ': "th", 203 'ÿ': '"y', 204 'Ä': "A", 205 'Ä': "a", 206 'Ä': "A", 207 'Ä': "a", 208 'Ä': "A", 209 'Ä ': "a", 210 'Ä': "'C", 211 'Ä': "'c", 212 'Ä': "^C", 213 'Ä': "^c", 214 'Ä': "C", 215 'Ä': "c", 216 'Ä': "C", 217 'Ä': "c", 218 'Ä': "D", 219 'Ä': "d", 220 'Ä': "D", 221 'Ä': "d", 222 'Ä': "E", 223 'Ä': "e", 224 'Ä': "E", 225 'Ä': "e", 226 'Ä': "E", 227 'Ä': "e", 228 'Ä': "E", 229 'Ä': "e", 230 'Ä': "E", 231 'Ä': "e", 232 'Ä': "^G", 233 'Ä': "^g", 234 'Ä': "G", 235 'Ä': "g", 236 'Ä ': "G", 237 'Ä¡': "g", 238 'Ä¢': "G", 239 'Ä£': "g", 240 'Ĥ': "^H", 241 'Ä¥': "^h", 242 'Ħ': "H", 243 'ħ': "h", 244 'Ĩ': "~I", 245 'Ä©': "~i", 246 'Ī': "I", 247 'Ä«': "i", 248 'Ĭ': "I", 249 'Ä': "i", 250 'Ä®': "I", 251 'į': "i", 252 'İ': "I", 253 'ı': "i", 254 'IJ': "IJ", 255 'ij': "ij", 256 'Ä´': "^J", 257 'ĵ': "^j", 258 'Ķ': "K", 259 'Ä·': "k", 260 'Ĺ': "L", 261 'ĺ': "l", 262 'Ä»': "L", 263 'ļ': "l", 264 'Ľ': "L", 265 'ľ': "l", 266 'Ä¿': "L", 267 'Å': "l", 268 'Å': "L", 269 'Å': "l", 270 'Å': "'N", 271 'Å': "'n", 272 'Å ': "N", 273 'Å': "n", 274 'Å': "N", 275 'Å': "n", 276 'Å': "'n", 277 'Å': "O", 278 'Å': "o", 279 'Å': "O", 280 'Å': "o", 281 'Å': '"O', 282 'Å': '"o', 283 'Å': "OE", 284 'Å': "oe", 285 'Å': "'R", 286 'Å': "'r", 287 'Å': "R", 288 'Å': "r", 289 'Å': "R", 290 'Å': "r", 291 'Å': "'S", 292 'Å': "'s", 293 'Å': "^S", 294 'Å': "^s", 295 'Å': "S", 296 'Å': "s", 297 'Å ': "S", 298 'Å¡': "s", 299 'Å¢': "T", 300 'Å£': "t", 301 'Ť': "T", 302 'Å¥': "t", 303 'Ŧ': "T", 304 'ŧ': "t", 305 'Ũ': "~U", 306 'Å©': "~u", 307 'Ū': "U", 308 'Å«': "u", 309 'Ŭ': "U", 310 'Å': "u", 311 'Å®': "U", 312 'ů': "u", 313 'Ű': '"U', 314 'ű': '"u', 315 'Ų': "U", 316 'ų': "u", 317 'Å´': "^W", 318 'ŵ': "^w", 319 'Ŷ': "^Y", 320 'Å·': "^y", 321 'Ÿ': '"Y', 322 'Ź': "'Z", 323 'ź': "'z", 324 'Å»': "Z", 325 'ż': "z", 326 'Ž': "Z", 327 'ž': "z", 328 'Å¿': "s" 329 }; 330 331 function _slugify(s) { 332 if (!s) return ""; 333 var ascii = []; 334 var ch, cp; 335 for (var i = 0; i < s.length; i++) { 336 if ((cp = s.charCodeAt(i)) < 0x180) { 337 ch = String.fromCharCode(cp); 338 ascii.push(charmap[ch] || ch); 339 } 340 } 341 s = ascii.join(""); 342 s = s.replace(/[^\w\s-]/g, "").trim().toLowerCase(); 343 return s.replace(/[-\s]+/g, "-"); 344 } 345 346 mod.factory("Slug", function() { 347 return { 348 slugify: _slugify 349 }; 350 }); 351 352 mod.directive("slug", ["Slug", function(Slug) { 353 return { 354 restrict: "E", 355 scope: { 356 to: "=", 357 }, 358 transclude: true, 359 replace: true, 360 template: "<div ng-transclude></div>", 361 link: function(scope, elem, attrs) { 362 if (!attrs.from) { 363 throw "must set attribute 'from'"; 364 } 365 scope.$parent.$watch(attrs.from, function(val) { 366 scope.to = Slug.slugify(val); 367 }); 368 } 369 }; 370 }]); 371 372 mod.filter("slugify", ["Slug", function(Slug) { 373 return function(input) { 374 return Slug.slugify(input); 375 }; 376 }]); 377})(); 378/*! 379 * Bootstrap v3.3.6 (http://getbootstrap.com) 380 * Copyright 2011-2016 Twitter, Inc. 381 * Licensed under the MIT license 382 */ 383if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;
383e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")}
vendor: 5,584 bytes, line 383
383,c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","fal
383se"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===event.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("key
383down.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focu
383s":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.t
vendor: 6,971 bytes, lines 383-384
383ype+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active"); 384d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;
384e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); 385/*! 386 * Datepicker for Bootstrap v1.8.0 (https://github.com/uxsolutions/bootstrap-datepicker) 387 * 388 * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) 389 */ 390 391!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&&a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&&(e=i.replace(h,d),g[e]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;c<d;c++)if(0<=this[c].valueOf()-b&&this[c].valueOf()-b<864e5)return c;return-1},remove:function(a){this.splice(a,1)},replace:function(b){b&&(a.isArray(b)||(b=[b]),this.clear(),this.push.apply(this,b))},clear:function(){this.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a.data(b,"datepicker",this),this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(a,b){return Number(b)+1}
vendor: 13,677 bytes, line 391
391),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};k.prototype={constructor:k,_resolveViewName:function(b){return a.each(r.viewModes,function(c,d){if(b===c||a.inArray(b,d.names)!==-1)return b=c,!1}),b},_resolveDaysOfWeek:function(b){return a.isArray(b)||(b=b.split(/[,\s]*/)),a.map(b,Number)},_check_template:function(c){try{if(c===b||""===c)return!1;if((c.match(/[<>]/g)||[]).length<=0)return!0;var d=a(c);return d.length>0}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),e.multidate!==!0&&(e.multidate=Number(e.multidate)||!1,e.multidate!==!1&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-(1/0)&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-(1/0)),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(d=b,e=a[f][1]):3===a[f].length&&(d=a[f][1],e=a[f][2]),c.on(e,d)},_unapplyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(e=b,d=a[f][1]):3===a[f].length&&(e=a[f][1],d=a[f][2]),c.off(d,e)},_buildEvents:function(){var b={keyup:a.proxy(function(b){a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:a.proxy(this.keydown,this),paste:a.proxy(this.paste,this)};this.o.showOnFocus===!0&&(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&&this.inputField.length?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:a.proxy(function(a){this._focused_from=a.target},this)}],[this.element,{blur:a.proxy(function(a){this._focused_from=a.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":a.proxy(function(a){this.update(a.date)},this)}]),this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[this.picker,".prev, .next",{click:a.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:a.proxy(this.dayCellClick,this)}],[a(window),{resize:a.proxy(this.place,this)}],[a(document),{"mousedown touchstart":a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(b,c){var d=c||this.dates.get(-1),e=this._utc_to_local(d);this.element.trigger({type:b,date:e,viewMode:this.viewMode,dates:a.map(this.dates,this._utc_to_local),format:a.proxy(function(a,b){0===arguments.length?(a=this.dates.length-1,b=this.o.format):"string"==typeof a&&(b=a,a=this.dates.length-1),b=b||this.o.format;var c=this.dates.get(a);return r.formatDate(c,b,this.o.language)},this)})},show:function(){if(!(this.inputField.prop("disabled")||this.inputField.prop("readonly")&&this.o.enableOnReadonly===!1))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&a(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&&b.originalEvent.clipboardData.types&&a.inArray("text/plain",b.originalEvent.clipboardData.types)!==-1)c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_utc_to_local:function(a){if(!a)return a;var b=new Date(a.getTime()+6e4*a.getTimezoneOffset());return b.getTimezoneOffset()!==a.getTimezoneOffset()&&(b=new Date(a.getTime()+6e4*b.getTimezoneOffset())),b},_local_to_utc:function(a){return a&&new Date(a.getTime()-6e4*a.getTimezoneOffset())},_zero_time:function(a){return a&&new Date(a.getFullYear(),a.getMonth(),a.getDate())},_zero_utc_time:function(a){return a&&c(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())},getDates:function(){return a.map(this.dates,this._utc_to_local)},getUTCDates:function(){return a.map(this.dates,function(a){return new Date(a)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var a=this.dates.get(-1);return a!==b?new Date(a):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,a.map(b,this._utc_to_local)),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return r.formatDate(a,c,d)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){return this._process_options({datesDisabled:a}),this.update(),this},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=10,e=a(this.o.container),f=e.width(),g="body"===this.o.container?a(document).scrollTop():e.scrollTop(),h=e.offset(),i=[0];this.element.parents().each(function(){var b=a(this).css("z-index");"auto"!==b&&0!==Number(b)&&i.push(Number(b))});var j=Math.max.apply(Math,i)+this.o.zIndexOffset,k=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),m=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),n=k.left-h.left,o=k.top-h.top;"body"!==this.o.container&&(o+=g),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(n-=b-m)):k.left<0?(this.picker.addClass("datepicker-orient-left"),n-=k.left-d):n+b>f?(this.picker.addClass("datepicker-orient-right"),n+=m-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p,q=this.o.orientation.y;if("auto"===q&&(p=-g+o-c,q=p<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+q),"top"===q?o-=c+parseInt(this.picker.css("padding-top")):o+=l,this.o.rtl){var r=f-(n+m);this.picker.css({top:o,right:r,zIndex:j})}else this.picker.css({top:o,left:n,zIndex:j});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),c=c&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&&String(b)!==String(this.dates)&&d&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&b.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="<tr>";for(this.o.calendarWeeks&&(c+='<th class="cw"> </th>');b<this.o.weekStart+7;)c+='<th class="dow',a.inArray(b,this.o.daysOfWeekDisabled)!==-1&&(c+=" disabled"),c+='">'+q[this.o.language].daysMin[b++%7]+"</th>";c+="</tr>",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d<12;d++)a=b&&b.getMonth()===d?" focused":"",c+='<span class="month'+a+'">'+q[this.o.language].monthsShort[d]+"</span>";this.picker.find(".datepicker-months td").html(c)},setRange:function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()<f||b.getUTCFullYear()===f&&b.getUTCMonth()<g?c.push("old"):(b.getUTCFullYear()>f||b.getUTCFullYear()===f&&b.getUTCMonth()>g)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&e(b,h)&&c.push("today"),this.dates.contains(b)!==-1&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)!==-1&&c.push("highlighted"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),a.inArray(b.valueOf(),this.range)!==-1&&c.push("selected"),b.valueOf()===this.range[0]&&c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&&c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i){for(var j,k,l,m="",n=e/10,o=this.picker.find(c),p=Math.floor(f/e)*e,q=p+9*n,r=Math.floor(this.viewDate.getFullYear()/n)*n,s=a.map(this.dates,function(a){return Math.floor(a.getUTCFullYear()/n)*n}),t=p-n;t<=q+n;t+=n)j=[d],k=null,t===p-n?j.push("old"):t===q+n&&j.push("new"),a.inArray(t,s)!==-1&&j.push("active"),(t<g||t>h)&&j.push("disabled"),t===r&&j.push("focused"),i!==a.noop&&(l=i(new Date(t,0,1)),l===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&&(l={classes:l}),l.enabled===!1&&j.push("disabled"),l.classes&&(j=j.concat(l.classes.split(/\s+/))),l.tooltip&&(k=l.tooltip)),m+='<sp
391an class="'+j.join(" ")+'"'+(k?' title="'+k+'"':"")+">"+t+"</span>";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var d,e,f=new Date(this.viewDate),g=f.getUTCFullYear(),h=f.getUTCMonth(),i=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),j=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),k=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,m=q[this.o.language].today||q.en.today||"",n=q[this.o.language].clear||q.en.clear||"",o=q[this.o.language].titleFormat||q.en.titleFormat;if(!isNaN(g)&&!isNaN(h)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(f,o,this.o.language)),this.picker.find("tfoot .today").text(m).css("display",this.o.todayBtn===!0||"linked"===this.o.todayBtn?"table-cell":"none"),this.picker.find("tfoot .clear").text(n).css("display",this.o.clearBtn===!0?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var p=c(g,h,0),s=p.getUTCDate();p.setUTCDate(s-(p.getUTCDay()-this.o.weekStart+7)%7);var t=new Date(p);p.getUTCFullYear()<100&&t.setUTCFullYear(p.getUTCFullYear()),t.setUTCDate(t.getUTCDate()+42),t=t.valueOf();for(var u,v,w=[];p.valueOf()<t;){if(u=p.getUTCDay(),u===this.o.weekStart&&(w.push("<tr>"),this.o.calendarWeeks)){var x=new Date(+p+(this.o.weekStart-u-7)%7*864e5),y=new Date(Number(x)+(11-x.getUTCDay())%7*864e5),z=new Date(Number(z=c(y.getUTCFullYear(),0,1))+(11-z.getUTCDay())%7*864e5),A=(y-z)/864e5/7+1;w.push('<td class="cw">'+A+"</td>")}v=this.getClassNames(p),v.push("day");var B=p.getUTCDate();this.o.beforeShowDay!==a.noop&&(e=this.o.beforeShowDay(this._utc_to_local(p)),e===b?e={}:"boolean"==typeof e?e={enabled:e}:"string"==typeof e&&(e={classes:e}),e.enabled===!1&&v.push("disabled"),e.classes&&(v=v.concat(e.classes.split(/\s+/))),e.tooltip&&(d=e.tooltip),e.content&&(B=e.content)),v=a.isFunction(a.uniqueSort)?a.uniqueSort(v):a.unique(v),w.push('<td class="'+v.join(" ")+'"'+(d?' title="'+d+'"':"")+' data-date="'+p.getTime().toString()+'">'+B+"</td>"),d=null,u===this.o.weekEnd&&w.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(w.join(""));var C=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",D=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?C:g).end().find("tbody span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===g&&D.eq(b.getUTCMonth()).addClass("active")}),(g<i||g>k)&&D.addClass("disabled"),g===i&&D.slice(0,j).addClass("disabled"),g===k&&D.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var E=this;a.each(D,function(c,d){var e=new Date(g,c,1),f=E.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),f.enabled!==!1||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,g,i,k,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,g,i,k,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,g,i,k,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),g=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j<f,b=Math.floor(d/j)*j+j>h;break;case 0:a=d<=f&&e<g,b=d>=h&&e>i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h;e=a(b.target),e.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,f)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c=a(b.currentTarget),d=c.data("date"),e=new Date(d);this.o.updateViewDate&&(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c=a(b.currentTarget),d=c.hasClass("prev")?-1:1;0!==this.viewMode&&(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),b!==-1?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):this.o.multidate===!1?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)}
vendor: 6,439 bytes, line 391
391,_setDate:function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),(!b&&this.o.updateViewDate||"view"===b)&&(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=b===-1?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j<i;j++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!==e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)!==-1},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,function(a){return e(b,a)}).length>0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void(40!==a.keyCode&&27!==a.keyCode||(this.show(),a.stopPropagation()));var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"),c&&this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"),c&&this._trigger("changeMonth",this.viewDate)):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a.data(b,"datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},clearDates:function(){a.each(this.pickers,function(a,b){b.clearDates()})},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(g!==-1){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b!==d&&f||b.setUTCDate(e)}),e<this.dates[h])for(;h>=0&&e<this.dates[h];)this.pickers[h--].setUTCDate(e);else if(e>this.dates[i])for(;i<j&&e>this.dates[i];)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,function(a){a.destroy()}),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
391ay","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,e,f,g){function h(a,b){return b===!0&&(b=10),a<100&&(a+=2e3,a>(new Date).getFullYear()+b&&(a-=100)),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&&(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&&(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n<j.length;n++)l=j[n].match(/([\-+]\d+)([dmwy])/i),m=Number(l[1]),o=p[l[2].toLowerCase()],c=k.prototype[o](c,m);return k.prototype._zero_utc_time(c)}j=c&&c.match(this.nonpunctuation)||[];var t,u,v={},w=["yyyy","yy","M","MM","m","mm","d","dd"],x={yyyy:function(a,b){return a.setUTCFullYear(g?h(b,g):b)},m:function(a,b){if(isNaN(a))return a;for(b-=1;b<0;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!==b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};x.yy=x.yyyy,x.M=x.MM=x.mm=x.m,x.dd=x.d,c=d();var y=e.parts.slice();if(j.length!==y.length&&(y=a(y).filter(function(b,c){return a.inArray(c,w)!==-1}).toArray()),j.length===y.length){var z;for(n=0,z=y.length;n<z;n++){if(t=parseInt(j[n],10),l=y[n],isNaN(t))switch(l){case"MM":u=a(q[f].months).filter(i),t=a.inArray(u[0],q[f].months)+1;break;case"M":u=a(q[f].monthsShort).filter(i),t=a.inArray(u[0],q[f].monthsShort)+1}v[l]=t}var A,B;for(n=0;n<w.length;n++)B=w[n],B in v&&!isNaN(v[B])&&(A=new Date(c),x[B](A,v[B]),isNaN(A)||(c=A))}return c},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&&(c=r.parseFormat(c)),c.toDisplay)return c.toDisplay(b,c,d);var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[d].months[b.getUTCMonth()],yy:b.getUTCFullYear().toString().substring(2),yyyy:b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,b=[];for(var f=a.extend([],c.separators),g=0,h=c.parts.length;g<=h;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+o.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+o.templates.rightArrow+"</th></tr></thead>", 392contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};r.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+r.headTemplate+"<tbody></tbody>"+r.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.8.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&&b.warn&&b.warn("DEPRECATED: "+a)},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})}); 393(function () { 394 'use strict'; 395 396 var multiselect = angular.module('btorfs.multiselect', ['btorfs.multiselect.templates']); 397 398 multiselect.getRecursiveProperty = function (object, path) { 399 return path.split('.').reduce(function (object, x) { 400 if (object) { 401 return object[x]; 402 } else { 403 return null; 404 } 405 }, object) 406 }; 407 408 multiselect.directive('multiselect', ['$filter', '$document', '$log', function ($filter, $document, $log) { 409 return { 410 restrict: 'AE', 411 scope: { 412 options: '=', 413 displayProp: '@', 414 idProp: '@', 415 searchLimit: '=?', 416 selectionLimit: '=?', 417 showSelectAll: '=?', 418 showUnselectAll: '=?', 419 showSearch: '=?', 420 searchFilter: '=?', 421 disabled: '=?ngDisabled', 422 labels: '=?', 423 showTooltip: '=?', 424 placeholder: '@?' 425 }, 426 require: 'ngModel', 427 templateUrl: 'multiselect.html', 428 link: function ($scope, $element, $attrs, $ngModelCtrl) { 429 $scope.selectionLimit = $scope.selectionLimit || 0; 430 $scope.searchLimit = $scope.searchLimit || 25; 431 432 $scope.searchFilter = ''; 433 434 $scope.resolvedOptions = []; 435 if (typeof $scope.options !== 'function') { 436 $scope.resolvedOptions = $scope.options; 437 } 438 439 if (typeof $attrs.disabled != 'undefined') { 440 $scope.disabled = true; 441 } 442 443 444 var closeHandler = function (event) { 445 if (!$element[0].contains(event.target)) { 446 $scope.$apply(function () { 447 $scope.open = false;
448 }); 449 } 450 }; 451 452 $document.on('click', closeHandler); 453 $document.on('keydown', function(event) { 454 if(event.keyCode == 27) { 455 $scope.$apply(function () { 456 $scope.open = false; 457 }); 458 } 459 }); 460 461 var updateSelectionLists = function () { 462 if (!$ngModelCtrl.$viewValue) { 463 if ($scope.selectedOptions) { 464 $scope.selectedOptions = []; 465 } 466 $scope.unselectedOptions = $scope.resolvedOptions.slice(); // Take a copy 467 } else { 468 $scope.selectedOptions = $scope.resolvedOptions.filter(function (el) { 469 var id = $scope.getId(el); 470 for (var i = 0; i < $ngModelCtrl.$viewValue.length; i++) { 471 var selectedId = $scope.getId($ngModelCtrl.$viewValue[i]); 472 if (id === selectedId) { 473 return true; 474 } 475 } 476 return false; 477 }); 478 $scope.unselectedOptions = $scope.resolvedOptions.filter(function (el) { 479 return $scope.selectedOptions.indexOf(el) < 0; 480 }); 481 } 482 }; 483 484 $scope.toggleDropdown = function () { 485 $scope.open = !$scope.open; 486 $scope.resolvedOptions = $scope.options; 487 updateSelectionLists(); 488 }; 489 490 $ngModelCtrl.$render = function () { 491 updateSelectionLists(); 492 }; 493 494 $ngModelCtrl.$viewChangeListeners.push(function () { 495 updateSelectionLists(); 496 }); 497 498 $ngModelCtrl.$isEmpty = function (value) { 499 if (value) { 500 return (value.length === 0); 501 } else { 502 return true; 503 } 504 }; 505 506 var watcher = $scope.$watch('selectedOptions', function () { 507 $ngModelCtrl.$setViewValue(angular.copy($scope.selectedOptions)); 508 }, true); 509 510 $scope.$on('$destroy', function () { 511 $document.off('click', closeHandler); 512 if (watcher) { 513 watcher(); // Clean watcher 514 } 515 }); 516 517 $scope.getButtonText = function () { 518 //BS 519 return $scope.labels && $scope.labels.select ? $scope.labels.select : ($scope.placeholder || 'Select'); 520 521 if ($scope.selectedOptions && $scope.selectedOptions.length === 1) { 522 return $scope.getDisplay($scope.selectedOptions[0]); 523 } 524 if ($scope.selectedOptions && $scope.selectedOptions.length > 1) { 525 var totalSelected = angular.isDefined($scope.selectedOptions) ? $scope.selectedOptions.length : 0; 526 if (totalSelected === 0) { 527 return $scope.labels && $scope.labels.select ? $scope.labels.select : ($scope.placeholder || 'Select'); 528 } else { 529 return totalSelected + ' ' + ($scope.labels && $scope.labels.itemsSelected ? $scope.labels.itemsSelected : 'selected'); 530 } 531 } else { 532 return $scope.labels && $scope.labels.select ? $scope.labels.select : ($scope.placeholder || 'Select'); 533 } 534 }; 535 $scope.getButtonID = function() { 536 //BS 537 text = $scope.getButtonText(); 538 text= text.toLowerCase().replace("[^a-z\-]",""); 539 } 540 541 $scope.selectAll = function () { 542 $scope.selectedOptions = $scope.resolvedOptions.slice(); // Take a copy; 543 $scope.unselectedOptions = []; 544 }; 545 546 $scope.unselectAll = function () { 547 $scope.selectedOptions = []; 548 $scope.unselectedOptions = $scope.resolvedOptions.slice(); // Take a copy; 549 }; 550 551 $scope.toggleItem = function (item) { 552 if (typeof $scope.selectedOptions === 'undefined') { 553 $scope.selectedOptions = []; 554 } 555 var selectedIndex = $scope.selectedOptions.indexOf(item); 556 var currentlySelected = (selectedIndex !== -1); 557 if (currentlySelected) { 558 $scope.unselectedOptions.push($scope.selectedOptions[selectedIndex]); 559 $scope.selectedOptions.splice(selectedIndex, 1); 560 } else if (!currentlySelected && ($scope.selectionLimit === 0 || $scope.selectedOptions.length < $scope.selectionLimit)) { 561 var unselectedIndex = $scope.unselectedOptions.indexOf(item); 562 $scope.unselectedOptions.splice(unselectedIndex, 1); 563 $scope.selectedOptions.push(item); 564 } 565 }; 566 567 $scope.getId = function (item) { 568 if (angular.isString(item)) { 569 return item; 570 } else if (angular.isObject(item)) { 571 if ($scope.idProp) { 572 return multiselect.getRecursiveProperty(item, $scope.idProp); 573 } else { 574 $log.error('Multiselect: when using objects as model, a idProp value is mandatory.'); 575 return ''; 576 } 577 } else { 578 return item; 579 } 580 }; 581 582 $scope.getDisplay = function (item) { 583 if (angular.isString(item)) { 584 return item; 585 } else if (angular.isObject(item)) { 586 if ($scope.displayProp) { 587 return multiselect.getRecursiveProperty(item, $scope.displayProp); 588 } else { 589 $log.error('Multiselect: when using objects as model, a displayProp value is mandatory.'); 590 return ''; 591 } 592 } else { 593 return item; 594 } 595 }; 596 597 $scope.isSelected = function (item) { 598 if (!$scope.selectedOptions) { 599 return false;
600 } 601 var itemId = $scope.getId(item); 602 for (var i = 0; i < $scope.selectedOptions.length; i++) { 603 var selectedElement = $scope.selectedOptions[i]; 604 if ($scope.getId(selectedElement) === itemId) { 605 return true; 606 } 607 } 608 return false; 609 }; 610 611 $scope.updateOptions = function () { 612 if (typeof $scope.options === 'function') { 613 $scope.options().then(function (resolvedOptions) { 614 $scope.resolvedOptions = resolvedOptions; 615 updateSelectionLists(); 616 }); 617 } 618 }; 619 620 // This search function is optimized to take into account the search limit. 621 // Using angular limitTo filter is not efficient for big lists, because it still runs the search for 622 // all elements, even if the limit is reached 623 $scope.search = function () { 624 var counter = 0; 625 return function (item) { 626 if (counter > $scope.searchLimit) { 627 return false; 628 } 629 var displayName = $scope.getDisplay(item); 630 if (displayName) { 631 var result = displayName.toLowerCase().indexOf($scope.searchFilter.toLowerCase()) > -1; 632 if (result) { 633 counter++; 634 } 635 return result; 636 } 637 } 638 }; 639 640 } 641 }; 642 }]); 643 644}()); 645 646angular.module('btorfs.multiselect.templates', ['multiselect.html']); 647 648angular.module("multiselect.html", []).run(["$templateCache", function ($templateCache) { 649 $templateCache.put("multiselect.html", 650 "<div class=\"btn-group\" style=\"min-width: 100%\">\n" + 651 " <button type=\"button\" class=\"btn btn-default btn-block dropdown-toggle arrows arrows-inline\" aria-haspopup=\"true\" ng-attr-aria-controls=\"{{getButtonId}}\" ng-attr-aria-expanded=\"{{open ? true : false}}\" ng-click=\"toggleDropdown()\" ng-disabled=\"disabled\" style=\"white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;\">\n" + 652 " {{getButtonText()}} <span class=\"glyphicon glyphicon-menu-right\"></span>\n" + 653 " </button>\n" + 654 " <ul id=\"getButtonId()\" class=\"dropdown-menu dropdown-menu-form\"\n" + 655 " ng-style=\"{display: open ? 'block' : 'none'}\" style=\"min-width: 100%; overflow-x: auto\">\n" + 656 "\n" + 657 " <li ng-show=\"showSearch\">\n" + 658 " <div class=\"dropdown-header\">\n" + 659 " <input type=\"text\" class=\"form-control input-sm\" style=\"min-width: 100%;\"\n" + 660 " ng-model=\"searchFilter\" placeholder=\"{{labels.search || 'Search...'}}\" ng-change=\"updateOptions()\"/>\n" + 661 " </div>\n" + 662 " </li>\n" + 663 " <li class=\"close\" ><button role=\"button\" ng-click=\"toggleDropdown()\">\n" + 664 " <span class=\"close-text\">Close</span>\n" + 665 " <span class=\"glyphicon glyphicon-remove\"></span></button>\n" + 666 " </li>\n" + 667 "\n" + 668 " <li ng-show=\"showSearch\" class=\"divider\"></li>\n" + 669 " <li role=\"presentation\" ng-repeat=\"option in unselectedOptions | filter:search() | limitTo: searchLimit\"\n" + 670 " ng-if=\"!isSelected(option)\"\n" + 671 " ng-class=\"{disabled : selectionLimit && selectedOptions.length >= selectionLimit}\">\n" + 672 " <a class=\"item-unselected\" href=\"\" title=\"{{showTooltip ? getDisplay(option) : ''}}\" ng-click=\"toggleItem(option); $event.stopPropagation()\" style=\"overflow-x: auto\">\n" + 673 " {{getDisplay(option)}}\n" + 674 " </a>\n" + 675 " </li>\n" + 676 "\n" + 677 " <li class=\"divider\" ng-show=\"selectionLimit > 1\"></li>\n" + 678 " <li role=\"presentation\" ng-show=\"selectionLimit > 1\">\n" + 679 " <a>{{selectedOptions.length || 0}} / {{selectionLimit}} {{labels.itemsSelected || 'selected'}}</a>\n" + 680 " </li>\n" + 681 "\n" + 682 " </ul>\n" + 683 "</div>\n" + 684 ""); 685}]); 686/* 687* bootstrap-table - v1.11.1 - 2017-02-22 688* https://github.com/wenzhixin/bootstrap-table 689* Copyright (c) 2017 zhixin wen 690* Licensed MIT License 691*/ 692!function(a){"use strict";var b=null,c=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},d=function(b,c,d,e){var f="";return a.each(b,function(a,b){return b[c]===e?(f=b[d],!1):!0}),f},e=function(b,c){var d=-1;
692return a.each(b,function(a,b){return b.field===c?(d=a,!1):!0}),d},f=function(b){var c,d,e,f=0,g=[];for(c=0;c<b[0].length;c++)f+=b[0][c].colspan||1;for(c=0;c<b.length;c++)for(g[c]=[],d=0;f>d;d++)g[c][d]=!1;for(c=0;c<b.length;c++)for(d=0;d<b[c].length;d++){var h=b[c][d],i=h.rowspan||1,j=h.colspan||1,k=a.inArray(!1,g[c]);for(1===j&&(h.fieldIndex=k,"undefined"==typeof h.field&&(h.field=k)),e=0;i>e;e++)g[c+e][k]=!0;for(e=0;j>e;e++)g[c][k+e]=!0}},g=function(){if(null===b){var c,d,e=a("<p/>").addClass("fixed-table-scroll-inner"),f=a("<div/>").addClass("fixed-table-scroll-outer");f.append(e),a("body").append(f),c=e[0].offsetWidth,f.css("overflow","scroll"),d=e[0].offsetWidth,c===d&&(d=f[0].clientWidth),f.remove(),b=c-d}return b},h=function(b,d,e,f){var g=d;if("string"==typeof d){var h=d.split(".");h.length>1?(g=window,a.each(h,function(a,b){g=g[b]})):g=window[d]}return"object"==typeof g?g:"function"==typeof g?g.apply(b,e||[]):!g&&"string"==typeof d&&c.apply(this,[d].concat(e))?c.apply(this,[d].concat(e)):f},i=function(b,c,d){var e=Object.getOwnPropertyNames(b),f=Object.getOwnPropertyNames(c),g="";if(d&&e.length!==f.length)return!1;for(var h=0;h<e.length;h++)if(g=e[h],a.inArray(g,f)>-1&&b[g]!==c[g])return!1;return!0},j=function(a){return"string"==typeof a?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`"):a},k=function(a){for(var b in a){var c=b.split(/(?=[A-Z])/).join("-").toLowerCase();c!==b&&(a[c]=a[b],delete a[b])}return a},l=function(a,b,c){var d=a;if("string"!=typeof b||a.hasOwnProperty(b))return c?j(a[b]):a[b];var e=b.split(".");for(var f in e)e.hasOwnProperty(f)&&(d=d&&d[e[f]]);return c?j(d):d},m=function(){return!!(navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./))},n=function(){Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}())},o=function(b,c){this.options=c,this.$el=a(b),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()};o.DEFAULTS={classes:"table table-hover",sortClass:void 0,locale:void 0,height:void 0,undefinedText:"-",sortName:void 0,sortOrder:"asc",sortStable:!1,striped:!1,columns:[[]],data:[],totalField:"total",dataField:"rows",method:"get",url:void 0,ajax:void 0,cache:!0,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(a){return a},queryParamsType:"limit",responseHandler:function(a){return a},pagination:!1,onlyInfoPagination:!1,paginationLoop:!0,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"‹",paginationNextText:"›",search:!1,searchOnEnterKey:!1,strictSearch:!1,searchAlign:"right",selectItemName:"btSelectItem",showHeader:!0,showFooter:!1,showColumns:!1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,buttonsAlign:"right",smartDisplay:!0,escape:!1,minimumCountColumns:1,idField:void 0,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return""},trimOnSearch:!0,clickToSelect:!1,singleSelect:!1,toolbar:void 0,toolbarAlign:"left",checkboxHeader:!0,sortable:!0,silentSort:!0,maintainSelected:!1,searchTimeOut:500,searchText:"",iconSize:void 0,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:a.noop,customSort:a.noop,rowStyle:function(){return{}},rowAttributes:function(){return{}},footerStyle:function(){return{}},onAll:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1},onSort:function(){return!1},onCheck:function(){return!1},onUncheck:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onCheckSome:function(){return!1},onUncheckSome:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onColumnSwitch:function(){return!1},onPageChange:function(){return!1},onSearch:function(){return!1},onToggle:function(){return!1},onPreBody:function(){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onExpandRow:function(){return!1},onCollapseRow:function(){return!1},onRefreshOptions:function(){return!1},onRefresh:function(){return!1},onResetView:function(){return!1}},o.LOCALES={},o.LOCALES["en-US"]=o.LOCALES.en={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(a){return c("%s rows per page",a)},formatShowingRows:function(a,b,d){return c("Showing %s to %s of %s rows",a,b,d)},formatDetailPagination:function(a){return c("Showing %s rows",a)},formatSearch:function(){return"Search"}
692,formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"}},a.extend(o.DEFAULTS,o.LOCALES["en-US"]),o.COLUMN_DEFAULTS={radio:!1,checkbox:!1,checkboxEnabled:!0,field:void 0,title:void 0,titleTooltip:void 0,"class":void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,width:void 0,sortable:!1,order:"asc",visible:!0,switchable:!0,clickToSelect:!0,formatter:void 0,footerFormatter:void 0,events:void 0,sorter:void 0,sortName:void 0,cellStyle:void 0,searchable:!0,searchFormatter:!0,cardVisible:!0,escape:!1},o.EVENTS={"all.bs.table":"onAll","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh"},o.prototype.init=function(){this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initHiddenRows(),this.initFooter(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()},o.prototype.initLocale=function(){if(this.options.locale){var b=this.options.locale.split(/-|_/);b[0].toLowerCase(),b[1]&&b[1].toUpperCase(),a.fn.bootstrapTable.locales[this.options.locale]?a.extend(this.options,a.fn.bootstrapTable.locales[this.options.locale]):a.fn.bootstrapTable.locales[b.join("-")]?a.extend(this.options,a.fn.bootstrapTable.locales[b.join("-")]):a.fn.bootstrapTable.locales[b[0]]&&a.extend(this.options,a.fn.bootstrapTable.locales[b[0]])}},o.prototype.initContainer=function(){this.$container=a(['<div class="bootstrap-table">','<div class="fixed-table-toolbar"></div>',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination" style="clear: both;"></div>':"",'<div class="fixed-table-container">','<div class="fixed-table-header"><table></table></div>','<div class="fixed-table-body">','<div class="fixed-table-loading">',this.options.formatLoadingMessage(),"</div>","</div>",'<div class="fixed-table-footer"><table><tr></tr></table></div>',"bottom"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination"></div>':"","</div>","</div>"].join("")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$container.find(".fixed-table-footer"),this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('<div class="clearfix"></div>'),this.$el.addClass(this.options.classes),this.options.striped&&this.$el.addClass("table-striped"),-1!==a.inArray("table-no-bordered",this.options.classes.split(" "))&&this.$tableContainer.addClass("table-no-bordered")},o.prototype.initTable=function(){var b=this,c=[],d=[];if(this.$header=this.$el.find(">thead"),this.$header.length||(this.$header=a("<thead></thead>").appendTo(this.$el)),this.$header.find("tr").each(function(){var b=[];a(this).find("th").each(function(){"undefined"!=typeof a(this).data("field")&&a(this).data("field",a(this).data("field")+""),b.push(a.extend({},{title:a(this).html(),"class":a(this).attr("class"),titleTooltip:a(this).attr("title"),rowspan:a(this).attr("rowspan")?+a(this).attr("rowspan"):void 0,colspan:a(this).attr("colspan")?+a(this).attr("colspan"):void 0},a(this).data()))}),c.push(b)}),a.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=a.extend(!0,[],c,this.options.columns),this.columns=[],f(this.options.columns),a.each(this.options.columns,function(c,d){a.each(d,function(d,e){e=a.extend({},o.COLUMN_DEFAULTS,e),"undefined"!=typeof e.fieldIndex&&(b.columns[e.fieldIndex]=e),b.options.columns[c][d]=e})}),!this.options.data.length){var e=[];this.$el.find(">tbody>tr").each(function(c){var f={};f._id=a(this).attr("id"),f._class=a(this).attr("class"),f._data=k(a(this).data()),a(this).find(">td").each(function(d){for(var g,h,i=a(this),j=+i.attr("colspan")||1,l=+i.attr("rowspan")||1;e[c]&&e[c][d];d++);for(g=d;d+j>g;g++)for(h=c;c+l>h;h++)e[h]||(e[h]=[]),e[h][g]=!0;var m=b.columns[d].field;f[m]=a(this).html(),f["_"+m+"_id"]=a(this).attr("id"),f["_"+m+"_class"]=a(this).attr("class"),f["_"+m+"_rowspan"]=a(this).attr("rowspan"),f["_"+m+"_colspan"]=a(this).attr("colspan"),f["_"+m+"_title"]=a(this).attr("title"),f["_"+m+"_data"]=k(a(this).data())}),d.push(f)}),this.options.data=d,d.length&&(this.fromHtml=!0)}},o.prototype.initHeader=function(){var b=this,d={},e=[];this.header={fields:[],styles:[],classes:[],formatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},a.each(this.options.columns,function(f,g){e.push("<tr>
692"),0===f&&!b.options.cardView&&b.options.detailView&&e.push(c('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',b.options.columns.length)),a.each(g,function(a,f){var g="",h="",i="",k="",l=c(' class="%s"',f["class"]),m=(b.options.sortOrder||f.order,"px"),n=f.width;if(void 0===f.width||b.options.cardView||"string"==typeof f.width&&-1!==f.width.indexOf("%")&&(m="%"),f.width&&"string"==typeof f.width&&(n=f.width.replace("%","").replace("px","")),h=c("text-align: %s; ",f.halign?f.halign:f.align),i=c("text-align: %s; ",f.align),k=c("vertical-align: %s; ",f.valign),k+=c("width: %s; ",!f.checkbox&&!f.radio||n?n?n+m:void 0:"36px"),"undefined"!=typeof f.fieldIndex){if(b.header.fields[f.fieldIndex]=f.field,b.header.styles[f.fieldIndex]=i+k,b.header.classes[f.fieldIndex]=l,b.header.formatters[f.fieldIndex]=f.formatter,b.header.events[f.fieldIndex]=f.events,b.header.sorters[f.fieldIndex]=f.sorter,b.header.sortNames[f.fieldIndex]=f.sortName,b.header.cellStyles[f.fieldIndex]=f.cellStyle,b.header.searchables[f.fieldIndex]=f.searchable,!f.visible)return;if(b.options.cardView&&!f.cardVisible)return;d[f.field]=f}e.push("<th"+c(' title="%s"',f.titleTooltip),f.checkbox||f.radio?c(' class="bs-checkbox %s"',f["class"]||""):l,c(' style="%s"',h+k),c(' rowspan="%s"',f.rowspan),c(' colspan="%s"',f.colspan),c(' data-field="%s"',f.field),">"),e.push(c('<div class="th-inner %s">',b.options.sortable&&f.sortable?"sortable both":"")),g=b.options.escape?j(f.title):f.title,f.checkbox&&(!b.options.singleSelect&&b.options.checkboxHeader&&(g='<input name="btSelectAll" type="checkbox" />'),b.header.stateField=f.field),f.radio&&(g="",b.header.stateField=f.field,b.options.singleSelect=!0),e.push(g),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</th>")}),e.push("</tr>")}),this.$header.html(e.join("")),this.$header.find("th[data-field]").each(function(){a(this).data(d[a(this).data("field")])}),this.$container.off("click",".th-inner").on("click",".th-inner",function(c){var d=a(this);return b.options.detailView&&d.closest(".bootstrap-table")[0]!==b.$container[0]?!1:void(b.options.sortable&&d.parent().data().sortable&&b.onSort(c))}),this.$header.children().children().off("keypress").on("keypress",function(c){if(b.options.sortable&&a(this).data().sortable){var d=c.keyCode||c.which;13==d&&b.onSort(c)}}),a(window).off("resize.bootstrap-table"),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),a(window).on("resize.bootstrap-table",a.proxy(this.resetWidth,this))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",function(){var c=a(this).prop("checked");b[c?"checkAll":"uncheckAll"](),b.updateSelected()})},o.prototype.initFooter=function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()},o.prototype.initData=function(a,b){this.data="append"===b?this.data.concat(a):"prepend"===b?[].concat(a).concat(this.data):a||this.options.data,this.options.data="append"===b?this.options.data.concat(a):"prepend"===b?[].concat(a).concat(this.options.data):this.data,"server"!==this.options.sidePagination&&this.initSort()},o.prototype.initSort=function(){var b=this,d=this.options.sortName,e="desc"===this.options.sortOrder?-1:1,f=a.inArray(this.options.sortName,this.header.fields),g=0;return this.options.customSort!==a.noop?void this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]):void(-1!==f&&(this.options.sortStable&&a.each(this.data,function(a,b){b.hasOwnProperty("_position")||(b._position=a)}),this.data.sort(function(c,g){b.header.sortNames[f]&&(d=b.header.sortNames[f]);var i=l(c,d,b.options.escape),j=l(g,d,b.options.escape),k=h(b.header,b.header.sorters[f],[i,j]);return void 0!==k?e*k:((void 0===i||null===i)&&(i=""),(void 0===j||null===j)&&(j=""),b.options.sortStable&&i===j&&(i=c._position,j=g._position),a.isNumeric(i)&&a.isNumeric(j)?(i=parseFloat(i),j=parseFloat(j),j>i?-1*e:e):i===j?0:("string"!=typeof i&&(i=i.toString()),-1===i.localeCompare(j)?-1*e:e))}),void 0!==this.options.sortClass&&(clearTimeout(g),g=setTimeout(function(){b.$el.removeClass(b.options.sortClass);var a=b.$header.find(c('[data-field="%s"]',b.options.sortName).index()+1);b.$el.find(c("tr td:nth-child(%s)",a)).addClass(b.options.sortClass)},250))))},o.prototype.onSort=function(b){var c="keypress"===b.type?a(b.currentTarget):a(b.currentTarget).parent(),d=this.$header.find("th").eq(c.index());return this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===c.data("field")?this.options.sortOrder="asc"===this.options.sortOrder?"desc":"asc":(this.options.sortName=c.data("field"),this.options.sortOrder="asc"===c.data("order")?"desc":"asc"),this.trigger("sort",this.options.sortName,this.options.sortOrder),c.add(d).data("order",this.options.sortOrder),this.getCaret(),"server"===this.options.sidePagination?void this.initServer(this.options.silentSort):(this.initSort(),void this.initBody())},o.prototype.initToolbar=function(){var b,d,e=this,f=[],g=0,i=0;this.$toolbar.find(".bs-bars").children().length&&a("body").append(a(this.options.toolbar)),this.$toolbar.html(""),("string"==typeof this.options.toolbar||"object"==typeof this.options.toolbar)&&a(c('<div class="bs-bars pull-%s"></div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(a(this.options.toolbar)),f=[c('<div class="columns columns-%s btn-group pull-%s">',this.options.buttonsAlign,this.options.buttonsAlign)],"string"==typeof this.options.icons&&(this.options.icons=h(null,this.options.icons)),this.options.showPaginationSwitch&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="paginationSwitch" aria-label="pagination Switch" title="%s">',this.options.formatPaginationSwitch()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.paginationSwitchDown),"</button>"),this.options.showRefresh&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="refresh" aria-label="refresh" title="%s">',this.options.formatRefresh()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.refresh),"</button>
692"),this.options.showToggle&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="toggle" aria-label="toggle" title="%s">',this.options.formatToggle()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.toggle),"</button>"),this.options.showColumns&&(f.push(c('<div class="keep-open btn-group" title="%s">',this.options.formatColumns()),'<button type="button" aria-label="columns" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.columns),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'),a.each(this.columns,function(a,b){if(!(b.radio||b.checkbox||e.options.cardView&&!b.cardVisible)){var d=b.visible?' checked="checked"':"";b.switchable&&(f.push(c('<li role="menuitem"><label><input type="checkbox" data-field="%s" value="%s"%s> %s</label></li>',b.field,a,d,b.title)),i++)}}),f.push("</ul>","</div>")),f.push("</div>"),(this.showToolbar||f.length>2)&&this.$toolbar.append(f.join("")),this.options.showPaginationSwitch&&this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click",a.proxy(this.togglePagination,this)),this.options.showRefresh&&this.$toolbar.find('button[name="refresh"]').off("click").on("click",a.proxy(this.refresh,this)),this.options.showToggle&&this.$toolbar.find('button[name="toggle"]').off("click").on("click",function(){e.toggleView()}),this.options.showColumns&&(b=this.$toolbar.find(".keep-open"),i<=this.options.minimumCountColumns&&b.find("input").prop("disabled",!0),b.find("li").off("click").on("click",function(a){a.stopImmediatePropagation()}),b.find("input").off("click").on("click",function(){var b=a(this);e.toggleColumn(a(this).val(),b.prop("checked"),!1),e.trigger("column-switch",a(this).data("field"),b.prop("checked"))})),this.options.search&&(f=[],f.push('<div class="pull-'+this.options.searchAlign+' search">',c('<input class="form-control'+c(" input-%s",this.options.iconSize)+'" type="text" placeholder="%s">',this.options.formatSearch()),"</div>"),this.$toolbar.append(f.join("")),d=this.$toolbar.find(".search input"),d.off("keyup drop blur").on("keyup drop blur",function(b){e.options.searchOnEnterKey&&13!==b.keyCode||a.inArray(b.keyCode,[37,38,39,40])>-1||(clearTimeout(g),g=setTimeout(function(){e.onSearch(b)},e.options.searchTimeOut))}),m()&&d.off("mouseup").on("mouseup",function(a){clearTimeout(g),g=setTimeout(function(){e.onSearch(a)},e.options.searchTimeOut)}))},o.prototype.onSearch=function(b){var c=a.trim(a(b.currentTarget).val());this.options.trimOnSearch&&a(b.currentTarget).val()!==c&&a(b.currentTarget).val(c),c!==this.searchText&&(this.searchText=c,this.options.searchText=c,this.options.pageNumber=1,this.initSearch(),this.updatePagination(),this.trigger("search",c))},o.prototype.initSearch=function(){var b=this;if("server"!==this.options.sidePagination){if(this.options.customSearch!==a.noop)return void this.options.customSearch.apply(this,[this.searchText]);var c=this.searchText&&(this.options.escape?j(this.searchText):this.searchText).toLowerCase(),d=a.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=d?a.grep(this.options.data,function(b){for(var c in d)if(a.isArray(d[c])&&-1===a.inArray(b[c],d[c])||!a.isArray(d[c])&&b[c]!==d[c])return!1;return!0}):this.options.data,this.data=c?a.grep(this.data,function(d,f){for(var g=0;g<b.header.fields.length;g++)if(b.header.searchables[g]){var i,j=a.isNumeric(b.header.fields[g])?parseInt(b.header.fields[g],10):b.header.fields[g],k=b.columns[e(b.columns,j)];if("string"==typeof j){i=d;for(var l=j.split("."),m=0;m<l.length;m++)i=i[l[m]];k&&k.searchFormatter&&(i=h(k,b.header.formatters[g],[i,d,f],i))}else i=d[j];if("string"==typeof i||"number"==typeof i)if(b.options.strictSearch){if((i+"").toLowerCase()===c)return!0}else if(-1!==(i+"").toLowerCase().indexOf(c))return!0}return!1}):this.data}},o.prototype.initPagination=function(){if(!this.options.pagination)return void this.$pagination.hide();this.$pagination.show();var b,d,e,f,g,h,i,j,k,l=this,m=[],n=!1,o=this.getData(),p=this.options.pageList;if("server"!==this.options.sidePagination&&(this.options.totalRows=o.length),this.totalPages=0,this.options.totalRows){if(this.options.pageSize===this.options.formatAllRows())this.options.pageSize=this.options.totalRows,n=!0;else if(this.options.pageSize===this.options.totalRows){var q="string"==typeof this.options.pageList?this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.pageList;a.inArray(this.options.formatAllRows().toLowerCase(),q)>-1&&(n=!0)}this.totalPages=~~((this.options.totalRows-1)/this.options.pageSize)+1,this.options.totalPages=this.totalPages}if(this.totalPages>0&&this.options.pageNumber>this.totalPages&&(this.options.pageNumber=this.totalPages),this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1,this.pageTo=this.options.pageNumber*this.options.pageSize,this.pageTo>this.options.totalRows&&(this.pageTo=this.options.totalRows),m.push('<div class="pull-'+this.options.paginationDetailHAlign+' pagination-detail">','<span class="pagination-info">',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),"</span>"),!this.options.onlyInfoPagination){m.push('<span class="page-list">');var r=[c('<span class="btn-group %s">',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?"dropdown":"dropup"),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">','<span class="page-size">',n?this.options.formatAllRows():this.options.pageSize,"</span>",' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'];if("string"==typeof this.options.pageList){var s=this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").split(",");p=[],a.each(s,function(a,b){p.push(b.toUpperCase()===l.options.formatAllRows().toUpperCase()?l.options.formatAllRows():+b)})}for(a.each(p,function(a,b){if(!l.options.smartDisplay||0===a||p[a-1]<l.options.totalRows){var d;d=n?b===l.options.formatAllRows()?' class="active"':"":b===l.options.pageSize?' class="active"':"",r.push(c('<li role="menuitem"%s><a href="#">%s</a></li>',d,b))}}),r.push("</ul></span>"),m.push(this.options.formatRecordsPerPage(r.join(""))),m.push("</span>"),m.push("</div>",'<div class="pull-'+this.options.paginationHAlign+' pagination">','<ul class="pagination'+c(" pagination-%s",this.options.iconSize)+'">','<li class="page-pre"><a href="#">'+this.options.paginationPreText+"</a></li>"),this.totalPages<5?(d=1,e=this.totalPages):(d=this.options.pageNumber-2,e=d+4,1>d&&(d=1,e=5),e>this.totalPages&&(e=this.totalPages,d=e-4)),this.totalPages>=6&&(this.options.pageNumber>
692=3&&(m.push('<li class="page-first'+(1===this.options.pageNumber?" active":"")+'">','<a href="#">',1,"</a>","</li>"),d++),this.options.pageNumber>=4&&(4==this.options.pageNumber||6==this.totalPages||7==this.totalPages?d--:m.push('<li class="page-first-separator disabled">','<a href="#">...</a>',"</li>"),e--)),this.totalPages>=7&&this.options.pageNumber>=this.totalPages-2&&d--,6==this.totalPages?this.options.pageNumber>=this.totalPages-2&&e++:this.totalPages>=7&&(7==this.totalPages||this.options.pageNumber>=this.totalPages-3)&&e++,b=d;e>=b;b++)m.push('<li class="page-number'+(b===this.options.pageNumber?" active":"")+'">','<a href="#">',b,"</a>","</li>");this.totalPages>=8&&this.options.pageNumber<=this.totalPages-4&&m.push('<li class="page-last-separator disabled">','<a href="#">...</a>',"</li>"),this.totalPages>=6&&this.options.pageNumber<=this.totalPages-3&&m.push('<li class="page-last'+(this.totalPages===this.options.pageNumber?" active":"")+'">','<a href="#">',this.totalPages,"</a>","</li>"),m.push('<li class="page-next"><a href="#">'+this.options.paginationNextText+"</a></li>","</ul>","</div>")}this.$pagination.html(m.join("")),this.options.onlyInfoPagination||(f=this.$pagination.find(".page-list a"),g=this.$pagination.find(".page-first"),h=this.$pagination.find(".page-pre"),i=this.$pagination.find(".page-next"),j=this.$pagination.find(".page-last"),k=this.$pagination.find(".page-number"),this.options.smartDisplay&&(this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),(p.length<2||this.options.totalRows<=p[0])&&this.$pagination.find("span.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"]()),this.options.paginationLoop||(1===this.options.pageNumber&&h.addClass("disabled"),this.options.pageNumber===this.totalPages&&i.addClass("disabled")),n&&(this.options.pageSize=this.options.formatAllRows()),f.off("click").on("click",a.proxy(this.onPageListChange,this)),g.off("click").on("click",a.proxy(this.onPageFirst,this)),h.off("click").on("click",a.proxy(this.onPagePre,this)),i.off("click").on("click",a.proxy(this.onPageNext,this)),j.off("click").on("click",a.proxy(this.onPageLast,this)),k.off("click").on("click",a.proxy(this.onPageNumber,this)))},o.prototype.updatePagination=function(b){b&&a(b.currentTarget).hasClass("disabled")||(this.options.maintainSelected||this.resetRows(),this.initPagination(),"server"===this.options.sidePagination?this.initServer():this.initBody(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize))},o.prototype.onPageListChange=function(b){var c=a(b.currentTarget);return c.parent().addClass("active").siblings().removeClass("active"),this.options.pageSize=c.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+c.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(b),!1},o.prototype.onPageFirst=function(a){return this.options.pageNumber=1,this.updatePagination(a),!1},o.prototype.onPagePre=function(a){return this.options.pageNumber-1===0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(a),!1},o.prototype.onPageNext=function(a){return this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(a),!1},o.prototype.onPageLast=function(a){return this.options.pageNumber=this.totalPages,this.updatePagination(a),!1},o.prototype.onPageNumber=function(b){return this.options.pageNumber!==+a(b.currentTarget).text()?(this.options.pageNumber=+a(b.currentTarget).text(),this.updatePagination(b),!1):void 0},o.prototype.initRow=function(b,e){var f,g=this,i=[],k={},m=[],n="",o={},p=[];if(!(a.inArray(b,this.hiddenRows)>-1)){if(k=h(this.options,this.options.rowStyle,[b,e],k),k&&k.css)for(f in k.css)m.push(f+": "+k.css[f]);if(o=h(this.options,this.options.rowAttributes,[b,e],o))for(f in o)p.push(c('%s="%s"',f,j(o[f])));return b._data&&!a.isEmptyObject(b._data)&&a.each(b._data,function(a,b){"index"!==a&&(n+=c(' data-%s="%s"',a,b))}),i.push("<tr",c(" %s",p.join(" ")),c(' id="%s"',a.isArray(b)?void 0:b._id),c(' class="%s"',k.classes||(a.isArray(b)?void 0:b._class)),c(' data-index="%s"',e),c(' data-uniqueid="%s"',b[this.options.uniqueId]),c("%s",n),">"),this.options.cardView&&i.push(c('<td colspan="%s"><div class="card-views">',this.header.fields.length)),!this.options.cardView&&this.options.detailVie
692w&&i.push("<td>",'<a class="detail-icon" href="#">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.detailOpen),"</a>","</td>"),a.each(this.header.fields,function(f,n){var o="",p=l(b,n,g.options.escape),q="",r="",s={},t="",u=g.header.classes[f],v="",w="",x="",y="",z=g.columns[f];if(!(g.fromHtml&&"undefined"==typeof p||!z.visible||g.options.cardView&&!z.cardVisible)){if(z.escape&&(p=j(p)),k=c('style="%s"',m.concat(g.header.styles[f]).join("; ")),b["_"+n+"_id"]&&(t=c(' id="%s"',b["_"+n+"_id"])),b["_"+n+"_class"]&&(u=c(' class="%s"',b["_"+n+"_class"])),b["_"+n+"_rowspan"]&&(w=c(' rowspan="%s"',b["_"+n+"_rowspan"])),b["_"+n+"_colspan"]&&(x=c(' colspan="%s"',b["_"+n+"_colspan"])),b["_"+n+"_title"]&&(y=c(' title="%s"',b["_"+n+"_title"])),s=h(g.header,g.header.cellStyles[f],[p,b,e,n],s),s.classes&&(u=c(' class="%s"',s.classes)),s.css){var A=[];for(var B in s.css)A.push(B+": "+s.css[B]);k=c('style="%s"',A.concat(g.header.styles[f]).join("; "))}q=h(z,g.header.formatters[f],[p,b,e],p),b["_"+n+"_data"]&&!a.isEmptyObject(b["_"+n+"_data"])&&a.each(b["_"+n+"_data"],function(a,b){"index"!==a&&(v+=c(' data-%s="%s"',a,b))}),z.checkbox||z.radio?(r=z.checkbox?"checkbox":r,r=z.radio?"radio":r,o=[c(g.options.cardView?'<div class="card-view %s">':'<td class="bs-checkbox %s">',z["class"]||""),"<input"+c(' data-index="%s"',e)+c(' name="%s"',g.options.selectItemName)+c(' type="%s"',r)+c(' value="%s"',b[g.options.idField])+c(' checked="%s"',q===!0||p||q&&q.checked?"checked":void 0)+c(' disabled="%s"',!z.checkboxEnabled||q&&q.disabled?"disabled":void 0)+" />",g.header.formatters[f]&&"string"==typeof q?q:"",g.options.cardView?"</div>":"</td>"].join(""),b[g.header.stateField]=q===!0||q&&q.checked):(q="undefined"==typeof q||null===q?g.options.undefinedText:q,o=g.options.cardView?['<div class="card-view">',g.options.showHeader?c('<span class="title" %s>%s</span>',k,d(g.columns,"field","title",n)):"",c('<span class="value">%s</span>',q),"</div>"].join(""):[c("<td%s %s %s %s %s %s %s>",t,u,k,v,w,x,y),q,"</td>"].join(""),g.options.cardView&&g.options.smartDisplay&&""===q&&(o='<div class="card-view"></div>')),i.push(o)}}),this.options.cardView&&i.push("</div></td>"),i.push("</tr>"),i.join(" ")}},o.prototype.initBody=function(b){var d=this,f=this.getData();this.trigger("pre-body",f),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=a("<tbody></tbody>").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=f.length);for(var g,i=a(document.createDocumentFragment()),j=this.pageFrom-1;j<this.pageTo;j++){ 693var k=f[j],m=this.initRow(k,j,f,i);g=g||!!m,m&&m!==!0&&i.append(m)}g||i.append('<tr class="no-records-found">'+c('<td colspan="%s">%s</td>',this.$header.find("th").length,this.options.formatNoMatches())+"</tr>"),this.$body.html(i),b||this.scrollTo(0),this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(b){var f=a(this),g=f.parent(),h=d.data[g.data("index")],i=f[0].cellIndex,j=d.getVisibleFields(),k=j[d.options.detailView&&!d.options.cardView?i-1:i],m=d.columns[e(d.columns,k)],n=l(h,k,d.options.escape);if(!f.find(".detail-icon").length&&(d.trigger("click"===b.type?"click-cell":"dbl-click-cell",k,n,h,f),d.trigger("click"===b.type?"click-row":"dbl-click-row",h,g,k),"click"===b.type&&d.options.clickToSelect&&m.clickToSelect)){var o=g.find(c('[name="%s"]',d.options.selectItemName));o.length&&o[0].click()}}),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var b=a(this),e=b.parent().parent(),g=e.data("index"),i=f[g];if(e.next().is("tr.detail-view"))b.find("i").attr("class",c("%s %s",d.options.iconsPrefix,d.options.icons.detailOpen)),d.trigger("collapse-row",g,i),e.next().remove();else{b.find("i").attr("class",c("%s %s",d.options.iconsPrefix,d.options.icons.detailClose)),e.after(c('<tr class="detail-view"><td colspan="%s"></td></tr>',e.find("td").length));var j=e.next().find("td"),k=h(d.options,d.options.detailFormatter,[g,i,j],"");1===j.length&&j.append(k),d.trigger("expand-row",g,i,j)}return d.resetView(),!1}),this.$selectItem=this.$body.find(c('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",function(b){b.stopImmediatePropagation();var c=a(this),e=c.prop("checked"),f=d.data[c.data("index")];d.options.maintainSelected&&a(this).is(":radio")&&a.each(d.options.data,function(a,b){b[d.header.stateField]=!1}),f[d.header.stateField]=e,d.options.singleSelect&&(d.$selectItem.not(this).each(function(){d.data[a(this).data("index")][d.header.stateField]=!1}),d.$selectItem.filter(":checked").not(this).prop("checked",!1)),d.updateSelected(),d.trigger(e?"check":"uncheck",f,c)}),a.each(this.header.events,function(b,c){if(c){"string"==typeof c&&(c=h(null,c));var e=d.header.fields[b],f=a.inArray(e,d.getVisibleFields());
693d.options.detailView&&!d.options.cardView&&(f+=1);for(var g in c)d.$body.find(">tr:not(.no-records-found)").each(function(){var b=a(this),h=b.find(d.options.cardView?".card-view":"td").eq(f),i=g.indexOf(" "),j=g.substring(0,i),k=g.substring(i+1),l=c[g];h.find(k).off(j).on(j,function(a){var c=b.data("index"),f=d.data[c],g=f[e];l.apply(this,[a,g,f,c])})})}}),this.updateSelected(),this.resetView(),this.trigger("post-body",f)},o.prototype.initServer=function(b,c,d){var e,f=this,g={},i={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};this.options.pagination&&(i.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,i.pageNumber=this.options.pageNumber),(d||this.options.url||this.options.ajax)&&("limit"===this.options.queryParamsType&&(i={search:i.searchText,sort:i.sortName,order:i.sortOrder},this.options.pagination&&(i.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),i.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize)),a.isEmptyObject(this.filterColumnsPartial)||(i.filter=JSON.stringify(this.filterColumnsPartial,null)),g=h(this.options,this.options.queryParams,[i],g),a.extend(g,c||{}),g!==!1&&(b||this.$tableLoading.show(),e=a.extend({},h(null,this.options.ajaxOptions),{type:this.options.method,url:d||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(g):g,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(a){a=h(f.options,f.options.responseHandler,[a],a),f.load(a),f.trigger("load-success",a),b||f.$tableLoading.hide()},error:function(a){f.trigger("load-error",a.status,a),b||f.$tableLoading.hide()}}),this.options.ajax?h(this,this.options.ajax,[e],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=a.ajax(e))))},o.prototype.initSearchText=function(){if(this.options.search&&""!==this.options.searchText){var a=this.$toolbar.find(".search input");a.val(this.options.searchText),this.onSearch({currentTarget:a})}},o.prototype.getCaret=function(){var b=this;a.each(this.$header.find("th"),function(c,d){a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field")===b.options.sortName?b.options.sortOrder:"both")})},o.prototype.updateSelected=function(){var b=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",b),this.$selectItem.each(function(){a(this).closest("tr")[a(this).prop("checked")?"addClass":"removeClass"]("selected")})},o.prototype.updateRows=function(){var b=this;this.$selectItem.each(function(){b.data[a(this).data("index")][b.header.stateField]=a(this).prop("checked")})},o.prototype.resetRows=function(){var b=this;a.each(this.data,function(a,c){b.$selectAll.prop("checked",!1),b.$selectItem.prop("checked",!1),b.header.stateField&&(c[b.header.stateField]=!1)}),this.initHiddenRows()},o.prototype.trigger=function(b){var c=Array.prototype.slice.call(arguments,1);b+=".bs.table",this.options[o.EVENTS[b]].apply(this.options,c),this.$el.trigger(a.Event(b),c),this.options.onAll(b,c),this.$el.trigger(a.Event("all.bs.table"),[b,c])},o.prototype.resetHeader=function(){clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(a.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)},o.prototype.fitHeader=function(){var b,d,e,f,h=this;if(h.$el.is(":hidden"))return void(h.timeoutId_=setTimeout(a.proxy(h.fitHeader,h),100));if(b=this.$tableBody.get(0),d=b.scrollWidth>b.clientWidth&&b.scrollHeight>b.clientHeight+this.$header.outerHeight()?g():0,this.$el.css("margin-top",-this.$header.outerHeight()),e=a(":focus"),e.length>0){var i=e.parents("th");if(i.length>0){var j=i.attr("data-field");if(void 0!==j){var k=this.$header.find("[data-field='"+j+"']");k.length>0&&k.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css({"margin-right":d}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),f=a(".focus-temp:visible:eq(0)"),f.length>0&&(f.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(){h.$header_.find(c('th[data-field="%s"]',a(this).data("field"))).data(a(this).data())});var l=this.getVisibleFields(),m=this.$header_.find("th");this.$body.find(">
693tr:first-child:not(.no-records-found) > *").each(function(b){var d=a(this),e=b;h.options.detailView&&!h.options.cardView&&(0===b&&h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()),e=b-1);var f=h.$header_.find(c('th[data-field="%s"]',l[e]));f.length>1&&(f=a(m[d[0].cellIndex])),f.find(".fht-cell").width(d.innerWidth())}),this.$tableBody.off("scroll").on("scroll",function(){h.$tableHeader.scrollLeft(a(this).scrollLeft()),h.options.showFooter&&!h.options.cardView&&h.$tableFooter.scrollLeft(a(this).scrollLeft())}),h.trigger("post-header")},o.prototype.resetFooter=function(){var b=this,d=b.getData(),e=[];this.options.showFooter&&!this.options.cardView&&(!this.options.cardView&&this.options.detailView&&e.push('<td><div class="th-inner"> </div><div class="fht-cell"></div></td>'),a.each(this.columns,function(a,f){var g,i="",j="",k=[],l={},m=c(' class="%s"',f["class"]);if(f.visible&&(!b.options.cardView||f.cardVisible)){if(i=c("text-align: %s; ",f.falign?f.falign:f.align),j=c("vertical-align: %s; ",f.valign),l=h(null,b.options.footerStyle),l&&l.css)for(g in l.css)k.push(g+": "+l.css[g]);e.push("<td",m,c(' style="%s"',i+j+k.concat().join("; ")),">"),e.push('<div class="th-inner">'),e.push(h(f,f.footerFormatter,[d]," ")||" "),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</td>")}}),this.$tableFooter.find("tr").html(e.join("")),this.$tableFooter.show(),clearTimeout(this.timeoutFooter_),this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0))},o.prototype.fitFooter=function(){var b,c,d;return clearTimeout(this.timeoutFooter_),this.$el.is(":hidden")?void(this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),100)):(c=this.$el.css("width"),d=c>this.$tableBody.width()?g():0,this.$tableFooter.css({"margin-right":d}).find("table").css("width",c).attr("class",this.$el.attr("class")),b=this.$tableFooter.find("td"),void this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(c){var d=a(this);b.eq(c).find(".fht-cell").width(d.innerWidth())}))},o.prototype.toggleColumn=function(a,b,d){if(-1!==a&&(this.columns[a].visible=b,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var e=this.$toolbar.find(".keep-open input").prop("disabled",!1);d&&e.filter(c('[value="%s"]',a)).prop("checked",b),e.filter(":checked").length<=this.options.minimumCountColumns&&e.filter(":checked").prop("disabled",!0)}},o.prototype.getVisibleFields=function(){var b=this,c=[];return a.each(this.header.fields,function(a,d){var f=b.columns[e(b.columns,d)];f.visible&&c.push(d)}),c},o.prototype.resetView=function(a){var b=0;if(a&&a.height&&(this.options.height=a.height),this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length),this.options.height){var c=this.$toolbar.outerHeight(!0),d=this.$pagination.outerHeight(!0),e=this.options.height-c-d;this.$tableContainer.css("height",e+"px")}return this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),void this.$tableFooter.hide()):(this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),b+=this.$header.outerHeight()):(this.$tableHeader.hide(),this.trigger("post-header")),this.options.showFooter&&(this.resetFooter(),this.options.height&&(b+=this.$tableFooter.outerHeight()+1)),this.getCaret(),this.$tableContainer.css("padding-bottom",b+"px"),void this.trigger("reset-view"))},o.prototype.getData=function(b){return!this.searchText&&a.isEmptyObject(this.filterColumns)&&a.isEmptyObject(this.filterColumnsPartial)?b?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data:b?this.data.slice(this.pageFrom-1,this.pageTo):this.data},o.prototype.load=function(b){var c=!1;"server"===this.options.sidePagination?(this.options.totalRows=b[this.options.totalField],c=b.fixedScroll,b=b[this.options.dataField]):a.isArray(b)||(c=b.fixedScroll,b=b.data),this.initData(b),this.initSearch(),this.initPagination(),this.initBody(c)},o.prototype.append=function(a){this.initData(a,"append"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},o.prototype.prepend=function(a){this.initData(a,"prepend"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},o.prototype.remove=function(b){var c,d,e=this.options.data.length;if(b.hasOwnProperty("field")&&b.hasOwnProperty("values")){for(c=e-1;c>=0;c--)d=this.options.data[c],d.hasOwnProperty(b.field)&&-1!==a.inArray(d[b.field],b.values)&&(this.options.data.splice(c,1),"server"===this.options.sidePagination&&(this.options.totalRows-=1));e!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},o.prototype.removeAll=function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))},o.prototype.getRowByUniqueId=function(a){var b,c,d,e=this.options.uniqueId,f=this.options.data.length,g=null;for(b=f-1;b>=0;b--){if(c=this.options.data[b],c.hasOwnProperty(e))d=c[e];else{if(!c._data.hasOwnProperty(e))continue;d=c._data[e]}if("string"==typeof d?a=a.toString():"number"==typeof d&&(Number(d)===d&&d%1===0?a=
693parseInt(a):d===Number(d)&&0!==d&&(a=parseFloat(a))),d===a){g=c;break}}return g},o.prototype.removeByUniqueId=function(a){var b=this.options.data.length,c=this.getRowByUniqueId(a);c&&this.options.data.splice(this.options.data.indexOf(c),1),b!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initBody(!0))},o.prototype.updateByUniqueId=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){var e;d.hasOwnProperty("id")&&d.hasOwnProperty("row")&&(e=a.inArray(c.getRowByUniqueId(d.id),c.options.data),-1!==e&&a.extend(c.options.data[e],d.row))}),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},o.prototype.insertRow=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("row")&&(this.data.splice(a.index,0,a.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))},o.prototype.updateRow=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){d.hasOwnProperty("index")&&d.hasOwnProperty("row")&&a.extend(c.options.data[d.index],d.row)}),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},o.prototype.initHiddenRows=function(){this.hiddenRows=[]},o.prototype.showRow=function(a){this.toggleRow(a,!0)},o.prototype.hideRow=function(a){this.toggleRow(a,!1)},o.prototype.toggleRow=function(b,c){var d,e;b.hasOwnProperty("index")?d=this.getData()[b.index]:b.hasOwnProperty("uniqueId")&&(d=this.getRowByUniqueId(b.uniqueId)),d&&(e=a.inArray(d,this.hiddenRows),c||-1!==e?c&&e>-1&&this.hiddenRows.splice(e,1):this.hiddenRows.push(d),this.initBody(!0))},o.prototype.getHiddenRows=function(){var b=this,c=this.getData(),d=[];return a.each(c,function(c,e){a.inArray(e,b.hiddenRows)>-1&&d.push(e)}),this.hiddenRows=d,d},o.prototype.mergeCells=function(b){var c,d,e,f=b.index,g=a.inArray(b.field,this.getVisibleFields()),h=b.rowspan||1,i=b.colspan||1,j=this.$body.find(">tr");if(this.options.detailView&&!this.options.cardView&&(g+=1),e=j.eq(f).find(">td").eq(g),!(0>f||0>g||f>=this.data.length)){for(c=f;f+h>c;c++)for(d=g;g+i>d;d++)j.eq(c).find(">td").eq(d).hide();e.attr("rowspan",h).attr("colspan",i).show()}},o.prototype.updateCell=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("field")&&a.hasOwnProperty("value")&&(this.data[a.index][a.field]=a.value,a.reinit!==!1&&(this.initSort(),this.initBody(!0)))},o.prototype.getOptions=function(){return this.options},o.prototype.getSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]===!0})},o.prototype.getAllSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},o.prototype.checkAll=function(){this.checkAll_(!0)},o.prototype.uncheckAll=function(){this.checkAll_(!1)},o.prototype.checkInvert=function(){var b=this,c=b.$selectItem.filter(":enabled"),d=c.filter(":checked");c.each(function(){a(this).prop("checked",!a(this).prop("checked"))}),b.updateRows(),b.updateSelected(),b.trigger("uncheck-some",d),d=b.getSelections(),b.trigger("check-some",d)},o.prototype.checkAll_=function(a){var b;a||(b=this.getSelections()),this.$selectAll.add(this.$selectAll_).prop("checked",a),this.$selectItem.filter(":enabled").prop("checked",a),this.updateRows(),a&&(b=this.getSelections()),this.trigger(a?"check-all":"uncheck-all",b)},o.prototype.check=function(a){this.check_(!0,a)},o.prototype.uncheck=function(a){this.check_(!1,a)},o.prototype.check_=function(a,b){var d=this.$selectItem.filter(c('[data-index="%s"]',b)).prop("checked",a);this.data[b][this.header.stateField]=a,this.updateSelected(),this.trigger(a?"check":"uncheck",this.data[b],d)},o.prototype.checkBy=function(a){this.checkBy_(!0,a)},o.prototype.uncheckBy=function(a){this.checkBy_(!1,a)},o.prototype.checkBy_=function(b,d){if(d.hasOwnProperty("field")&&d.hasOwnProperty("values")){var e=this,f=[];a.each(this.options.data,function(g,h){if(!h.hasOwnProperty(d.field))return!1;if(-1!==a.inArray(h[d.field],d.values)){var i=e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]',g)).prop("checked",b);h[e.header.stateField]=b,f.push(h),e.trigger(b?"check":"uncheck",h,i)}}),this.updateSelected(),this.trigger(b?"check-some":"uncheck-some",f)}},o.prototype.destroy=function(){this.$el.insertBefore(this.$container),a(this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")},o.prototype.showLoading=function(){this.$tableLoading.show()},o.prototype.hideLoading=function(){this.$tableLoading.hide()},o.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var a=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown):a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp),this.updatePagination()},o.prototype.refresh=function(a){a&&a.url&&(this.options.url=a.url),a&&a.pageNumber&&(this.options.pageNumber=a.pageNumber),a&&a.pageSize&&(this.options.pageSize=a.pageSize),this.initServer(a&&a.silent,a&&a.query,a&&a.url),this.trigger("refresh",a)},o.prototype.resetWidth=function(){this.options.showHeader&&this.options.height&&this.fitHeader(),this.options.showFooter&&this.fitFooter()},o.prototype.showColumn=function(a){this.toggleColumn(e(this.columns,a),!0,!0)},o.prototype.hideColumn=function(a){this.toggleColumn(e(this.columns,a),!1,!0)},o.prototype.getHiddenColumns=function(){return a.grep(this.columns,function(a){return!a.visible})},o.prototype.getVisibleColumns=function(){return a.grep(this.columns,function(a){return a.visible})},o.prototype.toggleAllColumns=function(b){if(a.each(this.columns,function(a){this.columns[a].visible=b}),this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var c=this.$toolbar.find(".keep-open input").prop("disabled",!1);c.filter(":checked").length<=this.options.minimumCountColumns&&c.filter(":checked").prop("disabled",!0)}},o.prototype.showAllColumns=function(){this.toggleAllColumns(!0)},o.prototype.hideAllColumns=function(){this.toggleAllColumns(!1)},o.prototype.filterBy=function(b){this.filterColumns=a.isEmptyObject(b)?{}:b,this.options.pageNumber=1,this.initSearch(),this.updatePagination()},o.prototype.scrollTo=function(a){return"string"==typeof a&&(a="bottom"===a?this.$tableBody[0].scrollHeight:0),"number"==typeof a&&this.$tableBody.scrollTop(a),"undefined"==typeof a?this.$tableBody.scrollTop():void 0},o.prototype.getScrollPosition=function(){return this.scrollTo()},o.prototype.selectPage=function(a){a>0&&a<=this.options.totalPages&&(this.options.pageNumber=a,this.updatePagination())},o.prototype.prevPage=function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())},o.prototype.nextPage=function(){this.options.pageNumber<this.options.totalPages&&(this.options.pageNumber++,this.updatePagination())},o.prototype.toggleView=function(){this.options.cardView=!this.options.cardView,this.initHeader(),this.initBody(),this.trigger("toggle",this.options.cardView)},o.prototype.refreshOptions=function(b){i(this.options,b,!0)||(this.options=a.extend(this.options,b),this.trigger("refresh-options",this.options),this.destroy(),this.init())},o.prototype.resetSearch=function(a){var b=this.$toolbar.find(".search input");b.val(a||""),this.onSearch({currentTarget:b})},o.prototype.expandRow_=function(a,b){var d=this.$body.find(c('> tr[data-index="%s"]',b));d.next().is("tr.detail-view")===(a?!1:!0)&&d.find("> td > .detail-icon").click()},o.prototype.expandRow=function(a){this.expandRow_(!0,a)},o.prototype.collapseRow=function(a){this.expandRow_(!1,a)},o.prototype.expandAllRows=function(b){if(b){var d=this.$body.find(c('> tr[data-index="%s"]',0)),e=this,f=null,g=!1,h=-1;if(d.next().is("tr.detail-view")?d.next().next().is("tr.detail-view")||(d.next().find(".detail-icon").click(),g=!0):(d.find("> td > .detail-icon").click(),g=!0),g)try{h=setInterval(function(){f=e.$body.find("tr.detail-view").last().find(".detail-icon"),f.length>0?f.click():clearInterval(h)},1)}catch(i){clearInterval(h)}}else for(var j=this.$body.children(),k=0;k<j.length;k++)this.expandRow_(!0,a(j[k]).data("index"))},o.prototype.collapseAllRows=function(b){if(b)this.expandRow_(!1,0);else for(var c=this.$body.children(),d=0;d<c.length;d++)this.expandRow_(!1,a(c[d]).data("index"))},o.prototype.updateFormatText=function(a,b){this.options[c("format%s",a)]&&("string"==typeof b?this.options[c("format%s",a)]=function(){return b}:"function"==typeof b&&(this.options[c("format%s",a)]=b)),this.initToolbar(),this.initPagination(),this.initBody()};var p=["getOptions","getSelections","getAllSelections","getData","load","append","prepe
vendor: 162,149 bytes, lines 693-6326
693nd","remove","removeAll","insertRow","updateRow","updateCell","updateByUniqueId","removeByUniqueId","getRowByUniqueId","showRow","hideRow","getHiddenRows","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","resetView","resetWidth","destroy","showLoading","hideLoading","showColumn","hideColumn","getHiddenColumns","getVisibleColumns","showAllColumns","hideAllColumns","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","togglePagination","toggleView","refreshOptions","resetSearch","expandRow","collapseRow","expandAllRows","collapseAllRows","updateFormatText"];a.fn.bootstrapTable=function(b){var c,d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("bootstrap.table"),g=a.extend({},o.DEFAULTS,e.data(),"object"==typeof b&&b);if("string"==typeof b){if(a.inArray(b,p)<0)throw new Error("Unknown method: "+b);if(!f)return;c=f[b].apply(f,d),"destroy"===b&&e.removeData("bootstrap.table")}f||e.data("bootstrap.table",f=new o(this,g))}),"undefined"==typeof c?this:c},a.fn.bootstrapTable.Constructor=o,a.fn.bootstrapTable.defaults=o.DEFAULTS,a.fn.bootstrapTable.columnDefaults=o.COLUMN_DEFAULTS,a.fn.bootstrapTable.locales=o.LOCALES,a.fn.bootstrapTable.methods=p,a.fn.bootstrapTable.utils={sprintf:c,getFieldIndex:e,compareObjects:i,calculateObjectValue:h,getItemField:l,objectKeys:n,isIEBrowser:m},a(function(){a('[data-toggle="table"]').bootstrapTable()})}(jQuery); 694 695// ================================================== 696// fancyBox v3.5.7 697// 698// Licensed GPLv3 for open source use 699// or fancyBox Commercial License for commercial use 700// 701// http://fancyapps.com/fancybox/ 702// Copyright 2019 fancyApps 703// 704// ================================================== 705(function (window, document, $, undefined) { 706 "use strict"; 707 708 window.console = window.console || { 709 info: function (stuff) {} 710 }; 711 712 // If there's no jQuery, fancyBox can't work 713 // ========================================= 714 715 if (!$) { 716 return; 717 } 718 719 // Check if fancyBox is already initialized 720 // ======================================== 721 722 if ($.fn.fancybox) { 723 console.info("fancyBox already initialized"); 724 725 return; 726 } 727 728 // Private default settings 729 // ======================== 730 731 var defaults = { 732 // Close existing modals 733 // Set this to false if you do not need to stack multiple instances 734 closeExisting: false, 735 736 // Enable infinite gallery navigation 737 loop: false, 738 739 // Horizontal space between slides 740 gutter: 50, 741 742 // Enable keyboard navigation 743 keyboard: true, 744 745 // Should allow caption to overlap the content 746 preventCaptionOverlap: true, 747 748 // Should display navigation arrows at the screen edges 749 arrows: true, 750 751 // Should display counter at the top left corner 752 infobar: true, 753 754 // Should display close button (using `btnTpl.smallBtn` template) over the content 755 // Can be true, false, "auto" 756 // If "auto" - will be automatically enabled for "html", "inline" or "ajax" items 757 smallBtn: "auto", 758 759 // Should display toolbar (buttons at the top) 760 // Can be true, false, "auto" 761 // If "auto" - will be automatically hidden if "smallBtn" is enabled 762 toolbar: "auto", 763 764 // What buttons should appear in the top right corner. 765 // Buttons will be created using templates from `btnTpl` option 766 // and they will be placed into toolbar (class="fancybox-toolbar"` element) 767 buttons: [ 768 "zoom", 769 //"share", 770 "slideShow", 771 //"fullScreen", 772 //"download", 773 "thumbs", 774 "close" 775 ], 776 777 // Detect "idle" time in seconds 778 idleTime: 3, 779 780 // Disable right-click and use simple image protection for images 781 protect: false, 782 783 // Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc 784 modal: false, 785 786 image: { 787 // Wait for images to load before displaying 788 // true - wait for image to load and then display; 789 // false - display thumbnail and load the full-sized image over top, 790 // requires predefined image dimensions (`data-width` and `data-height` attributes) 791 preload: false 792 }, 793 794 ajax: { 795 // Object containing settings for ajax request 796 settings: { 797 // This helps to indicate that request comes from the modal 798 // Feel free to change naming 799 data: { 800 fancybox: true 801 } 802 } 803 }, 804 805 iframe: { 806 // Iframe template 807 tpl: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>', 808 809 // Preload iframe before displaying it 810 // This allows to calculate iframe content width and height 811 // (note: Due to "Same Origin Policy", you can't get cross domain data). 812 preload: true, 813 814 // Custom CSS styling for iframe wrapping element 815 // You can use this to set custom iframe dimensions 816 css: {}, 817 818 // Iframe tag attributes 819 attr: { 820 scrolling: "auto" 821 } 822 }, 823 824 // For HTML5 video only 825 video: { 826 tpl: '<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}">' + 827 '<source src="{{src}}" type="{{format}}" />' + 828 'Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!' + 829 "</video>", 830 format: "", // custom video format 831 autoStart: true 832 }, 833 834 // Default content type if cannot be detected automatically 835 defaultType: "image", 836 837 // Open/close animation type 838 // Possible values: 839 // false - disable 840 // "zoom" - zoom images from/to thumbnail 841 // "fade" 842 // "zoom-in-out" 843 // 844 animationEffect: "zoom", 845 846 // Duration in ms for open/close animation 847 animationDuration: 366, 848 849 // Should image change opacity while zooming 850 // If opacity is "auto", then opacity will be changed if image and thumbnail have different aspect ratios 851 zoomOpacity: "auto", 852 853 // Transition effect between slides 854 // 855 // Possible values: 856 // false - disable 857 // "fade' 858 // "slide' 859 // "circular' 860 // "tube' 861 // "zoom-in-out' 862 // "rotate' 863 // 864 transitionEffect: "fade", 865 866 // Duration in ms for transition animation 867 transitionDuration: 366, 868 869 // Custom CSS class for slide element 870 slideClass: "", 871 872 // Custom CSS class for layout 873 baseClass: "", 874 875 // Base template for layout 876 baseTpl: '<div class="fancybox-container" role="dialog" tabindex="-1">' + 877 '<div class="fancybox-bg"></div>' + 878 '<div class="fancybox-inner">' + 879 '<div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div>' + 880 '<div class="fancybox-toolbar">{{buttons}}</div>' + 881 '<div class="fancybox-navigation">{{arrows}}</div>' + 882 '<div class="fancybox-stage"></div>' + 883 '<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' + 884 "</div>" + 885 "</div>", 886 887 // Loading indicator template 888 spinnerTpl: '<div class="fancybox-loading"></div>', 889 890 // Error message template 891 errorTpl: '<div class="fancybox-error"><p>{{ERROR}}</p></div>', 892 893 btnTpl: { 894 download: '<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;">' + 895 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg>' + 896 "</a>", 897 898 zoom: '<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}">' + 899 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg>' + 900 "</button>", 901 902 close: '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' + 903 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg>' + 904 "</button>", 905 906 // Arrows 907 arrowLeft: '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 908 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div>' + 909 "</button>", 910 911 arrowRight: '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 912 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div>' + 913 "</button>", 914 915 // This small close button will be appended to your html/inline/ajax content by default, 916 // if "smallBtn" option is not set to false 917 smallBtn: '<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}">' + 918 '<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg>' + 919 "</button>" 920 }, 921 922 // Container is injected into this element 923 parentEl: "body", 924 925 // Hide browser vertical scrollbars; use at your own risk 926 hideScrollbar: true, 927 928 // Focus handling 929 // ============== 930 931 // Try to focus on the first focusable element after opening 932 autoFocus: true, 933 934 // Put focus back to active element after closing 935 backFocus: true, 936 937 // Do not let user to focus on element outside modal content 938 trapFocus: true, 939 940 // Module specific options 941 // ======================= 942 943 fullScreen: { 944 autoStart: false 945 }, 946 947 // Set `touch: false` to disable panning/swiping 948 touch: { 949 vertical: true, // Allow to drag content vertically 950 momentum: true // Continue movement after releasing mouse/touch when panning 951 }, 952 953 // Hash value when initializing manually, 954 // set `false` to disable hash change 955 hash: null, 956 957 // Customize or add new media types 958 // Example: 959 /* 960 media : { 961 youtube : { 962 params : { 963 autoplay : 0 964 } 965 } 966 } 967 */ 968 media: {}, 969 970 slideShow: { 971 autoStart: false, 972 speed: 3000 973 }, 974 975 thumbs: { 976 autoStart: false, // Display thumbnails on opening 977 hideOnClose: true, // Hide thumbnail grid when closing animation starts 978 parentEl: ".fancybox-container", // Container is injected into this element 979 axis: "y" // Vertical (y) or horizontal (x) scrolling 980 }, 981 982 // Use mousewheel to navigate gallery 983 // If 'auto' - enabled for images only 984 wheel: "auto", 985 986 // Callbacks 987 //========== 988 989 // See Documentation/API/Events for more information 990 // Example: 991 /* 992 afterShow: function( instance, current ) { 993 console.info( 'Clicked element:' ); 994 console.info( current.opts.$orig ); 995 } 996 */ 997 998 onInit: $.noop, // When instance has been initialized 999 1000 beforeLoad: $.noop, // Before the content of a slide is being loaded 1001 afterLoad: $.noop, // When the content of a slide is done loading 1002 1003 beforeShow: $.noop, // Before open animation starts 1004 afterShow: $.noop, // When content is done loading and animating 1005 1006 beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close. 1007 afterClose: $.noop, // After instance has been closed 1008 1009 onActivate: $.noop, // When instance is brought to front 1010 onDeactivate: $.noop, // When other instance has been activated 1011 1012 // Interaction 1013 // =========== 1014 1015 // Use options below to customize taken action when user clicks or double clicks on the fancyBox area, 1016 // each option can be string or method that returns value. 1017 // 1018 // Possible values: 1019 // "close" - close instance 1020 // "next" - move to next gallery item 1021 // "nextOrClose" - move to next gallery item or close if gallery has only one item 1022 // "toggleControls" - show/hide controls 1023 // "zoom" - zoom image (if loaded) 1024 // false - do nothing 1025 1026 // Clicked on the content 1027 clickContent: function (current, event) { 1028 return current.type === "image" ? "zoom" : false; 1029 }, 1030 1031 // Clicked on the slide 1032 clickSlide: "close", 1033 1034 // Clicked on the background (backdrop) element; 1035 // if you have not changed the layout, then most likely you need to use `clickSlide` option 1036 clickOutside: "close", 1037 1038 // Same as previous two, but for double click 1039 dblclickContent: false, 1040 dblclickSlide: false, 1041 dblclickOutside: false, 1042 1043 // Custom options when mobile device is detected 1044 // ============================================= 1045 1046 mobile: { 1047 preventCaptionOverlap: false, 1048 idleTime: false, 1049 clickContent: function (current, event) { 1050 return current.type === "image" ? "toggleControls" : false; 1051 }, 1052 clickSlide: function (current, event) { 1053 return current.type === "image" ? "toggleControls" : "close"; 1054 }, 1055 dblclickContent: function (current, event) { 1056 return current.type === "image" ? "zoom" : false; 1057 }, 1058 dblclickSlide: function (current, event) { 1059 return current.type === "image" ? "zoom" : false; 1060 } 1061 }, 1062 1063 // Internationalization 1064 // ==================== 1065 1066 lang: "en", 1067 i18n: { 1068 en: { 1069 CLOSE: "Close", 1070 NEXT: "Next", 1071 PREV: "Previous", 1072 ERROR: "The requested content cannot be loaded. <br/> Please try again later.", 1073 PLAY_START: "Start slideshow", 1074 PLAY_STOP: "Pause slideshow", 1075 FULL_SCREEN: "Full screen", 1076 THUMBS: "Thumbnails", 1077 DOWNLOAD: "Download", 1078 SHARE: "Share", 1079 ZOOM: "Zoom" 1080 }, 1081 de: { 1082 CLOSE: "Schließen", 1083 NEXT: "Weiter", 1084 PREV: "Zurück", 1085 ERROR: "Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.", 1086 PLAY_START: "Diaschau starten", 1087 PLAY_STOP: "Diaschau beenden", 1088 FULL_SCREEN: "Vollbild", 1089 THUMBS: "Vorschaubilder", 1090 DOWNLOAD: "Herunterladen", 1091 SHARE: "Teilen", 1092 ZOOM: "Vergrößern" 1093 } 1094 } 1095 }; 1096 1097 // Few useful variables and methods 1098 // ================================ 1099 1100 var $W = $(window); 1101 var $D = $(document); 1102 1103 var called = 0; 1104 1105 // Check if an object is a jQuery object and not a native JavaScript object 1106 // ======================================================================== 1107 var isQuery = function (obj) { 1108 return obj && obj.hasOwnProperty && obj instanceof $; 1109 }; 1110 1111 // Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame" 1112 // =============================================================================== 1113 var requestAFrame = (function () { 1114 return ( 1115 window.requestAnimationFrame || 1116 window.webkitRequestAnimationFrame || 1117 window.mozRequestAnimationFrame || 1118 window.oRequestAnimationFrame || 1119 // if all else fails, use setTimeout 1120 function (callback) { 1121 return window.setTimeout(callback, 1000 / 60); 1122 } 1123 ); 1124 })(); 1125 1126 var cancelAFrame = (function () { 1127 return ( 1128 window.cancelAnimationFrame || 1129 window.webkitCancelAnimationFrame || 1130 window.mozCancelAnimationFrame || 1131 window.oCancelAnimationFrame || 1132 function (id) { 1133 window.clearTimeout(id); 1134 } 1135 ); 1136 })(); 1137 1138 // Detect the supported transition-end event property name 1139 // ======================================================= 1140 var transitionEnd = (function () { 1141 var el = document.createElement("fakeelement"), 1142 t; 1143 1144 var transitions = { 1145 transition: "transitionend", 1146 OTransition: "oTransitionEnd", 1147 MozTransition: "transitionend", 1148 WebkitTransition: "webkitTransitionEnd" 1149 }; 1150 1151 for (t in transitions) { 1152 if (el.style[t] !== undefined) { 1153 return transitions[t]; 1154 } 1155 } 1156 1157 return "transitionend"; 1158 })(); 1159 1160 // Force redraw on an element. 1161 // This helps in cases where the browser doesn't redraw an updated element properly 1162 // ================================================================================ 1163 var forceRedraw = function ($el) { 1164 return $el && $el.length && $el[0].offsetHeight; 1165 }; 1166 1167 // Exclude array (`buttons`) options from deep merging 1168 // =================================================== 1169 var mergeOpts = function (opts1, opts2) { 1170 var rez = $.extend(true, {}, opts1, opts2); 1171 1172 $.each(opts2, function (key, value) { 1173 if ($.isArray(value)) { 1174 rez[key] = value; 1175 } 1176 }); 1177 1178 return rez; 1179 }; 1180 1181 // How much of an element is visible in viewport 1182 // ============================================= 1183 1184 var inViewport = function (elem) { 1185 var elemCenter, rez; 1186 1187 if (!elem || elem.ownerDocument !== document) { 1188 return false; 1189 } 1190 1191 $(".fancybox-container").css("pointer-events", "none"); 1192 1193 elemCenter = { 1194 x: elem.getBoundingClientRect().left + elem.offsetWidth / 2, 1195 y: elem.getBoundingClientRect().top + elem.offsetHeight / 2 1196 }; 1197 1198 rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem; 1199 1200 $(".fancybox-container").css("pointer-events", ""); 1201 1202 return rez; 1203 }; 1204 1205 // Class definition 1206 // ================ 1207 1208 var FancyBox = function (content, opts, index) { 1209 var self = this; 1210 1211 self.opts = mergeOpts({ 1212 index: index 1213 }, $.fancybox.defaults); 1214 1215 if ($.isPlainObject(opts)) { 1216 self.opts = mergeOpts(self.opts, opts); 1217 } 1218 1219 if ($.fancybox.isMobile) { 1220 self.opts = mergeOpts(self.opts, self.opts.mobile); 1221 } 1222 1223 self.id = self.opts.id || ++called; 1224 1225 self.currIndex = parseInt(self.opts.index, 10) || 0; 1226 self.prevIndex = null; 1227 1228 self.prevPos = null; 1229 self.currPos = 0; 1230 1231 self.firstRun = true; 1232 1233 // All group items 1234 self.group = []; 1235 1236 // Existing slides (for current, next and previous gallery items) 1237 self.slides = {}; 1238 1239 // Create group elements 1240 self.addContent(content); 1241 1242 if (!self.group.length) { 1243 return; 1244 } 1245 1246 self.init(); 1247 }; 1248 1249 $.extend(FancyBox.prototype, { 1250 // Create DOM structure 1251 // ==================== 1252 1253 init: function () { 1254 var self = this, 1255 firstItem = self.group[self.currIndex], 1256 firstItemOpts = firstItem.opts, 1257 $container, 1258 buttonStr; 1259 1260 if (firstItemOpts.closeExisting) { 1261 $.fancybox.close(true); 1262 } 1263 1264 // Hide scrollbars 1265 // =============== 1266 1267 $("body").addClass("fancybox-active"); 1268 1269 if ( 1270 !$.fancybox.getInstance() && 1271 firstItemOpts.hideScrollbar !== false && 1272 !$.fancybox.isMobile && 1273 document.body.scrollHeight > window.innerHeight 1274 ) { 1275 $("head").append( 1276 '<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:' + 1277 (window.innerWidth - document.documentElement.clientWidth) + 1278 "px;}</style>" 1279 ); 1280 1281 $("body").addClass("compensate-for-scrollbar"); 1282 } 1283 1284 // Build html markup and set references 1285 // ==================================== 1286 1287 // Build html code for buttons and insert into main template 1288 buttonStr = ""; 1289 1290 $.each(firstItemOpts.buttons, function (index, value) { 1291 buttonStr += firstItemOpts.btnTpl[value] || ""; 1292 }); 1293 1294 // Create markup from base template, it will be initially hidden to 1295 // avoid unnecessary work like painting while initializing is not complete 1296 $container = $( 1297 self.translate( 1298 self, 1299 firstItemOpts.baseTpl 1300 .replace("{{buttons}}", buttonStr) 1301 .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight) 1302 ) 1303 ) 1304 .attr("id", "fancybox-container-" + self.id) 1305 .addClass(firstItemOpts.baseClass) 1306 .data("FancyBox", self) 1307 .appendTo(firstItemOpts.parentEl); 1308 1309 // Create object holding references to jQuery wrapped nodes 1310 self.$refs = { 1311 container: $container 1312 }; 1313 1314 ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function (item) { 1315 self.$refs[item] = $container.find(".fancybox-" + item); 1316 }); 1317 1318 self.trigger("onInit"); 1319 1320 // Enable events, deactive previous instances 1321 self.activate(); 1322 1323 // Build slides, load and reveal content 1324 self.jumpTo(self.currIndex); 1325 }, 1326 1327 // Simple i18n support - replaces object keys found in template 1328 // with corresponding values 1329 // ============================================================ 1330 1331 translate: function (obj, str) { 1332 var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en; 1333 1334 return str.replace(/\{\{(\w+)\}\}/g, function (match, n) { 1335 return arr[n] === undefined ? match : arr[n]; 1336 }); 1337 }, 1338 1339 // Populate current group with fresh content 1340 // Check if each object has valid type and content 1341 // =============================================== 1342 1343 addContent: function (content) { 1344 var self = this, 1345 items = $.makeArray(content), 1346 thumbs; 1347 1348 $.each(items, function (i, item) { 1349 var obj = {}, 1350 opts = {}, 1351 $item, 1352 type, 1353 found, 1354 src, 1355 srcParts; 1356 1357 // Step 1 - Make sure we have an object 1358 // ==================================== 1359 1360 if ($.isPlainObject(item)) { 1361 // We probably have manual usage here, something like 1362 // $.fancybox.open( [ { src : "image.jpg", type : "image" } ] ) 1363 1364 obj = item; 1365 opts = item.opts || item; 1366 } else if ($.type(item) === "object" && $(item).length) { 1367 // Here we probably have jQuery collection returned by some selector 1368 $item = $(item); 1369 1370 // Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'` 1371 opts = $item.data() || {}; 1372 opts = $.extend(true, {}, opts, opts.options); 1373 1374 // Here we store clicked element 1375 opts.$orig = $item; 1376 1377 obj.src = self.opts.src || opts.src || $item.attr("href"); 1378 1379 // Assume that simple syntax is used, for example: 1380 // `$.fancybox.open( $("#test"), {} );` 1381 if (!obj.type && !obj.src) { 1382 obj.type = "inline"; 1383 obj.src = item; 1384 } 1385 } else { 1386 // Assume we have a simple html code, for example: 1387 // $.fancybox.open( '<div><h1>Hi!</h1></div>' ); 1388 obj = { 1389 type: "html", 1390 src: item + "" 1391 }; 1392 } 1393 1394 // Each gallery object has full collection of options 1395 obj.opts = $.extend(true, {}, self.opts, opts); 1396 1397 // Do not merge buttons array 1398 if ($.isArray(opts.buttons)) { 1399 obj.opts.buttons = opts.buttons; 1400 } 1401 1402 if ($.fancybox.isMobile && obj.opts.mobile) { 1403 obj.opts = mergeOpts(obj.opts, obj.opts.mobile); 1404 } 1405 1406 // Step 2 - Make sure we have content type, if not - try to guess 1407 // ============================================================== 1408 1409 type = obj.type || obj.opts.type; 1410 src = obj.src || ""; 1411 1412 if (!type && src) { 1413 if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) { 1414 type = "video"; 1415 1416 if (!obj.opts.video.format) { 1417 obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]); 1418 } 1419 } else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) { 1420 type = "image"; 1421 } else if (src.match(/\.(pdf)((\?|#).*)?$/i)) { 1422 type = "iframe"; 1423 obj = $.extend(true, obj, { 1424 contentType: "pdf", 1425 opts: { 1426 iframe: { 1427 preload: false 1428 } 1429 } 1430 }); 1431 } else if (src.charAt(0) === "#") { 1432 type = "inline"; 1433 } 1434 } 1435 1436 if (type) { 1437 obj.type = type; 1438 } else { 1439 self.trigger("objectNeedsType", obj); 1440 } 1441 1442 if (!obj.contentType) { 1443 obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type; 1444 } 1445 1446 // Step 3 - Some adjustments 1447 // ========================= 1448 1449 obj.index = self.group.length; 1450 1451 if (obj.opts.smallBtn == "auto") { 1452 obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1; 1453 } 1454 1455 if (obj.opts.toolbar === "auto") { 1456 obj.opts.toolbar = !obj.opts.smallBtn; 1457 } 1458 1459 // Find thumbnail image, check if exists and if is in the viewport 1460 obj.$thumb = obj.opts.$thumb || null; 1461 1462 if (obj.opts.$trigger && obj.index === self.opts.index) { 1463 obj.$thumb = obj.opts.$trigger.find("img:first"); 1464 1465 if (obj.$thumb.length) { 1466 obj.opts.$orig = obj.opts.$trigger; 1467 } 1468 } 1469 1470 if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) { 1471 obj.$thumb = obj.opts.$orig.find("img:first"); 1472 } 1473 1474 if (obj.$thumb && !obj.$thumb.length) { 1475 obj.$thumb = null; 1476 } 1477 1478 obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null); 1479 1480 // "caption" is a "special" option, it can be used to customize caption per gallery item 1481 if ($.type(obj.opts.caption) === "function") { 1482 obj.opts.caption = obj.opts.caption.apply(item, [self, obj]); 1483 } 1484 1485 if ($.type(self.opts.caption) === "function") { 1486 obj.opts.caption = self.opts.caption.apply(item, [self, obj]); 1487 } 1488 1489 // Make sure we have caption as a string or jQuery object 1490 if (!(obj.opts.caption instanceof $)) { 1491 obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + ""; 1492 } 1493 1494 // Check if url contains "filter" used to filter the content 1495 // Example: "ajax.html #something" 1496 if (obj.type === "ajax") { 1497 srcParts = src.split(/\s+/, 2); 1498 1499 if (srcParts.length > 1) { 1500 obj.src = srcParts.shift(); 1501 1502 obj.opts.filter = srcParts.shift(); 1503 } 1504 } 1505 1506 // Hide all buttons and disable interactivity for modal items 1507 if (obj.opts.modal) { 1508 obj.opts = $.extend(true, obj.opts, { 1509 trapFocus: true, 1510 // Remove buttons 1511 infobar: 0, 1512 toolbar: 0, 1513 1514 smallBtn: 0, 1515 1516 // Disable keyboard navigation 1517 keyboard: 0, 1518 1519 // Disable some modules 1520 slideShow: 0, 1521 fullScreen: 0, 1522 thumbs: 0, 1523 touch: 0, 1524 1525 // Disable click event handlers 1526 clickContent: false, 1527 clickSlide: false, 1528 clickOutside: false, 1529 dblclickContent: false, 1530 dblclickSlide: false, 1531 dblclickOutside: false 1532 }); 1533 } 1534 1535 // Step 4 - Add processed object to group 1536 // ====================================== 1537 1538 self.group.push(obj); 1539 }); 1540 1541 // Update controls if gallery is already opened 1542 if (Object.keys(self.slides).length) { 1543 self.updateControls(); 1544 1545 // Update thumbnails, if needed 1546 thumbs = self.Thumbs; 1547 1548 if (thumbs && thumbs.isActive) { 1549 thumbs.create(); 1550 1551 thumbs.focus(); 1552 } 1553 } 1554 }, 1555 1556 // Attach an event handler functions for: 1557 // - navigation buttons 1558 // - browser scrolling, resizing; 1559 // - focusing 1560 // - keyboard 1561 // - detecting inactivity 1562 // ====================================== 1563 1564 addEvents: function () { 1565 var self = this; 1566 1567 self.removeEvents(); 1568 1569 // Make navigation elements clickable 1570 // ================================== 1571 1572 self.$refs.container 1573 .on("click.fb-close", "[data-fancybox-close]", function (e) { 1574 e.stopPropagation(); 1575 e.preventDefault(); 1576 1577 self.close(e); 1578 }) 1579 .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function (e) { 1580 e.stopPropagation(); 1581 e.preventDefault(); 1582 1583 self.previous(); 1584 }) 1585 .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function (e) { 1586 e.stopPropagation(); 1587 e.preventDefault(); 1588 1589 self.next(); 1590 }) 1591 .on("click.fb", "[data-fancybox-zoom]", function (e) { 1592 // Click handler for zoom button 1593 self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"](); 1594 }); 1595 1596 // Handle page scrolling and browser resizing 1597 // ========================================== 1598 1599 $W.on("orientationchange.fb resize.fb", function (e) { 1600 if (e && e.originalEvent && e.originalEvent.type === "resize") { 1601 if (self.requestId) { 1602 cancelAFrame(self.requestId); 1603 } 1604 1605 self.requestId = requestAFrame(function () { 1606 self.update(e); 1607 }); 1608 } else { 1609 if (self.current && self.current.type === "iframe") { 1610 self.$refs.stage.hide(); 1611 } 1612 1613 setTimeout( 1614 function () { 1615 self.$refs.stage.show(); 1616 1617 self.update(e); 1618 }, 1619 $.fancybox.isMobile ? 600 : 250 1620 ); 1621 } 1622 }); 1623 1624 $D.on("keydown.fb", function (e) { 1625 var instance = $.fancybox ? $.fancybox.getInstance() : null, 1626 current = instance.current, 1627 keycode = e.keyCode || e.which; 1628 1629 // Trap keyboard focus inside of the modal 1630 // ======================================= 1631 1632 if (keycode == 9) { 1633 if (current.opts.trapFocus) { 1634 self.focus(e); 1635 } 1636 1637 return; 1638 } 1639 1640 // Enable keyboard navigation 1641 // ========================== 1642 1643 if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input,textarea,video,audio,select")) { 1644 return; 1645 } 1646 1647 // Backspace and Esc keys 1648 if (keycode === 8 || keycode === 27) { 1649 e.preventDefault(); 1650 1651 self.close(e); 1652 1653 return; 1654 } 1655 1656 // Left arrow and Up arrow 1657 if (keycode === 37 || keycode === 38) { 1658 e.preventDefault(); 1659 1660 self.previous(); 1661 1662 return; 1663 } 1664 1665 // Righ arrow and Down arrow 1666 if (keycode === 39 || keycode === 40) { 1667 e.preventDefault(); 1668 1669 self.next(); 1670 1671 return; 1672 } 1673 1674 self.trigger("afterKeydown", e, keycode); 1675 }); 1676 1677 // Hide controls after some inactivity period 1678 if (self.group[self.currIndex].opts.idleTime) { 1679 self.idleSecondsCounter = 0; 1680 1681 $D.on( 1682 "mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle", 1683 function (e) { 1684 self.idleSecondsCounter = 0; 1685 1686 if (self.isIdle) { 1687 self.showControls(); 1688 } 1689 1690 self.isIdle = false; 1691 } 1692 ); 1693 1694 self.idleInterval = window.setInterval(function () { 1695 self.idleSecondsCounter++; 1696 1697 if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) { 1698 self.isIdle = true; 1699 self.idleSecondsCounter = 0; 1700 1701 self.hideControls(); 1702 } 1703 }, 1000); 1704 } 1705 }, 1706 1707 // Remove events added by the core 1708 // =============================== 1709 1710 removeEvents: function () { 1711 var self = this; 1712 1713 $W.off("orientationchange.fb resize.fb"); 1714 $D.off("keydown.fb .fb-idle"); 1715 1716 this.$refs.container.off(".fb-close .fb-prev .fb-next"); 1717 1718 if (self.idleInterval) { 1719 window.clearInterval(self.idleInterval); 1720 1721 self.idleInterval = null; 1722 } 1723 }, 1724 1725 // Change to previous gallery item 1726 // =============================== 1727 1728 previous: function (duration) { 1729 return this.jumpTo(this.currPos - 1, duration); 1730 }, 1731 1732 // Change to next gallery item 1733 // =========================== 1734 1735 next: function (duration) { 1736 return this.jumpTo(this.currPos + 1, duration); 1737 }, 1738 1739 // Switch to selected gallery item 1740 // =============================== 1741 1742 jumpTo: function (pos, duration) { 1743 var self = this, 1744 groupLen = self.group.length, 1745 firstRun, 1746 isMoved, 1747 loop, 1748 current, 1749 previous, 1750 slidePos, 1751 stagePos, 1752 prop, 1753 diff; 1754 1755 if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) { 1756 return; 1757 } 1758 1759 // Should loop? 1760 pos = parseInt(pos, 10); 1761 loop = self.current ? self.current.opts.loop : self.opts.loop; 1762 1763 if (!loop && (pos < 0 || pos >= groupLen)) { 1764 return false; 1765 } 1766 1767 // Check if opening for the first time; this helps to speed things up 1768 firstRun = self.firstRun = !Object.keys(self.slides).length; 1769 1770 // Create slides 1771 previous = self.current; 1772 1773 self.prevIndex = self.currIndex; 1774 self.prevPos = self.currPos; 1775 1776 current = self.createSlide(pos); 1777 1778 if (groupLen > 1) { 1779 if (loop || current.index < groupLen - 1) { 1780 self.createSlide(pos + 1); 1781 } 1782 1783 if (loop || current.index > 0) { 1784 self.createSlide(pos - 1); 1785 } 1786 } 1787 1788 self.current = current; 1789 self.currIndex = current.index; 1790 self.currPos = current.pos; 1791 1792 self.trigger("beforeShow", firstRun); 1793 1794 self.updateControls(); 1795 1796 // Validate duration length 1797 current.forcedDuration = undefined; 1798 1799 if ($.isNumeric(duration)) { 1800 current.forcedDuration = duration; 1801 } else { 1802 duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"]; 1803 } 1804 1805 duration = parseInt(duration, 10); 1806 1807 // Check if user has swiped the slides or if still animating 1808 isMoved = self.isMoved(current); 1809 1810 // Make sure current slide is visible 1811 current.$slide.addClass("fancybox-slide--current"); 1812 1813 // Fresh start - reveal container, current slide and start loading content 1814 if (firstRun) { 1815 if (current.opts.animationEffect && duration) { 1816 self.$refs.container.css("transition-duration", duration + "ms"); 1817 } 1818 1819 self.$refs.container.addClass("fancybox-is-open").trigger("focus"); 1820 1821 // Attempt to load content into slide 1822 // This will later call `afterLoad` -> `revealContent` 1823 self.loadSlide(current); 1824 1825 self.preload("image"); 1826 1827 return; 1828 } 1829 1830 // Get actual slide/stage positions (before cleaning up) 1831 slidePos = $.fancybox.getTranslate(previous.$slide); 1832 stagePos = $.fancybox.getTranslate(self.$refs.stage); 1833 1834 // Clean up all slides 1835 $.each(self.slides, function (index, slide) { 1836 $.fancybox.stop(slide.$slide, true); 1837 }); 1838 1839 if (previous.pos !== current.pos) { 1840 previous.isComplete = false; 1841 } 1842 1843 previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"); 1844 1845 // If slides are out of place, then animate them to correct position 1846 if (isMoved) { 1847 // Calculate horizontal swipe distance 1848 diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter); 1849 1850 $.each(self.slides, function (index, slide) { 1851 slide.$slide.removeClass("fancybox-animated").removeClass(function (index, className) { 1852 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 1853 }); 1854 1855 // Make sure that each slide is in equal distance 1856 // This is mostly needed for freshly added slides, because they are not yet positioned 1857 var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter; 1858 1859 $.fancybox.setTranslate(slide.$slide, { 1860 top: 0, 1861 left: leftPos - stagePos.left + diff 1862 }); 1863 1864 if (slide.pos !== current.pos) { 1865 slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next" : "previous")); 1866 } 1867 1868 // Redraw to make sure that transition will start 1869 forceRedraw(slide.$slide); 1870 1871 // Animate the slide 1872 $.fancybox.animate( 1873 slide.$slide, { 1874 top: 0, 1875 left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter 1876 }, 1877 duration, 1878 function () { 1879 slide.$slide 1880 .css({ 1881 transform: "", 1882 opacity: "" 1883 }) 1884 .removeClass("fancybox-slide--next fancybox-slide--previous"); 1885 1886 if (slide.pos === self.currPos) { 1887 self.complete(); 1888 } 1889 } 1890 ); 1891 }); 1892 } else if (duration && current.opts.transitionEffect) { 1893 // Set transition effect for previously active slide 1894 prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect; 1895 1896 previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous")); 1897 1898 $.fancybox.animate( 1899 previous.$slide, 1900 prop, 1901 duration, 1902 function () { 1903 previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous"); 1904 }, 1905 false 1906 ); 1907 } 1908 1909 if (current.isLoaded) { 1910 self.revealContent(current); 1911 } else { 1912 self.loadSlide(current); 1913 } 1914 1915 self.preload("image"); 1916 }, 1917 1918 // Create new "slide" element 1919 // These are gallery items that are actually added to DOM 1920 // ======================================================= 1921 1922 createSlide: function (pos) { 1923 var self = this, 1924 $slide, 1925 index; 1926 1927 index = pos % self.group.length; 1928 index = index < 0 ? self.group.length + index : index; 1929 1930 if (!self.slides[pos] && self.group[index]) { 1931 $slide = $('<div class="fancybox-slide"></div>').appendTo(self.$refs.stage); 1932 1933 self.slides[pos] = $.extend(true, {}, self.group[index], { 1934 pos: pos, 1935 $slide: $slide, 1936 isLoaded: false 1937 }); 1938 1939 self.updateSlide(self.slides[pos]); 1940 } 1941 1942 return self.slides[pos]; 1943 }, 1944 1945 // Scale image to the actual size of the image; 1946 // x and y values should be relative to the slide 1947 // ============================================== 1948 1949 scaleToActual: function (x, y, duration) { 1950 var self = this, 1951 current = self.current, 1952 $content = current.$content, 1953 canvasWidth = $.fancybox.getTranslate(current.$slide).width, 1954 canvasHeight = $.fancybox.getTranslate(current.$slide).height, 1955 newImgWidth = current.width, 1956 newImgHeight = current.height, 1957 imgPos, 1958 posX, 1959 posY, 1960 scaleX, 1961 scaleY; 1962 1963 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 1964 return; 1965 } 1966 1967 self.isAnimating = true; 1968 1969 $.fancybox.stop($content); 1970 1971 x = x === undefined ? canvasWidth * 0.5 : x; 1972 y = y === undefined ? canvasHeight * 0.5 : y; 1973 1974 imgPos = $.fancybox.getTranslate($content); 1975 1976 imgPos.top -= $.fancybox.getTranslate(current.$slide).top; 1977 imgPos.left -= $.fancybox.getTranslate(current.$slide).left; 1978 1979 scaleX = newImgWidth / imgPos.width; 1980 scaleY = newImgHeight / imgPos.height; 1981 1982 // Get center position for original image 1983 posX = canvasWidth * 0.5 - newImgWidth * 0.5; 1984 posY = canvasHeight * 0.5 - newImgHeight * 0.5; 1985 1986 // Make sure image does not move away from edges 1987 if (newImgWidth > canvasWidth) { 1988 posX = imgPos.left * scaleX - (x * scaleX - x); 1989 1990 if (posX > 0) { 1991 posX = 0; 1992 } 1993 1994 if (posX < canvasWidth - newImgWidth) { 1995 posX = canvasWidth - newImgWidth; 1996 } 1997 } 1998 1999 if (newImgHeight > canvasHeight) { 2000 posY = imgPos.top * scaleY - (y * scaleY - y); 2001 2002 if (posY > 0) { 2003 posY = 0; 2004 } 2005 2006 if (posY < canvasHeight - newImgHeight) { 2007 posY = canvasHeight - newImgHeight; 2008 } 2009 } 2010 2011 self.updateCursor(newImgWidth, newImgHeight); 2012 2013 $.fancybox.animate( 2014 $content, { 2015 top: posY, 2016 left: posX, 2017 scaleX: scaleX, 2018 scaleY: scaleY 2019 }, 2020 duration || 366, 2021 function () { 2022 self.isAnimating = false; 2023 } 2024 ); 2025 2026 // Stop slideshow 2027 if (self.SlideShow && self.SlideShow.isActive) { 2028 self.SlideShow.stop(); 2029 } 2030 }, 2031 2032 // Scale image to fit inside parent element 2033 // ======================================== 2034 2035 scaleToFit: function (duration) { 2036 var self = this, 2037 current = self.current, 2038 $content = current.$content, 2039 end; 2040 2041 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 2042 return; 2043 } 2044 2045 self.isAnimating = true; 2046 2047 $.fancybox.stop($content); 2048 2049 end = self.getFitPos(current); 2050 2051 self.updateCursor(end.width, end.height); 2052 2053 $.fancybox.animate( 2054 $content, { 2055 top: end.top, 2056 left: end.left, 2057 scaleX: end.width / $content.width(), 2058 scaleY: end.height / $content.height() 2059 }, 2060 duration || 366, 2061 function () { 2062 self.isAnimating = false; 2063 } 2064 ); 2065 }, 2066 2067 // Calculate image size to fit inside viewport 2068 // =========================================== 2069 2070 getFitPos: function (slide) { 2071 var self = this, 2072 $content = slide.$content, 2073 $slide = slide.$slide, 2074 width = slide.width || slide.opts.width, 2075 height = slide.height || slide.opts.height, 2076 maxWidth, 2077 maxHeight, 2078 minRatio, 2079 aspectRatio, 2080 rez = {}; 2081 2082 if (!slide.isLoaded || !$content || !$content.length) { 2083 return false; 2084 } 2085 2086 maxWidth = $.fancybox.getTranslate(self.$refs.stage).width; 2087 maxHeight = $.fancybox.getTranslate(self.$refs.stage).height; 2088 2089 maxWidth -= 2090 parseFloat($slide.css("paddingLeft")) + 2091 parseFloat($slide.css("paddingRight")) + 2092 parseFloat($content.css("marginLeft")) + 2093 parseFloat($content.css("marginRight")); 2094 2095 maxHeight -= 2096 parseFloat($slide.css("paddingTop")) + 2097 parseFloat($slide.css("paddingBottom")) + 2098 parseFloat($content.css("marginTop")) + 2099 parseFloat($content.css("marginBottom")); 2100 2101 if (!width || !height) { 2102 width = maxWidth; 2103 height = maxHeight; 2104 } 2105 2106 minRatio = Math.min(1, maxWidth / width, maxHeight / height); 2107 2108 width = minRatio * width; 2109 height = minRatio * height; 2110 2111 // Adjust width/height to precisely fit into container 2112 if (width > maxWidth - 0.5) { 2113 width = maxWidth; 2114 } 2115 2116 if (height > maxHeight - 0.5) { 2117 height = maxHeight; 2118 } 2119 2120 if (slide.type === "image") { 2121 rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop")); 2122 rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft")); 2123 } else if (slide.contentType === "video") { 2124 // Force aspect ratio for the video 2125 // "I say the whole world must learn of our peaceful ways⦠by force!" 2126 aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9; 2127 2128 if (height > width / aspectRatio) { 2129 height = width / aspectRatio; 2130 } else if (width > height * aspectRatio) { 2131 width = height * aspectRatio; 2132 } 2133 } 2134 2135 rez.width = width; 2136 rez.height = height; 2137 2138 return rez; 2139 }, 2140 2141 // Update content size and position for all slides 2142 // ============================================== 2143 2144 update: function (e) { 2145 var self = this; 2146 2147 $.each(self.slides, function (key, slide) { 2148 self.updateSlide(slide, e); 2149 }); 2150 }, 2151 2152 // Update slide content position and size 2153 // ====================================== 2154 2155 updateSlide: function (slide, e) { 2156 var self = this, 2157 $content = slide && slide.$content, 2158 width = slide.width || slide.opts.width, 2159 height = slide.height || slide.opts.height, 2160 $slide = slide.$slide; 2161 2162 // First, prevent caption overlap, if needed 2163 self.adjustCaption(slide); 2164 2165 // Then resize content to fit inside the slide 2166 if ($content && (width || height || slide.contentType === "video") && !slide.hasError) { 2167 $.fancybox.stop($content); 2168 2169 $.fancybox.setTranslate($content, self.getFitPos(slide)); 2170 2171 if (slide.pos === self.currPos) { 2172 self.isAnimating = false; 2173 2174 self.updateCursor(); 2175 } 2176 } 2177 2178 // Then some adjustments 2179 self.adjustLayout(slide); 2180 2181 if ($slide.length) { 2182 $slide.trigger("refresh"); 2183 2184 if (slide.pos === self.currPos) { 2185 self.$refs.toolbar 2186 .add(self.$refs.navigation.find(".fancybox-button--arrow_right")) 2187 .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight); 2188 } 2189 } 2190 2191 self.trigger("onUpdate", slide, e); 2192 }, 2193 2194 // Horizontally center slide 2195 // ========================= 2196 2197 centerSlide: function (duration) { 2198 var self = this, 2199 current = self.current, 2200 $slide = current.$slide; 2201 2202 if (self.isClosing || !current) { 2203 return; 2204 } 2205 2206 $slide.siblings().css({ 2207 transform: "", 2208 opacity: "" 2209 }); 2210 2211 $slide 2212 .parent() 2213 .children() 2214 .removeClass("fancybox-slide--previous fancybox-slide--next"); 2215 2216 $.fancybox.animate( 2217 $slide, { 2218 top: 0, 2219 left: 0, 2220 opacity: 1 2221 }, 2222 duration === undefined ? 0 : duration, 2223 function () { 2224 // Clean up 2225 $slide.css({ 2226 transform: "", 2227 opacity: "" 2228 }); 2229 2230 if (!current.isComplete) { 2231 self.complete(); 2232 } 2233 }, 2234 false 2235 ); 2236 }, 2237 2238 // Check if current slide is moved (swiped) 2239 // ======================================== 2240 2241 isMoved: function (slide) { 2242 var current = slide || this.current, 2243 slidePos, 2244 stagePos; 2245 2246 if (!current) { 2247 return false; 2248 } 2249 2250 stagePos = $.fancybox.getTranslate(this.$refs.stage); 2251 slidePos = $.fancybox.getTranslate(current.$slide); 2252 2253 return ( 2254 !current.$slide.hasClass("fancybox-animated") && 2255 (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5) 2256 ); 2257 }, 2258 2259 // Update cursor style depending if content can be zoomed 2260 // ====================================================== 2261 2262 updateCursor: function (nextWidth, nextHeight) { 2263 var self = this, 2264 current = self.current, 2265 $container = self.$refs.container, 2266 canPan, 2267 isZoomable; 2268 2269 if (!current || self.isClosing || !self.Guestures) { 2270 return; 2271 } 2272 2273 $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"); 2274 2275 canPan = self.canPan(nextWidth, nextHeight); 2276 2277 isZoomable = canPan ? true : self.isZoomable(); 2278 2279 $container.toggleClass("fancybox-is-zoomable", isZoomable); 2280 2281 $("[data-fancybox-zoom]").prop("disabled", !isZoomable); 2282 2283 if (canPan) { 2284 $container.addClass("fancybox-can-pan"); 2285 } else if ( 2286 isZoomable && 2287 (current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom")) 2288 ) { 2289 $container.addClass("fancybox-can-zoomIn"); 2290 } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") { 2291 $container.addClass("fancybox-can-swipe"); 2292 } 2293 }, 2294 2295 // Check if current slide is zoomable 2296 // ================================== 2297 2298 isZoomable: function () { 2299 var self = this, 2300 current = self.current, 2301 fitPos; 2302 2303 // Assume that slide is zoomable if: 2304 // - image is still loading 2305 // - actual size of the image is smaller than available area 2306 if (current && !self.isClosing && current.type === "image" && !current.hasError) { 2307 if (!current.isLoaded) { 2308 return true; 2309 } 2310 2311 fitPos = self.getFitPos(current); 2312 2313 if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) { 2314 return true; 2315 } 2316 } 2317 2318 return false; 2319 }, 2320 2321 // Check if current image dimensions are smaller than actual 2322 // ========================================================= 2323 2324 isScaledDown: function (nextWidth, nextHeight) { 2325 var self = this, 2326 rez = false, 2327 current = self.current, 2328 $content = current.$content; 2329 2330 if (nextWidth !== undefined && nextHeight !== undefined) { 2331 rez = nextWidth < current.width && nextHeight < current.height; 2332 } else if ($content) { 2333 rez = $.fancybox.getTranslate($content); 2334 rez = rez.width < current.width && rez.height < current.height; 2335 } 2336 2337 return rez; 2338 }, 2339 2340 // Check if image dimensions exceed parent element 2341 // =============================================== 2342 2343 canPan: function (nextWidth, nextHeight) { 2344 var self = this, 2345 current = self.current, 2346 pos = null, 2347 rez = false; 2348 2349 if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) { 2350 rez = self.getFitPos(current); 2351 2352 if (nextWidth !== undefined && nextHeight !== undefined) { 2353 pos = { 2354 width: nextWidth, 2355 height: nextHeight 2356 }; 2357 } else if (current.isComplete) { 2358 pos = $.fancybox.getTranslate(current.$content); 2359 } 2360 2361 if (pos && rez) { 2362 rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5; 2363 } 2364 } 2365 2366 return rez; 2367 }, 2368 2369 // Load content into the slide 2370 // =========================== 2371 2372 loadSlide: function (slide) { 2373 var self = this, 2374 type, 2375 $slide, 2376 ajaxLoad; 2377 2378 if (slide.isLoading || slide.isLoaded) { 2379 return; 2380 } 2381 2382 slide.isLoading = true; 2383 2384 if (self.trigger("beforeLoad", slide) === false) { 2385 slide.isLoading = false; 2386 2387 return false; 2388 } 2389 2390 type = slide.type; 2391 $slide = slide.$slide; 2392 2393 $slide 2394 .off("refresh") 2395 .trigger("onReset") 2396 .addClass(slide.opts.slideClass); 2397 2398 // Create content depending on the type 2399 switch (type) { 2400 case "image": 2401 self.setImage(slide); 2402 2403 break; 2404 2405 case "iframe": 2406 self.setIframe(slide); 2407 2408 break; 2409 2410 case "html": 2411 self.setContent(slide, slide.src || slide.content); 2412 2413 break; 2414 2415 case "video": 2416 self.setContent( 2417 slide, 2418 slide.opts.video.tpl 2419 .replace(/\{\{src\}\}/gi, slide.src) 2420 .replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "") 2421 .replace("{{poster}}", slide.thumb || "") 2422 ); 2423 2424 break; 2425 2426 case "inline": 2427 if ($(slide.src).length) { 2428 self.setContent(slide, $(slide.src)); 2429 } else { 2430 self.setError(slide); 2431 } 2432 2433 break; 2434 2435 case "ajax": 2436 self.showLoading(slide); 2437 2438 ajaxLoad = $.ajax( 2439 $.extend({}, slide.opts.ajax.settings, { 2440 url: slide.src, 2441 success: function (data, textStatus) { 2442 if (textStatus === "success") { 2443 self.setContent(slide, data); 2444 } 2445 }, 2446 error: function (jqXHR, textStatus) { 2447 if (jqXHR && textStatus !== "abort") { 2448 self.setError(slide); 2449 } 2450 } 2451 }) 2452 ); 2453 2454 $slide.one("onReset", function () { 2455 ajaxLoad.abort(); 2456 }); 2457 2458 break; 2459 2460 default: 2461 self.setError(slide); 2462 2463 break; 2464 } 2465 2466 return true; 2467 }, 2468 2469 // Use thumbnail image, if possible 2470 // ================================ 2471 2472 setImage: function (slide) { 2473 var self = this, 2474 ghost; 2475 2476 // Check if need to show loading icon 2477 setTimeout(function () { 2478 var $img = slide.$image; 2479 2480 if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) { 2481 self.showLoading(slide); 2482 } 2483 }, 50); 2484 2485 //Check if image has srcset 2486 self.checkSrcset(slide); 2487 2488 // This will be wrapper containing both ghost and actual image 2489 slide.$content = $('<div class="fancybox-content"></div>') 2490 .addClass("fancybox-is-hidden") 2491 .appendTo(slide.$slide.addClass("fancybox-slide--image")); 2492 2493 // If we have a thumbnail, we can display it while actual image is loading 2494 // Users will not stare at black screen and actual image will appear gradually 2495 if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) { 2496 slide.width = slide.opts.width; 2497 slide.height = slide.opts.height; 2498 2499 ghost = document.createElement("img"); 2500 2501 ghost.onerror = function () { 2502 $(this).remove(); 2503 2504 slide.$ghost = null; 2505 }; 2506 2507 ghost.onload = function () { 2508 self.afterLoad(slide); 2509 }; 2510 2511 slide.$ghost = $(ghost) 2512 .addClass("fancybox-image") 2513 .appendTo(slide.$content) 2514 .attr("src", slide.thumb); 2515 } 2516 2517 // Start loading actual image 2518 self.setBigImage(slide); 2519 }, 2520 2521 // Check if image has srcset and get the source 2522 // ============================================ 2523 checkSrcset: function (slide) { 2524 var srcset = slide.opts.srcset || slide.opts.image.srcset, 2525 found, 2526 temp, 2527 pxRatio, 2528 windowWidth; 2529 2530 // If we have "srcset", then we need to find first matching "src" value. 2531 // This is necessary, because when you set an src attribute, the browser will preload the image 2532 // before any javascript or even CSS is applied. 2533 if (srcset) { 2534 pxRatio = window.devicePixelRatio || 1; 2535 windowWidth = window.innerWidth * pxRatio; 2536 2537 temp = srcset.split(",").map(function (el) { 2538 var ret = {}; 2539 2540 el.trim() 2541 .split(/\s+/) 2542 .forEach(function (el, i) { 2543 var value = parseInt(el.substring(0, el.length - 1), 10); 2544 2545 if (i === 0) { 2546 return (ret.url = el); 2547 } 2548 2549 if (value) { 2550 ret.value = value; 2551 ret.postfix = el[el.length - 1]; 2552 } 2553 }); 2554 2555 return ret; 2556 }); 2557 2558 // Sort by value 2559 temp.sort(function (a, b) { 2560 return a.value - b.value; 2561 }); 2562 2563 // Ok, now we have an array of all srcset values 2564 for (var j = 0; j < temp.length; j++) { 2565 var el = temp[j]; 2566 2567 if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) { 2568 found = el; 2569 break; 2570 } 2571 } 2572 2573 // If not found, take the last one 2574 if (!found && temp.length) { 2575 found = temp[temp.length - 1]; 2576 } 2577 2578 if (found) { 2579 slide.src = found.url; 2580 2581 // If we have default width/height values, we can calculate height for matching source 2582 if (slide.width && slide.height && found.postfix == "w") { 2583 slide.height = (slide.width / slide.height) * found.value; 2584 slide.width = found.value; 2585 } 2586 2587 slide.opts.srcset = srcset; 2588 } 2589 } 2590 }, 2591 2592 // Create full-size image 2593 // ====================== 2594 2595 setBigImage: function (slide) { 2596 var self = this, 2597 img = document.createElement("img"), 2598 $img = $(img); 2599 2600 slide.$image = $img 2601 .one("error", function () { 2602 self.setError(slide); 2603 }) 2604 .one("load", function () { 2605 var sizes; 2606 2607 if (!slide.$ghost) { 2608 self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight); 2609 2610 self.afterLoad(slide); 2611 } 2612 2613 if (self.isClosing) { 2614 return; 2615 } 2616 2617 if (slide.opts.srcset) { 2618 sizes = slide.opts.sizes; 2619 2620 if (!sizes || sizes === "auto") { 2621 sizes = 2622 (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) + 2623 "vw"; 2624 } 2625 2626 $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset); 2627 } 2628 2629 // Hide temporary image after some delay 2630 if (slide.$ghost) { 2631 setTimeout(function () { 2632 if (slide.$ghost && !self.isClosing) { 2633 slide.$ghost.hide(); 2634 } 2635 }, Math.min(300, Math.max(1000, slide.height / 1600))); 2636 } 2637 2638 self.hideLoading(slide); 2639 }) 2640 .addClass("fancybox-image") 2641 .attr("src", slide.src) 2642 .appendTo(slide.$content); 2643 2644 if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) { 2645 $img.trigger("load"); 2646 } else if (img.error) { 2647 $img.trigger("error"); 2648 } 2649 }, 2650 2651 // Computes the slide size from image size and maxWidth/maxHeight 2652 // ============================================================== 2653 2654 resolveImageSlideSize: function (slide, imgWidth, imgHeight) { 2655 var maxWidth = parseInt(slide.opts.width, 10), 2656 maxHeight = parseInt(slide.opts.height, 10); 2657 2658 // Sets the default values from the image 2659 slide.width = imgWidth; 2660 slide.height = imgHeight; 2661 2662 if (maxWidth > 0) { 2663 slide.width = maxWidth; 2664 slide.height = Math.floor((maxWidth * imgHeight) / imgWidth); 2665 } 2666 2667 if (maxHeight > 0) { 2668 slide.width = Math.floor((maxHeight * imgWidth) / imgHeight); 2669 slide.height = maxHeight; 2670 } 2671 }, 2672 2673 // Create iframe wrapper, iframe and bindings 2674 // ========================================== 2675 2676 setIframe: function (slide) { 2677 var self = this, 2678 opts = slide.opts.iframe, 2679 $slide = slide.$slide, 2680 $iframe; 2681 2682 slide.$content = $('<div class="fancybox-content' + (opts.preload ? " fancybox-is-hidden" : "") + '"></div>') 2683 .css(opts.css) 2684 .appendTo($slide); 2685 2686 $slide.addClass("fancybox-slide--" + slide.contentType); 2687 2688 slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime())) 2689 .attr(opts.attr) 2690 .appendTo(slide.$content); 2691 2692 if (opts.preload) { 2693 self.showLoading(slide); 2694 2695 // Unfortunately, it is not always possible to determine if iframe is successfully loaded 2696 // (due to browser security policy) 2697 2698 $iframe.on("load.fb error.fb", function (e) { 2699 this.isReady = 1; 2700 2701 slide.$slide.trigger("refresh"); 2702 2703 self.afterLoad(slide); 2704 }); 2705 2706 // Recalculate iframe content size 2707 // =============================== 2708 2709 $slide.on("refresh.fb", function () { 2710 var $content = slide.$content, 2711 frameWidth = opts.css.width, 2712 frameHeight = opts.css.height, 2713 $contents, 2714 $body; 2715 2716 if ($iframe[0].isReady !== 1) { 2717 return; 2718 } 2719 2720 try { 2721 $contents = $iframe.contents(); 2722 $body = $contents.find("body"); 2723 } catch (ignore) {} 2724 2725 // Calculate content dimensions, if it is accessible 2726 if ($body && $body.length && $body.children().length) { 2727 // Avoid scrolling to top (if multiple instances) 2728 $slide.css("overflow", "visible"); 2729 2730 $content.css({ 2731 width: "100%", 2732 "max-width": "100%", 2733 height: "9999px" 2734 }); 2735 2736 if (frameWidth === undefined) { 2737 frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true))); 2738 } 2739 2740 $content.css("width", frameWidth ? frameWidth : "").css("max-width", ""); 2741 2742 if (frameHeight === undefined) { 2743 frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true))); 2744 } 2745 2746 $content.css("height", frameHeight ? frameHeight : ""); 2747 2748 $slide.css("overflow", "auto"); 2749 } 2750 2751 $content.removeClass("fancybox-is-hidden"); 2752 }); 2753 } else { 2754 self.afterLoad(slide); 2755 } 2756 2757 $iframe.attr("src", slide.src); 2758 2759 // Remove iframe if closing or changing gallery item 2760 $slide.one("onReset", function () { 2761 // This helps IE not to throw errors when closing 2762 try { 2763 $(this) 2764 .find("iframe") 2765 .hide() 2766 .unbind() 2767 .attr("src", "//about:blank"); 2768 } catch (ignore) {} 2769 2770 $(this) 2771 .off("refresh.fb") 2772 .empty(); 2773 2774 slide.isLoaded = false; 2775 slide.isRevealed = false; 2776 }); 2777 }, 2778 2779 // Wrap and append content to the slide 2780 // ====================================== 2781 2782 setContent: function (slide, content) { 2783 var self = this; 2784 2785 if (self.isClosing) { 2786 return; 2787 } 2788 2789 self.hideLoading(slide); 2790 2791 if (slide.$content) { 2792 $.fancybox.stop(slide.$content); 2793 } 2794 2795 slide.$slide.empty(); 2796 2797 // If content is a jQuery object, then it will be moved to the slide. 2798 // The placeholder is created so we will know where to put it back. 2799 if (isQuery(content) && content.parent().length) { 2800 // Make sure content is not already moved to fancyBox 2801 if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) { 2802 content.parents(".fancybox-slide").trigger("onReset"); 2803 } 2804 2805 // Create temporary element marking original place of the content 2806 slide.$placeholder = $("<div>") 2807 .hide() 2808 .insertAfter(content); 2809 2810 // Make sure content is visible 2811 content.css("display", "inline-block"); 2812 } else if (!slide.hasError) { 2813 // If content is just a plain text, try to convert it to html 2814 if ($.type(content) === "string") { 2815 content = $("<div>") 2816 .append($.trim(content)) 2817 .contents(); 2818 } 2819 2820 // If "filter" option is provided, then filter content 2821 if (slide.opts.filter) { 2822 content = $("<div>") 2823 .html(content) 2824 .find(slide.opts.filter); 2825 } 2826 } 2827 2828 slide.$slide.one("onReset", function () { 2829 // Pause all html5 video/audio 2830 $(this) 2831 .find("video,audio") 2832 .trigger("pause"); 2833 2834 // Put content back 2835 if (slide.$placeholder) { 2836 slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove(); 2837 2838 slide.$placeholder = null; 2839 } 2840 2841 // Remove custom close button 2842 if (slide.$smallBtn) { 2843 slide.$smallBtn.remove(); 2844 2845 slide.$smallBtn = null; 2846 } 2847 2848 // Remove content and mark slide as not loaded 2849 if (!slide.hasError) { 2850 $(this).empty(); 2851 2852 slide.isLoaded = false; 2853 slide.isRevealed = false; 2854 } 2855 }); 2856 2857 $(content).appendTo(slide.$slide); 2858 2859 if ($(content).is("video,audio")) { 2860 $(content).addClass("fancybox-video"); 2861 2862 $(content).wrap("<div></div>"); 2863 2864 slide.contentType = "video"; 2865 2866 slide.opts.width = slide.opts.width || $(content).attr("width"); 2867 slide.opts.height = slide.opts.height || $(content).attr("height"); 2868 } 2869 2870 slide.$content = slide.$slide 2871 .children() 2872 .filter("div,form,main,video,audio,article,.fancybox-content") 2873 .first(); 2874 2875 slide.$content.siblings().hide(); 2876 2877 // Re-check if there is a valid content 2878 // (in some cases, ajax response can contain various elements or plain text) 2879 if (!slide.$content.length) { 2880 slide.$content = slide.$slide 2881 .wrapInner("<div></div>") 2882 .children() 2883 .first(); 2884 } 2885 2886 slide.$content.addClass("fancybox-content"); 2887 2888 slide.$slide.addClass("fancybox-slide--" + slide.contentType); 2889 2890 self.afterLoad(slide); 2891 }, 2892 2893 // Display error message 2894 // ===================== 2895 2896 setError: function (slide) { 2897 slide.hasError = true; 2898 2899 slide.$slide 2900 .trigger("onReset") 2901 .removeClass("fancybox-slide--" + slide.contentType) 2902 .addClass("fancybox-slide--error"); 2903 2904 slide.contentType = "html"; 2905 2906 this.setContent(slide, this.translate(slide, slide.opts.errorTpl)); 2907 2908 if (slide.pos === this.currPos) { 2909 this.isAnimating = false; 2910 } 2911 }, 2912 2913 // Show loading icon inside the slide 2914 // ================================== 2915 2916 showLoading: function (slide) { 2917 var self = this; 2918 2919 slide = slide || self.current; 2920 2921 if (slide && !slide.$spinner) { 2922 slide.$spinner = $(self.translate(self, self.opts.spinnerTpl)) 2923 .appendTo(slide.$slide) 2924 .hide() 2925 .fadeIn("fast"); 2926 } 2927 }, 2928 2929 // Remove loading icon from the slide 2930 // ================================== 2931 2932 hideLoading: function (slide) { 2933 var self = this; 2934 2935 slide = slide || self.current; 2936 2937 if (slide && slide.$spinner) { 2938 slide.$spinner.stop().remove(); 2939 2940 delete slide.$spinner; 2941 } 2942 }, 2943 2944 // Adjustments after slide content has been loaded 2945 // =============================================== 2946 2947 afterLoad: function (slide) { 2948 var self = this; 2949 2950 if (self.isClosing) { 2951 return; 2952 } 2953 2954 slide.isLoading = false; 2955 slide.isLoaded = true; 2956 2957 self.trigger("afterLoad", slide); 2958 2959 self.hideLoading(slide); 2960 2961 // Add small close button 2962 if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) { 2963 slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content); 2964 } 2965 2966 // Disable right click 2967 if (slide.opts.protect && slide.$content && !slide.hasError) { 2968 slide.$content.on("contextmenu.fb", function (e) { 2969 if (e.button == 2) { 2970 e.preventDefault(); 2971 } 2972 2973 return true; 2974 }); 2975 2976 // Add fake element on top of the image 2977 // This makes a bit harder for user to select image 2978 if (slide.type === "image") { 2979 $('<div class="fancybox-spaceball"></div>').appendTo(slide.$content); 2980 } 2981 } 2982 2983 self.adjustCaption(slide); 2984 2985 self.adjustLayout(slide); 2986 2987 if (slide.pos === self.currPos) { 2988 self.updateCursor(); 2989 } 2990 2991 self.revealContent(slide); 2992 }, 2993 2994 // Prevent caption overlap, 2995 // fix css inconsistency across browsers 2996 // ===================================== 2997 2998 adjustCaption: function (slide) { 2999 var self = this, 3000 current = slide || self.current, 3001 caption = current.opts.caption, 3002 preventOverlap = current.opts.preventCaptionOverlap, 3003 $caption = self.$refs.caption, 3004 $clone, 3005 captionH = false; 3006 3007 $caption.toggleClass("fancybox-caption--separate", preventOverlap); 3008 3009 if (preventOverlap && caption && caption.length) { 3010 if (current.pos !== self.currPos) { 3011 $clone = $caption.clone().appendTo($caption.parent()); 3012 3013 $clone 3014 .children() 3015 .eq(0) 3016 .empty() 3017 .html(caption); 3018 3019 captionH = $clone.outerHeight(true); 3020 3021 $clone.empty().remove(); 3022 } else if (self.$caption) { 3023 captionH = self.$caption.outerHeight(true); 3024 } 3025 3026 current.$slide.css("padding-bottom", captionH || ""); 3027 } 3028 }, 3029 3030 // Simple hack to fix inconsistency across browsers, described here (affects Edge, too): 3031 // https://bugzilla.mozilla.org/show_bug.cgi?id=748518 3032 // ==================================================================================== 3033 3034 adjustLayout: function (slide) { 3035 var self = this, 3036 current = slide || self.current, 3037 scrollHeight, 3038 marginBottom, 3039 inlinePadding, 3040 actualPadding; 3041 3042 if (current.isLoaded && current.opts.disableLayoutFix !== true) { 3043 current.$content.css("margin-bottom", ""); 3044 3045 // If we would always set margin-bottom for the content, 3046 // then it would potentially break vertical align 3047 if (current.$content.outerHeight() > current.$slide.height() + 0.5) { 3048 inlinePadding = current.$slide[0].style["padding-bottom"]; 3049 actualPadding = current.$slide.css("padding-bottom"); 3050 3051 if (parseFloat(actualPadding) > 0) { 3052 scrollHeight = current.$slide[0].scrollHeight; 3053 3054 current.$slide.css("padding-bottom", 0); 3055 3056 if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) { 3057 marginBottom = actualPadding; 3058 } 3059 3060 current.$slide.css("padding-bottom", inlinePadding); 3061 } 3062 } 3063 3064 current.$content.css("margin-bottom", marginBottom); 3065 } 3066 }, 3067 3068 // Make content visible 3069 // This method is called right after content has been loaded or 3070 // user navigates gallery and transition should start 3071 // ============================================================ 3072 3073 revealContent: function (slide) { 3074 var self = this, 3075 $slide = slide.$slide, 3076 end = false, 3077 start = false, 3078 isMoved = self.isMoved(slide), 3079 isRevealed = slide.isRevealed, 3080 effect, 3081 effectClassName, 3082 duration, 3083 opacity; 3084 3085 slide.isRevealed = true; 3086 3087 effect = slide.opts[self.firstRun ? "animationEffect" : "transitionEffect"]; 3088 duration = slide.opts[self.firstRun ? "animationDuration" : "transitionDuration"]; 3089 3090 duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10); 3091 3092 if (isMoved || slide.pos !== self.currPos || !duration) { 3093 effect = false; 3094 } 3095 3096 // Check if can zoom 3097 if (effect === "zoom") { 3098 if (slide.pos === self.currPos && duration && slide.type === "image" && !slide.hasError && (start = self.getThumbPos(slide))) { 3099 end = self.getFitPos(slide); 3100 } else { 3101 effect = "fade"; 3102 } 3103 } 3104 3105 // Zoom animation 3106 // ============== 3107 if (effect === "zoom") { 3108 self.isAnimating = true; 3109 3110 end.scaleX = end.width / start.width; 3111 end.scaleY = end.height / start.height; 3112 3113 // Check if we need to animate opacity 3114 opacity = slide.opts.zoomOpacity; 3115 3116 if (opacity == "auto") { 3117 opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1; 3118 } 3119 3120 if (opacity) { 3121 start.opacity = 0.1; 3122 end.opacity = 1; 3123 } 3124 3125 // Draw image at start position 3126 $.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start); 3127 3128 forceRedraw(slide.$content); 3129 3130 // Start animation 3131 $.fancybox.animate(slide.$content, end, duration, function () { 3132 self.isAnimating = false; 3133 3134 self.complete(); 3135 }); 3136 3137 return; 3138 } 3139 3140 self.updateSlide(slide); 3141 3142 // Simply show content if no effect 3143 // ================================ 3144 if (!effect) { 3145 slide.$content.removeClass("fancybox-is-hidden"); 3146 3147 if (!isRevealed && isMoved && slide.type === "image" && !slide.hasError) { 3148 slide.$content.hide().fadeIn("fast"); 3149 } 3150 3151 if (slide.pos === self.currPos) { 3152 self.complete(); 3153 } 3154 3155 return; 3156 } 3157 3158 // Prepare for CSS transiton 3159 // ========================= 3160 $.fancybox.stop($slide); 3161 3162 //effectClassName = "fancybox-animated fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-fx-" + effect; 3163 effectClassName = "fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-animated fancybox-fx-" + effect; 3164 3165 $slide.addClass(effectClassName).removeClass("fancybox-slide--current"); //.addClass(effectClassName); 3166 3167 slide.$content.removeClass("fancybox-is-hidden"); 3168 3169 // Force reflow 3170 forceRedraw($slide); 3171 3172 if (slide.type !== "image") { 3173 slide.$content.hide().show(0); 3174 } 3175 3176 $.fancybox.animate( 3177 $slide, 3178 "fancybox-slide--current", 3179 duration, 3180 function () { 3181 $slide.removeClass(effectClassName).css({ 3182 transform: "", 3183 opacity: "" 3184 }); 3185 3186 if (slide.pos === self.currPos) { 3187 self.complete(); 3188 } 3189 }, 3190 true 3191 ); 3192 }, 3193 3194 // Check if we can and have to zoom from thumbnail 3195 //================================================ 3196 3197 getThumbPos: function (slide) { 3198 var rez = false, 3199 $thumb = slide.$thumb, 3200 thumbPos, 3201 btw, 3202 brw, 3203 bbw, 3204 blw; 3205 3206 if (!$thumb || !inViewport($thumb[0])) { 3207 return false; 3208 } 3209 3210 thumbPos = $.fancybox.getTranslate($thumb); 3211 3212 btw = parseFloat($thumb.css("border-top-width") || 0); 3213 brw = parseFloat($thumb.css("border-right-width") || 0); 3214 bbw = parseFloat($thumb.css("border-bottom-width") || 0); 3215 blw = parseFloat($thumb.css("border-left-width") || 0); 3216 3217 rez = { 3218 top: thumbPos.top + btw, 3219 left: thumbPos.left + blw, 3220 width: thumbPos.width - brw - blw, 3221 height: thumbPos.height - btw - bbw, 3222 scaleX: 1, 3223 scaleY: 1 3224 }; 3225 3226 return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false; 3227 }, 3228 3229 // Final adjustments after current gallery item is moved to position 3230 // and it`s content is loaded 3231 // ================================================================== 3232 3233 complete: function () { 3234 var self = this, 3235 current = self.current, 3236 slides = {}, 3237 $el; 3238 3239 if (self.isMoved() || !current.isLoaded) { 3240 return; 3241 } 3242 3243 if (!current.isComplete) { 3244 current.isComplete = true; 3245 3246 current.$slide.siblings().trigger("onReset"); 3247 3248 self.preload("inline"); 3249 3250 // Trigger any CSS transiton inside the slide 3251 forceRedraw(current.$slide); 3252 3253 current.$slide.addClass("fancybox-slide--complete"); 3254 3255 // Remove unnecessary slides 3256 $.each(self.slides, function (key, slide) { 3257 if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) { 3258 slides[slide.pos] = slide; 3259 } else if (slide) { 3260 $.fancybox.stop(slide.$slide); 3261 3262 slide.$slide.off().remove(); 3263 } 3264 }); 3265 3266 self.slides = slides; 3267 } 3268 3269 self.isAnimating = false; 3270 3271 self.updateCursor(); 3272 3273 self.trigger("afterShow"); 3274 3275 // Autoplay first html5 video/audio 3276 if (!!current.opts.video.autoStart) { 3277 current.$slide 3278 .find("video,audio") 3279 .filter(":visible:first") 3280 .trigger("play") 3281 .one("ended", function () { 3282 if (Document.exitFullscreen) { 3283 Document.exitFullscreen(); 3284 } else if (this.webkitExitFullscreen) { 3285 this.webkitExitFullscreen(); 3286 } 3287 3288 self.next(); 3289 }); 3290 } 3291 3292 // Try to focus on the first focusable element 3293 if (current.opts.autoFocus && current.contentType === "html") { 3294 // Look for the first input with autofocus attribute 3295 $el = current.$content.find("input[autofocus]:enabled:visible:first"); 3296 3297 if ($el.length) { 3298 $el.trigger("focus"); 3299 } else { 3300 self.focus(null, true); 3301 } 3302 } 3303 3304 // Avoid jumping 3305 current.$slide.scrollTop(0).scrollLeft(0); 3306 }, 3307 3308 // Preload next and previous slides 3309 // ================================ 3310 3311 preload: function (type) { 3312 var self = this, 3313 prev, 3314 next; 3315 3316 if (self.group.length < 2) { 3317 return; 3318 } 3319 3320 next = self.slides[self.currPos + 1]; 3321 prev = self.slides[self.currPos - 1]; 3322 3323 if (prev && prev.type === type) { 3324 self.loadSlide(prev); 3325 } 3326 3327 if (next && next.type === type) { 3328 self.loadSlide(next); 3329 } 3330 }, 3331 3332 // Try to find and focus on the first focusable element 3333 // ==================================================== 3334 3335 focus: function (e, firstRun) { 3336 var self = this, 3337 focusableStr = [ 3338 "a[href]", 3339 "area[href]", 3340 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 3341 "select:not([disabled]):not([aria-hidden])", 3342 "textarea:not([disabled]):not([aria-hidden])", 3343 "button:not([disabled]):not([aria-hidden])", 3344 "iframe", 3345 "object", 3346 "embed", 3347 "video", 3348 "audio", 3349 "[contenteditable]", 3350 '[tabindex]:not([tabindex^="-"])' 3351 ].join(","), 3352 focusableItems, 3353 focusedItemIndex; 3354 3355 if (self.isClosing) { 3356 return; 3357 } 3358 3359 if (e || !self.current || !self.current.isComplete) { 3360 // Focus on any element inside fancybox 3361 focusableItems = self.$refs.container.find("*:visible"); 3362 } else { 3363 // Focus inside current slide 3364 focusableItems = self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)" : "")); 3365 } 3366 3367 focusableItems = focusableItems.filter(focusableStr).filter(function () { 3368 return $(this).css("visibility") !== "hidden" && !$(this).hasClass("disabled"); 3369 }); 3370 3371 if (focusableItems.length) { 3372 focusedItemIndex = focusableItems.index(document.activeElement); 3373 3374 if (e && e.shiftKey) { 3375 // Back tab 3376 if (focusedItemIndex < 0 || focusedItemIndex == 0) { 3377 e.preventDefault(); 3378 3379 focusableItems.eq(focusableItems.length - 1).trigger("focus"); 3380 } 3381 } else { 3382 // Outside or Forward tab 3383 if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) { 3384 if (e) { 3385 e.preventDefault(); 3386 } 3387 3388 focusableItems.eq(0).trigger("focus"); 3389 } 3390 } 3391 } else { 3392 self.$refs.container.trigger("focus"); 3393 } 3394 }, 3395 3396 // Activates current instance - brings container to the front and enables keyboard, 3397 // notifies other instances about deactivating 3398 // ================================================================================= 3399 3400 activate: function () { 3401 var self = this; 3402 3403 // Deactivate all instances 3404 $(".fancybox-container").each(function () { 3405 var instance = $(this).data("FancyBox"); 3406 3407 // Skip self and closing instances 3408 if (instance && instance.id !== self.id && !instance.isClosing) { 3409 instance.trigger("onDeactivate"); 3410 3411 instance.removeEvents(); 3412 3413 instance.isVisible = false; 3414 } 3415 }); 3416 3417 self.isVisible = true; 3418 3419 if (self.current || self.isIdle) { 3420 self.update(); 3421 3422 self.updateControls(); 3423 } 3424 3425 self.trigger("onActivate"); 3426 3427 self.addEvents(); 3428 }, 3429 3430 // Start closing procedure 3431 // This will start "zoom-out" animation if needed and clean everything up afterwards 3432 // ================================================================================= 3433 3434 close: function (e, d) { 3435 var self = this, 3436 current = self.current, 3437 effect, 3438 duration, 3439 $content, 3440 domRect, 3441 opacity, 3442 start, 3443 end; 3444 3445 var done = function () { 3446 self.cleanUp(e); 3447 }; 3448 3449 if (self.isClosing) { 3450 return false; 3451 } 3452 3453 self.isClosing = true; 3454 3455 // If beforeClose callback prevents closing, make sure content is centered 3456 if (self.trigger("beforeClose", e) === false) { 3457 self.isClosing = false; 3458 3459 requestAFrame(function () { 3460 self.update(); 3461 }); 3462 3463 return false; 3464 } 3465 3466 // Remove all events 3467 // If there are multiple instances, they will be set again by "activate" method 3468 self.removeEvents(); 3469 3470 $content = current.$content; 3471 effect = current.opts.animationEffect; 3472 duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0; 3473 3474 current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"); 3475 3476 if (e !== true) { 3477 $.fancybox.stop(current.$slide); 3478 } else { 3479 effect = false; 3480 } 3481 3482 // Remove other slides 3483 current.$slide 3484 .siblings() 3485 .trigger("onReset") 3486 .remove(); 3487 3488 // Trigger animations 3489 if (duration) { 3490 self.$refs.container 3491 .removeClass("fancybox-is-open") 3492 .addClass("fancybox-is-closing") 3493 .css("transition-duration", duration + "ms"); 3494 } 3495 3496 // Clean up 3497 self.hideLoading(current); 3498 3499 self.hideControls(true); 3500 3501 self.updateCursor(); 3502 3503 // Check if possible to zoom-out 3504 if ( 3505 effect === "zoom" && 3506 !($content && duration && current.type === "image" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current))) 3507 ) { 3508 effect = "fade"; 3509 } 3510 3511 if (effect === "zoom") { 3512 $.fancybox.stop($content); 3513 3514 domRect = $.fancybox.getTranslate($content); 3515 3516 start = { 3517 top: domRect.top, 3518 left: domRect.left, 3519 scaleX: domRect.width / end.width, 3520 scaleY: domRect.height / end.height, 3521 width: end.width, 3522 height: end.height 3523 }; 3524 3525 // Check if we need to animate opacity 3526 opacity = current.opts.zoomOpacity; 3527 3528 if (opacity == "auto") { 3529 opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1; 3530 } 3531 3532 if (opacity) { 3533 end.opacity = 0; 3534 } 3535 3536 $.fancybox.setTranslate($content, start); 3537 3538 forceRedraw($content); 3539 3540 $.fancybox.animate($content, end, duration, done); 3541 3542 return true; 3543 } 3544 3545 if (effect && duration) { 3546 $.fancybox.animate( 3547 current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"), 3548 "fancybox-animated fancybox-fx-" + effect, 3549 duration, 3550 done 3551 ); 3552 } else { 3553 // If skip animation 3554 if (e === true) { 3555 setTimeout(done, duration); 3556 } else { 3557 done(); 3558 } 3559 } 3560 3561 return true; 3562 }, 3563 3564 // Final adjustments after removing the instance 3565 // ============================================= 3566 3567 cleanUp: function (e) { 3568 var self = this, 3569 instance, 3570 $focus = self.current.opts.$orig, 3571 x, 3572 y; 3573 3574 self.current.$slide.trigger("onReset"); 3575 3576 self.$refs.container.empty().remove(); 3577 3578 self.trigger("afterClose", e); 3579 3580 // Place back focus 3581 if (!!self.current.opts.backFocus) { 3582 if (!$focus || !$focus.length || !$focus.is(":visible")) { 3583 $focus = self.$trigger; 3584 } 3585 3586 if ($focus && $focus.length) { 3587 x = window.scrollX; 3588 y = window.scrollY; 3589 3590 $focus.trigger("focus"); 3591 3592 $("html, body") 3593 .scrollTop(y) 3594 .scrollLeft(x); 3595 } 3596 } 3597 3598 self.current = null; 3599 3600 // Check if there are other instances 3601 instance = $.fancybox.getInstance(); 3602 3603 if (instance) { 3604 instance.activate(); 3605 } else { 3606 $("body").removeClass("fancybox-active compensate-for-scrollbar"); 3607 3608 $("#fancybox-style-noscroll").remove(); 3609 } 3610 }, 3611 3612 // Call callback and trigger an event 3613 // ================================== 3614 3615 trigger: function (name, slide) { 3616 var args = Array.prototype.slice.call(arguments, 1), 3617 self = this, 3618 obj = slide && slide.opts ? slide : self.current, 3619 rez; 3620 3621 if (obj) { 3622 args.unshift(obj); 3623 } else { 3624 obj = self; 3625 } 3626 3627 args.unshift(self); 3628 3629 if ($.isFunction(obj.opts[name])) { 3630 rez = obj.opts[name].apply(obj, args); 3631 } 3632 3633 if (rez === false) { 3634 return rez; 3635 } 3636 3637 if (name === "afterClose" || !self.$refs) { 3638 $D.trigger(name + ".fb", args); 3639 } else { 3640 self.$refs.container.trigger(name + ".fb", args); 3641 } 3642 }, 3643 3644 // Update infobar values, navigation button states and reveal caption 3645 // ================================================================== 3646 3647 updateControls: function () { 3648 var self = this, 3649 current = self.current, 3650 index = current.index, 3651 $container = self.$refs.container, 3652 $caption = self.$refs.caption, 3653 caption = current.opts.caption; 3654 3655 // Recalculate content dimensions 3656 current.$slide.trigger("refresh"); 3657 3658 // Set caption 3659 if (caption && caption.length) { 3660 self.$caption = $caption; 3661 3662 $caption 3663 .children() 3664 .eq(0) 3665 .html(caption); 3666 } else { 3667 self.$caption = null; 3668 } 3669 3670 if (!self.hasHiddenControls && !self.isIdle) { 3671 self.showControls(); 3672 } 3673 3674 // Update info and navigation elements 3675 $container.find("[data-fancybox-count]").html(self.group.length); 3676 $container.find("[data-fancybox-index]").html(index + 1); 3677 3678 $container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop && index <= 0); 3679 $container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop && index >= self.group.length - 1); 3680 3681 if (current.type === "image") { 3682 // Re-enable buttons; update download button source 3683 $container 3684 .find("[data-fancybox-zoom]") 3685 .show() 3686 .end() 3687 .find("[data-fancybox-download]") 3688 .attr("href", current.opts.image.src || current.src) 3689 .show(); 3690 } else if (current.opts.toolbar) { 3691 $container.find("[data-fancybox-download],[data-fancybox-zoom]").hide(); 3692 } 3693 3694 // Make sure focus is not on disabled button/element 3695 if ($(document.activeElement).is(":hidden,[disabled]")) { 3696 self.$refs.container.trigger("focus"); 3697 } 3698 }, 3699 3700 // Hide toolbar and caption 3701 // ======================== 3702 3703 hideControls: function (andCaption) { 3704 var self = this, 3705 arr = ["infobar", "toolbar", "nav"]; 3706 3707 if (andCaption || !self.current.opts.preventCaptionOverlap) { 3708 arr.push("caption"); 3709 } 3710 3711 this.$refs.container.removeClass( 3712 arr 3713 .map(function (i) { 3714 return "fancybox-show-" + i; 3715 }) 3716 .join(" ") 3717 ); 3718 3719 this.hasHiddenControls = true; 3720 }, 3721 3722 showControls: function () { 3723 var self = this, 3724 opts = self.current ? self.current.opts : self.opts, 3725 $container = self.$refs.container; 3726 3727 self.hasHiddenControls = false; 3728 self.idleSecondsCounter = 0; 3729 3730 $container 3731 .toggleClass("fancybox-show-toolbar", !!(opts.toolbar && opts.buttons)) 3732 .toggleClass("fancybox-show-infobar", !!(opts.infobar && self.group.length > 1)) 3733 .toggleClass("fancybox-show-caption", !!self.$caption) 3734 .toggleClass("fancybox-show-nav", !!(opts.arrows && self.group.length > 1)) 3735 .toggleClass("fancybox-is-modal", !!opts.modal); 3736 }, 3737 3738 // Toggle toolbar and caption 3739 // ========================== 3740 3741 toggleControls: function () { 3742 if (this.hasHiddenControls) { 3743 this.showControls(); 3744 } else { 3745 this.hideControls(); 3746 } 3747 } 3748 }); 3749 3750 $.fancybox = { 3751 version: "3.5.7", 3752 defaults: defaults, 3753 3754 // Get current instance and execute a command. 3755 // 3756 // Examples of usage: 3757 // 3758 // $instance = $.fancybox.getInstance(); 3759 // $.fancybox.getInstance().jumpTo( 1 ); 3760 // $.fancybox.getInstance( 'jumpTo', 1 ); 3761 // $.fancybox.getInstance( function() { 3762 // console.info( this.currIndex ); 3763 // }); 3764 // ====================================================== 3765 3766 getInstance: function (command) { 3767 var instance = $('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"), 3768 args = Array.prototype.slice.call(arguments, 1); 3769 3770 if (instance instanceof FancyBox) { 3771 if ($.type(command) === "string") { 3772 instance[command].apply(instance, args); 3773 } else if ($.type(command) === "function") { 3774 command.apply(instance, args); 3775 } 3776 3777 return instance; 3778 } 3779 3780 return false; 3781 }, 3782 3783 // Create new instance 3784 // =================== 3785 3786 open: function (items, opts, index) { 3787 return new FancyBox(items, opts, index); 3788 }, 3789 3790 // Close current or all instances 3791 // ============================== 3792 3793 close: function (all) { 3794 var instance = this.getInstance(); 3795 3796 if (instance) { 3797 instance.close(); 3798 3799 // Try to find and close next instance 3800 if (all === true) { 3801 this.close(all); 3802 } 3803 } 3804 }, 3805 3806 // Close all instances and unbind all events 3807 // ========================================= 3808 3809 destroy: function () { 3810 this.close(true); 3811 3812 $D.add("body").off("click.fb-start", "**"); 3813 }, 3814 3815 // Try to detect mobile devices 3816 // ============================ 3817 3818 isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 3819 3820 // Detect if 'translate3d' support is available 3821 // ============================================ 3822 3823 use3d: (function () { 3824 var div = document.createElement("div"); 3825 3826 return ( 3827 window.getComputedStyle && 3828 window.getComputedStyle(div) && 3829 window.getComputedStyle(div).getPropertyValue("transform") && 3830 !(document.documentMode && document.documentMode < 11) 3831 ); 3832 })(), 3833 3834 // Helper function to get current visual state of an element 3835 // returns array[ top, left, horizontal-scale, vertical-scale, opacity ] 3836 // ===================================================================== 3837 3838 getTranslate: function ($el) { 3839 var domRect; 3840 3841 if (!$el || !$el.length) { 3842 return false; 3843 } 3844 3845 domRect = $el[0].getBoundingClientRect(); 3846 3847 return { 3848 top: domRect.top || 0, 3849 left: domRect.left || 0, 3850 width: domRect.width, 3851 height: domRect.height, 3852 opacity: parseFloat($el.css("opacity")) 3853 }; 3854 }, 3855 3856 // Shortcut for setting "translate3d" properties for element 3857 // Can set be used to set opacity, too 3858 // ======================================================== 3859 3860 setTranslate: function ($el, props) { 3861 var str = "", 3862 css = {}; 3863 3864 if (!$el || !props) { 3865 return; 3866 } 3867 3868 if (props.left !== undefined || props.top !== undefined) { 3869 str = 3870 (props.left === undefined ? $el.position().left : props.left) + 3871 "px, " + 3872 (props.top === undefined ? $el.position().top : props.top) + 3873 "px"; 3874 3875 if (this.use3d) { 3876 str = "translate3d(" + str + ", 0px)"; 3877 } else { 3878 str = "translate(" + str + ")"; 3879 } 3880 } 3881 3882 if (props.scaleX !== undefined && props.scaleY !== undefined) { 3883 str += " scale(" + props.scaleX + ", " + props.scaleY + ")"; 3884 } else if (props.scaleX !== undefined) { 3885 str += " scaleX(" + props.scaleX + ")"; 3886 } 3887 3888 if (str.length) { 3889 css.transform = str; 3890 } 3891 3892 if (props.opacity !== undefined) { 3893 css.opacity = props.opacity; 3894 } 3895 3896 if (props.width !== undefined) { 3897 css.width = props.width; 3898 } 3899 3900 if (props.height !== undefined) { 3901 css.height = props.height; 3902 } 3903 3904 return $el.css(css); 3905 }, 3906 3907 // Simple CSS transition handler 3908 // ============================= 3909 3910 animate: function ($el, to, duration, callback, leaveAnimationName) { 3911 var self = this, 3912 from; 3913 3914 if ($.isFunction(duration)) { 3915 callback = duration; 3916 duration = null; 3917 } 3918 3919 self.stop($el); 3920 3921 from = self.getTranslate($el); 3922 3923 $el.on(transitionEnd, function (e) { 3924 // Skip events from child elements and z-index change 3925 if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == "z-index")) { 3926 return; 3927 } 3928 3929 self.stop($el); 3930 3931 if ($.isNumeric(duration)) { 3932 $el.css("transition-duration", ""); 3933 } 3934 3935 if ($.isPlainObject(to)) { 3936 if (to.scaleX !== undefined && to.scaleY !== undefined) { 3937 self.setTranslate($el, { 3938 top: to.top, 3939 left: to.left, 3940 width: from.width * to.scaleX, 3941 height: from.height * to.scaleY, 3942 scaleX: 1, 3943 scaleY: 1 3944 }); 3945 } 3946 } else if (leaveAnimationName !== true) { 3947 $el.removeClass(to); 3948 } 3949 3950 if ($.isFunction(callback)) { 3951 callback(e); 3952 } 3953 }); 3954 3955 if ($.isNumeric(duration)) { 3956 $el.css("transition-duration", duration + "ms"); 3957 } 3958 3959 // Start animation by changing CSS properties or class name 3960 if ($.isPlainObject(to)) { 3961 if (to.scaleX !== undefined && to.scaleY !== undefined) { 3962 delete to.width; 3963 delete to.height; 3964 3965 if ($el.parent().hasClass("fancybox-slide--image")) { 3966 $el.parent().addClass("fancybox-is-scaling"); 3967 } 3968 } 3969 3970 $.fancybox.setTranslate($el, to); 3971 } else { 3972 $el.addClass(to); 3973 } 3974 3975 // Make sure that `transitionend` callback gets fired 3976 $el.data( 3977 "timer", 3978 setTimeout(function () { 3979 $el.trigger(transitionEnd); 3980 }, duration + 33) 3981 ); 3982 }, 3983 3984 stop: function ($el, callCallback) { 3985 if ($el && $el.length) { 3986 clearTimeout($el.data("timer")); 3987 3988 if (callCallback) { 3989 $el.trigger(transitionEnd); 3990 } 3991 3992 $el.off(transitionEnd).css("transition-duration", ""); 3993 3994 $el.parent().removeClass("fancybox-is-scaling"); 3995 } 3996 } 3997 }; 3998 3999 // Default click handler for "fancyboxed" links 4000 // ============================================ 4001 4002 function _run(e, opts) { 4003 var items = [], 4004 index = 0, 4005 $target, 4006 value, 4007 instance; 4008 4009 // Avoid opening multiple times 4010 if (e && e.isDefaultPrevented()) { 4011 return; 4012 } 4013 4014 e.preventDefault(); 4015 4016 opts = opts || {}; 4017 4018 if (e && e.data) { 4019 opts = mergeOpts(e.data.options, opts); 4020 } 4021 4022 $target = opts.$target || $(e.currentTarget).trigger("blur"); 4023 instance = $.fancybox.getInstance(); 4024 4025 if (instance && instance.$trigger && instance.$trigger.is($target)) { 4026 return; 4027 } 4028 4029 if (opts.selector) { 4030 items = $(opts.selector); 4031 } else { 4032 // Get all related items and find index for clicked one 4033 value = $target.attr("data-fancybox") || ""; 4034 4035 if (value) { 4036 items = e.data ? e.data.items : []; 4037 items = items.length ? items.filter('[data-fancybox="' + value + '"]') : $('[data-fancybox="' + value + '"]'); 4038 } else { 4039 items = [$target]; 4040 } 4041 } 4042 4043 index = $(items).index($target); 4044 4045 // Sometimes current item can not be found 4046 if (index < 0) { 4047 index = 0; 4048 } 4049 4050 instance = $.fancybox.open(items, opts, index); 4051 4052 // Save last active element 4053 instance.$trigger = $target; 4054 } 4055 4056 // Create a jQuery plugin 4057 // ====================== 4058 4059 $.fn.fancybox = function (options) { 4060 var selector; 4061 4062 options = options || {}; 4063 selector = options.selector || false; 4064 4065 if (selector) { 4066 // Use body element instead of document so it executes first 4067 $("body") 4068 .off("click.fb-start", selector) 4069 .on("click.fb-start", selector, { 4070 options: options 4071 }, _run); 4072 } else { 4073 this.off("click.fb-start").on( 4074 "click.fb-start", { 4075 items: this, 4076 options: options 4077 }, 4078 _run 4079 ); 4080 } 4081 4082 return this; 4083 }; 4084 4085 // Self initializing plugin for all elements having `data-fancybox` attribute 4086 // ========================================================================== 4087 4088 $D.on("click.fb-start", "[data-fancybox]", _run); 4089 4090 // Enable "trigger elements" 4091 // ========================= 4092 4093 $D.on("click.fb-start", "[data-fancybox-trigger]", function (e) { 4094 $('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]') 4095 .eq($(this).attr("data-fancybox-index") || 0) 4096 .trigger("click.fb-start", { 4097 $trigger: $(this) 4098 }); 4099 }); 4100 4101 // Track focus event for better accessibility styling 4102 // ================================================== 4103 (function () { 4104 var buttonStr = ".fancybox-button", 4105 focusStr = "fancybox-focus", 4106 $pressed = null; 4107 4108 $D.on("mousedown mouseup focus blur", buttonStr, function (e) { 4109 switch (e.type) { 4110 case "mousedown": 4111 $pressed = $(this); 4112 break; 4113 case "mouseup": 4114 $pressed = null; 4115 break; 4116 case "focusin": 4117 $(buttonStr).removeClass(focusStr); 4118 4119 if (!$(this).is($pressed) && !$(this).is("[disabled]")) { 4120 $(this).addClass(focusStr); 4121 } 4122 break; 4123 case "focusout": 4124 $(buttonStr).removeClass(focusStr); 4125 break; 4126 } 4127 }); 4128 })(); 4129})(window, document, jQuery); 4130// ========================================================================== 4131// 4132// Media 4133// Adds additional media type support 4134// 4135// ========================================================================== 4136(function ($) { 4137 "use strict"; 4138 4139 // Object containing properties for each media type 4140 var defaults = { 4141 youtube: { 4142 matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i, 4143 params: { 4144 autoplay: 1, 4145 autohide: 1, 4146 fs: 1, 4147 rel: 0, 4148 hd: 1, 4149 wmode: "transparent", 4150 enablejsapi: 1, 4151 html5: 1 4152 }, 4153 paramPlace: 8, 4154 type: "iframe", 4155 url: "https://www.youtube-nocookie.com/embed/$4", 4156 thumb: "https://img.youtube.com/vi/$4/hqdefault.jpg" 4157 }, 4158 4159 vimeo: { 4160 matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/, 4161 params: { 4162 autoplay: 1, 4163 hd: 1, 4164 show_title: 1, 4165 show_byline: 1, 4166 show_portrait: 0, 4167 fullscreen: 1 4168 }, 4169 paramPlace: 3, 4170 type: "iframe", 4171 url: "//player.vimeo.com/video/$2" 4172 }, 4173 4174 instagram: { 4175 matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 4176 type: "image", 4177 url: "//$1/p/$2/media/?size=l" 4178 }, 4179 4180 // Examples: 4181 // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 4182 // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z 4183 // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en 4184 // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572 4185 gmap_place: { 4186 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i, 4187 type: "iframe", 4188 url: function (rez) { 4189 return ( 4190 "//maps.google." + 4191 rez[2] + 4192 "/?ll=" + 4193 (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") + 4194 "&output=" + 4195 (rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed") 4196 ); 4197 } 4198 }, 4199 4200 // Examples: 4201 // https://www.google.com/maps/search/Empire+State+Building/ 4202 // https://www.google.com/maps/search/?api=1&query=centurylink+field 4203 // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393 4204 gmap_search: { 4205 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i, 4206 type: "iframe", 4207 url: function (rez) { 4208 return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed"; 4209 } 4210 } 4211 }; 4212 4213 // Formats matching url to final form 4214 var format = function (url, rez, params) { 4215 if (!url) { 4216 return; 4217 } 4218 4219 params = params || ""; 4220 4221 if ($.type(params) === "object") { 4222 params = $.param(params, true); 4223 } 4224 4225 $.each(rez, function (key, value) { 4226 url = url.replace("$" + key, value || ""); 4227 }); 4228 4229 if (params.length) { 4230 url += (url.indexOf("?") > 0 ? "&" : "?") + params; 4231 } 4232 4233 return url; 4234 }; 4235 4236 $(document).on("objectNeedsType.fb", function (e, instance, item) { 4237 var url = item.src || "", 4238 type = false, 4239 media, 4240 thumb, 4241 rez, 4242 params, 4243 urlParams, 4244 paramObj, 4245 provider; 4246 4247 media = $.extend(true, {}, defaults, item.opts.media); 4248 4249 // Look for any matching media type 4250 $.each(media, function (providerName, providerOpts) { 4251 rez = url.match(providerOpts.matcher); 4252 4253 if (!rez) { 4254 return; 4255 } 4256 4257 type = providerOpts.type; 4258 provider = providerName; 4259 paramObj = {}; 4260 4261 if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) { 4262 urlParams = rez[providerOpts.paramPlace]; 4263 4264 if (urlParams[0] == "?") { 4265 urlParams = urlParams.substring(1); 4266 } 4267 4268 urlParams = urlParams.split("&"); 4269 4270 for (var m = 0; m < urlParams.length; ++m) { 4271 var p = urlParams[m].split("=", 2); 4272 4273 if (p.length == 2) { 4274 paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 4275 } 4276 } 4277 } 4278 4279 params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj); 4280 4281 url = 4282 $.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params); 4283 4284 thumb = 4285 $.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez); 4286 4287 if (providerName === "youtube") { 4288 url = url.replace(/&t=((\d+)m)?(\d+)s/, function (match, p1, m, s) { 4289 return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10)); 4290 }); 4291 } else if (providerName === "vimeo") { 4292 url = url.replace("&%23", "#"); 4293 } 4294 4295 return false; 4296 }); 4297 4298 // If it is found, then change content type and update the url 4299 4300 if (type) { 4301 if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) { 4302 item.opts.thumb = thumb; 4303 } 4304 4305 if (type === "iframe") { 4306 item.opts = $.extend(true, item.opts, { 4307 iframe: { 4308 preload: false, 4309 attr: { 4310 scrolling: "no" 4311 } 4312 } 4313 }); 4314 } 4315 4316 $.extend(item, { 4317 type: type, 4318 src: url, 4319 origSrc: item.src, 4320 contentSource: provider, 4321 contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video" 4322 }); 4323 } else if (url) { 4324 item.type = item.opts.defaultType; 4325 } 4326 }); 4327 4328 // Load YouTube/Video API on request to detect when video finished playing 4329 var VideoAPILoader = { 4330 youtube: { 4331 src: "https://www.youtube.com/iframe_api", 4332 class: "YT", 4333 loading: false, 4334 loaded: false 4335 }, 4336 4337 vimeo: { 4338 src: "https://player.vimeo.com/api/player.js", 4339 class: "Vimeo", 4340 loading: false, 4341 loaded: false 4342 }, 4343 4344 load: function (vendor) { 4345 var _this = this, 4346 script; 4347 4348 if (this[vendor].loaded) { 4349 setTimeout(function () { 4350 _this.done(vendor); 4351 }); 4352 return; 4353 } 4354 4355 if (this[vendor].loading) { 4356 return; 4357 } 4358 4359 this[vendor].loading = true; 4360 4361 script = document.createElement("script"); 4362 script.type = "text/javascript"; 4363 script.src = this[vendor].src; 4364 4365 if (vendor === "youtube") { 4366 window.onYouTubeIframeAPIReady = function () { 4367 _this[vendor].loaded = true; 4368 _this.done(vendor); 4369 }; 4370 } else { 4371 script.onload = function () { 4372 _this[vendor].loaded = true; 4373 _this.done(vendor); 4374 }; 4375 } 4376 4377 document.body.appendChild(script); 4378 }, 4379 done: function (vendor) { 4380 var instance, $el, player; 4381 4382 if (vendor === "youtube") { 4383 delete window.onYouTubeIframeAPIReady; 4384 } 4385 4386 instance = $.fancybox.getInstance(); 4387 4388 if (instance) { 4389 $el = instance.current.$content.find("iframe"); 4390 4391 if (vendor === "youtube" && YT !== undefined && YT) { 4392 player = new YT.Player($el.attr("id"), { 4393 events: { 4394 onStateChange: function (e) { 4395 if (e.data == 0) { 4396 instance.next(); 4397 } 4398 } 4399 } 4400 }); 4401 } else if (vendor === "vimeo" && Vimeo !== undefined && Vimeo) { 4402 player = new Vimeo.Player($el); 4403 4404 player.on("ended", function () { 4405 instance.next(); 4406 }); 4407 } 4408 } 4409 } 4410 }; 4411 4412 $(document).on({ 4413 "afterShow.fb": function (e, instance, current) { 4414 if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) { 4415 VideoAPILoader.load(current.contentSource); 4416 } 4417 } 4418 }); 4419})(jQuery); 4420// ========================================================================== 4421// 4422// Guestures 4423// Adds touch guestures, handles click and tap events 4424// 4425// ========================================================================== 4426(function (window, document, $) { 4427 "use strict"; 4428 4429 var requestAFrame = (function () { 4430 return ( 4431 window.requestAnimationFrame || 4432 window.webkitRequestAnimationFrame || 4433 window.mozRequestAnimationFrame || 4434 window.oRequestAnimationFrame || 4435 // if all else fails, use setTimeout 4436 function (callback) { 4437 return window.setTimeout(callback, 1000 / 60); 4438 } 4439 ); 4440 })(); 4441 4442 var cancelAFrame = (function () { 4443 return ( 4444 window.cancelAnimationFrame || 4445 window.webkitCancelAnimationFrame || 4446 window.mozCancelAnimationFrame || 4447 window.oCancelAnimationFrame || 4448 function (id) { 4449 window.clearTimeout(id); 4450 } 4451 ); 4452 })(); 4453 4454 var getPointerXY = function (e) { 4455 var result = []; 4456 4457 e = e.originalEvent || e || window.e; 4458 e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e]; 4459 4460 for (var key in e) { 4461 if (e[key].pageX) { 4462 result.push({ 4463 x: e[key].pageX, 4464 y: e[key].pageY 4465 }); 4466 } else if (e[key].clientX) { 4467 result.push({ 4468 x: e[key].clientX, 4469 y: e[key].clientY 4470 }); 4471 } 4472 } 4473 4474 return result; 4475 }; 4476 4477 var distance = function (point2, point1, what) { 4478 if (!point1 || !point2) { 4479 return 0; 4480 } 4481 4482 if (what === "x") { 4483 return point2.x - point1.x; 4484 } else if (what === "y") { 4485 return point2.y - point1.y; 4486 } 4487 4488 return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2)); 4489 }; 4490 4491 var isClickable = function ($el) { 4492 if ( 4493 $el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') || 4494 $.isFunction($el.get(0).onclick) || 4495 $el.data("selectable") 4496 ) { 4497 return true; 4498 } 4499 4500 // Check for attributes like data-fancybox-next or data-fancybox-close 4501 for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) { 4502 if (atts[i].nodeName.substr(0, 14) === "data-fancybox-") { 4503 return true; 4504 } 4505 } 4506 4507 return false; 4508 }; 4509 4510 var hasScrollbars = function (el) { 4511 var overflowY = window.getComputedStyle(el)["overflow-y"], 4512 overflowX = window.getComputedStyle(el)["overflow-x"], 4513 vertical = (overflowY === "scroll" || overflowY === "auto") && el.scrollHeight > el.clientHeight, 4514 horizontal = (overflowX === "scroll" || overflowX === "auto") && el.scrollWidth > el.clientWidth; 4515 4516 return vertical || horizontal; 4517 }; 4518 4519 var isScrollable = function ($el) { 4520 var rez = false; 4521 4522 while (true) { 4523 rez = hasScrollbars($el.get(0)); 4524 4525 if (rez) { 4526 break; 4527 } 4528 4529 $el = $el.parent(); 4530 4531 if (!$el.length || $el.hasClass("fancybox-stage") || $el.is("body")) { 4532 break; 4533 } 4534 } 4535 4536 return rez; 4537 }; 4538 4539 var Guestures = function (instance) { 4540 var self = this; 4541 4542 self.instance = instance; 4543 4544 self.$bg = instance.$refs.bg; 4545 self.$stage = instance.$refs.stage; 4546 self.$container = instance.$refs.container; 4547 4548 self.destroy(); 4549 4550 self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart")); 4551 }; 4552 4553 Guestures.prototype.destroy = function () { 4554 var self = this; 4555 4556 self.$container.off(".fb.touch"); 4557 4558 $(document).off(".fb.touch"); 4559 4560 if (self.requestId) { 4561 cancelAFrame(self.requestId); 4562 self.requestId = null; 4563 } 4564 4565 if (self.tapped) { 4566 clearTimeout(self.tapped); 4567 self.tapped = null; 4568 } 4569 }; 4570 4571 Guestures.prototype.ontouchstart = function (e) { 4572 var self = this, 4573 $target = $(e.target), 4574 instance = self.instance, 4575 current = instance.current, 4576 $slide = current.$slide, 4577 $content = current.$content, 4578 isTouchDevice = e.type == "touchstart"; 4579 4580 // Do not respond to both (touch and mouse) events 4581 if (isTouchDevice) { 4582 self.$container.off("mousedown.fb.touch"); 4583 } 4584 4585 // Ignore right click 4586 if (e.originalEvent && e.originalEvent.button == 2) { 4587 return; 4588 } 4589 4590 // Ignore taping on links, buttons, input elements 4591 if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) { 4592 return; 4593 } 4594 // Ignore clicks on the scrollbar 4595 if (!$target.is("img") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) { 4596 return; 4597 } 4598 4599 // Ignore clicks while zooming or closing 4600 if (!current || instance.isAnimating || current.$slide.hasClass("fancybox-animated")) { 4601 e.stopPropagation(); 4602 e.preventDefault(); 4603 4604 return; 4605 } 4606 4607 self.realPoints = self.startPoints = getPointerXY(e); 4608 4609 if (!self.startPoints.length) { 4610 return; 4611 } 4612 4613 // Allow other scripts to catch touch event if "touch" is set to false 4614 if (current.touch) { 4615 e.stopPropagation(); 4616 } 4617 4618 self.startEvent = e; 4619 4620 self.canTap = true; 4621 self.$target = $target; 4622 self.$content = $content; 4623 self.opts = current.opts.touch; 4624 4625 self.isPanning = false; 4626 self.isSwiping = false; 4627 self.isZooming = false; 4628 self.isScrolling = false; 4629 self.canPan = instance.canPan(); 4630 4631 self.startTime = new Date().getTime(); 4632 self.distanceX = self.distanceY = self.distance = 0; 4633 4634 self.canvasWidth = Math.round($slide[0].clientWidth); 4635 self.canvasHeight = Math.round($slide[0].clientHeight); 4636 4637 self.contentLastPos = null; 4638 self.contentStartPos = $.fancybox.getTranslate(self.$content) || { 4639 top: 0, 4640 left: 0 4641 }; 4642 self.sliderStartPos = $.fancybox.getTranslate($slide); 4643 4644 // Since position will be absolute, but we need to make it relative to the stage 4645 self.stagePos = $.fancybox.getTranslate(instance.$refs.stage); 4646 4647 self.sliderStartPos.top -= self.stagePos.top; 4648 self.sliderStartPos.left -= self.stagePos.left; 4649 4650 self.contentStartPos.top -= self.stagePos.top; 4651 self.contentStartPos.left -= self.stagePos.left; 4652 4653 $(document) 4654 .off(".fb.touch") 4655 .on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch" : "mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend")) 4656 .on(isTouchDevice ? "touchmove.fb.touch" : "mousemove.fb.touch", $.proxy(self, "ontouchmove")); 4657 4658 if ($.fancybox.isMobile) { 4659 document.addEventListener("scroll", self.onscroll, true); 4660 } 4661 4662 // Skip if clicked outside the sliding area 4663 if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) { 4664 if ($target.is(".fancybox-image")) { 4665 e.preventDefault(); 4666 } 4667 4668 if (!($.fancybox.isMobile && $target.parents(".fancybox-caption").length)) { 4669 return; 4670 } 4671 } 4672 4673 self.isScrollable = isScrollable($target) || isScrollable($target.parent()); 4674 4675 // Check if element is scrollable and try to prevent default behavior (scrolling) 4676 if (!($.fancybox.isMobile && self.isScrollable)) { 4677 e.preventDefault(); 4678 } 4679 4680 // One finger or mouse click - swipe or pan an image 4681 if (self.startPoints.length === 1 || current.hasError) { 4682 if (self.canPan) { 4683 $.fancybox.stop(self.$content); 4684 4685 self.isPanning = true; 4686 } else { 4687 self.isSwiping = true; 4688 } 4689 4690 self.$container.addClass("fancybox-is-grabbing"); 4691 } 4692 4693 // Two fingers - zoom image 4694 if (self.startPoints.length === 2 && current.type === "image" && (current.isLoaded || current.$ghost)) { 4695 self.canTap = false; 4696 self.isSwiping = false; 4697 self.isPanning = false; 4698 4699 self.isZooming = true; 4700 4701 $.fancybox.stop(self.$content); 4702 4703 self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft(); 4704 self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop(); 4705 4706 self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width; 4707 self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height; 4708 4709 self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]); 4710 } 4711 }; 4712 4713 Guestures.prototype.onscroll = function (e) { 4714 var self = this; 4715 4716 self.isScrolling = true; 4717 4718 document.removeEventListener("scroll", self.onscroll, true); 4719 }; 4720 4721 Guestures.prototype.ontouchmove = function (e) { 4722 var self = this; 4723 4724 // Make sure user has not released over iframe or disabled element 4725 if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) { 4726 self.ontouchend(e); 4727 return; 4728 } 4729 4730 if (self.isScrolling) { 4731 self.canTap = false; 4732 return; 4733 } 4734 4735 self.newPoints = getPointerXY(e); 4736 4737 if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) { 4738 return; 4739 } 4740 4741 if (!(self.isSwiping && self.isSwiping === true)) { 4742 e.preventDefault(); 4743 } 4744 4745 self.distanceX = distance(self.newPoints[0], self.startPoints[0], "x"); 4746 self.distanceY = distance(self.newPoints[0], self.startPoints[0], "y"); 4747 4748 self.distance = distance(self.newPoints[0], self.startPoints[0]); 4749 4750 // Skip false ontouchmove events (Chrome) 4751 if (self.distance > 0) { 4752 if (self.isSwiping) { 4753 self.onSwipe(e); 4754 } else if (self.isPanning) { 4755 self.onPan(); 4756 } else if (self.isZooming) { 4757 self.onZoom(); 4758 } 4759 } 4760 }; 4761 4762 Guestures.prototype.onSwipe = function (e) { 4763 var self = this, 4764 instance = self.instance, 4765 swiping = self.isSwiping, 4766 left = self.sliderStartPos.left || 0, 4767 angle; 4768 4769 // If direction is not yet determined 4770 if (swiping === true) { 4771 // We need at least 10px distance to correctly calculate an angle 4772 if (Math.abs(self.distance) > 10) { 4773 self.canTap = false; 4774 4775 if (instance.group.length < 2 && self.opts.vertical) { 4776 self.isSwiping = "y"; 4777 } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === "auto" && $(window).width() > 800)) { 4778 self.isSwiping = "x"; 4779 } else { 4780 angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI); 4781 4782 self.isSwiping = angle > 45 && angle < 135 ? "y" : "x"; 4783 } 4784 4785 if (self.isSwiping === "y" && $.fancybox.isMobile && self.isScrollable) { 4786 self.isScrolling = true; 4787 4788 return; 4789 } 4790 4791 instance.isDragging = self.isSwiping; 4792 4793 // Reset points to avoid jumping, because we dropped first swipes to calculate the angle 4794 self.startPoints = self.newPoints; 4795 4796 $.each(instance.slides, function (index, slide) { 4797 var slidePos, stagePos; 4798 4799 $.fancybox.stop(slide.$slide); 4800 4801 slidePos = $.fancybox.getTranslate(slide.$slide); 4802 stagePos = $.fancybox.getTranslate(instance.$refs.stage); 4803 4804 slide.$slide 4805 .css({ 4806 transform: "", 4807 opacity: "", 4808 "transition-duration": "" 4809 }) 4810 .removeClass("fancybox-animated") 4811 .removeClass(function (index, className) { 4812 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 4813 }); 4814 4815 if (slide.pos === instance.current.pos) { 4816 self.sliderStartPos.top = slidePos.top - stagePos.top; 4817 self.sliderStartPos.left = slidePos.left - stagePos.left; 4818 } 4819 4820 $.fancybox.setTranslate(slide.$slide, { 4821 top: slidePos.top - stagePos.top, 4822 left: slidePos.left - stagePos.left 4823 }); 4824 }); 4825 4826 // Stop slideshow 4827 if (instance.SlideShow && instance.SlideShow.isActive) { 4828 instance.SlideShow.stop(); 4829 } 4830 } 4831 4832 return; 4833 } 4834 4835 // Sticky edges 4836 if (swiping == "x") { 4837 if ( 4838 self.distanceX > 0 && 4839 (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop)) 4840 ) { 4841 left = left + Math.pow(self.distanceX, 0.8); 4842 } else if ( 4843 self.distanceX < 0 && 4844 (self.instance.group.length < 2 || 4845 (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop)) 4846 ) { 4847 left = left - Math.pow(-self.distanceX, 0.8); 4848 } else { 4849 left = left + self.distanceX; 4850 } 4851 } 4852 4853 self.sliderLastPos = { 4854 top: swiping == "x" ? 0 : self.sliderStartPos.top + self.distanceY, 4855 left: left 4856 }; 4857 4858 if (self.requestId) { 4859 cancelAFrame(self.requestId); 4860 4861 self.requestId = null; 4862 } 4863 4864 self.requestId = requestAFrame(function () { 4865 if (self.sliderLastPos) { 4866 $.each(self.instance.slides, function (index, slide) { 4867 var pos = slide.pos - self.instance.currPos; 4868 4869 $.fancybox.setTranslate(slide.$slide, { 4870 top: self.sliderLastPos.top, 4871 left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter 4872 }); 4873 }); 4874 4875 self.$container.addClass("fancybox-is-sliding"); 4876 } 4877 }); 4878 }; 4879 4880 Guestures.prototype.onPan = function () { 4881 var self = this; 4882 4883 // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit) 4884 if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) { 4885 self.startPoints = self.newPoints; 4886 return; 4887 } 4888 4889 self.canTap = false; 4890 4891 self.contentLastPos = self.limitMovement(); 4892 4893 if (self.requestId) { 4894 cancelAFrame(self.requestId); 4895 } 4896 4897 self.requestId = requestAFrame(function () { 4898 $.fancybox.setTranslate(self.$content, self.contentLastPos); 4899 }); 4900 }; 4901 4902 // Make panning sticky to the edges 4903 Guestures.prototype.limitMovement = function () { 4904 var self = this; 4905 4906 var canvasWidth = self.canvasWidth; 4907 var canvasHeight = self.canvasHeight; 4908 4909 var distanceX = self.distanceX; 4910 var distanceY = self.distanceY; 4911 4912 var contentStartPos = self.contentStartPos; 4913 4914 var currentOffsetX = contentStartPos.left; 4915 var currentOffsetY = contentStartPos.top; 4916 4917 var currentWidth = contentStartPos.width; 4918 var currentHeight = contentStartPos.height; 4919 4920 var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY; 4921 4922 if (currentWidth > canvasWidth) { 4923 newOffsetX = currentOffsetX + distanceX; 4924 } else { 4925 newOffsetX = currentOffsetX; 4926 } 4927 4928 newOffsetY = currentOffsetY + distanceY; 4929 4930 // Slow down proportionally to traveled distance 4931 minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5); 4932 minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5); 4933 4934 maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5); 4935 maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5); 4936 4937 // -> 4938 if (distanceX > 0 && newOffsetX > minTranslateX) { 4939 newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0; 4940 } 4941 4942 // <- 4943 if (distanceX < 0 && newOffsetX < maxTranslateX) { 4944 newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0; 4945 } 4946 4947 // \/ 4948 if (distanceY > 0 && newOffsetY > minTranslateY) { 4949 newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0; 4950 } 4951 4952 // /\ 4953 if (distanceY < 0 && newOffsetY < maxTranslateY) { 4954 newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0; 4955 } 4956 4957 return { 4958 top: newOffsetY, 4959 left: newOffsetX 4960 }; 4961 }; 4962 4963 Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) { 4964 var self = this; 4965 4966 var canvasWidth = self.canvasWidth; 4967 var canvasHeight = self.canvasHeight; 4968 4969 if (newWidth > canvasWidth) { 4970 newOffsetX = newOffsetX > 0 ? 0 : newOffsetX; 4971 newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX; 4972 } else { 4973 // Center horizontally 4974 newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2); 4975 } 4976 4977 if (newHeight > canvasHeight) { 4978 newOffsetY = newOffsetY > 0 ? 0 : newOffsetY; 4979 newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY; 4980 } else { 4981 // Center vertically 4982 newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2); 4983 } 4984 4985 return { 4986 top: newOffsetY, 4987 left: newOffsetX 4988 }; 4989 }; 4990 4991 Guestures.prototype.onZoom = function () { 4992 var self = this; 4993 4994 // Calculate current distance between points to get pinch ratio and new width and height 4995 var contentStartPos = self.contentStartPos; 4996 4997 var currentWidth = contentStartPos.width; 4998 var currentHeight = contentStartPos.height; 4999 5000 var currentOffsetX = contentStartPos.left; 5001 var currentOffsetY = contentStartPos.top; 5002 5003 var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]); 5004 5005 var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers; 5006 5007 var newWidth = Math.floor(currentWidth * pinchRatio); 5008 var newHeight = Math.floor(currentHeight * pinchRatio); 5009 5010 // This is the translation due to pinch-zooming 5011 var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX; 5012 var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY; 5013 5014 // Point between the two touches 5015 var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft(); 5016 var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop(); 5017 5018 // And this is the translation due to translation of the centerpoint 5019 // between the two fingers 5020 var translateFromTranslatingX = centerPointEndX - self.centerPointStartX; 5021 var translateFromTranslatingY = centerPointEndY - self.centerPointStartY; 5022 5023 // The new offset is the old/current one plus the total translation 5024 var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX); 5025 var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY); 5026 5027 var newPos = { 5028 top: newOffsetY, 5029 left: newOffsetX, 5030 scaleX: pinchRatio, 5031 scaleY: pinchRatio 5032 }; 5033 5034 self.canTap = false; 5035 5036 self.newWidth = newWidth; 5037 self.newHeight = newHeight; 5038 5039 self.contentLastPos = newPos; 5040 5041 if (self.requestId) { 5042 cancelAFrame(self.requestId); 5043 } 5044 5045 self.requestId = requestAFrame(function () { 5046 $.fancybox.setTranslate(self.$content, self.contentLastPos); 5047 }); 5048 }; 5049 5050 Guestures.prototype.ontouchend = function (e) { 5051 var self = this; 5052 5053 var swiping = self.isSwiping; 5054 var panning = self.isPanning; 5055 var zooming = self.isZooming; 5056 var scrolling = self.isScrolling; 5057 5058 self.endPoints = getPointerXY(e); 5059 self.dMs = Math.max(new Date().getTime() - self.startTime, 1); 5060 5061 self.$container.removeClass("fancybox-is-grabbing"); 5062 5063 $(document).off(".fb.touch"); 5064 5065 document.removeEventListener("scroll", self.onscroll, true); 5066 5067 if (self.requestId) { 5068 cancelAFrame(self.requestId); 5069 5070 self.requestId = null; 5071 } 5072 5073 self.isSwiping = false; 5074 self.isPanning = false; 5075 self.isZooming = false; 5076 self.isScrolling = false; 5077 5078 self.instance.isDragging = false; 5079 5080 if (self.canTap) { 5081 return self.onTap(e); 5082 } 5083 5084 self.speed = 100; 5085 5086 // Speed in px/ms 5087 self.velocityX = (self.distanceX / self.dMs) * 0.5; 5088 self.velocityY = (self.distanceY / self.dMs) * 0.5; 5089 5090 if (panning) { 5091 self.endPanning(); 5092 } else if (zooming) { 5093 self.endZooming(); 5094 } else { 5095 self.endSwiping(swiping, scrolling); 5096 } 5097 5098 return; 5099 }; 5100 5101 Guestures.prototype.endSwiping = function (swiping, scrolling) { 5102 var self = this, 5103 ret = false, 5104 len = self.instance.group.length, 5105 distanceX = Math.abs(self.distanceX), 5106 canAdvance = swiping == "x" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50), 5107 speedX = 300; 5108 5109 self.sliderLastPos = null; 5110 5111 // Close if swiped vertically / navigate if horizontally 5112 if (swiping == "y" && !scrolling && Math.abs(self.distanceY) > 50) { 5113 // Continue vertical movement 5114 $.fancybox.animate( 5115 self.instance.current.$slide, { 5116 top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150, 5117 opacity: 0 5118 }, 5119 200 5120 ); 5121 ret = self.instance.close(true, 250); 5122 } else if (canAdvance && self.distanceX > 0) { 5123 ret = self.instance.previous(speedX); 5124 } else if (canAdvance && self.distanceX < 0) { 5125 ret = self.instance.next(speedX); 5126 } 5127 5128 if (ret === false && (swiping == "x" || swiping == "y")) { 5129 self.instance.centerSlide(200); 5130 } 5131 5132 self.$container.removeClass("fancybox-is-sliding"); 5133 }; 5134 5135 // Limit panning from edges 5136 // ======================== 5137 Guestures.prototype.endPanning = function () { 5138 var self = this, 5139 newOffsetX, 5140 newOffsetY, 5141 newPos; 5142 5143 if (!self.contentLastPos) { 5144 return; 5145 } 5146 5147 if (self.opts.momentum === false || self.dMs > 350) { 5148 newOffsetX = self.contentLastPos.left; 5149 newOffsetY = self.contentLastPos.top; 5150 } else { 5151 // Continue movement 5152 newOffsetX = self.contentLastPos.left + self.velocityX * 500; 5153 newOffsetY = self.contentLastPos.top + self.velocityY * 500; 5154 } 5155 5156 newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height); 5157 5158 newPos.width = self.contentStartPos.width; 5159 newPos.height = self.contentStartPos.height; 5160 5161 $.fancybox.animate(self.$content, newPos, 366); 5162 }; 5163 5164 Guestures.prototype.endZooming = function () { 5165 var self = this; 5166 5167 var current = self.instance.current; 5168 5169 var newOffsetX, newOffsetY, newPos, reset; 5170 5171 var newWidth = self.newWidth; 5172 var newHeight = self.newHeight; 5173 5174 if (!self.contentLastPos) { 5175 return; 5176 } 5177 5178 newOffsetX = self.contentLastPos.left; 5179 newOffsetY = self.contentLastPos.top; 5180 5181 reset = { 5182 top: newOffsetY, 5183 left: newOffsetX, 5184 width: newWidth, 5185 height: newHeight, 5186 scaleX: 1, 5187 scaleY: 1 5188 }; 5189 5190 // Reset scalex/scaleY values; this helps for perfomance and does not break animation 5191 $.fancybox.setTranslate(self.$content, reset); 5192 5193 if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) { 5194 self.instance.scaleToFit(150); 5195 } else if (newWidth > current.width || newHeight > current.height) { 5196 self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150); 5197 } else { 5198 newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight); 5199 5200 $.fancybox.animate(self.$content, newPos, 150); 5201 } 5202 }; 5203 5204 Guestures.prototype.onTap = function (e) { 5205 var self = this; 5206 var $target = $(e.target); 5207 5208 var instance = self.instance; 5209 var current = instance.current; 5210 5211 var endPoints = (e && getPointerXY(e)) || self.startPoints; 5212 5213 var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0; 5214 var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0; 5215 5216 var where; 5217 5218 var process = function (prefix) { 5219 var action = current.opts[prefix]; 5220 5221 if ($.isFunction(action)) { 5222 action = action.apply(instance, [current, e]); 5223 } 5224 5225 if (!action) { 5226 return; 5227 } 5228 5229 switch (action) { 5230 case "close": 5231 instance.close(self.startEvent); 5232 5233 break; 5234 5235 case "toggleControls": 5236 instance.toggleControls(); 5237 5238 break; 5239 5240 case "next": 5241 instance.next(); 5242 5243 break; 5244 5245 case "nextOrClose": 5246 if (instance.group.length > 1) { 5247 instance.next(); 5248 } else { 5249 instance.close(self.startEvent); 5250 } 5251 5252 break; 5253 5254 case "zoom": 5255 if (current.type == "image" && (current.isLoaded || current.$ghost)) { 5256 if (instance.canPan()) { 5257 instance.scaleToFit(); 5258 } else if (instance.isScaledDown()) { 5259 instance.scaleToActual(tapX, tapY); 5260 } else if (instance.group.length < 2) { 5261 instance.close(self.startEvent); 5262 } 5263 } 5264 5265 break; 5266 } 5267 }; 5268 5269 // Ignore right click 5270 if (e.originalEvent && e.originalEvent.button == 2) { 5271 return; 5272 } 5273 5274 // Skip if clicked on the scrollbar 5275 if (!$target.is("img") && tapX > $target[0].clientWidth + $target.offset().left) { 5276 return; 5277 } 5278 5279 // Check where is clicked 5280 if ($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")) { 5281 where = "Outside"; 5282 } else if ($target.is(".fancybox-slide")) { 5283 where = "Slide"; 5284 } else if ( 5285 instance.current.$content && 5286 instance.current.$content 5287 .find($target) 5288 .addBack() 5289 .filter($target).length 5290 ) { 5291 where = "Content"; 5292 } else { 5293 return; 5294 } 5295 5296 // Check if this is a double tap 5297 if (self.tapped) { 5298 // Stop previously created single tap 5299 clearTimeout(self.tapped); 5300 self.tapped = null; 5301 5302 // Skip if distance between taps is too big 5303 if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) { 5304 return this; 5305 } 5306 5307 // OK, now we assume that this is a double-tap 5308 process("dblclick" + where); 5309 } else { 5310 // Single tap will be processed if user has not clicked second time within 300ms 5311 // or there is no need to wait for double-tap 5312 self.tapX = tapX; 5313 self.tapY = tapY; 5314 5315 if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) { 5316 self.tapped = setTimeout(function () { 5317 self.tapped = null; 5318 5319 if (!instance.isAnimating) { 5320 process("click" + where); 5321 } 5322 }, 500); 5323 } else { 5324 process("click" + where); 5325 } 5326 } 5327 5328 return this; 5329 }; 5330 5331 $(document) 5332 .on("onActivate.fb", function (e, instance) { 5333 if (instance && !instance.Guestures) { 5334 instance.Guestures = new Guestures(instance); 5335 } 5336 }) 5337 .on("beforeClose.fb", function (e, instance) { 5338 if (instance && instance.Guestures) { 5339 instance.Guestures.destroy(); 5340 } 5341 }); 5342})(window, document, jQuery); 5343// ========================================================================== 5344// 5345// SlideShow 5346// Enables slideshow functionality 5347// 5348// Example of usage: 5349// $.fancybox.getInstance().SlideShow.start() 5350// 5351// ========================================================================== 5352(function (document, $) { 5353 "use strict"; 5354 5355 $.extend(true, $.fancybox.defaults, { 5356 btnTpl: { 5357 slideShow: '<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' + 5358 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg>' + 5359 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg>' + 5360 "</button>" 5361 }, 5362 slideShow: { 5363 autoStart: false, 5364 speed: 3000, 5365 progress: true 5366 } 5367 }); 5368 5369 var SlideShow = function (instance) { 5370 this.instance = instance; 5371 this.init(); 5372 }; 5373 5374 $.extend(SlideShow.prototype, { 5375 timer: null, 5376 isActive: false, 5377 $button: null, 5378 5379 init: function () { 5380 var self = this, 5381 instance = self.instance, 5382 opts = instance.group[instance.currIndex].opts.slideShow; 5383 5384 self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function () { 5385 self.toggle(); 5386 }); 5387 5388 if (instance.group.length < 2 || !opts) { 5389 self.$button.hide(); 5390 } else if (opts.progress) { 5391 self.$progress = $('<div class="fancybox-progress"></div>').appendTo(instance.$refs.inner); 5392 } 5393 }, 5394 5395 set: function (force) { 5396 var self = this, 5397 instance = self.instance, 5398 current = instance.current; 5399 5400 // Check if reached last element 5401 if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) { 5402 if (self.isActive && current.contentType !== "video") { 5403 if (self.$progress) { 5404 $.fancybox.animate(self.$progress.show(), { 5405 scaleX: 1 5406 }, current.opts.slideShow.speed); 5407 } 5408 5409 self.timer = setTimeout(function () { 5410 if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) { 5411 instance.jumpTo(0); 5412 } else { 5413 instance.next(); 5414 } 5415 }, current.opts.slideShow.speed); 5416 } 5417 } else { 5418 self.stop(); 5419 instance.idleSecondsCounter = 0; 5420 instance.showControls(); 5421 } 5422 }, 5423 5424 clear: function () { 5425 var self = this; 5426 5427 clearTimeout(self.timer); 5428 5429 self.timer = null; 5430 5431 if (self.$progress) { 5432 self.$progress.removeAttr("style").hide(); 5433 } 5434 }, 5435 5436 start: function () { 5437 var self = this, 5438 current = self.instance.current; 5439 5440 if (current) { 5441 self.$button 5442 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP) 5443 .removeClass("fancybox-button--play") 5444 .addClass("fancybox-button--pause"); 5445 5446 self.isActive = true; 5447 5448 if (current.isComplete) { 5449 self.set(true); 5450 } 5451 5452 self.instance.trigger("onSlideShowChange", true); 5453 } 5454 }, 5455 5456 stop: function () { 5457 var self = this, 5458 current = self.instance.current; 5459 5460 self.clear(); 5461 5462 self.$button 5463 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START) 5464 .removeClass("fancybox-button--pause") 5465 .addClass("fancybox-button--play"); 5466 5467 self.isActive = false; 5468 5469 self.instance.trigger("onSlideShowChange", false); 5470 5471 if (self.$progress) { 5472 self.$progress.removeAttr("style").hide(); 5473 } 5474 }, 5475 5476 toggle: function () { 5477 var self = this; 5478 5479 if (self.isActive) { 5480 self.stop(); 5481 } else { 5482 self.start(); 5483 } 5484 } 5485 }); 5486 5487 $(document).on({ 5488 "onInit.fb": function (e, instance) { 5489 if (instance && !instance.SlideShow) { 5490 instance.SlideShow = new SlideShow(instance); 5491 } 5492 }, 5493 5494 "beforeShow.fb": function (e, instance, current, firstRun) { 5495 var SlideShow = instance && instance.SlideShow; 5496 5497 if (firstRun) { 5498 if (SlideShow && current.opts.slideShow.autoStart) { 5499 SlideShow.start(); 5500 } 5501 } else if (SlideShow && SlideShow.isActive) { 5502 SlideShow.clear(); 5503 } 5504 }, 5505 5506 "afterShow.fb": function (e, instance, current) { 5507 var SlideShow = instance && instance.SlideShow; 5508 5509 if (SlideShow && SlideShow.isActive) { 5510 SlideShow.set(); 5511 } 5512 }, 5513 5514 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5515 var SlideShow = instance && instance.SlideShow; 5516 5517 // "P" or Spacebar 5518 if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is("button,a,input")) { 5519 keypress.preventDefault(); 5520 5521 SlideShow.toggle(); 5522 } 5523 }, 5524 5525 "beforeClose.fb onDeactivate.fb": function (e, instance) { 5526 var SlideShow = instance && instance.SlideShow; 5527 5528 if (SlideShow) { 5529 SlideShow.stop(); 5530 } 5531 } 5532 }); 5533 5534 // Page Visibility API to pause slideshow when window is not active 5535 $(document).on("visibilitychange", function () { 5536 var instance = $.fancybox.getInstance(), 5537 SlideShow = instance && instance.SlideShow; 5538 5539 if (SlideShow && SlideShow.isActive) { 5540 if (document.hidden) { 5541 SlideShow.clear(); 5542 } else { 5543 SlideShow.set(); 5544 } 5545 } 5546 }); 5547})(document, jQuery); 5548// ========================================================================== 5549// 5550// FullScreen 5551// Adds fullscreen functionality 5552// 5553// ========================================================================== 5554(function (document, $) { 5555 "use strict"; 5556 5557 // Collection of methods supported by user browser 5558 var fn = (function () { 5559 var fnMap = [ 5560 ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], 5561 // new WebKit 5562 [ 5563 "webkitRequestFullscreen", 5564 "webkitExitFullscreen", 5565 "webkitFullscreenElement", 5566 "webkitFullscreenEnabled", 5567 "webkitfullscreenchange", 5568 "webkitfullscreenerror" 5569 ], 5570 // old WebKit (Safari 5.1) 5571 [ 5572 "webkitRequestFullScreen", 5573 "webkitCancelFullScreen", 5574 "webkitCurrentFullScreenElement", 5575 "webkitCancelFullScreen", 5576 "webkitfullscreenchange", 5577 "webkitfullscreenerror" 5578 ], 5579 [ 5580 "mozRequestFullScreen", 5581 "mozCancelFullScreen", 5582 "mozFullScreenElement", 5583 "mozFullScreenEnabled", 5584 "mozfullscreenchange", 5585 "mozfullscreenerror" 5586 ], 5587 ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"] 5588 ]; 5589 5590 var ret = {}; 5591 5592 for (var i = 0; i < fnMap.length; i++) { 5593 var val = fnMap[i]; 5594 5595 if (val && val[1] in document) { 5596 for (var j = 0; j < val.length; j++) { 5597 ret[fnMap[0][j]] = val[j]; 5598 } 5599 5600 return ret; 5601 } 5602 } 5603 5604 return false; 5605 })(); 5606 5607 if (fn) { 5608 var FullScreen = { 5609 request: function (elem) { 5610 elem = elem || document.documentElement; 5611 5612 elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT); 5613 }, 5614 exit: function () { 5615 document[fn.exitFullscreen](); 5616 }, 5617 toggle: function (elem) { 5618 elem = elem || document.documentElement; 5619 5620 if (this.isFullscreen()) { 5621 this.exit(); 5622 } else { 5623 this.request(elem); 5624 } 5625 }, 5626 isFullscreen: function () { 5627 return Boolean(document[fn.fullscreenElement]); 5628 }, 5629 enabled: function () { 5630 return Boolean(document[fn.fullscreenEnabled]); 5631 } 5632 }; 5633 5634 $.extend(true, $.fancybox.defaults, { 5635 btnTpl: { 5636 fullScreen: '<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' + 5637 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>' + 5638 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg>' + 5639 "</button>" 5640 }, 5641 fullScreen: { 5642 autoStart: false 5643 } 5644 }); 5645 5646 $(document).on(fn.fullscreenchange, function () { 5647 var isFullscreen = FullScreen.isFullscreen(), 5648 instance = $.fancybox.getInstance(); 5649 5650 if (instance) { 5651 // If image is zooming, then force to stop and reposition properly 5652 if (instance.current && instance.current.type === "image" && instance.isAnimating) { 5653 instance.isAnimating = false; 5654 5655 instance.update(true, true, 0); 5656 5657 if (!instance.isComplete) { 5658 instance.complete(); 5659 } 5660 } 5661 5662 instance.trigger("onFullscreenChange", isFullscreen); 5663 5664 instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen); 5665 5666 instance.$refs.toolbar 5667 .find("[data-fancybox-fullscreen]") 5668 .toggleClass("fancybox-button--fsenter", !isFullscreen) 5669 .toggleClass("fancybox-button--fsexit", isFullscreen); 5670 } 5671 }); 5672 } 5673 5674 $(document).on({ 5675 "onInit.fb": function (e, instance) { 5676 var $container; 5677 5678 if (!fn) { 5679 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove(); 5680 5681 return; 5682 } 5683 5684 if (instance && instance.group[instance.currIndex].opts.fullScreen) { 5685 $container = instance.$refs.container; 5686 5687 $container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function (e) { 5688 e.stopPropagation(); 5689 e.preventDefault(); 5690 5691 FullScreen.toggle(); 5692 }); 5693 5694 if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) { 5695 FullScreen.request(); 5696 } 5697 5698 // Expose API 5699 instance.FullScreen = FullScreen; 5700 } else if (instance) { 5701 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide(); 5702 } 5703 }, 5704 5705 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5706 // "F" 5707 if (instance && instance.FullScreen && keycode === 70) { 5708 keypress.preventDefault(); 5709 5710 instance.FullScreen.toggle(); 5711 } 5712 }, 5713 5714 "beforeClose.fb": function (e, instance) { 5715 if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) { 5716 FullScreen.exit(); 5717 } 5718 } 5719 }); 5720})(document, jQuery); 5721// ========================================================================== 5722// 5723// Thumbs 5724// Displays thumbnails in a grid 5725// 5726// ========================================================================== 5727(function (document, $) { 5728 "use strict"; 5729 5730 var CLASS = "fancybox-thumbs", 5731 CLASS_ACTIVE = CLASS + "-active"; 5732 5733 // Make sure there are default values 5734 $.fancybox.defaults = $.extend( 5735 true, { 5736 btnTpl: { 5737 thumbs: '<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' + 5738 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg>' + 5739 "</button>" 5740 }, 5741 thumbs: { 5742 autoStart: false, // Display thumbnails on opening 5743 hideOnClose: true, // Hide thumbnail grid when closing animation starts 5744 parentEl: ".fancybox-container", // Container is injected into this element 5745 axis: "y" // Vertical (y) or horizontal (x) scrolling 5746 } 5747 }, 5748 $.fancybox.defaults 5749 ); 5750 5751 var FancyThumbs = function (instance) { 5752 this.init(instance); 5753 }; 5754 5755 $.extend(FancyThumbs.prototype, { 5756 $button: null, 5757 $grid: null, 5758 $list: null, 5759 isVisible: false, 5760 isActive: false, 5761 5762 init: function (instance) { 5763 var self = this, 5764 group = instance.group, 5765 enabled = 0; 5766 5767 self.instance = instance; 5768 self.opts = group[instance.currIndex].opts.thumbs; 5769 5770 instance.Thumbs = self; 5771 5772 self.$button = instance.$refs.toolbar.find("[data-fancybox-thumbs]"); 5773 5774 // Enable thumbs if at least two group items have thumbnails 5775 for (var i = 0, len = group.length; i < len; i++) { 5776 if (group[i].thumb) { 5777 enabled++; 5778 } 5779 5780 if (enabled > 1) { 5781 break; 5782 } 5783 } 5784 5785 if (enabled > 1 && !!self.opts) { 5786 self.$button.removeAttr("style").on("click", function () { 5787 self.toggle(); 5788 }); 5789 5790 self.isActive = true; 5791 } else { 5792 self.$button.hide(); 5793 } 5794 }, 5795 5796 create: function () { 5797 var self = this, 5798 instance = self.instance, 5799 parentEl = self.opts.parentEl, 5800 list = [], 5801 src; 5802 5803 if (!self.$grid) { 5804 // Create main element 5805 self.$grid = $('<div class="' + CLASS + " " + CLASS + "-" + self.opts.axis + '"></div>').appendTo( 5806 instance.$refs.container 5807 .find(parentEl) 5808 .addBack() 5809 .filter(parentEl) 5810 ); 5811 5812 // Add "click" event that performs gallery navigation 5813 self.$grid.on("click", "a", function () { 5814 instance.jumpTo($(this).attr("data-index")); 5815 }); 5816 } 5817 5818 // Build the list 5819 if (!self.$list) { 5820 self.$list = $('<div class="' + CLASS + '__list">').appendTo(self.$grid); 5821 } 5822 5823 $.each(instance.group, function (i, item) { 5824 src = item.thumb; 5825 5826 if (!src && item.type === "image") { 5827 src = item.src; 5828 } 5829 5830 list.push( 5831 '<a href="javascript:;" tabindex="0" data-index="' + 5832 i + 5833 '"' + 5834 (src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') + 5835 "></a>" 5836 ); 5837 }); 5838 5839 self.$list[0].innerHTML = list.join(""); 5840 5841 if (self.opts.axis === "x") { 5842 // Set fixed width for list element to enable horizontal scrolling 5843 self.$list.width( 5844 parseInt(self.$grid.css("padding-right"), 10) + 5845 instance.group.length * 5846 self.$list 5847 .children() 5848 .eq(0) 5849 .outerWidth(true) 5850 ); 5851 } 5852 }, 5853 5854 focus: function (duration) { 5855 var self = this, 5856 $list = self.$list, 5857 $grid = self.$grid, 5858 thumb, 5859 thumbPos; 5860 5861 if (!self.instance.current) { 5862 return; 5863 } 5864 5865 thumb = $list 5866 .children() 5867 .removeClass(CLASS_ACTIVE) 5868 .filter('[data-index="' + self.instance.current.index + '"]') 5869 .addClass(CLASS_ACTIVE); 5870 5871 thumbPos = thumb.position(); 5872 5873 // Check if need to scroll to make current thumb visible 5874 if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) { 5875 $list.stop().animate({ 5876 scrollTop: $list.scrollTop() + thumbPos.top 5877 }, 5878 duration 5879 ); 5880 } else if ( 5881 self.opts.axis === "x" && 5882 (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth())) 5883 ) { 5884 $list 5885 .parent() 5886 .stop() 5887 .animate({ 5888 scrollLeft: thumbPos.left 5889 }, 5890 duration 5891 ); 5892 } 5893 }, 5894 5895 update: function () { 5896 var that = this; 5897 that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible); 5898 5899 if (that.isVisible) { 5900 if (!that.$grid) { 5901 that.create(); 5902 } 5903 5904 that.instance.trigger("onThumbsShow"); 5905 5906 that.focus(0); 5907 } else if (that.$grid) { 5908 that.instance.trigger("onThumbsHide"); 5909 } 5910 5911 // Update content position 5912 that.instance.update(); 5913 }, 5914 5915 hide: function () { 5916 this.isVisible = false; 5917 this.update(); 5918 }, 5919 5920 show: function () { 5921 this.isVisible = true; 5922 this.update(); 5923 }, 5924 5925 toggle: function () { 5926 this.isVisible = !this.isVisible; 5927 this.update(); 5928 } 5929 }); 5930 5931 $(document).on({ 5932 "onInit.fb": function (e, instance) { 5933 var Thumbs; 5934 5935 if (instance && !instance.Thumbs) { 5936 Thumbs = new FancyThumbs(instance); 5937 5938 if (Thumbs.isActive && Thumbs.opts.autoStart === true) { 5939 Thumbs.show(); 5940 } 5941 } 5942 }, 5943 5944 "beforeShow.fb": function (e, instance, item, firstRun) { 5945 var Thumbs = instance && instance.Thumbs; 5946 5947 if (Thumbs && Thumbs.isVisible) { 5948 Thumbs.focus(firstRun ? 0 : 250); 5949 } 5950 }, 5951 5952 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5953 var Thumbs = instance && instance.Thumbs; 5954 5955 // "G" 5956 if (Thumbs && Thumbs.isActive && keycode === 71) { 5957 keypress.preventDefault(); 5958 5959 Thumbs.toggle(); 5960 } 5961 }, 5962 5963 "beforeClose.fb": function (e, instance) { 5964 var Thumbs = instance && instance.Thumbs; 5965 5966 if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) { 5967 Thumbs.$grid.hide(); 5968 } 5969 } 5970 }); 5971})(document, jQuery); 5972//// ========================================================================== 5973// 5974// Share 5975// Displays simple form for sharing current url 5976// 5977// ========================================================================== 5978(function (document, $) { 5979 "use strict"; 5980 5981 $.extend(true, $.fancybox.defaults, { 5982 btnTpl: { 5983 share: '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' + 5984 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg>' + 5985 "</button>" 5986 }, 5987 share: { 5988 url: function (instance, item) { 5989 return ( 5990 (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location 5991 ); 5992 }, 5993 tpl: '<div class="fancybox-share">' + 5994 "<h1>{{SHARE}}</h1>" + 5995 "<p>" + 5996 '<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' + 5997 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg>' + 5998 "<span>Facebook</span>" + 5999 "</a>" + 6000 '<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' + 6001 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg>' + 6002 "<span>Twitter</span>" + 6003 "</a>" + 6004 '<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' + 6005 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg>' + 6006 "<span>Pinterest</span>" + 6007 "</a>" + 6008 "</p>" + 6009 '<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p>' + 6010 "</div>" 6011 } 6012 }); 6013 6014 function escapeHtml(string) { 6015 var entityMap = { 6016 "&": "&", 6017 "<": "<", 6018 ">": ">", 6019 '"': """, 6020 "'": "'", 6021 "/": "/", 6022 "`": "`", 6023 "=": "=" 6024 }; 6025 6026 return String(string).replace(/[&<>"'`=\/]/g, function (s) { 6027 return entityMap[s]; 6028 }); 6029 } 6030 6031 $(document).on("click", "[data-fancybox-share]", function () { 6032 var instance = $.fancybox.getInstance(), 6033 current = instance.current || null, 6034 url, 6035 tpl; 6036 6037 if (!current) { 6038 return; 6039 } 6040 6041 if ($.type(current.opts.share.url) === "function") { 6042 url = current.opts.share.url.apply(current, [instance, current]); 6043 } 6044 6045 tpl = current.opts.share.tpl 6046 .replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "") 6047 .replace(/\{\{url\}\}/g, encodeURIComponent(url)) 6048 .replace(/\{\{url_raw\}\}/g, escapeHtml(url)) 6049 .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : ""); 6050 6051 $.fancybox.open({ 6052 src: instance.translate(instance, tpl), 6053 type: "html", 6054 opts: { 6055 touch: false, 6056 animationEffect: false, 6057 afterLoad: function (shareInstance, shareCurrent) { 6058 // Close self if parent instance is closing 6059 instance.$refs.container.one("beforeClose.fb", function () { 6060 shareInstance.close(null, 0); 6061 }); 6062 6063 // Opening links in a popup window 6064 shareCurrent.$content.find(".fancybox-share__button").click(function () { 6065 window.open(this.href, "Share", "width=550, height=450"); 6066 return false; 6067 }); 6068 }, 6069 mobile: { 6070 autoFocus: false 6071 } 6072 } 6073 }); 6074 }); 6075})(document, jQuery); 6076// ========================================================================== 6077// 6078// Hash 6079// Enables linking to each modal 6080// 6081// ========================================================================== 6082(function (window, document, $) { 6083 "use strict"; 6084 6085 // Simple $.escapeSelector polyfill (for jQuery prior v3) 6086 if (!$.escapeSelector) { 6087 $.escapeSelector = function (sel) { 6088 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 6089 var fcssescape = function (ch, asCodePoint) { 6090 if (asCodePoint) { 6091 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 6092 if (ch === "\0") { 6093 return "\uFFFD"; 6094 } 6095 6096 // Control characters and (dependent upon position) numbers get escaped as code points 6097 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; 6098 } 6099 6100 // Other potentially-special ASCII characters get backslash-escaped 6101 return "\\" + ch; 6102 }; 6103 6104 return (sel + "").replace(rcssescape, fcssescape); 6105 }; 6106 } 6107 6108 // Get info about gallery name and current index from url 6109 function parseUrl() { 6110 var hash = window.location.hash.substr(1), 6111 rez = hash.split("-"), 6112 index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1, 6113 gallery = rez.join("-"); 6114 6115 return { 6116 hash: hash, 6117 /* Index is starting from 1 */ 6118 index: index < 1 ? 1 : index, 6119 gallery: gallery 6120 }; 6121 } 6122 6123 // Trigger click evnt on links to open new fancyBox instance 6124 function triggerFromUrl(url) { 6125 if (url.gallery !== "") { 6126 // If we can find element matching 'data-fancybox' atribute, 6127 // then triggering click event should start fancyBox 6128 $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']") 6129 .eq(url.index - 1) 6130 .focus() 6131 .trigger("click.fb-start"); 6132 } 6133 } 6134 6135 // Get gallery name from current instance 6136 function getGalleryID(instance) { 6137 var opts, ret; 6138 6139 if (!instance) { 6140 return false; 6141 } 6142 6143 opts = instance.current ? instance.current.opts : instance.opts; 6144 ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") || opts.$orig.data("fancybox-trigger") : ""); 6145 6146 return ret === "" ? false : ret; 6147 } 6148 6149 // Start when DOM becomes ready 6150 $(function () { 6151 // Check if user has disabled this module 6152 if ($.fancybox.defaults.hash === false) { 6153 return; 6154 } 6155 6156 // Update hash when opening/closing fancyBox 6157 $(document).on({ 6158 "onInit.fb": function (e, instance) { 6159 var url, gallery; 6160 6161 if (instance.group[instance.currIndex].opts.hash === false) { 6162 return; 6163 } 6164 6165 url = parseUrl(); 6166 gallery = getGalleryID(instance); 6167 6168 // Make sure gallery start index matches index from hash 6169 if (gallery && url.gallery && gallery == url.gallery) { 6170 instance.currIndex = url.index - 1; 6171 } 6172 }, 6173 6174 "beforeShow.fb": function (e, instance, current, firstRun) { 6175 var gallery; 6176 6177 if (!current || current.opts.hash === false) { 6178 return; 6179 } 6180 6181 // Check if need to update window hash 6182 gallery = getGalleryID(instance); 6183 6184 if (!gallery) { 6185 return; 6186 } 6187 6188 // Variable containing last hash value set by fancyBox 6189 // It will be used to determine if fancyBox needs to close after hash change is detected 6190 instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : ""); 6191 6192 // If current hash is the same (this instance most likely is opened by hashchange), then do nothing 6193 if (window.location.hash === "#" + instance.currentHash) { 6194 return; 6195 } 6196 6197 if (firstRun && !instance.origHash) { 6198 instance.origHash = window.location.hash; 6199 } 6200 6201 if (instance.hashTimer) { 6202 clearTimeout(instance.hashTimer); 6203 } 6204 6205 // Update hash 6206 instance.hashTimer = setTimeout(function () { 6207 if ("replaceState" in window.history) { 6208 window.history[firstRun ? "pushState" : "replaceState"]({}, 6209 document.title, 6210 window.location.pathname + window.location.search + "#" + instance.currentHash 6211 ); 6212 6213 if (firstRun) { 6214 instance.hasCreatedHistory = true; 6215 } 6216 } else { 6217 window.location.hash = instance.currentHash; 6218 } 6219 6220 instance.hashTimer = null; 6221 }, 300); 6222 }, 6223 6224 "beforeClose.fb": function (e, instance, current) { 6225 if (!current || current.opts.hash === false) { 6226 return; 6227 } 6228 6229 clearTimeout(instance.hashTimer); 6230 6231 // Goto previous history entry 6232 if (instance.currentHash && instance.hasCreatedHistory) { 6233 window.history.back(); 6234 } else if (instance.currentHash) { 6235 if ("replaceState" in window.history) { 6236 window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || "")); 6237 } else { 6238 window.location.hash = instance.origHash; 6239 } 6240 } 6241 6242 instance.currentHash = null; 6243 } 6244 }); 6245 6246 // Check if need to start/close after url has changed 6247 $(window).on("hashchange.fb", function () { 6248 var url = parseUrl(), 6249 fb = null; 6250 6251 // Find last fancyBox instance that has "hash" 6252 $.each( 6253 $(".fancybox-container") 6254 .get() 6255 .reverse(), 6256 function (index, value) { 6257 var tmp = $(value).data("FancyBox"); 6258 6259 if (tmp && tmp.currentHash) { 6260 fb = tmp; 6261 return false; 6262 } 6263 } 6264 ); 6265 6266 if (fb) { 6267 // Now, compare hash values 6268 if (fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) { 6269 fb.currentHash = null; 6270 6271 fb.close(); 6272 } 6273 } else if (url.gallery !== "") { 6274 triggerFromUrl(url); 6275 } 6276 }); 6277 6278 // Check current hash and trigger click event on matching element to start fancyBox, if needed 6279 setTimeout(function () { 6280 if (!$.fancybox.getInstance()) { 6281 triggerFromUrl(parseUrl()); 6282 } 6283 }, 50); 6284 }); 6285})(window, document, jQuery); 6286// ========================================================================== 6287// 6288// Wheel 6289// Basic mouse weheel support for gallery navigation 6290// 6291// ========================================================================== 6292(function (document, $) { 6293 "use strict"; 6294 6295 var prevTime = new Date().getTime(); 6296 6297 $(document).on({ 6298 "onInit.fb": function (e, instance, current) { 6299 instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function (e) { 6300 var current = instance.current, 6301 currTime = new Date().getTime(); 6302 6303 if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) { 6304 return; 6305 } 6306 6307 e.preventDefault(); 6308 e.stopPropagation(); 6309 6310 if (current.$slide.hasClass("fancybox-animated")) { 6311 return; 6312 } 6313 6314 e = e.originalEvent || e; 6315 6316 if (currTime - prevTime < 250) { 6317 return; 6318 } 6319 6320 prevTime = currTime; 6321 6322 instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"](); 6323 }); 6324 } 6325 }); 6326})(document, jQuery);
vendor: 33,202 bytes, lines 6326-6327
6326 6327(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports!=="undefined"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){"use strict";var Slick=window.Slick||{};Slick=function(){var instanceUid=0;function Slick(element,settings){var _=this,dataSettings;_.defaults={accessibility:true,adaptiveHeight:false,appendArrows:$(element),appendDots:$(element),arrows:true,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:false,autoplaySpeed:3e3,centerMode:false,centerPadding:"50px",cssEase:"ease",customPaging:function(slider,i){return $('<button type="button" />').text(i+1)},dots:false,dotsClass:"slick-dots",draggable:true,easing:"linear",edgeFriction:.35,fade:false,focusOnSelect:false,focusOnChange:false,infinite:true,initialSlide:0,lazyLoad:"ondemand",mobileFirst:false,pauseOnHover:true,pauseOnFocus:true,pauseOnDotsHover:false,respondTo:"window",responsive:null,rows:1,rtl:false,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1e3};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:false,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,swiping:false,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=false;_.focussed=false;_.interrupted=false;_.hidden="hidden";_.paused=true;_.positionProp=null;_.respondTo=null;_.rowCount=1;_.shouldClick=true;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.visibilityChange="visibilitychange";_.windowWidth=0;_.windowTimer=null;dataSettings=$(element).data("slick")||{};_.options=$.extend({},_.defaults,settings,dataSettings);_.currentSlide=_.options.initialSlide;_.originalSettings=_.options;if(typeof document.mozHidden!=="undefined"){_.hidden="mozHidden";_.visibilityChange="mozvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){_.hidden="webkitHidden";_.visibilityChange="webkitvisibilitychange"}_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.changeSlide=$.proxy(_.changeSlide,_);_.clickHandler=$.proxy(_.clickHandler,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;_.registerBreakpoints();_.init(true)}return Slick}();Slick.prototype.activateADA=function(){var _=this;_.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup,index,addBefore){var _=this;if(typeof index==="boolean"){addBefore=index;index=null}else if(index<0||index>=_.slideCount){return false}_.unload();if(typeof index==="number"){if(index===0&&_.$slides.length===0){$(markup).appendTo(_.$slideTrack)}else if(addBefore){$(markup).insertBefore(_.$slides.eq(index))}else{$(markup).insertAfter(_.$slides.eq(index))}}else{if(addBefore===true){$(markup).prependTo(_.$slideTrack)}else{$(markup).appendTo(_.$slideTrack)}}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr("data-slick-index",index)});_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.animateHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.animate({height:targetHeight},_.options.speed)}};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={},_=this;_.animateHeight();if(_.options.rtl===true&&_.options.vertical===false){targetLeft=-targetLeft}if(_.transformsEnabled===false){if(_.options.vertical===false){_.$slideTrack.animate({left:targetLeft},_.options.speed,_.options.easing,callback)}else{_.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback)}}else{if(_.cssTransitions===false){if(_.options.rtl===true){_.currentLeft=-_.currentLeft}$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){now=Math.ceil(now);if(_.options.vertical===false){animProps[_.animType]="translate("+now+"px, 0px)";_.$slideTrack.css(animProps)}else{animProps[_.animType]="translate(0px,"+now+"px)";_.$slideTrack.css(animProps)}},complete:function(){if(callback){callback.call()}}})}else{_.applyTransition();targetLeft=Math.ceil(targetLeft);if(_.options.vertical===false){animProps[_.animType]="translate3d("+targetLeft+"px, 0px, 0px)"}else{animProps[_.animType]="translate3d(0px,"+targetLeft+"px, 0px)"}_.$slideTrack.css(animProps);if(callback){setTimeout(function(){_.disableTransition();callback.call()},_.options.speed)}}}};Slick.prototype.getNavTarget=function(){var _=this,asNavFor=_.options.asNavFor;if(asNavFor&&asNavFor!==null){asNavFor=$(asNavFor).not(_.$slider)}return asNavFor};Slick.prototype.asNavFor=function(index){var _=this,asNavFor=_.getNavTarget();if(asNavFor!==null&&typeof asNavFor==="object"){asNavFor.each(function(){var target=$(this).slick("getSlick");if(!target.unslicked){target.slideHandler(index,true)}})}};Slick.prototype.applyTransition=function(slide){var _=this,transition={};if(_.options.fade===false){transition[_.transitionType]=_.transformType+" "+_.options.speed+"ms "+_.options.cssEase}else{transition[_.transitionType]="opacity "+_.options.speed+"ms "+_.options.cssEase}if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.autoPlay=function(){var _=this;_.autoPlayClear();if(_.slideCount>_.options.slidesToShow){_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed)}};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer)}};Slick.prototype.autoPlayIterator=function(){var _=this,slideTo=_.currentSlide+_.options.slidesToScroll;if(!_.paused&&!_.interrupted&&!_.focussed){if(_.options.infinite===false){if(_.direction===1&&_.currentSlide+1===_.slideCount-1){_.direction=0}else if(_.direction===0){slideTo=_.currentSlide-_.options.slidesToScroll;if(_.currentSlide-1===0){_.direction=1}}}_.slideHandler(slideTo)}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true){_.$prevArrow=$(_.options.prevArrow).addClass("slick-arrow");_.$nextArrow=$(_.options.nextArrow).addClass("slick-arrow");if(_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");_.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.prependTo(_.options.appendArrows)}if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.appendTo(_.options.appendArrows)}if(_.options.infinite!==true){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")}}else{_.$prevArrow.add(_.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"})}}};Slick.prototype.buildDots=function(){var _=this,i,dot;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$slider.addClass("slick-dotted");dot=$("<ul />").addClass(_.options.dotsClass);for(i=0;i<=_.getDotCount();i+=1){dot.append($("<li />").append(_.options.customPaging.call(this,_,i)))}_.$dots=dot.appendTo(_.options.appendDots);_.$dots.find("li").first().addClass("slick-active")}};Slick.prototype.buildOut=function(){var _=this;_.$slides=_.$slider.children(_.options.slide+":not(.slick-cloned)").addClass("slick-slide");_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr("data-slick-index",index).data("originalStyling",$(element).attr("style")||"")});_.$slider.addClass("slick-slider");_.$slideTrack=_.slideCount===0?$('<div class="slick-track"/>').appendTo(_.$slider):_.$slides.wrapAll('<div class="slick-track"/>').parent();_.$list=_.$slideTrack.wrap('<div class="slick-list"/>').parent();_.$slideTrack.css("opacity",0);if(_.options.centerMode===true||_.options.swipeToSlide===true){_.options.slidesToScroll=1}$("img[data-lazy]",_.$slider).not("[src]").addClass("slick-loading");_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);if(_.options.draggable===true){_.$list.addClass("draggable")}};Slick.prototype.buildRows=function(){var _=this,a,b,c,newSlides,numOfSlides,originalSlides,slidesPerSection;newSlides=document.createDocumentFragment();originalSlides=_.$slider.children();if(_.options.rows>0){slidesPerSection=_.options.slidesPerRow*_.options.rows;numOfSlides=Math.ceil(originalSlides.length/slidesPerSection);for(a=0;a<numOfSlides;a++){var slide=document.createElement("div");for(b=0;b<_.options.rows;b++){var row=document.createElement("div");for(c=0;c<_.options.slidesPerRow;c++){var target=a*slidesPerSection+(b*_.options.slidesPerRow+c);if(originalSlides.get(target)){row.appendChild(originalSlides.get(target))}}slide.appendChild(row)}newSlides.appendChild(slide)}_.$slider.empty().append(newSlides);_.$slider.children().children().children().css({width:100/_.options.slidesPerRow+"%",display:"inline-block"})}};Slick.prototype.checkResponsive=function(initial,forceUpdate){var _=this,breakpoint,targetBreakpoint,respondToWidth,triggerBreakpoint=false;var sliderWidth=_.$slider.width();var windowWidth=window.innerWidth||$(window).width();if(_.respondTo==="window"){respondToWidth=windowWidth}else if(_.respondTo==="slider"){respondToWidth=sliderWidth}else if(_.respondTo==="min"){respondToWidth=Math.min(windowWidth,sliderWidth)}if(_.options.responsive&&_.options.responsive.length&&_.options.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints){if(_.breakpoints.hasOwnProperty(breakpoint)){if(_.originalSettings.mobileFirst===false){if(respondToWidth<_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}else{if(respondToWidth>_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}}}if(targetBreakpoint!==null){if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=_.originalSettings;if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial);triggerBreakpoint=targetBreakpoint}}if(!initial&&triggerBreakpoint!==false){_.$slider.trigger("breakpoint",[_,triggerBreakpoint])}}};Slick.prototype.changeSlide=function(event,dontAnimate){var _=this,$target=$(event.currentTarget),indexOffset,slideOffset,unevenOffset;if($target.is("a")){event.preventDefault()}if(!$target.is("li")){$target=$target.closest("li")}unevenOffset=_.slideCount%_.options.slidesToScroll!==0;indexOffset=unevenOffset?0:(_.slideCount-_.currentSlide)%_.options.slidesToScroll;switch(event.data.message){case"previous":slideOffset=indexOffset===0?_.options.slidesToScroll:_.options.slidesToShow-indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-slideOffset,false,dontAnimate)}break;case"next":slideOffset=indexOffset===0?_.options.slidesToScroll:indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+slideOffset,false,dontAnimate)}break;case"index":var index=event.data.index===0?0:event.data.index||$target.index()*_.options.slidesToScroll;_.slideHandler(_.checkNavigable(index),false,dontAnimate);$target.children().trigger("focus");break;default:return}};Slick.prototype.checkNavigable=function(index){var _=this,navigables,prevNavigable;navigables=_.getNavigableIndexes();prevNavigable=0;if(index>navigables[navigables.length-1]){index=navigables[navigables.length-1]}else{for(var n in navigables){if(index<navigables[n]){index=prevNavigable;break}prevNavigable=navigables[n]}}return index};Slick.prototype.cleanUpEvents=function(){var _=this;if(_.options.dots&&_.$dots!==null){$("li",_.$dots).off("click.slick",_.changeSlide).off("mouseenter.slick",$.proxy(_.interrupt,_,true)).off("mouseleave.slick",$.proxy(_.interrupt,_,false));if(_.options.accessibility===true){_.$dots.off("keydown.slick",_.keyHandler)}}_.$slider.off("focus.slick blur.slick");if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow&&_.$prevArrow.off("click.slick",_.changeSlide);_.$nextArrow&&_.$nextArrow.off("click.slick",_.changeSlide);if(_.options.accessibility===true){_.$prevArrow&&_.$prevArrow.off("keydown.slick",_.keyHandler);_.$nextArrow&&_.$nextArrow.off("keydown.slick",_.keyHandler)}}_.$list.off("touchstart.slick mousedown.slick",_.swipeHandler);_.$list.off("touchmove.slick mousemove.slick",_.swipeHandler);_.$list.off("touchend.slick mouseup.slick",_.swipeHandler);_.$list.off("touchcancel.slick mouseleave.slick",_.swipeHandler);_.$list.off("click.slick",_.clickHandler);$(document).off(_.visibilityChange,_.visibility);_.cleanUpSlideEvents();if(_.options.accessibility===true){_.$list.off("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().off("click.slick",_.selectHandler)}$(window).off("orientationchange.slick.slick-"+_.instanceUid,_.orientationChange);$(window).off("resize.slick.slick-"+_.instanceUid,_.resize);$("[draggable!=true]",_.$slideTrack).off("dragstart",_.preventDefault);$(window).off("load.slick.slick-"+_.instanceUid,_.setPosition)};Slick.prototype.cleanUpSlideEvents=function(){var _=this;_.$list.off("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.off("mouseleave.slick",$.proxy(_.interrupt,_,false))};Slick.prototype.cleanUpRows=function(){var _=this,originalSlides;if(_.options.rows>0){originalSlides=_.$slides.children().children();originalSlides.removeAttr("style");_.$slider.empty().append(originalSlides)}};Slick.prototype.clickHandler=function(event){var _=this;if(_.shouldClick===false){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault()}};Slick.prototype.destroy=function(refresh){var _=this;_.autoPlayClear();_.touchObject={};_.cleanUpEvents();$(".slick-cloned",_.$slider).detach();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.$prevArrow.length){_.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}}if(_.$nextArrow&&_.$nextArrow.length){_.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}}if(_.$slides){_.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){$(this).attr("style",$(this).data("originalStyling"))});_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.detach();_.$list.detach();_.$slider.append(_.$slides)}_.cleanUpRows();_.$slider.removeClass("slick-slider");_.$slider.removeClass("slick-initialized");_.$slider.removeClass("slick-dotted");_.unslicked=true;if(!refresh){_.$slider.trigger("destroy",[_])}};Slick.prototype.disableTransition=function(slide){var _=this,transition={};transition[_.transitionType]="";if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:_.options.zIndex});_.$slides.eq(slideIndex).animate({opacity:1},_.options.speed,_.options.easing,callback)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:_.options.zIndex});if(callback){setTimeout(function(){_.disableTransition(slideIndex);callback.call()},_.options.speed)}}};Slick.prototype.fadeSlideOut=function(slideIndex){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).animate({opacity:0,zIndex:_.options.zIndex-2},_.options.speed,_.options.easing)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:0,zIndex:_.options.zIndex-2})}};Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){var _=this;if(filter!==null){_.$slidesCache=_.$slides;_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.focusHandler=function(){var _=this;_.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(event){var $sf=$(this);setTimeout(function(){if(_.options.pauseOnFocus){if($sf.is(":focus")){_.focussed=true;_.autoPlay()}}},0)}).on("blur.slick","*",function(event){var $sf=$(this);if(_.options.pauseOnFocus){_.focussed=false;_.autoPlay()}})};Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){var _=this;return _.currentSlide};Slick.prototype.getDotCount=function(){var _=this;var breakPoint=0;var counter=0;var pagerQty=0;if(_.options.infinite===true){if(_.slideCount<=_.options.slidesToShow){++pagerQty}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}}else if(_.options.centerMode===true){pagerQty=_.slideCount}else if(!_.options.asNavFor){pagerQty=1+Math.ceil((_.slideCount-_.options.slidesToShow)/_.options.slidesToScroll)}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}return pagerQty-1};Slick.prototype.getLeft=function(slideIndex){var _=this,targetLeft,verticalHeight,verticalOffset=0,targetSlide,coef;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight(true);if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=_.slideWidth*_.options.slidesToShow*-1;coef=-1;if(_.options.vertical===true&&_.options.centerMode===true){if(_.options.slidesToShow===2){coef=-1.5}else if(_.options.slidesToShow===1){coef=-2}}verticalOffset=verticalHeight*_.options.slidesToShow*coef}if(_.slideCount%_.options.slidesToScroll!==0){if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){if(slideIndex>_.slideCount){_.slideOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*_.slideWidth*-1;verticalOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*verticalHeight*-1}else{_.slideOffset=_.slideCount%_.options.slidesToScroll*_.slideWidth*-1;verticalOffset=_.slideCount%_.options.slidesToScroll*verticalHeight*-1}}}}else{if(slideIndex+_.options.slidesToShow>_.slideCount){_.slideOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*_.slideWidth;verticalOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*verticalHeight}}if(_.slideCount<=_.options.slidesToShow){_.slideOffset=0;verticalOffset=0}if(_.options.centerMode===true&&_.slideCount<=_.options.slidesToShow){_.slideOffset=_.slideWidth*Math.floor(_.options.slidesToShow)/2-_.slideWidth*_.slideCount/2}else if(_.options.centerMode===true&&_.options.infinite===true){_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth}else if(_.options.centerMode===true){_.slideOffset=0;_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)}if(_.options.vertical===false){targetLeft=slideIndex*_.slideWidth*-1+_.slideOffset}else{targetLeft=slideIndex*verticalHeight*-1+verticalOffset}if(_.options.variableWidth===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}if(_.options.centerMode===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow+1)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}targetLeft+=(_.$list.width()-targetSlide.outerWidth())/2}}return targetLeft};Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){var _=this;return _.options[option]};Slick.prototype.getNavigableIndexes=function(){var _=this,breakPoint=0,counter=0,indexes=[],max;if(_.options.infinite===false){max=_.slideCount}else{breakPoint=_.options.slidesToScroll*-1;counter=_.options.slidesToScroll*-1;max=_.slideCount*2}while(breakPoint<max){indexes.push(breakPoint);breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}return indexes};Slick.prototype.getSlick=function(){return this};Slick.prototype.getSlideCount=function(){var _=this,slidesTraversed,swipedSlide,swipeTarget,centerOffset;centerOffset=_.options.centerMode===true?Math.floor(_.$list.width()/2):0;swipeTarget=_.swipeLeft*-1+centerOffset;if(_.options.swipeToSlide===true){_.$slideTrack.find(".slick-slide").each(function(index,slide){var slideOuterWidth,slideOffset,slideRightBoundary;slideOuterWidth=$(slide).outerWidth();slideOffset=slide.offsetLeft;if(_.options.centerMode!==true){slideOffset+=slideOuterWidth/2}slideRightBoundary=slideOffset+slideOuterWidth;if(swipeTarget<slideRightBoundary){swipedSlide=slide;return false}});slidesTraversed=Math.abs($(swipedSlide).attr("data-slick-index")-_.currentSlide)||1;return slidesTraversed}else{return _.options.slidesToScroll}};Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide,dontAnimate){var _=this;_.changeSlide({data:{message:"index",index:parseInt(slide)}},dontAnimate)};Slick.prototype.init=function(creation){var _=this;if(!$(_.$slider).hasClass("slick-initialized")){$(_.$slider).addClass("slick-initialized");_.buildRows();_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.updateArrows();_.updateDots();_.checkResponsive(true);_.focusHandler()}if(creation){_.$slider.trigger("init",[_])}if(_.options.accessibility===true){_.initADA()}if(_.options.autoplay){_.paused=false;_.autoPlay()}};Slick.prototype.initADA=function(){var _=this,numDotGroups=Math.ceil(_.slideCount/_.options.slidesToShow),tabControlIndexes=_.getNavigableIndexes().filter(function(val){return val>=0&&val<_.slideCount});_.$slides.add(_.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"});if(_.$dots!==null){_.$slides.not(_.$slideTrack.find(".slick-cloned")).each(function(i){var slideControlIndex=tabControlIndexes.indexOf(i);$(this).attr({role:"tabpanel",id:"slick-slide"+_.instanceUid+i,tabindex:-1});if(slideControlIndex!==-1){var ariaButtonControl="slick-slide-control"+_.instanceUid+slideControlIndex;if($("#"+ariaButtonControl).length){$(this).attr({"aria-describedby":ariaButtonControl})}}});_.$dots.attr("role","tablist").find("li").each(function(i){var mappedSlideIndex=tabControlIndexes[i];$(this).attr({role:"presentation"});$(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+_.instanceUid+i,"aria-controls":"slick-slide"+_.instanceUid+mappedSlideIndex,"aria-label":i+1+" of "+numDotGroups,"aria-selected":null,tabindex:"-1"})}).eq(_.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end()}for(var i=_.currentSlide,max=i+_.options.slidesToShow;i<max;i++){if(_.options.focusOnChange){_.$slides.eq(i).attr({tabindex:"0"})}else{_.$slides.eq(i).removeAttr("tabindex")}}_.activateADA()};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},_.changeSlide);_.$nextArrow.off("click.slick").on("click.slick",{message:"next"},_.changeSlide);if(_.options.accessibility===true){_.$prevArrow.on("keydown.slick",_.keyHandler);_.$nextArrow.on("keydown.slick",_.keyHandler)}}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("click.slick",{message:"index"},_.changeSlide);if(_.options.accessibility===true){_.$dots.on("keydown.slick",_.keyHandler)}}if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("mouseenter.slick",$.proxy(_.interrupt,_,true)).on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initSlideEvents=function(){var _=this;if(_.options.pauseOnHover){_.$list.on("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.initSlideEvents();_.$list.on("touchstart.slick mousedown.slick",{action:"start"},_.swipeHandler);_.$list.on("touchmove.slick mousemove.slick",{action:"move"},_.swipeHandler);_.$list.on("touchend.slick mouseup.slick",{action:"end"},_.swipeHandler);_.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},_.swipeHandler);_.$list.on("click.slick",_.clickHandler);$(document).on(_.visibilityChange,$.proxy(_.visibility,_));if(_.options.accessibility===true){_.$list.on("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}$(window).on("orientationchange.slick.slick-"+_.instanceUid,$.proxy(_.orientationChange,_));$(window).on("resize.slick.slick-"+_.instanceUid,$.proxy(_.resize,_));$("[draggable!=true]",_.$slideTrack).on("dragstart",_.preventDefault);$(window).on("load.slick.slick-"+_.instanceUid,_.setPosition);$(_.setPosition)};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.show()}};Slick.prototype.keyHandler=function(event){var _=this;if(!event.target.tagName.match("TEXTAREA|INPUT|SELECT")){if(event.keyCode===37&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"next":"previous"}})}else if(event.keyCode===39&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"previous":"next"}})}}};Slick.prototype.lazyLoad=function(){var _=this,loadRange,cloneRange,rangeStart,rangeEnd;function loadImages(imagesScope){$("img[data-lazy]",imagesScope).each(function(){var image=$(this),imageSource=$(this).attr("data-lazy"),imageSrcSet=$(this).attr("data-srcset"),imageSizes=$(this).attr("data-sizes")||_.$slider.attr("data-sizes"),imageToLoad=document.createElement("img");imageToLoad.onload=function(){image.animate({opacity:0},100,function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).animate({opacity:1},200,function(){image.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")});_.$slider.trigger("lazyLoaded",[_,image,imageSource])})};imageToLoad.onerror=function(){image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource])};imageToLoad.src=imageSource})}if(_.options.centerMode===true){if(_.options.infinite===true){rangeStart=_.currentSlide+(_.options.slidesToShow/2+1);rangeEnd=rangeStart+_.options.slidesToShow+2}else{rangeStart=Math.max(0,_.currentSlide-(_.options.slidesToShow/2+1));rangeEnd=2+(_.options.slidesToShow/2+1)+_.currentSlide}}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=Math.ceil(rangeStart+_.options.slidesToShow);if(_.options.fade===true){if(rangeStart>0)rangeStart--;if(rangeEnd<=_.slideCount)rangeEnd++}}loadRange=_.$slider.find(".slick-slide").slice(rangeStart,rangeEnd);if(_.options.lazyLoad==="anticipated"){var prevSlide=rangeStart-1,nextSlide=rangeEnd,$slides=_.$slider.find(".slick-slide");for(var i=0;i<_.options.slidesToScroll;i++){if(prevSlide<0)prevSlide=_.slideCount-1;loadRange=loadRange.add($slides.eq(prevSlide));loadRange=loadRange.add($slides.eq(nextSlide));prevSlide--;nextSlide++}}loadImages(loadRange);if(_.slideCount<=_.options.slidesToShow){cloneRange=_.$slider.find(".slick-slide");loadImages(cloneRange)}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find(".slick-cloned").slice(0,_.options.slidesToShow);loadImages(cloneRange)}else if(_.currentSlide===0){cloneRange=_.$slider.find(".slick-cloned").slice(_.options.slidesToShow*-1);loadImages(cloneRange)}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass("slick-loading");_.initUI();if(_.options.lazyLoad==="progressive"){_.progressiveLazyLoad()}};Slick.prototype.next=Slick.prototype.slickNext=function(){var _=this;_.changeSlide({data:{message:"next"}})};Slick.prototype.orientationChange=function(){var _=this;_.checkResponsive();_.setPosition()};Slick.prototype.pause=Slick.prototype.slickPause=function(){var _=this;_.autoPlayClear();_.paused=true};Slick.prototype.play=Slick.prototype.slickPlay=function(){var _=this;_.autoPlay();_.options.autoplay=true;_.paused=false;_.focussed=false;_.interrupted=false};Slick.prototype.postSlide=function(index){var _=this;if(!_.unslicked){_.$slider.trigger("afterChange",[_,index]);_.animating=false;if(_.slideCount>_.options.slidesToShow){_.setPosition()}_.swipeLeft=null;if(_.options.autoplay){_.autoPlay()}if(_.options.accessibility===true){_.initADA();if(_.options.focusOnChange){var $currentSlide=$(_.$slides.get(_.currentSlide));$currentSlide.attr("tabindex",0).focus()}}}};Slick.prototype.prev=Slick.prototype.slickPrev=function(){var _=this;_.changeSlide({data:{message:"previous"}})};Slick.prototype.preventDefault=function(event){event.preventDefault()};Slick.prototype.progressiveLazyLoad=function(tryCount){tryCount=tryCount||1;var _=this,$imgsToLoad=$("img[data-lazy]",_.$slider),image,imageSource,imageSrcSet,imageSizes,imageToLoad;if($imgsToLoad.length){image=$imgsToLoad.first();imageSource=image.attr("data-lazy");imageSrcSet=image.attr("data-srcset");imageSizes=image.attr("data-sizes")||_.$slider.attr("data-sizes");imageToLoad=document.createElement("img");imageToLoad.onload=function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");if(_.options.adaptiveHeight===true){_.setPosition()}_.$slider.trigger("lazyLoaded",[_,image,imageSource]);_.progressiveLazyLoad()};imageToLoad.onerror=function(){if(tryCount<3){setTimeout(function(){_.progressiveLazyLoad(tryCount+1)},500)}else{image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource]);_.progressiveLazyLoad()}};imageToLoad.src=imageSource}else{_.$slider.trigger("allImagesLoaded",[_])}};Slick.prototype.refresh=function(initializing){var _=this,currentSlide,lastVisibleIndex;lastVisibleIndex=_.slideCount-_.options.slidesToShow;if(!_.options.infinite&&_.currentSlide>lastVisibleIndex){_.currentSlide=lastVisibleIndex}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}currentSlide=_.currentSlide;_.destroy(true);$.extend(_,_.initials,{currentSlide:currentSlide});_.init();if(!initializing){_.changeSlide({data:{message:"index",index:currentSlide}},false)}};Slick.prototype.registerBreakpoints=function(){var _=this,breakpoint,currentBreakpoint,l,responsiveSettings=_.options.responsive||null;if(
vendor: 4,085 bytes, line 6327
6327$.type(responsiveSettings)==="array"&&responsiveSettings.length){_.respondTo=_.options.respondTo||"window";for(breakpoint in responsiveSettings){l=_.breakpoints.length-1;if(responsiveSettings.hasOwnProperty(breakpoint)){currentBreakpoint=responsiveSettings[breakpoint].breakpoint;while(l>=0){if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){_.breakpoints.splice(l,1)}l--}_.breakpoints.push(currentBreakpoint);_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings}}_.breakpoints.sort(function(a,b){return _.options.mobileFirst?a-b:b-a})}};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass("slick-slide");_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0){_.currentSlide=_.currentSlide-_.options.slidesToScroll}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}_.registerBreakpoints();_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();_.buildDots();_.updateDots();_.initDotEvents();_.cleanUpSlideEvents();_.initSlideEvents();_.checkResponsive(false,true);if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);_.setPosition();_.focusHandler();_.paused=!_.options.autoplay;_.autoPlay();_.$slider.trigger("reInit",[_])};Slick.prototype.resize=function(){var _=this;if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=$(window).width();_.checkResponsive();if(!_.unslicked){_.setPosition()}},50)}};Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index,removeBefore,removeAll){var _=this;if(typeof index==="boolean"){removeBefore=index;index=removeBefore===true?0:_.slideCount-1}else{index=removeBefore===true?--index:index}if(_.slideCount<1||index<0||index>_.slideCount-1){return false}_.unload();if(removeAll===true){_.$slideTrack.children().remove()}else{_.$slideTrack.children(this.options.slide).eq(index).remove()}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.setCSS=function(position){var _=this,positionProps={},x,y;if(_.options.rtl===true){position=-position}x=_.positionProp=="left"?Math.ceil(position)+"px":"0px";y=_.positionProp=="top"?Math.ceil(position)+"px":"0px";positionProps[_.positionProp]=position;if(_.transformsEnabled===false){_.$slideTrack.css(positionProps)}else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]="translate("+x+", "+y+")";_.$slideTrack.css(positionProps)}else{positionProps[_.animType]="translate3d("+x+", "+y+", 0px)";_.$slideTrack.css(positionProps)}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true){_.$list.css({padding:"0px "+_.options.centerPadding})}}else{_.$list.height(_.$slides.first().outerHeight(true)*_.options.slidesToShow);if(_.options.centerMode===true){_.$list.css({padding:_.options.centerPadding+" 0px"})}}_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false&&_.options.variableWidth===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil(_.slideWidth*_.$slideTrack.children(".slick-slide").length))}else if(_.options.variableWidth===true){_.$slideTrack.width(5e3*_.slideCount)}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true)*_.$slideTrack.children(".slick-slide").length))}var offset=_.$slides.first().outerWidth(true)-_.$slides.first().width();if(_.options.variableWidth===false)_.$slideTrack.children(".slick-slide").width(_.slideWidth-offset)};Slick.prototype.setFade=function(){var _=this,targetLeft;_.$slides.each(function(index,element){targetLeft=_.slideWidth*index*-1;if(_.options.rtl===true){$(element).css({position:"relative",right:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0}
6327)}else{$(element).css({position:"relative",left:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0})}});_.$slides.eq(_.currentSlide).css({zIndex:_.options.zIndex-1,opacity:1})};Slick.prototype.setHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.css("height",targetHeight)}};Slick.prototype.setOption=Slick.prototype.slickSetOption=function(){var _=this,l,item,option,value,refresh=false,type;if($.type(arguments[0])==="object"){option=arguments[0];refresh=arguments[1];type="multiple"}else if($.type(arguments[0])==="string"){option=arguments[0];value=arguments[1];refresh=arguments[2];if(arguments[0]==="responsive"&&$.type(arguments[1])==="array"){type="responsive"}else if(typeof arguments[1]!=="undefined"){type="single"}}if(type==="single"){_.options[option]=value}else if(type==="multiple"){$.each(option,function(opt,val){_.options[opt]=val})}else if(type==="responsive"){for(item in value){if($.type(_.options.responsive)!=="array"
vendor: 14,808 bytes, line 6327
6327){_.options.responsive=[value[item]]}else{l=_.options.responsive.length-1;while(l>=0){if(_.options.responsive[l].breakpoint===value[item].breakpoint){_.options.responsive.splice(l,1)}l--}_.options.responsive.push(value[item])}}}if(refresh){_.unload();_.reinit()}};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();_.setHeight();if(_.options.fade===false){_.setCSS(_.getLeft(_.currentSlide))}else{_.setFade()}_.$slider.trigger("setPosition",[_])};Slick.prototype.setProps=function(){var _=this,bodyStyle=document.body.style;_.positionProp=_.options.vertical===true?"top":"left";if(_.positionProp==="top"){_.$slider.addClass("slick-vertical")}else{_.$slider.removeClass("slick-vertical")}if(bodyStyle.WebkitTransition!==undefined||bodyStyle.MozTransition!==undefined||bodyStyle.msTransition!==undefined){if(_.options.useCSS===true){_.cssTransitions=true}}if(_.options.fade){if(typeof _.options.zIndex==="number"){if(_.options.zIndex<3){_.options.zIndex=3}}else{_.options.zIndex=_.defaults.zIndex}}if(bodyStyle.OTransform!==undefined){_.animType="OTransform";_.transformType="-o-transform";_.transitionType="OTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.MozTransform!==undefined){_.animType="MozTransform";_.transformType="-moz-transform";_.transitionType="MozTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined)_.animType=false}if(bodyStyle.webkitTransform!==undefined){_.animType="webkitTransform";_.transformType="-webkit-transform";_.transitionType="webkitTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.msTransform!==undefined){_.animType="msTransform";_.transformType="-ms-transform";_.transitionType="msTransition";if(bodyStyle.msTransform===undefined)_.animType=false}if(bodyStyle.transform!==undefined&&_.animType!==false){_.animType="transform";_.transformType="transform";_.transitionType="transition"}_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false)};Slick.prototype.setSlideClasses=function(index){var _=this,centerOffset,allSlides,indexOffset,remainder;allSlides=_.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");_.$slides.eq(index).addClass("slick-current");if(_.options.centerMode===true){var evenCoef=_.options.slidesToShow%2===0?1:0;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=_.slideCount-1-centerOffset){_.$slides.slice(index-centerOffset+evenCoef,index+centerOffset+1).addClass("slick-active").attr("aria-hidden","false")}else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1+evenCoef,indexOffset+centerOffset+2).addClass("slick-active").attr("aria-hidden","false")}if(index===0){allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass("slick-center")}else if(index===_.slideCount-1){allSlides.eq(_.options.slidesToShow).addClass("slick-center")}}_.$slides.eq(index).addClass("slick-center")}else{if(index>=0&&index<=_.slideCount-_.options.slidesToShow){_.$slides.slice(index,index+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}else if(allSlides.length<=_.options.slidesToShow){allSlides.addClass("slick-active").attr("aria-hidden","false")}else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&_.slideCount-index<_.options.slidesToShow){allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass("slick-active").attr("aria-hidden","false")}else{allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}}}if(_.options.lazyLoad==="ondemand"||_.options.lazyLoad==="anticipated"){_.lazyLoad()}};Slick.prototype.setupInfinite=function(){var _=this,i,slideIndex,infiniteCount;if(_.options.fade===true){_.options.centerMode=false}if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true){infiniteCount=_.options.slidesToShow+1}else{infiniteCount=_.options.slidesToShow}for(i=_.slideCount;i>_.slideCount-infiniteCount;i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex-_.slideCount).prependTo(_.$slideTrack).addClass("slick-cloned")}for(i=0;i<infiniteCount+_.slideCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex+_.slideCount).appendTo(_.$slideTrack).addClass("slick-cloned")}_.$slideTrack.find(".slick-cloned").find("[id]").each(function(){$(this).attr("id","")})}}};Slick.prototype.interrupt=function(toggle){var _=this;if(!toggle){_.autoPlay()}_.interrupted=toggle};Slick.prototype.selectHandler=function(event){var _=this;var targetElement=$(event.target).is(".slick-slide")?$(event.target):$(event.target).parents(".slick-slide");var index=parseInt(targetElement.attr("data-slick-index"));if(!index)index=0;if(_.slideCount<=_.options.slidesToShow){_.slideHandler(index,false,true);return}_.slideHandler(index)};Slick.prototype.slideHandler=function(index,sync,dontAnimate){var targetSlide,animSlide,oldSlide,slideLeft,targetLeft=null,_=this,navTarget;sync=sync||false;if(_.animating===true&&_.options.waitForAnimate===true){return}if(_.options.fade===true&&_.currentSlide===index){return}if(sync===false){_.asNavFor(index)}targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.getDotCount()*_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>_.slideCount-_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}if(_.options.autoplay){clearInterval(_.autoPlayTimer)}if(targetSlide<0){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=_.slideCount-_.slideCount%_.options.slidesToScroll}else{animSlide=_.slideCount+targetSlide}}else if(targetSlide>=_.slideCount){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=0}else{animSlide=targetSlide-_.slideCount}}else{animSlide=targetSlide}_.animating=true;_.$slider.trigger("beforeChange",[_,_.currentSlide,animSlide]);oldSlide=_.currentSlide;_.currentSlide=animSlide;_.setSlideClasses(_.currentSlide);if(_.options.asNavFor){navTarget=_.getNavTarget();navTarget=navTarget.slick("getSlick");if(navTarget.slideCount<=navTarget.options.slidesToShow){navTarget.setSlideClasses(_.currentSlide)}}_.updateDots();_.updateArrows();if(_.options.fade===true){if(dontAnimate!==true){_.fadeSlideOut(oldSlide);_.fadeSlide(animSlide,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}_.animateHeight();return}if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(targetLeft,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.hide()}_.$slider.addClass("slick-loading")};Slick.prototype.swipeDirection=function(){var xDist,yDist,r,swipeAngle,_=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0){swipeAngle=360-Math.abs(swipeAngle)}if(swipeAngle<=45&&swipeAngle>=0){return _.options.rtl===false?"left":"right"}if(swipeAngle<=360&&swipeAngle>=315){return _.options.rtl===false?"left":"right"}if(swipeAngle>=135&&swipeAngle<=225){return _.options.rtl===false?"right":"left"}if(_.options.verticalSwiping===true){if(swipeAngle>=35&&swipeAngle<=135){return"down"}else{return"up"}}return"vertical"};Slick.prototype.swipeEnd=function(event){var _=this,slideCount,direction;_.dragging=false;_.swiping=false;if(_.scrolling){_.scrolling=false;return false}_.interrupted=false;_.shouldClick=_.touchObject.swipeLength>10?false:true;if(_.touchObject.curX===undefined){return false}if(_.touchObject.edgeHit===true){_.$slider.trigger("edge",[_,_.swipeDirection()])}if(_.touchObject.swipeLength>=_.touchObject.minSwipe){direction=_.swipeDirection();switch(direction){case"left":case"down":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide+_.getSlideCount()):_.currentSlide+_.getSlideCount();_.currentDirection=0;break;case"right":case"up":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide-_.getSlideCount()):_.currentSlide-_.getSlideCount();_.currentDirection=1;break;default:}if(direction!="vertical"){_.slideHandler(slideCount);_.touchObject={};_.$slider.trigger("swipe",[_,direction])}}else{if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);_.touchObject={}}}};Slick.prototype.swipeHandler=function(event){var _=this;if(_.options.swipe===false||"ontouchend"in document&&_.options.swipe===false){return}else if(_.options.draggable===false&&event.type.indexOf("mouse")!==-1){return}_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;if(_.options.verticalSwiping===true){_.touchObject.minSwipe=_.listHeight/_.options.touchThreshold}switch(event.data.action){case"start":_.swipeStart(event);break;case"move":_.swipeMove(event);break;case"end":_.swipeEnd(event);break}};Slick.prototype.swipeMove=function(event){var _=this,edgeWasHit=false,curLeft,swipeDirection,swipeLength,positionOffset,touches,verticalSwipeLength;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;if(!_.dragging||_.scrolling||touches&&touches.length!==1){return false}curLeft=_.getLeft(_.currentSlide);_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));verticalSwipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY-_.touchObject.startY,2)));if(!_.options.verticalSwiping&&!_.swiping&&verticalSwipeLength>4){_.scrolling=true;return false}if(_.options.verticalSwiping===true){_.touchObject.swipeLength=verticalSwipeLength}swipeDirection=_.swipeDirection();if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4){_.swiping=true;event.preventDefault()}positionOffset=(_.options.rtl===false?1:-1)*(_.touchObject.curX>_.touchObject.startX?1:-1);if(_.options.verticalSwiping===true){positionOffset=_.touchObject.curY>_.touchObject.startY?1:-1}swipeLength=_.touchObject.swipeLength;_.touchObject.edgeHit=false;if(_.options.infinite===false){if(_.currentSlide===0&&swipeDirection==="right"||_.currentSlide>=_.getDotCount()&&swipeDirection==="left"){swipeLength=_.touchObject.swipeLength*_.options.edgeFriction;_.touchObject.edgeHit=true}}if(_.options.vertical===false){_.swipeLeft=curLeft+swipeLength*positionOffset}else{_.swipeLeft=curLeft+swipeLength*(_.$list.height()/_.listWidth)*positionOffset}if(_.options.verticalSwiping===true){_.swipeLeft=curLeft+swipeLength*positionOffset}if(_.options.fade===true||_.options.touchMove===false){return false}if(_.animating===true){_.swipeLeft=null;return false}_.setCSS(_.swipeLeft)};Slick.prototype.swipeStart=function(event){var _=this,touches;_.interrupted=true;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false}if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){touches=event.originalEvent.touches[0]}_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true};Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.unload=function(){var _=this;$(".slick-cloned",_.$slider).remove();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}_.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};Slick.prototype.unslick=function(fromBreakpoint){var _=this;_.$slider.trigger("unslick",[_,fromBreakpoint]);_.destroy()};Slick.prototype.updateArrows=function(){var _=this,centerOffset;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow&&!_.options.infinite){_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false");if(_.currentSlide===0){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow&&_.options.centerMode===false){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-1&&_.options.centerMode===true){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find("li").removeClass("slick-active").end();_.$dots.find("li").eq(Math.floor(_.currentSlide/_.options.slidesToScroll)).addClass("slick-active")}};Slick.prototype.visibility=function(){var _=this;if(_.options.autoplay){if(document[_.hidden]){_.interrupted=true}else{_.interrupted=false}}};$.fn.slick=function(){var _=this,opt=arguments[0],args=Array.prototype.slice.call(arguments,1),l=_.length,i,ret;for(i=0;i<l;i++){if(typeof opt=="object"||typeof opt=="undefined")_[i].slick=new Slick(_[i],opt);else ret=_[i].slick[opt].apply(_[i].slick,args);if(typeof ret!="undefined")return ret}return _}});
vendor: 7,261 bytes, lines 6327-6349
6327 6328'use strict';(function(C,g){"function"===typeof define&&define.amd?define([],g):"object"===typeof module&&module.exports?module.exports=g():C.Rellax=g()})("undefined"!==typeof window?window:global,function(){var C=function(g,q){function P(){if(3===a.options.breakpoints.length&&Array.isArray(a.options.breakpoints)){var d=!0,c=!0,b;a.options.breakpoints.forEach(function(f){"number"!==typeof f&&(c=!1);null!==b&&f<b&&(d=!1);b=f});if(d&&c)return}a.options.breakpoints=[576,768,1201];console.warn("Rellax: You must pass an array of 3 numbers in ascending order to the breakpoints option. Defaults reverted")} 6329var a=Object.create(C.prototype),p=0,r=0,t=0,k=0,e=[],u=!0,J=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(d){return setTimeout(d,1E3/60)},v=null,G=!1;try{var K=Object.defineProperty({},"passive",{get:function(){G=!0}});window.addEventListener("testPassive",null,K);window.removeEventListener("testPassive",null,K)}catch(d){}var Q=window.cancelAnimationFrame||window.mozCancelAnimationFrame|| 6330clearTimeout,R=window.transformProp||function(){var d=document.createElement("div");if(null===d.style.transform){var c=["Webkit","Moz","ms"],b;for(b in c)if(void 0!==d.style[c[b]+"Transform"])return c[b]+"Transform"}return"transform"}();a.options={speed:-2,verticalSpeed:null,horizontalSpeed:null,breakpoints:[576,768,1201],center:!1,wrapper:null,relativeToWrapper:!1,round:!0,vertical:!0,horizontal:!1,verticalScrollAxis:"y",horizontalScrollAxis:"x",callback:function(){}};q&&Object.keys(q).forEach(function(d){a.options[d]= 6331q[d]});q&&q.breakpoints&&P();g||=".rellax";g="string"===typeof g?document.querySelectorAll(g):[g];if(0<g.length){a.elems=g;if(a.options.wrapper&&!a.options.wrapper.nodeType)if(g=document.querySelector(a.options.wrapper))a.options.wrapper=g;else{console.warn("Rellax: The wrapper you're trying to use doesn't exist.");return}var H,F=function(){for(var d=0;d<e.length;d++)a.elems[d].style.cssText=e[d].style;e=[];r=window.innerHeight;k=window.innerWidth;d=a.options.breakpoints;H=k<d[0]?"xs":k>=d[0]&&k< 6332d[1]?"sm":k>=d[1]&&k<d[2]?"md":"lg";L();for(d=0;d<a.elems.length;d++){var c=void 0,b=a.elems[d],f=b.getAttribute("data-rellax-percentage"),l=b.getAttribute("data-rellax-speed"),h=b.getAttribute("data-rellax-xs-speed"),w=b.getAttribute("data-rellax-mobile-speed"),x=b.getAttribute("data-rellax-tablet-speed"),y=b.getAttribute("data-rellax-desktop-speed"),z=b.getAttribute("data-rellax-vertical-speed"),A=b.getAttribute("data-rellax-horizontal-speed"),D=b.getAttribute("data-rellax-vertical-scroll-axis"), 6333E=b.getAttribute("data-rellax-horizontal-scroll-axis"),S=b.getAttribute("data-rellax-zindex")||0,T=b.getAttribute("data-rellax-min"),U=b.getAttribute("data-rellax-max"),V=b.getAttribute("data-rellax-min-x"),W=b.getAttribute("data-rellax-max-x"),X=b.getAttribute("data-rellax-min-y"),Y=b.getAttribute("data-rellax-max-y"),m=!0;h||w||x||y?c={xs:h,sm:w,md:x,lg:y}:m=!1;h=a.options.wrapper?a.options.wrapper.scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;a.options.relativeToWrapper&& 6334(h=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)-a.options.wrapper.offsetTop);var B=a.options.vertical?f||a.options.center?h:0:0,M=a.options.horizontal?f||a.options.center?a.options.wrapper?a.options.wrapper.scrollLeft:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft:0:0;h=B+b.getBoundingClientRect().top;w=b.clientHeight||b.offsetHeight||b.scrollHeight;x=M+b.getBoundingClientRect().left;y=b.clientWidth||b.offsetWidth||b.scrollWidth; 6335B=f?f:(B-h+r)/(w+r);f=f?f:(M-x+k)/(y+k);a.options.center&&(B=f=.5);c=m&&null!==c[H]?Number(c[H]):l?l:a.options.speed;z=z?z:a.options.verticalSpeed;A=A?A:a.options.horizontalSpeed;D=D?D:a.options.verticalScrollAxis;E=E?E:a.options.horizontalScrollAxis;l=N(f,B,c,z,A);b=b.style.cssText;m="";if(f=/transform\s*:/i.exec(b))m=b.slice(f.index),m=(f=m.indexOf(";"))?" "+m.slice(11,f).replace(/\s/g,""):" "+m.slice(11).replace(/\s/g,"");e.push({baseX:l.x,baseY:l.y,top:h,left:x,height:w,width:y,speed:c,verticalSpeed:z, 6336horizontalSpeed:A,verticalScrollAxis:D,horizontalScrollAxis:E,style:b,transform:m,zindex:S,min:T,max:U,minX:V,maxX:W,minY:X,maxY:Y})}O();u&&(window.addEventListener("resize",F),u=!1,I())},L=function(){var d=p,c=t;p=a.options.wrapper?a.options.wrapper.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop||window.pageYOffset;t=a.options.wrapper?a.options.wrapper.scrollLeft:(document.documentElement||document.body.parentNode||document.body).scrollLeft||window.pageXOffset; 6337a.options.relativeToWrapper&&(p=((document.documentElement||document.body.parentNode||document.body).scrollTop||window.pageYOffset)-a.options.wrapper.offsetTop);return d!=p&&a.options.vertical||c!=t&&a.options.horizontal?!0:!1},N=function(d,c,b,f,l){var h={};d=100*(l?l:b)*(1-d);c=100*(f?f:b)*(1-c);h.x=a.options.round?Math.round(d):Math.round(100*d)/100;h.y=a.options.round?Math.round(c):Math.round(100*c)/100;return h},n=function(){window.removeEventListener("resize",n);window.removeEventListener("orientationchange", 6338n);(a.options.wrapper?a.options.wrapper:window).removeEventListener("scroll",n);(a.options.wrapper?a.options.wrapper:document).removeEventListener("touchmove",n);v=J(I)},I=function(){L()&&!1===u?(O(),v=J(I)):(v=null,window.addEventListener("resize",n),window.addEventListener("orientationchange",n),(a.options.wrapper?a.options.wrapper:window).addEventListener("scroll",n,G?{passive:!0}:!1),(a.options.wrapper?a.options.wrapper:document).addEventListener("touchmove",n,G?{passive:!0}:!1))},O=function(){for(var d, 6339c=0;c<a.elems.length;c++){var b=e[c].verticalScrollAxis.toLowerCase(),f=e[c].horizontalScrollAxis.toLowerCase();d=-1!=b.indexOf("x")?p:0;b=-1!=b.indexOf("y")?p:0;var l=-1!=f.indexOf("x")?t:0;f=-1!=f.indexOf("y")?t:0;d=N((d+l-e[c].left+k)/(e[c].width+k),(b+f-e[c].top+r)/(e[c].height+r),e[c].speed,e[c].verticalSpeed,e[c].horizontalSpeed);f=d.y-e[c].baseY;b=d.x-e[c].baseX;null!==e[c].min&&(a.options.vertical&&!a.options.horizontal&&(f=f<=e[c].min?e[c].min:f),a.options.horizontal&&!a.options.vertical&& 6340(b=b<=e[c].min?e[c].min:b));null!=e[c].minY&&(f=f<=e[c].minY?e[c].minY:f);null!=e[c].minX&&(b=b<=e[c].minX?e[c].minX:b);null!==e[c].max&&(a.options.vertical&&!a.options.horizontal&&(f=f>=e[c].max?e[c].max:f),a.options.horizontal&&!a.options.vertical&&(b=b>=e[c].max?e[c].max:b));null!=e[c].maxY&&(f=f>=e[c].maxY?e[c].maxY:f);null!=e[c].maxX&&(b=b>=e[c].maxX?e[c].maxX:b);a.elems[c].style[R]="translate3d("+(a.options.horizontal?b:"0")+"px,"+(a.options.vertical?f:"0")+"px,"+e[c].zindex+"px) "+e[c].transform}a.options.callback(d)}; 6341a.destroy=function(){for(var d=0;d<a.elems.length;d++)a.elems[d].style.cssText=e[d].style;u||(window.removeEventListener("resize",F),u=!0);Q(v);v=null};F();a.refresh=F;return a}console.warn("Rellax: The elements you're trying to select don't exist.")};return C}); 6342$(window).on('load', function() { 6343 if ($('.trellax').length) { 6344 var rellax = new Rellax('.trellax', { center: true }); 6345 if ($(window).width() < 768) { 6346 rellax.destroy(); 6347 } 6348 } 6349});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.