vendor: 15,125 bytes, lines 1-2
1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}
vendor: 4,356 bytes, line 2
2:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];
vendor: 10,068 bytes, line 2
2if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pe
vendor: 8,547 bytes, line 2
2nding",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone
vendor: 51,404 bytes, line 2
2=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={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,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
2 3
vendor: 20,278 bytes, lines 4-7
4/*! jQuery Validation Plugin - v1.19.5 - 7/1/2022 5 * https://jqueryvalidation.org/ 6 * Copyright (c) 2022 Jörn Zaefferer; Licensed MIT */ 7!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.val
7idator.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}); 8/*! jQuery UI - v1.13.2 - 2023-05-11 9* http://jqueryui.com 10* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/menu.js, widgets/tabs.js, effect.js, effects/effect-bounce.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-highlight.js, effects/effect-scale.js, effects/effect-size.js, effects/effect-slide.js 11* Copyright jQuery Foundation and other contributors; Licensed MIT */ 12 13!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(w){"use strict";w.ui=w.ui||{};w.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;w.cleanData=(n=w.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=w._data(i,"events"))&&e.remove&&w(i).triggerHandler("remove");n(t)}),w.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=w.Widget),Array.isArray(e)&&(e=w.extend.apply(null,[{}].concat(e))),w.expr.pseudos[l.toLowerCase()]=function(t){return!!w.data(t,l)},w[r]=w[r]||{},s=w[r][t],n=w[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},w.extend(n,s,{version:e.version,_proto:w.extend({},e),_childConstructors:[]}),(o=new i).options=w.widget.extend({},o.options),w.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=w.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(w.each(s._childConstructors,function(t,e){var i=e.prototype;w.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),w.widget.bridge(t,n),n}
vendor: 31,850 bytes, line 13
13,w.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(w.isPlainObject(i)?t[e]=w.isPlainObject(t[e])?w.widget.extend({},t[e],i):w.widget.extend({},i):t[e]=i);return t},w.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;w.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=w.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?w.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:w.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=w.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=w.data(this,a);t?(t.option(i||{}),t._init&&t._init()):w.data(this,a,new e(i,this))})),n}},w.Widget=function(){},w.Widget._childConstructors=[],w.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=w(e||this.defaultElement||this)[0],this.element=w(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=w(),this.hoverable=w(),this.focusable=w(),this.classesElementLookup={},e!==this&&(w.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=w(e.style?e.ownerDocument:e.document||e),this.window=w(this.document[0].defaultView||this.document[0].parentWindow)),this.options=w.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:w.noop,_create:w.noop,_init:w.noop,destroy:function(){var i=this;this._destroy(),w.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:w.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return w.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=w.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=w(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||w(),i=n.add?(function(){var i=[];n.element.each(function(t,e){w.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(w(i),{remove:"_untrackClassesElement"})}(),w(w.uniqueSort(i.get().concat(n.element.get())))):w(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=w.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;w.each(s.classesElementLookup,function(t,e){-1!==w.inArray(i.target,e)&&(s.classesElementLookup[t]=w(e.not(i.target).get()))}),this._off(w(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=w(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),w.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!w(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||w.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=w(this.bindings.not(t).get()),this.focusable=w(this.focusable.not(t).get()),this.hoverable=w(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(w(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(w(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=w.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},w.each({show:"fadeIn",hide:"fadeOut"},function(o,a){w.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!w.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&w.effects&&w.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){w(this)[o](),i&&i.call(e[0]),t()})}});var s,C,T,o,l,h,c,u,k;w.widget;function I(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function E(t,e){return parseInt(w.css(t,e),10)||0}function A(t){return null!=t&&t===t.window}C=Math.max,T=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,k=w.fn.position,w.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=w("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return w("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?w.position.scrollbarWidth():0,height:e?w.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=w(t||window),i=A(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?w(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},w.fn.position=function(u){if(!u||!u.of)return k.apply(this,arguments);var d,f,p,m,g,t,v="string"==typeof(u=w.extend({},u)).of?w(document).find(u.of):w(u.of),b=w.position.getWithinInfo(u.within),_=w.position.getScrollInfo(b),y=(u.collision||"flip").split(" "),x={},e=9===(t=(e=v)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:A(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return v[0].preventDefault&&(u.at="left top"),f=e.width,p=e.height,g=w.extend({},m=e.offset),w.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),x[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?g.left+=f:"center"===u.at[0]&&(g.left+=f/2),"bottom"===u.at[1]?g.top+=p:"center"===u.at[1]&&(g.top+=p/2),d=I(x.at,f,p),g.left+=d[0],g.top+=d[1],this.each(function(){var i,t,a=w(this),r=a.outerWidth(),l=a.outerHeight(),e=E(this,"marginLeft"),s=E(this,"marginTop"),n=r+e+E(this,"marginRight")+_.width,o=l+s+E(this,"marginBottom")+_.height,h=w.extend({},g),c=I(x.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},w.each(["left","top"],function(t,e){w.ui.position[y[t]]&&w.ui.position[y[t]][e](h,{targetWidth:f,targetHeight:p,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:b,elem:a})}),u.using&&(t=function(t){var e=m.left-h.left,i=e+f-r,s=m.top-h.top,n=s+p-l,o={target:{element:v,left:m.left,top:m.top,width:f,height:p},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};f<r&&T(e+i)<f&&(o.horizontal="center"),p<l&&T(s+n)<p&&(o.vertical="middle"),C(T(e),T(i))>C(T(s),T(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(w.extend(h,{using:t}))})},w.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=C(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=C(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<T(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||T(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<T(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||T(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){w.ui.position.flip.left.apply(this,arguments),w.ui.position.fit.left.apply(this,arguments)},top:function(){w.ui.position.flip.top.apply(this,arguments),w.ui.position.fit.top.apply(this,arguments)}}};var t;w.ui.position,w.extend(w.expr.pseudos,{data:w.expr.createPseudo?w.expr.createPseudo(function(e){return function(t){return!!w.data(t,e)}}):function(t,e,i){return!!w.data(t,i[3])}}),w.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});w.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=w("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=w(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&w(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(w(t)))},w.extend(w.expr.pseudos,{focusable:function(t){return w.ui.focusable(t,null!=w.attr(t,"tabindex"))}});var e,d;w.ui.focusable,w.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):w(this[0].form)},w.ui.formResetMixin={_formResetHandler:function(){var e=w(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");w.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(w.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};w.expr.pseudos||(w.expr.pseudos=w.expr[":"]),w.uniqueSort||(w.uniqueSort=w.unique),w.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,d=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},w.escapeSelector=function(t){return(t+"").replace(e,d)}),w.fn.even&&w.fn.odd||w.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});var f;w.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},w.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+w.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},w.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=w(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:w(this[0].ownerDocument||document)},w.extend(w.expr.pseudos,{tabbable:function(t){var e=w.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&w.ui.focusable(t,i)}}),w.fn.extend({uniqueId:(f=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++f)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&w(this).removeAttr("id")})}}),w.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=w(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():w()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=w("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=w.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(w(t.target).attr("tabIndex",-1),w(n).attr("tabIndex",0),w(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===w.ui.keyCode.UP&&t.ctrlKey&&w(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=w()):!1===t.active?this._activate(0):this.active.length&&!w.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=w()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=w(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=w(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=w(this).outerHeight(!0)}),this.headers.next().each(function(){w(this).height(Math.max(0,i-w(this).innerHeight()+w(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=w(this).is(":visible");t||w(this).show(),i=Math.max(i,w(this).css("height","").height()),t||w(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:w.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):w()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&w.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=w(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?w():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?w():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?w():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(w(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),w.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},w.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=w(t.target),i=w(w.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){w.contains(this.element[0],w.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=w(t.target).closest(".ui-menu-item"),i=w(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=w(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case w.ui.keyCode.PAGE_UP:this.previousPage(t);break;case w.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case w.ui.keyCode.HOME:this._move("first","first",t);break;case w.ui.keyCode.END:this._move("last","last",t);break;case w.ui.keyCode.UP:this.previous(t);break;case w.ui.keyCode.DOWN:this.next(t);break;case w.ui.keyCode.LEFT:this.collapse(t);break;case w.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case w.ui.keyCode.ENTER:case w.ui.keyCode.SPACE:this._activate(t);break;case w.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=w(this),e=t.prev(),i=w("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=w(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!w.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(w.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(w.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=w.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:w(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
13se")},_closeOnDocumentClick:function(t){return!w(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===w.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=w(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===w.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=w(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||w(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(w(this).children(".ui-menu-item-wrapper").text()))})}});w.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=w.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=w.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value(
vendor: 40,547 bytes, lines 13-37
13)},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=w("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){w(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(w("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==w.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=w("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||w.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?w(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(w.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=w.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:w.map(t,function(t){return"string"==typeof t?{label:t,value:t}:w.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(w.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;w.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return w("<li>").append(w("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),w.extend(w.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(w.ui.autocomplete.escapeRegex(e),"i");return w.grep(t,function(t){return i.test(t.label||t.value||t)})}}),w.widget("ui.autocomplete",w.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(w("<div>").text(e))},100))}});var p;w.ui.autocomplete;w.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(p=/#.*$/,function(t){var e=t.href.replace(p,""),i=location.href.replace(p,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=w.uniqueSort(t.disabled.concat(w.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=w(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(w(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):w()}},_tabKeydown:function(t){var e=w(w.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case w.ui.keyCode.RIGHT:case w.ui.keyCode.DOWN:i++;break;case w.ui.keyCode.UP:case w.ui.keyCode.LEFT:s=!1,i--;break;case w.ui.keyCode.END:i=this.anchors.length-1;break;case w.ui.keyCode.HOME:i=0;break;case w.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case w.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===w.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===w.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===w.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==w.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=w.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!w.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=w()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=w()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){w(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){w(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return w("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=w(),this.anchors.each(function(t,e){var i,s,n,o=w(e).uniqueId().attr("id"),a=w(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||w({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return w("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=w(e),!0===t||-1!==w.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&w.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=w(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=w(this).outerHeight(!0)}),this.panels.each(function(){w(this).height(Math.max(0,i-w(this).innerHeight()+w(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,w(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=w(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?w():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):w(),i={oldTab:i,oldPanel:r,newTab:o?w():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?w():s,this.xhr&&this.xhr.abort(),r.length||a.length||w.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===w(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:w.noop}))},_findActive:function(t){return!1===t?w():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+w.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){w.data(this,"ui-tabs-destroy")?w(this).remove():w(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=w(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?w.map(t,function(t){return t!==i?t:null}):w.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==w.inArray(t,e))return;e=Array.isArray(e)?w.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=w.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,w.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=w(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==w.uiBackCompat&&w.widget("ui.tabs",w.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});w.ui.tabs;var m=w,g={},v=g.toString,b=/^([\-+])=\s*(\d+\.?\d*)/,_=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],y=m.Color=function(t,e,i,s){return new m.Color.fn.parse(t,e,i,s)},x={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},P={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},H=y.support={},S=m("<p>")[0],W=m.each;function D(t){return null==t?t+"":"object"==typeof t?g[v.call(t)]||"object":typeof t}function M(t,e,i){var s=P[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function N(s){var n=y(),o=n._rgba=[];return s=s.toLowerCase(),W(_,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[x[e].cache]=i[x[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&m.extend(o,G.transparent),n):G[s]}function O(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}S.style.cssText="background-color:rgba(1,1,1,.5)",H.rgba=-1<S.style.backgroundColor.indexOf("rgba"),W(x,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),m.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){g["[object "+e+"]"]=e.toLowerCase()}),(y.fn=m.extend(y.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=m(n).css(t),t=void 0);var o=this,s=D(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(N(n)||G._default):"array"===s?(W(x.rgba.props,function(t,e){a[e.idx]=M(n[e.idx],e)}),this):"object"===s?(W(x,n instanceof y?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;W(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=M(n[t],e,!0)}),o[s]&&m.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=y(t),o=!0,a=this;return W(x,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],W(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return W(x,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=y(t))._space(),i=x[e],t=0===this.alpha()?y("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return W(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=P[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=y(t)._rgba;return y(m.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=m.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=m.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+m.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=y.fn,x.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},x.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*O(s,i,e+1/3)),Math.round(255*O(s,i,e)),Math.round(255*O(s,i,e-1/3)),t]},W(x,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;y.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=D(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return W(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=M(t,e)}),r?((t=y(r(n)))[o]=n,t):y(n)},W(e,function(a,r){y.fn[a]||(y.fn[a]=function(t){var e,i=D(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=D(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=b.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(y.hook=function(t){t=t.split(" ");W(t,function(t,o){m.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==D(e)||(i=N(e)))){if(e=y(i||e),!H.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=m.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},m.fx.step[o]=function(t){t.colorInit||(t.start=y(t.elem,o),t.end=y(t.end),t.colorInit=!0),m.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),m.cssHooks.borderColor={expand:function(i){var s={};return W(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var L,q,R,F,j,B,U,z,K,$,G=m.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},Q="ui-effects-",V="ui-effects-style",X="ui-effects-animated";function Y(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function J(t,e,i,s){return t={effect:t=w.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!w.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&w.extend(t,e),i=i||e.duration,t.duration=w.fx.off?0:"number"==typeof i?i:i in w.fx.speeds?w.fx.speeds[i]:w.fx.speeds._default,t.complete=s||e.complete,t}function Z(t){return!t||"number"==typeof t||w.fx.speeds[t]||("string"==typeof t&&!w.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function tt(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}w.effects={effect:{}},F=["add","remove","toggle"],j={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},w.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){w.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(m.style(t.elem,e,t.end),t.setAttr=!0)}}),w.fn.addBack||(w.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),w.effects.animateClass=function(n,t,e,i){var o=w.speed(t,e,i);return this.queue(function(){var i=w(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:w(this),start:Y(this)}}),s=function(){w.each(F,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=Y(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(j[i]||!w.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=w.Deferred(),i=w.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),w.when.apply(w,e.get()).done(function(){s(),w.each(arguments,function(){var e=this.el;w.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},w.fn.extend({addClass:(R=w.fn.addClass,function(t,e,i,s){return e?w.effects.animateClass.call(this,{add:t},e,i,s):R.apply(this,arguments)}),removeClass:(q=w.fn.removeClass,function(t,e,i,s){return 1<arguments.length?w.effects.animateClass.call(this,{remove:t},e,i,s):q.apply(this,arguments)}),toggleClass:(L=w.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?w.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):L.apply(this,arguments):w.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return w.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),w.expr&&w.expr.pseudos&&w.expr.pseudos.animated&&(w.expr.pseudos.animated=(B=w.expr.pseudos.animated,function(t){return!!w(t).data(X)||B(t)})),!1!==w.uiBackCompat&&w.extend(w.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(Q+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(Q+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=w("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!w.contains(i[0],n)||w(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(w.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),w.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!w.contains(t[0],e)||w(e).trigger("focus")),t}}),w.extend(w.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),w.effects.effect[t]=i,w.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(V,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(V)||"",t.removeData(V)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=w("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(Q+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=Q+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){w.effects.restoreStyle(t),w.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},w.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),w.fn.extend({effect:function(){function t(t){var e=w(this),i=w.effects.mode(e,r)||o;e.data(X,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||w.effects.saveStyle(e),"function"==typeof t&&t()}var s=J.apply(this,arguments),n=w.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return w.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=w(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===w.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(X),w.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(K=w.fn.show,function(t){if(Z(t))return K.apply(this,arguments);t=J.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(z=w.fn.hide,function(t){if(Z(t))return z.apply(this,arguments);t=J.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(U=w.fn.toggle,function(t){if(Z(t)||"boolean"==typeof t)return U.apply(this,arguments);t=J.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return w.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):tt(this.css("clip"),this)},transfer:function(t,e){var i=w(this),s=w(t.to),n="fixed"===s.css("position"),o=w("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=w("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),w.fx.step.clip=function(t){t.clipInit||(t.start=w(t.elem).cssClip(),"string"==typeof t.end&&(t.end=tt(t.end,t.elem)),t.clipInit=!0),w(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},$={},w.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){$[t]=function(t){return Math.pow(t,e+2)}}),w.extend($,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),w.each($,function(t,e){w.easing["easeIn"+t]=e,w.easing["easeOut"+t]=function(t){return 1-e(1-t)},w.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});w.effects,w.effects.define("bounce",function(t,e){var i,s,n=w(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,f="up"===l||"down"===l?"top":"left",p="up"===l||"left"===l,m=0,t=n.queue().length;for(w.effects.createPlaceholder(n),l=n.css(f),h=h||n["top"==f?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[f]=l,n.css("opacity",0).css(f,p?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[f]=l;m<c;m++)(i={})[f]=(p?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[f]=(p?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),w.effects.unshift(n,t,1+o)}),w.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=w(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),f=Math.ceil(c.outerWidth()/h),p=Math.ceil(c.outerHeight()/l),m=[];function g(){m.push(this),m.length===l*h&&(c.css({visibility:"visible"}),w(m).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*p,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*f,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*f,top:-i*p}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:p,left:n+(u?a*f:0),top:o+(u?r*p:0),opacity:u?0:1}).animate({left:n+(u?0:a*f),top:o+(u?0:r*p),opacity:u?1:0},t.duration||500,t.easing,g)}),w.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;w(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),w.effects.define("highlight","show",function(t,e){var i=w(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),w.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),w.effects.define("size",function(s,e){var n,i=w(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),f=w.effects.scaledDimensions(i),p=s.from||f,m=s.to||w.effects.scaledDimensions(i,0);w.effects.createPlaceholder(i),"show"===r&&(r=p,p=m,m=r),n={from:{y:p.height/f.height,x:p.width/f.width},to:{y:m.height/f.height,x:m.width/f.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(p=w.effects.setTransition(i,o,n.from.y,p),m=w.effects.setTransition(i,o,n.to.y,m)),n.from.x!==n.to.x&&(p=w.effects.setTransition(i,a,n.from.x,p),m=w.effects.setTransition(i,a,n.to.x,m))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(p=w.effects.setTransition(i,t,n.from.y,p),m=w.effects.setTransition(i,t,n.to.y,m)),c&&(c=w.effects.getBaseline(c,f),p.top=(f.outerHeight-p.outerHeight)*c.y+d.top,p.left=(f.outerWidth-p.outerWidth)*c.x+d.left,m.top=(f.outerHeight-m.outerHeight)*c.y+d.top,m.left=(f.outerWidth-m.outerWidth)*c.x+d.left),delete p.outerHeight,delete p.outerWidth,i.css(p),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=w(this),e=w.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=w.effects.setTransition(t,o,n.from.y,i),e=w.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=w.effects.setTransition(t,a,n.from.x,i),e=w.effects.setTransition(t,a,n.to.x,e)),l&&w.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&w.effects.restoreStyle(t)})})),i.animate(m,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===m.opacity&&i.css("opacity",p.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),w.effects.saveStyle(i)),e()}})}),w.effects.define("scale",function(t,e){var i=w(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=w.extend(!0,{from:w.effects.scaledDimensions(i),to:w.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),w.effects.effect.size.call(this,s,e)}),w.effects.define("slide","show",function(t,e){var i,s,n=w(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};w.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})})}); 14jQuery(function ($) { 15 16 // https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/repeat 17 if (!String.prototype.repeat) { 18 String.prototype.repeat = function (count) { 19 'use strict'; 20 if (this == null) { 21 throw new TypeError('can\'t convert ' + this + ' to object'); 22 } 23 var str = '' + this; 24 count = +count; 25 if (count != count) { 26 count = 0; 27 } 28 if (count < 0) { 29 throw new RangeError('repeat count must be non-negative'); 30 } 31 if (count == Infinity) { 32 throw new RangeError('repeat count must be less than infinity'); 33 } 34 count = Math.floor(count); 35 if (str.length == 0 || count == 0) { 36 return ''; 37 }
38 // ÐбеÑпеÑение Ñого, ÑÑо count ÑвлÑеÑÑÑ 31-биÑнÑм ÑелÑм ÑиÑлом, позволÑÐµÑ Ð½Ð°Ð¼ знаÑиÑелÑно 39 // ÑопÑимизиÑоваÑÑ Ð³Ð»Ð°Ð²Ð½ÑÑ ÑаÑÑÑ ÑÑнкÑии. ÐпÑоÑем, болÑÑинÑÑво ÑовÑеменнÑÑ (на авгÑÑÑ 40 // 2014 года) бÑаÑзеÑов не обÑабаÑÑваÑÑ ÑÑÑоки, длиннее 1 << 28 Ñимволов, Ñак ÑÑо: 41 if (str.length * count >= 1 << 28) { 42 throw new RangeError('repeat count must not overflow maximum string size'); 43 } 44 var rpt = ''; 45 for (var i = 0; i < count; i++) { 46 rpt += str; 47 } 48 return rpt; 49 } 50 } 51 52 // https://github.com/uxitten/polyfill/blob/master/string.polyfill.js 53 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart 54 if (!String.prototype.padStart) { 55 String.prototype.padStart = function padStart(targetLength, padString) { 56 targetLength = targetLength >> 0; //truncate if number or convert non-number to 0; 57 padString = String((typeof padString !== 'undefined' ? padString : ' ')); 58 if (this.length > targetLength) { 59 return String(this); 60 } 61 else { 62 targetLength = targetLength - this.length; 63 if (targetLength > padString.length) { 64 padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed 65 } 66 console.log("targetLength", targetLength); 67 console.log("padString.length", padString.length); 68 console.log("targetLength / padString.length", targetLength / padString.length); 69 70 return padString.slice(0, targetLength) + String(this); 71 } 72 }; 73 } 74 75 $.fn.flipper = function (action, options) { 76 var $flipper = $(this); 77 var action = action || 'init'; 78 var settings = $.extend({ 79 // defaults. 80 reverse: $flipper.data('reverse') || false, 81 datetime: $flipper.data('datetime') || 'now', 82 datetimeExtended: $flipper.data('datetimeExtended') || 'now', 83 template: $flipper.data('template') || 'HH:ii:ss', 84 labels: $flipper.data('labels') || 'Hours|Minutes|Seconds', 85 preload: true 86 }, options); 87 88 if (action === 'init') { 89 if ($flipper.hasClass('flipper-initialized')) { 90 console.warn('Flipper already initialized.'); 91 return; 92 } 93 $flipper.addClass("flipper-initialized"); 94 95 var templateParts = settings.template.split('|'); 96 var labelsArray = settings.labels.split('|'); 97 var n; 98 99 templateParts.forEach(function (part, index) { 100 if (index > 0) { 101 $flipper.append('<div class="flipper-group flipper-delimiter">:</div>'); 102 } 103 $flipper.append('<div class="flipper-group flipper-' + part + '"></div>'); 104 var $part = $flipper.find('.flipper-group.flipper-' + part); 105 if (typeof labelsArray[index] !== 'undefined') { 106 $part.append('<label>' + labelsArray[index] + '</label>'); 107 } 108 if (part === 'd' || part === 'H' || part === 'i' || part === 's') { 109 var rev = settings.reverse ? 'reverse' : ''; 110 $part.append('<div class="flipper-digit ' + rev + '"></div>'); 111 } 112 if (part === 'dd' || part === 'ddd' || part === 'HH' || part === 'ii' || part === 'ss') { 113 var rev = settings.reverse ? 'reverse' : ''; 114 $part.append('<div class="flipper-digit ' + rev + '"></div>'); 115 $part.append('<div class="flipper-delimiter"></div>'); 116 $part.append('<div class="flipper-digit ' + rev + '"></div>'); 117 if (part === 'ddd') { 118 $part.append('<div class="flipper-delimiter"></div>'); 119 $part.append('<div class="flipper-digit ' + rev + '"></div>'); 120 } 121 } 122 if (part === 'd') { 123 for (n = 0; n <= 31; n++) { 124 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 125 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 126 } 127 } 128 if (part === 'H') { 129 for (n = 0; n <= 23; n++) { 130 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 131 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 132 } 133 } 134 if (part === 'i' || part === 's') { 135 for (n = 0; n <= 59; n++) { 136 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 137 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 138 } 139 } 140 if (part === 'dd' || part === 'ddd') { 141 for (n = 0; n <= 9; n++) { 142 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 143 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 144 if (part === 'ddd') { 145 $part.find('.flipper-digit:eq(2)').append('<div class="digit-face">' + n + '</div>'); 146 } 147 } 148 } 149 if (part === 'HH') { 150 for (n = 0; n <= 2; n++) { 151 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 152 } 153 for (n = 0; n <= 9; n++) { 154 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 155 } 156 } 157 if (part === 'ii' || part === 'ss') { 158 for (n = 0; n <= 5; n++) { 159 $part.find('.flipper-digit:eq(0)').append('<div class="digit-face">' + n + '</div>'); 160 } 161 for (n = 0; n <= 9; n++) { 162 $part.find('.flipper-digit:eq(1)').append('<div class="digit-face">' + n + '</div>'); 163 } 164 } 165 }); 166 167 if (settings.preload) { 168 setFlipperDate($flipper, settings.datetime, false); 169 } 170 171 var setIntervalTimer = 1000; 172 173 setInterval(function () { 174 var now = new Date().toLocaleDateString(); 175 var datetimeCustom = new Date(settings.datetime).toLocaleDateString(); 176 var datetimeExtendedCustom = new Date(settings.datetimeExtended).toLocaleDateString(); 177 178 if (now <= datetimeCustom) { 179 setFlipperDate($flipper, settings.datetime, true); 180 } 181 else if (now <= datetimeExtendedCustom) { 182 settings.datetime = settings.datetimeExtended; 183 setFlipperDate($flipper, settings.datetime, true); 184 } 185 else { 186 setIntervalTimer = 0; 187 } 188 }, setIntervalTimer); 189 190 191 upsizeToParent($flipper); 192 $(window).on("resize", function () { 193 upsizeToParent($flipper); 194 }); 195 } 196 197 var flipTime = 400; 198 var $body = $('body'); 199 200 function flipDigit($digit) { 201 if (!$digit.closest('.flipper').is('.flipper-initialized')) { 202 return; 203 } 204 if ($digit.hasClass('r')) { 205 setTimeout(function () { 206 flipDigit($digit); 207 }, flipTime + 1); 208 return; 209 } 210 $digit.addClass('r'); 211 212 var $currentTop = $digit.find('.digit-top'); 213 var $currentTop2 = $digit.find('.digit-top2'); 214 var $currentBottom = $digit.find('.digit-bottom'); 215 var $activeDigit = $digit.find('.digit-face.active'); 216 var $firstDigit = $digit.find('.digit-face:first'); 217 var $prevDigit = $activeDigit.prev('.digit-face'); 218 var $nextDigit = $activeDigit.next('.digit-face'); 219 var $lastDigit = $digit.find('.digit-face:last'); 220 if ($digit.hasClass('reverse')) { 221 var $next = $prevDigit.length ? $prevDigit : $lastDigit; 222 } 223 else { 224 var $next = $nextDigit.length ? $nextDigit : $firstDigit; 225 } 226 var current = parseInt($currentTop.html()); 227 var next = $next.html(); 228 $digit.find('.digit-next').html(next); 229 $digit.find('.digit-face').removeClass('active'); 230 $next.addClass('active'); 231 $currentTop.addClass('r'); 232 $currentTop2.addClass('r'); 233 $currentBottom.addClass('r'); 234 if (next.toString() === $digit.attr('data-value')) { 235 $digit.removeAttr('data-value'); 236 } 237 setTimeout(function () { 238 $currentTop.html(next).hide(); 239 $currentTop2.html(next); 240 setTimeout(function () { 241 $currentBottom.html(next).removeClass('r'); 242 $currentTop.removeClass('r').show(); 243 $currentTop2.html(next).removeClass('r'); 244 $digit.removeClass('r'); 245 }, flipTime / 2); 246 }, flipTime / 2); 247 } 248 249 function upsizeToParent($flipper) { 250 var parentWidth; 251 var flipperWidth; 252 var maxFontSize = 1000; 253 var fontSize = maxFontSize; 254 var i = 0; 255 var minFontSize = 0; 256 $flipper.css('font-size', fontSize + 'px'); 257 while (i < 20) { 258 i++; 259 parentWidth = $flipper.innerWidth(); 260 $flipper.css('width', '9999px'); 261 flipperWidth = 0; 262 $flipper.find('.flipper-group').each(function () { 263 var w = parseFloat($(this).outerWidth()); 264 flipperWidth += w; 265 }); 266 if ((parentWidth - flipperWidth) < 10 && (parentWidth - flipperWidth) > 0) { 267 $flipper.css('width', ''); 268 return; 269 } 270 if (flipperWidth > parentWidth) { 271 maxFontSize = fontSize < maxFontSize ? fontSize : maxFontSize; 272 } 273 else { 274 minFontSize = fontSize > minFontSize ? fontSize : minFontSize; 275 } 276 fontSize = (maxFontSize + minFontSize) / 2; 277 $flipper.css('width', ''); 278 $flipper.css('font-size', fontSize + 'px'); 279 } 280 } 281 282 function setDigitValue(digitIndex, value) { 283 var $flipper = $('.flipper'); 284 var $digit = $flipper.find('.flipper-digit:eq(' + digitIndex + ')'); 285 var currentValue = getDigitValue($digit); 286 if (currentValue.toString() === value.toString()) { 287 return; // has same value, do nothing 288 } 289 $digit.attr('data-value', value); 290 } 291 292 setInterval(function () { 293 var $flipper = $('.flipper'); 294 $flipper.find('.flipper-digit[data-value]').each(function () { 295 var $digit = $(this); 296 if ($digit.find('.active').html() === $digit.attr('data-value')) { 297 return; // 298 } 299 if (!$digit.is('.r')) { 300 flipDigit($digit); 301 } 302 }); 303 }, flipTime / 4); 304 305 function formatFlipperDate(dateStr) { 306 var a = dateStr.split(" "); 307 var d = a[0].split("-"); 308 var t = a[1].split(":"); 309 var date = new Date(d[0], (d[1] - 1), d[2], t[0], t[1], t[2]); 310 return date; 311 } 312 313 function addAppearance($flipper) { 314 $flipper.find('.flipper-digit').each(function () { 315 var $digit = $(this); 316 var value = $digit.find('.digit-face.active').html(); 317 $digit.find('.digit-top').remove(); 318 $digit.find('.digit-top2').remove(); 319 $digit.find('.digit-bottom').remove(); 320 $digit.find('.digit-next').remove();
321 $digit.prepend('<div class="digit-top">' + value + '</div>'); 322 $digit.prepend('<div class="digit-top2">' + value + '</div>'); 323 $digit.prepend('<div class="digit-bottom">' + value + '</div>'); 324 $digit.prepend('<div class="digit-next"></div>'); 325 }); 326 } 327 328 function setFlipperDate($flipper, dateString, animate) { 329 var animate = animate || false; 330 if (!$flipper.is(':visible')) { 331 $flipper.addClass('flipper-invisible'); 332 return; 333 } 334 if ($flipper.hasClass('flipper-invisible')) { 335 $flipper.removeClass('flipper-invisible'); 336 upsizeToParent($flipper); 337 setFlipperDate($flipper, settings.datetime, false); 338 } 339 var now = Date.now(); 340 if (dateString === 'now') { 341 var now = new Date(); 342 var seconds = now.getSeconds(); 343 var minutes = now.getMinutes(); 344 var hours = now.getHours(); 345 var days = now.getDate(); 346 } 347 else { 348 var timestamp = Date.parse(formatFlipperDate(dateString)); 349 var remainder = (timestamp - now) / 1000; 350 var days = Math.floor(remainder / 60 / 60 / 24); 351 remainder -= days * 60 * 60 * 24; 352 var hours = Math.floor(remainder / 60 / 60); 353 remainder -= hours * 60 * 60; 354 var minutes = Math.floor(remainder / 60); 355 remainder -= minutes * 60; 356 var seconds = Math.floor(remainder); 357 } 358 359 var days_str = days.toString().padStart(3, '0'); 360 var hours_str = hours.toString().padStart(2, '0'); 361 var minutes_str = minutes.toString().padStart(2, '0'); 362 var seconds_str = seconds.toString().padStart(2, '0'); 363 364 if (animate) { 365 // one section 366 $flipper.find('.flipper-d').find('.flipper-digit:eq(0)').attr('data-value', days); 367 $flipper.find('.flipper-H').find('.flipper-digit:eq(0)').attr('data-value', hours); 368 $flipper.find('.flipper-i').find('.flipper-digit:eq(0)').attr('data-value', minutes); 369 $flipper.find('.flipper-s').find('.flipper-digit:eq(0)').attr('data-value', seconds); 370 371 // two sections 372 $flipper.find('.flipper-dd').find('.flipper-digit:eq(0)').attr('data-value', days_str[1]); 373 $flipper.find('.flipper-dd').find('.flipper-digit:eq(1)').attr('data-value', days_str[2]); 374 $flipper.find('.flipper-HH').find('.flipper-digit:eq(0)').attr('data-value', hours_str[0]); 375 $flipper.find('.flipper-HH').find('.flipper-digit:eq(1)').attr('data-value', hours_str[1]); 376 $flipper.find('.flipper-ii').find('.flipper-digit:eq(0)').attr('data-value', minutes_str[0]); 377 $flipper.find('.flipper-ii').find('.flipper-digit:eq(1)').attr('data-value', minutes_str[1]); 378 $flipper.find('.flipper-ss').find('.flipper-digit:eq(0)').attr('data-value', seconds_str[0]); 379 $flipper.find('.flipper-ss').find('.flipper-digit:eq(1)').attr('data-value', seconds_str[1]); 380 381 // three sections 382 $flipper.find('.flipper-ddd').find('.flipper-digit:eq(0)').attr('data-value', days_str[0]); 383 $flipper.find('.flipper-ddd').find('.flipper-digit:eq(1)').attr('data-value', days_str[1]); 384 $flipper.find('.flipper-ddd').find('.flipper-digit:eq(2)').attr('data-value', days_str[2]); 385 } 386 else { 387 $flipper.find('.flipper-group .flipper-digit').removeAttr('data-value'); 388 $flipper.find('.digit-face.active').removeClass('active'); 389 390 // one section 391 $flipper.find('.flipper-d .flipper-digit:eq(0) .digit-face:contains(' + days + ')').addClass('active'); 392 $flipper.find('.flipper-H .flipper-digit:eq(0) .digit-face:contains(' + hours + ')').addClass('active'); 393 $flipper.find('.flipper-i .flipper-digit:eq(0) .digit-face:contains(' + minutes + ')').addClass('active'); 394 $flipper.find('.flipper-s .flipper-digit:eq(0) .digit-face:contains(' + seconds + ')').addClass('active'); 395 396 // two sections 397 $flipper.find('.flipper-dd .flipper-digit:eq(0) .digit-face:contains(' + days_str[1] + ')').addClass('active'); 398 $flipper.find('.flipper-dd .flipper-digit:eq(1) .digit-face:contains(' + days_str[2] + ')').addClass('active'); 399 $flipper.find('.flipper-HH .flipper-digit:eq(0) .digit-face:contains(' + hours_str[0] + ')').addClass('active'); 400 $flipper.find('.flipper-HH .flipper-digit:eq(1) .digit-face:contains(' + hours_str[1] + ')').addClass('active'); 401 $flipper.find('.flipper-ii .flipper-digit:eq(0) .digit-face:contains(' + minutes_str[0] + ')').addClass('active'); 402 $flipper.find('.flipper-ii .flipper-digit:eq(1) .digit-face:contains(' + minutes_str[1] + ')').addClass('active'); 403 $flipper.find('.flipper-ss .flipper-digit:eq(0) .digit-face:contains(' + seconds_str[0] + ')').addClass('active'); 404 $flipper.find('.flipper-ss .flipper-digit:eq(1) .digit-face:contains(' + seconds_str[1] + ')').addClass('active'); 405 406 // three sections 407 $flipper.find('.flipper-ddd .flipper-digit:eq(0) .digit-face:contains(' + days_str[0] + ')').addClass('active'); 408 $flipper.find('.flipper-ddd .flipper-digit:eq(1) .digit-face:contains(' + days_str[1] + ')').addClass('active'); 409 $flipper.find('.flipper-ddd .flipper-digit:eq(2) .digit-face:contains(' + days_str[2] + ')').addClass('active'); 410 addAppearance($flipper); 411 } 412 413 } 414 }; 415 416}); 417 418(function (global, factory) { 419 typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : 420 typeof define === 'function' && define.amd ? define(['jquery'], factory) : 421 (factory(global.jQuery)); 422}(this, (function ($) { 'use strict'; 423 424$ = $ && $.hasOwnProperty('default') ? $['default'] : $; 425 426/** 427 * @author Mudit Ameta 428 * @license https://github.com/zeusdeux/isInViewport/blob/master/license.md MIT 429 */ 430 431// expose isInViewport as a custom pseudo-selector 432$.extend($.expr.pseudos || $.expr[':'], { 433 // if $.expr.createPseudo is available, use it 434 'in-viewport': $.expr.createPseudo 435 ? $.expr.createPseudo(function (argsString) { return function (currElement) { return isInViewport(currElement, getSelectorArgs(argsString)); }; }) 436 : function (currObj, index, meta) { return isInViewport(currObj, getSelectorArgs(meta[3])); } 437}); 438 439 440// expose isInViewport as a function too 441// this lets folks pass around actual objects as options (like custom viewport) 442// and doesn't tie 'em down to strings. It also prevents isInViewport from 443// having to look up and wrap the dom element corresponding to the viewport selector 444$.fn.isInViewport = function(options) { 445 return this.filter(function (i, el) { return isInViewport(el, options); }) 446}; 447 448$.fn.run = run; 449 450// lets you chain any arbitrary function or an array of functions and returns a jquery object 451function run(args) { 452 var this$1 = this; 453 454 if (arguments.length === 1 && typeof args === 'function') { 455 args = [args]; 456 } 457 458 if (!(args instanceof Array)) { 459 throw new SyntaxError('isInViewport: Argument(s) passed to .do/.run should be a function or an array of functions') 460 } 461
462 args.forEach(function (arg) { 463 if (typeof arg !== 'function') { 464 console.warn('isInViewport: Argument(s) passed to .do/.run should be a function or an array of functions'); 465 console.warn('isInViewport: Ignoring non-function values in array and moving on'); 466 } else { 467 [].slice.call(this$1).forEach(function (t) { return arg.call($(t)); }); 468 } 469 }); 470 471 return this 472} 473 474 475// gets the width of the scrollbar 476function getScrollbarWidth(viewport) { 477 // append a div that has 100% width to get true width of viewport 478 var el = $('<div></div>').css({ 479 width: '100%' 480 }); 481 viewport.append(el); 482 483 // subtract true width from the viewport width which is inclusive 484 // of scrollbar by default 485 var scrollBarWidth = viewport.width() - el.width(); 486 487 // remove our element from DOM 488 el.remove(); 489 return scrollBarWidth 490} 491 492 493// Returns true if DOM element `element` is in viewport 494function isInViewport(element, options) { 495 var ref = element.getBoundingClientRect(); 496 var top = ref.top; 497 var bottom = ref.bottom; 498 var left = ref.left; 499 var right = ref.right; 500 501 var settings = $.extend({ 502 tolerance: 0, 503 viewport: window 504 }, options); 505 var isVisibleFlag = false; 506 var $viewport = settings.viewport.jquery ? settings.viewport : $(settings.viewport); 507 508 if (!$viewport.length) { 509 // console.warn('isInViewport: The viewport selector you have provided matches no element on page.'); 510 // console.warn('isInViewport: Defaulting to viewport as window'); 511 $viewport = $(window); 512 } 513 514 var $viewportHeight = $viewport.height(); 515 var $viewportWidth = $viewport.width(); 516 var typeofViewport = $viewport[0].toString(); 517 518 // if the viewport is other than window recalculate the top, 519 // bottom,left and right wrt the new viewport 520 // the [object DOMWindow] check is for window object type in PhantomJS 521 if ($viewport[0] !== window && typeofViewport !== '[object Window]' && typeofViewport !== '[object DOMWindow]') { 522 // use getBoundingClientRect() instead of $.Offset() 523 // since the original top/bottom positions are calculated relative to browser viewport and not document 524 var viewportRect = $viewport[0].getBoundingClientRect(); 525 526 // recalculate these relative to viewport 527 top = top - viewportRect.top; 528 bottom = bottom - viewportRect.top; 529 left = left - viewportRect.left; 530 right = right - viewportRect.left; 531 532 // get the scrollbar width from cache or calculate it 533 isInViewport.scrollBarWidth = isInViewport.scrollBarWidth || getScrollbarWidth($viewport); 534 535 // remove the width of the scrollbar from the viewport width 536 $viewportWidth -= isInViewport.scrollBarWidth; 537 } 538 539 // handle falsy, non-number and non-integer tolerance value 540 // same as checking using isNaN and then setting to 0 541 // bitwise operators deserve some love too you know 542 settings.tolerance = ~~Math.round(parseFloat(settings.tolerance)); 543 544 if (settings.tolerance < 0) { 545 settings.tolerance = $viewportHeight + settings.tolerance; // viewport height - tol 546 } 547 548 // the element is NOT in viewport iff it is completely out of 549 // viewport laterally or if it is completely out of the tolerance 550 // region. Therefore, if it is partially in view then it is considered 551 // to be in the viewport and hence true is returned. Because we have adjusted 552 // the left/right positions relative to the viewport, we should check the 553 // element's right against the viewport's 0 (left side), and the element's 554 // left against the viewport's width to see if it is outside of the viewport. 555 556 if (right <= 0 || left >= $viewportWidth) { 557 return isVisibleFlag 558 } 559 560 // if the element is bound to some tolerance 561 isVisibleFlag = settings.tolerance ? top <= settings.tolerance && bottom >= settings.tolerance : bottom > 0 && top <= $viewportHeight; 562 563 return isVisibleFlag 564} 565 566 567// get the selector args from the args string proved by Sizzle 568function getSelectorArgs(argsString) { 569 if (argsString) { 570 var args = argsString.split(','); 571 572 // when user only gives viewport and no tolerance 573 if (args.length === 1 && isNaN(args[0])) { 574 args[1] = args[0]; 575 args[0] = void 0; 576 } 577 578 return { 579 tolerance: args[0] ? args[0].trim() : void 0, 580 viewport: args[1] ? $(args[1].trim()) : void 0 581 } 582 } 583 return {} 584} 585 586}))); 587 588//# sourceMappingURL=isInViewport.js.map 589 590/** 591 * Swiper 8.3.1 592 * Most modern mobile touch slider and framework with hardware accelerated transitions 593 * https://swiperjs.com 594 * 595 * Copyright 2014-2022 Vladimir Kharlampidi 596 * 597 * Released under the MIT License 598 * 599 * Released on: July 13, 2022 600 */ 601 602 (function (global, factory) { 603 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 604 typeof define === 'function' && define.amd ? define(factory) : 605 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Swiper = factory()); 606})(this, (function () { 'use strict'; 607 608 /** 609 * SSR Window 4.0.2 610 * Better handling for window object in SSR environment 611 * https://github.com/nolimits4web/ssr-window 612 * 613 * Copyright 2021, Vladimir Kharlampidi 614 * 615 * Licensed under MIT 616 * 617 * Released on: December 13, 2021 618 */ 619 620 /* eslint-disable no-param-reassign */ 621 function isObject$1(obj) { 622 return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object; 623 } 624
vendor: 31,888 bytes, lines 625-1864
625 function extend$1(target, src) { 626 if (target === void 0) { 627 target = {}; 628 } 629 630 if (src === void 0) { 631 src = {}; 632 } 633 634 Object.keys(src).forEach(key => { 635 if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) { 636 extend$1(target[key], src[key]); 637 } 638 }); 639 } 640 641 const ssrDocument = { 642 body: {}, 643 644 addEventListener() {}, 645 646 removeEventListener() {}, 647 648 activeElement: { 649 blur() {}, 650 651 nodeName: '' 652 }, 653 654 querySelector() { 655 return null; 656 }, 657 658 querySelectorAll() { 659 return []; 660 }, 661 662 getElementById() { 663 return null; 664 }, 665 666 createEvent() { 667 return { 668 initEvent() {} 669 670 }; 671 }, 672 673 createElement() { 674 return { 675 children: [], 676 childNodes: [], 677 style: {}, 678 679 setAttribute() {}, 680 681 getElementsByTagName() { 682 return []; 683 } 684 685 }; 686 }, 687 688 createElementNS() { 689 return {}; 690 }, 691 692 importNode() { 693 return null; 694 }, 695 696 location: { 697 hash: '', 698 host: '', 699 hostname: '', 700 href: '', 701 origin: '', 702 pathname: '', 703 protocol: '', 704 search: '' 705 } 706 }; 707 708 function getDocument() { 709 const doc = typeof document !== 'undefined' ? document : {}; 710 extend$1(doc, ssrDocument); 711 return doc; 712 } 713 714 const ssrWindow = { 715 document: ssrDocument, 716 navigator: { 717 userAgent: '' 718 }, 719 location: { 720 hash: '', 721 host: '', 722 hostname: '', 723 href: '', 724 origin: '', 725 pathname: '', 726 protocol: '', 727 search: '' 728 }, 729 history: { 730 replaceState() {}, 731 732 pushState() {}, 733 734 go() {}, 735 736 back() {} 737 738 }, 739 CustomEvent: function CustomEvent() { 740 return this; 741 }, 742 743 addEventListener() {}, 744 745 removeEventListener() {}, 746 747 getComputedStyle() { 748 return { 749 getPropertyValue() { 750 return ''; 751 } 752 753 }; 754 }, 755 756 Image() {}, 757 758 Date() {}, 759 760 screen: {}, 761 762 setTimeout() {}, 763 764 clearTimeout() {}, 765 766 matchMedia() { 767 return {}; 768 }, 769 770 requestAnimationFrame(callback) { 771 if (typeof setTimeout === 'undefined') { 772 callback(); 773 return null; 774 } 775 776 return setTimeout(callback, 0); 777 }, 778 779 cancelAnimationFrame(id) { 780 if (typeof setTimeout === 'undefined') { 781 return; 782 } 783 784 clearTimeout(id); 785 } 786 787 }; 788 789 function getWindow() { 790 const win = typeof window !== 'undefined' ? window : {}; 791 extend$1(win, ssrWindow); 792 return win; 793 } 794 795 /** 796 * Dom7 4.0.4 797 * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API 798 * https://framework7.io/docs/dom7.html 799 * 800 * Copyright 2022, Vladimir Kharlampidi 801 * 802 * Licensed under MIT 803 * 804 * Released on: January 11, 2022 805 */ 806 /* eslint-disable no-proto */ 807 808 function makeReactive(obj) { 809 const proto = obj.__proto__; 810 Object.defineProperty(obj, '__proto__', { 811 get() { 812 return proto; 813 }, 814 815 set(value) { 816 proto.__proto__ = value; 817 } 818 819 }); 820 } 821 822 class Dom7 extends Array { 823 constructor(items) { 824 if (typeof items === 'number') { 825 super(items); 826 } else { 827 super(...(items || [])); 828 makeReactive(this); 829 } 830 } 831 832 } 833 834 function arrayFlat(arr) { 835 if (arr === void 0) { 836 arr = []; 837 } 838 839 const res = []; 840 arr.forEach(el => { 841 if (Array.isArray(el)) { 842 res.push(...arrayFlat(el)); 843 } else { 844 res.push(el); 845 } 846 }); 847 return res; 848 } 849 850 function arrayFilter(arr, callback) { 851 return Array.prototype.filter.call(arr, callback); 852 } 853 854 function arrayUnique(arr) { 855 const uniqueArray = []; 856 857 for (let i = 0; i < arr.length; i += 1) { 858 if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]); 859 } 860 861 return uniqueArray; 862 } 863 864 865 function qsa(selector, context) { 866 if (typeof selector !== 'string') { 867 return [selector]; 868 } 869 870 const a = []; 871 const res = context.querySelectorAll(selector); 872 873 for (let i = 0; i < res.length; i += 1) { 874 a.push(res[i]); 875 } 876 877 return a; 878 } 879 880 function $(selector, context) { 881 const window = getWindow(); 882 const document = getDocument(); 883 let arr = []; 884 885 if (!context && selector instanceof Dom7) { 886 return selector; 887 } 888 889 if (!selector) { 890 return new Dom7(arr); 891 } 892 893 if (typeof selector === 'string') { 894 const html = selector.trim(); 895 896 if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { 897 let toCreate = 'div'; 898 if (html.indexOf('<li') === 0) toCreate = 'ul'; 899 if (html.indexOf('<tr') === 0) toCreate = 'tbody'; 900 if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr'; 901 if (html.indexOf('<tbody') === 0) toCreate = 'table'; 902 if (html.indexOf('<option') === 0) toCreate = 'select'; 903 const tempParent = document.createElement(toCreate); 904 tempParent.innerHTML = html; 905 906 for (let i = 0; i < tempParent.childNodes.length; i += 1) { 907 arr.push(tempParent.childNodes[i]); 908 } 909 } else { 910 arr = qsa(selector.trim(), context || document); 911 } // arr = qsa(selector, document); 912 913 } else if (selector.nodeType || selector === window || selector === document) { 914 arr.push(selector); 915 } else if (Array.isArray(selector)) { 916 if (selector instanceof Dom7) return selector; 917 arr = selector; 918 } 919 920 return new Dom7(arrayUnique(arr)); 921 } 922 923 $.fn = Dom7.prototype; // eslint-disable-next-line 924 925 function addClass() { 926 for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) { 927 classes[_key] = arguments[_key]; 928 } 929 930 const classNames = arrayFlat(classes.map(c => c.split(' '))); 931 this.forEach(el => { 932 el.classList.add(...classNames); 933 }); 934 return this; 935 } 936 937 function removeClass() { 938 for (var _len2 = arguments.length, classes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 939 classes[_key2] = arguments[_key2]; 940 } 941 942 const classNames = arrayFlat(classes.map(c => c.split(' '))); 943 this.forEach(el => { 944 el.classList.remove(...classNames); 945 }); 946 return this; 947 } 948 949 function toggleClass() { 950 for (var _len3 = arguments.length, classes = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 951 classes[_key3] = arguments[_key3]; 952 } 953 954 const classNames = arrayFlat(classes.map(c => c.split(' '))); 955 this.forEach(el => { 956 classNames.forEach(className => { 957 el.classList.toggle(className); 958 }); 959 }); 960 } 961 962 function hasClass() { 963 for (var _len4 = arguments.length, classes = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 964 classes[_key4] = arguments[_key4]; 965 } 966 967 const classNames = arrayFlat(classes.map(c => c.split(' '))); 968 return arrayFilter(this, el => { 969 return classNames.filter(className => el.classList.contains(className)).length > 0; 970 }).length > 0; 971 } 972 973 function attr(attrs, value) { 974 if (arguments.length === 1 && typeof attrs === 'string') { 975 // Get attr 976 if (this[0]) return this[0].getAttribute(attrs); 977 return undefined; 978 } // Set attrs 979 980 981 for (let i = 0; i < this.length; i += 1) { 982 if (arguments.length === 2) { 983 // String 984 this[i].setAttribute(attrs, value); 985 } else { 986 // Object 987 for (const attrName in attrs) { 988 this[i][attrName] = attrs[attrName]; 989 this[i].setAttribute(attrName, attrs[attrName]); 990 } 991 } 992 } 993 994 return this; 995 } 996 997 function removeAttr(attr) { 998 for (let i = 0; i < this.length; i += 1) { 999 this[i].removeAttribute(attr); 1000 } 1001 1002 return this; 1003 } 1004 1005 function transform(transform) { 1006 for (let i = 0; i < this.length; i += 1) { 1007 this[i].style.transform = transform; 1008 } 1009 1010 return this; 1011 } 1012 1013 function transition$1(duration) { 1014 for (let i = 0; i < this.length; i += 1) { 1015 this[i].style.transitionDuration = typeof duration !== 'string' ? `${duration}ms` : duration; 1016 } 1017 1018 return this; 1019 } 1020 1021 function on() { 1022 for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { 1023 args[_key5] = arguments[_key5]; 1024 } 1025 1026 let [eventType, targetSelector, listener, capture] = args; 1027 1028 if (typeof args[1] === 'function') { 1029 [eventType, listener, capture] = args; 1030 targetSelector = undefined; 1031 } 1032 1033 if (!capture) capture = false; 1034 1035 function handleLiveEvent(e) { 1036 const target = e.target; 1037 if (!target) return; 1038 const eventData = e.target.dom7EventData || []; 1039 1040 if (eventData.indexOf(e) < 0) { 1041 eventData.unshift(e); 1042 } 1043 1044 if ($(target).is(targetSelector)) listener.apply(target, eventData);else { 1045 const parents = $(target).parents(); // eslint-disable-line 1046 1047 for (let k = 0; k < parents.length; k += 1) { 1048 if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData); 1049 } 1050 } 1051 } 1052 1053 function handleEvent(e) { 1054 const eventData = e && e.target ? e.target.dom7EventData || [] : []; 1055 1056 if (eventData.indexOf(e) < 0) { 1057 eventData.unshift(e); 1058 } 1059 1060 listener.apply(this, eventData); 1061 } 1062 1063 const events = eventType.split(' '); 1064 let j; 1065 1066 for (let i = 0; i < this.length; i += 1) { 1067 const el = this[i]; 1068 1069 if (!targetSelector) { 1070 for (j = 0; j < events.length; j += 1) { 1071 const event = events[j]; 1072 if (!el.dom7Listeners) el.dom7Listeners = {}; 1073 if (!el.dom7Listeners[event]) el.dom7Listeners[event] = []; 1074 el.dom7Listeners[event].push({ 1075 listener, 1076 proxyListener: handleEvent 1077 }); 1078 el.addEventListener(event, handleEvent, capture); 1079 } 1080 } else { 1081 // Live events 1082 for (j = 0; j < events.length; j += 1) { 1083 const event = events[j]; 1084 if (!el.dom7LiveListeners) el.dom7LiveListeners = {}; 1085 if (!el.dom7LiveListeners[event]) el.dom7LiveListeners[event] = []; 1086 el.dom7LiveListeners[event].push({ 1087 listener, 1088 proxyListener: handleLiveEvent 1089 }); 1090 el.addEventListener(event, handleLiveEvent, capture); 1091 } 1092 } 1093 } 1094 1095 return this; 1096 } 1097 1098 function off() { 1099 for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { 1100 args[_key6] = arguments[_key6]; 1101 } 1102 1103 let [eventType, targetSelector, listener, capture] = args; 1104 1105 if (typeof args[1] === 'function') { 1106 [eventType, listener, capture] = args; 1107 targetSelector = undefined; 1108 } 1109 1110 if (!capture) capture = false; 1111 const events = eventType.split(' '); 1112 1113 for (let i = 0; i < events.length; i += 1) { 1114 const event = events[i]; 1115 1116 for (let j = 0; j < this.length; j += 1) { 1117 const el = this[j]; 1118 let handlers; 1119 1120 if (!targetSelector && el.dom7Listeners) { 1121 handlers = el.dom7Listeners[event]; 1122 } else if (targetSelector && el.dom7LiveListeners) { 1123 handlers = el.dom7LiveListeners[event]; 1124 } 1125 1126 if (handlers && handlers.length) { 1127 for (let k = handlers.length - 1; k >= 0; k -= 1) { 1128 const handler = handlers[k]; 1129 1130 if (listener && handler.listener === listener) { 1131 el.removeEventListener(event, handler.proxyListener, capture); 1132 handlers.splice(k, 1); 1133 } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) { 1134 el.removeEventListener(event, handler.proxyListener, capture); 1135 handlers.splice(k, 1); 1136 } else if (!listener) { 1137 el.removeEventListener(event, handler.proxyListener, capture); 1138 handlers.splice(k, 1); 1139 } 1140 } 1141 } 1142 } 1143 } 1144 1145 return this; 1146 } 1147 1148 function trigger() { 1149 const window = getWindow(); 1150 1151 for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { 1152 args[_key9] = arguments[_key9]; 1153 } 1154 1155 const events = args[0].split(' '); 1156 const eventData = args[1]; 1157 1158 for (let i = 0; i < events.length; i += 1) { 1159 const event = events[i]; 1160 1161 for (let j = 0; j < this.length; j += 1) { 1162 const el = this[j]; 1163 1164 if (window.CustomEvent) { 1165 const evt = new window.CustomEvent(event, { 1166 detail: eventData, 1167 bubbles: true, 1168 cancelable: true 1169 }); 1170 el.dom7EventData = args.filter((data, dataIndex) => dataIndex > 0); 1171 el.dispatchEvent(evt); 1172 el.dom7EventData = []; 1173 delete el.dom7EventData; 1174 } 1175 } 1176 } 1177 1178 return this; 1179 } 1180 1181 function transitionEnd$1(callback) { 1182 const dom = this; 1183 1184 function fireCallBack(e) { 1185 if (e.target !== this) return; 1186 callback.call(this, e); 1187 dom.off('transitionend', fireCallBack); 1188 } 1189 1190 if (callback) { 1191 dom.on('transitionend', fireCallBack); 1192 } 1193 1194 return this; 1195 } 1196 1197 function outerWidth(includeMargins) { 1198 if (this.length > 0) { 1199 if (includeMargins) { 1200 const styles = this.styles(); 1201 return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left')); 1202 } 1203 1204 return this[0].offsetWidth; 1205 } 1206 1207 return null; 1208 } 1209 1210 function outerHeight(includeMargins) { 1211 if (this.length > 0) { 1212 if (includeMargins) { 1213 const styles = this.styles(); 1214 return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom')); 1215 } 1216 1217 return this[0].offsetHeight; 1218 } 1219 1220 return null; 1221 } 1222 1223 function offset() { 1224 if (this.length > 0) { 1225 const window = getWindow(); 1226 const document = getDocument(); 1227 const el = this[0]; 1228 const box = el.getBoundingClientRect(); 1229 const body = document.body; 1230 const clientTop = el.clientTop || body.clientTop || 0; 1231 const clientLeft = el.clientLeft || body.clientLeft || 0; 1232 const scrollTop = el === window ? window.scrollY : el.scrollTop; 1233 const scrollLeft = el === window ? window.scrollX : el.scrollLeft; 1234 return { 1235 top: box.top + scrollTop - clientTop, 1236 left: box.left + scrollLeft - clientLeft 1237 }; 1238 } 1239 1240 return null; 1241 } 1242 1243 function styles() { 1244 const window = getWindow(); 1245 if (this[0]) return window.getComputedStyle(this[0], null); 1246 return {}; 1247 } 1248 1249 function css(props, value) { 1250 const window = getWindow(); 1251 let i; 1252 1253 if (arguments.length === 1) { 1254 if (typeof props === 'string') { 1255 // .css('width') 1256 if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props); 1257 } else { 1258 // .css({ width: '100px' }) 1259 for (i = 0; i < this.length; i += 1) { 1260 for (const prop in props) { 1261 this[i].style[prop] = props[prop]; 1262 } 1263 } 1264 1265 return this; 1266 } 1267 } 1268 1269 if (arguments.length === 2 && typeof props === 'string') { 1270 // .css('width', '100px') 1271 for (i = 0; i < this.length; i += 1) { 1272 this[i].style[props] = value; 1273 } 1274 1275 return this; 1276 } 1277 1278 return this; 1279 } 1280 1281 function each(callback) { 1282 if (!callback) return this; 1283 this.forEach((el, index) => { 1284 callback.apply(el, [el, index]); 1285 }); 1286 return this; 1287 } 1288 1289 function filter(callback) { 1290 const result = arrayFilter(this, callback); 1291 return $(result); 1292 } 1293 1294 function html(html) { 1295 if (typeof html === 'undefined') { 1296 return this[0] ? this[0].innerHTML : null; 1297 } 1298 1299 for (let i = 0; i < this.length; i += 1) { 1300 this[i].innerHTML = html; 1301 } 1302 1303 return this; 1304 } 1305 1306 function text(text) { 1307 if (typeof text === 'undefined') { 1308 return this[0] ? this[0].textContent.trim() : null; 1309 } 1310 1311 for (let i = 0; i < this.length; i += 1) { 1312 this[i].textContent = text; 1313 } 1314 1315 return this; 1316 } 1317 1318 function is(selector) { 1319 const window = getWindow(); 1320 const document = getDocument(); 1321 const el = this[0]; 1322 let compareWith; 1323 let i; 1324 if (!el || typeof selector === 'undefined') return false; 1325 1326 if (typeof selector === 'string') { 1327 if (el.matches) return el.matches(selector); 1328 if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector); 1329 if (el.msMatchesSelector) return el.msMatchesSelector(selector); 1330 compareWith = $(selector); 1331 1332 for (i = 0; i < compareWith.length; i += 1) { 1333 if (compareWith[i] === el) return true; 1334 } 1335 1336 return false; 1337 } 1338 1339 if (selector === document) { 1340 return el === document; 1341 } 1342 1343 if (selector === window) { 1344 return el === window; 1345 } 1346 1347 if (selector.nodeType || selector instanceof Dom7) { 1348 compareWith = selector.nodeType ? [selector] : selector; 1349 1350 for (i = 0; i < compareWith.length; i += 1) { 1351 if (compareWith[i] === el) return true; 1352 } 1353 1354 return false; 1355 } 1356 1357 return false; 1358 } 1359 1360 function index() { 1361 let child = this[0]; 1362 let i; 1363 1364 if (child) { 1365 i = 0; // eslint-disable-next-line 1366 1367 while ((child = child.previousSibling) !== null) { 1368 if (child.nodeType === 1) i += 1; 1369 } 1370 1371 return i; 1372 } 1373 1374 return undefined; 1375 } 1376 1377 function eq(index) { 1378 if (typeof index === 'undefined') return this; 1379 const length = this.length; 1380 1381 if (index > length - 1) { 1382 return $([]); 1383 } 1384 1385 if (index < 0) { 1386 const returnIndex = length + index; 1387 if (returnIndex < 0) return $([]); 1388 return $([this[returnIndex]]); 1389 } 1390 1391 return $([this[index]]); 1392 } 1393 1394 function append() { 1395 let newChild; 1396 const document = getDocument(); 1397 1398 for (let k = 0; k < arguments.length; k += 1) { 1399 newChild = k < 0 || arguments.length <= k ? undefined : arguments[k]; 1400 1401 for (let i = 0; i < this.length; i += 1) { 1402 if (typeof newChild === 'string') { 1403 const tempDiv = document.createElement('div'); 1404 tempDiv.innerHTML = newChild; 1405 1406 while (tempDiv.firstChild) { 1407 this[i].appendChild(tempDiv.firstChild); 1408 } 1409 } else if (newChild instanceof Dom7) { 1410 for (let j = 0; j < newChild.length; j += 1) { 1411 this[i].appendChild(newChild[j]); 1412 } 1413 } else { 1414 this[i].appendChild(newChild); 1415 } 1416 } 1417 } 1418 1419 return this; 1420 } 1421 1422 function prepend(newChild) { 1423 const document = getDocument(); 1424 let i; 1425 let j; 1426 1427 for (i = 0; i < this.length; i += 1) { 1428 if (typeof newChild === 'string') { 1429 const tempDiv = document.createElement('div'); 1430 tempDiv.innerHTML = newChild; 1431 1432 for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) { 1433 this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]); 1434 } 1435 } else if (newChild instanceof Dom7) { 1436 for (j = 0; j < newChild.length; j += 1) { 1437 this[i].insertBefore(newChild[j], this[i].childNodes[0]); 1438 } 1439 } else { 1440 this[i].insertBefore(newChild, this[i].childNodes[0]); 1441 } 1442 } 1443 1444 return this; 1445 } 1446 1447 function next(selector) { 1448 if (this.length > 0) { 1449 if (selector) { 1450 if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) { 1451 return $([this[0].nextElementSibling]); 1452 } 1453 1454 return $([]); 1455 } 1456 1457 if (this[0].nextElementSibling) return $([this[0].nextElementSibling]); 1458 return $([]); 1459 } 1460 1461 return $([]); 1462 } 1463 1464 function nextAll(selector) { 1465 const nextEls = []; 1466 let el = this[0]; 1467 if (!el) return $([]); 1468 1469 while (el.nextElementSibling) { 1470 const next = el.nextElementSibling; // eslint-disable-line 1471 1472 if (selector) { 1473 if ($(next).is(selector)) nextEls.push(next); 1474 } else nextEls.push(next); 1475 1476 el = next; 1477 } 1478 1479 return $(nextEls); 1480 } 1481 1482 function prev(selector) { 1483 if (this.length > 0) { 1484 const el = this[0]; 1485 1486 if (selector) { 1487 if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) { 1488 return $([el.previousElementSibling]); 1489 } 1490 1491 return $([]); 1492 } 1493 1494 if (el.previousElementSibling) return $([el.previousElementSibling]); 1495 return $([]); 1496 } 1497 1498 return $([]); 1499 } 1500 1501 function prevAll(selector) { 1502 const prevEls = []; 1503 let el = this[0]; 1504 if (!el) return $([]); 1505 1506 while (el.previousElementSibling) { 1507 const prev = el.previousElementSibling; // eslint-disable-line 1508 1509 if (selector) { 1510 if ($(prev).is(selector)) prevEls.push(prev); 1511 } else prevEls.push(prev); 1512 1513 el = prev; 1514 } 1515 1516 return $(prevEls); 1517 } 1518 1519 function parent(selector) { 1520 const parents = []; // eslint-disable-line 1521 1522 for (let i = 0; i < this.length; i += 1) { 1523 if (this[i].parentNode !== null) { 1524 if (selector) { 1525 if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); 1526 } else { 1527 parents.push(this[i].parentNode); 1528 } 1529 } 1530 } 1531 1532 return $(parents); 1533 } 1534 1535 function parents(selector) { 1536 const parents = []; // eslint-disable-line 1537 1538 for (let i = 0; i < this.length; i += 1) { 1539 let parent = this[i].parentNode; // eslint-disable-line 1540 1541 while (parent) { 1542 if (selector) { 1543 if ($(parent).is(selector)) parents.push(parent); 1544 } else { 1545 parents.push(parent); 1546 } 1547 1548 parent = parent.parentNode; 1549 } 1550 } 1551 1552 return $(parents); 1553 } 1554 1555 function closest(selector) { 1556 let closest = this; // eslint-disable-line 1557 1558 if (typeof selector === 'undefined') { 1559 return $([]); 1560 } 1561 1562 if (!closest.is(selector)) { 1563 closest = closest.parents(selector).eq(0); 1564 } 1565 1566 return closest; 1567 } 1568 1569 function find(selector) { 1570 const foundElements = []; 1571 1572 for (let i = 0; i < this.length; i += 1) { 1573 const found = this[i].querySelectorAll(selector); 1574 1575 for (let j = 0; j < found.length; j += 1) { 1576 foundElements.push(found[j]); 1577 } 1578 } 1579 1580 return $(foundElements); 1581 } 1582 1583 function children(selector) { 1584 const children = []; // eslint-disable-line 1585 1586 for (let i = 0; i < this.length; i += 1) { 1587 const childNodes = this[i].children; 1588 1589 for (let j = 0; j < childNodes.length; j += 1) { 1590 if (!selector || $(childNodes[j]).is(selector)) { 1591 children.push(childNodes[j]); 1592 } 1593 } 1594 } 1595 1596 return $(children); 1597 } 1598 1599 function remove() { 1600 for (let i = 0; i < this.length; i += 1) { 1601 if (this[i].parentNode) this[i].parentNode.removeChild(this[i]); 1602 } 1603 1604 return this; 1605 } 1606 1607 const Methods = { 1608 addClass, 1609 removeClass, 1610 hasClass, 1611 toggleClass, 1612 attr, 1613 removeAttr, 1614 transform, 1615 transition: transition$1, 1616 on, 1617 off, 1618 trigger, 1619 transitionEnd: transitionEnd$1, 1620 outerWidth, 1621 outerHeight, 1622 styles, 1623 offset, 1624 css, 1625 each, 1626 html, 1627 text, 1628 is, 1629 index, 1630 eq, 1631 append, 1632 prepend, 1633 next, 1634 nextAll, 1635 prev, 1636 prevAll, 1637 parent, 1638 parents, 1639 closest, 1640 find, 1641 children, 1642 filter, 1643 remove 1644 }; 1645 Object.keys(Methods).forEach(methodName => { 1646 Object.defineProperty($.fn, methodName, { 1647 value: Methods[methodName], 1648 writable: true 1649 }); 1650 }); 1651 1652 function deleteProps(obj) { 1653 const object = obj; 1654 Object.keys(object).forEach(key => { 1655 try { 1656 object[key] = null; 1657 } catch (e) {// no getter for object 1658 } 1659 1660 try { 1661 delete object[key]; 1662 } catch (e) {// something got wrong 1663 } 1664 }); 1665 } 1666 1667 function nextTick(callback, delay) { 1668 if (delay === void 0) { 1669 delay = 0; 1670 } 1671 1672 return setTimeout(callback, delay); 1673 } 1674 1675 function now() { 1676 return Date.now(); 1677 } 1678 1679 function getComputedStyle$1(el) { 1680 const window = getWindow(); 1681 let style; 1682 1683 if (window.getComputedStyle) { 1684 style = window.getComputedStyle(el, null); 1685 } 1686 1687 if (!style && el.currentStyle) { 1688 style = el.currentStyle; 1689 } 1690 1691 if (!style) { 1692 style = el.style; 1693 } 1694 1695 return style; 1696 } 1697 1698 function getTranslate(el, axis) { 1699 if (axis === void 0) { 1700 axis = 'x'; 1701 } 1702 1703 const window = getWindow(); 1704 let matrix; 1705 let curTransform; 1706 let transformMatrix; 1707 const curStyle = getComputedStyle$1(el); 1708 1709 if (window.WebKitCSSMatrix) { 1710 curTransform = curStyle.transform || curStyle.webkitTransform; 1711 1712 if (curTransform.split(',').length > 6) { 1713 curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', '); 1714 } // Some old versions of Webkit choke when 'none' is passed; pass 1715 // empty string instead in this case 1716 1717 1718 transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); 1719 } else { 1720 transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); 1721 matrix = transformMatrix.toString().split(','); 1722 } 1723 1724 if (axis === 'x') { 1725 // Latest Chrome and webkits Fix 1726 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix 1727 else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers 1728 else curTransform = parseFloat(matrix[4]); 1729 } 1730 1731 if (axis === 'y') { 1732 // Latest Chrome and webkits Fix 1733 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix 1734 else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers 1735 else curTransform = parseFloat(matrix[5]); 1736 } 1737 1738 return curTransform || 0; 1739 } 1740 1741 function isObject(o) { 1742 return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object'; 1743 } 1744 1745 function isNode(node) { 1746 // eslint-disable-next-line 1747 if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { 1748 return node instanceof HTMLElement; 1749 } 1750 1751 return node && (node.nodeType === 1 || node.nodeType === 11); 1752 } 1753 1754 function extend() { 1755 const to = Object(arguments.length <= 0 ? undefined : arguments[0]); 1756 const noExtend = ['__proto__', 'constructor', 'prototype']; 1757 1758 for (let i = 1; i < arguments.length; i += 1) { 1759 const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i]; 1760 1761 if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) { 1762 const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0); 1763 1764 for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { 1765 const nextKey = keysArray[nextIndex]; 1766 const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); 1767 1768 if (desc !== undefined && desc.enumerable) { 1769 if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 1770 if (nextSource[nextKey].__swiper__) { 1771 to[nextKey] = nextSource[nextKey]; 1772 } else { 1773 extend(to[nextKey], nextSource[nextKey]); 1774 } 1775 } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 1776 to[nextKey] = {}; 1777 1778 if (nextSource[nextKey].__swiper__) { 1779 to[nextKey] = nextSource[nextKey]; 1780 } else { 1781 extend(to[nextKey], nextSource[nextKey]); 1782 } 1783 } else { 1784 to[nextKey] = nextSource[nextKey]; 1785 } 1786 } 1787 } 1788 } 1789 } 1790 1791 return to; 1792 } 1793 1794 function setCSSProperty(el, varName, varValue) { 1795 el.style.setProperty(varName, varValue); 1796 } 1797 1798 function animateCSSModeScroll(_ref) { 1799 let { 1800 swiper, 1801 targetPosition, 1802 side 1803 } = _ref; 1804 const window = getWindow(); 1805 const startPosition = -swiper.translate; 1806 let startTime = null; 1807 let time; 1808 const duration = swiper.params.speed; 1809 swiper.wrapperEl.style.scrollSnapType = 'none'; 1810 window.cancelAnimationFrame(swiper.cssModeFrameID); 1811 const dir = targetPosition > startPosition ? 'next' : 'prev'; 1812 1813 const isOutOfBound = (current, target) => { 1814 return dir === 'next' && current >= target || dir === 'prev' && current <= target; 1815 }; 1816 1817 const animate = () => { 1818 time = new Date().getTime(); 1819 1820 if (startTime === null) { 1821 startTime = time; 1822 } 1823 1824 const progress = Math.max(Math.min((time - startTime) / duration, 1), 0); 1825 const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2; 1826 let currentPosition = startPosition + easeProgress * (targetPosition - startPosition); 1827 1828 if (isOutOfBound(currentPosition, targetPosition)) { 1829 currentPosition = targetPosition; 1830 } 1831 1832 swiper.wrapperEl.scrollTo({ 1833 [side]: currentPosition 1834 }); 1835 1836 if (isOutOfBound(currentPosition, targetPosition)) { 1837 swiper.wrapperEl.style.overflow = 'hidden'; 1838 swiper.wrapperEl.style.scrollSnapType = ''; 1839 setTimeout(() => { 1840 swiper.wrapperEl.style.overflow = ''; 1841 swiper.wrapperEl.scrollTo({ 1842 [side]: currentPosition 1843 }); 1844 }); 1845 window.cancelAnimationFrame(swiper.cssModeFrameID); 1846 return; 1847 } 1848 1849 swiper.cssModeFrameID = window.requestAnimationFrame(animate); 1850 }; 1851 1852 animate(); 1853 } 1854 1855 let support; 1856 1857 function calcSupport() { 1858 const window = getWindow(); 1859 const document = getDocument(); 1860 return { 1861 smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style, 1862 touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch), 1863 passiveListener: function checkPassiveListener() { 1864 let supportsPassive = false;
vendor: 7,298 bytes, lines 1865-2118
1865 1866 try { 1867 const opts = Object.defineProperty({}, 'passive', { 1868 // eslint-disable-next-line 1869 get() { 1870 supportsPassive = true; 1871 } 1872 1873 }); 1874 window.addEventListener('testPassiveListener', null, opts); 1875 } catch (e) {// No support 1876 } 1877 1878 return supportsPassive; 1879 }(), 1880 gestures: function checkGestures() { 1881 return 'ongesturestart' in window; 1882 }() 1883 }; 1884 } 1885 1886 function getSupport() { 1887 if (!support) { 1888 support = calcSupport(); 1889 } 1890 1891 return support; 1892 } 1893 1894 let deviceCached; 1895 1896 function calcDevice(_temp) { 1897 let { 1898 userAgent 1899 } = _temp === void 0 ? {} : _temp; 1900 const support = getSupport(); 1901 const window = getWindow(); 1902 const platform = window.navigator.platform; 1903 const ua = userAgent || window.navigator.userAgent; 1904 const device = { 1905 ios: false, 1906 android: false 1907 }; 1908 const screenWidth = window.screen.width; 1909 const screenHeight = window.screen.height; 1910 const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line 1911 1912 let ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 1913 const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); 1914 const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); 1915 const windows = platform === 'Win32'; 1916 let macos = platform === 'MacIntel'; // iPadOs 13 fix 1917 1918 const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810']; 1919 1920 if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) { 1921 ipad = ua.match(/(Version)\/([\d.]+)/); 1922 if (!ipad) ipad = [0, 1, '13_0_0']; 1923 macos = false; 1924 } // Android 1925 1926 1927 if (android && !windows) { 1928 device.os = 'android'; 1929 device.android = true; 1930 } 1931 1932 if (ipad || iphone || ipod) { 1933 device.os = 'ios'; 1934 device.ios = true; 1935 } // Export object 1936 1937 1938 return device; 1939 } 1940 1941 function getDevice(overrides) { 1942 if (overrides === void 0) { 1943 overrides = {}; 1944 } 1945 1946 if (!deviceCached) { 1947 deviceCached = calcDevice(overrides); 1948 } 1949 1950 return deviceCached; 1951 } 1952 1953 let browser; 1954 1955 function calcBrowser() { 1956 const window = getWindow(); 1957 1958 function isSafari() { 1959 const ua = window.navigator.userAgent.toLowerCase(); 1960 return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0; 1961 } 1962 1963 return { 1964 isSafari: isSafari(), 1965 isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent) 1966 }; 1967 } 1968 1969 function getBrowser() { 1970 if (!browser) { 1971 browser = calcBrowser(); 1972 } 1973 1974 return browser; 1975 } 1976 1977 function Resize(_ref) { 1978 let { 1979 swiper, 1980 on, 1981 emit 1982 } = _ref; 1983 const window = getWindow(); 1984 let observer = null; 1985 let animationFrame = null; 1986 1987 const resizeHandler = () => { 1988 if (!swiper || swiper.destroyed || !swiper.initialized) return; 1989 emit('beforeResize'); 1990 emit('resize'); 1991 }; 1992 1993 const createObserver = () => { 1994 if (!swiper || swiper.destroyed || !swiper.initialized) return; 1995 observer = new ResizeObserver(entries => { 1996 animationFrame = window.requestAnimationFrame(() => { 1997 const { 1998 width, 1999 height 2000 } = swiper; 2001 let newWidth = width; 2002 let newHeight = height; 2003 entries.forEach(_ref2 => { 2004 let { 2005 contentBoxSize, 2006 contentRect, 2007 target 2008 } = _ref2; 2009 if (target && target !== swiper.el) return; 2010 newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize; 2011 newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize; 2012 }); 2013 2014 if (newWidth !== width || newHeight !== height) { 2015 resizeHandler(); 2016 } 2017 }); 2018 }); 2019 observer.observe(swiper.el); 2020 }; 2021 2022 const removeObserver = () => { 2023 if (animationFrame) { 2024 window.cancelAnimationFrame(animationFrame); 2025 } 2026 2027 if (observer && observer.unobserve && swiper.el) { 2028 observer.unobserve(swiper.el); 2029 observer = null; 2030 } 2031 }; 2032 2033 const orientationChangeHandler = () => { 2034 if (!swiper || swiper.destroyed || !swiper.initialized) return; 2035 emit('orientationchange'); 2036 }; 2037 2038 on('init', () => { 2039 if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') { 2040 createObserver(); 2041 return; 2042 } 2043 2044 window.addEventListener('resize', resizeHandler); 2045 window.addEventListener('orientationchange', orientationChangeHandler); 2046 }); 2047 on('destroy', () => { 2048 removeObserver(); 2049 window.removeEventListener('resize', resizeHandler); 2050 window.removeEventListener('orientationchange', orientationChangeHandler); 2051 }); 2052 } 2053 2054 function Observer(_ref) { 2055 let { 2056 swiper, 2057 extendParams, 2058 on, 2059 emit 2060 } = _ref; 2061 const observers = []; 2062 const window = getWindow(); 2063 2064 const attach = function (target, options) { 2065 if (options === void 0) { 2066 options = {}; 2067 } 2068 2069 const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; 2070 const observer = new ObserverFunc(mutations => { 2071 // The observerUpdate event should only be triggered 2072 // once despite the number of mutations. Additional 2073 // triggers are redundant and are very costly 2074 if (mutations.length === 1) { 2075 emit('observerUpdate', mutations[0]); 2076 return; 2077 } 2078 2079 const observerUpdate = function observerUpdate() { 2080 emit('observerUpdate', mutations[0]); 2081 }; 2082 2083 if (window.requestAnimationFrame) { 2084 window.requestAnimationFrame(observerUpdate); 2085 } else { 2086 window.setTimeout(observerUpdate, 0); 2087 } 2088 }); 2089 observer.observe(target, { 2090 attributes: typeof options.attributes === 'undefined' ? true : options.attributes, 2091 childList: typeof options.childList === 'undefined' ? true : options.childList, 2092 characterData: typeof options.characterData === 'undefined' ? true : options.characterData 2093 }); 2094 observers.push(observer); 2095 }; 2096 2097 const init = () => { 2098 if (!swiper.params.observer) return; 2099 2100 if (swiper.params.observeParents) { 2101 const containerParents = swiper.$el.parents(); 2102 2103 for (let i = 0; i < containerParents.length; i += 1) { 2104 attach(containerParents[i]); 2105 } 2106 } // Observe container 2107 2108 2109 attach(swiper.$el[0], { 2110 childList: swiper.params.observeSlideChildren 2111 }); // Observe wrapper 2112 2113 attach(swiper.$wrapperEl[0], { 2114 attributes: false 2115 }); 2116 }; 2117 2118 const destroy = () => {
vendor: 69,254 bytes, lines 2119-4255
2119 observers.forEach(observer => { 2120 observer.disconnect(); 2121 }); 2122 observers.splice(0, observers.length); 2123 }; 2124 2125 extendParams({ 2126 observer: false, 2127 observeParents: false, 2128 observeSlideChildren: false 2129 }); 2130 on('init', init); 2131 on('destroy', destroy); 2132 } 2133 2134 /* eslint-disable no-underscore-dangle */ 2135 var eventsEmitter = { 2136 on(events, handler, priority) { 2137 const self = this; 2138 if (!self.eventsListeners || self.destroyed) return self; 2139 if (typeof handler !== 'function') return self; 2140 const method = priority ? 'unshift' : 'push'; 2141 events.split(' ').forEach(event => { 2142 if (!self.eventsListeners[event]) self.eventsListeners[event] = []; 2143 self.eventsListeners[event][method](handler); 2144 }); 2145 return self; 2146 }, 2147 2148 once(events, handler, priority) { 2149 const self = this; 2150 if (!self.eventsListeners || self.destroyed) return self; 2151 if (typeof handler !== 'function') return self; 2152 2153 function onceHandler() { 2154 self.off(events, onceHandler); 2155 2156 if (onceHandler.__emitterProxy) { 2157 delete onceHandler.__emitterProxy; 2158 } 2159 2160 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 2161 args[_key] = arguments[_key]; 2162 } 2163 2164 handler.apply(self, args); 2165 } 2166 2167 onceHandler.__emitterProxy = handler; 2168 return self.on(events, onceHandler, priority); 2169 }, 2170 2171 onAny(handler, priority) { 2172 const self = this; 2173 if (!self.eventsListeners || self.destroyed) return self; 2174 if (typeof handler !== 'function') return self; 2175 const method = priority ? 'unshift' : 'push'; 2176 2177 if (self.eventsAnyListeners.indexOf(handler) < 0) { 2178 self.eventsAnyListeners[method](handler); 2179 } 2180 2181 return self; 2182 }, 2183 2184 offAny(handler) { 2185 const self = this; 2186 if (!self.eventsListeners || self.destroyed) return self; 2187 if (!self.eventsAnyListeners) return self; 2188 const index = self.eventsAnyListeners.indexOf(handler); 2189 2190 if (index >= 0) { 2191 self.eventsAnyListeners.splice(index, 1); 2192 } 2193 2194 return self; 2195 }, 2196 2197 off(events, handler) { 2198 const self = this; 2199 if (!self.eventsListeners || self.destroyed) return self; 2200 if (!self.eventsListeners) return self; 2201 events.split(' ').forEach(event => { 2202 if (typeof handler === 'undefined') { 2203 self.eventsListeners[event] = []; 2204 } else if (self.eventsListeners[event]) { 2205 self.eventsListeners[event].forEach((eventHandler, index) => { 2206 if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) { 2207 self.eventsListeners[event].splice(index, 1); 2208 } 2209 }); 2210 } 2211 }); 2212 return self; 2213 }, 2214 2215 emit() { 2216 const self = this; 2217 if (!self.eventsListeners || self.destroyed) return self; 2218 if (!self.eventsListeners) return self; 2219 let events; 2220 let data; 2221 let context; 2222 2223 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 2224 args[_key2] = arguments[_key2]; 2225 } 2226 2227 if (typeof args[0] === 'string' || Array.isArray(args[0])) { 2228 events = args[0]; 2229 data = args.slice(1, args.length); 2230 context = self; 2231 } else { 2232 events = args[0].events; 2233 data = args[0].data; 2234 context = args[0].context || self; 2235 } 2236 2237 data.unshift(context); 2238 const eventsArray = Array.isArray(events) ? events : events.split(' '); 2239 eventsArray.forEach(event => { 2240 if (self.eventsAnyListeners && self.eventsAnyListeners.length) { 2241 self.eventsAnyListeners.forEach(eventHandler => { 2242 eventHandler.apply(context, [event, ...data]); 2243 }); 2244 } 2245 2246 if (self.eventsListeners && self.eventsListeners[event]) { 2247 self.eventsListeners[event].forEach(eventHandler => { 2248 eventHandler.apply(context, data); 2249 }); 2250 } 2251 }); 2252 return self; 2253 } 2254 2255 }; 2256 2257 function updateSize() { 2258 const swiper = this; 2259 let width; 2260 let height; 2261 const $el = swiper.$el; 2262 2263 if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) { 2264 width = swiper.params.width; 2265 } else { 2266 width = $el[0].clientWidth; 2267 } 2268 2269 if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) { 2270 height = swiper.params.height; 2271 } else { 2272 height = $el[0].clientHeight; 2273 } 2274 2275 if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) { 2276 return; 2277 } // Subtract paddings 2278 2279 2280 width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10); 2281 height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10); 2282 if (Number.isNaN(width)) width = 0; 2283 if (Number.isNaN(height)) height = 0; 2284 Object.assign(swiper, { 2285 width, 2286 height, 2287 size: swiper.isHorizontal() ? width : height 2288 }); 2289 } 2290 2291 function updateSlides() { 2292 const swiper = this; 2293 2294 function getDirectionLabel(property) { 2295 if (swiper.isHorizontal()) { 2296 return property; 2297 } // prettier-ignore 2298 2299 2300 return { 2301 'width': 'height', 2302 'margin-top': 'margin-left', 2303 'margin-bottom ': 'margin-right', 2304 'margin-left': 'margin-top', 2305 'margin-right': 'margin-bottom', 2306 'padding-left': 'padding-top', 2307 'padding-right': 'padding-bottom', 2308 'marginRight': 'marginBottom' 2309 }[property]; 2310 } 2311 2312 function getDirectionPropertyValue(node, label) { 2313 return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0); 2314 } 2315 2316 const params = swiper.params; 2317 const { 2318 $wrapperEl, 2319 size: swiperSize, 2320 rtlTranslate: rtl, 2321 wrongRTL 2322 } = swiper; 2323 const isVirtual = swiper.virtual && params.virtual.enabled; 2324 const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length; 2325 const slides = $wrapperEl.children(`.${swiper.params.slideClass}`); 2326 const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length; 2327 let snapGrid = []; 2328 const slidesGrid = []; 2329 const slidesSizesGrid = []; 2330 let offsetBefore = params.slidesOffsetBefore; 2331 2332 if (typeof offsetBefore === 'function') { 2333 offsetBefore = params.slidesOffsetBefore.call(swiper); 2334 } 2335 2336 let offsetAfter = params.slidesOffsetAfter; 2337 2338 if (typeof offsetAfter === 'function') { 2339 offsetAfter = params.slidesOffsetAfter.call(swiper); 2340 } 2341 2342 const previousSnapGridLength = swiper.snapGrid.length; 2343 const previousSlidesGridLength = swiper.slidesGrid.length; 2344 let spaceBetween = params.spaceBetween; 2345 let slidePosition = -offsetBefore; 2346 let prevSlideSize = 0; 2347 let index = 0; 2348 2349 if (typeof swiperSize === 'undefined') { 2350 return; 2351 } 2352 2353 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 2354 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize; 2355 } 2356 2357 swiper.virtualSize = -spaceBetween; // reset margins 2358 2359 if (rtl) slides.css({ 2360 marginLeft: '', 2361 marginBottom: '', 2362 marginTop: '' 2363 });else slides.css({ 2364 marginRight: '', 2365 marginBottom: '', 2366 marginTop: '' 2367 }); // reset cssMode offsets 2368 2369 if (params.centeredSlides && params.cssMode) { 2370 setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', ''); 2371 setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', ''); 2372 } 2373 2374 const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid; 2375 2376 if (gridEnabled) { 2377 swiper.grid.initSlides(slidesLength); 2378 } // Calc slides 2379 2380 2381 let slideSize; 2382 const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => { 2383 return typeof params.breakpoints[key].slidesPerView !== 'undefined'; 2384 }).length > 0; 2385 2386 for (let i = 0; i < slidesLength; i += 1) { 2387 slideSize = 0; 2388 const slide = slides.eq(i); 2389 2390 if (gridEnabled) { 2391 swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel); 2392 } 2393 2394 if (slide.css('display') === 'none') continue; // eslint-disable-line 2395 2396 if (params.slidesPerView === 'auto') { 2397 if (shouldResetSlideSize) { 2398 slides[i].style[getDirectionLabel('width')] = ``; 2399 } 2400 2401 const slideStyles = getComputedStyle(slide[0]); 2402 const currentTransform = slide[0].style.transform; 2403 const currentWebKitTransform = slide[0].style.webkitTransform; 2404 2405 if (currentTransform) { 2406 slide[0].style.transform = 'none'; 2407 } 2408 2409 if (currentWebKitTransform) { 2410 slide[0].style.webkitTransform = 'none'; 2411 } 2412 2413 if (params.roundLengths) { 2414 slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true); 2415 } else { 2416 // eslint-disable-next-line 2417 const width = getDirectionPropertyValue(slideStyles, 'width'); 2418 const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left'); 2419 const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right'); 2420 const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left'); 2421 const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right'); 2422 const boxSizing = slideStyles.getPropertyValue('box-sizing'); 2423 2424 if (boxSizing && boxSizing === 'border-box') { 2425 slideSize = width + marginLeft + marginRight; 2426 } else { 2427 const { 2428 clientWidth, 2429 offsetWidth 2430 } = slide[0]; 2431 slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth); 2432 } 2433 } 2434 2435 if (currentTransform) { 2436 slide[0].style.transform = currentTransform; 2437 } 2438 2439 if (currentWebKitTransform) { 2440 slide[0].style.webkitTransform = currentWebKitTransform; 2441 } 2442 2443 if (params.roundLengths) slideSize = Math.floor(slideSize); 2444 } else { 2445 slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView; 2446 if (params.roundLengths) slideSize = Math.floor(slideSize); 2447 2448 if (slides[i]) { 2449 slides[i].style[getDirectionLabel('width')] = `${slideSize}px`; 2450 } 2451 } 2452 2453 if (slides[i]) { 2454 slides[i].swiperSlideSize = slideSize; 2455 } 2456 2457 slidesSizesGrid.push(slideSize); 2458 2459 if (params.centeredSlides) { 2460 slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; 2461 if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 2462 if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 2463 if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; 2464 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 2465 if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition); 2466 slidesGrid.push(slidePosition); 2467 } else { 2468 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 2469 if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition); 2470 slidesGrid.push(slidePosition); 2471 slidePosition = slidePosition + slideSize + spaceBetween; 2472 } 2473 2474 swiper.virtualSize += slideSize + spaceBetween; 2475 prevSlideSize = slideSize; 2476 index += 1; 2477 } 2478 2479 swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter; 2480 2481 if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) { 2482 $wrapperEl.css({ 2483 width: `${swiper.virtualSize + params.spaceBetween}px` 2484 }); 2485 } 2486 2487 if (params.setWrapperSize) { 2488 $wrapperEl.css({ 2489 [getDirectionLabel('width')]: `${swiper.virtualSize + params.spaceBetween}px` 2490 }); 2491 } 2492 2493 if (gridEnabled) { 2494 swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel); 2495 } // Remove last grid elements depending on width 2496 2497 2498 if (!params.centeredSlides) { 2499 const newSlidesGrid = []; 2500 2501 for (let i = 0; i < snapGrid.length; i += 1) { 2502 let slidesGridItem = snapGrid[i]; 2503 if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem); 2504 2505 if (snapGrid[i] <= swiper.virtualSize - swiperSize) { 2506 newSlidesGrid.push(slidesGridItem); 2507 } 2508 } 2509 2510 snapGrid = newSlidesGrid; 2511 2512 if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) { 2513 snapGrid.push(swiper.virtualSize - swiperSize); 2514 } 2515 } 2516 2517 if (snapGrid.length === 0) snapGrid = [0]; 2518 2519 if (params.spaceBetween !== 0) { 2520 const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight'); 2521 slides.filter((_, slideIndex) => { 2522 if (!params.cssMode) return true; 2523 2524 if (slideIndex === slides.length - 1) { 2525 return false; 2526 } 2527 2528 return true; 2529 }).css({ 2530 [key]: `${spaceBetween}px` 2531 }); 2532 } 2533 2534 if (params.centeredSlides && params.centeredSlidesBounds) { 2535 let allSlidesSize = 0; 2536 slidesSizesGrid.forEach(slideSizeValue => { 2537 allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); 2538 }); 2539 allSlidesSize -= params.spaceBetween; 2540 const maxSnap = allSlidesSize - swiperSize; 2541 snapGrid = snapGrid.map(snap => { 2542 if (snap < 0) return -offsetBefore; 2543 if (snap > maxSnap) return maxSnap + offsetAfter; 2544 return snap; 2545 }); 2546 } 2547 2548 if (params.centerInsufficientSlides) { 2549 let allSlidesSize = 0; 2550 slidesSizesGrid.forEach(slideSizeValue => { 2551 allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); 2552 }); 2553 allSlidesSize -= params.spaceBetween; 2554 2555 if (allSlidesSize < swiperSize) { 2556 const allSlidesOffset = (swiperSize - allSlidesSize) / 2; 2557 snapGrid.forEach((snap, snapIndex) => { 2558 snapGrid[snapIndex] = snap - allSlidesOffset; 2559 }); 2560 slidesGrid.forEach((snap, snapIndex) => { 2561 slidesGrid[snapIndex] = snap + allSlidesOffset; 2562 }); 2563 } 2564 } 2565 2566 Object.assign(swiper, { 2567 slides, 2568 snapGrid, 2569 slidesGrid, 2570 slidesSizesGrid 2571 }); 2572 2573 if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) { 2574 setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`); 2575 setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`); 2576 const addToSnapGrid = -swiper.snapGrid[0]; 2577 const addToSlidesGrid = -swiper.slidesGrid[0]; 2578 swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid); 2579 swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid); 2580 } 2581 2582 if (slidesLength !== previousSlidesLength) { 2583 swiper.emit('slidesLengthChange'); 2584 } 2585 2586 if (snapGrid.length !== previousSnapGridLength) { 2587 if (swiper.params.watchOverflow) swiper.checkOverflow(); 2588 swiper.emit('snapGridLengthChange'); 2589 } 2590 2591 if (slidesGrid.length !== previousSlidesGridLength) { 2592 swiper.emit('slidesGridLengthChange'); 2593 } 2594 2595 if (params.watchSlidesProgress) { 2596 swiper.updateSlidesOffset(); 2597 } 2598 2599 if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) { 2600 const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`; 2601 const hasClassBackfaceClassAdded = swiper.$el.hasClass(backFaceHiddenClass); 2602 2603 if (slidesLength <= params.maxBackfaceHiddenSlides) { 2604 if (!hasClassBackfaceClassAdded) swiper.$el.addClass(backFaceHiddenClass); 2605 } else if (hasClassBackfaceClassAdded) { 2606 swiper.$el.removeClass(backFaceHiddenClass); 2607 } 2608 } 2609 } 2610 2611 function updateAutoHeight(speed) { 2612 const swiper = this; 2613 const activeSlides = []; 2614 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 2615 let newHeight = 0; 2616 let i; 2617 2618 if (typeof speed === 'number') { 2619 swiper.setTransition(speed); 2620 } else if (speed === true) { 2621 swiper.setTransition(swiper.params.speed); 2622 } 2623 2624 const getSlideByIndex = index => { 2625 if (isVirtual) { 2626 return swiper.slides.filter(el => parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index)[0]; 2627 } 2628 2629 return swiper.slides.eq(index)[0]; 2630 }; // Find slides currently in view 2631 2632 2633 if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) { 2634 if (swiper.params.centeredSlides) { 2635 (swiper.visibleSlides || $([])).each(slide => { 2636 activeSlides.push(slide); 2637 }); 2638 } else { 2639 for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) { 2640 const index = swiper.activeIndex + i; 2641 if (index > swiper.slides.length && !isVirtual) break; 2642 activeSlides.push(getSlideByIndex(index)); 2643 } 2644 } 2645 } else { 2646 activeSlides.push(getSlideByIndex(swiper.activeIndex)); 2647 } // Find new height from highest slide in view 2648 2649 2650 for (i = 0; i < activeSlides.length; i += 1) { 2651 if (typeof activeSlides[i] !== 'undefined') { 2652 const height = activeSlides[i].offsetHeight; 2653 newHeight = height > newHeight ? height : newHeight; 2654 } 2655 } // Update Height 2656 2657 2658 if (newHeight || newHeight === 0) swiper.$wrapperEl.css('height', `${newHeight}px`); 2659 } 2660 2661 function updateSlidesOffset() { 2662 const swiper = this; 2663 const slides = swiper.slides; 2664 2665 for (let i = 0; i < slides.length; i += 1) { 2666 slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop; 2667 } 2668 } 2669 2670 function updateSlidesProgress(translate) { 2671 if (translate === void 0) { 2672 translate = this && this.translate || 0; 2673 } 2674 2675 const swiper = this; 2676 const params = swiper.params; 2677 const { 2678 slides, 2679 rtlTranslate: rtl, 2680 snapGrid 2681 } = swiper; 2682 if (slides.length === 0) return; 2683 if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset(); 2684 let offsetCenter = -translate; 2685 if (rtl) offsetCenter = translate; // Visible Slides 2686 2687 slides.removeClass(params.slideVisibleClass); 2688 swiper.visibleSlidesIndexes = []; 2689 swiper.visibleSlides = []; 2690 2691 for (let i = 0; i < slides.length; i += 1) { 2692 const slide = slides[i]; 2693 let slideOffset = slide.swiperSlideOffset; 2694 2695 if (params.cssMode && params.centeredSlides) { 2696 slideOffset -= slides[0].swiperSlideOffset; 2697 } 2698 2699 const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); 2700 const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); 2701 const slideBefore = -(offsetCenter - slideOffset); 2702 const slideAfter = slideBefore + swiper.slidesSizesGrid[i]; 2703 const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size; 2704 2705 if (isVisible) { 2706 swiper.visibleSlides.push(slide); 2707 swiper.visibleSlidesIndexes.push(i); 2708 slides.eq(i).addClass(params.slideVisibleClass); 2709 } 2710 2711 slide.progress = rtl ? -slideProgress : slideProgress; 2712 slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress; 2713 } 2714 2715 swiper.visibleSlides = $(swiper.visibleSlides); 2716 } 2717 2718 function updateProgress(translate) { 2719 const swiper = this; 2720 2721 if (typeof translate === 'undefined') { 2722 const multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line 2723 2724 translate = swiper && swiper.translate && swiper.translate * multiplier || 0; 2725 } 2726 2727 const params = swiper.params; 2728 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 2729 let { 2730 progress, 2731 isBeginning, 2732 isEnd 2733 } = swiper; 2734 const wasBeginning = isBeginning; 2735 const wasEnd = isEnd; 2736 2737 if (translatesDiff === 0) { 2738 progress = 0; 2739 isBeginning = true; 2740 isEnd = true; 2741 } else { 2742 progress = (translate - swiper.minTranslate()) / translatesDiff; 2743 isBeginning = progress <= 0; 2744 isEnd = progress >= 1; 2745 } 2746 2747 Object.assign(swiper, { 2748 progress, 2749 isBeginning, 2750 isEnd 2751 }); 2752 if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate); 2753 2754 if (isBeginning && !wasBeginning) { 2755 swiper.emit('reachBeginning toEdge'); 2756 } 2757 2758 if (isEnd && !wasEnd) { 2759 swiper.emit('reachEnd toEdge'); 2760 } 2761 2762 if (wasBeginning && !isBeginning || wasEnd && !isEnd) { 2763 swiper.emit('fromEdge'); 2764 } 2765 2766 swiper.emit('progress', progress); 2767 } 2768 2769 function updateSlidesClasses() { 2770 const swiper = this; 2771 const { 2772 slides, 2773 params, 2774 $wrapperEl, 2775 activeIndex, 2776 realIndex 2777 } = swiper; 2778 const isVirtual = swiper.virtual && params.virtual.enabled; 2779 slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`); 2780 let activeSlide; 2781 2782 if (isVirtual) { 2783 activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`); 2784 } else { 2785 activeSlide = slides.eq(activeIndex); 2786 } // Active classes 2787 2788 2789 activeSlide.addClass(params.slideActiveClass); 2790 2791 if (params.loop) { 2792 // Duplicate to all looped slides 2793 if (activeSlide.hasClass(params.slideDuplicateClass)) { 2794 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); 2795 } else { 2796 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); 2797 } 2798 } // Next Slide 2799 2800 2801 let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass); 2802 2803 if (params.loop && nextSlide.length === 0) { 2804 nextSlide = slides.eq(0); 2805 nextSlide.addClass(params.slideNextClass); 2806 } // Prev Slide 2807 2808 2809 let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass); 2810 2811 if (params.loop && prevSlide.length === 0) { 2812 prevSlide = slides.eq(-1); 2813 prevSlide.addClass(params.slidePrevClass); 2814 } 2815 2816 if (params.loop) { 2817 // Duplicate to all looped slides 2818 if (nextSlide.hasClass(params.slideDuplicateClass)) { 2819 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); 2820 } else { 2821 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); 2822 } 2823 2824 if (prevSlide.hasClass(params.slideDuplicateClass)) { 2825 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); 2826 } else { 2827 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); 2828 } 2829 } 2830 2831 swiper.emitSlidesClasses(); 2832 } 2833 2834 function updateActiveIndex(newActiveIndex) { 2835 const swiper = this; 2836 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 2837 const { 2838 slidesGrid, 2839 snapGrid, 2840 params, 2841 activeIndex: previousIndex, 2842 realIndex: previousRealIndex, 2843 snapIndex: previousSnapIndex 2844 } = swiper; 2845 let activeIndex = newActiveIndex; 2846 let snapIndex; 2847 2848 if (typeof activeIndex === 'undefined') { 2849 for (let i = 0; i < slidesGrid.length; i += 1) { 2850 if (typeof slidesGrid[i + 1] !== 'undefined') { 2851 if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) { 2852 activeIndex = i; 2853 } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) { 2854 activeIndex = i + 1; 2855 } 2856 } else if (translate >= slidesGrid[i]) { 2857 activeIndex = i; 2858 } 2859 } // Normalize slideIndex 2860 2861 2862 if (params.normalizeSlideIndex) { 2863 if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0; 2864 } 2865 } 2866 2867 if (snapGrid.indexOf(translate) >= 0) { 2868 snapIndex = snapGrid.indexOf(translate); 2869 } else { 2870 const skip = Math.min(params.slidesPerGroupSkip, activeIndex); 2871 snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup); 2872 } 2873 2874 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 2875 2876 if (activeIndex === previousIndex) { 2877 if (snapIndex !== previousSnapIndex) { 2878 swiper.snapIndex = snapIndex; 2879 swiper.emit('snapIndexChange'); 2880 } 2881 2882 return; 2883 } // Get real index 2884 2885 2886 const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10); 2887 Object.assign(swiper, { 2888 snapIndex, 2889 realIndex, 2890 previousIndex, 2891 activeIndex 2892 }); 2893 swiper.emit('activeIndexChange'); 2894 swiper.emit('snapIndexChange'); 2895 2896 if (previousRealIndex !== realIndex) { 2897 swiper.emit('realIndexChange'); 2898 } 2899 2900 if (swiper.initialized || swiper.params.runCallbacksOnInit) { 2901 swiper.emit('slideChange'); 2902 } 2903 } 2904 2905 function updateClickedSlide(e) { 2906 const swiper = this; 2907 const params = swiper.params; 2908 const slide = $(e).closest(`.${params.slideClass}`)[0]; 2909 let slideFound = false; 2910 let slideIndex; 2911 2912 if (slide) { 2913 for (let i = 0; i < swiper.slides.length; i += 1) { 2914 if (swiper.slides[i] === slide) { 2915 slideFound = true; 2916 slideIndex = i; 2917 break; 2918 } 2919 } 2920 } 2921 2922 if (slide && slideFound) { 2923 swiper.clickedSlide = slide; 2924 2925 if (swiper.virtual && swiper.params.virtual.enabled) { 2926 swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10); 2927 } else { 2928 swiper.clickedIndex = slideIndex; 2929 } 2930 } else { 2931 swiper.clickedSlide = undefined; 2932 swiper.clickedIndex = undefined; 2933 return; 2934 } 2935 2936 if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) { 2937 swiper.slideToClickedSlide(); 2938 } 2939 } 2940 2941 var update = { 2942 updateSize, 2943 updateSlides, 2944 updateAutoHeight, 2945 updateSlidesOffset, 2946 updateSlidesProgress, 2947 updateProgress, 2948 updateSlidesClasses, 2949 updateActiveIndex, 2950 updateClickedSlide 2951 }; 2952 2953 function getSwiperTranslate(axis) { 2954 if (axis === void 0) { 2955 axis = this.isHorizontal() ? 'x' : 'y'; 2956 } 2957 2958 const swiper = this; 2959 const { 2960 params, 2961 rtlTranslate: rtl, 2962 translate, 2963 $wrapperEl 2964 } = swiper; 2965 2966 if (params.virtualTranslate) { 2967 return rtl ? -translate : translate; 2968 } 2969 2970 if (params.cssMode) { 2971 return translate; 2972 } 2973 2974 let currentTranslate = getTranslate($wrapperEl[0], axis); 2975 if (rtl) currentTranslate = -currentTranslate; 2976 return currentTranslate || 0; 2977 } 2978 2979 function setTranslate(translate, byController) { 2980 const swiper = this; 2981 const { 2982 rtlTranslate: rtl, 2983 params, 2984 $wrapperEl, 2985 wrapperEl, 2986 progress 2987 } = swiper; 2988 let x = 0; 2989 let y = 0; 2990 const z = 0; 2991 2992 if (swiper.isHorizontal()) { 2993 x = rtl ? -translate : translate; 2994 } else { 2995 y = translate; 2996 } 2997 2998 if (params.roundLengths) { 2999 x = Math.floor(x); 3000 y = Math.floor(y); 3001 } 3002 3003 if (params.cssMode) { 3004 wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y; 3005 } else if (!params.virtualTranslate) { 3006 $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`); 3007 } 3008 3009 swiper.previousTranslate = swiper.translate; 3010 swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress 3011 3012 let newProgress; 3013 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 3014 3015 if (translatesDiff === 0) { 3016 newProgress = 0; 3017 } else { 3018 newProgress = (translate - swiper.minTranslate()) / translatesDiff; 3019 } 3020 3021 if (newProgress !== progress) { 3022 swiper.updateProgress(translate); 3023 } 3024 3025 swiper.emit('setTranslate', swiper.translate, byController); 3026 } 3027 3028 function minTranslate() { 3029 return -this.snapGrid[0]; 3030 } 3031 3032 function maxTranslate() { 3033 return -this.snapGrid[this.snapGrid.length - 1]; 3034 } 3035 3036 function translateTo(translate, speed, runCallbacks, translateBounds, internal) { 3037 if (translate === void 0) { 3038 translate = 0; 3039 } 3040 3041 if (speed === void 0) { 3042 speed = this.params.speed; 3043 } 3044 3045 if (runCallbacks === void 0) { 3046 runCallbacks = true; 3047 } 3048 3049 if (translateBounds === void 0) { 3050 translateBounds = true; 3051 } 3052 3053 const swiper = this; 3054 const { 3055 params, 3056 wrapperEl 3057 } = swiper; 3058 3059 if (swiper.animating && params.preventInteractionOnTransition) { 3060 return false; 3061 } 3062 3063 const minTranslate = swiper.minTranslate(); 3064 const maxTranslate = swiper.maxTranslate(); 3065 let newTranslate; 3066 if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress 3067 3068 swiper.updateProgress(newTranslate); 3069 3070 if (params.cssMode) { 3071 const isH = swiper.isHorizontal(); 3072 3073 if (speed === 0) { 3074 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate; 3075 } else { 3076 if (!swiper.support.smoothScroll) { 3077 animateCSSModeScroll({ 3078 swiper, 3079 targetPosition: -newTranslate, 3080 side: isH ? 'left' : 'top' 3081 }); 3082 return true; 3083 } 3084 3085 wrapperEl.scrollTo({ 3086 [isH ? 'left' : 'top']: -newTranslate, 3087 behavior: 'smooth' 3088 }); 3089 } 3090 3091 return true; 3092 } 3093 3094 if (speed === 0) { 3095 swiper.setTransition(0); 3096 swiper.setTranslate(newTranslate); 3097 3098 if (runCallbacks) { 3099 swiper.emit('beforeTransitionStart', speed, internal); 3100 swiper.emit('transitionEnd'); 3101 } 3102 } else { 3103 swiper.setTransition(speed); 3104 swiper.setTranslate(newTranslate); 3105 3106 if (runCallbacks) { 3107 swiper.emit('beforeTransitionStart', speed, internal); 3108 swiper.emit('transitionStart'); 3109 } 3110 3111 if (!swiper.animating) { 3112 swiper.animating = true; 3113 3114 if (!swiper.onTranslateToWrapperTransitionEnd) { 3115 swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) { 3116 if (!swiper || swiper.destroyed) return; 3117 if (e.target !== this) return; 3118 swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 3119 swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); 3120 swiper.onTranslateToWrapperTransitionEnd = null; 3121 delete swiper.onTranslateToWrapperTransitionEnd; 3122 3123 if (runCallbacks) { 3124 swiper.emit('transitionEnd'); 3125 } 3126 }; 3127 } 3128 3129 swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 3130 swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); 3131 } 3132 } 3133 3134 return true; 3135 } 3136 3137 var translate = { 3138 getTranslate: getSwiperTranslate, 3139 setTranslate, 3140 minTranslate, 3141 maxTranslate, 3142 translateTo 3143 }; 3144 3145 function setTransition(duration, byController) { 3146 const swiper = this; 3147 3148 if (!swiper.params.cssMode) { 3149 swiper.$wrapperEl.transition(duration); 3150 } 3151 3152 swiper.emit('setTransition', duration, byController); 3153 } 3154 3155 function transitionEmit(_ref) { 3156 let { 3157 swiper, 3158 runCallbacks, 3159 direction, 3160 step 3161 } = _ref; 3162 const { 3163 activeIndex, 3164 previousIndex 3165 } = swiper; 3166 let dir = direction; 3167 3168 if (!dir) { 3169 if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset'; 3170 } 3171 3172 swiper.emit(`transition${step}`); 3173 3174 if (runCallbacks && activeIndex !== previousIndex) { 3175 if (dir === 'reset') { 3176 swiper.emit(`slideResetTransition${step}`); 3177 return; 3178 } 3179 3180 swiper.emit(`slideChangeTransition${step}`); 3181 3182 if (dir === 'next') { 3183 swiper.emit(`slideNextTransition${step}`); 3184 } else { 3185 swiper.emit(`slidePrevTransition${step}`); 3186 } 3187 } 3188 } 3189 3190 function transitionStart(runCallbacks, direction) { 3191 if (runCallbacks === void 0) { 3192 runCallbacks = true; 3193 } 3194 3195 const swiper = this; 3196 const { 3197 params 3198 } = swiper; 3199 if (params.cssMode) return; 3200 3201 if (params.autoHeight) { 3202 swiper.updateAutoHeight(); 3203 } 3204 3205 transitionEmit({ 3206 swiper, 3207 runCallbacks, 3208 direction, 3209 step: 'Start' 3210 }); 3211 } 3212 3213 function transitionEnd(runCallbacks, direction) { 3214 if (runCallbacks === void 0) { 3215 runCallbacks = true; 3216 } 3217 3218 const swiper = this; 3219 const { 3220 params 3221 } = swiper; 3222 swiper.animating = false; 3223 if (params.cssMode) return; 3224 swiper.setTransition(0); 3225 transitionEmit({ 3226 swiper, 3227 runCallbacks, 3228 direction, 3229 step: 'End' 3230 }); 3231 } 3232 3233 var transition = { 3234 setTransition, 3235 transitionStart, 3236 transitionEnd 3237 }; 3238 3239 function slideTo(index, speed, runCallbacks, internal, initial) { 3240 if (index === void 0) { 3241 index = 0; 3242 } 3243 3244 if (speed === void 0) { 3245 speed = this.params.speed; 3246 } 3247 3248 if (runCallbacks === void 0) { 3249 runCallbacks = true; 3250 } 3251 3252 if (typeof index !== 'number' && typeof index !== 'string') { 3253 throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`); 3254 } 3255 3256 if (typeof index === 'string') { 3257 /** 3258 * The `index` argument converted from `string` to `number`. 3259 * @type {number} 3260 */ 3261 const indexAsNumber = parseInt(index, 10); 3262 /** 3263 * Determines whether the `index` argument is a valid `number` 3264 * after being converted from the `string` type. 3265 * @type {boolean} 3266 */ 3267 3268 const isValidNumber = isFinite(indexAsNumber); 3269 3270 if (!isValidNumber) { 3271 throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`); 3272 } // Knowing that the converted `index` is a valid number, 3273 // we can update the original argument's value. 3274 3275 3276 index = indexAsNumber; 3277 } 3278 3279 const swiper = this; 3280 let slideIndex = index; 3281 if (slideIndex < 0) slideIndex = 0; 3282 const { 3283 params, 3284 snapGrid, 3285 slidesGrid, 3286 previousIndex, 3287 activeIndex, 3288 rtlTranslate: rtl, 3289 wrapperEl, 3290 enabled 3291 } = swiper; 3292 3293 if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) { 3294 return false; 3295 } 3296 3297 const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex); 3298 let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup); 3299 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 3300 3301 if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) { 3302 swiper.emit('beforeSlideChangeStart'); 3303 } 3304 3305 const translate = -snapGrid[snapIndex]; // Update progress 3306 3307 swiper.updateProgress(translate); // Normalize slideIndex 3308 3309 if (params.normalizeSlideIndex) { 3310 for (let i = 0; i < slidesGrid.length; i += 1) { 3311 const normalizedTranslate = -Math.floor(translate * 100); 3312 const normalizedGrid = Math.floor(slidesGrid[i] * 100); 3313 const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100); 3314 3315 if (typeof slidesGrid[i + 1] !== 'undefined') { 3316 if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) { 3317 slideIndex = i; 3318 } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) { 3319 slideIndex = i + 1; 3320 } 3321 } else if (normalizedTranslate >= normalizedGrid) { 3322 slideIndex = i; 3323 } 3324 } 3325 } // Directions locks 3326 3327 3328 if (swiper.initialized && slideIndex !== activeIndex) { 3329 if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) { 3330 return false; 3331 } 3332 3333 if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) { 3334 if ((activeIndex || 0) !== slideIndex) return false; 3335 } 3336 } 3337 3338 let direction; 3339 if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index 3340 3341 if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) { 3342 swiper.updateActiveIndex(slideIndex); // Update Height 3343 3344 if (params.autoHeight) { 3345 swiper.updateAutoHeight(); 3346 } 3347 3348 swiper.updateSlidesClasses(); 3349 3350 if (params.effect !== 'slide') { 3351 swiper.setTranslate(translate); 3352 } 3353 3354 if (direction !== 'reset') { 3355 swiper.transitionStart(runCallbacks, direction); 3356 swiper.transitionEnd(runCallbacks, direction); 3357 } 3358 3359 return false; 3360 } 3361 3362 if (params.cssMode) { 3363 const isH = swiper.isHorizontal(); 3364 const t = rtl ? translate : -translate; 3365 3366 if (speed === 0) { 3367 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 3368 3369 if (isVirtual) { 3370 swiper.wrapperEl.style.scrollSnapType = 'none'; 3371 swiper._immediateVirtual = true; 3372 } 3373 3374 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 3375 3376 if (isVirtual) { 3377 requestAnimationFrame(() => { 3378 swiper.wrapperEl.style.scrollSnapType = ''; 3379 swiper._swiperImmediateVirtual = false; 3380 }); 3381 } 3382 } else { 3383 if (!swiper.support.smoothScroll) { 3384 animateCSSModeScroll({ 3385 swiper, 3386 targetPosition: t, 3387 side: isH ? 'left' : 'top' 3388 }); 3389 return true; 3390 } 3391 3392 wrapperEl.scrollTo({ 3393 [isH ? 'left' : 'top']: t, 3394 behavior: 'smooth' 3395 }); 3396 } 3397 3398 return true; 3399 } 3400 3401 swiper.setTransition(speed); 3402 swiper.setTranslate(translate); 3403 swiper.updateActiveIndex(slideIndex); 3404 swiper.updateSlidesClasses(); 3405 swiper.emit('beforeTransitionStart', speed, internal); 3406 swiper.transitionStart(runCallbacks, direction); 3407 3408 if (speed === 0) { 3409 swiper.transitionEnd(runCallbacks, direction); 3410 } else if (!swiper.animating) { 3411 swiper.animating = true; 3412 3413 if (!swiper.onSlideToWrapperTransitionEnd) { 3414 swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) { 3415 if (!swiper || swiper.destroyed) return; 3416 if (e.target !== this) return; 3417 swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 3418 swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); 3419 swiper.onSlideToWrapperTransitionEnd = null; 3420 delete swiper.onSlideToWrapperTransitionEnd; 3421 swiper.transitionEnd(runCallbacks, direction); 3422 }; 3423 } 3424 3425 swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 3426 swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); 3427 } 3428 3429 return true; 3430 } 3431 3432 function slideToLoop(index, speed, runCallbacks, internal) { 3433 if (index === void 0) { 3434 index = 0; 3435 } 3436 3437 if (speed === void 0) { 3438 speed = this.params.speed; 3439 } 3440 3441 if (runCallbacks === void 0) { 3442 runCallbacks = true; 3443 } 3444 3445 if (typeof index === 'string') { 3446 /** 3447 * The `index` argument converted from `string` to `number`. 3448 * @type {number} 3449 */ 3450 const indexAsNumber = parseInt(index, 10); 3451 /** 3452 * Determines whether the `index` argument is a valid `number` 3453 * after being converted from the `string` type. 3454 * @type {boolean} 3455 */ 3456 3457 const isValidNumber = isFinite(indexAsNumber); 3458 3459 if (!isValidNumber) { 3460 throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`); 3461 } // Knowing that the converted `index` is a valid number, 3462 // we can update the original argument's value. 3463 3464 3465 index = indexAsNumber; 3466 } 3467 3468 const swiper = this; 3469 let newIndex = index; 3470 3471 if (swiper.params.loop) { 3472 newIndex += swiper.loopedSlides; 3473 } 3474 3475 return swiper.slideTo(newIndex, speed, runCallbacks, internal); 3476 } 3477 3478 /* eslint no-unused-vars: "off" */ 3479 function slideNext(speed, runCallbacks, internal) { 3480 if (speed === void 0) { 3481 speed = this.params.speed; 3482 } 3483 3484 if (runCallbacks === void 0) { 3485 runCallbacks = true; 3486 } 3487 3488 const swiper = this; 3489 const { 3490 animating, 3491 enabled, 3492 params 3493 } = swiper; 3494 if (!enabled) return swiper; 3495 let perGroup = params.slidesPerGroup; 3496 3497 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 3498 perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1); 3499 } 3500 3501 const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup; 3502 3503 if (params.loop) { 3504 if (animating && params.loopPreventsSlide) return false; 3505 swiper.loopFix(); // eslint-disable-next-line 3506 3507 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 3508 } 3509 3510 if (params.rewind && swiper.isEnd) { 3511 return swiper.slideTo(0, speed, runCallbacks, internal); 3512 } 3513 3514 return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); 3515 } 3516 3517 /* eslint no-unused-vars: "off" */ 3518 function slidePrev(speed, runCallbacks, internal) { 3519 if (speed === void 0) { 3520 speed = this.params.speed; 3521 } 3522 3523 if (runCallbacks === void 0) { 3524 runCallbacks = true; 3525 } 3526 3527 const swiper = this; 3528 const { 3529 params, 3530 animating, 3531 snapGrid, 3532 slidesGrid, 3533 rtlTranslate, 3534 enabled 3535 } = swiper; 3536 if (!enabled) return swiper; 3537 3538 if (params.loop) { 3539 if (animating && params.loopPreventsSlide) return false; 3540 swiper.loopFix(); // eslint-disable-next-line 3541 3542 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 3543 } 3544 3545 const translate = rtlTranslate ? swiper.translate : -swiper.translate; 3546 3547 function normalize(val) { 3548 if (val < 0) return -Math.floor(Math.abs(val)); 3549 return Math.floor(val); 3550 } 3551 3552 const normalizedTranslate = normalize(translate); 3553 const normalizedSnapGrid = snapGrid.map(val => normalize(val)); 3554 let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1]; 3555 3556 if (typeof prevSnap === 'undefined' && params.cssMode) { 3557 let prevSnapIndex; 3558 snapGrid.forEach((snap, snapIndex) => { 3559 if (normalizedTranslate >= snap) { 3560 // prevSnap = snap; 3561 prevSnapIndex = snapIndex; 3562 } 3563 }); 3564 3565 if (typeof prevSnapIndex !== 'undefined') { 3566 prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex]; 3567 } 3568 } 3569 3570 let prevIndex = 0; 3571 3572 if (typeof prevSnap !== 'undefined') { 3573 prevIndex = slidesGrid.indexOf(prevSnap); 3574 if (prevIndex < 0) prevIndex = swiper.activeIndex - 1; 3575 3576 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 3577 prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1; 3578 prevIndex = Math.max(prevIndex, 0); 3579 } 3580 } 3581 3582 if (params.rewind && swiper.isBeginning) { 3583 const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 3584 return swiper.slideTo(lastIndex, speed, runCallbacks, internal); 3585 } 3586 3587 return swiper.slideTo(prevIndex, speed, runCallbacks, internal); 3588 } 3589 3590 /* eslint no-unused-vars: "off" */ 3591 function slideReset(speed, runCallbacks, internal) { 3592 if (speed === void 0) { 3593 speed = this.params.speed; 3594 } 3595 3596 if (runCallbacks === void 0) { 3597 runCallbacks = true; 3598 } 3599 3600 const swiper = this; 3601 return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); 3602 } 3603 3604 /* eslint no-unused-vars: "off" */ 3605 function slideToClosest(speed, runCallbacks, internal, threshold) { 3606 if (speed === void 0) { 3607 speed = this.params.speed; 3608 } 3609 3610 if (runCallbacks === void 0) { 3611 runCallbacks = true; 3612 } 3613 3614 if (threshold === void 0) { 3615 threshold = 0.5; 3616 } 3617 3618 const swiper = this; 3619 let index = swiper.activeIndex; 3620 const skip = Math.min(swiper.params.slidesPerGroupSkip, index); 3621 const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup); 3622 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 3623 3624 if (translate >= swiper.snapGrid[snapIndex]) { 3625 // The current translate is on or after the current snap index, so the choice 3626 // is between the current index and the one after it. 3627 const currentSnap = swiper.snapGrid[snapIndex]; 3628 const nextSnap = swiper.snapGrid[snapIndex + 1]; 3629 3630 if (translate - currentSnap > (nextSnap - currentSnap) * threshold) { 3631 index += swiper.params.slidesPerGroup; 3632 } 3633 } else { 3634 // The current translate is before the current snap index, so the choice 3635 // is between the current index and the one before it. 3636 const prevSnap = swiper.snapGrid[snapIndex - 1]; 3637 const currentSnap = swiper.snapGrid[snapIndex]; 3638 3639 if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) { 3640 index -= swiper.params.slidesPerGroup; 3641 } 3642 } 3643 3644 index = Math.max(index, 0); 3645 index = Math.min(index, swiper.slidesGrid.length - 1); 3646 return swiper.slideTo(index, speed, runCallbacks, internal); 3647 } 3648 3649 function slideToClickedSlide() { 3650 const swiper = this; 3651 const { 3652 params, 3653 $wrapperEl 3654 } = swiper; 3655 const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; 3656 let slideToIndex = swiper.clickedIndex; 3657 let realIndex; 3658 3659 if (params.loop) { 3660 if (swiper.animating) return; 3661 realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10); 3662 3663 if (params.centeredSlides) { 3664 if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) { 3665 swiper.loopFix(); 3666 slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); 3667 nextTick(() => { 3668 swiper.slideTo(slideToIndex); 3669 }); 3670 } else { 3671 swiper.slideTo(slideToIndex); 3672 } 3673 } else if (slideToIndex > swiper.slides.length - slidesPerView) { 3674 swiper.loopFix(); 3675 slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); 3676 nextTick(() => { 3677 swiper.slideTo(slideToIndex); 3678 }); 3679 } else { 3680 swiper.slideTo(slideToIndex); 3681 } 3682 } else { 3683 swiper.slideTo(slideToIndex); 3684 } 3685 } 3686 3687 var slide = { 3688 slideTo, 3689 slideToLoop, 3690 slideNext, 3691 slidePrev, 3692 slideReset, 3693 slideToClosest, 3694 slideToClickedSlide 3695 }; 3696 3697 function loopCreate() { 3698 const swiper = this; 3699 const document = getDocument(); 3700 const { 3701 params, 3702 $wrapperEl 3703 } = swiper; // Remove duplicated slides 3704 3705 const $selector = $wrapperEl.children().length > 0 ? $($wrapperEl.children()[0].parentNode) : $wrapperEl; 3706 $selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove(); 3707 let slides = $selector.children(`.${params.slideClass}`); 3708 3709 if (params.loopFillGroupWithBlank) { 3710 const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup; 3711 3712 if (blankSlidesNum !== params.slidesPerGroup) { 3713 for (let i = 0; i < blankSlidesNum; i += 1) { 3714 const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`); 3715 $selector.append(blankNode); 3716 } 3717 3718 slides = $selector.children(`.${params.slideClass}`); 3719 } 3720 } 3721 3722 if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length; 3723 swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10)); 3724 swiper.loopedSlides += params.loopAdditionalSlides; 3725 3726 if (swiper.loopedSlides > slides.length) { 3727 swiper.loopedSlides = slides.length; 3728 } 3729 3730 const prependSlides = []; 3731 const appendSlides = []; 3732 slides.each((el, index) => { 3733 const slide = $(el); 3734 3735 if (index < swiper.loopedSlides) { 3736 appendSlides.push(el); 3737 } 3738 3739 if (index < slides.length && index >= slides.length - swiper.loopedSlides) { 3740 prependSlides.push(el); 3741 } 3742 3743 slide.attr('data-swiper-slide-index', index); 3744 }); 3745 3746 for (let i = 0; i < appendSlides.length; i += 1) { 3747 $selector.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); 3748 } 3749 3750 for (let i = prependSlides.length - 1; i >= 0; i -= 1) { 3751 $selector.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); 3752 } 3753 } 3754 3755 function loopFix() { 3756 const swiper = this; 3757 swiper.emit('beforeLoopFix'); 3758 const { 3759 activeIndex, 3760 slides, 3761 loopedSlides, 3762 allowSlidePrev, 3763 allowSlideNext, 3764 snapGrid, 3765 rtlTranslate: rtl 3766 } = swiper; 3767 let newIndex; 3768 swiper.allowSlidePrev = true; 3769 swiper.allowSlideNext = true; 3770 const snapTranslate = -snapGrid[activeIndex]; 3771 const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding 3772 3773 if (activeIndex < loopedSlides) { 3774 newIndex = slides.length - loopedSlides * 3 + activeIndex; 3775 newIndex += loopedSlides; 3776 const slideChanged = swiper.slideTo(newIndex, 0, false, true); 3777 3778 if (slideChanged && diff !== 0) { 3779 swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); 3780 } 3781 } else if (activeIndex >= slides.length - loopedSlides) { 3782 // Fix For Positive Oversliding 3783 newIndex = -slides.length + activeIndex + loopedSlides; 3784 newIndex += loopedSlides; 3785 const slideChanged = swiper.slideTo(newIndex, 0, false, true); 3786 3787 if (slideChanged && diff !== 0) { 3788 swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); 3789 } 3790 } 3791 3792 swiper.allowSlidePrev = allowSlidePrev; 3793 swiper.allowSlideNext = allowSlideNext; 3794 swiper.emit('loopFix'); 3795 } 3796 3797 function loopDestroy() { 3798 const swiper = this; 3799 const { 3800 $wrapperEl, 3801 params, 3802 slides 3803 } = swiper; 3804 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove(); 3805 slides.removeAttr('data-swiper-slide-index'); 3806 } 3807 3808 var loop = { 3809 loopCreate, 3810 loopFix, 3811 loopDestroy 3812 }; 3813 3814 function setGrabCursor(moving) { 3815 const swiper = this; 3816 if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; 3817 const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; 3818 el.style.cursor = 'move'; 3819 el.style.cursor = moving ? 'grabbing' : 'grab'; 3820 } 3821 3822 function unsetGrabCursor() { 3823 const swiper = this; 3824 3825 if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { 3826 return; 3827 } 3828 3829 swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; 3830 } 3831 3832 var grabCursor = { 3833 setGrabCursor, 3834 unsetGrabCursor 3835 }; 3836 3837 function closestElement(selector, base) { 3838 if (base === void 0) { 3839 base = this; 3840 } 3841 3842 function __closestFrom(el) { 3843 if (!el || el === getDocument() || el === getWindow()) return null; 3844 if (el.assignedSlot) el = el.assignedSlot; 3845 const found = el.closest(selector); 3846 3847 if (!found && !el.getRootNode) { 3848 return null; 3849 } 3850 3851 return found || __closestFrom(el.getRootNode().host); 3852 } 3853 3854 return __closestFrom(base); 3855 } 3856 3857 function onTouchStart(event) { 3858 const swiper = this; 3859 const document = getDocument(); 3860 const window = getWindow(); 3861 const data = swiper.touchEventsData; 3862 const { 3863 params, 3864 touches, 3865 enabled 3866 } = swiper; 3867 if (!enabled) return; 3868 3869 if (swiper.animating && params.preventInteractionOnTransition) { 3870 return; 3871 } 3872 3873 if (!swiper.animating && params.cssMode && params.loop) { 3874 swiper.loopFix(); 3875 } 3876 3877 let e = event; 3878 if (e.originalEvent) e = e.originalEvent; 3879 let $targetEl = $(e.target); 3880 3881 if (params.touchEventsTarget === 'wrapper') { 3882 if (!$targetEl.closest(swiper.wrapperEl).length) return; 3883 } 3884 3885 data.isTouchEvent = e.type === 'touchstart'; 3886 if (!data.isTouchEvent && 'which' in e && e.which === 3) return; 3887 if (!data.isTouchEvent && 'button' in e && e.button > 0) return; 3888 if (data.isTouched && data.isMoved) return; // change target el for shadow root component 3889 3890 const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; 3891 3892 if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) { 3893 $targetEl = $(event.path[0]); 3894 } 3895 3896 const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`; 3897 const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element 3898 3899 if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, $targetEl[0]) : $targetEl.closest(noSwipingSelector)[0])) { 3900 swiper.allowClick = true; 3901 return; 3902 } 3903 3904 if (params.swipeHandler) { 3905 if (!$targetEl.closest(params.swipeHandler)[0]) return; 3906 } 3907 3908 touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; 3909 touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; 3910 const startX = touches.currentX; 3911 const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore 3912 3913 const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection; 3914 const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold; 3915 3916 if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) { 3917 if (edgeSwipeDetection === 'prevent') { 3918 event.preventDefault(); 3919 } else { 3920 return; 3921 } 3922 } 3923 3924 Object.assign(data, { 3925 isTouched: true, 3926 isMoved: false, 3927 allowTouchCallbacks: true, 3928 isScrolling: undefined, 3929 startMoving: undefined 3930 }); 3931 touches.startX = startX; 3932 touches.startY = startY; 3933 data.touchStartTime = now(); 3934 swiper.allowClick = true; 3935 swiper.updateSize(); 3936 swiper.swipeDirection = undefined; 3937 if (params.threshold > 0) data.allowThresholdMove = false; 3938 3939 if (e.type !== 'touchstart') { 3940 let preventDefault = true; 3941 3942 if ($targetEl.is(data.focusableElements)) { 3943 preventDefault = false; 3944 3945 if ($targetEl[0].nodeName === 'SELECT') { 3946 data.isTouched = false; 3947 } 3948 } 3949 3950 if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) { 3951 document.activeElement.blur(); 3952 } 3953 3954 const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault; 3955 3956 if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) { 3957 e.preventDefault(); 3958 } 3959 } 3960 3961 if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) { 3962 swiper.freeMode.onTouchStart(); 3963 } 3964 3965 swiper.emit('touchStart', e); 3966 } 3967 3968 function onTouchMove(event) { 3969 const document = getDocument(); 3970 const swiper = this; 3971 const data = swiper.touchEventsData; 3972 const { 3973 params, 3974 touches, 3975 rtlTranslate: rtl, 3976 enabled 3977 } = swiper; 3978 if (!enabled) return; 3979 let e = event; 3980 if (e.originalEvent) e = e.originalEvent; 3981 3982 if (!data.isTouched) { 3983 if (data.startMoving && data.isScrolling) { 3984 swiper.emit('touchMoveOpposite', e); 3985 } 3986 3987 return; 3988 } 3989 3990 if (data.isTouchEvent && e.type !== 'touchmove') return; 3991 const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]); 3992 const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX; 3993 const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY; 3994 3995 if (e.preventedByNestedSwiper) { 3996 touches.startX = pageX; 3997 touches.startY = pageY; 3998 return; 3999 } 4000 4001 if (!swiper.allowTouchMove) { 4002 if (!$(e.target).is(data.focusableElements)) { 4003 swiper.allowClick = false; 4004 } 4005 4006 if (data.isTouched) { 4007 Object.assign(touches, { 4008 startX: pageX, 4009 startY: pageY, 4010 currentX: pageX, 4011 currentY: pageY 4012 }); 4013 data.touchStartTime = now(); 4014 } 4015 4016 return; 4017 } 4018 4019 if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) { 4020 if (swiper.isVertical()) { 4021 // Vertical 4022 if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) { 4023 data.isTouched = false; 4024 data.isMoved = false; 4025 return; 4026 } 4027 } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) { 4028 return; 4029 } 4030 } 4031 4032 if (data.isTouchEvent && document.activeElement) { 4033 if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) { 4034 data.isMoved = true; 4035 swiper.allowClick = false; 4036 return; 4037 } 4038 } 4039 4040 if (data.allowTouchCallbacks) { 4041 swiper.emit('touchMove', e); 4042 } 4043 4044 if (e.targetTouches && e.targetTouches.length > 1) return; 4045 touches.currentX = pageX; 4046 touches.currentY = pageY; 4047 const diffX = touches.currentX - touches.startX; 4048 const diffY = touches.currentY - touches.startY; 4049 if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return; 4050 4051 if (typeof data.isScrolling === 'undefined') { 4052 let touchAngle; 4053 4054 if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) { 4055 data.isScrolling = false; 4056 } else { 4057 // eslint-disable-next-line 4058 if (diffX * diffX + diffY * diffY >= 25) { 4059 touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI; 4060 data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle; 4061 } 4062 } 4063 } 4064 4065 if (data.isScrolling) { 4066 swiper.emit('touchMoveOpposite', e); 4067 } 4068 4069 if (typeof data.startMoving === 'undefined') { 4070 if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) { 4071 data.startMoving = true; 4072 } 4073 } 4074 4075 if (data.isScrolling) { 4076 data.isTouched = false; 4077 return; 4078 } 4079 4080 if (!data.startMoving) { 4081 return; 4082 } 4083 4084 swiper.allowClick = false; 4085 4086 if (!params.cssMode && e.cancelable) { 4087 e.preventDefault(); 4088 } 4089 4090 if (params.touchMoveStopPropagation && !params.nested) { 4091 e.stopPropagation(); 4092 } 4093 4094 if (!data.isMoved) { 4095 if (params.loop && !params.cssMode) { 4096 swiper.loopFix(); 4097 } 4098 4099 data.startTranslate = swiper.getTranslate(); 4100 swiper.setTransition(0); 4101 4102 if (swiper.animating) { 4103 swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend'); 4104 } 4105 4106 data.allowMomentumBounce = false; // Grab Cursor 4107 4108 if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 4109 swiper.setGrabCursor(true); 4110 } 4111 4112 swiper.emit('sliderFirstMove', e); 4113 } 4114 4115 swiper.emit('sliderMove', e); 4116 data.isMoved = true; 4117 let diff = swiper.isHorizontal() ? diffX : diffY; 4118 touches.diff = diff; 4119 diff *= params.touchRatio; 4120 if (rtl) diff = -diff; 4121 swiper.swipeDirection = diff > 0 ? 'prev' : 'next'; 4122 data.currentTranslate = diff + data.startTranslate; 4123 let disableParentSwiper = true; 4124 let resistanceRatio = params.resistanceRatio; 4125 4126 if (params.touchReleaseOnEdges) { 4127 resistanceRatio = 0; 4128 } 4129 4130 if (diff > 0 && data.currentTranslate > swiper.minTranslate()) { 4131 disableParentSwiper = false; 4132 if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio; 4133 } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) { 4134 disableParentSwiper = false; 4135 if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio; 4136 } 4137 4138 if (disableParentSwiper) { 4139 e.preventedByNestedSwiper = true; 4140 } // Directions locks 4141 4142 4143 if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) { 4144 data.currentTranslate = data.startTranslate; 4145 } 4146 4147 if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) { 4148 data.currentTranslate = data.startTranslate; 4149 } 4150 4151 if (!swiper.allowSlidePrev && !swiper.allowSlideNext) { 4152 data.currentTranslate = data.startTranslate; 4153 } // Threshold 4154 4155 4156 if (params.threshold > 0) { 4157 if (Math.abs(diff) > params.threshold || data.allowThresholdMove) { 4158 if (!data.allowThresholdMove) { 4159 data.allowThresholdMove = true; 4160 touches.startX = touches.currentX; 4161 touches.startY = touches.currentY; 4162 data.currentTranslate = data.startTranslate; 4163 touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY; 4164 return; 4165 } 4166 } else { 4167 data.currentTranslate = data.startTranslate; 4168 return; 4169 } 4170 } 4171 4172 if (!params.followFinger || params.cssMode) return; // Update active index in free mode 4173 4174 if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) { 4175 swiper.updateActiveIndex(); 4176 swiper.updateSlidesClasses(); 4177 } 4178 4179 if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) { 4180 swiper.freeMode.onTouchMove(); 4181 } // Update progress 4182 4183 4184 swiper.updateProgress(data.currentTranslate); // Update translate 4185 4186 swiper.setTranslate(data.currentTranslate); 4187 } 4188 4189 function onTouchEnd(event) { 4190 const swiper = this; 4191 const data = swiper.touchEventsData; 4192 const { 4193 params, 4194 touches, 4195 rtlTranslate: rtl, 4196 slidesGrid, 4197 enabled 4198 } = swiper; 4199 if (!enabled) return; 4200 let e = event; 4201 if (e.originalEvent) e = e.originalEvent; 4202 4203 if (data.allowTouchCallbacks) { 4204 swiper.emit('touchEnd', e); 4205 } 4206 4207 data.allowTouchCallbacks = false; 4208 4209 if (!data.isTouched) { 4210 if (data.isMoved && params.grabCursor) { 4211 swiper.setGrabCursor(false); 4212 } 4213 4214 data.isMoved = false; 4215 data.startMoving = false; 4216 return; 4217 } // Return Grab Cursor 4218 4219 4220 if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 4221 swiper.setGrabCursor(false); 4222 } // Time diff 4223 4224 4225 const touchEndTime = now(); 4226 const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click 4227 4228 if (swiper.allowClick) { 4229 const pathTree = e.path || e.composedPath && e.composedPath(); 4230 swiper.updateClickedSlide(pathTree && pathTree[0] || e.target); 4231 swiper.emit('tap click', e); 4232 4233 if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) { 4234 swiper.emit('doubleTap doubleClick', e); 4235 } 4236 } 4237 4238 data.lastClickTime = now(); 4239 nextTick(() => { 4240 if (!swiper.destroyed) swiper.allowClick = true; 4241 }); 4242 4243 if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) { 4244 data.isTouched = false; 4245 data.isMoved = false; 4246 data.startMoving = false; 4247 return; 4248 } 4249 4250 data.isTouched = false; 4251 data.isMoved = false; 4252 data.startMoving = false; 4253 let currentPos; 4254 4255 if (params.followFinger) {
vendor: 5,874 bytes, lines 4256-4444
4256 currentPos = rtl ? swiper.translate : -swiper.translate; 4257 } else { 4258 currentPos = -data.currentTranslate; 4259 } 4260 4261 if (params.cssMode) { 4262 return; 4263 } 4264 4265 if (swiper.params.freeMode && params.freeMode.enabled) { 4266 swiper.freeMode.onTouchEnd({ 4267 currentPos 4268 }); 4269 return; 4270 } // Find current slide 4271 4272 4273 let stopIndex = 0; 4274 let groupSize = swiper.slidesSizesGrid[0]; 4275 4276 for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) { 4277 const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 4278 4279 if (typeof slidesGrid[i + increment] !== 'undefined') { 4280 if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) { 4281 stopIndex = i; 4282 groupSize = slidesGrid[i + increment] - slidesGrid[i]; 4283 } 4284 } else if (currentPos >= slidesGrid[i]) { 4285 stopIndex = i; 4286 groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2]; 4287 } 4288 } 4289 4290 let rewindFirstIndex = null; 4291 let rewindLastIndex = null; 4292 4293 if (params.rewind) { 4294 if (swiper.isBeginning) { 4295 rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 4296 } else if (swiper.isEnd) { 4297 rewindFirstIndex = 0; 4298 } 4299 } // Find current slide size 4300 4301 4302 const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize; 4303 const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 4304 4305 if (timeDiff > params.longSwipesMs) { 4306 // Long touches 4307 if (!params.longSwipes) { 4308 swiper.slideTo(swiper.activeIndex); 4309 return; 4310 } 4311 4312 if (swiper.swipeDirection === 'next') { 4313 if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex); 4314 } 4315 4316 if (swiper.swipeDirection === 'prev') { 4317 if (ratio > 1 - params.longSwipesRatio) { 4318 swiper.slideTo(stopIndex + increment); 4319 } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) { 4320 swiper.slideTo(rewindLastIndex); 4321 } else { 4322 swiper.slideTo(stopIndex); 4323 } 4324 } 4325 } else { 4326 // Short swipes 4327 if (!params.shortSwipes) { 4328 swiper.slideTo(swiper.activeIndex); 4329 return; 4330 } 4331 4332 const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl); 4333 4334 if (!isNavButtonTarget) { 4335 if (swiper.swipeDirection === 'next') { 4336 swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment); 4337 } 4338 4339 if (swiper.swipeDirection === 'prev') { 4340 swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex); 4341 } 4342 } else if (e.target === swiper.navigation.nextEl) { 4343 swiper.slideTo(stopIndex + increment); 4344 } else { 4345 swiper.slideTo(stopIndex); 4346 } 4347 } 4348 } 4349 4350 function onResize() { 4351 const swiper = this; 4352 const { 4353 params, 4354 el 4355 } = swiper; 4356 if (el && el.offsetWidth === 0) return; // Breakpoints 4357 4358 if (params.breakpoints) { 4359 swiper.setBreakpoint(); 4360 } // Save locks 4361 4362 4363 const { 4364 allowSlideNext, 4365 allowSlidePrev, 4366 snapGrid 4367 } = swiper; // Disable locks on resize 4368 4369 swiper.allowSlideNext = true; 4370 swiper.allowSlidePrev = true; 4371 swiper.updateSize(); 4372 swiper.updateSlides(); 4373 swiper.updateSlidesClasses(); 4374 4375 if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) { 4376 swiper.slideTo(swiper.slides.length - 1, 0, false, true); 4377 } else { 4378 swiper.slideTo(swiper.activeIndex, 0, false, true); 4379 } 4380 4381 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 4382 swiper.autoplay.run(); 4383 } // Return locks after resize 4384 4385 4386 swiper.allowSlidePrev = allowSlidePrev; 4387 swiper.allowSlideNext = allowSlideNext; 4388 4389 if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) { 4390 swiper.checkOverflow(); 4391 } 4392 } 4393 4394 function onClick(e) { 4395 const swiper = this; 4396 if (!swiper.enabled) return; 4397 4398 if (!swiper.allowClick) { 4399 if (swiper.params.preventClicks) e.preventDefault(); 4400 4401 if (swiper.params.preventClicksPropagation && swiper.animating) { 4402 e.stopPropagation(); 4403 e.stopImmediatePropagation(); 4404 } 4405 } 4406 } 4407 4408 function onScroll() { 4409 const swiper = this; 4410 const { 4411 wrapperEl, 4412 rtlTranslate, 4413 enabled 4414 } = swiper; 4415 if (!enabled) return; 4416 swiper.previousTranslate = swiper.translate; 4417 4418 if (swiper.isHorizontal()) { 4419 swiper.translate = -wrapperEl.scrollLeft; 4420 } else { 4421 swiper.translate = -wrapperEl.scrollTop; 4422 } // eslint-disable-next-line 4423 4424 4425 if (swiper.translate === 0) swiper.translate = 0; 4426 swiper.updateActiveIndex(); 4427 swiper.updateSlidesClasses(); 4428 let newProgress; 4429 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 4430 4431 if (translatesDiff === 0) { 4432 newProgress = 0; 4433 } else { 4434 newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff; 4435 } 4436 4437 if (newProgress !== swiper.progress) { 4438 swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate); 4439 } 4440 4441 swiper.emit('setTranslate', swiper.translate, false); 4442 } 4443 4444 let dummyEventAttached = false;
vendor: 28,788 bytes, lines 4445-5405
4445 4446 function dummyEventListener() {} 4447 4448 const events = (swiper, method) => { 4449 const document = getDocument(); 4450 const { 4451 params, 4452 touchEvents, 4453 el, 4454 wrapperEl, 4455 device, 4456 support 4457 } = swiper; 4458 const capture = !!params.nested; 4459 const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 4460 const swiperMethod = method; // Touch Events 4461 4462 if (!support.touch) { 4463 el[domMethod](touchEvents.start, swiper.onTouchStart, false); 4464 document[domMethod](touchEvents.move, swiper.onTouchMove, capture); 4465 document[domMethod](touchEvents.end, swiper.onTouchEnd, false); 4466 } else { 4467 const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? { 4468 passive: true, 4469 capture: false 4470 } : false; 4471 el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener); 4472 el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? { 4473 passive: false, 4474 capture 4475 } : capture); 4476 el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener); 4477 4478 if (touchEvents.cancel) { 4479 el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener); 4480 } 4481 } // Prevent Links Clicks 4482 4483 4484 if (params.preventClicks || params.preventClicksPropagation) { 4485 el[domMethod]('click', swiper.onClick, true); 4486 } 4487 4488 if (params.cssMode) { 4489 wrapperEl[domMethod]('scroll', swiper.onScroll); 4490 } // Resize handler 4491 4492 4493 if (params.updateOnWindowResize) { 4494 swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true); 4495 } else { 4496 swiper[swiperMethod]('observerUpdate', onResize, true); 4497 } 4498 }; 4499 4500 function attachEvents() { 4501 const swiper = this; 4502 const document = getDocument(); 4503 const { 4504 params, 4505 support 4506 } = swiper; 4507 swiper.onTouchStart = onTouchStart.bind(swiper); 4508 swiper.onTouchMove = onTouchMove.bind(swiper); 4509 swiper.onTouchEnd = onTouchEnd.bind(swiper); 4510 4511 if (params.cssMode) { 4512 swiper.onScroll = onScroll.bind(swiper); 4513 } 4514 4515 swiper.onClick = onClick.bind(swiper); 4516 4517 if (support.touch && !dummyEventAttached) { 4518 document.addEventListener('touchstart', dummyEventListener); 4519 dummyEventAttached = true; 4520 } 4521 4522 events(swiper, 'on'); 4523 } 4524 4525 function detachEvents() { 4526 const swiper = this; 4527 events(swiper, 'off'); 4528 } 4529 4530 var events$1 = { 4531 attachEvents, 4532 detachEvents 4533 }; 4534 4535 const isGridEnabled = (swiper, params) => { 4536 return swiper.grid && params.grid && params.grid.rows > 1; 4537 }; 4538 4539 function setBreakpoint() { 4540 const swiper = this; 4541 const { 4542 activeIndex, 4543 initialized, 4544 loopedSlides = 0, 4545 params, 4546 $el 4547 } = swiper; 4548 const breakpoints = params.breakpoints; 4549 if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters 4550 4551 const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el); 4552 if (!breakpoint || swiper.currentBreakpoint === breakpoint) return; 4553 const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined; 4554 const breakpointParams = breakpointOnlyParams || swiper.originalParams; 4555 const wasMultiRow = isGridEnabled(swiper, params); 4556 const isMultiRow = isGridEnabled(swiper, breakpointParams); 4557 const wasEnabled = params.enabled; 4558 4559 if (wasMultiRow && !isMultiRow) { 4560 $el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`); 4561 swiper.emitContainerClasses(); 4562 } else if (!wasMultiRow && isMultiRow) { 4563 $el.addClass(`${params.containerModifierClass}grid`); 4564 4565 if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') { 4566 $el.addClass(`${params.containerModifierClass}grid-column`); 4567 } 4568 4569 swiper.emitContainerClasses(); 4570 } // Toggle navigation, pagination, scrollbar 4571 4572 4573 ['navigation', 'pagination', 'scrollbar'].forEach(prop => { 4574 const wasModuleEnabled = params[prop] && params[prop].enabled; 4575 const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled; 4576 4577 if (wasModuleEnabled && !isModuleEnabled) { 4578 swiper[prop].disable(); 4579 } 4580 4581 if (!wasModuleEnabled && isModuleEnabled) { 4582 swiper[prop].enable(); 4583 } 4584 }); 4585 const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction; 4586 const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged); 4587 4588 if (directionChanged && initialized) { 4589 swiper.changeDirection(); 4590 } 4591 4592 extend(swiper.params, breakpointParams); 4593 const isEnabled = swiper.params.enabled; 4594 Object.assign(swiper, { 4595 allowTouchMove: swiper.params.allowTouchMove, 4596 allowSlideNext: swiper.params.allowSlideNext, 4597 allowSlidePrev: swiper.params.allowSlidePrev 4598 }); 4599 4600 if (wasEnabled && !isEnabled) { 4601 swiper.disable(); 4602 } else if (!wasEnabled && isEnabled) { 4603 swiper.enable(); 4604 } 4605 4606 swiper.currentBreakpoint = breakpoint; 4607 swiper.emit('_beforeBreakpoint', breakpointParams); 4608 4609 if (needsReLoop && initialized) { 4610 swiper.loopDestroy(); 4611 swiper.loopCreate(); 4612 swiper.updateSlides(); 4613 swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false); 4614 } 4615 4616 swiper.emit('breakpoint', breakpointParams); 4617 } 4618 4619 function getBreakpoint(breakpoints, base, containerEl) { 4620 if (base === void 0) { 4621 base = 'window'; 4622 } 4623 4624 if (!breakpoints || base === 'container' && !containerEl) return undefined; 4625 let breakpoint = false; 4626 const window = getWindow(); 4627 const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight; 4628 const points = Object.keys(breakpoints).map(point => { 4629 if (typeof point === 'string' && point.indexOf('@') === 0) { 4630 const minRatio = parseFloat(point.substr(1)); 4631 const value = currentHeight * minRatio; 4632 return { 4633 value, 4634 point 4635 }; 4636 } 4637 4638 return { 4639 value: point, 4640 point 4641 }; 4642 }); 4643 points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10)); 4644 4645 for (let i = 0; i < points.length; i += 1) { 4646 const { 4647 point, 4648 value 4649 } = points[i]; 4650 4651 if (base === 'window') { 4652 if (window.matchMedia(`(min-width: ${value}px)`).matches) { 4653 breakpoint = point; 4654 } 4655 } else if (value <= containerEl.clientWidth) { 4656 breakpoint = point; 4657 } 4658 } 4659 4660 return breakpoint || 'max'; 4661 } 4662 4663 var breakpoints = { 4664 setBreakpoint, 4665 getBreakpoint 4666 }; 4667 4668 function prepareClasses(entries, prefix) { 4669 const resultClasses = []; 4670 entries.forEach(item => { 4671 if (typeof item === 'object') { 4672 Object.keys(item).forEach(classNames => { 4673 if (item[classNames]) { 4674 resultClasses.push(prefix + classNames); 4675 } 4676 }); 4677 } else if (typeof item === 'string') { 4678 resultClasses.push(prefix + item); 4679 } 4680 }); 4681 return resultClasses; 4682 } 4683 4684 function addClasses() { 4685 const swiper = this; 4686 const { 4687 classNames, 4688 params, 4689 rtl, 4690 $el, 4691 device, 4692 support 4693 } = swiper; // prettier-ignore 4694 4695 const suffixes = prepareClasses(['initialized', params.direction, { 4696 'pointer-events': !support.touch 4697 }, { 4698 'free-mode': swiper.params.freeMode && params.freeMode.enabled 4699 }, { 4700 'autoheight': params.autoHeight 4701 }, { 4702 'rtl': rtl 4703 }, { 4704 'grid': params.grid && params.grid.rows > 1 4705 }, { 4706 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column' 4707 }, { 4708 'android': device.android 4709 }, { 4710 'ios': device.ios 4711 }, { 4712 'css-mode': params.cssMode 4713 }, { 4714 'centered': params.cssMode && params.centeredSlides 4715 }, { 4716 'watch-progress': params.watchSlidesProgress 4717 }], params.containerModifierClass); 4718 classNames.push(...suffixes); 4719 $el.addClass([...classNames].join(' ')); 4720 swiper.emitContainerClasses(); 4721 } 4722 4723 function removeClasses() { 4724 const swiper = this; 4725 const { 4726 $el, 4727 classNames 4728 } = swiper; 4729 $el.removeClass(classNames.join(' ')); 4730 swiper.emitContainerClasses(); 4731 } 4732 4733 var classes = { 4734 addClasses, 4735 removeClasses 4736 }; 4737 4738 function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) { 4739 const window = getWindow(); 4740 let image; 4741 4742 function onReady() { 4743 if (callback) callback(); 4744 } 4745 4746 const isPicture = $(imageEl).parent('picture')[0]; 4747 4748 if (!isPicture && (!imageEl.complete || !checkForComplete)) { 4749 if (src) { 4750 image = new window.Image(); 4751 image.onload = onReady; 4752 image.onerror = onReady; 4753 4754 if (sizes) { 4755 image.sizes = sizes; 4756 } 4757 4758 if (srcset) { 4759 image.srcset = srcset; 4760 } 4761 4762 if (src) { 4763 image.src = src; 4764 } 4765 } else { 4766 onReady(); 4767 } 4768 } else { 4769 // image already loaded... 4770 onReady(); 4771 } 4772 } 4773 4774 function preloadImages() { 4775 const swiper = this; 4776 swiper.imagesToLoad = swiper.$el.find('img'); 4777 4778 function onReady() { 4779 if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return; 4780 if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1; 4781 4782 if (swiper.imagesLoaded === swiper.imagesToLoad.length) { 4783 if (swiper.params.updateOnImagesReady) swiper.update(); 4784 swiper.emit('imagesReady'); 4785 } 4786 } 4787 4788 for (let i = 0; i < swiper.imagesToLoad.length; i += 1) { 4789 const imageEl = swiper.imagesToLoad[i]; 4790 swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady); 4791 } 4792 } 4793 4794 var images = { 4795 loadImage, 4796 preloadImages 4797 }; 4798 4799 function checkOverflow() { 4800 const swiper = this; 4801 const { 4802 isLocked: wasLocked, 4803 params 4804 } = swiper; 4805 const { 4806 slidesOffsetBefore 4807 } = params; 4808 4809 if (slidesOffsetBefore) { 4810 const lastSlideIndex = swiper.slides.length - 1; 4811 const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2; 4812 swiper.isLocked = swiper.size > lastSlideRightEdge; 4813 } else { 4814 swiper.isLocked = swiper.snapGrid.length === 1; 4815 } 4816 4817 if (params.allowSlideNext === true) { 4818 swiper.allowSlideNext = !swiper.isLocked; 4819 } 4820 4821 if (params.allowSlidePrev === true) { 4822 swiper.allowSlidePrev = !swiper.isLocked; 4823 } 4824 4825 if (wasLocked && wasLocked !== swiper.isLocked) { 4826 swiper.isEnd = false; 4827 } 4828 4829 if (wasLocked !== swiper.isLocked) { 4830 swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); 4831 } 4832 } 4833 4834 var checkOverflow$1 = { 4835 checkOverflow 4836 }; 4837 4838 var defaults = { 4839 init: true, 4840 direction: 'horizontal', 4841 touchEventsTarget: 'wrapper', 4842 initialSlide: 0, 4843 speed: 300, 4844 cssMode: false, 4845 updateOnWindowResize: true, 4846 resizeObserver: true, 4847 nested: false, 4848 createElements: false, 4849 enabled: true, 4850 focusableElements: 'input, select, option, textarea, button, video, label', 4851 // Overrides 4852 width: null, 4853 height: null, 4854 // 4855 preventInteractionOnTransition: false, 4856 // ssr 4857 userAgent: null, 4858 url: null, 4859 // To support iOS's swipe-to-go-back gesture (when being used in-app). 4860 edgeSwipeDetection: false, 4861 edgeSwipeThreshold: 20, 4862 // Autoheight 4863 autoHeight: false, 4864 // Set wrapper width 4865 setWrapperSize: false, 4866 // Virtual Translate 4867 virtualTranslate: false, 4868 // Effects 4869 effect: 'slide', 4870 // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' 4871 // Breakpoints 4872 breakpoints: undefined, 4873 breakpointsBase: 'window', 4874 // Slides grid 4875 spaceBetween: 0, 4876 slidesPerView: 1, 4877 slidesPerGroup: 1, 4878 slidesPerGroupSkip: 0, 4879 slidesPerGroupAuto: false, 4880 centeredSlides: false, 4881 centeredSlidesBounds: false, 4882 slidesOffsetBefore: 0, 4883 // in px 4884 slidesOffsetAfter: 0, 4885 // in px 4886 normalizeSlideIndex: true, 4887 centerInsufficientSlides: false, 4888 // Disable swiper and hide navigation when container not overflow 4889 watchOverflow: true, 4890 // Round length 4891 roundLengths: false, 4892 // Touches 4893 touchRatio: 1, 4894 touchAngle: 45, 4895 simulateTouch: true, 4896 shortSwipes: true, 4897 longSwipes: true, 4898 longSwipesRatio: 0.5, 4899 longSwipesMs: 300, 4900 followFinger: true, 4901 allowTouchMove: true, 4902 threshold: 0, 4903 touchMoveStopPropagation: false, 4904 touchStartPreventDefault: true, 4905 touchStartForcePreventDefault: false, 4906 touchReleaseOnEdges: false, 4907 // Unique Navigation Elements 4908 uniqueNavElements: true, 4909 // Resistance 4910 resistance: true, 4911 resistanceRatio: 0.85, 4912 // Progress 4913 watchSlidesProgress: false, 4914 // Cursor 4915 grabCursor: false, 4916 // Clicks 4917 preventClicks: true, 4918 preventClicksPropagation: true, 4919 slideToClickedSlide: false, 4920 // Images 4921 preloadImages: true, 4922 updateOnImagesReady: true, 4923 // loop 4924 loop: false, 4925 loopAdditionalSlides: 0, 4926 loopedSlides: null, 4927 loopFillGroupWithBlank: false, 4928 loopPreventsSlide: true, 4929 // rewind 4930 rewind: false, 4931 // Swiping/no swiping 4932 allowSlidePrev: true, 4933 allowSlideNext: true, 4934 swipeHandler: null, 4935 // '.swipe-handler', 4936 noSwiping: true, 4937 noSwipingClass: 'swiper-no-swiping', 4938 noSwipingSelector: null, 4939 // Passive Listeners 4940 passiveListeners: true, 4941 maxBackfaceHiddenSlides: 10, 4942 // NS 4943 containerModifierClass: 'swiper-', 4944 // NEW 4945 slideClass: 'swiper-slide', 4946 slideBlankClass: 'swiper-slide-invisible-blank', 4947 slideActiveClass: 'swiper-slide-active', 4948 slideDuplicateActiveClass: 'swiper-slide-duplicate-active', 4949 slideVisibleClass: 'swiper-slide-visible', 4950 slideDuplicateClass: 'swiper-slide-duplicate', 4951 slideNextClass: 'swiper-slide-next', 4952 slideDuplicateNextClass: 'swiper-slide-duplicate-next', 4953 slidePrevClass: 'swiper-slide-prev', 4954 slideDuplicatePrevClass: 'swiper-slide-duplicate-prev', 4955 wrapperClass: 'swiper-wrapper', 4956 // Callbacks 4957 runCallbacksOnInit: true, 4958 // Internals 4959 _emitClasses: false 4960 }; 4961 4962 function moduleExtendParams(params, allModulesParams) { 4963 return function extendParams(obj) { 4964 if (obj === void 0) { 4965 obj = {}; 4966 } 4967 4968 const moduleParamName = Object.keys(obj)[0]; 4969 const moduleParams = obj[moduleParamName]; 4970 4971 if (typeof moduleParams !== 'object' || moduleParams === null) { 4972 extend(allModulesParams, obj); 4973 return; 4974 } 4975 4976 if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) { 4977 params[moduleParamName] = { 4978 auto: true 4979 }; 4980 } 4981 4982 if (!(moduleParamName in params && 'enabled' in moduleParams)) { 4983 extend(allModulesParams, obj); 4984 return; 4985 } 4986 4987 if (params[moduleParamName] === true) { 4988 params[moduleParamName] = { 4989 enabled: true 4990 }; 4991 } 4992 4993 if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) { 4994 params[moduleParamName].enabled = true; 4995 } 4996 4997 if (!params[moduleParamName]) params[moduleParamName] = { 4998 enabled: false 4999 }; 5000 extend(allModulesParams, obj); 5001 }; 5002 } 5003 5004 /* eslint no-param-reassign: "off" */ 5005 const prototypes = { 5006 eventsEmitter, 5007 update, 5008 translate, 5009 transition, 5010 slide, 5011 loop, 5012 grabCursor, 5013 events: events$1, 5014 breakpoints, 5015 checkOverflow: checkOverflow$1, 5016 classes, 5017 images 5018 }; 5019 const extendedDefaults = {}; 5020 5021 class Swiper { 5022 constructor() { 5023 let el; 5024 let params; 5025 5026 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 5027 args[_key] = arguments[_key]; 5028 } 5029 5030 if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') { 5031 params = args[0]; 5032 } else { 5033 [el, params] = args; 5034 } 5035 5036 if (!params) params = {}; 5037 params = extend({}, params); 5038 if (el && !params.el) params.el = el; 5039 5040 if (params.el && $(params.el).length > 1) { 5041 const swipers = []; 5042 $(params.el).each(containerEl => { 5043 const newParams = extend({}, params, { 5044 el: containerEl 5045 }); 5046 swipers.push(new Swiper(newParams)); 5047 }); 5048 return swipers; 5049 } // Swiper Instance 5050 5051 5052 const swiper = this; 5053 swiper.__swiper__ = true; 5054 swiper.support = getSupport(); 5055 swiper.device = getDevice({ 5056 userAgent: params.userAgent 5057 }); 5058 swiper.browser = getBrowser(); 5059 swiper.eventsListeners = {}; 5060 swiper.eventsAnyListeners = []; 5061 swiper.modules = [...swiper.__modules__]; 5062 5063 if (params.modules && Array.isArray(params.modules)) { 5064 swiper.modules.push(...params.modules); 5065 } 5066 5067 const allModulesParams = {}; 5068 swiper.modules.forEach(mod => { 5069 mod({ 5070 swiper, 5071 extendParams: moduleExtendParams(params, allModulesParams), 5072 on: swiper.on.bind(swiper), 5073 once: swiper.once.bind(swiper), 5074 off: swiper.off.bind(swiper), 5075 emit: swiper.emit.bind(swiper) 5076 }); 5077 }); // Extend defaults with modules params 5078 5079 const swiperParams = extend({}, defaults, allModulesParams); // Extend defaults with passed params 5080 5081 swiper.params = extend({}, swiperParams, extendedDefaults, params); 5082 swiper.originalParams = extend({}, swiper.params); 5083 swiper.passedParams = extend({}, params); // add event listeners 5084 5085 if (swiper.params && swiper.params.on) { 5086 Object.keys(swiper.params.on).forEach(eventName => { 5087 swiper.on(eventName, swiper.params.on[eventName]); 5088 }); 5089 } 5090 5091 if (swiper.params && swiper.params.onAny) { 5092 swiper.onAny(swiper.params.onAny); 5093 } // Save Dom lib 5094 5095 5096 swiper.$ = $; // Extend Swiper 5097 5098 Object.assign(swiper, { 5099 enabled: swiper.params.enabled, 5100 el, 5101 // Classes 5102 classNames: [], 5103 // Slides 5104 slides: $(), 5105 slidesGrid: [], 5106 snapGrid: [], 5107 slidesSizesGrid: [], 5108 5109 // isDirection 5110 isHorizontal() { 5111 return swiper.params.direction === 'horizontal'; 5112 }, 5113 5114 isVertical() { 5115 return swiper.params.direction === 'vertical'; 5116 }, 5117 5118 // Indexes 5119 activeIndex: 0, 5120 realIndex: 0, 5121 // 5122 isBeginning: true, 5123 isEnd: false, 5124 // Props 5125 translate: 0, 5126 previousTranslate: 0, 5127 progress: 0, 5128 velocity: 0, 5129 animating: false, 5130 // Locks 5131 allowSlideNext: swiper.params.allowSlideNext, 5132 allowSlidePrev: swiper.params.allowSlidePrev, 5133 // Touch Events 5134 touchEvents: function touchEvents() { 5135 const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel']; 5136 const desktop = ['pointerdown', 'pointermove', 'pointerup']; 5137 swiper.touchEventsTouch = { 5138 start: touch[0], 5139 move: touch[1], 5140 end: touch[2], 5141 cancel: touch[3] 5142 }; 5143 swiper.touchEventsDesktop = { 5144 start: desktop[0], 5145 move: desktop[1], 5146 end: desktop[2] 5147 }; 5148 return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop; 5149 }(), 5150 touchEventsData: { 5151 isTouched: undefined, 5152 isMoved: undefined, 5153 allowTouchCallbacks: undefined, 5154 touchStartTime: undefined, 5155 isScrolling: undefined, 5156 currentTranslate: undefined, 5157 startTranslate: undefined, 5158 allowThresholdMove: undefined, 5159 // Form elements to match 5160 focusableElements: swiper.params.focusableElements, 5161 // Last click time 5162 lastClickTime: now(), 5163 clickTimeout: undefined, 5164 // Velocities 5165 velocities: [], 5166 allowMomentumBounce: undefined, 5167 isTouchEvent: undefined, 5168 startMoving: undefined 5169 }, 5170 // Clicks 5171 allowClick: true, 5172 // Touches 5173 allowTouchMove: swiper.params.allowTouchMove, 5174 touches: { 5175 startX: 0, 5176 startY: 0, 5177 currentX: 0, 5178 currentY: 0, 5179 diff: 0 5180 }, 5181 // Images 5182 imagesToLoad: [], 5183 imagesLoaded: 0 5184 }); 5185 swiper.emit('_swiper'); // Init 5186 5187 if (swiper.params.init) { 5188 swiper.init(); 5189 } // Return app instance 5190 5191 5192 return swiper; 5193 } 5194 5195 enable() { 5196 const swiper = this; 5197 if (swiper.enabled) return; 5198 swiper.enabled = true; 5199 5200 if (swiper.params.grabCursor) { 5201 swiper.setGrabCursor(); 5202 } 5203 5204 swiper.emit('enable'); 5205 } 5206 5207 disable() { 5208 const swiper = this; 5209 if (!swiper.enabled) return; 5210 swiper.enabled = false; 5211 5212 if (swiper.params.grabCursor) { 5213 swiper.unsetGrabCursor(); 5214 } 5215 5216 swiper.emit('disable'); 5217 } 5218 5219 setProgress(progress, speed) { 5220 const swiper = this; 5221 progress = Math.min(Math.max(progress, 0), 1); 5222 const min = swiper.minTranslate(); 5223 const max = swiper.maxTranslate(); 5224 const current = (max - min) * progress + min; 5225 swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed); 5226 swiper.updateActiveIndex(); 5227 swiper.updateSlidesClasses(); 5228 } 5229 5230 emitContainerClasses() { 5231 const swiper = this; 5232 if (!swiper.params._emitClasses || !swiper.el) return; 5233 const cls = swiper.el.className.split(' ').filter(className => { 5234 return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0; 5235 }); 5236 swiper.emit('_containerClasses', cls.join(' ')); 5237 } 5238 5239 getSlideClasses(slideEl) { 5240 const swiper = this; 5241 if (swiper.destroyed) return ''; 5242 return slideEl.className.split(' ').filter(className => { 5243 return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0; 5244 }).join(' '); 5245 } 5246 5247 emitSlidesClasses() { 5248 const swiper = this; 5249 if (!swiper.params._emitClasses || !swiper.el) return; 5250 const updates = []; 5251 swiper.slides.each(slideEl => { 5252 const classNames = swiper.getSlideClasses(slideEl); 5253 updates.push({ 5254 slideEl, 5255 classNames 5256 }); 5257 swiper.emit('_slideClass', slideEl, classNames); 5258 }); 5259 swiper.emit('_slideClasses', updates); 5260 } 5261 5262 slidesPerViewDynamic(view, exact) { 5263 if (view === void 0) { 5264 view = 'current'; 5265 } 5266 5267 if (exact === void 0) { 5268 exact = false; 5269 } 5270 5271 const swiper = this; 5272 const { 5273 params, 5274 slides, 5275 slidesGrid, 5276 slidesSizesGrid, 5277 size: swiperSize, 5278 activeIndex 5279 } = swiper; 5280 let spv = 1; 5281 5282 if (params.centeredSlides) { 5283 let slideSize = slides[activeIndex].swiperSlideSize; 5284 let breakLoop; 5285 5286 for (let i = activeIndex + 1; i < slides.length; i += 1) { 5287 if (slides[i] && !breakLoop) { 5288 slideSize += slides[i].swiperSlideSize; 5289 spv += 1; 5290 if (slideSize > swiperSize) breakLoop = true; 5291 } 5292 } 5293 5294 for (let i = activeIndex - 1; i >= 0; i -= 1) { 5295 if (slides[i] && !breakLoop) { 5296 slideSize += slides[i].swiperSlideSize; 5297 spv += 1; 5298 if (slideSize > swiperSize) breakLoop = true; 5299 } 5300 } 5301 } else { 5302 // eslint-disable-next-line 5303 if (view === 'current') { 5304 for (let i = activeIndex + 1; i < slides.length; i += 1) { 5305 const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize; 5306 5307 if (slideInView) { 5308 spv += 1; 5309 } 5310 } 5311 } else { 5312 // previous 5313 for (let i = activeIndex - 1; i >= 0; i -= 1) { 5314 const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize; 5315 5316 if (slideInView) { 5317 spv += 1; 5318 } 5319 } 5320 } 5321 } 5322 5323 return spv; 5324 } 5325 5326 update() { 5327 const swiper = this; 5328 if (!swiper || swiper.destroyed) return; 5329 const { 5330 snapGrid, 5331 params 5332 } = swiper; // Breakpoints 5333 5334 if (params.breakpoints) { 5335 swiper.setBreakpoint(); 5336 } 5337 5338 swiper.updateSize(); 5339 swiper.updateSlides(); 5340 swiper.updateProgress(); 5341 swiper.updateSlidesClasses(); 5342 5343 function setTranslate() { 5344 const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate; 5345 const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate()); 5346 swiper.setTranslate(newTranslate); 5347 swiper.updateActiveIndex(); 5348 swiper.updateSlidesClasses(); 5349 } 5350 5351 let translated; 5352 5353 if (swiper.params.freeMode && swiper.params.freeMode.enabled) { 5354 setTranslate(); 5355 5356 if (swiper.params.autoHeight) { 5357 swiper.updateAutoHeight(); 5358 } 5359 } else { 5360 if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) { 5361 translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true); 5362 } else { 5363 translated = swiper.slideTo(swiper.activeIndex, 0, false, true); 5364 } 5365 5366 if (!translated) { 5367 setTranslate(); 5368 } 5369 } 5370 5371 if (params.watchOverflow && snapGrid !== swiper.snapGrid) { 5372 swiper.checkOverflow(); 5373 } 5374 5375 swiper.emit('update'); 5376 } 5377 5378 changeDirection(newDirection, needUpdate) { 5379 if (needUpdate === void 0) { 5380 needUpdate = true; 5381 } 5382 5383 const swiper = this; 5384 const currentDirection = swiper.params.direction; 5385 5386 if (!newDirection) { 5387 // eslint-disable-next-line 5388 newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal'; 5389 } 5390 5391 if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') { 5392 return swiper; 5393 } 5394 5395 swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`); 5396 swiper.emitContainerClasses(); 5397 swiper.params.direction = newDirection; 5398 swiper.slides.each(slideEl => { 5399 if (newDirection === 'vertical') { 5400 slideEl.style.width = ''; 5401 } else { 5402 slideEl.style.height = ''; 5403 } 5404 }); 5405 swiper.emit('changeDirection');
5406 if (needUpdate) swiper.update(); 5407 return swiper; 5408 } 5409 5410 changeLanguageDirection(direction) { 5411 const swiper = this; 5412 if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return; 5413 swiper.rtl = direction === 'rtl'; 5414 swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl; 5415 5416 if (swiper.rtl) { 5417 swiper.$el.addClass(`${swiper.params.containerModifierClass}rtl`); 5418 swiper.el.dir = 'rtl'; 5419 } else { 5420 swiper.$el.removeClass(`${swiper.params.containerModifierClass}rtl`); 5421 swiper.el.dir = 'ltr'; 5422 } 5423 5424 swiper.update(); 5425 } 5426 5427 mount(el) { 5428 const swiper = this; 5429 if (swiper.mounted) return true; // Find el 5430 5431 const $el = $(el || swiper.params.el); 5432 el = $el[0]; 5433 5434 if (!el) { 5435 return false; 5436 } 5437 5438 el.swiper = swiper; 5439 5440 const getWrapperSelector = () => { 5441 return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`; 5442 }; 5443 5444 const getWrapper = () => { 5445 if (el && el.shadowRoot && el.shadowRoot.querySelector) { 5446 const res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items 5447 5448 res.children = options => $el.children(options); 5449 5450 return res; 5451 } 5452 5453 if (!$el.children) { 5454 return $($el).children(getWrapperSelector()); 5455 } 5456 5457 return $el.children(getWrapperSelector()); 5458 }; // Find Wrapper 5459 5460 5461 let $wrapperEl = getWrapper(); 5462 5463 if ($wrapperEl.length === 0 && swiper.params.createElements) { 5464 const document = getDocument(); 5465 const wrapper = document.createElement('div'); 5466 $wrapperEl = $(wrapper); 5467 wrapper.className = swiper.params.wrapperClass; 5468 $el.append(wrapper); 5469 $el.children(`.${swiper.params.slideClass}`).each(slideEl => { 5470 $wrapperEl.append(slideEl); 5471 }); 5472 } 5473 5474 Object.assign(swiper, { 5475 $el, 5476 el, 5477 $wrapperEl, 5478 wrapperEl: $wrapperEl[0], 5479 mounted: true, 5480 // RTL 5481 rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl', 5482 rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'), 5483 wrongRTL: $wrapperEl.css('display') === '-webkit-box' 5484 }); 5485 return true; 5486 } 5487 5488 init(el) { 5489 const swiper = this; 5490 if (swiper.initialized) return swiper; 5491 const mounted = swiper.mount(el); 5492 if (mounted === false) return swiper; 5493 swiper.emit('beforeInit'); // Set breakpoint 5494 5495 if (swiper.params.breakpoints) { 5496 swiper.setBreakpoint(); 5497 } // Add Classes 5498 5499 5500 swiper.addClasses(); // Create loop 5501 5502 if (swiper.params.loop) { 5503 swiper.loopCreate(); 5504 } // Update size 5505 5506 5507 swiper.updateSize(); // Update slides 5508 5509 swiper.updateSlides(); 5510 5511 if (swiper.params.watchOverflow) { 5512 swiper.checkOverflow(); 5513 } // Set Grab Cursor 5514 5515 5516 if (swiper.params.grabCursor && swiper.enabled) { 5517 swiper.setGrabCursor(); 5518 } 5519 5520 if (swiper.params.preloadImages) { 5521 swiper.preloadImages(); 5522 } // Slide To Initial Slide 5523 5524 5525 if (swiper.params.loop) { 5526 swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true); 5527 } else { 5528 swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true); 5529 } // Attach events 5530 5531 5532 swiper.attachEvents(); // Init Flag 5533 5534 swiper.initialized = true; // Emit 5535 5536 swiper.emit('init'); 5537 swiper.emit('afterInit'); 5538 return swiper; 5539 } 5540 5541 destroy(deleteInstance, cleanStyles) { 5542 if (deleteInstance === void 0) { 5543 deleteInstance = true; 5544 } 5545 5546 if (cleanStyles === void 0) { 5547 cleanStyles = true; 5548 } 5549 5550 const swiper = this; 5551 const { 5552 params, 5553 $el, 5554 $wrapperEl, 5555 slides 5556 } = swiper; 5557 5558 if (typeof swiper.params === 'undefined' || swiper.destroyed) { 5559 return null; 5560 } 5561 5562 swiper.emit('beforeDestroy'); // Init Flag 5563 5564 swiper.initialized = false; // Detach events 5565 5566 swiper.detachEvents(); // Destroy loop 5567 5568 if (params.loop) { 5569 swiper.loopDestroy(); 5570 } // Cleanup styles 5571 5572 5573 if (cleanStyles) { 5574 swiper.removeClasses(); 5575 $el.removeAttr('style'); 5576 $wrapperEl.removeAttr('style'); 5577 5578 if (slides && slides.length) { 5579 slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index'); 5580 } 5581 } 5582 5583 swiper.emit('destroy'); // Detach emitter events 5584
5585 Object.keys(swiper.eventsListeners).forEach(eventName => { 5586 swiper.off(eventName); 5587 }); 5588 5589 if (deleteInstance !== false) { 5590 swiper.$el[0].swiper = null; 5591 deleteProps(swiper); 5592 } 5593 5594 swiper.destroyed = true; 5595 return null; 5596 } 5597 5598 static extendDefaults(newDefaults) { 5599 extend(extendedDefaults, newDefaults); 5600 } 5601 5602 static get extendedDefaults() { 5603 return extendedDefaults; 5604 } 5605 5606 static get defaults() { 5607 return defaults; 5608 } 5609 5610 static installModule(mod) { 5611 if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = []; 5612 const modules = Swiper.prototype.__modules__; 5613 5614 if (typeof mod === 'function' && modules.indexOf(mod) < 0) { 5615 modules.push(mod); 5616 } 5617 } 5618 5619 static use(module) { 5620 if (Array.isArray(module)) { 5621 module.forEach(m => Swiper.installModule(m)); 5622 return Swiper; 5623 } 5624 5625 Swiper.installModule(module); 5626 return Swiper; 5627 } 5628 5629 } 5630 5631 Object.keys(prototypes).forEach(prototypeGroup => { 5632 Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => { 5633 Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod]; 5634 }); 5635 }); 5636 Swiper.use([Resize, Observer]); 5637 5638 function Virtual(_ref) { 5639 let { 5640 swiper, 5641 extendParams, 5642 on, 5643 emit 5644 } = _ref; 5645 extendParams({ 5646 virtual: { 5647 enabled: false, 5648 slides: [], 5649 cache: true, 5650 renderSlide: null, 5651 renderExternal: null, 5652 renderExternalUpdate: true, 5653 addSlidesBefore: 0, 5654 addSlidesAfter: 0 5655 } 5656 }); 5657 let cssModeTimeout; 5658 swiper.virtual = { 5659 cache: {}, 5660 from: undefined, 5661 to: undefined, 5662 slides: [], 5663 offset: 0, 5664 slidesGrid: [] 5665 }; 5666
5667 function renderSlide(slide, index) { 5668 const params = swiper.params.virtual; 5669 5670 if (params.cache && swiper.virtual.cache[index]) { 5671 return swiper.virtual.cache[index]; 5672 } 5673 5674 const $slideEl = params.renderSlide ? $(params.renderSlide.call(swiper, slide, index)) : $(`<div class="${swiper.params.slideClass}" data-swiper-slide-index="${index}">${slide}</div>`); 5675 if (!$slideEl.attr('data-swiper-slide-index')) $slideEl.attr('data-swiper-slide-index', index); 5676 if (params.cache) swiper.virtual.cache[index] = $slideEl; 5677 return $slideEl; 5678 } 5679 5680 function update(force) { 5681 const { 5682 slidesPerView, 5683 slidesPerGroup, 5684 centeredSlides 5685 } = swiper.params; 5686 const { 5687 addSlidesBefore, 5688 addSlidesAfter 5689 } = swiper.params.virtual; 5690 const { 5691 from: previousFrom, 5692 to: previousTo, 5693 slides, 5694 slidesGrid: previousSlidesGrid, 5695 offset: previousOffset 5696 } = swiper.virtual; 5697 5698 if (!swiper.params.cssMode) { 5699 swiper.updateActiveIndex(); 5700 } 5701 5702 const activeIndex = swiper.activeIndex || 0; 5703 let offsetProp; 5704 if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top'; 5705 let slidesAfter; 5706 let slidesBefore; 5707 5708 if (centeredSlides) { 5709 slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter; 5710 slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore; 5711 } else { 5712 slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter; 5713 slidesBefore = slidesPerGroup + addSlidesBefore; 5714 } 5715 5716 const from = Math.max((activeIndex || 0) - slidesBefore, 0); 5717 const to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1); 5718 const offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0); 5719 Object.assign(swiper.virtual, { 5720 from, 5721 to, 5722 offset, 5723 slidesGrid: swiper.slidesGrid 5724 }); 5725 5726 function onRendered() { 5727 swiper.updateSlides(); 5728 swiper.updateProgress(); 5729 swiper.updateSlidesClasses(); 5730 5731 if (swiper.lazy && swiper.params.lazy.enabled) { 5732 swiper.lazy.load(); 5733 } 5734 5735 emit('virtualUpdate'); 5736 } 5737 5738 if (previousFrom === from && previousTo === to && !force) { 5739 if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) { 5740 swiper.slides.css(offsetProp, `${offset}px`); 5741 } 5742 5743 swiper.updateProgress(); 5744 emit('virtualUpdate'); 5745 return; 5746 } 5747 5748 if (swiper.params.virtual.renderExternal) { 5749 swiper.params.virtual.renderExternal.call(swiper, { 5750 offset, 5751 from, 5752 to, 5753 slides: function getSlides() { 5754 const slidesToRender = []; 5755 5756 for (let i = from; i <= to; i += 1) { 5757 slidesToRender.push(slides[i]); 5758 } 5759 5760 return slidesToRender; 5761 }() 5762 }); 5763 5764 if (swiper.params.virtual.renderExternalUpdate) { 5765 onRendered(); 5766 } else { 5767 emit('virtualUpdate'); 5768 } 5769 5770 return; 5771 } 5772 5773 const prependIndexes = []; 5774 const appendIndexes = []; 5775 5776 if (force) { 5777 swiper.$wrapperEl.find(`.${swiper.params.slideClass}`).remove(); 5778 } else { 5779 for (let i = previousFrom; i <= previousTo; i += 1) { 5780 if (i < from || i > to) { 5781 swiper.$wrapperEl.find(`.${swiper.params.slideClass}[data-swiper-slide-index="${i}"]`).remove(); 5782 } 5783 } 5784 } 5785 5786 for (let i = 0; i < slides.length; i += 1) { 5787 if (i >= from && i <= to) { 5788 if (typeof previousTo === 'undefined' || force) { 5789 appendIndexes.push(i); 5790 } else { 5791 if (i > previousTo) appendIndexes.push(i);
5792 if (i < previousFrom) prependIndexes.push(i); 5793 } 5794 } 5795 } 5796 5797 appendIndexes.forEach(index => { 5798 swiper.$wrapperEl.append(renderSlide(slides[index], index)); 5799 }); 5800 prependIndexes.sort((a, b) => b - a).forEach(index => { 5801 swiper.$wrapperEl.prepend(renderSlide(slides[index], index)); 5802 }); 5803 swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, `${offset}px`); 5804 onRendered(); 5805 } 5806 5807 function appendSlide(slides) { 5808 if (typeof slides === 'object' && 'length' in slides) { 5809 for (let i = 0; i < slides.length; i += 1) { 5810 if (slides[i]) swiper.virtual.slides.push(slides[i]); 5811 } 5812 } else { 5813 swiper.virtual.slides.push(slides); 5814 } 5815 5816 update(true); 5817 } 5818 5819 function prependSlide(slides) { 5820 const activeIndex = swiper.activeIndex; 5821 let newActiveIndex = activeIndex + 1; 5822 let numberOfNewSlides = 1; 5823 5824 if (Array.isArray(slides)) { 5825 for (let i = 0; i < slides.length; i += 1) { 5826 if (slides[i]) swiper.virtual.slides.unshift(slides[i]); 5827 } 5828 5829 newActiveIndex = activeIndex + slides.length; 5830 numberOfNewSlides = slides.length; 5831 } else { 5832 swiper.virtual.slides.unshift(slides); 5833 } 5834 5835 if (swiper.params.virtual.cache) { 5836 const cache = swiper.virtual.cache; 5837 const newCache = {}; 5838 Object.keys(cache).forEach(cachedIndex => { 5839 const $cachedEl = cache[cachedIndex]; 5840 const cachedElIndex = $cachedEl.attr('data-swiper-slide-index'); 5841 5842 if (cachedElIndex) { 5843 $cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides); 5844 } 5845 5846 newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl; 5847 }); 5848 swiper.virtual.cache = newCache; 5849 } 5850 5851 update(true); 5852 swiper.slideTo(newActiveIndex, 0); 5853 } 5854 5855 function removeSlide(slidesIndexes) { 5856 if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return; 5857 let activeIndex = swiper.activeIndex; 5858 5859 if (Array.isArray(slidesIndexes)) { 5860 for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) { 5861 swiper.virtual.slides.splice(slidesIndexes[i], 1); 5862 5863 if (swiper.params.virtual.cache) { 5864 delete swiper.virtual.cache[slidesIndexes[i]]; 5865 } 5866 5867 if (slidesIndexes[i] < activeIndex) activeIndex -= 1; 5868 activeIndex = Math.max(activeIndex, 0); 5869 } 5870 } else { 5871 swiper.virtual.slides.splice(slidesIndexes, 1); 5872 5873 if (swiper.params.virtual.cache) { 5874 delete swiper.virtual.cache[slidesIndexes]; 5875 } 5876 5877 if (slidesIndexes < activeIndex) activeIndex -= 1; 5878 activeIndex = Math.max(activeIndex, 0); 5879 } 5880 5881 update(true); 5882 swiper.slideTo(activeIndex, 0); 5883 } 5884 5885 function removeAllSlides() { 5886 swiper.virtual.slides = []; 5887 5888 if (swiper.params.virtual.cache) { 5889 swiper.virtual.cache = {}; 5890 } 5891 5892 update(true); 5893 swiper.slideTo(0, 0); 5894 } 5895 5896 on('beforeInit', () => { 5897 if (!swiper.params.virtual.enabled) return; 5898 swiper.virtual.slides = swiper.params.virtual.slides; 5899 swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`); 5900 swiper.params.watchSlidesProgress = true; 5901 swiper.originalParams.watchSlidesProgress = true; 5902 5903 if (!swiper.params.initialSlide) { 5904 update(); 5905 } 5906 }); 5907 on('setTranslate', () => { 5908 if (!swiper.params.virtual.enabled) return; 5909 5910 if (swiper.params.cssMode && !swiper._immediateVirtual) { 5911 clearTimeout(cssModeTimeout); 5912 cssModeTimeout = setTimeout(() => { 5913 update(); 5914 }, 100); 5915 } else { 5916 update(); 5917 } 5918 }); 5919 on('init update resize', () => { 5920 if (!swiper.params.virtual.enabled) return; 5921 5922 if (swiper.params.cssMode) { 5923 setCSSProperty(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`); 5924 } 5925 }); 5926 Object.assign(swiper.virtual, { 5927 appendSlide, 5928 prependSlide, 5929 removeSlide, 5930 removeAllSlides, 5931 update 5932 }); 5933 } 5934 5935 /* eslint-disable consistent-return */ 5936 function Keyboard(_ref) { 5937 let { 5938 swiper, 5939 extendParams, 5940 on, 5941 emit 5942 } = _ref; 5943 const document = getDocument(); 5944 const window = getWindow(); 5945 swiper.keyboard = { 5946 enabled: false 5947 }; 5948 extendParams({ 5949 keyboard: { 5950 enabled: false, 5951 onlyInViewport: true, 5952 pageUpDown: true 5953 } 5954 }); 5955 5956 function handle(event) { 5957 if (!swiper.enabled) return; 5958 const { 5959 rtlTranslate: rtl 5960 } = swiper; 5961 let e = event; 5962 if (e.originalEvent) e = e.originalEvent; // jquery fix 5963
vendor: 4,245 bytes, lines 5964-6079
5964 const kc = e.keyCode || e.charCode; 5965 const pageUpDown = swiper.params.keyboard.pageUpDown; 5966 const isPageUp = pageUpDown && kc === 33; 5967 const isPageDown = pageUpDown && kc === 34; 5968 const isArrowLeft = kc === 37; 5969 const isArrowRight = kc === 39; 5970 const isArrowUp = kc === 38; 5971 const isArrowDown = kc === 40; // Directions locks 5972 5973 if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { 5974 return false; 5975 } 5976 5977 if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { 5978 return false; 5979 } 5980 5981 if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { 5982 return undefined; 5983 } 5984 5985 if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { 5986 return undefined; 5987 } 5988 5989 if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { 5990 let inView = false; // Check that swiper should be inside of visible area of window 5991 5992 if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) { 5993 return undefined; 5994 } 5995 5996 const $el = swiper.$el; 5997 const swiperWidth = $el[0].clientWidth; 5998 const swiperHeight = $el[0].clientHeight; 5999 const windowWidth = window.innerWidth; 6000 const windowHeight = window.innerHeight; 6001 const swiperOffset = swiper.$el.offset(); 6002 if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; 6003 const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; 6004 6005 for (let i = 0; i < swiperCoord.length; i += 1) { 6006 const point = swiperCoord[i]; 6007 6008 if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { 6009 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 6010 6011 inView = true; 6012 } 6013 } 6014 6015 if (!inView) return undefined; 6016 } 6017 6018 if (swiper.isHorizontal()) { 6019 if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { 6020 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 6021 } 6022 6023 if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); 6024 if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); 6025 } else { 6026 if (isPageUp || isPageDown || isArrowUp || isArrowDown) { 6027 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 6028 } 6029 6030 if (isPageDown || isArrowDown) swiper.slideNext(); 6031 if (isPageUp || isArrowUp) swiper.slidePrev(); 6032 } 6033 6034 emit('keyPress', kc); 6035 return undefined; 6036 } 6037 6038 function enable() { 6039 if (swiper.keyboard.enabled) return; 6040 $(document).on('keydown', handle); 6041 swiper.keyboard.enabled = true; 6042 } 6043 6044 function disable() { 6045 if (!swiper.keyboard.enabled) return; 6046 $(document).off('keydown', handle); 6047 swiper.keyboard.enabled = false; 6048 } 6049 6050 on('init', () => { 6051 if (swiper.params.keyboard.enabled) { 6052 enable(); 6053 } 6054 }); 6055 on('destroy', () => { 6056 if (swiper.keyboard.enabled) { 6057 disable(); 6058 } 6059 }); 6060 Object.assign(swiper.keyboard, { 6061 enable, 6062 disable 6063 }); 6064 } 6065 6066 /* eslint-disable consistent-return */ 6067 function Mousewheel(_ref) { 6068 let { 6069 swiper, 6070 extendParams, 6071 on, 6072 emit 6073 } = _ref; 6074 const window = getWindow(); 6075 extendParams({ 6076 mousewheel: { 6077 enabled: false, 6078 releaseOnEdges: false, 6079 invert: false,
vendor: 14,262 bytes, lines 6080-6449
6080 forceToAxis: false, 6081 sensitivity: 1, 6082 eventsTarget: 'container', 6083 thresholdDelta: null, 6084 thresholdTime: null 6085 } 6086 }); 6087 swiper.mousewheel = { 6088 enabled: false 6089 }; 6090 let timeout; 6091 let lastScrollTime = now(); 6092 let lastEventBeforeSnap; 6093 const recentWheelEvents = []; 6094 6095 function normalize(e) { 6096 // Reasonable defaults 6097 const PIXEL_STEP = 10; 6098 const LINE_HEIGHT = 40; 6099 const PAGE_HEIGHT = 800; 6100 let sX = 0; 6101 let sY = 0; // spinX, spinY 6102 6103 let pX = 0; 6104 let pY = 0; // pixelX, pixelY 6105 // Legacy 6106 6107 if ('detail' in e) { 6108 sY = e.detail; 6109 } 6110 6111 if ('wheelDelta' in e) { 6112 sY = -e.wheelDelta / 120; 6113 } 6114 6115 if ('wheelDeltaY' in e) { 6116 sY = -e.wheelDeltaY / 120; 6117 } 6118 6119 if ('wheelDeltaX' in e) { 6120 sX = -e.wheelDeltaX / 120; 6121 } // side scrolling on FF with DOMMouseScroll 6122 6123 6124 if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { 6125 sX = sY; 6126 sY = 0; 6127 } 6128 6129 pX = sX * PIXEL_STEP; 6130 pY = sY * PIXEL_STEP; 6131 6132 if ('deltaY' in e) { 6133 pY = e.deltaY; 6134 } 6135 6136 if ('deltaX' in e) { 6137 pX = e.deltaX; 6138 } 6139 6140 if (e.shiftKey && !pX) { 6141 // if user scrolls with shift he wants horizontal scroll 6142 pX = pY; 6143 pY = 0; 6144 } 6145 6146 if ((pX || pY) && e.deltaMode) { 6147 if (e.deltaMode === 1) { 6148 // delta in LINE units 6149 pX *= LINE_HEIGHT; 6150 pY *= LINE_HEIGHT; 6151 } else { 6152 // delta in PAGE units 6153 pX *= PAGE_HEIGHT; 6154 pY *= PAGE_HEIGHT; 6155 } 6156 } // Fall-back if spin cannot be determined 6157 6158 6159 if (pX && !sX) { 6160 sX = pX < 1 ? -1 : 1; 6161 } 6162 6163 if (pY && !sY) { 6164 sY = pY < 1 ? -1 : 1; 6165 } 6166 6167 return { 6168 spinX: sX, 6169 spinY: sY, 6170 pixelX: pX, 6171 pixelY: pY 6172 }; 6173 } 6174 6175 function handleMouseEnter() { 6176 if (!swiper.enabled) return; 6177 swiper.mouseEntered = true; 6178 } 6179 6180 function handleMouseLeave() { 6181 if (!swiper.enabled) return; 6182 swiper.mouseEntered = false; 6183 } 6184 6185 function animateSlider(newEvent) { 6186 if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) { 6187 // Prevent if delta of wheel scroll delta is below configured threshold 6188 return false; 6189 } 6190 6191 if (swiper.params.mousewheel.thresholdTime && now() - lastScrollTime < swiper.params.mousewheel.thresholdTime) { 6192 // Prevent if time between scrolls is below configured threshold 6193 return false; 6194 } // If the movement is NOT big enough and 6195 // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider): 6196 // Don't go any further (avoid insignificant scroll movement). 6197 6198 6199 if (newEvent.delta >= 6 && now() - lastScrollTime < 60) { 6200 // Return false as a default 6201 return true; 6202 } // If user is scrolling towards the end: 6203 // If the slider hasn't hit the latest slide or 6204 // if the slider is a loop and 6205 // if the slider isn't moving right now: 6206 // Go to next slide and 6207 // emit a scroll event. 6208 // Else (the user is scrolling towards the beginning) and 6209 // if the slider hasn't hit the first slide or 6210 // if the slider is a loop and 6211 // if the slider isn't moving right now: 6212 // Go to prev slide and 6213 // emit a scroll event. 6214 6215 6216 if (newEvent.direction < 0) { 6217 if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) { 6218 swiper.slideNext(); 6219 emit('scroll', newEvent.raw); 6220 } 6221 } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) { 6222 swiper.slidePrev(); 6223 emit('scroll', newEvent.raw); 6224 } // If you got here is because an animation has been triggered so store the current time 6225 6226 6227 lastScrollTime = new window.Date().getTime(); // Return false as a default 6228 6229 return false; 6230 } 6231 6232 function releaseScroll(newEvent) { 6233 const params = swiper.params.mousewheel; 6234 6235 if (newEvent.direction < 0) { 6236 if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) { 6237 // Return true to animate scroll on edges 6238 return true; 6239 } 6240 } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) { 6241 // Return true to animate scroll on edges 6242 return true; 6243 } 6244 6245 return false; 6246 } 6247 6248 function handle(event) { 6249 let e = event; 6250 let disableParentSwiper = true; 6251 if (!swiper.enabled) return; 6252 const params = swiper.params.mousewheel; 6253 6254 if (swiper.params.cssMode) { 6255 e.preventDefault(); 6256 } 6257 6258 let target = swiper.$el; 6259 6260 if (swiper.params.mousewheel.eventsTarget !== 'container') { 6261 target = $(swiper.params.mousewheel.eventsTarget); 6262 } 6263 6264 if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true; 6265 if (e.originalEvent) e = e.originalEvent; // jquery fix 6266 6267 let delta = 0; 6268 const rtlFactor = swiper.rtlTranslate ? -1 : 1; 6269 const data = normalize(e); 6270 6271 if (params.forceToAxis) { 6272 if (swiper.isHorizontal()) { 6273 if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true; 6274 } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true; 6275 } else { 6276 delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY; 6277 } 6278 6279 if (delta === 0) return true; 6280 if (params.invert) delta = -delta; // Get the scroll positions 6281 6282 let positions = swiper.getTranslate() + delta * params.sensitivity; 6283 if (positions >= swiper.minTranslate()) positions = swiper.minTranslate(); 6284 if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); // When loop is true: 6285 // the disableParentSwiper will be true. 6286 // When loop is false: 6287 // if the scroll positions is not on edge, 6288 // then the disableParentSwiper will be true. 6289 // if the scroll on edge positions, 6290 // then the disableParentSwiper will be false. 6291 6292 disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate()); 6293 if (disableParentSwiper && swiper.params.nested) e.stopPropagation(); 6294 6295 if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) { 6296 // Register the new event in a variable which stores the relevant data 6297 const newEvent = { 6298 time: now(), 6299 delta: Math.abs(delta), 6300 direction: Math.sign(delta), 6301 raw: event 6302 }; // Keep the most recent events 6303 6304 if (recentWheelEvents.length >= 2) { 6305 recentWheelEvents.shift(); // only store the last N events 6306 } 6307 6308 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 6309 recentWheelEvents.push(newEvent); // If there is at least one previous recorded event: 6310 // If direction has changed or 6311 // if the scroll is quicker than the previous one: 6312 // Animate the slider. 6313 // Else (this is the first time the wheel is moved): 6314 // Animate the slider. 6315 6316 if (prevEvent) { 6317 if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) { 6318 animateSlider(newEvent); 6319 } 6320 } else { 6321 animateSlider(newEvent); 6322 } // If it's time to release the scroll: 6323 // Return now so you don't hit the preventDefault. 6324 6325 6326 if (releaseScroll(newEvent)) { 6327 return true; 6328 } 6329 } else { 6330 // Freemode or scrollContainer: 6331 // If we recently snapped after a momentum scroll, then ignore wheel events 6332 // to give time for the deceleration to finish. Stop ignoring after 500 msecs 6333 // or if it's a new scroll (larger delta or inverse sign as last event before 6334 // an end-of-momentum snap). 6335 const newEvent = { 6336 time: now(), 6337 delta: Math.abs(delta), 6338 direction: Math.sign(delta) 6339 }; 6340 const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction; 6341 6342 if (!ignoreWheelEvents) { 6343 lastEventBeforeSnap = undefined; 6344 6345 if (swiper.params.loop) { 6346 swiper.loopFix(); 6347 } 6348 6349 let position = swiper.getTranslate() + delta * params.sensitivity; 6350 const wasBeginning = swiper.isBeginning; 6351 const wasEnd = swiper.isEnd; 6352 if (position >= swiper.minTranslate()) position = swiper.minTranslate(); 6353 if (position <= swiper.maxTranslate()) position = swiper.maxTranslate(); 6354 swiper.setTransition(0); 6355 swiper.setTranslate(position); 6356 swiper.updateProgress(); 6357 swiper.updateActiveIndex(); 6358 swiper.updateSlidesClasses(); 6359 6360 if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) { 6361 swiper.updateSlidesClasses(); 6362 } 6363 6364 if (swiper.params.freeMode.sticky) { 6365 // When wheel scrolling starts with sticky (aka snap) enabled, then detect 6366 // the end of a momentum scroll by storing recent (N=15?) wheel events. 6367 // 1. do all N events have decreasing or same (absolute value) delta? 6368 // 2. did all N events arrive in the last M (M=500?) msecs? 6369 // 3. does the earliest event have an (absolute value) delta that's 6370 // at least P (P=1?) larger than the most recent event's delta? 6371 // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels? 6372 // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration. 6373 // Snap immediately and ignore remaining wheel events in this scroll. 6374 // See comment above for "remaining wheel events in this scroll" determination. 6375 // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event. 6376 clearTimeout(timeout); 6377 timeout = undefined; 6378 6379 if (recentWheelEvents.length >= 15) { 6380 recentWheelEvents.shift(); // only store the last N events 6381 } 6382 6383 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 6384 const firstEvent = recentWheelEvents[0]; 6385 recentWheelEvents.push(newEvent); 6386 6387 if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) { 6388 // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log. 6389 recentWheelEvents.splice(0); 6390 } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) { 6391 // We're at the end of the deceleration of a momentum scroll, so there's no need 6392 // to wait for more events. Snap ASAP on the next tick. 6393 // Also, because there's some remaining momentum we'll bias the snap in the 6394 // direction of the ongoing scroll because it's better UX for the scroll to snap 6395 // in the same direction as the scroll instead of reversing to snap. Therefore, 6396 // if it's already scrolled more than 20% in the current direction, keep going. 6397 const snapToThreshold = delta > 0 ? 0.8 : 0.2; 6398 lastEventBeforeSnap = newEvent; 6399 recentWheelEvents.splice(0); 6400 timeout = nextTick(() => { 6401 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 6402 }, 0); // no delay; move on next tick 6403 } 6404 6405 if (!timeout) { 6406 // if we get here, then we haven't detected the end of a momentum scroll, so 6407 // we'll consider a scroll "complete" when there haven't been any wheel events 6408 // for 500ms. 6409 timeout = nextTick(() => { 6410 const snapToThreshold = 0.5; 6411 lastEventBeforeSnap = newEvent; 6412 recentWheelEvents.splice(0); 6413 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 6414 }, 500); 6415 } 6416 } // Emit event 6417 6418 6419 if (!ignoreWheelEvents) emit('scroll', e); // Stop autoplay 6420 6421 if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); // Return page scroll on edge positions 6422 6423 if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true; 6424 } 6425 } 6426 6427 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 6428 return false; 6429 } 6430 6431 function events(method) { 6432 let target = swiper.$el; 6433 6434 if (swiper.params.mousewheel.eventsTarget !== 'container') { 6435 target = $(swiper.params.mousewheel.eventsTarget); 6436 } 6437 6438 target[method]('mouseenter', handleMouseEnter); 6439 target[method]('mouseleave', handleMouseLeave); 6440 target[method]('wheel', handle); 6441 } 6442 6443 function enable() { 6444 if (swiper.params.cssMode) { 6445 swiper.wrapperEl.removeEventListener('wheel', handle); 6446 return true; 6447 } 6448 6449 if (swiper.mousewheel.enabled) return false;
6450 events('on'); 6451 swiper.mousewheel.enabled = true; 6452 return true; 6453 } 6454 6455 function disable() { 6456 if (swiper.params.cssMode) { 6457 swiper.wrapperEl.addEventListener(event, handle); 6458 return true; 6459 } 6460 6461 if (!swiper.mousewheel.enabled) return false; 6462 events('off'); 6463 swiper.mousewheel.enabled = false; 6464 return true; 6465 } 6466 6467 on('init', () => { 6468 if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) { 6469 disable(); 6470 } 6471 6472 if (swiper.params.mousewheel.enabled) enable(); 6473 }); 6474 on('destroy', () => { 6475 if (swiper.params.cssMode) { 6476 enable(); 6477 } 6478 6479 if (swiper.mousewheel.enabled) disable(); 6480 }); 6481 Object.assign(swiper.mousewheel, { 6482 enable, 6483 disable 6484 }); 6485 } 6486 6487 function createElementIfNotDefined(swiper, originalParams, params, checkProps) { 6488 const document = getDocument(); 6489 6490 if (swiper.params.createElements) { 6491 Object.keys(checkProps).forEach(key => { 6492 if (!params[key] && params.auto === true) { 6493 let element = swiper.$el.children(`.${checkProps[key]}`)[0]; 6494 6495 if (!element) { 6496 element = document.createElement('div'); 6497 element.className = checkProps[key]; 6498 swiper.$el.append(element); 6499 } 6500 6501 params[key] = element; 6502 originalParams[key] = element; 6503 } 6504 }); 6505 } 6506 6507 return params; 6508 } 6509 6510 function Navigation(_ref) { 6511 let { 6512 swiper, 6513 extendParams, 6514 on, 6515 emit 6516 } = _ref; 6517 extendParams({ 6518 navigation: { 6519 nextEl: null, 6520 prevEl: null, 6521 hideOnClick: false, 6522 disabledClass: 'swiper-button-disabled', 6523 hiddenClass: 'swiper-button-hidden', 6524 lockClass: 'swiper-button-lock', 6525 navigationDisabledClass: 'swiper-navigation-disabled' 6526 } 6527 }); 6528 swiper.navigation = { 6529 nextEl: null, 6530 $nextEl: null, 6531 prevEl: null, 6532 $prevEl: null 6533 }; 6534 6535 function getEl(el) { 6536 let $el; 6537 6538 if (el) { 6539 $el = $(el); 6540 6541 if (swiper.params.uniqueNavElements && typeof el === 'string' && $el.length > 1 && swiper.$el.find(el).length === 1) { 6542 $el = swiper.$el.find(el); 6543 } 6544 } 6545 6546 return $el; 6547 } 6548 6549 function toggleEl($el, disabled) { 6550 const params = swiper.params.navigation; 6551 6552 if ($el && $el.length > 0) { 6553 $el[disabled ? 'addClass' : 'removeClass'](params.disabledClass); 6554 if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled; 6555 6556 if (swiper.params.watchOverflow && swiper.enabled) { 6557 $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); 6558 } 6559 } 6560 } 6561 6562 function update() { 6563 // Update Navigation Buttons 6564 if (swiper.params.loop) return; 6565 const { 6566 $nextEl, 6567 $prevEl 6568 } = swiper.navigation; 6569 toggleEl($prevEl, swiper.isBeginning && !swiper.params.rewind); 6570 toggleEl($nextEl, swiper.isEnd && !swiper.params.rewind); 6571 } 6572 6573 function onPrevClick(e) { 6574 e.preventDefault(); 6575 if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return; 6576 swiper.slidePrev(); 6577 emit('navigationPrev'); 6578 } 6579 6580 function onNextClick(e) { 6581 e.preventDefault(); 6582 if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return; 6583 swiper.slideNext(); 6584 emit('navigationNext'); 6585 } 6586 6587 function init() { 6588 const params = swiper.params.navigation; 6589 swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, { 6590 nextEl: 'swiper-button-next', 6591 prevEl: 'swiper-button-prev' 6592 }); 6593 if (!(params.nextEl || params.prevEl)) return; 6594 const $nextEl = getEl(params.nextEl); 6595 const $prevEl = getEl(params.prevEl); 6596 6597 if ($nextEl && $nextEl.length > 0) { 6598 $nextEl.on('click', onNextClick); 6599 } 6600 6601 if ($prevEl && $prevEl.length > 0) { 6602 $prevEl.on('click', onPrevClick); 6603 } 6604 6605 Object.assign(swiper.navigation, { 6606 $nextEl, 6607 nextEl: $nextEl && $nextEl[0], 6608 $prevEl, 6609 prevEl: $prevEl && $prevEl[0] 6610 }); 6611 6612 if (!swiper.enabled) { 6613 if ($nextEl) $nextEl.addClass(params.lockClass); 6614 if ($prevEl) $prevEl.addClass(params.lockClass); 6615 } 6616 } 6617 6618 function destroy() { 6619 const { 6620 $nextEl, 6621 $prevEl 6622 } = swiper.navigation; 6623 6624 if ($nextEl && $nextEl.length) { 6625 $nextEl.off('click', onNextClick); 6626 $nextEl.removeClass(swiper.params.navigation.disabledClass); 6627 } 6628 6629 if ($prevEl && $prevEl.length) { 6630 $prevEl.off('click', onPrevClick); 6631 $prevEl.removeClass(swiper.params.navigation.disabledClass); 6632 } 6633 } 6634 6635 on('init', () => { 6636 if (swiper.params.navigation.enabled === false) { 6637 // eslint-disable-next-line 6638 disable(); 6639 } else { 6640 init(); 6641 update(); 6642 } 6643 }); 6644 on('toEdge fromEdge lock unlock', () => { 6645 update(); 6646 }); 6647 on('destroy', () => { 6648 destroy(); 6649 }); 6650 on('enable disable', () => { 6651 const { 6652 $nextEl, 6653 $prevEl 6654 } = swiper.navigation; 6655 6656 if ($nextEl) { 6657 $nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); 6658 } 6659 6660 if ($prevEl) { 6661 $prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); 6662 } 6663 }); 6664 on('click', (_s, e) => { 6665 const { 6666 $nextEl, 6667 $prevEl 6668 } = swiper.navigation; 6669 const targetEl = e.target; 6670 6671 if (swiper.params.navigation.hideOnClick && !$(targetEl).is($prevEl) && !$(targetEl).is($nextEl)) { 6672 if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return; 6673 let isHidden; 6674 6675 if ($nextEl) { 6676 isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass); 6677 } else if ($prevEl) { 6678 isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass); 6679 } 6680 6681 if (isHidden === true) { 6682 emit('navigationShow'); 6683 } else { 6684 emit('navigationHide'); 6685 } 6686 6687 if ($nextEl) { 6688 $nextEl.toggleClass(swiper.params.navigation.hiddenClass); 6689 } 6690 6691 if ($prevEl) { 6692 $prevEl.toggleClass(swiper.params.navigation.hiddenClass); 6693 } 6694 } 6695 }); 6696 6697 const enable = () => { 6698 swiper.$el.removeClass(swiper.params.navigation.navigationDisabledClass); 6699 init(); 6700 update(); 6701 }; 6702 6703 const disable = () => { 6704 swiper.$el.addClass(swiper.params.navigation.navigationDisabledClass); 6705 destroy(); 6706 }; 6707 6708 Object.assign(swiper.navigation, { 6709 enable, 6710 disable, 6711 update, 6712 init, 6713 destroy 6714 }); 6715 } 6716 6717 function classesToSelector(classes) { 6718 if (classes === void 0) { 6719 classes = ''; 6720 } 6721 6722 return `.${classes.trim().replace(/([\.:!\/])/g, '\\$1') // eslint-disable-line 6723 .replace(/ /g, '.')}`; 6724 } 6725 6726 function Pagination(_ref) { 6727 let { 6728 swiper, 6729 extendParams, 6730 on, 6731 emit 6732 } = _ref; 6733 const pfx = 'swiper-pagination'; 6734 extendParams({ 6735 pagination: { 6736 el: null, 6737 bulletElement: 'span', 6738 clickable: false, 6739 hideOnClick: false, 6740 renderBullet: null, 6741 renderProgressbar: null, 6742 renderFraction: null, 6743 renderCustom: null, 6744 progressbarOpposite: false, 6745 type: 'bullets', 6746 // 'bullets' or 'progressbar' or 'fraction' or 'custom' 6747 dynamicBullets: false, 6748 dynamicMainBullets: 1, 6749 formatFractionCurrent: number => number, 6750 formatFractionTotal: number => number, 6751 bulletClass: `${pfx}-bullet`, 6752 bulletActiveClass: `${pfx}-bullet-active`, 6753 modifierClass: `${pfx}-`, 6754 currentClass: `${pfx}-current`, 6755 totalClass: `${pfx}-total`, 6756 hiddenClass: `${pfx}-hidden`, 6757 progressbarFillClass: `${pfx}-progressbar-fill`, 6758 progressbarOppositeClass: `${pfx}-progressbar-opposite`, 6759 clickableClass: `${pfx}-clickable`, 6760 lockClass: `${pfx}-lock`, 6761 horizontalClass: `${pfx}-horizontal`, 6762 verticalClass: `${pfx}-vertical`, 6763 paginationDisabledClass: `${pfx}-disabled` 6764 } 6765 }); 6766 swiper.pagination = { 6767 el: null, 6768 $el: null, 6769 bullets: [] 6770 }; 6771 let bulletSize; 6772 let dynamicBulletIndex = 0; 6773 6774 function isPaginationDisabled() { 6775 return !swiper.params.pagination.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0; 6776 } 6777 6778 function setSideBullets($bulletEl, position) { 6779 const { 6780 bulletActiveClass 6781 } = swiper.params.pagination; 6782 $bulletEl[position]().addClass(`${bulletActiveClass}-${position}`)[position]().addClass(`${bulletActiveClass}-${position}-${position}`); 6783 } 6784
vendor: 19,910 bytes, lines 6785-7369
6785 function update() { 6786 // Render || Update Pagination bullets/items 6787 const rtl = swiper.rtl; 6788 const params = swiper.params.pagination; 6789 if (isPaginationDisabled()) return; 6790 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 6791 const $el = swiper.pagination.$el; // Current/Total 6792 6793 let current; 6794 const total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 6795 6796 if (swiper.params.loop) { 6797 current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup); 6798 6799 if (current > slidesLength - 1 - swiper.loopedSlides * 2) { 6800 current -= slidesLength - swiper.loopedSlides * 2; 6801 } 6802 6803 if (current > total - 1) current -= total; 6804 if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current; 6805 } else if (typeof swiper.snapIndex !== 'undefined') { 6806 current = swiper.snapIndex; 6807 } else { 6808 current = swiper.activeIndex || 0; 6809 } // Types 6810 6811 6812 if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) { 6813 const bullets = swiper.pagination.bullets; 6814 let firstIndex; 6815 let lastIndex; 6816 let midIndex; 6817 6818 if (params.dynamicBullets) { 6819 bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true); 6820 $el.css(swiper.isHorizontal() ? 'width' : 'height', `${bulletSize * (params.dynamicMainBullets + 4)}px`); 6821 6822 if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) { 6823 dynamicBulletIndex += current - (swiper.previousIndex - swiper.loopedSlides || 0); 6824 6825 if (dynamicBulletIndex > params.dynamicMainBullets - 1) { 6826 dynamicBulletIndex = params.dynamicMainBullets - 1; 6827 } else if (dynamicBulletIndex < 0) { 6828 dynamicBulletIndex = 0; 6829 } 6830 } 6831 6832 firstIndex = Math.max(current - dynamicBulletIndex, 0); 6833 lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1); 6834 midIndex = (lastIndex + firstIndex) / 2; 6835 } 6836 6837 bullets.removeClass(['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`).join(' ')); 6838 6839 if ($el.length > 1) { 6840 bullets.each(bullet => { 6841 const $bullet = $(bullet); 6842 const bulletIndex = $bullet.index(); 6843 6844 if (bulletIndex === current) { 6845 $bullet.addClass(params.bulletActiveClass); 6846 } 6847 6848 if (params.dynamicBullets) { 6849 if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) { 6850 $bullet.addClass(`${params.bulletActiveClass}-main`); 6851 } 6852 6853 if (bulletIndex === firstIndex) { 6854 setSideBullets($bullet, 'prev'); 6855 } 6856 6857 if (bulletIndex === lastIndex) { 6858 setSideBullets($bullet, 'next'); 6859 } 6860 } 6861 }); 6862 } else { 6863 const $bullet = bullets.eq(current); 6864 const bulletIndex = $bullet.index(); 6865 $bullet.addClass(params.bulletActiveClass); 6866 6867 if (params.dynamicBullets) { 6868 const $firstDisplayedBullet = bullets.eq(firstIndex); 6869 const $lastDisplayedBullet = bullets.eq(lastIndex); 6870 6871 for (let i = firstIndex; i <= lastIndex; i += 1) { 6872 bullets.eq(i).addClass(`${params.bulletActiveClass}-main`); 6873 } 6874 6875 if (swiper.params.loop) { 6876 if (bulletIndex >= bullets.length) { 6877 for (let i = params.dynamicMainBullets; i >= 0; i -= 1) { 6878 bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`); 6879 } 6880 6881 bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(`${params.bulletActiveClass}-prev`); 6882 } else { 6883 setSideBullets($firstDisplayedBullet, 'prev'); 6884 setSideBullets($lastDisplayedBullet, 'next'); 6885 } 6886 } else { 6887 setSideBullets($firstDisplayedBullet, 'prev'); 6888 setSideBullets($lastDisplayedBullet, 'next'); 6889 } 6890 } 6891 } 6892 6893 if (params.dynamicBullets) { 6894 const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4); 6895 const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize; 6896 const offsetProp = rtl ? 'right' : 'left'; 6897 bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`); 6898 } 6899 } 6900 6901 if (params.type === 'fraction') { 6902 $el.find(classesToSelector(params.currentClass)).text(params.formatFractionCurrent(current + 1)); 6903 $el.find(classesToSelector(params.totalClass)).text(params.formatFractionTotal(total)); 6904 } 6905 6906 if (params.type === 'progressbar') { 6907 let progressbarDirection; 6908 6909 if (params.progressbarOpposite) { 6910 progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal'; 6911 } else { 6912 progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical'; 6913 } 6914 6915 const scale = (current + 1) / total; 6916 let scaleX = 1; 6917 let scaleY = 1; 6918 6919 if (progressbarDirection === 'horizontal') { 6920 scaleX = scale; 6921 } else { 6922 scaleY = scale; 6923 } 6924 6925 $el.find(classesToSelector(params.progressbarFillClass)).transform(`translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`).transition(swiper.params.speed); 6926 } 6927 6928 if (params.type === 'custom' && params.renderCustom) { 6929 $el.html(params.renderCustom(swiper, current + 1, total)); 6930 emit('paginationRender', $el[0]); 6931 } else { 6932 emit('paginationUpdate', $el[0]); 6933 } 6934 6935 if (swiper.params.watchOverflow && swiper.enabled) { 6936 $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); 6937 } 6938 } 6939 6940 function render() { 6941 // Render Container 6942 const params = swiper.params.pagination; 6943 if (isPaginationDisabled()) return; 6944 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 6945 const $el = swiper.pagination.$el; 6946 let paginationHTML = ''; 6947 6948 if (params.type === 'bullets') { 6949 let numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 6950 6951 if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.loop && numberOfBullets > slidesLength) { 6952 numberOfBullets = slidesLength; 6953 } 6954 6955 for (let i = 0; i < numberOfBullets; i += 1) { 6956 if (params.renderBullet) { 6957 paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass); 6958 } else { 6959 paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`; 6960 } 6961 } 6962 6963 $el.html(paginationHTML); 6964 swiper.pagination.bullets = $el.find(classesToSelector(params.bulletClass)); 6965 } 6966 6967 if (params.type === 'fraction') { 6968 if (params.renderFraction) { 6969 paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); 6970 } else { 6971 paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`; 6972 } 6973 6974 $el.html(paginationHTML); 6975 } 6976 6977 if (params.type === 'progressbar') { 6978 if (params.renderProgressbar) { 6979 paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass); 6980 } else { 6981 paginationHTML = `<span class="${params.progressbarFillClass}"></span>`; 6982 } 6983 6984 $el.html(paginationHTML); 6985 } 6986 6987 if (params.type !== 'custom') { 6988 emit('paginationRender', swiper.pagination.$el[0]); 6989 } 6990 } 6991 6992 function init() { 6993 swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, { 6994 el: 'swiper-pagination' 6995 }); 6996 const params = swiper.params.pagination; 6997 if (!params.el) return; 6998 let $el = $(params.el); 6999 if ($el.length === 0) return; 7000 7001 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) { 7002 $el = swiper.$el.find(params.el); // check if it belongs to another nested Swiper 7003 7004 if ($el.length > 1) { 7005 $el = $el.filter(el => { 7006 if ($(el).parents('.swiper')[0] !== swiper.el) return false; 7007 return true; 7008 }); 7009 } 7010 } 7011 7012 if (params.type === 'bullets' && params.clickable) { 7013 $el.addClass(params.clickableClass); 7014 } 7015 7016 $el.addClass(params.modifierClass + params.type); 7017 $el.addClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7018 7019 if (params.type === 'bullets' && params.dynamicBullets) { 7020 $el.addClass(`${params.modifierClass}${params.type}-dynamic`); 7021 dynamicBulletIndex = 0; 7022 7023 if (params.dynamicMainBullets < 1) { 7024 params.dynamicMainBullets = 1; 7025 } 7026 } 7027 7028 if (params.type === 'progressbar' && params.progressbarOpposite) { 7029 $el.addClass(params.progressbarOppositeClass); 7030 } 7031 7032 if (params.clickable) { 7033 $el.on('click', classesToSelector(params.bulletClass), function onClick(e) { 7034 e.preventDefault(); 7035 let index = $(this).index() * swiper.params.slidesPerGroup; 7036 if (swiper.params.loop) index += swiper.loopedSlides; 7037 swiper.slideTo(index); 7038 }); 7039 } 7040 7041 Object.assign(swiper.pagination, { 7042 $el, 7043 el: $el[0] 7044 }); 7045 7046 if (!swiper.enabled) { 7047 $el.addClass(params.lockClass); 7048 } 7049 } 7050 7051 function destroy() { 7052 const params = swiper.params.pagination; 7053 if (isPaginationDisabled()) return; 7054 const $el = swiper.pagination.$el; 7055 $el.removeClass(params.hiddenClass); 7056 $el.removeClass(params.modifierClass + params.type); 7057 $el.removeClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7058 if (swiper.pagination.bullets && swiper.pagination.bullets.removeClass) swiper.pagination.bullets.removeClass(params.bulletActiveClass); 7059 7060 if (params.clickable) { 7061 $el.off('click', classesToSelector(params.bulletClass)); 7062 } 7063 } 7064 7065 on('init', () => { 7066 if (swiper.params.pagination.enabled === false) { 7067 // eslint-disable-next-line 7068 disable(); 7069 } else { 7070 init(); 7071 render(); 7072 update(); 7073 } 7074 }); 7075 on('activeIndexChange', () => { 7076 if (swiper.params.loop) { 7077 update(); 7078 } else if (typeof swiper.snapIndex === 'undefined') { 7079 update(); 7080 } 7081 }); 7082 on('snapIndexChange', () => { 7083 if (!swiper.params.loop) { 7084 update(); 7085 } 7086 }); 7087 on('slidesLengthChange', () => { 7088 if (swiper.params.loop) { 7089 render(); 7090 update(); 7091 } 7092 }); 7093 on('snapGridLengthChange', () => { 7094 if (!swiper.params.loop) { 7095 render(); 7096 update(); 7097 } 7098 }); 7099 on('destroy', () => { 7100 destroy(); 7101 }); 7102 on('enable disable', () => { 7103 const { 7104 $el 7105 } = swiper.pagination; 7106 7107 if ($el) { 7108 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass); 7109 } 7110 }); 7111 on('lock unlock', () => { 7112 update(); 7113 }); 7114 on('click', (_s, e) => { 7115 const targetEl = e.target; 7116 const { 7117 $el 7118 } = swiper.pagination; 7119 7120 if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && $el && $el.length > 0 && !$(targetEl).hasClass(swiper.params.pagination.bulletClass)) { 7121 if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return; 7122 const isHidden = $el.hasClass(swiper.params.pagination.hiddenClass); 7123 7124 if (isHidden === true) { 7125 emit('paginationShow'); 7126 } else { 7127 emit('paginationHide'); 7128 } 7129 7130 $el.toggleClass(swiper.params.pagination.hiddenClass); 7131 } 7132 }); 7133 7134 const enable = () => { 7135 swiper.$el.removeClass(swiper.params.pagination.paginationDisabledClass); 7136 7137 if (swiper.pagination.$el) { 7138 swiper.pagination.$el.removeClass(swiper.params.pagination.paginationDisabledClass); 7139 } 7140 7141 init(); 7142 render(); 7143 update(); 7144 }; 7145 7146 const disable = () => { 7147 swiper.$el.addClass(swiper.params.pagination.paginationDisabledClass); 7148 7149 if (swiper.pagination.$el) { 7150 swiper.pagination.$el.addClass(swiper.params.pagination.paginationDisabledClass); 7151 } 7152 7153 destroy(); 7154 }; 7155 7156 Object.assign(swiper.pagination, { 7157 enable, 7158 disable, 7159 render, 7160 update, 7161 init, 7162 destroy 7163 }); 7164 } 7165 7166 function Scrollbar(_ref) { 7167 let { 7168 swiper, 7169 extendParams, 7170 on, 7171 emit 7172 } = _ref; 7173 const document = getDocument(); 7174 let isTouched = false; 7175 let timeout = null; 7176 let dragTimeout = null; 7177 let dragStartPos; 7178 let dragSize; 7179 let trackSize; 7180 let divider; 7181 extendParams({ 7182 scrollbar: { 7183 el: null, 7184 dragSize: 'auto', 7185 hide: false, 7186 draggable: false, 7187 snapOnRelease: true, 7188 lockClass: 'swiper-scrollbar-lock', 7189 dragClass: 'swiper-scrollbar-drag', 7190 scrollbarDisabledClass: 'swiper-scrollbar-disabled', 7191 horizontalClass: `swiper-scrollbar-horizontal`, 7192 verticalClass: `swiper-scrollbar-vertical` 7193 } 7194 }); 7195 swiper.scrollbar = { 7196 el: null, 7197 dragEl: null, 7198 $el: null, 7199 $dragEl: null 7200 }; 7201 7202 function setTranslate() { 7203 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7204 const { 7205 scrollbar, 7206 rtlTranslate: rtl, 7207 progress 7208 } = swiper; 7209 const { 7210 $dragEl, 7211 $el 7212 } = scrollbar; 7213 const params = swiper.params.scrollbar; 7214 let newSize = dragSize; 7215 let newPos = (trackSize - dragSize) * progress; 7216 7217 if (rtl) { 7218 newPos = -newPos; 7219 7220 if (newPos > 0) { 7221 newSize = dragSize - newPos; 7222 newPos = 0; 7223 } else if (-newPos + dragSize > trackSize) { 7224 newSize = trackSize + newPos; 7225 } 7226 } else if (newPos < 0) { 7227 newSize = dragSize + newPos; 7228 newPos = 0; 7229 } else if (newPos + dragSize > trackSize) { 7230 newSize = trackSize - newPos; 7231 } 7232 7233 if (swiper.isHorizontal()) { 7234 $dragEl.transform(`translate3d(${newPos}px, 0, 0)`); 7235 $dragEl[0].style.width = `${newSize}px`; 7236 } else { 7237 $dragEl.transform(`translate3d(0px, ${newPos}px, 0)`); 7238 $dragEl[0].style.height = `${newSize}px`; 7239 } 7240 7241 if (params.hide) { 7242 clearTimeout(timeout); 7243 $el[0].style.opacity = 1; 7244 timeout = setTimeout(() => { 7245 $el[0].style.opacity = 0; 7246 $el.transition(400); 7247 }, 1000); 7248 } 7249 } 7250 7251 function setTransition(duration) { 7252 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7253 swiper.scrollbar.$dragEl.transition(duration); 7254 } 7255 7256 function updateSize() { 7257 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7258 const { 7259 scrollbar 7260 } = swiper; 7261 const { 7262 $dragEl, 7263 $el 7264 } = scrollbar; 7265 $dragEl[0].style.width = ''; 7266 $dragEl[0].style.height = ''; 7267 trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight; 7268 divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0)); 7269 7270 if (swiper.params.scrollbar.dragSize === 'auto') { 7271 dragSize = trackSize * divider; 7272 } else { 7273 dragSize = parseInt(swiper.params.scrollbar.dragSize, 10); 7274 } 7275 7276 if (swiper.isHorizontal()) { 7277 $dragEl[0].style.width = `${dragSize}px`; 7278 } else { 7279 $dragEl[0].style.height = `${dragSize}px`; 7280 } 7281 7282 if (divider >= 1) { 7283 $el[0].style.display = 'none'; 7284 } else { 7285 $el[0].style.display = ''; 7286 } 7287 7288 if (swiper.params.scrollbar.hide) { 7289 $el[0].style.opacity = 0; 7290 } 7291 7292 if (swiper.params.watchOverflow && swiper.enabled) { 7293 scrollbar.$el[swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass); 7294 } 7295 } 7296 7297 function getPointerPosition(e) { 7298 if (swiper.isHorizontal()) { 7299 return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientX : e.clientX; 7300 } 7301 7302 return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientY : e.clientY; 7303 } 7304 7305 function setDragPosition(e) { 7306 const { 7307 scrollbar, 7308 rtlTranslate: rtl 7309 } = swiper; 7310 const { 7311 $el 7312 } = scrollbar; 7313 let positionRatio; 7314 positionRatio = (getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize); 7315 positionRatio = Math.max(Math.min(positionRatio, 1), 0); 7316 7317 if (rtl) { 7318 positionRatio = 1 - positionRatio; 7319 } 7320 7321 const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio; 7322 swiper.updateProgress(position); 7323 swiper.setTranslate(position); 7324 swiper.updateActiveIndex(); 7325 swiper.updateSlidesClasses(); 7326 } 7327 7328 function onDragStart(e) { 7329 const params = swiper.params.scrollbar; 7330 const { 7331 scrollbar, 7332 $wrapperEl 7333 } = swiper; 7334 const { 7335 $el, 7336 $dragEl 7337 } = scrollbar; 7338 isTouched = true; 7339 dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null; 7340 e.preventDefault(); 7341 e.stopPropagation(); 7342 $wrapperEl.transition(100); 7343 $dragEl.transition(100); 7344 setDragPosition(e); 7345 clearTimeout(dragTimeout); 7346 $el.transition(0); 7347 7348 if (params.hide) { 7349 $el.css('opacity', 1); 7350 } 7351 7352 if (swiper.params.cssMode) { 7353 swiper.$wrapperEl.css('scroll-snap-type', 'none'); 7354 } 7355 7356 emit('scrollbarDragStart', e); 7357 } 7358 7359 function onDragMove(e) { 7360 const { 7361 scrollbar, 7362 $wrapperEl 7363 } = swiper; 7364 const { 7365 $el, 7366 $dragEl 7367 } = scrollbar; 7368 if (!isTouched) return; 7369 if (e.preventDefault) e.preventDefault();else e.returnValue = false;
7370 setDragPosition(e); 7371 $wrapperEl.transition(0); 7372 $el.transition(0); 7373 $dragEl.transition(0); 7374 emit('scrollbarDragMove', e); 7375 } 7376 7377 function onDragEnd(e) { 7378 const params = swiper.params.scrollbar; 7379 const { 7380 scrollbar, 7381 $wrapperEl 7382 } = swiper; 7383 const { 7384 $el 7385 } = scrollbar; 7386 if (!isTouched) return; 7387 isTouched = false; 7388 7389 if (swiper.params.cssMode) { 7390 swiper.$wrapperEl.css('scroll-snap-type', ''); 7391 $wrapperEl.transition(''); 7392 } 7393 7394 if (params.hide) { 7395 clearTimeout(dragTimeout); 7396 dragTimeout = nextTick(() => { 7397 $el.css('opacity', 0); 7398 $el.transition(400); 7399 }, 1000); 7400 } 7401 7402 emit('scrollbarDragEnd', e); 7403 7404 if (params.snapOnRelease) { 7405 swiper.slideToClosest(); 7406 } 7407 } 7408 7409 function events(method) { 7410 const { 7411 scrollbar, 7412 touchEventsTouch, 7413 touchEventsDesktop, 7414 params, 7415 support 7416 } = swiper; 7417 const $el = scrollbar.$el; 7418 if (!$el) return; 7419 const target = $el[0]; 7420 const activeListener = support.passiveListener && params.passiveListeners ? { 7421 passive: false, 7422 capture: false 7423 } : false; 7424 const passiveListener = support.passiveListener && params.passiveListeners ? { 7425 passive: true, 7426 capture: false 7427 } : false; 7428 if (!target) return; 7429 const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 7430 7431 if (!support.touch) { 7432 target[eventMethod](touchEventsDesktop.start, onDragStart, activeListener); 7433 document[eventMethod](touchEventsDesktop.move, onDragMove, activeListener); 7434 document[eventMethod](touchEventsDesktop.end, onDragEnd, passiveListener); 7435 } else { 7436 target[eventMethod](touchEventsTouch.start, onDragStart, activeListener); 7437 target[eventMethod](touchEventsTouch.move, onDragMove, activeListener); 7438 target[eventMethod](touchEventsTouch.end, onDragEnd, passiveListener); 7439 } 7440 } 7441 7442 function enableDraggable() { 7443 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7444 events('on'); 7445 } 7446 7447 function disableDraggable() { 7448 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7449 events('off'); 7450 } 7451 7452 function init() { 7453 const { 7454 scrollbar, 7455 $el: $swiperEl 7456 } = swiper; 7457 swiper.params.scrollbar = createElementIfNotDefined(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, { 7458 el: 'swiper-scrollbar' 7459 }); 7460 const params = swiper.params.scrollbar; 7461 if (!params.el) return; 7462 let $el = $(params.el); 7463 7464 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) { 7465 $el = $swiperEl.find(params.el); 7466 } 7467 7468 $el.addClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7469 let $dragEl = $el.find(`.${swiper.params.scrollbar.dragClass}`); 7470 7471 if ($dragEl.length === 0) { 7472 $dragEl = $(`<div class="${swiper.params.scrollbar.dragClass}"></div>`); 7473 $el.append($dragEl); 7474 } 7475 7476 Object.assign(scrollbar, { 7477 $el, 7478 el: $el[0], 7479 $dragEl, 7480 dragEl: $dragEl[0] 7481 }); 7482 7483 if (params.draggable) { 7484 enableDraggable(); 7485 } 7486 7487 if ($el) { 7488 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); 7489 } 7490 } 7491 7492 function destroy() { 7493 const params = swiper.params.scrollbar; 7494 const $el = swiper.scrollbar.$el; 7495 7496 if ($el) { 7497 $el.removeClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7498 } 7499 7500 disableDraggable(); 7501 } 7502 7503 on('init', () => { 7504 if (swiper.params.scrollbar.enabled === false) { 7505 // eslint-disable-next-line 7506 disable(); 7507 } else { 7508 init(); 7509 updateSize(); 7510 setTranslate(); 7511 } 7512 }); 7513 on('update resize observerUpdate lock unlock', () => { 7514 updateSize(); 7515 }); 7516 on('setTranslate', () => { 7517 setTranslate(); 7518 }); 7519 on('setTransition', (_s, duration) => { 7520 setTransition(duration); 7521 }); 7522 on('enable disable', () => { 7523 const { 7524 $el 7525 } = swiper.scrollbar; 7526 7527 if ($el) { 7528 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); 7529 } 7530 }); 7531 on('destroy', () => { 7532 destroy(); 7533 }); 7534 7535 const enable = () => { 7536 swiper.$el.removeClass(swiper.params.scrollbar.scrollbarDisabledClass); 7537 7538 if (swiper.scrollbar.$el) { 7539 swiper.scrollbar.$el.removeClass(swiper.params.scrollbar.scrollbarDisabledClass); 7540 } 7541 7542 init(); 7543 updateSize(); 7544 setTranslate(); 7545 }; 7546 7547 const disable = () => { 7548 swiper.$el.addClass(swiper.params.scrollbar.scrollbarDisabledClass); 7549 7550 if (swiper.scrollbar.$el) { 7551 swiper.scrollbar.$el.addClass(swiper.params.scrollbar.scrollbarDisabledClass); 7552 } 7553 7554 destroy(); 7555 }; 7556 7557 Object.assign(swiper.scrollbar, { 7558 enable, 7559 disable, 7560 updateSize, 7561 setTranslate, 7562 init, 7563 destroy 7564 }); 7565 } 7566 7567 function Parallax(_ref) { 7568 let { 7569 swiper, 7570 extendParams, 7571 on 7572 } = _ref; 7573 extendParams({ 7574 parallax: { 7575 enabled: false 7576 } 7577 }); 7578 7579 const setTransform = (el, progress) => { 7580 const { 7581 rtl 7582 } = swiper; 7583 const $el = $(el); 7584 const rtlFactor = rtl ? -1 : 1; 7585 const p = $el.attr('data-swiper-parallax') || '0'; 7586 let x = $el.attr('data-swiper-parallax-x'); 7587 let y = $el.attr('data-swiper-parallax-y'); 7588 const scale = $el.attr('data-swiper-parallax-scale'); 7589 const opacity = $el.attr('data-swiper-parallax-opacity'); 7590 7591 if (x || y) { 7592 x = x || '0'; 7593 y = y || '0'; 7594 } else if (swiper.isHorizontal()) { 7595 x = p; 7596 y = '0'; 7597 } else { 7598 y = p; 7599 x = '0'; 7600 } 7601 7602 if (x.indexOf('%') >= 0) { 7603 x = `${parseInt(x, 10) * progress * rtlFactor}%`; 7604 } else { 7605 x = `${x * progress * rtlFactor}px`;
7606 } 7607 7608 if (y.indexOf('%') >= 0) { 7609 y = `${parseInt(y, 10) * progress}%`; 7610 } else { 7611 y = `${y * progress}px`; 7612 } 7613 7614 if (typeof opacity !== 'undefined' && opacity !== null) { 7615 const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress)); 7616 $el[0].style.opacity = currentOpacity; 7617 } 7618 7619 if (typeof scale === 'undefined' || scale === null) { 7620 $el.transform(`translate3d(${x}, ${y}, 0px)`); 7621 } else { 7622 const currentScale = scale - (scale - 1) * (1 - Math.abs(progress)); 7623 $el.transform(`translate3d(${x}, ${y}, 0px) scale(${currentScale})`); 7624 } 7625 }; 7626 7627 const setTranslate = () => { 7628 const { 7629 $el, 7630 slides, 7631 progress, 7632 snapGrid 7633 } = swiper; 7634 $el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { 7635 setTransform(el, progress); 7636 }); 7637 slides.each((slideEl, slideIndex) => { 7638 let slideProgress = slideEl.progress; 7639 7640 if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') { 7641 slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1); 7642 } 7643 7644 slideProgress = Math.min(Math.max(slideProgress, -1), 1); 7645 $(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { 7646 setTransform(el, slideProgress); 7647 }); 7648 }); 7649 }; 7650 7651 const setTransition = function (duration) { 7652 if (duration === void 0) { 7653 duration = swiper.params.speed; 7654 } 7655 7656 const { 7657 $el 7658 } = swiper; 7659 $el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(parallaxEl => { 7660 const $parallaxEl = $(parallaxEl); 7661 let parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration; 7662 if (duration === 0) parallaxDuration = 0; 7663 $parallaxEl.transition(parallaxDuration); 7664 }); 7665 }; 7666 7667 on('beforeInit', () => { 7668 if (!swiper.params.parallax.enabled) return; 7669 swiper.params.watchSlidesProgress = true; 7670 swiper.originalParams.watchSlidesProgress = true; 7671 }); 7672 on('init', () => { 7673 if (!swiper.params.parallax.enabled) return; 7674 setTranslate(); 7675 }); 7676 on('setTranslate', () => { 7677 if (!swiper.params.parallax.enabled) return; 7678 setTranslate(); 7679 }); 7680 on('setTransition', (_swiper, duration) => { 7681 if (!swiper.params.parallax.enabled) return; 7682 setTransition(duration); 7683 }); 7684 } 7685 7686 function Zoom(_ref) { 7687 let { 7688 swiper, 7689 extendParams, 7690 on, 7691 emit 7692 } = _ref; 7693 const window = getWindow(); 7694 extendParams({ 7695 zoom: { 7696 enabled: false, 7697 maxRatio: 3, 7698 minRatio: 1, 7699 toggle: true, 7700 containerClass: 'swiper-zoom-container', 7701 zoomedSlideClass: 'swiper-slide-zoomed' 7702 } 7703 }); 7704 swiper.zoom = { 7705 enabled: false 7706 }; 7707 let currentScale = 1; 7708 let isScaling = false; 7709 let gesturesEnabled; 7710 let fakeGestureTouched; 7711 let fakeGestureMoved; 7712 const gesture = { 7713 $slideEl: undefined, 7714 slideWidth: undefined, 7715 slideHeight: undefined, 7716 $imageEl: undefined, 7717 $imageWrapEl: undefined, 7718 maxRatio: 3 7719 }; 7720 const image = { 7721 isTouched: undefined, 7722 isMoved: undefined, 7723 currentX: undefined, 7724 currentY: undefined, 7725 minX: undefined, 7726 minY: undefined, 7727 maxX: undefined, 7728 maxY: undefined, 7729 width: undefined, 7730 height: undefined, 7731 startX: undefined, 7732 startY: undefined, 7733 touchesStart: {}, 7734 touchesCurrent: {} 7735 }; 7736 const velocity = { 7737 x: undefined, 7738 y: undefined, 7739 prevPositionX: undefined, 7740 prevPositionY: undefined, 7741 prevTime: undefined 7742 }; 7743 let scale = 1; 7744 Object.defineProperty(swiper.zoom, 'scale', { 7745 get() { 7746 return scale; 7747 }, 7748 7749 set(value) { 7750 if (scale !== value) { 7751 const imageEl = gesture.$imageEl ? gesture.$imageEl[0] : undefined; 7752 const slideEl = gesture.$slideEl ? gesture.$slideEl[0] : undefined; 7753 emit('zoomChange', value, imageEl, slideEl); 7754 } 7755 7756 scale = value; 7757 } 7758 7759 }); 7760 7761 function getDistanceBetweenTouches(e) { 7762 if (e.targetTouches.length < 2) return 1; 7763 const x1 = e.targetTouches[0].pageX; 7764 const y1 = e.targetTouches[0].pageY; 7765 const x2 = e.targetTouches[1].pageX; 7766 const y2 = e.targetTouches[1].pageY; 7767 const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); 7768 return distance; 7769 } // Events 7770 7771 7772 function onGestureStart(e) { 7773 const support = swiper.support; 7774 const params = swiper.params.zoom; 7775 fakeGestureTouched = false;
vendor: 13,553 bytes, lines 7776-8112
7776 fakeGestureMoved = false; 7777 7778 if (!support.gestures) { 7779 if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) { 7780 return; 7781 } 7782 7783 fakeGestureTouched = true; 7784 gesture.scaleStart = getDistanceBetweenTouches(e); 7785 } 7786 7787 if (!gesture.$slideEl || !gesture.$slideEl.length) { 7788 gesture.$slideEl = $(e.target).closest(`.${swiper.params.slideClass}`); 7789 if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 7790 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 7791 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 7792 gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 7793 7794 if (gesture.$imageWrapEl.length === 0) { 7795 gesture.$imageEl = undefined; 7796 return; 7797 } 7798 } 7799 7800 if (gesture.$imageEl) { 7801 gesture.$imageEl.transition(0); 7802 } 7803 7804 isScaling = true; 7805 } 7806 7807 function onGestureChange(e) { 7808 const support = swiper.support; 7809 const params = swiper.params.zoom; 7810 const zoom = swiper.zoom; 7811 7812 if (!support.gestures) { 7813 if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) { 7814 return; 7815 } 7816 7817 fakeGestureMoved = true; 7818 gesture.scaleMove = getDistanceBetweenTouches(e); 7819 } 7820 7821 if (!gesture.$imageEl || gesture.$imageEl.length === 0) { 7822 if (e.type === 'gesturechange') onGestureStart(e); 7823 return; 7824 } 7825 7826 if (support.gestures) { 7827 zoom.scale = e.scale * currentScale; 7828 } else { 7829 zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale; 7830 } 7831 7832 if (zoom.scale > gesture.maxRatio) { 7833 zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5; 7834 } 7835 7836 if (zoom.scale < params.minRatio) { 7837 zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5; 7838 } 7839 7840 gesture.$imageEl.transform(`translate3d(0,0,0) scale(${zoom.scale})`); 7841 } 7842 7843 function onGestureEnd(e) { 7844 const device = swiper.device; 7845 const support = swiper.support; 7846 const params = swiper.params.zoom; 7847 const zoom = swiper.zoom; 7848 7849 if (!support.gestures) { 7850 if (!fakeGestureTouched || !fakeGestureMoved) { 7851 return; 7852 } 7853 7854 if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2 && !device.android) { 7855 return; 7856 } 7857 7858 fakeGestureTouched = false; 7859 fakeGestureMoved = false; 7860 } 7861 7862 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 7863 zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio); 7864 gesture.$imageEl.transition(swiper.params.speed).transform(`translate3d(0,0,0) scale(${zoom.scale})`); 7865 currentScale = zoom.scale; 7866 isScaling = false; 7867 if (zoom.scale === 1) gesture.$slideEl = undefined; 7868 } 7869 7870 function onTouchStart(e) { 7871 const device = swiper.device; 7872 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 7873 if (image.isTouched) return; 7874 if (device.android && e.cancelable) e.preventDefault(); 7875 image.isTouched = true; 7876 image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; 7877 image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; 7878 } 7879 7880 function onTouchMove(e) { 7881 const zoom = swiper.zoom; 7882 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 7883 swiper.allowClick = false; 7884 if (!image.isTouched || !gesture.$slideEl) return; 7885 7886 if (!image.isMoved) { 7887 image.width = gesture.$imageEl[0].offsetWidth; 7888 image.height = gesture.$imageEl[0].offsetHeight; 7889 image.startX = getTranslate(gesture.$imageWrapEl[0], 'x') || 0; 7890 image.startY = getTranslate(gesture.$imageWrapEl[0], 'y') || 0; 7891 gesture.slideWidth = gesture.$slideEl[0].offsetWidth; 7892 gesture.slideHeight = gesture.$slideEl[0].offsetHeight; 7893 gesture.$imageWrapEl.transition(0); 7894 } // Define if we need image drag 7895 7896 7897 const scaledWidth = image.width * zoom.scale; 7898 const scaledHeight = image.height * zoom.scale; 7899 if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return; 7900 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 7901 image.maxX = -image.minX; 7902 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 7903 image.maxY = -image.minY; 7904 image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; 7905 image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; 7906 7907 if (!image.isMoved && !isScaling) { 7908 if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) { 7909 image.isTouched = false; 7910 return; 7911 } 7912 7913 if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) { 7914 image.isTouched = false; 7915 return; 7916 } 7917 } 7918 7919 if (e.cancelable) { 7920 e.preventDefault(); 7921 } 7922 7923 e.stopPropagation(); 7924 image.isMoved = true; 7925 image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX; 7926 image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY; 7927 7928 if (image.currentX < image.minX) { 7929 image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8; 7930 } 7931 7932 if (image.currentX > image.maxX) { 7933 image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8; 7934 } 7935 7936 if (image.currentY < image.minY) { 7937 image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8; 7938 } 7939 7940 if (image.currentY > image.maxY) { 7941 image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8; 7942 } // Velocity 7943 7944 7945 if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x; 7946 if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y; 7947 if (!velocity.prevTime) velocity.prevTime = Date.now(); 7948 velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2; 7949 velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2; 7950 if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0; 7951 if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0; 7952 velocity.prevPositionX = image.touchesCurrent.x; 7953 velocity.prevPositionY = image.touchesCurrent.y; 7954 velocity.prevTime = Date.now(); 7955 gesture.$imageWrapEl.transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); 7956 } 7957 7958 function onTouchEnd() { 7959 const zoom = swiper.zoom; 7960 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 7961 7962 if (!image.isTouched || !image.isMoved) { 7963 image.isTouched = false; 7964 image.isMoved = false; 7965 return; 7966 } 7967 7968 image.isTouched = false; 7969 image.isMoved = false; 7970 let momentumDurationX = 300; 7971 let momentumDurationY = 300; 7972 const momentumDistanceX = velocity.x * momentumDurationX; 7973 const newPositionX = image.currentX + momentumDistanceX; 7974 const momentumDistanceY = velocity.y * momentumDurationY; 7975 const newPositionY = image.currentY + momentumDistanceY; // Fix duration 7976 7977 if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); 7978 if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); 7979 const momentumDuration = Math.max(momentumDurationX, momentumDurationY); 7980 image.currentX = newPositionX; 7981 image.currentY = newPositionY; // Define if we need image drag 7982 7983 const scaledWidth = image.width * zoom.scale; 7984 const scaledHeight = image.height * zoom.scale; 7985 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 7986 image.maxX = -image.minX; 7987 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 7988 image.maxY = -image.minY; 7989 image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX); 7990 image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY); 7991 gesture.$imageWrapEl.transition(momentumDuration).transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); 7992 } 7993 7994 function onTransitionEnd() { 7995 const zoom = swiper.zoom; 7996 7997 if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) { 7998 if (gesture.$imageEl) { 7999 gesture.$imageEl.transform('translate3d(0,0,0) scale(1)'); 8000 } 8001 8002 if (gesture.$imageWrapEl) { 8003 gesture.$imageWrapEl.transform('translate3d(0,0,0)'); 8004 } 8005 8006 zoom.scale = 1; 8007 currentScale = 1; 8008 gesture.$slideEl = undefined; 8009 gesture.$imageEl = undefined; 8010 gesture.$imageWrapEl = undefined; 8011 } 8012 } 8013 8014 function zoomIn(e) { 8015 const zoom = swiper.zoom; 8016 const params = swiper.params.zoom; 8017 8018 if (!gesture.$slideEl) { 8019 if (e && e.target) { 8020 gesture.$slideEl = $(e.target).closest(`.${swiper.params.slideClass}`); 8021 } 8022 8023 if (!gesture.$slideEl) { 8024 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 8025 gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); 8026 } else { 8027 gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 8028 } 8029 } 8030 8031 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 8032 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 8033 } 8034 8035 if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; 8036 8037 if (swiper.params.cssMode) { 8038 swiper.wrapperEl.style.overflow = 'hidden'; 8039 swiper.wrapperEl.style.touchAction = 'none'; 8040 } 8041 8042 gesture.$slideEl.addClass(`${params.zoomedSlideClass}`); 8043 let touchX; 8044 let touchY; 8045 let offsetX; 8046 let offsetY; 8047 let diffX; 8048 let diffY; 8049 let translateX; 8050 let translateY; 8051 let imageWidth; 8052 let imageHeight; 8053 let scaledWidth; 8054 let scaledHeight; 8055 let translateMinX; 8056 let translateMinY; 8057 let translateMaxX; 8058 let translateMaxY; 8059 let slideWidth; 8060 let slideHeight; 8061 8062 if (typeof image.touchesStart.x === 'undefined' && e) { 8063 touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX; 8064 touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY; 8065 } else { 8066 touchX = image.touchesStart.x; 8067 touchY = image.touchesStart.y; 8068 } 8069 8070 zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 8071 currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 8072 8073 if (e) { 8074 slideWidth = gesture.$slideEl[0].offsetWidth; 8075 slideHeight = gesture.$slideEl[0].offsetHeight; 8076 offsetX = gesture.$slideEl.offset().left + window.scrollX; 8077 offsetY = gesture.$slideEl.offset().top + window.scrollY; 8078 diffX = offsetX + slideWidth / 2 - touchX; 8079 diffY = offsetY + slideHeight / 2 - touchY; 8080 imageWidth = gesture.$imageEl[0].offsetWidth; 8081 imageHeight = gesture.$imageEl[0].offsetHeight; 8082 scaledWidth = imageWidth * zoom.scale; 8083 scaledHeight = imageHeight * zoom.scale; 8084 translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0); 8085 translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0); 8086 translateMaxX = -translateMinX; 8087 translateMaxY = -translateMinY; 8088 translateX = diffX * zoom.scale; 8089 translateY = diffY * zoom.scale; 8090 8091 if (translateX < translateMinX) { 8092 translateX = translateMinX; 8093 } 8094 8095 if (translateX > translateMaxX) { 8096 translateX = translateMaxX; 8097 } 8098 8099 if (translateY < translateMinY) { 8100 translateY = translateMinY; 8101 } 8102 8103 if (translateY > translateMaxY) { 8104 translateY = translateMaxY; 8105 } 8106 } else { 8107 translateX = 0; 8108 translateY = 0; 8109 } 8110 8111 gesture.$imageWrapEl.transition(300).transform(`translate3d(${translateX}px, ${translateY}px,0)`); 8112 gesture.$imageEl.transition(300).transform(`translate3d(0,
81120,0) scale(${zoom.scale})`); 8113 } 8114 8115 function zoomOut() { 8116 const zoom = swiper.zoom; 8117 const params = swiper.params.zoom; 8118 8119 if (!gesture.$slideEl) { 8120 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 8121 gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); 8122 } else { 8123 gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 8124 } 8125 8126 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 8127 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 8128 } 8129 8130 if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; 8131 8132 if (swiper.params.cssMode) { 8133 swiper.wrapperEl.style.overflow = ''; 8134 swiper.wrapperEl.style.touchAction = ''; 8135 } 8136 8137 zoom.scale = 1; 8138 currentScale = 1; 8139 gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)'); 8140 gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)'); 8141 gesture.$slideEl.removeClass(`${params.zoomedSlideClass}`); 8142 gesture.$slideEl = undefined; 8143 } // Toggle Zoom 8144 8145 8146 function zoomToggle(e) { 8147 const zoom = swiper.zoom; 8148 8149 if (zoom.scale && zoom.scale !== 1) { 8150 // Zoom Out 8151 zoomOut(); 8152 } else { 8153 // Zoom In 8154 zoomIn(e); 8155 } 8156 } 8157 8158 function getListeners() { 8159 const support = swiper.support; 8160 const passiveListener = swiper.touchEvents.start === 'touchstart' && support.passiveListener && swiper.params.passiveListeners ? { 8161 passive: true, 8162 capture: false 8163 } : false; 8164 const activeListenerWithCapture = support.passiveListener ? { 8165 passive: false, 8166 capture: true 8167 } : true; 8168 return { 8169 passiveListener, 8170 activeListenerWithCapture 8171 }; 8172 } 8173 8174 function getSlideSelector() { 8175 return `.${swiper.params.slideClass}`; 8176 } 8177 8178 function toggleGestures(method) { 8179 const { 8180 passiveListener 8181 } = getListeners(); 8182 const slideSelector = getSlideSelector(); 8183 swiper.$wrapperEl[method]('gesturestart', slideSelector, onGestureStart, passiveListener); 8184 swiper.$wrapperEl[method]('gesturechange', slideSelector, onGestureChange, passiveListener); 8185 swiper.$wrapperEl[method]('gestureend', slideSelector, onGestureEnd, passiveListener); 8186 } 8187 8188 function enableGestures() { 8189 if (gesturesEnabled) return; 8190 gesturesEnabled = true; 8191 toggleGestures('on'); 8192 } 8193 8194 function disableGestures() { 8195 if (!gesturesEnabled) return; 8196 gesturesEnabled = false; 8197 toggleGestures('off'); 8198 } // Attach/Detach Events 8199 8200 8201 function enable() { 8202 const zoom = swiper.zoom; 8203 if (zoom.enabled) return; 8204 zoom.enabled = true; 8205 const support = swiper.support; 8206 const { 8207 passiveListener, 8208 activeListenerWithCapture 8209 } = getListeners(); 8210 const slideSelector = getSlideSelector(); // Scale image 8211 8212 if (support.gestures) { 8213 swiper.$wrapperEl.on(swiper.touchEvents.start, enableGestures, passiveListener); 8214 swiper.$wrapperEl.on(swiper.touchEvents.end, disableGestures, passiveListener); 8215 } else if (swiper.touchEvents.start === 'touchstart') { 8216 swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); 8217 swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); 8218 swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); 8219 8220 if (swiper.touchEvents.cancel) { 8221 swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); 8222 } 8223 } // Move image 8224 8225 8226 swiper.$wrapperEl.on(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); 8227 } 8228 8229 function disable() { 8230 const zoom = swiper.zoom; 8231 if (!zoom.enabled) return; 8232 const support = swiper.support; 8233 zoom.enabled = false;
8234 const { 8235 passiveListener, 8236 activeListenerWithCapture 8237 } = getListeners(); 8238 const slideSelector = getSlideSelector(); // Scale image 8239 8240 if (support.gestures) { 8241 swiper.$wrapperEl.off(swiper.touchEvents.start, enableGestures, passiveListener); 8242 swiper.$wrapperEl.off(swiper.touchEvents.end, disableGestures, passiveListener); 8243 } else if (swiper.touchEvents.start === 'touchstart') { 8244 swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); 8245 swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); 8246 swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); 8247 8248 if (swiper.touchEvents.cancel) { 8249 swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); 8250 } 8251 } // Move image 8252 8253 8254 swiper.$wrapperEl.off(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); 8255 } 8256 8257 on('init', () => { 8258 if (swiper.params.zoom.enabled) { 8259 enable(); 8260 } 8261 }); 8262 on('destroy', () => { 8263 disable(); 8264 }); 8265 on('touchStart', (_s, e) => { 8266 if (!swiper.zoom.enabled) return; 8267 onTouchStart(e); 8268 }); 8269 on('touchEnd', (_s, e) => { 8270 if (!swiper.zoom.enabled) return; 8271 onTouchEnd(); 8272 }); 8273 on('doubleTap', (_s, e) => { 8274 if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { 8275 zoomToggle(e); 8276 } 8277 }); 8278 on('transitionEnd', () => { 8279 if (swiper.zoom.enabled && swiper.params.zoom.enabled) { 8280 onTransitionEnd(); 8281 } 8282 }); 8283 on('slideChange', () => { 8284 if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) { 8285 onTransitionEnd(); 8286 } 8287 }); 8288 Object.assign(swiper.zoom, { 8289 enable, 8290 disable, 8291 in: zoomIn, 8292 out: zoomOut, 8293 toggle: zoomToggle 8294 }); 8295 } 8296 8297 function Lazy(_ref) { 8298 let { 8299 swiper, 8300 extendParams, 8301 on, 8302 emit 8303 } = _ref; 8304 extendParams({ 8305 lazy: { 8306 checkInView: false, 8307 enabled: false, 8308 loadPrevNext: false, 8309 loadPrevNextAmount: 1, 8310 loadOnTransitionStart: false, 8311 scrollingElement: '', 8312 elementClass: 'swiper-lazy', 8313 loadingClass: 'swiper-lazy-loading', 8314 loadedClass: 'swiper-lazy-loaded', 8315 preloaderClass: 'swiper-lazy-preloader' 8316 } 8317 }); 8318 swiper.lazy = {}; 8319 let scrollHandlerAttached = false; 8320 let initialImageLoaded = false; 8321 8322 function loadInSlide(index, loadInDuplicate) { 8323 if (loadInDuplicate === void 0) { 8324 loadInDuplicate = true; 8325 } 8326 8327 const params = swiper.params.lazy; 8328 if (typeof index === 'undefined') return; 8329 if (swiper.slides.length === 0) return; 8330 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 8331 const $slideEl = isVirtual ? swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-swiper-slide-index="${index}"]`) : swiper.slides.eq(index); 8332 const $images = $slideEl.find(`.${params.elementClass}:not(.${params.loadedClass}):not(.${params.loadingClass})`); 8333 8334 if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) { 8335 $images.push($slideEl[0]); 8336 } 8337 8338 if ($images.length === 0) return; 8339 $images.each(imageEl => { 8340 const $imageEl = $(imageEl); 8341 $imageEl.addClass(params.loadingClass); 8342 const background = $imageEl.attr('data-background'); 8343 const src = $imageEl.attr('data-src'); 8344 const srcset = $imageEl.attr('data-srcset'); 8345 const sizes = $imageEl.attr('data-sizes'); 8346 const $pictureEl = $imageEl.parent('picture'); 8347 swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, () => { 8348 if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) return; 8349 8350 if (background) { 8351 $imageEl.css('background-image', `url("${background}")`); 8352 $imageEl.removeAttr('data-background'); 8353 } else { 8354 if (srcset) { 8355 $imageEl.attr('srcset', srcset); 8356 $imageEl.removeAttr('data-srcset'); 8357 } 8358 8359 if (sizes) { 8360 $imageEl.attr('sizes', sizes); 8361 $imageEl.removeAttr('data-sizes'); 8362 } 8363 8364 if ($pictureEl.length) { 8365 $pictureEl.children('source').each(sourceEl => { 8366 const $source = $(sourceEl); 8367 8368 if ($source.attr('data-srcset')) { 8369 $source.attr('srcset', $source.attr('data-srcset')); 8370 $source.removeAttr('data-srcset'); 8371 } 8372 }); 8373 } 8374 8375 if (src) { 8376 $imageEl.attr('src', src); 8377 $imageEl.removeAttr('data-src'); 8378 } 8379 } 8380 8381 $imageEl.addClass(params.loadedClass).removeClass(params.loadingClass); 8382 $slideEl.find(`.${params.preloaderClass}`).remove(); 8383
8384 if (swiper.params.loop && loadInDuplicate) { 8385 const slideOriginalIndex = $slideEl.attr('data-swiper-slide-index'); 8386 8387 if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) { 8388 const originalSlide = swiper.$wrapperEl.children(`[data-swiper-slide-index="${slideOriginalIndex}"]:not(.${swiper.params.slideDuplicateClass})`); 8389 loadInSlide(originalSlide.index(), false); 8390 } else { 8391 const duplicatedSlide = swiper.$wrapperEl.children(`.${swiper.params.slideDuplicateClass}[data-swiper-slide-index="${slideOriginalIndex}"]`); 8392 loadInSlide(duplicatedSlide.index(), false); 8393 } 8394 } 8395 8396 emit('lazyImageReady', $slideEl[0], $imageEl[0]); 8397 8398 if (swiper.params.autoHeight) { 8399 swiper.updateAutoHeight(); 8400 } 8401 }); 8402 emit('lazyImageLoad', $slideEl[0], $imageEl[0]); 8403 }); 8404 } 8405 8406 function load() { 8407 const { 8408 $wrapperEl, 8409 params: swiperParams, 8410 slides, 8411 activeIndex 8412 } = swiper; 8413 const isVirtual = swiper.virtual && swiperParams.virtual.enabled; 8414 const params = swiperParams.lazy; 8415 let slidesPerView = swiperParams.slidesPerView; 8416 8417 if (slidesPerView === 'auto') { 8418 slidesPerView = 0; 8419 } 8420 8421 function slideExist(index) { 8422 if (isVirtual) { 8423 if ($wrapperEl.children(`.${swiperParams.slideClass}[data-swiper-slide-index="${index}"]`).length) { 8424 return true; 8425 } 8426 } else if (slides[index]) return true; 8427 8428 return false; 8429 } 8430 8431 function slideIndex(slideEl) { 8432 if (isVirtual) { 8433 return $(slideEl).attr('data-swiper-slide-index'); 8434 } 8435 8436 return $(slideEl).index(); 8437 } 8438 8439 if (!initialImageLoaded) initialImageLoaded = true; 8440 8441 if (swiper.params.watchSlidesProgress) { 8442 $wrapperEl.children(`.${swiperParams.slideVisibleClass}`).each(slideEl => { 8443 const index = isVirtual ? $(slideEl).attr('data-swiper-slide-index') : $(slideEl).index(); 8444 loadInSlide(index); 8445 }); 8446 } else if (slidesPerView > 1) { 8447 for (let i = activeIndex; i < activeIndex + slidesPerView; i += 1) { 8448 if (slideExist(i)) loadInSlide(i); 8449 } 8450 } else { 8451 loadInSlide(activeIndex); 8452 } 8453 8454 if (params.loadPrevNext) { 8455 if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) { 8456 const amount = params.loadPrevNextAmount; 8457 const spv = Math.ceil(slidesPerView); 8458 const maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length); 8459 const minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides 8460 8461 for (let i = activeIndex + spv; i < maxIndex; i += 1) { 8462 if (slideExist(i)) loadInSlide(i); 8463 } // Prev Slides 8464 8465 8466 for (let i = minIndex; i < activeIndex; i += 1) { 8467 if (slideExist(i)) loadInSlide(i); 8468 } 8469 } else { 8470 const nextSlide = $wrapperEl.children(`.${swiperParams.slideNextClass}`); 8471 if (nextSlide.length > 0) loadInSlide(slideIndex(nextSlide)); 8472 const prevSlide = $wrapperEl.children(`.${swiperParams.slidePrevClass}`); 8473 if (prevSlide.length > 0) loadInSlide(slideIndex(prevSlide)); 8474 } 8475 } 8476 } 8477 8478 function checkInViewOnLoad() { 8479 const window = getWindow(); 8480 if (!swiper || swiper.destroyed) return; 8481 const $scrollElement = swiper.params.lazy.scrollingElement ? $(swiper.params.lazy.scrollingElement) : $(window); 8482 const isWindow = $scrollElement[0] === window; 8483 const scrollElementWidth = isWindow ? window.innerWidth : $scrollElement[0].offsetWidth; 8484 const scrollElementHeight = isWindow ? window.innerHeight : $scrollElement[0].offsetHeight; 8485 const swiperOffset = swiper.$el.offset(); 8486 const { 8487 rtlTranslate: rtl 8488 } = swiper; 8489 let inView = false;
8490 if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; 8491 const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]]; 8492 8493 for (let i = 0; i < swiperCoord.length; i += 1) { 8494 const point = swiperCoord[i]; 8495 8496 if (point[0] >= 0 && point[0] <= scrollElementWidth && point[1] >= 0 && point[1] <= scrollElementHeight) { 8497 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 8498 8499 inView = true; 8500 } 8501 } 8502 8503 const passiveListener = swiper.touchEvents.start === 'touchstart' && swiper.support.passiveListener && swiper.params.passiveListeners ? { 8504 passive: true, 8505 capture: false 8506 } : false; 8507 8508 if (inView) { 8509 load(); 8510 $scrollElement.off('scroll', checkInViewOnLoad, passiveListener); 8511 } else if (!scrollHandlerAttached) { 8512 scrollHandlerAttached = true; 8513 $scrollElement.on('scroll', checkInViewOnLoad, passiveListener); 8514 } 8515 } 8516 8517 on('beforeInit', () => { 8518 if (swiper.params.lazy.enabled && swiper.params.preloadImages) { 8519 swiper.params.preloadImages = false; 8520 } 8521 }); 8522 on('init', () => { 8523 if (swiper.params.lazy.enabled) { 8524 if (swiper.params.lazy.checkInView) { 8525 checkInViewOnLoad(); 8526 } else { 8527 load(); 8528 } 8529 } 8530 }); 8531 on('scroll', () => { 8532 if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.freeMode.sticky) { 8533 load(); 8534 } 8535 }); 8536 on('scrollbarDragMove resize _freeModeNoMomentumRelease', () => { 8537 if (swiper.params.lazy.enabled) { 8538 if (swiper.params.lazy.checkInView) { 8539 checkInViewOnLoad(); 8540 } else { 8541 load(); 8542 } 8543 } 8544 }); 8545 on('transitionStart', () => { 8546 if (swiper.params.lazy.enabled) { 8547 if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !initialImageLoaded) { 8548 if (swiper.params.lazy.checkInView) { 8549 checkInViewOnLoad(); 8550 } else { 8551 load(); 8552 } 8553 } 8554 } 8555 }); 8556 on('transitionEnd', () => { 8557 if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) { 8558 if (swiper.params.lazy.checkInView) { 8559 checkInViewOnLoad(); 8560 } else { 8561 load(); 8562 } 8563 } 8564 }); 8565 on('slideChange', () => { 8566 const { 8567 lazy, 8568 cssMode, 8569 watchSlidesProgress, 8570 touchReleaseOnEdges, 8571 resistanceRatio 8572 } = swiper.params; 8573 8574 if (lazy.enabled && (cssMode || watchSlidesProgress && (touchReleaseOnEdges || resistanceRatio === 0))) { 8575 load(); 8576 } 8577 }); 8578 on('destroy', () => { 8579 if (!swiper.$el) return; 8580 swiper.$el.find(`.${swiper.params.lazy.loadingClass}`).removeClass(swiper.params.lazy.loadingClass); 8581 }); 8582 Object.assign(swiper.lazy, { 8583 load, 8584 loadInSlide 8585 }); 8586 } 8587 8588 /* eslint no-bitwise: ["error", { "allow": [">>"] }] */ 8589 function Controller(_ref) { 8590 let { 8591 swiper, 8592 extendParams, 8593 on 8594 } = _ref; 8595 extendParams({ 8596 controller: { 8597 control: undefined, 8598 inverse: false, 8599 by: 'slide' // or 'container' 8600 8601 } 8602 }); 8603 swiper.controller = { 8604 control: undefined 8605 }; 8606 8607 function LinearSpline(x, y) { 8608 const binarySearch = function search() { 8609 let maxIndex; 8610 let minIndex; 8611 let guess; 8612 return (array, val) => { 8613 minIndex = -1; 8614 maxIndex = array.length; 8615 8616 while (maxIndex - minIndex > 1) { 8617 guess = maxIndex + minIndex >> 1; 8618 8619 if (array[guess] <= val) { 8620 minIndex = guess; 8621 } else { 8622 maxIndex = guess; 8623 } 8624 } 8625
8626 return maxIndex; 8627 }; 8628 }(); 8629 8630 this.x = x; 8631 this.y = y; 8632 this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value: 8633 // (x1,y1) is the known point before given value, 8634 // (x3,y3) is the known point after given value. 8635 8636 let i1; 8637 let i3; 8638 8639 this.interpolate = function interpolate(x2) { 8640 if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2): 8641 8642 i3 = binarySearch(this.x, x2); 8643 i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already: 8644 // y2 := ((x2âx1) à (y3ây1)) ÷ (x3âx1) + y1 8645 8646 return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1]; 8647 }; 8648 8649 return this; 8650 } // xxx: for now i will just save one spline function to to 8651 8652 8653 function getInterpolateFunction(c) { 8654 if (!swiper.controller.spline) { 8655 swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid); 8656 } 8657 } 8658 8659 function setTranslate(_t, byController) { 8660 const controlled = swiper.controller.control; 8661 let multiplier; 8662 let controlledTranslate; 8663 const Swiper = swiper.constructor; 8664 8665 function setControlledTranslate(c) { 8666 // this will create an Interpolate function based on the snapGrids 8667 // x is the Grid of the scrolled scroller and y will be the controlled scroller 8668 // it makes sense to create this only once and recall it for the interpolation 8669 // the function does a lot of value caching for performance 8670 const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate; 8671 8672 if (swiper.params.controller.by === 'slide') { 8673 getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid 8674 // but it did not work out 8675 8676 controlledTranslate = -swiper.controller.spline.interpolate(-translate); 8677 } 8678 8679 if (!controlledTranslate || swiper.params.controller.by === 'container') { 8680 multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate()); 8681 controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate(); 8682 } 8683 8684 if (swiper.params.controller.inverse) { 8685 controlledTranslate = c.maxTranslate() - controlledTranslate; 8686 } 8687 8688 c.updateProgress(controlledTranslate); 8689 c.setTranslate(controlledTranslate, swiper); 8690 c.updateActiveIndex(); 8691 c.updateSlidesClasses(); 8692 } 8693 8694 if (Array.isArray(controlled)) { 8695 for (let i = 0; i < controlled.length; i += 1) { 8696 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 8697 setControlledTranslate(controlled[i]); 8698 } 8699 } 8700 } else if (controlled instanceof Swiper && byController !== controlled) { 8701 setControlledTranslate(controlled); 8702 } 8703 } 8704 8705 function setTransition(duration, byController) { 8706 const Swiper = swiper.constructor; 8707 const controlled = swiper.controller.control; 8708 let i; 8709 8710 function setControlledTransition(c) { 8711 c.setTransition(duration, swiper); 8712 8713 if (duration !== 0) { 8714 c.transitionStart(); 8715 8716 if (c.params.autoHeight) { 8717 nextTick(() => { 8718 c.updateAutoHeight(); 8719 }); 8720 } 8721 8722 c.$wrapperEl.transitionEnd(() => { 8723 if (!controlled) return; 8724 8725 if (c.params.loop && swiper.params.controller.by === 'slide') { 8726 c.loopFix(); 8727 } 8728 8729 c.transitionEnd(); 8730 }); 8731 } 8732 } 8733 8734 if (Array.isArray(controlled)) { 8735 for (i = 0; i < controlled.length; i += 1) { 8736 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 8737 setControlledTransition(controlled[i]); 8738 } 8739 } 8740 } else if (controlled instanceof Swiper && byController !== controlled) { 8741 setControlledTransition(controlled); 8742 } 8743 } 8744 8745 function removeSpline() { 8746 if (!swiper.controller.control) return; 8747 8748 if (swiper.controller.spline) { 8749 swiper.controller.spline = undefined; 8750 delete swiper.controller.spline; 8751 } 8752 } 8753 8754 on('beforeInit', () => { 8755 swiper.controller.control = swiper.params.controller.control; 8756 }); 8757 on('update', () => { 8758 removeSpline(); 8759 }); 8760 on('resize', () => { 8761 removeSpline(); 8762 }); 8763 on('observerUpdate', () => { 8764 removeSpline(); 8765 }); 8766 on('setTranslate', (_s, translate, byController) => { 8767 if (!swiper.controller.control) return; 8768 swiper.controller.setTranslate(translate, byController); 8769 }); 8770 on('setTransition', (_s, duration, byController) => { 8771 if (!swiper.controller.control) return; 8772 swiper.controller.setTransition(duration, byController); 8773 }); 8774 Object.assign(swiper.controller, { 8775 setTranslate, 8776 setTransition 8777 }); 8778 } 8779 8780 function A11y(_ref) { 8781 let { 8782 swiper, 8783 extendParams, 8784 on 8785 } = _ref; 8786 extendParams({ 8787 a11y: { 8788 enabled: true, 8789 notificationClass: 'swiper-notification', 8790 prevSlideMessage: 'Previous slide', 8791 nextSlideMessage: 'Next slide', 8792 firstSlideMessage: 'This is the first slide', 8793 lastSlideMessage: 'This is the last slide', 8794 paginationBulletMessage: 'Go to slide {{index}}', 8795 slideLabelMessage: '{{index}} / {{slidesLength}}', 8796 containerMessage: null, 8797 containerRoleDescriptionMessage: null, 8798 itemRoleDescriptionMessage: null, 8799 slideRole: 'group', 8800 id: null 8801 } 8802 }); 8803 let liveRegion = null; 8804 8805 function notify(message) { 8806 const notification = liveRegion; 8807 if (notification.length === 0) return; 8808 notification.html(''); 8809 notification.html(message); 8810 } 8811 8812 function getRandomNumber(size) { 8813 if (size === void 0) { 8814 size = 16; 8815 } 8816 8817 const randomChar = () => Math.round(16 * Math.random()).toString(16); 8818 8819 return 'x'.repeat(size).replace(/x/g, randomChar); 8820 } 8821 8822 function makeElFocusable($el) { 8823 $el.attr('tabIndex', '0'); 8824 } 8825 8826 function makeElNotFocusable($el) { 8827 $el.attr('tabIndex', '-1'); 8828 } 8829 8830 function addElRole($el, role) { 8831 $el.attr('role', role); 8832 } 8833 8834 function addElRoleDescription($el, description) { 8835 $el.attr('aria-roledescription', description); 8836 } 8837 8838 function addElControls($el, controls) { 8839 $el.attr('aria-controls', controls); 8840 } 8841 8842 function addElLabel($el, label) { 8843 $el.attr('aria-label', label); 8844 } 8845 8846 function addElId($el, id) { 8847 $el.attr('id', id); 8848 } 8849 8850 function addElLive($el, live) { 8851 $el.attr('aria-live', live); 8852 } 8853 8854 function disableEl($el) { 8855 $el.attr('aria-disabled', true); 8856 } 8857 8858 function enableEl($el) { 8859 $el.attr('aria-disabled', false); 8860 } 8861 8862 function onEnterOrSpaceKey(e) { 8863 if (e.keyCode !== 13 && e.keyCode !== 32) return; 8864 const params = swiper.params.a11y; 8865 const $targetEl = $(e.target); 8866 8867 if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) { 8868 if (!(swiper.isEnd && !swiper.params.loop)) { 8869 swiper.slideNext(); 8870 } 8871 8872 if (swiper.isEnd) { 8873 notify(params.lastSlideMessage); 8874 } else { 8875 notify(params.nextSlideMessage); 8876 } 8877 } 8878 8879 if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) { 8880 if (!(swiper.isBeginning && !swiper.params.loop)) { 8881 swiper.slidePrev(); 8882 } 8883 8884 if (swiper.isBeginning) { 8885 notify(params.firstSlideMessage); 8886 } else { 8887 notify(params.prevSlideMessage); 8888 } 8889 } 8890
8891 if (swiper.pagination && $targetEl.is(classesToSelector(swiper.params.pagination.bulletClass))) { 8892 $targetEl[0].click(); 8893 } 8894 } 8895 8896 function updateNavigation() { 8897 if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; 8898 const { 8899 $nextEl, 8900 $prevEl 8901 } = swiper.navigation; 8902 8903 if ($prevEl && $prevEl.length > 0) { 8904 if (swiper.isBeginning) { 8905 disableEl($prevEl); 8906 makeElNotFocusable($prevEl); 8907 } else { 8908 enableEl($prevEl); 8909 makeElFocusable($prevEl); 8910 } 8911 } 8912 8913 if ($nextEl && $nextEl.length > 0) { 8914 if (swiper.isEnd) { 8915 disableEl($nextEl); 8916 makeElNotFocusable($nextEl); 8917 } else { 8918 enableEl($nextEl); 8919 makeElFocusable($nextEl); 8920 } 8921 } 8922 } 8923 8924 function hasPagination() { 8925 return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; 8926 } 8927 8928 function hasClickablePagination() { 8929 return hasPagination() && swiper.params.pagination.clickable; 8930 } 8931 8932 function updatePagination() { 8933 const params = swiper.params.a11y; 8934 if (!hasPagination()) return; 8935 swiper.pagination.bullets.each(bulletEl => { 8936 const $bulletEl = $(bulletEl); 8937 8938 if (swiper.params.pagination.clickable) { 8939 makeElFocusable($bulletEl); 8940 8941 if (!swiper.params.pagination.renderBullet) { 8942 addElRole($bulletEl, 'button'); 8943 addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1)); 8944 } 8945 } 8946 8947 if ($bulletEl.is(`.${swiper.params.pagination.bulletActiveClass}`)) { 8948 $bulletEl.attr('aria-current', 'true'); 8949 } else { 8950 $bulletEl.removeAttr('aria-current'); 8951 } 8952 }); 8953 } 8954 8955 const initNavEl = ($el, wrapperId, message) => { 8956 makeElFocusable($el); 8957 8958 if ($el[0].tagName !== 'BUTTON') { 8959 addElRole($el, 'button'); 8960 $el.on('keydown', onEnterOrSpaceKey); 8961 } 8962 8963 addElLabel($el, message); 8964 addElControls($el, wrapperId); 8965 }; 8966 8967 const handleFocus = e => { 8968 const slideEl = e.target.closest(`.${swiper.params.slideClass}`); 8969 if (!slideEl || !swiper.slides.includes(slideEl)) return; 8970 const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex; 8971 const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl); 8972 if (isActive || isVisible) return; 8973 swiper.slideTo(swiper.slides.indexOf(slideEl), 0); 8974 }; 8975 8976 const initSlides = () => { 8977 const params = swiper.params.a11y; 8978 8979 if (params.itemRoleDescriptionMessage) { 8980 addElRoleDescription($(swiper.slides), params.itemRoleDescriptionMessage); 8981 } 8982 8983 if (params.slideRole) { 8984 addElRole($(swiper.slides), params.slideRole); 8985 } 8986 8987 const slidesLength = swiper.params.loop ? swiper.slides.filter(el => !el.classList.contains(swiper.params.slideDuplicateClass)).length : swiper.slides.length; 8988 8989 if (params.slideLabelMessage) { 8990 swiper.slides.each((slideEl, index) => { 8991 const $slideEl = $(slideEl); 8992 const slideIndex = swiper.params.loop ? parseInt($slideEl.attr('data-swiper-slide-index'), 10) : index; 8993 const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); 8994 addElLabel($slideEl, ariaLabelMessage); 8995 }); 8996 } 8997 }; 8998 8999 const init = () => { 9000 const params = swiper.params.a11y; 9001 swiper.$el.append(liveRegion); // Container 9002 9003 const $containerEl = swiper.$el; 9004 9005 if (params.containerRoleDescriptionMessage) { 9006 addElRoleDescription($containerEl, params.containerRoleDescriptionMessage); 9007 } 9008 9009 if (params.containerMessage) { 9010 addElLabel($containerEl, params.containerMessage); 9011 } // Wrapper 9012 9013 9014 const $wrapperEl = swiper.$wrapperEl; 9015 const wrapperId = params.id || $wrapperEl.attr('id') || `swiper-wrapper-${getRandomNumber(16)}`; 9016 const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; 9017 addElId($wrapperEl, wrapperId); 9018 addElLive($wrapperEl, live); // Slide 9019 9020 initSlides(); // Navigation 9021 9022 let $nextEl; 9023 let $prevEl; 9024 9025 if (swiper.navigation && swiper.navigation.$nextEl) { 9026 $nextEl = swiper.navigation.$nextEl; 9027 } 9028 9029 if (swiper.navigation && swiper.navigation.$prevEl) { 9030 $prevEl = swiper.navigation.$prevEl; 9031 } 9032 9033 if ($nextEl && $nextEl.length) { 9034 initNavEl($nextEl, wrapperId, params.nextSlideMessage); 9035 } 9036 9037 if ($prevEl && $prevEl.length) { 9038 initNavEl($prevEl, wrapperId, params.prevSlideMessage); 9039 } // Pagination 9040 9041 9042 if (hasClickablePagination()) { 9043 swiper.pagination.$el.on('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); 9044 } // Tab focus 9045 9046 9047 swiper.$el.on('focus', handleFocus, true); 9048 }; 9049 9050 function destroy() { 9051 if (liveRegion && liveRegion.length > 0) liveRegion.remove(); 9052 let $nextEl; 9053 let $prevEl; 9054 9055 if (swiper.navigation && swiper.navigation.$nextEl) { 9056 $nextEl = swiper.navigation.$nextEl; 9057 } 9058 9059 if (swiper.navigation && swiper.navigation.$prevEl) { 9060 $prevEl = swiper.navigation.$prevEl; 9061 } 9062 9063 if ($nextEl) { 9064 $nextEl.off('keydown', onEnterOrSpaceKey); 9065 } 9066 9067 if ($prevEl) { 9068 $prevEl.off('keydown', onEnterOrSpaceKey); 9069 } // Pagination 9070 9071 9072 if (hasClickablePagination()) { 9073 swiper.pagination.$el.off('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); 9074 } // Tab focus 9075 9076 9077 swiper.$el.off('focus', handleFocus, true); 9078 } 9079 9080 on('beforeInit', () => { 9081 liveRegion = $(`<span class="${swiper.params.a11y.notificationClass}
vendor: 5,355 bytes, lines 9081-9268
9081" aria-live="assertive" aria-atomic="true"></span>`); 9082 }); 9083 on('afterInit', () => { 9084 if (!swiper.params.a11y.enabled) return; 9085 init(); 9086 }); 9087 on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => { 9088 if (!swiper.params.a11y.enabled) return; 9089 initSlides(); 9090 }); 9091 on('fromEdge toEdge afterInit lock unlock', () => { 9092 if (!swiper.params.a11y.enabled) return; 9093 updateNavigation(); 9094 }); 9095 on('paginationUpdate', () => { 9096 if (!swiper.params.a11y.enabled) return; 9097 updatePagination(); 9098 }); 9099 on('destroy', () => { 9100 if (!swiper.params.a11y.enabled) return; 9101 destroy(); 9102 }); 9103 } 9104 9105 function History(_ref) { 9106 let { 9107 swiper, 9108 extendParams, 9109 on 9110 } = _ref; 9111 extendParams({ 9112 history: { 9113 enabled: false, 9114 root: '', 9115 replaceState: false, 9116 key: 'slides', 9117 keepQuery: false 9118 } 9119 }); 9120 let initialized = false; 9121 let paths = {}; 9122 9123 const slugify = text => { 9124 return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); 9125 }; 9126 9127 const getPathValues = urlOverride => { 9128 const window = getWindow(); 9129 let location; 9130 9131 if (urlOverride) { 9132 location = new URL(urlOverride); 9133 } else { 9134 location = window.location; 9135 } 9136 9137 const pathArray = location.pathname.slice(1).split('/').filter(part => part !== ''); 9138 const total = pathArray.length; 9139 const key = pathArray[total - 2]; 9140 const value = pathArray[total - 1]; 9141 return { 9142 key, 9143 value 9144 }; 9145 }; 9146 9147 const setHistory = (key, index) => { 9148 const window = getWindow(); 9149 if (!initialized || !swiper.params.history.enabled) return; 9150 let location; 9151 9152 if (swiper.params.url) { 9153 location = new URL(swiper.params.url); 9154 } else { 9155 location = window.location; 9156 } 9157 9158 const slide = swiper.slides.eq(index); 9159 let value = slugify(slide.attr('data-history')); 9160 9161 if (swiper.params.history.root.length > 0) { 9162 let root = swiper.params.history.root; 9163 if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1); 9164 value = `${root}/${key}/${value}`; 9165 } else if (!location.pathname.includes(key)) { 9166 value = `${key}/${value}`; 9167 } 9168 9169 if (swiper.params.history.keepQuery) { 9170 value += location.search; 9171 } 9172 9173 const currentState = window.history.state; 9174 9175 if (currentState && currentState.value === value) { 9176 return; 9177 } 9178 9179 if (swiper.params.history.replaceState) { 9180 window.history.replaceState({ 9181 value 9182 }, null, value); 9183 } else { 9184 window.history.pushState({ 9185 value 9186 }, null, value); 9187 } 9188 }; 9189 9190 const scrollToSlide = (speed, value, runCallbacks) => { 9191 if (value) { 9192 for (let i = 0, length = swiper.slides.length; i < length; i += 1) { 9193 const slide = swiper.slides.eq(i); 9194 const slideHistory = slugify(slide.attr('data-history')); 9195 9196 if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) { 9197 const index = slide.index(); 9198 swiper.slideTo(index, speed, runCallbacks); 9199 } 9200 } 9201 } else { 9202 swiper.slideTo(0, speed, runCallbacks); 9203 } 9204 }; 9205 9206 const setHistoryPopState = () => { 9207 paths = getPathValues(swiper.params.url); 9208 scrollToSlide(swiper.params.speed, paths.value, false); 9209 }; 9210 9211 const init = () => { 9212 const window = getWindow(); 9213 if (!swiper.params.history) return; 9214 9215 if (!window.history || !window.history.pushState) { 9216 swiper.params.history.enabled = false; 9217 swiper.params.hashNavigation.enabled = true; 9218 return; 9219 } 9220 9221 initialized = true; 9222 paths = getPathValues(swiper.params.url); 9223 if (!paths.key && !paths.value) return; 9224 scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit); 9225 9226 if (!swiper.params.history.replaceState) { 9227 window.addEventListener('popstate', setHistoryPopState); 9228 } 9229 }; 9230 9231 const destroy = () => { 9232 const window = getWindow(); 9233 9234 if (!swiper.params.history.replaceState) { 9235 window.removeEventListener('popstate', setHistoryPopState); 9236 } 9237 }; 9238 9239 on('init', () => { 9240 if (swiper.params.history.enabled) { 9241 init(); 9242 } 9243 }); 9244 on('destroy', () => { 9245 if (swiper.params.history.enabled) { 9246 destroy(); 9247 } 9248 }); 9249 on('transitionEnd _freeModeNoMomentumRelease', () => { 9250 if (initialized) { 9251 setHistory(swiper.params.history.key, swiper.activeIndex); 9252 } 9253 }); 9254 on('slideChange', () => { 9255 if (initialized && swiper.params.cssMode) { 9256 setHistory(swiper.params.history.key, swiper.activeIndex); 9257 } 9258 }); 9259 } 9260 9261 function HashNavigation(_ref) { 9262 let { 9263 swiper, 9264 extendParams, 9265 emit, 9266 on 9267 } = _ref; 9268 let initialized = false;
9269 const document = getDocument(); 9270 const window = getWindow(); 9271 extendParams({ 9272 hashNavigation: { 9273 enabled: false, 9274 replaceState: false, 9275 watchState: false 9276 } 9277 }); 9278 9279 const onHashChange = () => { 9280 emit('hashChange'); 9281 const newHash = document.location.hash.replace('#', ''); 9282 const activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash'); 9283 9284 if (newHash !== activeSlideHash) { 9285 const newIndex = swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-hash="${newHash}"]`).index(); 9286 if (typeof newIndex === 'undefined') return; 9287 swiper.slideTo(newIndex); 9288 } 9289 }; 9290 9291 const setHash = () => { 9292 if (!initialized || !swiper.params.hashNavigation.enabled) return; 9293 9294 if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) { 9295 window.history.replaceState(null, null, `#${swiper.slides.eq(swiper.activeIndex).attr('data-hash')}` || ''); 9296 emit('hashSet'); 9297 } else { 9298 const slide = swiper.slides.eq(swiper.activeIndex); 9299 const hash = slide.attr('data-hash') || slide.attr('data-history'); 9300 document.location.hash = hash || ''; 9301 emit('hashSet'); 9302 } 9303 }; 9304 9305 const init = () => { 9306 if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return; 9307 initialized = true; 9308 const hash = document.location.hash.replace('#', ''); 9309 9310 if (hash) { 9311 const speed = 0; 9312 9313 for (let i = 0, length = swiper.slides.length; i < length; i += 1) { 9314 const slide = swiper.slides.eq(i); 9315 const slideHash = slide.attr('data-hash') || slide.attr('data-history'); 9316 9317 if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) { 9318 const index = slide.index(); 9319 swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true); 9320 } 9321 } 9322 } 9323 9324 if (swiper.params.hashNavigation.watchState) { 9325 $(window).on('hashchange', onHashChange); 9326 } 9327 }; 9328 9329 const destroy = () => { 9330 if (swiper.params.hashNavigation.watchState) { 9331 $(window).off('hashchange', onHashChange); 9332 } 9333 }; 9334 9335 on('init', () => { 9336 if (swiper.params.hashNavigation.enabled) { 9337 init(); 9338 } 9339 }); 9340 on('destroy', () => { 9341 if (swiper.params.hashNavigation.enabled) { 9342 destroy(); 9343 } 9344 }); 9345 on('transitionEnd _freeModeNoMomentumRelease', () => { 9346 if (initialized) { 9347 setHash(); 9348 } 9349 }); 9350 on('slideChange', () => { 9351 if (initialized && swiper.params.cssMode) { 9352 setHash(); 9353 } 9354 }); 9355 } 9356 9357 /* eslint no-underscore-dangle: "off" */ 9358 function Autoplay(_ref) { 9359 let { 9360 swiper, 9361 extendParams, 9362 on, 9363 emit 9364 } = _ref; 9365 let timeout; 9366 swiper.autoplay = { 9367 running: false, 9368 paused: false 9369 }; 9370 extendParams({ 9371 autoplay: { 9372 enabled: false, 9373 delay: 3000, 9374 waitForTransition: true, 9375 disableOnInteraction: true, 9376 stopOnLastSlide: false, 9377 reverseDirection: false, 9378 pauseOnMouseEnter: false 9379 } 9380 }); 9381 9382 function run() { 9383 const $activeSlideEl = swiper.slides.eq(swiper.activeIndex); 9384 let delay = swiper.params.autoplay.delay; 9385 9386 if ($activeSlideEl.attr('data-swiper-autoplay')) { 9387 delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay; 9388 } 9389 9390 clearTimeout(timeout); 9391 timeout = nextTick(() => { 9392 let autoplayResult; 9393 9394 if (swiper.params.autoplay.reverseDirection) { 9395 if (swiper.params.loop) { 9396 swiper.loopFix(); 9397 autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); 9398 emit('autoplay'); 9399 } else if (!swiper.isBeginning) { 9400 autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); 9401 emit('autoplay'); 9402 } else if (!swiper.params.autoplay.stopOnLastSlide) { 9403 autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true); 9404 emit('autoplay'); 9405 } else { 9406 stop(); 9407 } 9408 } else if (swiper.params.loop) { 9409 swiper.loopFix(); 9410 autoplayResult = swiper.slideNext(swiper.params.speed, true, true); 9411 emit('autoplay'); 9412 } else if (!swiper.isEnd) { 9413 autoplayResult = swiper.slideNext(swiper.params.speed, true, true); 9414 emit('autoplay'); 9415 } else if (!swiper.params.autoplay.stopOnLastSlide) { 9416 autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true); 9417 emit('autoplay'); 9418 } else { 9419 stop(); 9420 } 9421 9422 if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) { 9423 run(); 9424 } 9425 }, delay); 9426 } 9427 9428 function start() { 9429 if (typeof timeout !== 'undefined') return false;
vendor: 4,501 bytes, lines 9430-9594
9430 if (swiper.autoplay.running) return false; 9431 swiper.autoplay.running = true; 9432 emit('autoplayStart'); 9433 run(); 9434 return true; 9435 } 9436 9437 function stop() { 9438 if (!swiper.autoplay.running) return false; 9439 if (typeof timeout === 'undefined') return false; 9440 9441 if (timeout) { 9442 clearTimeout(timeout); 9443 timeout = undefined; 9444 } 9445 9446 swiper.autoplay.running = false; 9447 emit('autoplayStop'); 9448 return true; 9449 } 9450 9451 function pause(speed) { 9452 if (!swiper.autoplay.running) return; 9453 if (swiper.autoplay.paused) return; 9454 if (timeout) clearTimeout(timeout); 9455 swiper.autoplay.paused = true; 9456 9457 if (speed === 0 || !swiper.params.autoplay.waitForTransition) { 9458 swiper.autoplay.paused = false; 9459 run(); 9460 } else { 9461 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 9462 swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd); 9463 }); 9464 } 9465 } 9466 9467 function onVisibilityChange() { 9468 const document = getDocument(); 9469 9470 if (document.visibilityState === 'hidden' && swiper.autoplay.running) { 9471 pause(); 9472 } 9473 9474 if (document.visibilityState === 'visible' && swiper.autoplay.paused) { 9475 run(); 9476 swiper.autoplay.paused = false; 9477 } 9478 } 9479 9480 function onTransitionEnd(e) { 9481 if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return; 9482 if (e.target !== swiper.$wrapperEl[0]) return; 9483 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 9484 swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); 9485 }); 9486 swiper.autoplay.paused = false; 9487 9488 if (!swiper.autoplay.running) { 9489 stop(); 9490 } else { 9491 run(); 9492 } 9493 } 9494 9495 function onMouseEnter() { 9496 if (swiper.params.autoplay.disableOnInteraction) { 9497 stop(); 9498 } else { 9499 emit('autoplayPause'); 9500 pause(); 9501 } 9502 9503 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 9504 swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); 9505 }); 9506 } 9507 9508 function onMouseLeave() { 9509 if (swiper.params.autoplay.disableOnInteraction) { 9510 return; 9511 } 9512 9513 swiper.autoplay.paused = false; 9514 emit('autoplayResume'); 9515 run(); 9516 } 9517 9518 function attachMouseEvents() { 9519 if (swiper.params.autoplay.pauseOnMouseEnter) { 9520 swiper.$el.on('mouseenter', onMouseEnter); 9521 swiper.$el.on('mouseleave', onMouseLeave); 9522 } 9523 } 9524 9525 function detachMouseEvents() { 9526 swiper.$el.off('mouseenter', onMouseEnter); 9527 swiper.$el.off('mouseleave', onMouseLeave); 9528 } 9529 9530 on('init', () => { 9531 if (swiper.params.autoplay.enabled) { 9532 start(); 9533 const document = getDocument(); 9534 document.addEventListener('visibilitychange', onVisibilityChange); 9535 attachMouseEvents(); 9536 } 9537 }); 9538 on('beforeTransitionStart', (_s, speed, internal) => { 9539 if (swiper.autoplay.running) { 9540 if (internal || !swiper.params.autoplay.disableOnInteraction) { 9541 swiper.autoplay.pause(speed); 9542 } else { 9543 stop(); 9544 } 9545 } 9546 }); 9547 on('sliderFirstMove', () => { 9548 if (swiper.autoplay.running) { 9549 if (swiper.params.autoplay.disableOnInteraction) { 9550 stop(); 9551 } else { 9552 pause(); 9553 } 9554 } 9555 }); 9556 on('touchEnd', () => { 9557 if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) { 9558 run(); 9559 } 9560 }); 9561 on('destroy', () => { 9562 detachMouseEvents(); 9563 9564 if (swiper.autoplay.running) { 9565 stop(); 9566 } 9567 9568 const document = getDocument(); 9569 document.removeEventListener('visibilitychange', onVisibilityChange); 9570 }); 9571 Object.assign(swiper.autoplay, { 9572 pause, 9573 run, 9574 start, 9575 stop 9576 }); 9577 } 9578 9579 function Thumb(_ref) { 9580 let { 9581 swiper, 9582 extendParams, 9583 on 9584 } = _ref; 9585 extendParams({ 9586 thumbs: { 9587 swiper: null, 9588 multipleActiveThumbs: true, 9589 autoScrollOffset: 0, 9590 slideThumbActiveClass: 'swiper-slide-thumb-active', 9591 thumbsContainerClass: 'swiper-thumbs' 9592 } 9593 }); 9594 let initialized = false;
9595 let swiperCreated = false; 9596 swiper.thumbs = { 9597 swiper: null 9598 }; 9599 9600 function onThumbClick() { 9601 const thumbsSwiper = swiper.thumbs.swiper; 9602 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 9603 const clickedIndex = thumbsSwiper.clickedIndex; 9604 const clickedSlide = thumbsSwiper.clickedSlide; 9605 if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return; 9606 if (typeof clickedIndex === 'undefined' || clickedIndex === null) return; 9607 let slideToIndex; 9608 9609 if (thumbsSwiper.params.loop) { 9610 slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10); 9611 } else { 9612 slideToIndex = clickedIndex; 9613 } 9614 9615 if (swiper.params.loop) { 9616 let currentIndex = swiper.activeIndex; 9617 9618 if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) { 9619 swiper.loopFix(); // eslint-disable-next-line 9620 9621 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 9622 currentIndex = swiper.activeIndex; 9623 } 9624 9625 const prevIndex = swiper.slides.eq(currentIndex).prevAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); 9626 const nextIndex = swiper.slides.eq(currentIndex).nextAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); 9627 if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex; 9628 } 9629 9630 swiper.slideTo(slideToIndex); 9631 } 9632 9633 function init() { 9634 const { 9635 thumbs: thumbsParams 9636 } = swiper.params; 9637 if (initialized) return false; 9638 initialized = true; 9639 const SwiperClass = swiper.constructor; 9640 9641 if (thumbsParams.swiper instanceof SwiperClass) { 9642 swiper.thumbs.swiper = thumbsParams.swiper; 9643 Object.assign(swiper.thumbs.swiper.originalParams, { 9644 watchSlidesProgress: true, 9645 slideToClickedSlide: false 9646 }); 9647 Object.assign(swiper.thumbs.swiper.params, { 9648 watchSlidesProgress: true, 9649 slideToClickedSlide: false 9650 }); 9651 } else if (isObject(thumbsParams.swiper)) { 9652 const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper); 9653 Object.assign(thumbsSwiperParams, { 9654 watchSlidesProgress: true, 9655 slideToClickedSlide: false 9656 }); 9657 swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams); 9658 swiperCreated = true; 9659 } 9660 9661 swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass); 9662 swiper.thumbs.swiper.on('tap', onThumbClick); 9663 return true; 9664 } 9665 9666 function update(initial) { 9667 const thumbsSwiper = swiper.thumbs.swiper; 9668 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 9669 const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; // Activate thumbs 9670 9671 let thumbsToActivate = 1; 9672 const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass; 9673 9674 if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) { 9675 thumbsToActivate = swiper.params.slidesPerView; 9676 } 9677 9678 if (!swiper.params.thumbs.multipleActiveThumbs) { 9679 thumbsToActivate = 1; 9680 } 9681 9682 thumbsToActivate = Math.floor(thumbsToActivate); 9683 thumbsSwiper.slides.removeClass(thumbActiveClass); 9684 9685 if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) { 9686 for (let i = 0; i < thumbsToActivate; i += 1) { 9687 thumbsSwiper.$wrapperEl.children(`[data-swiper-slide-index="${swiper.realIndex + i}"]`).addClass(thumbActiveClass); 9688 } 9689 } else { 9690 for (let i = 0; i < thumbsToActivate; i += 1) {
9691 thumbsSwiper.slides.eq(swiper.realIndex + i).addClass(thumbActiveClass); 9692 } 9693 } 9694 9695 const autoScrollOffset = swiper.params.thumbs.autoScrollOffset; 9696 const useOffset = autoScrollOffset && !thumbsSwiper.params.loop; 9697 9698 if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) { 9699 let currentThumbsIndex = thumbsSwiper.activeIndex; 9700 let newThumbsIndex; 9701 let direction; 9702 9703 if (thumbsSwiper.params.loop) { 9704 if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) { 9705 thumbsSwiper.loopFix(); // eslint-disable-next-line 9706 9707 thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft; 9708 currentThumbsIndex = thumbsSwiper.activeIndex; 9709 } // Find actual thumbs index to slide to 9710 9711 9712 const prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); 9713 const nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); 9714 9715 if (typeof prevThumbsIndex === 'undefined') { 9716 newThumbsIndex = nextThumbsIndex; 9717 } else if (typeof nextThumbsIndex === 'undefined') { 9718 newThumbsIndex = prevThumbsIndex; 9719 } else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) { 9720 newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex; 9721 } else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) { 9722 newThumbsIndex = nextThumbsIndex; 9723 } else { 9724 newThumbsIndex = prevThumbsIndex; 9725 } 9726 9727 direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev'; 9728 } else { 9729 newThumbsIndex = swiper.realIndex; 9730 direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev'; 9731 } 9732 9733 if (useOffset) { 9734 newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset; 9735 } 9736 9737 if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) { 9738 if (thumbsSwiper.params.centeredSlides) { 9739 if (newThumbsIndex > currentThumbsIndex) { 9740 newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1; 9741 } else { 9742 newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1; 9743 } 9744 } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ; 9745 9746 thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined); 9747 } 9748 } 9749 } 9750 9751 on('beforeInit', () => { 9752 const { 9753 thumbs 9754 } = swiper.params; 9755 if (!thumbs || !thumbs.swiper) return; 9756 init(); 9757 update(true); 9758 }); 9759 on('slideChange update resize observerUpdate', () => { 9760 update(); 9761 }); 9762 on('setTransition', (_s, duration) => { 9763 const thumbsSwiper = swiper.thumbs.swiper; 9764 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 9765 thumbsSwiper.setTransition(duration); 9766 }); 9767 on('beforeDestroy', () => { 9768 const thumbsSwiper = swiper.thumbs.swiper; 9769 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 9770 9771 if (swiperCreated) { 9772 thumbsSwiper.destroy(); 9773 } 9774 }); 9775 Object.assign(swiper.thumbs, { 9776 init, 9777 update 9778 }); 9779 } 9780 9781 function freeMode(_ref) { 9782 let { 9783 swiper, 9784 extendParams, 9785 emit, 9786 once 9787 } = _ref; 9788 extendParams({ 9789 freeMode: { 9790 enabled: false, 9791 momentum: true, 9792 momentumRatio: 1, 9793 momentumBounce: true, 9794 momentumBounceRatio: 1, 9795 momentumVelocityRatio: 1, 9796 sticky: false, 9797 minimumVelocity: 0.02 9798 } 9799 }); 9800 9801 function onTouchStart() { 9802 const translate = swiper.getTranslate(); 9803 swiper.setTranslate(translate); 9804 swiper.setTransition(0); 9805 swiper.touchEventsData.velocities.length = 0; 9806 swiper.freeMode.onTouchEnd({
vendor: 8,546 bytes, lines 9807-10049
9807 currentPos: swiper.rtl ? swiper.translate : -swiper.translate 9808 }); 9809 } 9810 9811 function onTouchMove() { 9812 const { 9813 touchEventsData: data, 9814 touches 9815 } = swiper; // Velocity 9816 9817 if (data.velocities.length === 0) { 9818 data.velocities.push({ 9819 position: touches[swiper.isHorizontal() ? 'startX' : 'startY'], 9820 time: data.touchStartTime 9821 }); 9822 } 9823 9824 data.velocities.push({ 9825 position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'], 9826 time: now() 9827 }); 9828 } 9829 9830 function onTouchEnd(_ref2) { 9831 let { 9832 currentPos 9833 } = _ref2; 9834 const { 9835 params, 9836 $wrapperEl, 9837 rtlTranslate: rtl, 9838 snapGrid, 9839 touchEventsData: data 9840 } = swiper; // Time diff 9841 9842 const touchEndTime = now(); 9843 const timeDiff = touchEndTime - data.touchStartTime; 9844 9845 if (currentPos < -swiper.minTranslate()) { 9846 swiper.slideTo(swiper.activeIndex); 9847 return; 9848 } 9849 9850 if (currentPos > -swiper.maxTranslate()) { 9851 if (swiper.slides.length < snapGrid.length) { 9852 swiper.slideTo(snapGrid.length - 1); 9853 } else { 9854 swiper.slideTo(swiper.slides.length - 1); 9855 } 9856 9857 return; 9858 } 9859 9860 if (params.freeMode.momentum) { 9861 if (data.velocities.length > 1) { 9862 const lastMoveEvent = data.velocities.pop(); 9863 const velocityEvent = data.velocities.pop(); 9864 const distance = lastMoveEvent.position - velocityEvent.position; 9865 const time = lastMoveEvent.time - velocityEvent.time; 9866 swiper.velocity = distance / time; 9867 swiper.velocity /= 2; 9868 9869 if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) { 9870 swiper.velocity = 0; 9871 } // this implies that the user stopped moving a finger then released. 9872 // There would be no events with distance zero, so the last event is stale. 9873 9874 9875 if (time > 150 || now() - lastMoveEvent.time > 300) { 9876 swiper.velocity = 0; 9877 } 9878 } else { 9879 swiper.velocity = 0; 9880 } 9881 9882 swiper.velocity *= params.freeMode.momentumVelocityRatio; 9883 data.velocities.length = 0; 9884 let momentumDuration = 1000 * params.freeMode.momentumRatio; 9885 const momentumDistance = swiper.velocity * momentumDuration; 9886 let newPosition = swiper.translate + momentumDistance; 9887 if (rtl) newPosition = -newPosition; 9888 let doBounce = false; 9889 let afterBouncePosition; 9890 const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio; 9891 let needsLoopFix; 9892 9893 if (newPosition < swiper.maxTranslate()) { 9894 if (params.freeMode.momentumBounce) { 9895 if (newPosition + swiper.maxTranslate() < -bounceAmount) { 9896 newPosition = swiper.maxTranslate() - bounceAmount; 9897 } 9898 9899 afterBouncePosition = swiper.maxTranslate(); 9900 doBounce = true; 9901 data.allowMomentumBounce = true; 9902 } else { 9903 newPosition = swiper.maxTranslate(); 9904 } 9905 9906 if (params.loop && params.centeredSlides) needsLoopFix = true; 9907 } else if (newPosition > swiper.minTranslate()) { 9908 if (params.freeMode.momentumBounce) { 9909 if (newPosition - swiper.minTranslate() > bounceAmount) { 9910 newPosition = swiper.minTranslate() + bounceAmount; 9911 } 9912 9913 afterBouncePosition = swiper.minTranslate(); 9914 doBounce = true; 9915 data.allowMomentumBounce = true; 9916 } else { 9917 newPosition = swiper.minTranslate(); 9918 } 9919 9920 if (params.loop && params.centeredSlides) needsLoopFix = true; 9921 } else if (params.freeMode.sticky) { 9922 let nextSlide; 9923 9924 for (let j = 0; j < snapGrid.length; j += 1) { 9925 if (snapGrid[j] > -newPosition) { 9926 nextSlide = j; 9927 break; 9928 } 9929 } 9930 9931 if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') { 9932 newPosition = snapGrid[nextSlide]; 9933 } else { 9934 newPosition = snapGrid[nextSlide - 1]; 9935 } 9936 9937 newPosition = -newPosition; 9938 } 9939 9940 if (needsLoopFix) { 9941 once('transitionEnd', () => { 9942 swiper.loopFix(); 9943 }); 9944 } // Fix duration 9945 9946 9947 if (swiper.velocity !== 0) { 9948 if (rtl) { 9949 momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity); 9950 } else { 9951 momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity); 9952 } 9953 9954 if (params.freeMode.sticky) { 9955 // If freeMode.sticky is active and the user ends a swipe with a slow-velocity 9956 // event, then durations can be 20+ seconds to slide one (or zero!) slides. 9957 // It's easy to see this when simulating touch with mouse events. To fix this, 9958 // limit single-slide swipes to the default slide duration. This also has the 9959 // nice side effect of matching slide speed if the user stopped moving before 9960 // lifting finger or mouse vs. moving slowly before lifting the finger/mouse. 9961 // For faster swipes, also apply limits (albeit higher ones). 9962 const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate); 9963 const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex]; 9964 9965 if (moveDistance < currentSlideSize) { 9966 momentumDuration = params.speed; 9967 } else if (moveDistance < 2 * currentSlideSize) { 9968 momentumDuration = params.speed * 1.5; 9969 } else { 9970 momentumDuration = params.speed * 2.5; 9971 } 9972 } 9973 } else if (params.freeMode.sticky) { 9974 swiper.slideToClosest(); 9975 return; 9976 } 9977 9978 if (params.freeMode.momentumBounce && doBounce) { 9979 swiper.updateProgress(afterBouncePosition); 9980 swiper.setTransition(momentumDuration); 9981 swiper.setTranslate(newPosition); 9982 swiper.transitionStart(true, swiper.swipeDirection); 9983 swiper.animating = true; 9984 $wrapperEl.transitionEnd(() => { 9985 if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return; 9986 emit('momentumBounce'); 9987 swiper.setTransition(params.speed); 9988 setTimeout(() => { 9989 swiper.setTranslate(afterBouncePosition); 9990 $wrapperEl.transitionEnd(() => { 9991 if (!swiper || swiper.destroyed) return; 9992 swiper.transitionEnd(); 9993 }); 9994 }, 0); 9995 }); 9996 } else if (swiper.velocity) { 9997 emit('_freeModeNoMomentumRelease'); 9998 swiper.updateProgress(newPosition); 9999 swiper.setTransition(momentumDuration); 10000 swiper.setTranslate(newPosition); 10001 swiper.transitionStart(true, swiper.swipeDirection); 10002 10003 if (!swiper.animating) { 10004 swiper.animating = true; 10005 $wrapperEl.transitionEnd(() => { 10006 if (!swiper || swiper.destroyed) return; 10007 swiper.transitionEnd(); 10008 }); 10009 } 10010 } else { 10011 swiper.updateProgress(newPosition); 10012 } 10013 10014 swiper.updateActiveIndex(); 10015 swiper.updateSlidesClasses(); 10016 } else if (params.freeMode.sticky) { 10017 swiper.slideToClosest(); 10018 return; 10019 } else if (params.freeMode) { 10020 emit('_freeModeNoMomentumRelease'); 10021 } 10022 10023 if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) { 10024 swiper.updateProgress(); 10025 swiper.updateActiveIndex(); 10026 swiper.updateSlidesClasses(); 10027 } 10028 } 10029 10030 Object.assign(swiper, { 10031 freeMode: { 10032 onTouchStart, 10033 onTouchMove, 10034 onTouchEnd 10035 } 10036 }); 10037 } 10038 10039 function Grid(_ref) { 10040 let { 10041 swiper, 10042 extendParams 10043 } = _ref; 10044 extendParams({ 10045 grid: { 10046 rows: 1, 10047 fill: 'column' 10048 } 10049 });
10050 let slidesNumberEvenToRows; 10051 let slidesPerRow; 10052 let numFullColumns; 10053 10054 const initSlides = slidesLength => { 10055 const { 10056 slidesPerView 10057 } = swiper.params; 10058 const { 10059 rows, 10060 fill 10061 } = swiper.params.grid; 10062 slidesPerRow = slidesNumberEvenToRows / rows; 10063 numFullColumns = Math.floor(slidesLength / rows); 10064 10065 if (Math.floor(slidesLength / rows) === slidesLength / rows) { 10066 slidesNumberEvenToRows = slidesLength; 10067 } else { 10068 slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows; 10069 } 10070 10071 if (slidesPerView !== 'auto' && fill === 'row') { 10072 slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows); 10073 } 10074 }; 10075 10076 const updateSlide = (i, slide, slidesLength, getDirectionLabel) => { 10077 const { 10078 slidesPerGroup, 10079 spaceBetween 10080 } = swiper.params; 10081 const { 10082 rows, 10083 fill 10084 } = swiper.params.grid; // Set slides order 10085 10086 let newSlideOrderIndex; 10087 let column; 10088 let row; 10089 10090 if (fill === 'row' && slidesPerGroup > 1) { 10091 const groupIndex = Math.floor(i / (slidesPerGroup * rows)); 10092 const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex; 10093 const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup); 10094 row = Math.floor(slideIndexInGroup / columnsInGroup); 10095 column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup; 10096 newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows; 10097 slide.css({ 10098 '-webkit-order': newSlideOrderIndex, 10099 order: newSlideOrderIndex 10100 }); 10101 } else if (fill === 'column') { 10102 column = Math.floor(i / rows); 10103 row = i - column * rows; 10104 10105 if (column > numFullColumns || column === numFullColumns && row === rows - 1) { 10106 row += 1; 10107 10108 if (row >= rows) { 10109 row = 0; 10110 column += 1; 10111 } 10112 } 10113 } else { 10114 row = Math.floor(i / slidesPerRow); 10115 column = i - row * slidesPerRow; 10116 } 10117 10118 slide.css(getDirectionLabel('margin-top'), row !== 0 ? spaceBetween && `${spaceBetween}px` : ''); 10119 }; 10120 10121 const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => { 10122 const { 10123 spaceBetween, 10124 centeredSlides, 10125 roundLengths 10126 } = swiper.params; 10127 const { 10128 rows 10129 } = swiper.params.grid; 10130 swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows; 10131 swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween; 10132 swiper.$wrapperEl.css({ 10133 [getDirectionLabel('width')]: `${swiper.virtualSize + spaceBetween}px` 10134 }); 10135 10136 if (centeredSlides) { 10137 snapGrid.splice(0, snapGrid.length); 10138 const newSlidesGrid = []; 10139 10140 for (let i = 0; i < snapGrid.length; i += 1) { 10141 let slidesGridItem = snapGrid[i]; 10142 if (roundLengths) slidesGridItem = Math.floor(slidesGridItem); 10143 if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem); 10144 } 10145 10146 snapGrid.push(...newSlidesGrid); 10147 } 10148 }; 10149 10150 swiper.grid = { 10151 initSlides, 10152 updateSlide, 10153 updateWrapperSize 10154 }; 10155 } 10156 10157 function appendSlide(slides) { 10158 const swiper = this; 10159 const { 10160 $wrapperEl, 10161 params 10162 } = swiper; 10163 10164 if (params.loop) { 10165 swiper.loopDestroy(); 10166 } 10167 10168 if (typeof slides === 'object' && 'length' in slides) { 10169 for (let i = 0; i < slides.length; i += 1) { 10170 if (slides[i]) $wrapperEl.append(slides[i]); 10171 } 10172 } else { 10173 $wrapperEl.append(slides); 10174 } 10175 10176 if (params.loop) { 10177 swiper.loopCreate(); 10178 } 10179 10180 if (!params.observer) { 10181 swiper.update(); 10182 } 10183 } 10184 10185 function prependSlide(slides) { 10186 const swiper = this; 10187 const { 10188 params, 10189 $wrapperEl, 10190 activeIndex 10191 } = swiper; 10192 10193 if (params.loop) { 10194 swiper.loopDestroy(); 10195 } 10196 10197 let newActiveIndex = activeIndex + 1; 10198 10199 if (typeof slides === 'object' && 'length' in slides) { 10200 for (let i = 0; i < slides.length; i += 1) {
vendor: 6,052 bytes, lines 10201-10414
10201 if (slides[i]) $wrapperEl.prepend(slides[i]); 10202 } 10203 10204 newActiveIndex = activeIndex + slides.length; 10205 } else { 10206 $wrapperEl.prepend(slides); 10207 } 10208 10209 if (params.loop) { 10210 swiper.loopCreate(); 10211 } 10212 10213 if (!params.observer) { 10214 swiper.update(); 10215 } 10216 10217 swiper.slideTo(newActiveIndex, 0, false); 10218 } 10219 10220 function addSlide(index, slides) { 10221 const swiper = this; 10222 const { 10223 $wrapperEl, 10224 params, 10225 activeIndex 10226 } = swiper; 10227 let activeIndexBuffer = activeIndex; 10228 10229 if (params.loop) { 10230 activeIndexBuffer -= swiper.loopedSlides; 10231 swiper.loopDestroy(); 10232 swiper.slides = $wrapperEl.children(`.${params.slideClass}`); 10233 } 10234 10235 const baseLength = swiper.slides.length; 10236 10237 if (index <= 0) { 10238 swiper.prependSlide(slides); 10239 return; 10240 } 10241 10242 if (index >= baseLength) { 10243 swiper.appendSlide(slides); 10244 return; 10245 } 10246 10247 let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer; 10248 const slidesBuffer = []; 10249 10250 for (let i = baseLength - 1; i >= index; i -= 1) { 10251 const currentSlide = swiper.slides.eq(i); 10252 currentSlide.remove(); 10253 slidesBuffer.unshift(currentSlide); 10254 } 10255 10256 if (typeof slides === 'object' && 'length' in slides) { 10257 for (let i = 0; i < slides.length; i += 1) { 10258 if (slides[i]) $wrapperEl.append(slides[i]); 10259 } 10260 10261 newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer; 10262 } else { 10263 $wrapperEl.append(slides); 10264 } 10265 10266 for (let i = 0; i < slidesBuffer.length; i += 1) { 10267 $wrapperEl.append(slidesBuffer[i]); 10268 } 10269 10270 if (params.loop) { 10271 swiper.loopCreate(); 10272 } 10273 10274 if (!params.observer) { 10275 swiper.update(); 10276 } 10277 10278 if (params.loop) { 10279 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 10280 } else { 10281 swiper.slideTo(newActiveIndex, 0, false); 10282 } 10283 } 10284 10285 function removeSlide(slidesIndexes) { 10286 const swiper = this; 10287 const { 10288 params, 10289 $wrapperEl, 10290 activeIndex 10291 } = swiper; 10292 let activeIndexBuffer = activeIndex; 10293 10294 if (params.loop) { 10295 activeIndexBuffer -= swiper.loopedSlides; 10296 swiper.loopDestroy(); 10297 swiper.slides = $wrapperEl.children(`.${params.slideClass}`); 10298 } 10299 10300 let newActiveIndex = activeIndexBuffer; 10301 let indexToRemove; 10302 10303 if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) { 10304 for (let i = 0; i < slidesIndexes.length; i += 1) { 10305 indexToRemove = slidesIndexes[i]; 10306 if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); 10307 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 10308 } 10309 10310 newActiveIndex = Math.max(newActiveIndex, 0); 10311 } else { 10312 indexToRemove = slidesIndexes; 10313 if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); 10314 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 10315 newActiveIndex = Math.max(newActiveIndex, 0); 10316 } 10317 10318 if (params.loop) { 10319 swiper.loopCreate(); 10320 } 10321 10322 if (!params.observer) { 10323 swiper.update(); 10324 } 10325 10326 if (params.loop) { 10327 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 10328 } else { 10329 swiper.slideTo(newActiveIndex, 0, false); 10330 } 10331 } 10332 10333 function removeAllSlides() { 10334 const swiper = this; 10335 const slidesIndexes = []; 10336 10337 for (let i = 0; i < swiper.slides.length; i += 1) { 10338 slidesIndexes.push(i); 10339 } 10340 10341 swiper.removeSlide(slidesIndexes); 10342 } 10343 10344 function Manipulation(_ref) { 10345 let { 10346 swiper 10347 } = _ref; 10348 Object.assign(swiper, { 10349 appendSlide: appendSlide.bind(swiper), 10350 prependSlide: prependSlide.bind(swiper), 10351 addSlide: addSlide.bind(swiper), 10352 removeSlide: removeSlide.bind(swiper), 10353 removeAllSlides: removeAllSlides.bind(swiper) 10354 }); 10355 } 10356 10357 function effectInit(params) { 10358 const { 10359 effect, 10360 swiper, 10361 on, 10362 setTranslate, 10363 setTransition, 10364 overwriteParams, 10365 perspective, 10366 recreateShadows, 10367 getEffectParams 10368 } = params; 10369 on('beforeInit', () => { 10370 if (swiper.params.effect !== effect) return; 10371 swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`); 10372 10373 if (perspective && perspective()) { 10374 swiper.classNames.push(`${swiper.params.containerModifierClass}3d`); 10375 } 10376 10377 const overwriteParamsResult = overwriteParams ? overwriteParams() : {}; 10378 Object.assign(swiper.params, overwriteParamsResult); 10379 Object.assign(swiper.originalParams, overwriteParamsResult); 10380 }); 10381 on('setTranslate', () => { 10382 if (swiper.params.effect !== effect) return; 10383 setTranslate(); 10384 }); 10385 on('setTransition', (_s, duration) => { 10386 if (swiper.params.effect !== effect) return; 10387 setTransition(duration); 10388 }); 10389 on('transitionEnd', () => { 10390 if (swiper.params.effect !== effect) return; 10391 10392 if (recreateShadows) { 10393 if (!getEffectParams || !getEffectParams().slideShadows) return; // remove shadows 10394 10395 swiper.slides.each(slideEl => { 10396 const $slideEl = swiper.$(slideEl); 10397 $slideEl.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').remove(); 10398 }); // create new one 10399 10400 recreateShadows(); 10401 } 10402 }); 10403 let requireUpdateOnVirtual; 10404 on('virtualUpdate', () => { 10405 if (swiper.params.effect !== effect) return; 10406 10407 if (!swiper.slides.length) { 10408 requireUpdateOnVirtual = true; 10409 } 10410 10411 requestAnimationFrame(() => { 10412 if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) { 10413 setTranslate(); 10414 requireUpdateOnVirtual = false;
10415 } 10416 }); 10417 }); 10418 } 10419 10420 function effectTarget(effectParams, $slideEl) { 10421 if (effectParams.transformEl) { 10422 return $slideEl.find(effectParams.transformEl).css({ 10423 'backface-visibility': 'hidden', 10424 '-webkit-backface-visibility': 'hidden' 10425 }); 10426 } 10427 10428 return $slideEl; 10429 } 10430 10431 function effectVirtualTransitionEnd(_ref) { 10432 let { 10433 swiper, 10434 duration, 10435 transformEl, 10436 allSlides 10437 } = _ref; 10438 const { 10439 slides, 10440 activeIndex, 10441 $wrapperEl 10442 } = swiper; 10443 10444 if (swiper.params.virtualTranslate && duration !== 0) { 10445 let eventTriggered = false; 10446 let $transitionEndTarget; 10447 10448 if (allSlides) { 10449 $transitionEndTarget = transformEl ? slides.find(transformEl) : slides; 10450 } else { 10451 $transitionEndTarget = transformEl ? slides.eq(activeIndex).find(transformEl) : slides.eq(activeIndex); 10452 } 10453 10454 $transitionEndTarget.transitionEnd(() => { 10455 if (eventTriggered) return; 10456 if (!swiper || swiper.destroyed) return; 10457 eventTriggered = true; 10458 swiper.animating = false; 10459 const triggerEvents = ['webkitTransitionEnd', 'transitionend']; 10460 10461 for (let i = 0; i < triggerEvents.length; i += 1) { 10462 $wrapperEl.trigger(triggerEvents[i]); 10463 } 10464 }); 10465 } 10466 } 10467 10468 function EffectFade(_ref) { 10469 let { 10470 swiper, 10471 extendParams, 10472 on 10473 } = _ref; 10474 extendParams({ 10475 fadeEffect: { 10476 crossFade: false, 10477 transformEl: null 10478 } 10479 }); 10480 10481 const setTranslate = () => { 10482 const { 10483 slides 10484 } = swiper; 10485 const params = swiper.params.fadeEffect; 10486 10487 for (let i = 0; i < slides.length; i += 1) { 10488 const $slideEl = swiper.slides.eq(i); 10489 const offset = $slideEl[0].swiperSlideOffset; 10490 let tx = -offset; 10491 if (!swiper.params.virtualTranslate) tx -= swiper.translate; 10492 let ty = 0; 10493 10494 if (!swiper.isHorizontal()) { 10495 ty = tx; 10496 tx = 0; 10497 } 10498 10499 const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0); 10500 const $targetEl = effectTarget(params, $slideEl); 10501 $targetEl.css({ 10502 opacity: slideOpacity 10503 }).transform(`translate3d(${tx}px, ${ty}px, 0px)`); 10504 } 10505 }; 10506 10507 const setTransition = duration => { 10508 const { 10509 transformEl 10510 } = swiper.params.fadeEffect; 10511 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 10512 $transitionElements.transition(duration); 10513 effectVirtualTransitionEnd({ 10514 swiper, 10515 duration, 10516 transformEl, 10517 allSlides: true 10518 }); 10519 }; 10520 10521 effectInit({ 10522 effect: 'fade', 10523 swiper, 10524 on, 10525 setTranslate, 10526 setTransition, 10527 overwriteParams: () => ({ 10528 slidesPerView: 1, 10529 slidesPerGroup: 1, 10530 watchSlidesProgress: true, 10531 spaceBetween: 0, 10532 virtualTranslate: !swiper.params.cssMode 10533 }) 10534 }); 10535 } 10536 10537 function EffectCube(_ref) { 10538 let { 10539 swiper, 10540 extendParams, 10541 on 10542 } = _ref; 10543 extendParams({ 10544 cubeEffect: { 10545 slideShadows: true, 10546 shadow: true, 10547 shadowOffset: 20, 10548 shadowScale: 0.94 10549 } 10550 }); 10551 10552 const createSlideShadows = ($slideEl, progress, isHorizontal) => { 10553 let shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 10554 let shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 10555 10556 if (shadowBefore.length === 0) { 10557 shadowBefore = $(`<div class="swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}"></div>`); 10558 $slideEl.append(shadowBefore); 10559 } 10560 10561 if (shadowAfter.length === 0) { 10562 shadowAfter = $(`<div class="swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}"></div>`); 10563 $slideEl.append(shadowAfter); 10564 } 10565 10566 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 10567 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 10568 }; 10569 10570 const recreateShadows = () => { 10571 // create new ones 10572 const isHorizontal = swiper.isHorizontal(); 10573 swiper.slides.each(slideEl => { 10574 const progress = Math.max(Math.min(slideEl.progress, 1), -1); 10575 createSlideShadows($(slideEl), progress, isHorizontal); 10576 }); 10577 }; 10578 10579 const setTranslate = () => { 10580 const { 10581 $el, 10582 $wrapperEl, 10583 slides, 10584 width: swiperWidth, 10585 height: swiperHeight, 10586 rtlTranslate: rtl, 10587 size: swiperSize, 10588 browser 10589 } = swiper; 10590 const params = swiper.params.cubeEffect; 10591 const isHorizontal = swiper.isHorizontal(); 10592 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 10593 let wrapperRotate = 0; 10594 let $cubeShadowEl; 10595 10596 if (params.shadow) { 10597 if (isHorizontal) { 10598 $cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow'); 10599 10600 if ($cubeShadowEl.length === 0) {
10601 $cubeShadowEl = $('<div class="swiper-cube-shadow"></div>'); 10602 $wrapperEl.append($cubeShadowEl); 10603 } 10604 10605 $cubeShadowEl.css({ 10606 height: `${swiperWidth}px` 10607 }); 10608 } else { 10609 $cubeShadowEl = $el.find('.swiper-cube-shadow'); 10610 10611 if ($cubeShadowEl.length === 0) { 10612 $cubeShadowEl = $('<div class="swiper-cube-shadow"></div>'); 10613 $el.append($cubeShadowEl); 10614 } 10615 } 10616 } 10617 10618 for (let i = 0; i < slides.length; i += 1) { 10619 const $slideEl = slides.eq(i); 10620 let slideIndex = i; 10621 10622 if (isVirtual) { 10623 slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10); 10624 } 10625 10626 let slideAngle = slideIndex * 90; 10627 let round = Math.floor(slideAngle / 360); 10628 10629 if (rtl) { 10630 slideAngle = -slideAngle; 10631 round = Math.floor(-slideAngle / 360); 10632 } 10633 10634 const progress = Math.max(Math.min($slideEl[0].progress, 1), -1); 10635 let tx = 0; 10636 let ty = 0; 10637 let tz = 0; 10638 10639 if (slideIndex % 4 === 0) { 10640 tx = -round * 4 * swiperSize; 10641 tz = 0; 10642 } else if ((slideIndex - 1) % 4 === 0) { 10643 tx = 0; 10644 tz = -round * 4 * swiperSize; 10645 } else if ((slideIndex - 2) % 4 === 0) { 10646 tx = swiperSize + round * 4 * swiperSize; 10647 tz = swiperSize; 10648 } else if ((slideIndex - 3) % 4 === 0) { 10649 tx = -swiperSize; 10650 tz = 3 * swiperSize + swiperSize * 4 * round; 10651 } 10652 10653 if (rtl) { 10654 tx = -tx; 10655 } 10656 10657 if (!isHorizontal) { 10658 ty = tx; 10659 tx = 0; 10660 } 10661 10662 const transform = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`; 10663 10664 if (progress <= 1 && progress > -1) { 10665 wrapperRotate = slideIndex * 90 + progress * 90; 10666 if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90; 10667 } 10668 10669 $slideEl.transform(transform); 10670 10671 if (params.slideShadows) { 10672 createSlideShadows($slideEl, progress, isHorizontal); 10673 } 10674 } 10675 10676 $wrapperEl.css({ 10677 '-webkit-transform-origin': `50% 50% -${swiperSize / 2}px`, 10678 'transform-origin': `50% 50% -${swiperSize / 2}px` 10679 }); 10680 10681 if (params.shadow) { 10682 if (isHorizontal) { 10683 $cubeShadowEl.transform(`translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`); 10684 } else { 10685 const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; 10686 const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); 10687 const scale1 = params.shadowScale; 10688 const scale2 = params.shadowScale / multiplier; 10689 const offset = params.shadowOffset; 10690 $cubeShadowEl.transform(`scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-90deg)`); 10691 } 10692 } 10693 10694 const zFactor = browser.isSafari || browser.isWebView ? -swiperSize / 2 : 0; 10695 $wrapperEl.transform(`translate3d(0px,0,${zFactor}px) rotateX(${swiper.isHorizontal() ? 0 : wrapperRotate}deg) rotateY(${swiper.isHorizontal() ? -wrapperRotate : 0}deg)`); 10696 $wrapperEl[0].style.setProperty('--swiper-cube-translate-z', `${zFactor}px`); 10697 }; 10698 10699 const setTransition = duration => { 10700 const { 10701 $el, 10702 slides 10703 } = swiper; 10704 slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 10705 10706 if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) { 10707 $el.find('.swiper-cube-shadow').transition(duration); 10708 } 10709 }; 10710 10711 effectInit({ 10712 effect: 'cube', 10713 swiper, 10714 on, 10715 setTranslate, 10716 setTransition, 10717 recreateShadows, 10718 getEffectParams: () => swiper.params.cubeEffect, 10719 perspective: () => true, 10720 overwriteParams: () => ({ 10721 slidesPerView: 1, 10722 slidesPerGroup: 1, 10723 watchSlidesProgress: true, 10724 resistanceRatio: 0, 10725 spaceBetween: 0, 10726 centeredSlides: false, 10727 virtualTranslate: true 10728 }) 10729 }); 10730 } 10731 10732 function createShadow(params, $slideEl, side) { 10733 const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}`; 10734 const $shadowContainer = params.transformEl ? $slideEl.find(params.transformEl) : $slideEl; 10735 let $shadowEl = $shadowContainer.children(`.${shadowClass}`); 10736 10737 if (!$shadowEl.length) { 10738 $shadowEl = $(`<div class="swiper-slide-shadow${side ? `-${side}` : ''}"></div>`); 10739 $shadowContainer.append($shadowEl); 10740 } 10741 10742 return $shadowEl; 10743 } 10744 10745 function EffectFlip(_ref) { 10746 let { 10747 swiper, 10748 extendParams, 10749 on 10750 } = _ref; 10751 extendParams({ 10752 flipEffect: { 10753 slideShadows: true, 10754 limitRotation: true, 10755 transformEl: null 10756 } 10757 }); 10758 10759 const createSlideShadows = ($slideEl, progress, params) => { 10760 let shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 10761 let shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 10762 10763 if (shadowBefore.length === 0) { 10764 shadowBefore = createShadow(params, $slideEl, swiper.isHorizontal() ? 'left' : 'top'); 10765 } 10766 10767 if (shadowAfter.length === 0) { 10768 shadowAfter = createShadow(params, $slideEl, swiper.isHorizontal() ? 'right' : 'bottom'); 10769 } 10770 10771 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 10772 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 10773 }; 10774 10775 const recreateShadows = () => { 10776 // Set shadows 10777 const params = swiper.params.flipEffect; 10778 swiper.slides.each(slideEl => { 10779 const $slideEl = $(slideEl); 10780 let progress = $slideEl[0].progress; 10781 10782 if (swiper.params.flipEffect.limitRotation) { 10783 progress = Math.max(Math.min(slideEl.progress, 1), -1); 10784 } 10785 10786 createSlideShadows($slideEl, progress, params); 10787 }); 10788 }; 10789 10790 const setTranslate = () => { 10791 const { 10792 slides, 10793 rtlTranslate: rtl 10794 } = swiper; 10795 const params = swiper.params.flipEffect; 10796 10797 for (let i = 0; i < slides.length; i += 1) { 10798 const $slideEl = slides.eq(i); 10799 let progress = $slideEl[0].progress; 10800 10801 if (swiper.params.flipEffect.limitRotation) { 10802 progress = Math.max(Math.min($slideEl[0].progress, 1), -1); 10803 } 10804 10805 const offset = $slideEl[0].swiperSlideOffset; 10806 const rotate = -180 * progress; 10807 let rotateY = rotate; 10808 let rotateX = 0; 10809 let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset; 10810 let ty = 0; 10811 10812 if (!swiper.isHorizontal()) { 10813 ty = tx; 10814 tx = 0; 10815 rotateX = -rotateY; 10816 rotateY = 0; 10817 } else if (rtl) { 10818 rotateY = -rotateY; 10819 } 10820 10821 $slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length; 10822 10823 if (params.slideShadows) { 10824 createSlideShadows($slideEl, progress, params); 10825 } 10826 10827 const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`; 10828 const $targetEl = effectTarget(params, $slideEl); 10829 $targetEl.transform(transform); 10830 } 10831 }; 10832 10833 const setTransition = duration => { 10834 const { 10835 transformEl 10836 } = swiper.params.flipEffect; 10837 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 10838 $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 10839 effectVirtualTransitionEnd({ 10840 swiper, 10841 duration, 10842 transformEl 10843 }); 10844 }; 10845 10846 effectInit({ 10847 effect: 'flip', 10848 swiper, 10849 on, 10850 setTranslate, 10851 setTransition, 10852 recreateShadows, 10853 getEffectParams: () => swiper.params.flipEffect, 10854 perspective: () => true, 10855 overwriteParams: () => ({ 10856 slidesPerView: 1, 10857 slidesPerGroup: 1, 10858 watchSlidesProgress: true, 10859 spaceBetween: 0, 10860 virtualTranslate: !swiper.params.cssMode 10861 }) 10862 }); 10863 } 10864 10865 function EffectCoverflow(_ref) { 10866 let { 10867 swiper, 10868 extendParams, 10869 on 10870 } = _ref; 10871 extendParams({ 10872 coverflowEffect: { 10873 rotate: 50, 10874 stretch: 0, 10875 depth: 100, 10876 scale: 1, 10877 modifier: 1, 10878 slideShadows: true, 10879 transformEl: null 10880 } 10881 }); 10882 10883 const setTranslate = () => { 10884 const { 10885 width: swiperWidth, 10886 height: swiperHeight, 10887 slides, 10888 slidesSizesGrid 10889 } = swiper; 10890 const params = swiper.params.coverflowEffect; 10891 const isHorizontal = swiper.isHorizontal(); 10892 const transform = swiper.translate; 10893 const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2; 10894 const rotate = isHorizontal ? params.rotate : -params.rotate; 10895 const translate = params.depth; // Each slide offset from center 10896 10897 for (let i = 0, length = slides.length; i < length; i += 1) { 10898 const $slideEl = slides.eq(i); 10899 const slideSize = slidesSizesGrid[i]; 10900 const slideOffset = $slideEl[0].swiperSlideOffset; 10901 const centerOffset = (center - slideOffset - slideSize / 2) / slideSize; 10902 const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier; 10903 let rotateY = isHorizontal ? rotate * offsetMultiplier : 0; 10904 let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; // var rotateZ = 0 10905 10906 let translateZ = -translate * Math.abs(offsetMultiplier); 10907 let stretch = params.stretch; // Allow percentage to make a relative stretch for responsive sliders 10908 10909 if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) { 10910 stretch = parseFloat(params.stretch) / 100 * slideSize; 10911 } 10912 10913 let translateY = isHorizontal ? 0 : stretch * offsetMultiplier; 10914 let translateX = isHorizontal ? stretch * offsetMultiplier : 0; 10915 let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); // Fix for ultra small values 10916 10917 if (Math.abs(translateX) < 0.001) translateX = 0; 10918 if (Math.abs(translateY) < 0.001) translateY = 0; 10919 if (Math.abs(translateZ) < 0.001) translateZ = 0; 10920 if (Math.abs(rotateY) < 0.001) rotateY = 0; 10921 if (Math.abs(rotateX) < 0.001) rotateX = 0; 10922 if (Math.abs(scale) < 0.001) scale = 0; 10923 const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(${scale})`; 10924 const $targetEl = effectTarget(params, $slideEl); 10925 $targetEl.transform(slideTransform); 10926 $slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; 10927 10928 if (params.slideShadows) { 10929 // Set shadows 10930 let $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 10931 let $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 10932 10933 if ($shadowBeforeEl.length === 0) { 10934 $shadowBeforeEl = createShadow(params, $slideEl, isHorizontal ? 'left' : 'top'); 10935 } 10936 10937 if ($shadowAfterEl.length === 0) { 10938 $shadowAfterEl = createShadow(params, $slideEl, isHorizontal ? 'right' : 'bottom'); 10939 } 10940 10941 if ($shadowBeforeEl.length) $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; 10942 if ($shadowAfterEl.length) $shadowAfterEl[0].style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0; 10943 } 10944 } 10945 }; 10946 10947 const setTransition = duration => { 10948 const { 10949 transformEl 10950 } = swiper.params.coverflowEffect; 10951 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 10952 $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 10953 }; 10954 10955 effectInit({ 10956 effect: 'coverflow', 10957 swiper, 10958 on, 10959 setTranslate, 10960 setTransition, 10961 perspective: () => true, 10962 overwriteParams: () => ({ 10963 watchSlidesProgress: true 10964 }) 10965 }); 10966 } 10967 10968 function EffectCreative(_ref) { 10969 let { 10970 swiper, 10971 extendParams, 10972 on 10973 } = _ref; 10974 extendParams({ 10975 creativeEffect: { 10976 transformEl: null, 10977 limitProgress: 1, 10978 shadowPerProgress: false, 10979 progressMultiplier: 1, 10980 perspective: true, 10981 prev: { 10982 translate: [0, 0, 0], 10983 rotate: [0, 0, 0], 10984 opacity: 1, 10985 scale: 1 10986 }, 10987 next: { 10988 translate: [0, 0, 0], 10989 rotate: [0, 0, 0], 10990 opacity: 1, 10991 scale: 1 10992 } 10993 } 10994 }); 10995 10996 const getTranslateValue = value => { 10997 if (typeof value === 'string') return value; 10998 return `${value}px`; 10999 }; 11000 11001 const setTranslate = () => { 11002 const { 11003 slides, 11004 $wrapperEl, 11005 slidesSizesGrid 11006 } = swiper; 11007 const params = swiper.params.creativeEffect; 11008 const { 11009 progressMultiplier: multiplier 11010 } = params; 11011 const isCenteredSlides = swiper.params.centeredSlides; 11012 11013 if (isCenteredSlides) { 11014 const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0; 11015 $wrapperEl.transform(`translateX(calc(50% - ${margin}px))`); 11016 } 11017 11018 for (let i = 0; i < slides.length; i += 1) { 11019 const $slideEl = slides.eq(i); 11020 const slideProgress = $slideEl[0].progress; 11021 const progress = Math.min(Math.max($slideEl[0].progress, -params.limitProgress), params.limitProgress); 11022 let originalProgress = progress; 11023 11024 if (!isCenteredSlides) { 11025 originalProgress = Math.min(Math.max($slideEl[0].originalProgress, -params.limitProgress), params.limitProgress); 11026 } 11027 11028 const offset = $slideEl[0].swiperSlideOffset; 11029 const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0]; 11030 const r = [0, 0, 0]; 11031 let custom = false;
11032 11033 if (!swiper.isHorizontal()) { 11034 t[1] = t[0]; 11035 t[0] = 0; 11036 } 11037 11038 let data = { 11039 translate: [0, 0, 0], 11040 rotate: [0, 0, 0], 11041 scale: 1, 11042 opacity: 1 11043 }; 11044 11045 if (progress < 0) { 11046 data = params.next; 11047 custom = true; 11048 } else if (progress > 0) { 11049 data = params.prev; 11050 custom = true; 11051 } // set translate 11052 11053 11054 t.forEach((value, index) => { 11055 t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`; 11056 }); // set rotates 11057 11058 r.forEach((value, index) => { 11059 r[index] = data.rotate[index] * Math.abs(progress * multiplier); 11060 }); 11061 $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 11062 const translateString = t.join(', '); 11063 const rotateString = `rotateX(${r[0]}deg) rotateY(${r[1]}deg) rotateZ(${r[2]}deg)`; 11064 const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`; 11065 const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier; 11066 const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`; // Set shadows 11067 11068 if (custom && data.shadow || !custom) { 11069 let $shadowEl = $slideEl.children('.swiper-slide-shadow'); 11070 11071 if ($shadowEl.length === 0 && data.shadow) { 11072 $shadowEl = createShadow(params, $slideEl); 11073 } 11074 11075 if ($shadowEl.length) { 11076 const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress; 11077 $shadowEl[0].style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1); 11078 } 11079 } 11080 11081 const $targetEl = effectTarget(params, $slideEl); 11082 $targetEl.transform(transform).css({ 11083 opacity: opacityString 11084 }); 11085 11086 if (data.origin) { 11087 $targetEl.css('transform-origin', data.origin); 11088 } 11089 } 11090 }; 11091 11092 const setTransition = duration => { 11093 const { 11094 transformEl 11095 } = swiper.params.creativeEffect; 11096 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 11097 $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); 11098 effectVirtualTransitionEnd({ 11099 swiper, 11100 duration, 11101 transformEl, 11102 allSlides: true 11103 }); 11104 }; 11105 11106 effectInit({ 11107 effect: 'creative', 11108 swiper, 11109 on, 11110 setTranslate, 11111 setTransition, 11112 perspective: () => swiper.params.creativeEffect.perspective, 11113 overwriteParams: () => ({ 11114 watchSlidesProgress: true, 11115 virtualTranslate: !swiper.params.cssMode 11116 }) 11117 }); 11118 } 11119 11120 function EffectCards(_ref) { 11121 let { 11122 swiper, 11123 extendParams, 11124 on 11125 } = _ref; 11126 extendParams({ 11127 cardsEffect: { 11128 slideShadows: true, 11129 transformEl: null, 11130 rotate: true 11131 } 11132 }); 11133 11134 const setTranslate = () => { 11135 const { 11136 slides, 11137 activeIndex 11138 } = swiper; 11139 const params = swiper.params.cardsEffect; 11140 const { 11141 startTranslate, 11142 isTouched 11143 } = swiper.touchEventsData; 11144 const currentTranslate = swiper.translate; 11145 11146 for (let i = 0; i < slides.length; i += 1) { 11147 const $slideEl = slides.eq(i); 11148 const slideProgress = $slideEl[0].progress; 11149 const progress = Math.min(Math.max(slideProgress, -4), 4); 11150 let offset = $slideEl[0].swiperSlideOffset; 11151 11152 if (swiper.params.centeredSlides && !swiper.params.cssMode) { 11153 swiper.$wrapperEl.transform(`translateX(${swiper.minTranslate()}px)`); 11154 } 11155 11156 if (swiper.params.centeredSlides && swiper.params.cssMode) { 11157 offset -= slides[0].swiperSlideOffset; 11158 } 11159 11160 let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset; 11161 let tY = 0; 11162 const tZ = -100 * Math.abs(progress); 11163 let scale = 1; 11164 let rotate = -2 * progress; 11165 let tXAdd = 8 - Math.abs(progress) * 0.75; 11166 const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i; 11167 const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate; 11168 const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate; 11169 11170 if (isSwipeToNext || isSwipeToPrev) { 11171 const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5; 11172 rotate += -28 * progress * subProgress; 11173 scale += -0.5 * subProgress; 11174 tXAdd += 96 * subProgress; 11175 tY = `${-25 * subProgress * Math.abs(progress)}%`; 11176 } 11177 11178 if (progress < 0) { 11179 // next 11180 tX = `calc(${tX}px + (${tXAdd * Math.abs(progress)}%))`;
11181 } else if (progress > 0) { 11182 // prev 11183 tX = `calc(${tX}px + (-${tXAdd * Math.abs(progress)}%))`; 11184 } else { 11185 tX = `${tX}px`; 11186 } 11187 11188 if (!swiper.isHorizontal()) { 11189 const prevY = tY; 11190 tY = tX; 11191 tX = prevY; 11192 } 11193 11194 const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`; 11195 const transform = ` 11196 translate3d(${tX}, ${tY}, ${tZ}px) 11197 rotateZ(${params.rotate ? rotate : 0}deg) 11198 scale(${scaleString}) 11199 `; 11200 11201 if (params.slideShadows) { 11202 // Set shadows 11203 let $shadowEl = $slideEl.find('.swiper-slide-shadow'); 11204 11205 if ($shadowEl.length === 0) { 11206 $shadowEl = createShadow(params, $slideEl); 11207 } 11208 11209 if ($shadowEl.length) $shadowEl[0].style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1); 11210 } 11211 11212 $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 11213 const $targetEl = effectTarget(params, $slideEl); 11214 $targetEl.transform(transform); 11215 } 11216 }; 11217 11218 const setTransition = duration => { 11219 const { 11220 transformEl 11221 } = swiper.params.cardsEffect; 11222 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 11223 $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); 11224 effectVirtualTransitionEnd({ 11225 swiper, 11226 duration, 11227 transformEl 11228 }); 11229 }; 11230 11231 effectInit({ 11232 effect: 'cards', 11233 swiper, 11234 on, 11235 setTranslate, 11236 setTransition, 11237 perspective: () => true, 11238 overwriteParams: () => ({ 11239 watchSlidesProgress: true, 11240 virtualTranslate: !swiper.params.cssMode 11241 }) 11242 }); 11243 } 11244 11245 // Swiper Class 11246 const modules = [Virtual, Keyboard, Mousewheel, Navigation, Pagination, Scrollbar, Parallax, Zoom, Lazy, Controller, A11y, History, HashNavigation, Autoplay, Thumb, freeMode, Grid, Manipulation, EffectFade, EffectCube, EffectFlip, EffectCoverflow, EffectCreative, EffectCards]; 11247 Swiper.use(modules); 11248 11249 return Swiper; 11250 11251})); 11252//# sourceMappingURL=swiper-bundle.js.map 11253document.addEventListener("DOMContentLoaded", function () { 11254 if (!window._genesys) window._genesys = {}; 11255 if (!window._gt) window._gt = []; 11256 11257 const STORAGE_KEYS = { 11258 WIDGET_INFO: "genesysChatWidgetInformation", 11259 CHAT_SESSION: "LauncherWebChatSessionData", 11260 PERSISTENCE: "GenesysChatPersistenceData" 11261 }; 11262 11263 /* 11264 * This function is used to get the value of the configuration of the chat widget 11265 * It tries to get the value from the data attribute (defined in the html - from BE and FE), 11266 * if it doesn't exist, it tries to get the value from the session storage (to work in 11267 * pages that suffered a redirect from the page where the chat was opened) 11268 */ 11269 function getValueOfConfig(key) { 11270 try { 11271 // First try to get from session storage 11272 const sessionData = JSON.parse(window.sessionStorage.getItem(STORAGE_KEYS.WIDGET_INFO) || '{}'); 11273 if (sessionData[key] !== undefined) { 11274 return sessionData[key]; 11275 } 11276 // Fallback to DOM element if exists 11277 const chatWidget = document.querySelector(".genesys-chat-widget"); 11278 11279 // Special handling for dataUrl - empty string is valid 11280 if (key === "dataUrl" && chatWidget && chatWidget.dataset[key] === "") { 11281 return ""; 11282 } 11283 11284 return chatWidget ? chatWidget.dataset[key] : undefined; 11285 } catch (error) { 11286 console.warn(`Error getting config value for ${key}:`, error); 11287 return undefined; 11288 } 11289 } 11290 11291 /* 11292 * Enhanced function to preserve widget data with validation 11293 */ 11294 function preserveWidgetData() { 11295 try { 11296 const chatWidget = document.querySelector(".genesys-chat-widget"); 11297 if (!chatWidget) { 11298 // If no widget element, preserve existing session data 11299 const existingData = window.sessionStorage.getItem(STORAGE_KEYS.WIDGET_INFO); 11300 if (existingData) return; // Keep existing data if no widget present 11301 } 11302 11303 const currentData = JSON.parse(window.sessionStorage.getItem(STORAGE_KEYS.WIDGET_INFO) || '{}'); 11304 const widgetData = { 11305 mainIsDebug: chatWidget?.dataset.mainIsDebug || currentData.mainIsDebug, 11306 genesysChatWidgetEnabled: chatWidget?.dataset.genesysChatWidgetEnabled || currentData.genesysChatWidgetEnabled, 11307 theme: chatWidget?.dataset.theme || currentData.theme, 11308 alreadyUserChatLine: chatWidget?.dataset.alreadyUserChatLine || currentData.alreadyUserChatLine, 11309 newUserChatLine: chatWidget?.dataset.newUserChatLine || currentData.newUserChatLine, 11310 chatCustomerGroup: chatWidget?.dataset.chatCustomerGroup || currentData.chatCustomerGroup, 11311 chatServiceLevel: chatWidget?.dataset.chatServiceLevel || currentData.chatServiceLevel, 11312 emojIsEnabled: chatWidget?.dataset.emojIsEnabled || currentData.emojIsEnabled, 11313 uploadsEnabled: chatWidget?.dataset.uploadsEnabled || currentData.uploadsEnabled, 11314 dataUrl: chatWidget?.dataset.dataUrl !== undefined ? chatWidget.dataset.dataUrl : currentData.dataUrl, 11315 cometDEnabled: chatWidget?.dataset.cometDEnabled || currentData.cometDEnabled, 11316 cometDUrl: chatWidget?.dataset.cometDUrl || currentData.cometDUrl, 11317 cometDChannel: chatWidget?.dataset.cometDChannel || currentData.cometDChannel, 11318 cometDApiUrl: chatWidget?.dataset.cometDApiUrl || currentData.cometDApiUrl, 11319 cometDLogLevel: chatWidget?.dataset.cometDLogLevel || currentData.cometDLogLevel, 11320 isNewUser: currentData.isNewUser || "false" // Preserve existing isNewUser value 11321 }; 11322 11323 // Only update storage if we have valid data 11324 if (Object.values(widgetData).some(value => value !== undefined)) { 11325 window.sessionStorage.setItem(STORAGE_KEYS.WIDGET_INFO, JSON.stringify(widgetData)); 11326 } 11327 } catch (error) { 11328 console.warn("Error preserving widget data:", error); 11329 } 11330 } 11331 11332 window._genesys.widgets = { 11333 main: { 11334 debug: getValueOfConfig("mainIsDebug"), 11335 theme: getValueOfConfig("theme"), 11336 lang: document.documentElement.lang, 11337 customStylesheetID: "genesys_wsidgets_custom", 11338 preload: (window.localStorage.getItem(STORAGE_KEYS.CHAT_SESSION)) ? ["webchat"] : [] 11339 }, 11340 webchat: { 11341 emojis: getValueOfConfig("emojIsEnabled"), 11342 cometD: { 11343 enabled: getValueOfConfig("cometDEnabled"), 11344 cometURL: getValueOfConfig("cometDUrl"), 11345 channel: getValueOfConfig("cometDChannel"), 11346 apiURL: getValueOfConfig("cometDApiUrl"), 11347 logLevel: getValueOfConfig("cometDLogLevel"), 11348 websocketEnabled: true 11349 }, 11350 autoInvite: { 11351 enabled: false, 11352 timeToInviteSeconds: 5, 11353 inviteTimeoutSeconds: 30 11354 }, 11355 chatButton: { 11356 enabled: false, 11357 openDelay: 1000, 11358 effectDuration: 300, 11359 hideDuringInvite: false 11360 }, 11361 uploadsEnabled: getValueOfConfig("uploadsEnabled"), 11362 dataURL: getValueOfConfig("dataUrl") === undefined ? "" : getValueOfConfig("dataUrl"), 11363 apikey: "", 11364 async: { 11365 enabled: false, 11366 newMessageRestoreState: 'full', 11367 setSessionData: function(open, Cookie, CookieOptions) { 11368 preserveWidgetData(); 11369 11370 try { 11371 // Preserve chat session data 11372 const existingSessionData = window.localStorage.getItem(STORAGE_KEYS.CHAT_SESSION); 11373 if (existingSessionData) { 11374 window.sessionStorage.setItem(STORAGE_KEYS.PERSISTENCE, existingSessionData); 11375 } 11376 return existingSessionData; 11377 } catch (error) { 11378 console.warn("Error in setSessionData:", error); 11379 return null; 11380 } 11381 }, 11382 getSessionData: function (sessionData, Cookie, CookieOptions) { 11383 try { 11384 // Restore chat session 11385 const persistedData = window.sessionStorage.getItem(STORAGE_KEYS.PERSISTENCE); 11386 if (persistedData) { 11387 window.localStorage.setItem(STORAGE_KEYS.CHAT_SESSION, persistedData); 11388 } 11389 if (sessionData) { 11390 window.localStorage.setItem(STORAGE_KEYS.CHAT_SESSION, JSON.stringify(sessionData)); 11391 } 11392 } catch (error) { 11393 console.warn("Error in getSessionData:", error); 11394 } 11395 } 11396 } 11397 } 11398 }; 11399 11400 /* 11401 * Enhanced chat closure handling with safety checks 11402 */ 11403 function clearGenesysChatSession() { 11404 try { 11405 window.localStorage.removeItem(STORAGE_KEYS.CHAT_SESSION); 11406 window.sessionStorage.removeItem(STORAGE_KEYS.PERSISTENCE); 11407 11408 const widgetInfo = JSON.parse(window.sessionStorage.getItem(STORAGE_KEYS.WIDGET_INFO) || '{}'); 11409 widgetInfo.isNewUser = "false"; 11410 window.sessionStorage.setItem(STORAGE_KEYS.WIDGET_INFO, JSON.stringify(widgetInfo)); 11411 } catch (error) { 11412 console.warn("Error clearing chat session:", error); 11413 } 11414 } 11415 11416 /* 11417 * Enhanced initialization with retry mechanism 11418 */ 11419 function initializeChatClosureHandling() { 11420 let retryCount = 0; 11421 const maxRetries = 3; 11422 11423 function trySubscribe() { 11424 if (window.CXBus) { 11425 CXBus.subscribe('WebChat.closed', clearGenesysChatSession); 11426 } else if (retryCount < maxRetries) { 11427 retryCount++; 11428 setTimeout(trySubscribe, 1000); // Retry after 1 second 11429 } else { 11430 console.warn("Failed to initialize CXBus after retries"); 11431 } 11432 } 11433 11434 if (window.CXBus) { 11435 CXBus.subscribe('WebChat.closed', clearGenesysChatSession); 11436 } else { 11437 window.addEventListener('CXBus.ready', function () { 11438 CXBus.subscribe('WebChat.closed', clearGenesysChatSession); 11439 }); 11440 // Start retry mechanism
11441 trySubscribe(); 11442 } 11443 } 11444 11445 // Initialize everything 11446 preserveWidgetData(); 11447 initializeChatClosureHandling(); 11448});
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.