vendor: 12,699 bytes, lines 1-2
1/*! jQuery v3.4.0 | (c) JS 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=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,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},x=function(e){return null!=e&&e===e.window},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.4.0",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(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)}k.fn=k.prototype={jquery:f,constructor:k,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=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.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)},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},k.extend=k.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&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.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){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(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},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.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(d(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.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.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="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),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-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|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(m.childNodes),m.childNodes),t[m.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&&((e?e.ownerDocument||e:m)!==C&&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)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$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[k]=!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.namespaceURI,n=(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:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),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=k,!C.getElementsByName||!C.getElementsByName(k).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){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\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~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),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("!=",$)}),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},D=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===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,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]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&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
vendor: 8,538 bytes, line 2
2(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&&j.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(D),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}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(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(F," ")+" ").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)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&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]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&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[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,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[k]?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(B,"$1"));return s[k]?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=[S,p];if(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[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&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[k]&&(v=Ce(v)),y&&!y[k]&&(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))[k]){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(B,"$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(B," ")}),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=
vendor: 5,832 bytes, line 2
2A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?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=S+=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&&(S=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&&(S=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=k.split("").sort(D).join("")===k,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);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=k.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.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&&A.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.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 k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.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(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!A.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&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(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(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(N
vendor: 8,719 bytes, line 2
2(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(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])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.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){k.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 k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.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},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",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 k.Deferred(function(r){k.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,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.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=k.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&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.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(k(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},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(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[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(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(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.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&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.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=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.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=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.
vendor: 8,633 bytes, line 2
2attachShadow&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.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 ce={};function fe(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]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};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&&N(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(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))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.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<k.inArray(o,r))i&&i.push(o);else if(l=oe(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}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ae(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ne(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)Ne(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=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n=void 0,r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(Q.set(this,i,k.event.trigger(k.extend(r.shift(),k.Event.prototype),r,this)),e.stopImmediatePropagation())}})):k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.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),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.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)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.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<k(i,this).index(l):k.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(k.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[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&N(t,"input")&&void 0===Q.get(t,"click")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&N(t,"input")&&void 0===Q.get(t,"click")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&N(t,"input")&&Q.get(t,"click")||N(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?
vendor: 1,513 bytes, line 2
2ke:Se,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&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.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:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ae),!1},trigger:function(){return De(this,e),!0},delegateType:t}}
vendor: 1,067 bytes, line 2
2),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ne(this,e,t,n,r)},one:function(e,t,n,r){return Ne(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(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=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return N(e,"table")&&N
vendor: 18,145 bytes, line 2
2(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],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&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.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++)Me(o[r],a[r]);else Me(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=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.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 Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(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&&(k.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 k.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&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.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 Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.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 ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(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+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[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 tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(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=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.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=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.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=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.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):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.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=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),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:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.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=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.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=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,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),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.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&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._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--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.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]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.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=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(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?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.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&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.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&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.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||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.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})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.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)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.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=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&
vendor: 2,246 bytes, line 2
2N(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(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.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=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.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)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(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){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");
vendor: 5,840 bytes, line 2
2if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(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){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.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,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.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||!N(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.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&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.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]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.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=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(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)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var At=/\[\]$/,Nt=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||At.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.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&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}}):{name:t.name,value:n.replace(N
vendor: 14,531 bytes, line 2
2t,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];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 _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.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 zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,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":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),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=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.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=Pt.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||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.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]?", "+$t+"; 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=_t(Wt,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)),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"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.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]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(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){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!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(Ut[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()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.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 k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<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 Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.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(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.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?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.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=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.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,k.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)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.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"===k.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"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.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)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.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?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.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){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.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)}}),k.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||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=
2N,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k}); 3 4/* Fix for octobercms/october#5097 */ 5jQuery.htmlPrefilter=function(h){return h} 6 7/*! jQuery Migrate v3.0.1 | (c) jQuery Foundation and other contributors | jquery.org/license */ 8void 0 === jQuery.migrateMute && (jQuery.migrateMute = !0), function(e) { 9 "function" == typeof define && define.amd ? define([ "jquery" ], window, e) : "object" == typeof module && module.exports ? module.exports = e(require("jquery"), window) : e(jQuery, window); 10}(function(e, t) { 11 "use strict"; 12 function r(r) { 13 var n = t.console; 14 o[r] || (o[r] = !0, e.migrateWarnings.push(r), n && n.warn && !e.migrateMute && (n.warn("JQMIGRATE: " + r), 15 e.migrateTrace && n.trace && n.trace())); 16 } 17 function n(e, t, n, a) { 18 Object.defineProperty(e, t, { 19 configurable: !0, 20 enumerable: !0, 21 get: function() { 22 return r(a), n; 23 }, 24 set: function(e) { 25 r(a), n = e; 26 } 27 }); 28 } 29 function a(e, t, n, a) { 30 e[t] = function() { 31 return r(a), n.apply(this, arguments); 32 }; 33 } 34 e.migrateVersion = "3.0.1", function() { 35 var r = /^[12]\./; 36 t.console && t.console.log && (e && !r.test(e.fn.jquery) || t.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"), 37 e.migrateWarnings && t.console.log("JQMIGRATE: Migrate plugin loaded multiple times"), 38 t.console.log("JQMIGRATE: Migrate is installed" + (e.migrateMute ? "" : " with logging active") + ", version " + e.migrateVersion)); 39 }(); 40 var o = {}; 41 e.migrateWarnings = [], void 0 === e.migrateTrace && (e.migrateTrace = !0), e.migrateReset = function() { 42 o = {}, e.migrateWarnings.length = 0; 43 }, "BackCompat" === t.document.compatMode && r("jQuery is not compatible with Quirks Mode"); 44 var i = e.fn.init, s = e.isNumeric, u = e.find, c = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, l = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g; 45 e.fn.init = function(e) { 46 var t = Array.prototype.slice.call(arguments); 47 return "string" == typeof e && "#" === e && (r("jQuery( '#' ) is not a valid selector"), 48 t[0] = []), i.apply(this, t); 49 }, e.fn.init.prototype = e.fn, e.find = function(e) { 50 var n = Array.prototype.slice.call(arguments); 51 if ("string" == typeof e && c.test(e)) try { 52 t.document.querySelector(e); 53 } catch (a) { 54 e = e.replace(l, function(e, t, r, n) { 55 return "[" + t + r + '"' + n + '"]'; 56 }); 57 try { 58 t.document.querySelector(e), r("Attribute selector with '#' must be quoted: " + n[0]), 59 n[0] = e; 60 } catch (e) { 61 r("Attribute selector with '#' was not fixed: " + n[0]); 62 } 63 } 64 return u.apply(this, n); 65 }; 66 var d; 67 for (d in u) Object.prototype.hasOwnProperty.call(u, d) && (e.find[d] = u[d]); 68 e.fn.size = function() { 69 return r("jQuery.fn.size() is deprecated and removed; use the .length property"), 70 this.length; 71 }, e.parseJSON = function() { 72 return r("jQuery.parseJSON is deprecated; use JSON.parse"), JSON.parse.apply(null, arguments); 73 }, e.isNumeric = function(t) { 74 var n = s(t), a = function(t) { 75 var r = t && t.toString(); 76 return !e.isArray(t) && r - parseFloat(r) + 1 >= 0; 77 }(t); 78 return n !== a && r("jQuery.isNumeric() should not be called on constructed objects"), 79 a; 80 }, a(e, "holdReady", e.holdReady, "jQuery.holdReady is deprecated"), a(e, "unique", e.uniqueSort, "jQuery.unique is deprecated; use jQuery.uniqueSort"), 81 n(e.expr, "filters", e.expr.pseudos, "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),
82 n(e.expr, ":", e.expr.pseudos, "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"); 83 var p = e.ajax; 84 e.ajax = function() { 85 var e = p.apply(this, arguments); 86 return e.promise && (a(e, "success", e.done, "jQXHR.success is deprecated and removed"), 87 a(e, "error", e.fail, "jQXHR.error is deprecated and removed"), a(e, "complete", e.always, "jQXHR.complete is deprecated and removed")), 88 e; 89 }; 90 var f = e.fn.removeAttr, y = e.fn.toggleClass, m = /\S+/g; 91 e.fn.removeAttr = function(t) { 92 var n = this; 93 return e.each(t.match(m), function(t, a) { 94 e.expr.match.bool.test(a) && (r("jQuery.fn.removeAttr no longer sets boolean properties: " + a), 95 n.prop(a, !1)); 96 }), f.apply(this, arguments); 97 }, e.fn.toggleClass = function(t) { 98 return void 0 !== t && "boolean" != typeof t ? y.apply(this, arguments) : (r("jQuery.fn.toggleClass( boolean ) is deprecated"), 99 this.each(function() { 100 var r = this.getAttribute && this.getAttribute("class") || ""; 101 r && e.data(this, "__className__", r), this.setAttribute && this.setAttribute("class", r || !1 === t ? "" : e.data(this, "__className__") || ""); 102 })); 103 }; 104 var h = !1; 105 e.swap && e.each([ "height", "width", "reliableMarginRight" ], function(t, r) { 106 var n = e.cssHooks[r] && e.cssHooks[r].get; 107 n && (e.cssHooks[r].get = function() { 108 var e; 109 return h = !0, e = n.apply(this, arguments), h = !1, e; 110 }); 111 }), e.swap = function(e, t, n, a) { 112 var o, i, s = {}; 113 h || r("jQuery.swap() is undocumented and deprecated"); 114 for (i in t) s[i] = e.style[i], e.style[i] = t[i]; 115 o = n.apply(e, a || []); 116 for (i in t) e.style[i] = s[i]; 117 return o; 118 }; 119 var g = e.data; 120 e.data = function(t, n, a) { 121 var o; 122 if (n && "object" == typeof n && 2 === arguments.length) { 123 o = e.hasData(t) && g.call(this, t); 124 var i = {}; 125 for (var s in n) s !== e.camelCase(s) ? (r("jQuery.data() always sets/gets camelCased names: " + s), 126 o[s] = n[s]) : i[s] = n[s]; 127 return g.call(this, t, i), n; 128 } 129 return n && "string" == typeof n && n !== e.camelCase(n) && (o = e.hasData(t) && g.call(this, t)) && n in o ? (r("jQuery.data() always sets/gets camelCased names: " + n), 130 arguments.length > 2 && (o[n] = a), o[n]) : g.apply(this, arguments); 131 }; 132 var v = e.Tween.prototype.run, j = function(e) { 133 return e; 134 }; 135 e.Tween.prototype.run = function() { 136 e.easing[this.easing].length > 1 && (r("'jQuery.easing." + this.easing.toString() + "' should use only one argument"), 137 e.easing[this.easing] = j), v.apply(this, arguments); 138 }, e.fx.interval = e.fx.interval || 13, t.requestAnimationFrame && n(e.fx, "interval", e.fx.interval, "jQuery.fx.interval is deprecated"); 139 var Q = e.fn.load, b = e.event.add, w = e.event.fix; 140 e.event.props = [], e.event.fixHooks = {}, n(e.event.props, "concat", e.event.props.concat, "jQuery.event.props.concat() is deprecated and removed"), 141 e.event.fix = function(t) { 142 var n, a = t.type, o = this.fixHooks[a], i = e.event.props; 143 if (i.length) for (r("jQuery.event.props are deprecated and removed: " + i.join()); i.length; ) e.event.addProp(i.pop()); 144 if (o && !o._migrated_ && (o._migrated_ = !0, r("jQuery.event.fixHooks are deprecated and removed: " + a), 145 (i = o.props) && i.length)) for (;i.length; ) e.event.addProp(i.pop()); 146 return n = w.call(this, t), o && o.filter ? o.filter(n, t) : n; 147 }, e.event.add = function(e, n) { 148 return e === t && "load" === n && "complete" === t.document.readyState && r("jQuery(window).on('load'...) called after load event occurred"), 149 b.apply(this, arguments); 150 }, e.each([ "load", "unload", "error" ], function(t, n) { 151 e.fn[n] = function() { 152 var e = Array.prototype.slice.call(arguments, 0); 153 return "load" === n && "string" == typeof e[0] ? Q.apply(this, e) : (r("jQuery.fn." + n + "() is deprecated"), 154 e.splice(0, 0, n), arguments.length ? this.on.apply(this, e) : (this.triggerHandler.apply(this, e), 155 this)); 156 }; 157 }), e.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(t, n) { 158 e.fn[n] = function(e, t) { 159 return r("jQuery.fn." + n + "() event shorthand is deprecated"), arguments.length > 0 ? this.on(n, null, e, t) : this.trigger(n); 160 }; 161 }), e(function() { 162 e(t.document).triggerHandler("ready"); 163 }), e.event.special.ready = { 164 setup: function() { 165 this === t.document && r("'ready' event is deprecated"); 166 } 167 }, e.fn.extend({ 168 bind: function(e, t, n) { 169 return r("jQuery.fn.bind() is deprecated"), this.on(e, null, t, n); 170 }, 171 unbind: function(e, t) { 172 return r("jQuery.fn.unbind() is deprecated"), this.off(e, null, t); 173 }, 174 delegate: function(e, t, n, a) { 175 return r("jQuery.fn.delegate() is deprecated"), this.on(t, e, n, a); 176 }, 177 undelegate: function(e, t, n) { 178 return r("jQuery.fn.undelegate() is deprecated"), 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n); 179 }, 180 hover: function(e, t) { 181 return r("jQuery.fn.hover() is deprecated"), this.on("mouseenter", e).on("mouseleave", t || e); 182 } 183 }); 184 var x = e.fn.offset; 185 e.fn.offset = function() { 186 var n, a = this[0], o = { 187 top: 0, 188 left: 0 189 }; 190 return a && a.nodeType ? (n = (a.ownerDocument || t.document).documentElement, e.contains(n, a) ? x.apply(this, arguments) : (r("jQuery.fn.offset() requires an element connected to a document"), 191 o)) : (r("jQuery.fn.offset() requires a valid DOM element"), o); 192 }; 193 var k = e.param; 194 e.param = function(t, n) { 195 var a = e.ajaxSettings && e.ajaxSettings.traditional; 196 return void 0 === n && a && (r("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"), 197 n = a), k.call(this, t, n); 198 }; 199 var A = e.fn.andSelf || e.fn.addBack; 200 e.fn.andSelf = function() { 201 return r("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"), 202 A.apply(this, arguments); 203 }; 204 var S = e.Deferred, q = [ [ "resolve", "done", e.Callbacks("once memory"), e.Callbacks("once memory"), "resolved" ], [ "reject", "fail", e.Callbacks("once memory"), e.Callbacks("once memory"), "rejected" ], [ "notify", "progress", e.Callbacks("memory"), e.Callbacks("memory") ] ]; 205 return e.Deferred = function(t) { 206 var n = S(), a = n.promise(); 207 return n.pipe = a.pipe = function() { 208 var t = arguments; 209 return r("deferred.pipe() is deprecated"), e.Deferred(function(r) { 210 e.each(q, function(o, i) { 211 var s = e.isFunction(t[o]) && t[o]; 212 n[i[1]](function() { 213 var t = s && s.apply(this, arguments); 214 t && e.isFunction(t.promise) ? t.promise().done(r.resolve).fail(r.reject).progress(r.notify) : r[i[0] + "With"](this === a ? r.promise() : this, s ? [ t ] : arguments); 215 }); 216 }), t = null; 217 }).promise(); 218 }, t && t.call(n, n), n; 219 }, e.Deferred.exceptionHook = S.exceptionHook, e; 220}); 221 222/* ======================================================================== 223 * OctoberCMS: front-end JavaScript framework 224 * http://octobercms.com 225 * ======================================================================== 226 * Copyright 2016-2020 Alexey Bobkov, Samuel Georges 227 * ======================================================================== */ 228 229if (window.jQuery === undefined) { 230 throw new Error('The jQuery library is not loaded. The OctoberCMS framework cannot be initialized.'); 231} 232if (window.jQuery.request !== undefined) { 233 throw new Error('The OctoberCMS framework is already loaded.'); 234} 235 236+function ($) { "use strict"; 237 238 var Request = function (element, handler, options) { 239 var $el = this.$el = $(element); 240 this.options = options || {}; 241 242 /* 243 * Validate handler name 244 */ 245 if (handler === undefined) { 246 throw new Error('The request handler name is not specified.') 247 } 248 249 if (!handler.match(/^(?:\w+\:{2})?on*/)) { 250 throw new Error('Invalid handler name. The correct handler name format is: "onEvent".') 251 } 252 253 /* 254 * Prepare the options 255 */ 256 var $form = options.form ? $(options.form) : $el.closest('form'), 257 $triggerEl = !!$form.length ? $form : $el, 258 context = { handler: handler, options: options } 259 260 /* 261 * Validate the form client-side 262 */ 263 if ((options.browserValidate !== undefined) && typeof document.createElement('input').reportValidity == 'function' && $form && $form[0] && !$form[0].checkValidity()) { 264 $form[0].reportValidity(); 265 return false;
266 } 267 268 /* 269 * Execute the request 270 */ 271 $el.trigger('ajaxSetup', [context]) 272 var _event = jQuery.Event('oc.beforeRequest') 273 $triggerEl.trigger(_event, context) 274 if (_event.isDefaultPrevented()) return 275 276 var loading = options.loading !== undefined ? options.loading : null, 277 url = options.url !== undefined ? options.url : window.location.href, 278 isRedirect = options.redirect !== undefined && options.redirect.length, 279 useFlash = options.flash !== undefined, 280 useFiles = options.files !== undefined 281 282 if (useFiles && typeof FormData === 'undefined') { 283 console.warn('This browser does not support file uploads via FormData') 284 useFiles = false 285 } 286 287 if ($.type(loading) == 'string') { 288 loading = $(loading) 289 } 290 291 /* 292 * Request headers 293 */ 294 var requestHeaders = { 295 'X-OCTOBER-REQUEST-HANDLER': handler, 296 'X-OCTOBER-REQUEST-PARTIALS': this.extractPartials(options.update) 297 } 298 299 if (useFlash) { 300 requestHeaders['X-OCTOBER-REQUEST-FLASH'] = 1 301 } 302 303 var csrfToken = getXSRFToken() 304 if (csrfToken) { 305 requestHeaders['X-XSRF-TOKEN'] = csrfToken 306 } 307 308 /* 309 * Request data 310 */ 311 var requestData, 312 inputName, 313 data = {} 314 315 $.each($el.parents('[data-request-data]').toArray().reverse(), function extendRequest() { 316 $.extend(data, paramToObj('data-request-data', $(this).data('request-data'))) 317 }) 318 319 if ($el.is(':input') && !$form.length) { 320 inputName = $el.attr('name') 321 if (inputName !== undefined && options.data[inputName] === undefined) { 322 options.data[inputName] = $el.val() 323 } 324 } 325 326 if (options.data !== undefined && !$.isEmptyObject(options.data)) { 327 $.extend(data, options.data) 328 } 329 330 if (useFiles) { 331 requestData = new FormData($form.length ? $form.get(0) : undefined) 332 333 if ($el.is(':file') && inputName) { 334 $.each($el.prop('files'), function() { 335 requestData.append(inputName, this) 336 }) 337 338 delete data[inputName] 339 } 340 341 $.each(data, function(key) { 342 if (typeof Blob !== "undefined" && this instanceof Blob && this.filename) { 343 requestData.append(key, this, this.filename) 344 } else { 345 requestData.append(key, this) 346 } 347 }) 348 } 349 else { 350 requestData = [$form.serialize(), $.param(data)].filter(Boolean).join('&') 351 } 352 353 /* 354 * Request options 355 */ 356 var requestOptions = { 357 url: url, 358 crossDomain: false, 359 global: options.ajaxGlobal, 360 context: context, 361 headers: requestHeaders, 362 success: function(data, textStatus, jqXHR) { 363 /* 364 * Halt here if beforeUpdate() or data-request-before-update returns false 365 */ 366 if (this.options.beforeUpdate.apply(this, [data, textStatus, jqXHR]) === false) return 367 if (options.evalBeforeUpdate && eval('(function($el, context, data, textStatus, jqXHR) {'+options.evalBeforeUpdate+'}.call($el.get(0), $el, context, data, textStatus, jqXHR))') === false) return 368 369 /* 370 * Trigger 'ajaxBeforeUpdate' on the form, halt if event.preventDefault() is called 371 */ 372 var _event = jQuery.Event('ajaxBeforeUpdate') 373 $triggerEl.trigger(_event, [context, data, textStatus, jqXHR]) 374 if (_event.isDefaultPrevented()) return 375 376 if (useFlash && data['X_OCTOBER_FLASH_MESSAGES']) { 377 $.each(data['X_OCTOBER_FLASH_MESSAGES'], function(type, message) { 378 requestOptions.handleFlashMessage(message, type) 379 }) 380 } 381 382 /* 383 * Proceed with the update process 384 */ 385 var updatePromise = requestOptions.handleUpdateResponse(data, textStatus, jqXHR) 386 387 updatePromise.done(function() {
388 $triggerEl.trigger('ajaxSuccess', [context, data, textStatus, jqXHR]) 389 options.evalSuccess && eval('(function($el, context, data, textStatus, jqXHR) {'+options.evalSuccess+'}.call($el.get(0), $el, context, data, textStatus, jqXHR))') 390 }) 391 392 return updatePromise 393 }, 394 error: function(jqXHR, textStatus, errorThrown) { 395 var errorMsg, 396 updatePromise = $.Deferred() 397 398 if ((window.ocUnloading !== undefined && window.ocUnloading) || errorThrown == 'abort') 399 return 400 401 /* 402 * Disable redirects 403 */ 404 isRedirect = false 405 options.redirect = null 406 407 /* 408 * Error 406 is a "smart error" that returns response object that is 409 * processed in the same fashion as a successful response. 410 */ 411 if (jqXHR.status == 406 && jqXHR.responseJSON) { 412 errorMsg = jqXHR.responseJSON['X_OCTOBER_ERROR_MESSAGE'] 413 updatePromise = requestOptions.handleUpdateResponse(jqXHR.responseJSON, textStatus, jqXHR) 414 } 415 /* 416 * Standard error with standard response text 417 */ 418 else { 419 errorMsg = jqXHR.responseText ? jqXHR.responseText : jqXHR.statusText 420 updatePromise.resolve() 421 } 422 423 updatePromise.done(function() { 424 $el.data('error-message', errorMsg) 425 426 /* 427 * Trigger 'ajaxError' on the form, halt if event.preventDefault() is called 428 */ 429 var _event = jQuery.Event('ajaxError') 430 $triggerEl.trigger(_event, [context, errorMsg, textStatus, jqXHR]) 431 if (_event.isDefaultPrevented()) return 432 433 /* 434 * Halt here if the data-request-error attribute returns false 435 */ 436 if (options.evalError && eval('(function($el, context, errorMsg, textStatus, jqXHR) {'+options.evalError+'}.call($el.get(0), $el, context, errorMsg, textStatus, jqXHR))') === false) 437 return 438 439 requestOptions.handleErrorMessage(errorMsg) 440 }) 441 442 return updatePromise 443 }, 444 complete: function(data, textStatus, jqXHR) { 445 $triggerEl.trigger('ajaxComplete', [context, data, textStatus, jqXHR]) 446 options.evalComplete && eval('(function($el, context, data, textStatus, jqXHR) {'+options.evalComplete+'}.call($el.get(0), $el, context, data, textStatus, jqXHR))') 447 }, 448 449 /* 450 * Custom function, requests confirmation from the user 451 */ 452 handleConfirmMessage: function(message) { 453 var _event = jQuery.Event('ajaxConfirmMessage') 454 455 _event.promise = $.Deferred() 456 if ($(window).triggerHandler(_event, [message]) !== undefined) { 457 _event.promise.done(function() { 458 options.confirm = null 459 new Request(element, handler, options) 460 }) 461 return false 462 } 463 464 if (_event.isDefaultPrevented()) return 465 if (message) return confirm(message) 466 }, 467 468 /* 469 * Custom function, display an error message to the user 470 */ 471 handleErrorMessage: function(message) { 472 var _event = jQuery.Event('ajaxErrorMessage') 473 $(window).trigger(_event, [message]) 474 if (_event.isDefaultPrevented()) return 475 if (message) alert(message) 476 }, 477 478 /* 479 * Custom function, focus fields with errors 480 */ 481 handleValidationMessage: function(message, fields) {
482 $triggerEl.trigger('ajaxValidation', [context, message, fields]) 483 484 var isFirstInvalidField = true 485 $.each(fields, function focusErrorField(fieldName, fieldMessages) { 486 fieldName = fieldName.replace(/\.(\w+)/g, '[$1]') 487 488 var fieldElement = $form.find('[name="'+fieldName+'"], [name="'+fieldName+'[]"], [name$="['+fieldName+']"], [name$="['+fieldName+'][]"]').filter(':enabled').first() 489 if (fieldElement.length > 0) { 490 491 var _event = jQuery.Event('ajaxInvalidField') 492 $(window).trigger(_event, [fieldElement.get(0), fieldName, fieldMessages, isFirstInvalidField]) 493 494 if (isFirstInvalidField) { 495 if (!_event.isDefaultPrevented()) fieldElement.focus() 496 isFirstInvalidField = false 497 } 498 } 499 }) 500 }, 501 502 /* 503 * Custom function, display a flash message to the user 504 */ 505 handleFlashMessage: function(message, type) {}, 506 507 /* 508 * Custom function, redirect the browser to another location 509 */ 510 handleRedirectResponse: function(url) { 511 window.location.assign(url) 512 }, 513 514 /* 515 * Custom function, handle any application specific response values 516 * Using a promisary object here in case injected assets need time to load 517 */ 518 handleUpdateResponse: function(data, textStatus, jqXHR) { 519 520 /* 521 * Update partials and finish request 522 */ 523 var updatePromise = $.Deferred().done(function() { 524 for (var partial in data) { 525 /* 526 * If a partial has been supplied on the client side that matches the server supplied key, look up 527 * it's selector and use that. If not, we assume it is an explicit selector reference. 528 */ 529 var selector = (options.update[partial]) ? options.update[partial] : partial 530 if ($.type(selector) == 'string' && selector.charAt(0) == '@') { 531 $(selector.substring(1)).append(data[partial]).trigger('ajaxUpdate', [context, data, textStatus, jqXHR]) 532 } 533 else if ($.type(selector) == 'string' && selector.charAt(0) == '^') { 534 $(selector.substring(1)).prepend(data[partial]).trigger('ajaxUpdate', [context, data, textStatus, jqXHR]) 535 } 536 else { 537 $(selector).trigger('ajaxBeforeReplace') 538 $(selector).html(data[partial]).trigger('ajaxUpdate', [context, data, textStatus, jqXHR]) 539 } 540 } 541 542 /* 543 * Wait for .html() method to finish rendering from partial updates 544 */ 545 setTimeout(function() { 546 $(window) 547 .trigger('ajaxUpdateComplete', [context, data, textStatus, jqXHR]) 548 .trigger('resize') 549 }, 0) 550 }) 551 552 /* 553 * Handle redirect 554 */ 555 if (data['X_OCTOBER_REDIRECT']) { 556 options.redirect = data['X_OCTOBER_REDIRECT'] 557 isRedirect = true 558 } 559 560 if (isRedirect) { 561 requestOptions.handleRedirectResponse(options.redirect) 562 } 563 564 /* 565 * Handle validation 566 */ 567 if (data['X_OCTOBER_ERROR_FIELDS']) { 568 requestOptions.handleValidationMessage(data['X_OCTOBER_ERROR_MESSAGE'], data['X_OCTOBER_ERROR_FIELDS']) 569 } 570 571 /* 572 * Handle asset injection 573 */ 574 if (data['X_OCTOBER_ASSETS']) { 575 assetManager.load(data['X_OCTOBER_ASSETS'], $.proxy(updatePromise.resolve, updatePromise)) 576 } 577 else { 578 updatePromise.resolve() 579 } 580 581 return updatePromise 582 } 583 } 584 585 if (useFiles) { 586 requestOptions.processData = requestOptions.contentType = false 587 } 588 589 /* 590 * Allow default business logic to be called from user functions 591 */ 592 context.success = requestOptions.success 593 context.error = requestOptions.error 594 context.complete = requestOptions.complete 595 requestOptions = $.extend(requestOptions, options) 596 requestOptions.data = requestData 597 598 /* 599 * Initiate request 600 */ 601 if (options.confirm && !requestOptions.handleConfirmMessage(options.confirm)) { 602 return 603 } 604 605 if (loading) loading.show()
606 $(window).trigger('ajaxBeforeSend', [context]) 607 $el.trigger('ajaxPromise', [context]) 608 609 return $.ajax(requestOptions) 610 .fail(function(jqXHR, textStatus, errorThrown) { 611 if (!isRedirect) { 612 $el.trigger('ajaxFail', [context, textStatus, jqXHR]) 613 } 614 if (loading) loading.hide() 615 }) 616 .done(function(data, textStatus, jqXHR) { 617 if (!isRedirect) { 618 $el.trigger('ajaxDone', [context, data, textStatus, jqXHR]) 619 } 620 if (loading) loading.hide() 621 }) 622 .always(function(dataOrXhr, textStatus, xhrOrError) { 623 $el.trigger('ajaxAlways', [context, dataOrXhr, textStatus, xhrOrError]) 624 }) 625 } 626 627 Request.DEFAULTS = { 628 update: {}, 629 type : 'POST', 630 beforeUpdate: function(data, textStatus, jqXHR) {}, 631 evalBeforeUpdate: null, 632 evalSuccess: null, 633 evalError: null, 634 evalComplete: null, 635 ajaxGlobal: false 636 } 637 638 /* 639 * Internal function, build a string of partials and their update elements. 640 */ 641 Request.prototype.extractPartials = function(update) { 642 var result = [] 643 644 for (var partial in update) 645 result.push(partial) 646 647 return result.join('&') 648 } 649 650 // REQUEST PLUGIN DEFINITION 651 // ============================ 652 653 var old = $.fn.request 654 655 $.fn.request = function(handler, option) { 656 var args = arguments 657 658 var $this = $(this).first() 659 var data = { 660 evalBeforeUpdate: $this.data('request-before-update'), 661 evalSuccess: $this.data('request-success'), 662 evalError: $this.data('request-error'), 663 evalComplete: $this.data('request-complete'), 664 ajaxGlobal: $this.data('request-ajax-global'), 665 confirm: $this.data('request-confirm'), 666 redirect: $this.data('request-redirect'), 667 loading: $this.data('request-loading'), 668 flash: $this.data('request-flash'), 669 files: $this.data('request-files'), 670 browserValidate: $this.data('browser-validate'), 671 form: $this.data('request-form'), 672 url: $this.data('request-url'), 673 update: paramToObj('data-request-update', $this.data('request-update')), 674 data: paramToObj('data-request-data', $this.data('request-data')) 675 } 676 if (!handler) handler = $this.data('request') 677 var options = $.extend(true, {}, Request.DEFAULTS, data, typeof option == 'object' && option) 678 return new Request($this, handler, options) 679 } 680 681 $.fn.request.Constructor = Request 682 683 $.request = function(handler, option) { 684 return $(document).request(handler, option) 685 } 686 687 // REQUEST NO CONFLICT 688 // ================= 689 690 $.fn.request.noConflict = function() { 691 $.fn.request = old 692 return this 693 } 694 695 // REQUEST DATA-API 696 // ============== 697 698 function paramToObj(name, value) { 699 if (value === undefined) value = '' 700 if (typeof value == 'object') return value 701 702 try { 703 return ocJSON("{" + value + "}") 704 } 705 catch (e) { 706 throw new Error('Error parsing the '+name+' attribute value. '+e) 707 } 708 } 709 710 function getXSRFToken() { 711 var cookieValue = null 712 if (document.cookie && document.cookie != '') { 713 var cookies = document.cookie.split(';') 714 for (var i = 0; i < cookies.length; i++) { 715 var cookie = jQuery.trim(cookies[i]) 716 if (cookie.substring(0, 11) == ('XSRF-TOKEN' + '=')) { 717 cookieValue = decodeURIComponent(cookie.substring(11)) 718 break 719 } 720 } 721 } 722 return cookieValue 723 } 724 725 $(document).on('change', 'select[data-request], input[type=radio][data-request], input[type=checkbox][data-request], input[type=file][data-request]', function documentOnChange() { 726 $(this).request() 727 }) 728 729 $(document).on('click', 'a[data-request], button[data-request], input[type=button][data-request], input[type=submit][data-request]', function documentOnClick(e) { 730 e.preventDefault() 731 732 $(this).request() 733 734 if ($(this).is('[type=submit]')) 735 return false 736 }) 737 738 $(document).on('keydown', 'input[type=text][data-request], input[type=submit][data-request], input[type=password][data-request]', function documentOnKeydown(e) { 739 if (e.key === 'Enter') { 740 if (this.dataTrackInputTimer !== undefined) 741 window.clearTimeout(this.dataTrackInputTimer) 742 743 $(this).request() 744 return false 745 } 746 }) 747 748 $(document).on('input', 'input[data-request][data-track-input]', function documentOnKeyup(e) { 749 var 750 $el = $(this),
751 lastValue = $el.data('oc.lastvalue') 752 753 if (!$el.is('[type=email],[type=number],[type=password],[type=search],[type=text]')) 754 return 755 756 if (lastValue !== undefined && lastValue == this.value) 757 return 758 759 $el.data('oc.lastvalue', this.value) 760 761 if (this.dataTrackInputTimer !== undefined) 762 window.clearTimeout(this.dataTrackInputTimer) 763 764 var interval = $(this).data('track-input') 765 if (!interval) 766 interval = 300 767 768 var self = this 769 this.dataTrackInputTimer = window.setTimeout(function() { 770 if (self.lastDataTrackInputRequest) { 771 self.lastDataTrackInputRequest.abort(); 772 } 773 self.lastDataTrackInputRequest = $(self).request(); 774 }, interval) 775 }) 776 777 $(document).on('submit', '[data-request]', function documentOnSubmit() { 778 $(this).request() 779 return false 780 }) 781 782 $(window).on('beforeunload', function documentOnBeforeUnload() { 783 window.ocUnloading = true 784 }) 785 786 /* 787 * Invent our own event that unifies document.ready with window.ajaxUpdateComplete 788 * 789 * $(document).render(function() { }) 790 * $(document).on('render', function() { }) 791 */ 792 793 $(document).ready(function triggerRenderOnReady() { 794 $(document).trigger('render') 795 }) 796 797 $(window).on('ajaxUpdateComplete', function triggerRenderOnAjaxUpdateComplete() { 798 $(document).trigger('render') 799 }) 800 801 $.fn.render = function(callback) { 802 $(document).on('render', callback) 803 } 804 805}(window.jQuery); 806 807/* 808 * October CMS JSON Parser 809 */ 810+function(window) { "use strict"; 811 function parseKey(str, pos, quote) { 812 var key = ""; 813 for (var i = pos; i < str.length; i++) { 814 if (quote && quote === str[i]) { 815 return key; 816 } else if (!quote && (str[i] === " " || str[i] === ":")) { 817 return key; 818 } 819 820 key += str[i]; 821 822 if (str[i] === "\\" && i + 1 < str.length) { 823 key += str[i + 1]; 824 i++; 825 } 826 } 827 throw new Error("Broken JSON syntax near " + key); 828 } 829 830 function getBody(str, pos) { 831 // parse string body 832 if (str[pos] === "\"" || str[pos] === "'") { 833 var body = str[pos]; 834 for (var i = pos + 1; i < str.length; i++) { 835 if (str[i] === "\\") { 836 body += str[i]; 837 if (i + 1 < str.length) body += str[i + 1]; 838 i++; 839 } else if (str[i] === str[pos]) { 840 body += str[pos]; 841 return { 842 originLength: body.length, 843 body: body 844 }; 845 } else body += str[i]; 846 } 847 throw new Error("Broken JSON string body near " + body); 848 } 849 850 // parse true / false 851 if (str[pos] === "t") { 852 if (str.indexOf("true", pos) === pos) { 853 return { 854 originLength: "true".length, 855 body: "true" 856 }; 857 } 858 throw new Error("Broken JSON boolean body near " + str.substr(0, pos + 10)); 859 } 860 if (str[pos] === "f") { 861 if (str.indexOf("f", pos) === pos) { 862 return { 863 originLength: "false".length, 864 body: "false" 865 }; 866 } 867 throw new Error("Broken JSON boolean body near " + str.substr(0, pos + 10)); 868 } 869 870 // parse null 871 if (str[pos] === "n") { 872 if (str.indexOf("null", pos) === pos) { 873 return { 874 originLength: "null".length, 875 body: "null" 876 }; 877 } 878 throw new Error("Broken JSON boolean body near " + str.substr(0, pos + 10)); 879 } 880 881 // parse number 882 if (str[pos] === "-" || str[pos] === "+" || str[pos] === "." || (str[pos] >= "0" && str[pos] <= "9")) { 883 var body = ""; 884 for (var i = pos; i < str.length; i++) { 885 if (str[i] === "-" || str[i] === "+" || str[i] === "." || (str[i] >= "0" && str[i] <= "9")) { 886 body += str[i]; 887 } else { 888 return { 889 originLength: body.length, 890 body: body 891 }; 892 } 893 } 894 throw new Error("Broken JSON number body near " + body); 895 } 896 897 // parse object 898 if (str[pos] === "{" || str[pos] === "[") { 899 var stack = [str[pos]]; 900 var body = str[pos]; 901 for (var i = pos + 1; i < str.length; i++) { 902 body += str[i]; 903 if (str[i] === "\\") { 904 if (i + 1 < str.length) body += str[i + 1]; 905 i++; 906 } else if (str[i] === "\"") { 907 if (stack[stack.length - 1] === "\"") { 908 stack.pop(); 909 } else if (stack[stack.length - 1] !== "'") {
910 stack.push(str[i]); 911 } 912 } else if (str[i] === "'") { 913 if (stack[stack.length - 1] === "'") { 914 stack.pop(); 915 } else if (stack[stack.length - 1] !== "\"") { 916 stack.push(str[i]); 917 } 918 } else if (stack[stack.length - 1] !== "\"" && stack[stack.length - 1] !== "'") { 919 if (str[i] === "{") { 920 stack.push("{"); 921 } else if (str[i] === "}") { 922 if (stack[stack.length - 1] === "{") { 923 stack.pop(); 924 } else { 925 throw new Error("Broken JSON " + (str[pos] === "{" ? "object" : "array") + " body near " + body); 926 } 927 } else if (str[i] === "[") { 928 stack.push("["); 929 } else if (str[i] === "]") { 930 if (stack[stack.length - 1] === "[") { 931 stack.pop(); 932 } else { 933 throw new Error("Broken JSON " + (str[pos] === "{" ? "object" : "array") + " body near " + body); 934 } 935 } 936 } 937 if (!stack.length) { 938 return { 939 originLength: i - pos, 940 body: body 941 }; 942 } 943 } 944 throw new Error("Broken JSON " + (str[pos] === "{" ? "object" : "array") + " body near " + body); 945 } 946 throw new Error("Broken JSON body near " + str.substr((pos - 5 >= 0) ? pos - 5 : 0, 50)); 947 } 948 949 function canBeKeyHead(ch) { 950 if (ch[0] === "\\") return false; 951 if ((ch[0] >= 'a' && ch[0] <= 'z') || (ch[0] >= 'A' && ch[0] <= 'Z') || ch[0] === '_') return true; 952 if (ch[0] >= '0' && ch[0] <= '9') return true; 953 if (ch[0] === '$') return true; 954 if (ch.charCodeAt(0) > 255) return true; 955 return false; 956 } 957 958 function isBlankChar(ch) { 959 return ch === " " || ch === "\n" || ch === "\t"; 960 } 961 962 function parse(str) { 963 str = str.trim(); 964 if (!str.length) throw new Error("Broken JSON object."); 965 var result = ""; 966 967 /* 968 * the mistake ',' 969 */ 970 while (str && str[0] === ",") { 971 str = str.substr(1); 972 } 973 974 /* 975 * string 976 */ 977 if (str[0] === "\"" || str[0] === "'") { 978 if (str[str.length - 1] !== str[0]) { 979 throw new Error("Invalid string JSON object."); 980 } 981 982 var body = "\""; 983 for (var i = 1; i < str.length; i++) { 984 if (str[i] === "\\") { 985 if (str[i + 1] === "'") { 986 body += str[i + 1] 987 } else { 988 body += str[i]; 989 body += str[i + 1]; 990 } 991 i++; 992 } else if (str[i] === str[0]) { 993 body += "\""; 994 return body 995 } else if (str[i] === "\"") { 996 body += "\\\"" 997 } else body += str[i]; 998 } 999 throw new Error("Invalid string JSON object."); 1000 } 1001 1002 /* 1003 * boolean 1004 */ 1005 if (str === "true" || str === "false") { 1006 return str; 1007 } 1008 1009 /* 1010 * null 1011 */ 1012 if (str === "null") { 1013 return "null"; 1014 } 1015 1016 /* 1017 * number 1018 */ 1019 var num = parseFloat(str); 1020 if (!isNaN(num)) { 1021 return num.toString(); 1022 } 1023 1024 /* 1025 * object 1026 */ 1027 if (str[0] === "{") { 1028 var type = "needKey"; 1029 var result = "{"; 1030 1031 for (var i = 1; i < str.length; i++) { 1032 if (isBlankChar(str[i])) { 1033 continue; 1034 } else if (type === "needKey" && (str[i] === "\"" || str[i] === "'")) { 1035 var key = parseKey(str, i + 1, str[i]); 1036 result += "\"" + key + "\""; 1037 i += key.length; 1038 i += 1; 1039 type = "afterKey"; 1040 } else if (type === "needKey" && canBeKeyHead(str[i])) { 1041 var key = parseKey(str, i); 1042 result += "\""; 1043 result += key; 1044 result += "\""; 1045 i += key.length - 1; 1046 type = "afterKey"; 1047 } else if (type === "afterKey" && str[i] === ":") { 1048 result += ":"; 1049 type = ":"; 1050 } else if (type === ":") { 1051 var body = getBody(str, i); 1052 1053 i = i + body.originLength - 1; 1054 result += parse(body.body); 1055 1056 type = "afterBody"; 1057 } else if (type === "afterBody" || type === "needKey") { 1058 var last = i; 1059 while (str[last] === "," || isBlankChar(str[last])) { 1060 last++; 1061 } 1062 if (str[last] === "}" && last === str.length - 1) { 1063 while (result[result.length - 1] === ",") { 1064 result = result.substr(0, result.length - 1); 1065 } 1066 result += "}"; 1067 return result; 1068 } else if (last !== i && result !== "{") { 1069 result += ","; 1070 type = "needKey"; 1071 i = last - 1; 1072 } 1073 } 1074 } 1075 throw new Error("Broken JSON object near " + result); 1076 } 1077 1078 /* 1079 * array 1080 */ 1081 if (str[0] === "[") { 1082 var result = "["; 1083 var type = "needBody"; 1084 for (var i = 1; i < str.length; i++) { 1085 if (" " === str[i] || "\n" === str[i] || "\t" === str[i]) { 1086 continue; 1087 } else if (type === "needBody") { 1088 if (str[i] === ",") { 1089 result += "null,"; 1090 continue; 1091 } 1092 if (str[i] === "]" && i === str.length - 1) { 1093 if (result[result.length - 1] === ",") result = result.substr(0, result.length - 1); 1094 result += "]"; 1095 return result; 1096 } 1097 1098 var body = getBody(str, i); 1099 1100 i = i + body.originLength - 1; 1101 result += parse(body.body); 1102 1103 type = "afterBody"; 1104 } else if (type === "afterBody") { 1105 if (str[i] === ",") { 1106 result += ","; 1107 type = "needBody"; 1108 1109 // deal with mistake "," 1110 while (str[i + 1] === "," || isBlankChar(str[i + 1])) { 1111 if (str[i + 1] === ",") result += "null,"; 1112 i++; 1113 } 1114 } else if (str[i] === "]" && i === str.length - 1) { 1115 result += "]"; 1116 return result; 1117 } 1118 } 1119 } 1120 throw new Error("Broken JSON array near " + result); 1121 } 1122 } 1123 1124 // Global function 1125 window.ocJSON = function(json) { 1126 var jsonString = parse(json); 1127 return JSON.parse(jsonString); 1128 }; 1129 1130}(window); 1131 1132/* 1133 * October CMS jQuery HTML Sanitizer 1134 * @see https://gist.github.com/ufologist/5a0da51b2b9ef1b861c30254172ac3c9 1135 */ 1136+function(window) { "use strict"; 1137 1138 function trimAttributes(node) { 1139 $.each(node.attributes, function() { 1140 var attrName = this.name; 1141 var attrValue = this.value; 1142 1143 /* 1144 * remove attributes where the names start with "on" (for example: onload, onerror...) 1145 * remove attributes where the value starts with the "javascript:" pseudo protocol (for example href="javascript:alert(1)") 1146 */ 1147 if (attrName.indexOf('on') == 0 || attrValue.indexOf('javascript:') == 0) { 1148 $(node).removeAttr(attrName); 1149 } 1150 }); 1151 } 1152 1153 function sanitize(html) { 1154 /* 1155 * [jQuery.parseHTML(data [, context ] [, keepScripts ])](http://api.jquery.com/jQuery.parseHTML/) added: 1.8 1156 * Parses a string into an array of DOM nodes. 1157 * 1158 * By default, the context is the current document if not specified or given as null or undefined. If the HTML was to be used 1159 * in another document such as an iframe, that frame's document could be used. 1160 * 1161 * As of 3.0 the default behavior is changed. 1162 * 1163 * If the context is not specified or given as null or undefined, a new document is used. 1164 * This can potentially improve security because inline events will not execute when the HTML is parsed. Once the parsed HTML 1165 * is injected into a document it does execute, but this gives tools a chance to traverse the created DOM and remove anything 1166 * deemed unsafe. This improvement does not apply to internal uses of jQuery.parseHTML as they usually pass in the current 1167 * document. Therefore, a statement like $( "#log" ).append( $( htmlString ) ) is still subject to the injection of malicious code. 1168 * 1169 * without context do not execute script 1170 * $.parseHTML('<div><img src=1 onerror=alert(1)></div>'); 1171 * $.parseHTML('<div><img src=1 onerror=alert(2)></div>', null); 1172 * 1173 * with context document execute script! 1174 * $.parseHTML('<div><img src=1 onerror=alert(3)></div>', document); 1175 * 1176 * Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run scripts 1177 * in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute scripts 1178 * indirectly, for example via the <img onerror> attribute. 1179 * 1180 * will return [] 1181 * $.parseHTML('<script>alert(1)<\/script>', null, false); 1182 * 1183 * will return [script DOM element] 1184 * $.parseHTML('<script>alert(1)<\/script>', null, true); 1185 */ 1186 var output = $($.parseHTML('<div>' + html + '</div>', null, false));
1187 output.find('*').each(function() { 1188 trimAttributes(this); 1189 }); 1190 return output.html(); 1191 } 1192 1193 // Global function 1194 window.ocSanitize = function(html) { 1195 return sanitize(html) 1196 }; 1197 1198}(window); 1199/* ======================================================================== 1200 * OctoberCMS: front-end JavaScript extras 1201 * http://octobercms.com 1202 * ======================================================================== 1203 * Copyright 2016-2020 Alexey Bobkov, Samuel Georges 1204 * ======================================================================== */ 1205 1206+function ($) { "use strict"; 1207 if ($.oc === undefined) 1208 $.oc = {} 1209 1210 // @todo Provide an interface for configuration 1211 // - Custom loader CSS class 1212 // - Custom stripe loader color 1213 // - Flash message interval 1214 1215 var LOADER_CLASS = 'oc-loading'; 1216 1217 // FLASH HANDLING 1218 // ============================ 1219 1220 $(document).on('ajaxSetup', '[data-request][data-request-flash]', function(event, context) { 1221 context.options.handleErrorMessage = function(message) { 1222 $.oc.flashMsg({ text: message, class: 'error' }) 1223 } 1224 1225 context.options.handleFlashMessage = function(message, type) { 1226 $.oc.flashMsg({ text: message, class: type }) 1227 } 1228 }) 1229 1230 // FORM VALIDATION 1231 // ============================ 1232 1233 $(document).on('ajaxValidation', '[data-request][data-request-validate]', function(event, context, errorMsg, fields) { 1234 var $this = $(this).closest('form'), 1235 $container = $('[data-validate-error]', $this), 1236 messages = [], 1237 $field 1238 1239 $.each(fields, function(fieldName, fieldMessages) { 1240 $field = $('[data-validate-for="'+fieldName+'"]', $this) 1241 messages = $.merge(messages, fieldMessages) 1242 if (!!$field.length) { 1243 if (!$field.text().length || $field.data('emptyMode') == true) { 1244 $field 1245 .data('emptyMode', true) 1246 .text(fieldMessages.join(', ')) 1247 } 1248 $field.addClass('visible') 1249 } 1250 }) 1251 1252 if (!!$container.length) { 1253 $container = $('[data-validate-error]', $this) 1254 } 1255 1256 if (!!$container.length) { 1257 var $oldMessages = $('[data-message]', $container) 1258 $container.addClass('visible') 1259 1260 if (!!$oldMessages.length) { 1261 var $clone = $oldMessages.first() 1262 1263 $.each(messages, function(key, message) { 1264 $clone.clone().text(message).insertAfter($clone) 1265 }) 1266 1267 $oldMessages.remove() 1268 } 1269 else { 1270 $container.text(errorMsg) 1271 } 1272 } 1273 1274 $this.one('ajaxError', function(event){ 1275 event.preventDefault() 1276 }) 1277 }) 1278 1279 $(document).on('ajaxPromise', '[data-request][data-request-validate]', function() { 1280 var $this = $(this).closest('form') 1281 $('[data-validate-for]', $this).removeClass('visible') 1282 $('[data-validate-error]', $this).removeClass('visible') 1283 }) 1284 1285 // LOADING BUTTONS 1286 // ============================ 1287 1288 $(document) 1289 .on('ajaxPromise', '[data-request]', function() { 1290 var $target = $(this) 1291 1292 if ($target.data('attach-loading') !== undefined) { 1293 $target 1294 .addClass(LOADER_CLASS) 1295 .prop('disabled', true) 1296 } 1297 1298 if ($target.is('form')) { 1299 $('[data-attach-loading]', $target) 1300 .addClass(LOADER_CLASS) 1301 .prop('disabled', true) 1302 } 1303 }) 1304 .on('ajaxFail ajaxDone', '[data-request]', function() { 1305 var $target = $(this) 1306 1307 if ($target.data('attach-loading') !== undefined) { 1308 $target 1309 .removeClass(LOADER_CLASS) 1310 .prop('disabled', false) 1311 } 1312 1313 if ($target.is('form')) { 1314 $('[data-attach-loading]', $target) 1315 .removeClass(LOADER_CLASS) 1316 .prop('disabled', false) 1317 } 1318 }) 1319 1320 // STRIPE LOAD INDICATOR 1321 // ============================ 1322 1323 var StripeLoadIndicator = function() { 1324 var self = this 1325 this.counter = 0 1326 this.indicator = $('<div/>').addClass('stripe-loading-indicator loaded') 1327 .append($('<div />').addClass('stripe')) 1328 .append($('<div />').addClass('stripe-loaded')) 1329 this.stripe = this.indicator.find('.stripe') 1330 1331 $(document).ready(function() { 1332 $(document.body).append(self.indicator) 1333 }) 1334 } 1335 1336 StripeLoadIndicator.prototype.show = function() { 1337 this.counter++ 1338 1339 // Restart the animation 1340 this.stripe.after(this.stripe = this.stripe.clone()).remove() 1341 1342 if (this.counter > 1) { 1343 return 1344 } 1345 1346 this.indicator.removeClass('loaded') 1347 $(document.body).addClass('oc-loading') 1348 } 1349 1350 StripeLoadIndicator.prototype.hide = function(force) { 1351 this.counter-- 1352 1353 if (force !== undefined && force) { 1354 this.counter = 0 1355 } 1356 1357 if (this.counter <= 0) { 1358 this.indicator.addClass('loaded') 1359 $(document.body).removeClass('oc-loading') 1360 } 1361 } 1362 1363 $.oc.stripeLoadIndicator = new StripeLoadIndicator() 1364 1365 // STRIPE LOAD INDICATOR DATA-API 1366 // ============================ 1367 1368 $(document) 1369 .on('ajaxPromise', '[data-request]', function(event) { 1370 // Prevent this event from bubbling up to a non-related data-request 1371 // element, for example a <form> tag wrapping a <button> tag 1372 event.stopPropagation() 1373 1374 $.oc.stripeLoadIndicator.show() 1375
1376 // This code will cover instances where the element has been removed 1377 // from the DOM, making the resolution event below an orphan. 1378 var $el = $(this) 1379 $(window).one('ajaxUpdateComplete', function() { 1380 if ($el.closest('html').length === 0) 1381 $.oc.stripeLoadIndicator.hide() 1382 }) 1383 }) 1384 .on('ajaxFail ajaxDone', '[data-request]', function(event) { 1385 event.stopPropagation() 1386 $.oc.stripeLoadIndicator.hide() 1387 }) 1388 1389 // FLASH MESSAGE 1390 // ============================ 1391 1392 var FlashMessage = function (options, el) { 1393 var 1394 options = $.extend({}, FlashMessage.DEFAULTS, options), 1395 $element = $(el) 1396 1397 $('body > p.flash-message').remove() 1398 1399 if ($element.length == 0) { 1400 $element = $('<p />').addClass(options.class).html(options.text) 1401 } 1402 1403 $element 1404 .addClass('flash-message fade') 1405 .attr('data-control', null) 1406 .on('click', 'button', remove) 1407 .on('click', remove) 1408 .append('<button type="button" class="close" aria-hidden="true">×</button>') 1409 1410 $(document.body).append($element) 1411 1412 setTimeout(function() { 1413 $element.addClass('in') 1414 }, 100) 1415 1416 var timer = window.setTimeout(remove, options.interval * 1000) 1417 1418 function removeElement() { 1419 $element.remove() 1420 } 1421 1422 function remove() { 1423 window.clearInterval(timer) 1424 1425 $element.removeClass('in') 1426 $.support.transition && $element.hasClass('fade') 1427 ? $element 1428 .one($.support.transition.end, removeElement) 1429 .emulateTransitionEnd(500) 1430 : removeElement() 1431 } 1432 } 1433 1434 FlashMessage.DEFAULTS = { 1435 class: 'success', 1436 text: 'Default text', 1437 interval: 5 1438 } 1439 1440 if ($.oc === undefined) 1441 $.oc = {} 1442 1443 $.oc.flashMsg = FlashMessage 1444 1445 // FLASH MESSAGE DATA-API 1446 // =============== 1447 1448 $(document).render(function(){ 1449 $('[data-control=flash-message]').each(function(){ 1450 $.oc.flashMsg($(this).data(), this) 1451 }) 1452 }) 1453 1454}(window.jQuery); 1455 1456/******/ (() => { // webpackBootstrap 1457/******/ var __webpack_modules__ = ({ 1458
1459/***/ "./assets/src/js/app.js": 1460/*!******************************!*\ 1461 !*** ./assets/src/js/app.js ***! 1462 \******************************/ 1463/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1464 1465"use strict"; 1466__webpack_require__.r(__webpack_exports__); 1467/* harmony import */ var _fittext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fittext */ "./assets/src/js/fittext.js"); 1468/* harmony import */ var _fittext__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fittext__WEBPACK_IMPORTED_MODULE_0__); 1469/* harmony import */ var _timeago__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeago */ "./assets/src/js/timeago.js"); 1470/* harmony import */ var _timeago__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_timeago__WEBPACK_IMPORTED_MODULE_1__); 1471window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 1472__webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js"); 1473__webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js"); 1474 1475 1476$(function () { 1477 // Shorthand for $( document ).ready() 1478 "use strict"; 1479 1480 // Your js script is below this line 1481 // --------------------------------------------------------------------- // 1482 1483 // Example 1484 // console.log("ready!"); 1485 // parallax scrolling 1486 var $window = $(window); 1487 $('section[data-type="background"]').each(function () { 1488 var $bgobj = $(this); // assigning the object 1489 $(window).scroll(function () { 1490 // async issue fix 1491 setTimeout(function () { 1492 var yPos = -($window.scrollTop() / $bgobj.data('speed')); 1493 // Put together our final background position 1494 var coords = '50% ' + yPos + 'px'; 1495 // Move the background 1496 $bgobj.css({ 1497 backgroundPosition: coords 1498 }); 1499 }, 200); 1500 }); 1501 }); 1502 1503 //overlay 1504 var triggerBtn = $('#trigger-overlay'), 1505 overlay = $('div.overlay'), 1506 overlayLink = $('div.overlay a'), 1507 closeBtn = $('button.overlay-close'); 1508 function toggleOverlay() { 1509 if (overlay.hasClass('open')) { 1510 overlay.removeClass('open'); 1511 triggerBtn.removeClass('open'); 1512 // overlay.addClass('close'); 1513 var onEndTransitionFn = function onEndTransitionFn(ev) { 1514 overlay.removeClass('close'); 1515 }; 1516 } else if (!overlay.hasClass('close')) { 1517 overlay.addClass('open'); 1518 triggerBtn.addClass('open'); 1519 } 1520 } 1521 triggerBtn.click(toggleOverlay); 1522 closeBtn.click(toggleOverlay); 1523 overlayLink.click(toggleOverlay); 1524 1525 // menu transition 1526 $(window).scroll(function () { 1527 var scroll = $(window).scrollTop(); 1528 if (scroll > 0) { 1529 $(".navbar").addClass("navbar-scroll"); 1530 } else { 1531 $(".navbar").removeClass("navbar-scroll"); 1532 } 1533 if (scroll > 500) { 1534 $(".navbar").addClass("bg-primary"); 1535 } else { 1536 $(".navbar").removeClass("bg-primary"); 1537 } 1538 }); 1539 1540 // fb/twitter share buttons 1541 var shareUrl = window.location.href, 1542 fbShareUrl = "https://www.facebook.com/sharer/sharer.php?u=" + shareUrl, 1543 twShareUrl = "https://twitter.com/intent/tweet?text=%20" + shareUrl; 1544 $('.btn-facebook.btn-share').attr('href', fbShareUrl); 1545 $('.btn-facebook.btn-share').click(function (e) { 1546 e.preventDefault(); 1547 var fbWindow = window.open(fbShareUrl, "_blank", "toolbar=no,scrollbars=yes,resizable=yes,width=400,height=600"); 1548 }); 1549 $('.btn-twitter.btn-share').attr('href', twShareUrl); 1550 $('.btn-twitter.btn-share').click(function (e) { 1551 e.preventDefault(); 1552 var twWindow = window.open(twShareUrl, "_blank", "toolbar=no,scrollbars=yes,resizable=yes,width=400,height=600"); 1553 }); 1554 // $('.btn-share').attr('target', '_blank'); 1555 1556 // form location lookup 1557 $('form#whereVote').submit(function (e) { 1558 e.preventDefault(); 1559 // animate submit button 1560 var inputFirst = $('#whereFirstName').val(), 1561 inputMiddle = $('#whereMiddleName').val(), 1562 inputLast = $('#whereLastName').val(), 1563 inputDOB = $('#whereDOB').val(), 1564 // inputSSN = $('#whereSSN').val(), 1565 vicUrl = 'https://vrsws.sos.ky.gov/vic/Default.aspx?FIRST_NAME=' + inputFirst + '&MIDDLE_NAME=' + inputMiddle + '&LAST_NAME=' + inputLast + '&DATE_OF_BIRTH=' + inputDOB + '&SSN_
1565LAST4=&submit=Submit', 1566 // open new window 1567 newWindow = window.open(vicUrl, "_blank", "toolbar=no,scrollbars=yes,resizable=yes,width=500,height=400").scrollTo(500); 1568 // clear the form 1569 }); 1570 1571 /** 1572 * Card Carousel 1573 */ 1574 $('.card-carousel').on('slide.bs.carousel', function (e) { 1575 var $e = $(e.relatedTarget); 1576 var idx = $e.index(); 1577 var itemsPerSlide = 4; 1578 var totalItems = $('.carousel-item').length; 1579 if (idx >= totalItems - (itemsPerSlide - 1)) { 1580 var it = itemsPerSlide - (totalItems - idx); 1581 for (var i = 0; i < it; i++) { 1582 // append slides to end 1583 if (e.direction == "left") { 1584 $('.carousel-item').eq(i).appendTo('.carousel-inner'); 1585 } else { 1586 $('.carousel-item').eq(0).appendTo('.carousel-inner'); 1587 } 1588 } 1589 } 1590 }); 1591 $('.card-carousel').carousel({ 1592 interval: 2000 1593 }); 1594 1595 // latest tweet 1596 /* $.getJSON("https://api.twitter.com/1/statuses/user_timeline/chriscoyier.json?count=1&include_rts=1&callback=?", function(data) { 1597 console.log(data); 1598 $(".latest-tweet").html(data[0].text); 1599 }); */ 1600})(); 1601 1602/* 1603(new IntersectionObserver(function(e, o) { 1604 if (e[0].intersectionRatio > 0) { 1605 document.documentElement.removeAttribute('class'); 1606 } else { 1607 document.documentElement.setAttribute('class', 'stuck'); 1608 }; 1609})).observe(document.querySelector('.trigger')); 1610*/ 1611 1612/***/ }), 1613
1614/***/ "./assets/src/js/fittext.js": 1615/*!**********************************!*\ 1616 !*** ./assets/src/js/fittext.js ***! 1617 \**********************************/ 1618/***/ (() => { 1619 1620/*global jQuery */ 1621/*! 1622 * FitText.js 1.2 1623 * 1624 * Copyright 2011, Dave Rupert http://daverupert.com 1625 * Released under the WTFPL license 1626 * http://sam.zoy.org/wtfpl/ 1627 * 1628 * Date: Thu May 05 14:23:00 2011 -0600 1629 */ 1630 1631(function ($) { 1632 $.fn.fitText = function (kompressor, options) { 1633 // Setup options 1634 var compressor = kompressor || 1, 1635 settings = $.extend({ 1636 'minFontSize': Number.NEGATIVE_INFINITY, 1637 'maxFontSize': Number.POSITIVE_INFINITY 1638 }, options); 1639 return this.each(function () { 1640 // Store the object 1641 var $this = $(this); 1642 // Resizer() resizes items based on the object width divided by the compressor * 10 1643 var resizer = function resizer() { 1644 $this.css('font-size', Math.max(Math.min($this.width() / (compressor * 10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); 1645 }; 1646 // Call once to set. 1647 resizer(); 1648 // Call on resize. Opera debounces their resize by default. 1649 $(window).on('resize.fittext orientationchange.fittext', resizer); 1650 }); 1651 }; 1652 $('[data-text="fit"]').fitText($(this).data('size'), { 1653 'maxFontSize': '62px' 1654 }); 1655})(jQuery); 1656 1657/***/ }), 1658
1659/***/ "./assets/src/js/timeago.js": 1660/*!**********************************!*\ 1661 !*** ./assets/src/js/timeago.js ***! 1662 \**********************************/ 1663/***/ ((module, exports, __webpack_require__) => { 1664 1665var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 1666/** 1667 * Timeago is a jQuery plugin that makes it easy to support automatically 1668 * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). 1669 * 1670 * @name timeago 1671 * @version 1.6.7 1672 * @requires jQuery >=1.5.0 <4.0 1673 * @author Ryan McGeary 1674 * @license MIT License - http://www.opensource.org/licenses/mit-license.php 1675 * 1676 * For usage and examples, visit: 1677 * http://timeago.yarp.com/ 1678 * 1679 * Copyright (c) 2008-2019, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org) 1680 */ 1681 1682(function (factory) { 1683 if (true) { 1684 // AMD. Register as an anonymous module. 1685 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1686 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1687 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1688 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1689 } else {} 1690})(function ($) { 1691 $.timeago = function (timestamp) { 1692 if (timestamp instanceof Date) { 1693 return inWords(timestamp); 1694 } else if (typeof timestamp === "string") { 1695 return inWords($.timeago.parse(timestamp)); 1696 } else if (typeof timestamp === "number") { 1697 return inWords(new Date(timestamp)); 1698 } else { 1699 return inWords($.timeago.datetime(timestamp)); 1700 } 1701 }; 1702 var $t = $.timeago; 1703 $.extend($.timeago, { 1704 settings: { 1705 refreshMillis: 60000, 1706 allowPast: true, 1707 allowFuture: false, 1708 localeTitle: false, 1709 cutoff: 0, 1710 autoDispose: true, 1711 strings: { 1712 prefixAgo: null, 1713 prefixFromNow: null, 1714 suffixAgo: "ago", 1715 suffixFromNow: "from now", 1716 inPast: 'any moment now', 1717 seconds: "less than a minute", 1718 minute: "about a minute", 1719 minutes: "%d minutes", 1720 hour: "about an hour", 1721 hours: "about %d hours", 1722 day: "a day", 1723 days: "%d days", 1724 month: "about a month", 1725 months: "%d months", 1726 year: "about a year", 1727 years: "%d years", 1728 wordSeparator: " ", 1729 numbers: [] 1730 } 1731 }, 1732 inWords: function inWords(distanceMillis) { 1733 if (!this.settings.allowPast && !this.settings.allowFuture) { 1734 throw 'timeago allowPast and allowFuture settings can not both be set to false.'; 1735 } 1736 var $l = this.settings.strings; 1737 var prefix = $l.prefixAgo; 1738 var suffix = $l.suffixAgo; 1739 if (this.settings.allowFuture) { 1740 if (distanceMillis < 0) { 1741 prefix = $l.prefixFromNow; 1742 suffix = $l.suffixFromNow; 1743 } 1744 } 1745 if (!this.settings.allowPast && distanceMillis >= 0) { 1746 return this.settings.strings.inPast; 1747 } 1748 var seconds = Math.abs(distanceMillis) / 1000; 1749 var minutes = seconds / 60; 1750 var hours = minutes / 60; 1751 var days = hours / 24; 1752 var years = days / 365; 1753 function substitute(stringOrFunction, number) { 1754 var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; 1755 var value = $l.numbers && $l.numbers[number] || number; 1756 return string.replace(/%d/i, value); 1757 } 1758 var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || seconds < 90 && substitute($l.minute, 1) || minutes < 45 && substitute($l.minutes, Math.round(minutes)) || minutes < 90 && substitute($l.hour, 1) || hours < 24 && substitute($l.hours, Math.round(hours)) || hours < 42 && substitute($l.day, 1) || days < 30 && substitute($l.days, Math.round(days)) || days < 45 && substitute($l.month, 1) || days < 365 && substitute($l.months, Math.round(days / 30)) || years < 1.5 && substitute($l.year, 1) || substitute($l.years, Math.round(years)); 1759 var separator = $l.wordSeparator || ""; 1760 if ($l.wordSeparator === undefined) { 1761 separator = " "; 1762 } 1763 return $.trim([prefix, words, suffix].join(separator)); 1764 }, 1765 parse: function parse(iso8601) { 1766 var s = $.trim(iso8601); 1767 s = s.replace(/\.\d+/, ""); // remove milliseconds 1768 s = s.replace(/-/, "/").replace(/-/, "/"); 1769 s = s.replace(/T/, " ").replace(/Z/, " UTC"); 1770 s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400 1771 s = s.replace(/([\+\-]\d\d)$/, " $100"); // +09 -> +0900 1772 return new Date(s); 1773 }, 1774 datetime: function datetime(elem) { 1775 var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); 1776 return $t.parse(iso8601); 1777 }, 1778 isTime: function isTime(elem) { 1779 // jQuery's `is()` doesn't play well with HTML5 in IE 1780 return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); 1781 } 1782 }); 1783 1784 // functions that can be called via $(el).timeago('action') 1785 // init is default when no action is given 1786 // functions are called with context of a single element 1787 var functions = {
vendor: 2,790 bytes, lines 1788-1885
1788 init: function init() { 1789 functions.dispose.call(this); 1790 var refresh_el = $.proxy(refresh, this); 1791 refresh_el(); 1792 var $s = $t.settings; 1793 if ($s.refreshMillis > 0) { 1794 this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis); 1795 } 1796 }, 1797 update: function update(timestamp) { 1798 var date = timestamp instanceof Date ? timestamp : $t.parse(timestamp); 1799 $(this).data('timeago', { 1800 datetime: date 1801 }); 1802 if ($t.settings.localeTitle) { 1803 $(this).attr("title", date.toLocaleString()); 1804 } 1805 refresh.apply(this); 1806 }, 1807 updateFromDOM: function updateFromDOM() { 1808 $(this).data('timeago', { 1809 datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) 1810 }); 1811 refresh.apply(this); 1812 }, 1813 dispose: function dispose() { 1814 if (this._timeagoInterval) { 1815 window.clearInterval(this._timeagoInterval); 1816 this._timeagoInterval = null; 1817 } 1818 } 1819 }; 1820 $.fn.timeago = function (action, options) { 1821 var fn = action ? functions[action] : functions.init; 1822 if (!fn) { 1823 throw new Error("Unknown function name '" + action + "' for timeago"); 1824 } 1825 // each over objects here and call the requested function 1826 this.each(function () { 1827 fn.call(this, options); 1828 }); 1829 return this; 1830 }; 1831 function refresh() { 1832 var $s = $t.settings; 1833 1834 //check if it's still visible 1835 if ($s.autoDispose && !$.contains(document.documentElement, this)) { 1836 //stop if it has been removed 1837 $(this).timeago("dispose"); 1838 return this; 1839 } 1840 var data = prepareData(this); 1841 if (!isNaN(data.datetime)) { 1842 if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { 1843 $(this).text(inWords(data.datetime)); 1844 } else { 1845 if ($(this).attr('title').length > 0) { 1846 $(this).text($(this).attr('title')); 1847 } 1848 } 1849 } 1850 return this; 1851 } 1852 function prepareData(element) { 1853 element = $(element); 1854 if (!element.data("timeago")) { 1855 element.data("timeago", { 1856 datetime: $t.datetime(element) 1857 }); 1858 var text = $.trim(element.text()); 1859 if ($t.settings.localeTitle) { 1860 element.attr("title", element.data('timeago').datetime.toLocaleString()); 1861 } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) { 1862 element.attr("title", text); 1863 } 1864 } 1865 return element.data("timeago"); 1866 } 1867 function inWords(date) { 1868 return $t.inWords(distance(date)); 1869 } 1870 function distance(date) { 1871 return new Date().getTime() - date.getTime(); 1872 } 1873 1874 // fix for IE6 suckage 1875 document.createElement("abbr"); 1876 document.createElement("time"); 1877}); 1878$(function () { 1879 "use strict"; 1880 1881 $("time.timeago").timeago(); 1882}); 1883 1884/***/ }), 1885
vendor: 137,860 bytes, lines 1886-6250
1886/***/ "./node_modules/bootstrap/dist/js/bootstrap.js": 1887/*!*****************************************************!*\ 1888 !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***! 1889 \*****************************************************/ 1890/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 1891 1892/*! 1893 * Bootstrap v4.6.2 (https://getbootstrap.com/) 1894 * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 1895 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1896 */ 1897(function (global, factory) { 1898 true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : 1899 0; 1900})(this, (function (exports, $, Popper) { 'use strict'; 1901 1902 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 1903 1904 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 1905 var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper); 1906 1907 function _defineProperties(target, props) { 1908 for (var i = 0; i < props.length; i++) { 1909 var descriptor = props[i]; 1910 descriptor.enumerable = descriptor.enumerable || false; 1911 descriptor.configurable = true; 1912 if ("value" in descriptor) descriptor.writable = true; 1913 Object.defineProperty(target, descriptor.key, descriptor); 1914 } 1915 } 1916 1917 function _createClass(Constructor, protoProps, staticProps) { 1918 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 1919 if (staticProps) _defineProperties(Constructor, staticProps); 1920 Object.defineProperty(Constructor, "prototype", { 1921 writable: false 1922 }); 1923 return Constructor; 1924 } 1925 1926 function _extends() { 1927 _extends = Object.assign ? Object.assign.bind() : function (target) { 1928 for (var i = 1; i < arguments.length; i++) { 1929 var source = arguments[i]; 1930 1931 for (var key in source) { 1932 if (Object.prototype.hasOwnProperty.call(source, key)) { 1933 target[key] = source[key]; 1934 } 1935 } 1936 } 1937 1938 return target; 1939 }; 1940 return _extends.apply(this, arguments); 1941 } 1942 1943 function _inheritsLoose(subClass, superClass) { 1944 subClass.prototype = Object.create(superClass.prototype); 1945 subClass.prototype.constructor = subClass; 1946 1947 _setPrototypeOf(subClass, superClass); 1948 } 1949 1950 function _setPrototypeOf(o, p) { 1951 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { 1952 o.__proto__ = p; 1953 return o; 1954 }; 1955 return _setPrototypeOf(o, p); 1956 } 1957 1958 /** 1959 * -------------------------------------------------------------------------- 1960 * Bootstrap (v4.6.2): util.js 1961 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1962 * -------------------------------------------------------------------------- 1963 */ 1964 /** 1965 * Private TransitionEnd Helpers 1966 */ 1967 1968 var TRANSITION_END = 'transitionend'; 1969 var MAX_UID = 1000000; 1970 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 1971 1972 function toType(obj) { 1973 if (obj === null || typeof obj === 'undefined') { 1974 return "" + obj; 1975 } 1976 1977 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 1978 } 1979 1980 function getSpecialTransitionEndEvent() { 1981 return { 1982 bindType: TRANSITION_END, 1983 delegateType: TRANSITION_END, 1984 handle: function handle(event) { 1985 if ($__default["default"](event.target).is(this)) { 1986 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 1987 } 1988 1989 return undefined; 1990 } 1991 }; 1992 } 1993 1994 function transitionEndEmulator(duration) { 1995 var _this = this; 1996 1997 var called = false; 1998 $__default["default"](this).one(Util.TRANSITION_END, function () { 1999 called = true; 2000 }); 2001 setTimeout(function () { 2002 if (!called) { 2003 Util.triggerTransitionEnd(_this); 2004 } 2005 }, duration); 2006 return this; 2007 } 2008 2009 function setTransitionEndSupport() { 2010 $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; 2011 $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 2012 } 2013 /** 2014 * Public Util API 2015 */ 2016 2017 2018 var Util = { 2019 TRANSITION_END: 'bsTransitionEnd', 2020 getUID: function getUID(prefix) { 2021 do { 2022 // eslint-disable-next-line no-bitwise 2023 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 2024 } while (document.getElementById(prefix)); 2025 2026 return prefix; 2027 }, 2028 getSelectorFromElement: function getSelectorFromElement(element) { 2029 var selector = element.getAttribute('data-target'); 2030 2031 if (!selector || selector === '#') { 2032 var hrefAttr = element.getAttribute('href'); 2033 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 2034 } 2035 2036 try { 2037 return document.querySelector(selector) ? selector : null; 2038 } catch (_) { 2039 return null; 2040 } 2041 }, 2042 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 2043 if (!element) { 2044 return 0; 2045 } // Get transition-duration of the element 2046 2047 2048 var transitionDuration = $__default["default"](element).css('transition-duration'); 2049 var transitionDelay = $__default["default"](element).css('transition-delay'); 2050 var floatTransitionDuration = parseFloat(transitionDuration); 2051 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 2052 2053 if (!floatTransitionDuration && !floatTransitionDelay) { 2054 return 0; 2055 } // If multiple durations are defined, take the first 2056 2057 2058 transitionDuration = transitionDuration.split(',')[0]; 2059 transitionDelay = transitionDelay.split(',')[0]; 2060 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 2061 }, 2062 reflow: function reflow(element) { 2063 return element.offsetHeight; 2064 }, 2065 triggerTransitionEnd: function triggerTransitionEnd(element) { 2066 $__default["default"](element).trigger(TRANSITION_END); 2067 }, 2068 supportsTransitionEnd: function supportsTransitionEnd() { 2069 return Boolean(TRANSITION_END); 2070 }, 2071 isElement: function isElement(obj) { 2072 return (obj[0] || obj).nodeType; 2073 }, 2074 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 2075 for (var property in configTypes) { 2076 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 2077 var expectedTypes = configTypes[property]; 2078 var value = config[property]; 2079 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 2080 2081 if (!new RegExp(expectedTypes).test(valueType)) { 2082 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 2083 } 2084 } 2085 } 2086 }, 2087 findShadowRoot: function findShadowRoot(element) { 2088 if (!document.documentElement.attachShadow) { 2089 return null; 2090 } // Can find the shadow root otherwise it'll return the document 2091 2092 2093 if (typeof element.getRootNode === 'function') { 2094 var root = element.getRootNode(); 2095 return root instanceof ShadowRoot ? root : null; 2096 } 2097 2098 if (element instanceof ShadowRoot) { 2099 return element; 2100 } // when we don't find a shadow root 2101 2102 2103 if (!element.parentNode) { 2104 return null; 2105 } 2106 2107 return Util.findShadowRoot(element.parentNode); 2108 }, 2109 jQueryDetection: function jQueryDetection() { 2110 if (typeof $__default["default"] === 'undefined') { 2111 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 2112 } 2113 2114 var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); 2115 var minMajor = 1; 2116 var ltMajor = 2; 2117 var minMinor = 9; 2118 var minPatch = 1; 2119 var maxMajor = 4; 2120 2121 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 2122 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 2123 } 2124 } 2125 }; 2126 Util.jQueryDetection(); 2127 setTransitionEndSupport(); 2128 2129 /** 2130 * Constants 2131 */ 2132 2133 var NAME$a = 'alert'; 2134 var VERSION$a = '4.6.2'; 2135 var DATA_KEY$a = 'bs.alert'; 2136 var EVENT_KEY$a = "." + DATA_KEY$a; 2137 var DATA_API_KEY$7 = '.data-api'; 2138 var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; 2139 var CLASS_NAME_ALERT = 'alert'; 2140 var CLASS_NAME_FADE$5 = 'fade'; 2141 var CLASS_NAME_SHOW$7 = 'show'; 2142 var EVENT_CLOSE = "close" + EVENT_KEY$a; 2143 var EVENT_CLOSED = "closed" + EVENT_KEY$a; 2144 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; 2145 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 2146 /** 2147 * Class definition 2148 */ 2149 2150 var Alert = /*#__PURE__*/function () { 2151 function Alert(element) { 2152 this._element = element; 2153 } // Getters 2154 2155 2156 var _proto = Alert.prototype; 2157 2158 // Public 2159 _proto.close = function close(element) { 2160 var rootElement = this._element; 2161 2162 if (element) { 2163 rootElement = this._getRootElement(element); 2164 } 2165 2166 var customEvent = this._triggerCloseEvent(rootElement); 2167 2168 if (customEvent.isDefaultPrevented()) { 2169 return; 2170 } 2171 2172 this._removeElement(rootElement); 2173 }; 2174 2175 _proto.dispose = function dispose() { 2176 $__default["default"].removeData(this._element, DATA_KEY$a); 2177 this._element = null; 2178 } // Private 2179 ; 2180 2181 _proto._getRootElement = function _getRootElement(element) { 2182 var selector = Util.getSelectorFromElement(element); 2183 var parent = false; 2184 2185 if (selector) { 2186 parent = document.querySelector(selector); 2187 } 2188 2189 if (!parent) { 2190 parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; 2191 } 2192 2193 return parent; 2194 }; 2195 2196 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 2197 var closeEvent = $__default["default"].Event(EVENT_CLOSE); 2198 $__default["default"](element).trigger(closeEvent); 2199 return closeEvent; 2200 }; 2201 2202 _proto._removeElement = function _removeElement(element) { 2203 var _this = this; 2204 2205 $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); 2206 2207 if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { 2208 this._destroyElement(element); 2209 2210 return; 2211 } 2212 2213 var transitionDuration = Util.getTransitionDurationFromElement(element); 2214 $__default["default"](element).one(Util.TRANSITION_END, function (event) { 2215 return _this._destroyElement(element, event); 2216 }).emulateTransitionEnd(transitionDuration); 2217 }; 2218 2219 _proto._destroyElement = function _destroyElement(element) { 2220 $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); 2221 } // Static 2222 ; 2223 2224 Alert._jQueryInterface = function _jQueryInterface(config) { 2225 return this.each(function () { 2226 var $element = $__default["default"](this); 2227 var data = $element.data(DATA_KEY$a); 2228 2229 if (!data) { 2230 data = new Alert(this); 2231 $element.data(DATA_KEY$a, data); 2232 } 2233 2234 if (config === 'close') { 2235 data[config](this); 2236 } 2237 }); 2238 }; 2239 2240 Alert._handleDismiss = function _handleDismiss(alertInstance) { 2241 return function (event) { 2242 if (event) { 2243 event.preventDefault(); 2244 } 2245 2246 alertInstance.close(this); 2247 }; 2248 }; 2249 2250 _createClass(Alert, null, [{ 2251 key: "VERSION", 2252 get: function get() { 2253 return VERSION$a; 2254 } 2255 }]); 2256 2257 return Alert; 2258 }(); 2259 /** 2260 * Data API implementation 2261 */ 2262 2263 2264 $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 2265 /** 2266 * jQuery 2267 */ 2268 2269 $__default["default"].fn[NAME$a] = Alert._jQueryInterface; 2270 $__default["default"].fn[NAME$a].Constructor = Alert; 2271 2272 $__default["default"].fn[NAME$a].noConflict = function () { 2273 $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 2274 return Alert._jQueryInterface; 2275 }; 2276 2277 /** 2278 * Constants 2279 */ 2280 2281 var NAME$9 = 'button'; 2282 var VERSION$9 = '4.6.2'; 2283 var DATA_KEY$9 = 'bs.button'; 2284 var EVENT_KEY$9 = "." + DATA_KEY$9; 2285 var DATA_API_KEY$6 = '.data-api'; 2286 var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; 2287 var CLASS_NAME_ACTIVE$3 = 'active'; 2288 var CLASS_NAME_BUTTON = 'btn'; 2289 var CLASS_NAME_FOCUS = 'focus'; 2290 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; 2291 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); 2292 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; 2293 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 2294 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 2295 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; 2296 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 2297 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 2298 var SELECTOR_ACTIVE$2 = '.active'; 2299 var SELECTOR_BUTTON = '.btn'; 2300 /** 2301 * Class definition 2302 */ 2303 2304 var Button = /*#__PURE__*/function () { 2305 function Button(element) { 2306 this._element = element; 2307 this.shouldAvoidTriggerChange = false; 2308 } // Getters 2309 2310 2311 var _proto = Button.prototype; 2312 2313 // Public 2314 _proto.toggle = function toggle() { 2315 var triggerChangeEvent = true; 2316 var addAriaPressed = true; 2317 var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 2318 2319 if (rootElement) { 2320 var input = this._element.querySelector(SELECTOR_INPUT); 2321 2322 if (input) { 2323 if (input.type === 'radio') { 2324 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { 2325 triggerChangeEvent = false; 2326 } else { 2327 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); 2328 2329 if (activeElement) { 2330 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); 2331 } 2332 } 2333 } 2334 2335 if (triggerChangeEvent) { 2336 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 2337 if (input.type === 'checkbox' || input.type === 'radio') { 2338 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); 2339 } 2340 2341 if (!this.shouldAvoidTriggerChange) { 2342 $__default["default"](input).trigger('change'); 2343 } 2344 } 2345 2346 input.focus(); 2347 addAriaPressed = false; 2348 } 2349 } 2350 2351 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 2352 if (addAriaPressed) { 2353 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); 2354 } 2355 2356 if (triggerChangeEvent) { 2357 $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); 2358 } 2359 } 2360 }; 2361 2362 _proto.dispose = function dispose() { 2363 $__default["default"].removeData(this._element, DATA_KEY$9); 2364 this._element = null; 2365 } // Static 2366 ; 2367 2368 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 2369 return this.each(function () { 2370 var $element = $__default["default"](this); 2371 var data = $element.data(DATA_KEY$9); 2372 2373 if (!data) { 2374 data = new Button(this); 2375 $element.data(DATA_KEY$9, data); 2376 } 2377 2378 data.shouldAvoidTriggerChange = avoidTriggerChange; 2379 2380 if (config === 'toggle') { 2381 data[config](); 2382 } 2383 }); 2384 }; 2385 2386 _createClass(Button, null, [{ 2387 key: "VERSION", 2388 get: function get() { 2389 return VERSION$9; 2390 } 2391 }]); 2392 2393 return Button; 2394 }(); 2395 /** 2396 * Data API implementation 2397 */ 2398 2399 2400 $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 2401 var button = event.target; 2402 var initialButton = button; 2403 2404 if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { 2405 button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; 2406 } 2407 2408 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 2409 event.preventDefault(); // work around Firefox bug #1540995 2410 } else { 2411 var inputBtn = button.querySelector(SELECTOR_INPUT); 2412 2413 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 2414 event.preventDefault(); // work around Firefox bug #1540995 2415 2416 return; 2417 } 2418 2419 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 2420 Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); 2421 } 2422 } 2423 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 2424 var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; 2425 $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 2426 }); 2427 $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { 2428 // ensure correct active class is set to match the controls' actual values/states 2429 // find all checkboxes/readio buttons inside data-toggle groups 2430 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 2431 2432 for (var i = 0, len = buttons.length; i < len; i++) { 2433 var button = buttons[i]; 2434 var input = button.querySelector(SELECTOR_INPUT); 2435 2436 if (input.checked || input.hasAttribute('checked')) { 2437 button.classList.add(CLASS_NAME_ACTIVE$3); 2438 } else { 2439 button.classList.remove(CLASS_NAME_ACTIVE$3); 2440 } 2441 } // find all button toggles 2442 2443 2444 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); 2445 2446 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 2447 var _button = buttons[_i]; 2448 2449 if (_button.getAttribute('aria-pressed') === 'true') { 2450 _button.classList.add(CLASS_NAME_ACTIVE$3); 2451 } else { 2452 _button.classList.remove(CLASS_NAME_ACTIVE$3); 2453 } 2454 } 2455 }); 2456 /** 2457 * jQuery 2458 */ 2459 2460 $__default["default"].fn[NAME$9] = Button._jQueryInterface; 2461 $__default["default"].fn[NAME$9].Constructor = Button; 2462 2463 $__default["default"].fn[NAME$9].noConflict = function () { 2464 $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 2465 return Button._jQueryInterface; 2466 }; 2467 2468 /** 2469 * Constants 2470 */ 2471 2472 var NAME$8 = 'carousel'; 2473 var VERSION$8 = '4.6.2'; 2474 var DATA_KEY$8 = 'bs.carousel'; 2475 var EVENT_KEY$8 = "." + DATA_KEY$8; 2476 var DATA_API_KEY$5 = '.data-api'; 2477 var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; 2478 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 2479 2480 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 2481 2482 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 2483 2484 var SWIPE_THRESHOLD = 40; 2485 var CLASS_NAME_CAROUSEL = 'carousel'; 2486 var CLASS_NAME_ACTIVE$2 = 'active'; 2487 var CLASS_NAME_SLIDE = 'slide'; 2488 var CLASS_NAME_RIGHT = 'carousel-item-right'; 2489 var CLASS_NAME_LEFT = 'carousel-item-left'; 2490 var CLASS_NAME_NEXT = 'carousel-item-next'; 2491 var CLASS_NAME_PREV = 'carousel-item-prev'; 2492 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 2493 var DIRECTION_NEXT = 'next'; 2494 var DIRECTION_PREV = 'prev'; 2495 var DIRECTION_LEFT = 'left'; 2496 var DIRECTION_RIGHT = 'right'; 2497 var EVENT_SLIDE = "slide" + EVENT_KEY$8; 2498 var EVENT_SLID = "slid" + EVENT_KEY$8; 2499 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; 2500 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; 2501 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; 2502 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; 2503 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; 2504 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; 2505 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; 2506 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; 2507 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; 2508 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; 2509 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; 2510 var SELECTOR_ACTIVE$1 = '.active'; 2511 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 2512 var SELECTOR_ITEM = '.carousel-item'; 2513 var SELECTOR_ITEM_IMG = '.carousel-item img'; 2514 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 2515 var SELECTOR_INDICATORS = '.carousel-indicators'; 2516 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 2517 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 2518 var Default$7 = { 2519 interval: 5000, 2520 keyboard: true, 2521 slide: false, 2522 pause: 'hover', 2523 wrap: true, 2524 touch: true 2525 }; 2526 var DefaultType$7 = { 2527 interval: '(number|boolean)', 2528 keyboard: 'boolean', 2529 slide: '(boolean|string)', 2530 pause: '(string|boolean)', 2531 wrap: 'boolean', 2532 touch: 'boolean' 2533 }; 2534 var PointerType = { 2535 TOUCH: 'touch', 2536 PEN: 'pen' 2537 }; 2538 /** 2539 * Class definition 2540 */ 2541 2542 var Carousel = /*#__PURE__*/function () { 2543 function Carousel(element, config) { 2544 this._items = null; 2545 this._interval = null; 2546 this._activeElement = null; 2547 this._isPaused = false; 2548 this._isSliding = false; 2549 this.touchTimeout = null; 2550 this.touchStartX = 0; 2551 this.touchDeltaX = 0; 2552 this._config = this._getConfig(config); 2553 this._element = element; 2554 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 2555 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 2556 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 2557 2558 this._addEventListeners(); 2559 } // Getters 2560 2561 2562 var _proto = Carousel.prototype; 2563 2564 // Public 2565 _proto.next = function next() { 2566 if (!this._isSliding) { 2567 this._slide(DIRECTION_NEXT); 2568 } 2569 }; 2570 2571 _proto.nextWhenVisible = function nextWhenVisible() { 2572 var $element = $__default["default"](this._element); // Don't call next when the page isn't visible 2573 // or the carousel or its parent isn't visible 2574 2575 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 2576 this.next(); 2577 } 2578 }; 2579 2580 _proto.prev = function prev() { 2581 if (!this._isSliding) { 2582 this._slide(DIRECTION_PREV); 2583 } 2584 }; 2585 2586 _proto.pause = function pause(event) { 2587 if (!event) { 2588 this._isPaused = true; 2589 } 2590 2591 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 2592 Util.triggerTransitionEnd(this._element); 2593 this.cycle(true); 2594 } 2595 2596 clearInterval(this._interval); 2597 this._interval = null; 2598 }; 2599 2600 _proto.cycle = function cycle(event) { 2601 if (!event) { 2602 this._isPaused = false; 2603 } 2604 2605 if (this._interval) { 2606 clearInterval(this._interval); 2607 this._interval = null; 2608 } 2609 2610 if (this._config.interval && !this._isPaused) { 2611 this._updateInterval(); 2612 2613 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 2614 } 2615 }; 2616 2617 _proto.to = function to(index) { 2618 var _this = this; 2619 2620 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 2621 2622 var activeIndex = this._getItemIndex(this._activeElement); 2623 2624 if (index > this._items.length - 1 || index < 0) { 2625 return; 2626 } 2627 2628 if (this._isSliding) { 2629 $__default["default"](this._element).one(EVENT_SLID, function () { 2630 return _this.to(index); 2631 }); 2632 return; 2633 } 2634 2635 if (activeIndex === index) { 2636 this.pause(); 2637 this.cycle(); 2638 return; 2639 } 2640 2641 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 2642 2643 this._slide(direction, this._items[index]); 2644 }; 2645 2646 _proto.dispose = function dispose() { 2647 $__default["default"](this._element).off(EVENT_KEY$8); 2648 $__default["default"].removeData(this._element, DATA_KEY$8); 2649 this._items = null; 2650 this._config = null; 2651 this._element = null; 2652 this._interval = null; 2653 this._isPaused = null; 2654 this._isSliding = null; 2655 this._activeElement = null; 2656 this._indicatorsElement = null; 2657 } // Private 2658 ; 2659 2660 _proto._getConfig = function _getConfig(config) { 2661 config = _extends({}, Default$7, config); 2662 Util.typeCheckConfig(NAME$8, config, DefaultType$7); 2663 return config; 2664 }; 2665 2666 _proto._handleSwipe = function _handleSwipe() { 2667 var absDeltax = Math.abs(this.touchDeltaX); 2668 2669 if (absDeltax <= SWIPE_THRESHOLD) { 2670 return; 2671 } 2672 2673 var direction = absDeltax / this.touchDeltaX; 2674 this.touchDeltaX = 0; // swipe left 2675 2676 if (direction > 0) { 2677 this.prev(); 2678 } // swipe right 2679 2680 2681 if (direction < 0) { 2682 this.next(); 2683 } 2684 }; 2685 2686 _proto._addEventListeners = function _addEventListeners() { 2687 var _this2 = this; 2688 2689 if (this._config.keyboard) { 2690 $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { 2691 return _this2._keydown(event); 2692 }); 2693 } 2694 2695 if (this._config.pause === 'hover') { 2696 $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { 2697 return _this2.pause(event); 2698 }).on(EVENT_MOUSELEAVE, function (event) { 2699 return _this2.cycle(event); 2700 }); 2701 } 2702 2703 if (this._config.touch) { 2704 this._addTouchEventListeners(); 2705 } 2706 }; 2707 2708 _proto._addTouchEventListeners = function _addTouchEventListeners() { 2709 var _this3 = this; 2710 2711 if (!this._touchSupported) { 2712 return; 2713 } 2714 2715 var start = function start(event) { 2716 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 2717 _this3.touchStartX = event.originalEvent.clientX; 2718 } else if (!_this3._pointerEvent) { 2719 _this3.touchStartX = event.originalEvent.touches[0].clientX; 2720 } 2721 }; 2722 2723 var move = function move(event) { 2724 // ensure swiping with one touch and not pinching 2725 _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; 2726 }; 2727 2728 var end = function end(event) { 2729 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 2730 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 2731 } 2732 2733 _this3._handleSwipe(); 2734 2735 if (_this3._config.pause === 'hover') { 2736 // If it's a touch-enabled device, mouseenter/leave are fired as 2737 // part of the mouse compatibility events on first tap - the carousel 2738 // would stop cycling until user tapped out of it; 2739 // here, we listen for touchend, explicitly pause the carousel 2740 // (as if it's the second time we tap on it, mouseenter compat event 2741 // is NOT fired) and after a timeout (to allow for mouse compatibility 2742 // events to fire) we explicitly restart cycling 2743 _this3.pause(); 2744 2745 if (_this3.touchTimeout) { 2746 clearTimeout(_this3.touchTimeout); 2747 } 2748 2749 _this3.touchTimeout = setTimeout(function (event) { 2750 return _this3.cycle(event); 2751 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 2752 } 2753 }; 2754 2755 $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 2756 return e.preventDefault(); 2757 }); 2758 2759 if (this._pointerEvent) { 2760 $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { 2761 return start(event); 2762 }); 2763 $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { 2764 return end(event); 2765 }); 2766 2767 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 2768 } else { 2769 $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { 2770 return start(event); 2771 }); 2772 $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { 2773 return move(event); 2774 }); 2775 $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { 2776 return end(event); 2777 }); 2778 } 2779 }; 2780 2781 _proto._keydown = function _keydown(event) { 2782 if (/input|textarea/i.test(event.target.tagName)) { 2783 return; 2784 } 2785 2786 switch (event.which) { 2787 case ARROW_LEFT_KEYCODE: 2788 event.preventDefault(); 2789 this.prev(); 2790 break; 2791 2792 case ARROW_RIGHT_KEYCODE: 2793 event.preventDefault(); 2794 this.next(); 2795 break; 2796 } 2797 }; 2798 2799 _proto._getItemIndex = function _getItemIndex(element) { 2800 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 2801 return this._items.indexOf(element); 2802 }; 2803 2804 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 2805 var isNextDirection = direction === DIRECTION_NEXT; 2806 var isPrevDirection = direction === DIRECTION_PREV; 2807 2808 var activeIndex = this._getItemIndex(activeElement); 2809 2810 var lastItemIndex = this._items.length - 1; 2811 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 2812 2813 if (isGoingToWrap && !this._config.wrap) { 2814 return activeElement; 2815 } 2816 2817 var delta = direction === DIRECTION_PREV ? -1 : 1; 2818 var itemIndex = (activeIndex + delta) % this._items.length; 2819 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 2820 }; 2821 2822 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 2823 var targetIndex = this._getItemIndex(relatedTarget); 2824 2825 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 2826 2827 var slideEvent = $__default["default"].Event(EVENT_SLIDE, { 2828 relatedTarget: relatedTarget, 2829 direction: eventDirectionName, 2830 from: fromIndex, 2831 to: targetIndex 2832 }); 2833 $__default["default"](this._element).trigger(slideEvent); 2834 return slideEvent; 2835 }; 2836 2837 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 2838 if (this._indicatorsElement) { 2839 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 2840 $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); 2841 2842 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 2843 2844 if (nextIndicator) { 2845 $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); 2846 } 2847 } 2848 }; 2849 2850 _proto._updateInterval = function _updateInterval() { 2851 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 2852 2853 if (!element) { 2854 return; 2855 } 2856 2857 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 2858 2859 if (elementInterval) { 2860 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 2861 this._config.interval = elementInterval; 2862 } else { 2863 this._config.interval = this._config.defaultInterval || this._config.interval; 2864 } 2865 }; 2866 2867 _proto._slide = function _slide(direction, element) { 2868 var _this4 = this; 2869 2870 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 2871 2872 var activeElementIndex = this._getItemIndex(activeElement); 2873 2874 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 2875 2876 var nextElementIndex = this._getItemIndex(nextElement); 2877 2878 var isCycling = Boolean(this._interval); 2879 var directionalClassName; 2880 var orderClassName; 2881 var eventDirectionName; 2882 2883 if (direction === DIRECTION_NEXT) { 2884 directionalClassName = CLASS_NAME_LEFT; 2885 orderClassName = CLASS_NAME_NEXT; 2886 eventDirectionName = DIRECTION_LEFT; 2887 } else { 2888 directionalClassName = CLASS_NAME_RIGHT; 2889 orderClassName = CLASS_NAME_PREV; 2890 eventDirectionName = DIRECTION_RIGHT; 2891 } 2892 2893 if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { 2894 this._isSliding = false; 2895 return; 2896 } 2897 2898 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 2899 2900 if (slideEvent.isDefaultPrevented()) { 2901 return; 2902 } 2903 2904 if (!activeElement || !nextElement) { 2905 // Some weirdness is happening, so we bail 2906 return; 2907 } 2908 2909 this._isSliding = true; 2910 2911 if (isCycling) { 2912 this.pause(); 2913 } 2914 2915 this._setActiveIndicatorElement(nextElement); 2916 2917 this._activeElement = nextElement; 2918 var slidEvent = $__default["default"].Event(EVENT_SLID, { 2919 relatedTarget: nextElement, 2920 direction: eventDirectionName, 2921 from: activeElementIndex, 2922 to: nextElementIndex 2923 }); 2924 2925 if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { 2926 $__default["default"](nextElement).addClass(orderClassName); 2927 Util.reflow(nextElement); 2928 $__default["default"](activeElement).addClass(directionalClassName); 2929 $__default["default"](nextElement).addClass(directionalClassName); 2930 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 2931 $__default["default"](activeElement).one(Util.TRANSITION_END, function () { 2932 $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); 2933 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); 2934 _this4._isSliding = false; 2935 setTimeout(function () { 2936 return $__default["default"](_this4._element).trigger(slidEvent); 2937 }, 0); 2938 }).emulateTransitionEnd(transitionDuration); 2939 } else { 2940 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); 2941 $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); 2942 this._isSliding = false; 2943 $__default["default"](this._element).trigger(slidEvent); 2944 } 2945 2946 if (isCycling) { 2947 this.cycle(); 2948 } 2949 } // Static 2950 ; 2951 2952 Carousel._jQueryInterface = function _jQueryInterface(config) { 2953 return this.each(function () { 2954 var data = $__default["default"](this).data(DATA_KEY$8); 2955 2956 var _config = _extends({}, Default$7, $__default["default"](this).data()); 2957 2958 if (typeof config === 'object') { 2959 _config = _extends({}, _config, config); 2960 } 2961 2962 var action = typeof config === 'string' ? config : _config.slide; 2963 2964 if (!data) { 2965 data = new Carousel(this, _config); 2966 $__default["default"](this).data(DATA_KEY$8, data); 2967 } 2968 2969 if (typeof config === 'number') { 2970 data.to(config); 2971 } else if (typeof action === 'string') { 2972 if (typeof data[action] === 'undefined') { 2973 throw new TypeError("No method named \"" + action + "\""); 2974 } 2975 2976 data[action](); 2977 } else if (_config.interval && _config.ride) { 2978 data.pause(); 2979 data.cycle(); 2980 } 2981 }); 2982 }; 2983 2984 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 2985 var selector = Util.getSelectorFromElement(this); 2986 2987 if (!selector) { 2988 return; 2989 } 2990 2991 var target = $__default["default"](selector)[0]; 2992 2993 if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { 2994 return; 2995 } 2996 2997 var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 2998 2999 var slideIndex = this.getAttribute('data-slide-to'); 3000 3001 if (slideIndex) { 3002 config.interval = false; 3003 } 3004 3005 Carousel._jQueryInterface.call($__default["default"](target), config); 3006 3007 if (slideIndex) { 3008 $__default["default"](target).data(DATA_KEY$8).to(slideIndex); 3009 } 3010 3011 event.preventDefault(); 3012 }; 3013 3014 _createClass(Carousel, null, [{ 3015 key: "VERSION", 3016 get: function get() { 3017 return VERSION$8; 3018 } 3019 }, { 3020 key: "Default", 3021 get: function get() { 3022 return Default$7; 3023 } 3024 }]); 3025 3026 return Carousel; 3027 }(); 3028 /** 3029 * Data API implementation 3030 */ 3031 3032 3033 $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 3034 $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { 3035 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 3036 3037 for (var i = 0, len = carousels.length; i < len; i++) { 3038 var $carousel = $__default["default"](carousels[i]); 3039 3040 Carousel._jQueryInterface.call($carousel, $carousel.data()); 3041 } 3042 }); 3043 /** 3044 * jQuery 3045 */ 3046 3047 $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; 3048 $__default["default"].fn[NAME$8].Constructor = Carousel; 3049 3050 $__default["default"].fn[NAME$8].noConflict = function () { 3051 $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 3052 return Carousel._jQueryInterface; 3053 }; 3054 3055 /** 3056 * Constants 3057 */ 3058 3059 var NAME$7 = 'collapse'; 3060 var VERSION$7 = '4.6.2'; 3061 var DATA_KEY$7 = 'bs.collapse'; 3062 var EVENT_KEY$7 = "." + DATA_KEY$7; 3063 var DATA_API_KEY$4 = '.data-api'; 3064 var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; 3065 var CLASS_NAME_SHOW$6 = 'show'; 3066 var CLASS_NAME_COLLAPSE = 'collapse'; 3067 var CLASS_NAME_COLLAPSING = 'collapsing'; 3068 var CLASS_NAME_COLLAPSED = 'collapsed'; 3069 var DIMENSION_WIDTH = 'width'; 3070 var DIMENSION_HEIGHT = 'height'; 3071 var EVENT_SHOW$4 = "show" + EVENT_KEY$7; 3072 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; 3073 var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; 3074 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; 3075 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; 3076 var SELECTOR_ACTIVES = '.show, .collapsing'; 3077 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; 3078 var Default$6 = { 3079 toggle: true, 3080 parent: '' 3081 }; 3082 var DefaultType$6 = { 3083 toggle: 'boolean', 3084 parent: '(string|element)' 3085 }; 3086 /** 3087 * Class definition 3088 */ 3089 3090 var Collapse = /*#__PURE__*/function () { 3091 function Collapse(element, config) { 3092 this._isTransitioning = false; 3093 this._element = element; 3094 this._config = this._getConfig(config); 3095 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 3096 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); 3097 3098 for (var i = 0, len = toggleList.length; i < len; i++) { 3099 var elem = toggleList[i]; 3100 var selector = Util.getSelectorFromElement(elem); 3101 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 3102 return foundElem === element; 3103 }); 3104 3105 if (selector !== null && filterElement.length > 0) { 3106 this._selector = selector; 3107 3108 this._triggerArray.push(elem); 3109 } 3110 } 3111 3112 this._parent = this._config.parent ? this._getParent() : null; 3113 3114 if (!this._config.parent) { 3115 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 3116 } 3117 3118 if (this._config.toggle) { 3119 this.toggle(); 3120 } 3121 } // Getters 3122 3123 3124 var _proto = Collapse.prototype; 3125 3126 // Public 3127 _proto.toggle = function toggle() { 3128 if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 3129 this.hide(); 3130 } else { 3131 this.show(); 3132 } 3133 }; 3134 3135 _proto.show = function show() { 3136 var _this = this; 3137 3138 if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 3139 return; 3140 } 3141 3142 var actives; 3143 var activesData; 3144 3145 if (this._parent) { 3146 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 3147 if (typeof _this._config.parent === 'string') { 3148 return elem.getAttribute('data-parent') === _this._config.parent; 3149 } 3150 3151 return elem.classList.contains(CLASS_NAME_COLLAPSE); 3152 }); 3153 3154 if (actives.length === 0) { 3155 actives = null; 3156 } 3157 } 3158 3159 if (actives) { 3160 activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); 3161 3162 if (activesData && activesData._isTransitioning) { 3163 return; 3164 } 3165 } 3166 3167 var startEvent = $__default["default"].Event(EVENT_SHOW$4); 3168 $__default["default"](this._element).trigger(startEvent); 3169 3170 if (startEvent.isDefaultPrevented()) { 3171 return; 3172 } 3173 3174 if (actives) { 3175 Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); 3176 3177 if (!activesData) { 3178 $__default["default"](actives).data(DATA_KEY$7, null); 3179 } 3180 } 3181 3182 var dimension = this._getDimension(); 3183 3184 $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 3185 this._element.style[dimension] = 0; 3186 3187 if (this._triggerArray.length) { 3188 $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 3189 } 3190 3191 this.setTransitioning(true); 3192 3193 var complete = function complete() { 3194 $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 3195 _this._element.style[dimension] = ''; 3196 3197 _this.setTransitioning(false); 3198 3199 $__default["default"](_this._element).trigger(EVENT_SHOWN$4); 3200 }; 3201 3202 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 3203 var scrollSize = "scroll" + capitalizedDimension; 3204 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 3205 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3206 this._element.style[dimension] = this._element[scrollSize] + "px"; 3207 }; 3208 3209 _proto.hide = function hide() { 3210 var _this2 = this; 3211 3212 if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 3213 return; 3214 } 3215 3216 var startEvent = $__default["default"].Event(EVENT_HIDE$4); 3217 $__default["default"](this._element).trigger(startEvent); 3218 3219 if (startEvent.isDefaultPrevented()) { 3220 return; 3221 } 3222 3223 var dimension = this._getDimension(); 3224 3225 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 3226 Util.reflow(this._element); 3227 $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 3228 var triggerArrayLength = this._triggerArray.length; 3229 3230 if (triggerArrayLength > 0) { 3231 for (var i = 0; i < triggerArrayLength; i++) { 3232 var trigger = this._triggerArray[i]; 3233 var selector = Util.getSelectorFromElement(trigger); 3234 3235 if (selector !== null) { 3236 var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); 3237 3238 if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { 3239 $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 3240 } 3241 } 3242 } 3243 } 3244 3245 this.setTransitioning(true); 3246 3247 var complete = function complete() { 3248 _this2.setTransitioning(false); 3249 3250 $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); 3251 }; 3252 3253 this._element.style[dimension] = ''; 3254 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 3255 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3256 }; 3257 3258 _proto.setTransitioning = function setTransitioning(isTransitioning) { 3259 this._isTransitioning = isTransitioning; 3260 }; 3261 3262 _proto.dispose = function dispose() { 3263 $__default["default"].removeData(this._element, DATA_KEY$7); 3264 this._config = null; 3265 this._parent = null; 3266 this._element = null; 3267 this._triggerArray = null; 3268 this._isTransitioning = null; 3269 } // Private 3270 ; 3271 3272 _proto._getConfig = function _getConfig(config) { 3273 config = _extends({}, Default$6, config); 3274 config.toggle = Boolean(config.toggle); // Coerce string values 3275 3276 Util.typeCheckConfig(NAME$7, config, DefaultType$6); 3277 return config; 3278 }; 3279 3280 _proto._getDimension = function _getDimension() { 3281 var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); 3282 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 3283 }; 3284 3285 _proto._getParent = function _getParent() { 3286 var _this3 = this; 3287 3288 var parent; 3289 3290 if (Util.isElement(this._config.parent)) { 3291 parent = this._config.parent; // It's a jQuery object 3292 3293 if (typeof this._config.parent.jquery !== 'undefined') { 3294 parent = this._config.parent[0]; 3295 } 3296 } else { 3297 parent = document.querySelector(this._config.parent); 3298 } 3299 3300 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 3301 var children = [].slice.call(parent.querySelectorAll(selector)); 3302 $__default["default"](children).each(function (i, element) { 3303 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 3304 }); 3305 return parent; 3306 }; 3307 3308 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 3309 var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); 3310 3311 if (triggerArray.length) { 3312 $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 3313 } 3314 } // Static 3315 ; 3316 3317 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 3318 var selector = Util.getSelectorFromElement(element); 3319 return selector ? document.querySelector(selector) : null; 3320 }; 3321 3322 Collapse._jQueryInterface = function _jQueryInterface(config) { 3323 return this.each(function () { 3324 var $element = $__default["default"](this); 3325 var data = $element.data(DATA_KEY$7); 3326 3327 var _config = _extends({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); 3328 3329 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 3330 _config.toggle = false; 3331 } 3332 3333 if (!data) { 3334 data = new Collapse(this, _config); 3335 $element.data(DATA_KEY$7, data); 3336 } 3337 3338 if (typeof config === 'string') { 3339 if (typeof data[config] === 'undefined') { 3340 throw new TypeError("No method named \"" + config + "\""); 3341 } 3342 3343 data[config](); 3344 } 3345 }); 3346 }; 3347 3348 _createClass(Collapse, null, [{ 3349 key: "VERSION", 3350 get: function get() { 3351 return VERSION$7; 3352 } 3353 }, { 3354 key: "Default", 3355 get: function get() { 3356 return Default$6; 3357 } 3358 }]); 3359 3360 return Collapse; 3361 }(); 3362 /** 3363 * Data API implementation 3364 */ 3365 3366 3367 $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 3368 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 3369 if (event.currentTarget.tagName === 'A') { 3370 event.preventDefault(); 3371 } 3372 3373 var $trigger = $__default["default"](this); 3374 var selector = Util.getSelectorFromElement(this); 3375 var selectors = [].slice.call(document.querySelectorAll(selector)); 3376 $__default["default"](selectors).each(function () { 3377 var $target = $__default["default"](this); 3378 var data = $target.data(DATA_KEY$7); 3379 var config = data ? 'toggle' : $trigger.data(); 3380 3381 Collapse._jQueryInterface.call($target, config); 3382 }); 3383 }); 3384 /** 3385 * jQuery 3386 */ 3387 3388 $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; 3389 $__default["default"].fn[NAME$7].Constructor = Collapse; 3390 3391 $__default["default"].fn[NAME$7].noConflict = function () { 3392 $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 3393 return Collapse._jQueryInterface; 3394 }; 3395 3396 /** 3397 * Constants 3398 */ 3399 3400 var NAME$6 = 'dropdown'; 3401 var VERSION$6 = '4.6.2'; 3402 var DATA_KEY$6 = 'bs.dropdown'; 3403 var EVENT_KEY$6 = "." + DATA_KEY$6; 3404 var DATA_API_KEY$3 = '.data-api'; 3405 var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; 3406 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 3407 3408 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 3409 3410 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 3411 3412 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 3413 3414 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 3415 3416 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 3417 3418 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); 3419 var CLASS_NAME_DISABLED$1 = 'disabled'; 3420 var CLASS_NAME_SHOW$5 = 'show'; 3421 var CLASS_NAME_DROPUP = 'dropup'; 3422 var CLASS_NAME_DROPRIGHT = 'dropright'; 3423 var CLASS_NAME_DROPLEFT = 'dropleft'; 3424 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 3425 var CLASS_NAME_POSITION_STATIC = 'position-static'; 3426 var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; 3427 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; 3428 var EVENT_SHOW$3 = "show" + EVENT_KEY$6; 3429 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; 3430 var EVENT_CLICK = "click" + EVENT_KEY$6; 3431 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; 3432 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; 3433 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; 3434 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 3435 var SELECTOR_FORM_CHILD = '.dropdown form'; 3436 var SELECTOR_MENU = '.dropdown-menu'; 3437 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 3438 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 3439 var PLACEMENT_TOP = 'top-start'; 3440 var PLACEMENT_TOPEND = 'top-end'; 3441 var PLACEMENT_BOTTOM = 'bottom-start'; 3442 var PLACEMENT_BOTTOMEND = 'bottom-end'; 3443 var PLACEMENT_RIGHT = 'right-start'; 3444 var PLACEMENT_LEFT = 'left-start'; 3445 var Default$5 = { 3446 offset: 0, 3447 flip: true, 3448 boundary: 'scrollParent', 3449 reference: 'toggle', 3450 display: 'dynamic', 3451 popperConfig: null 3452 }; 3453 var DefaultType$5 = { 3454 offset: '(number|string|function)', 3455 flip: 'boolean', 3456 boundary: '(string|element)', 3457 reference: '(string|element)', 3458 display: 'string', 3459 popperConfig: '(null|object)' 3460 }; 3461 /** 3462 * Class definition 3463 */ 3464 3465 var Dropdown = /*#__PURE__*/function () { 3466 function Dropdown(element, config) { 3467 this._element = element; 3468 this._popper = null; 3469 this._config = this._getConfig(config); 3470 this._menu = this._getMenuElement(); 3471 this._inNavbar = this._detectNavbar(); 3472 3473 this._addEventListeners(); 3474 } // Getters 3475 3476 3477 var _proto = Dropdown.prototype; 3478 3479 // Public 3480 _proto.toggle = function toggle() { 3481 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 3482 return; 3483 } 3484 3485 var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); 3486 3487 Dropdown._clearMenus(); 3488 3489 if (isActive) { 3490 return; 3491 } 3492 3493 this.show(true); 3494 }; 3495 3496 _proto.show = function show(usePopper) { 3497 if (usePopper === void 0) { 3498 usePopper = false; 3499 } 3500 3501 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 3502 return; 3503 } 3504 3505 var relatedTarget = { 3506 relatedTarget: this._element 3507 }; 3508 var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); 3509 3510 var parent = Dropdown._getParentFromElement(this._element); 3511 3512 $__default["default"](parent).trigger(showEvent); 3513 3514 if (showEvent.isDefaultPrevented()) { 3515 return; 3516 } // Totally disable Popper for Dropdowns in Navbar 3517 3518 3519 if (!this._inNavbar && usePopper) { 3520 // Check for Popper dependency 3521 if (typeof Popper__default["default"] === 'undefined') { 3522 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 3523 } 3524 3525 var referenceElement = this._element; 3526 3527 if (this._config.reference === 'parent') { 3528 referenceElement = parent; 3529 } else if (Util.isElement(this._config.reference)) { 3530 referenceElement = this._config.reference; // Check if it's jQuery element 3531 3532 if (typeof this._config.reference.jquery !== 'undefined') { 3533 referenceElement = this._config.reference[0]; 3534 } 3535 } // If boundary is not `scrollParent`, then set position to `static` 3536 // to allow the menu to "escape" the scroll parent's boundaries 3537 // https://github.com/twbs/bootstrap/issues/24251 3538 3539 3540 if (this._config.boundary !== 'scrollParent') { 3541 $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); 3542 } 3543 3544 this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig()); 3545 } // If this is a touch-enabled device we add extra 3546 // empty mouseover listeners to the body's immediate children; 3547 // only needed because of broken event delegation on iOS 3548 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3549 3550 3551 if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 3552 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 3553 } 3554 3555 this._element.focus(); 3556 3557 this._element.setAttribute('aria-expanded', true); 3558 3559 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 3560 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); 3561 }; 3562 3563 _proto.hide = function hide() { 3564 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 3565 return; 3566 } 3567 3568 var relatedTarget = { 3569 relatedTarget: this._element 3570 }; 3571 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 3572 3573 var parent = Dropdown._getParentFromElement(this._element); 3574 3575 $__default["default"](parent).trigger(hideEvent); 3576 3577 if (hideEvent.isDefaultPrevented()) { 3578 return; 3579 } 3580 3581 if (this._popper) { 3582 this._popper.destroy(); 3583 } 3584 3585 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 3586 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 3587 }; 3588 3589 _proto.dispose = function dispose() { 3590 $__default["default"].removeData(this._element, DATA_KEY$6); 3591 $__default["default"](this._element).off(EVENT_KEY$6); 3592 this._element = null; 3593 this._menu = null; 3594 3595 if (this._popper !== null) { 3596 this._popper.destroy(); 3597 3598 this._popper = null; 3599 } 3600 }; 3601 3602 _proto.update = function update() { 3603 this._inNavbar = this._detectNavbar(); 3604 3605 if (this._popper !== null) { 3606 this._popper.scheduleUpdate(); 3607 } 3608 } // Private 3609 ; 3610 3611 _proto._addEventListeners = function _addEventListeners() { 3612 var _this = this; 3613 3614 $__default["default"](this._element).on(EVENT_CLICK, function (event) { 3615 event.preventDefault(); 3616 event.stopPropagation(); 3617 3618 _this.toggle(); 3619 }); 3620 }; 3621 3622 _proto._getConfig = function _getConfig(config) { 3623 config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config); 3624 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 3625 return config; 3626 }; 3627 3628 _proto._getMenuElement = function _getMenuElement() { 3629 if (!this._menu) { 3630 var parent = Dropdown._getParentFromElement(this._element); 3631 3632 if (parent) { 3633 this._menu = parent.querySelector(SELECTOR_MENU); 3634 } 3635 } 3636 3637 return this._menu; 3638 }; 3639 3640 _proto._getPlacement = function _getPlacement() { 3641 var $parentDropdown = $__default["default"](this._element.parentNode); 3642 var placement = PLACEMENT_BOTTOM; // Handle dropup 3643 3644 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 3645 placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 3646 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 3647 placement = PLACEMENT_RIGHT; 3648 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 3649 placement = PLACEMENT_LEFT; 3650 } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 3651 placement = PLACEMENT_BOTTOMEND; 3652 } 3653 3654 return placement; 3655 }; 3656 3657 _proto._detectNavbar = function _detectNavbar() { 3658 return $__default["default"](this._element).closest('.navbar').length > 0; 3659 }; 3660 3661 _proto._getOffset = function _getOffset() { 3662 var _this2 = this; 3663 3664 var offset = {}; 3665 3666 if (typeof this._config.offset === 'function') { 3667 offset.fn = function (data) { 3668 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); 3669 return data; 3670 }; 3671 } else { 3672 offset.offset = this._config.offset; 3673 } 3674 3675 return offset; 3676 }; 3677 3678 _proto._getPopperConfig = function _getPopperConfig() { 3679 var popperConfig = { 3680 placement: this._getPlacement(), 3681 modifiers: { 3682 offset: this._getOffset(), 3683 flip: { 3684 enabled: this._config.flip 3685 }, 3686 preventOverflow: { 3687 boundariesElement: this._config.boundary 3688 } 3689 } 3690 }; // Disable Popper if we have a static display 3691 3692 if (this._config.display === 'static') { 3693 popperConfig.modifiers.applyStyle = { 3694 enabled: false 3695 }; 3696 } 3697 3698 return _extends({}, popperConfig, this._config.popperConfig); 3699 } // Static 3700 ; 3701 3702 Dropdown._jQueryInterface = function _jQueryInterface(config) { 3703 return this.each(function () { 3704 var data = $__default["default"](this).data(DATA_KEY$6); 3705 3706 var _config = typeof config === 'object' ? config : null; 3707 3708 if (!data) { 3709 data = new Dropdown(this, _config); 3710 $__default["default"](this).data(DATA_KEY$6, data); 3711 } 3712 3713 if (typeof config === 'string') { 3714 if (typeof data[config] === 'undefined') { 3715 throw new TypeError("No method named \"" + config + "\""); 3716 } 3717 3718 data[config](); 3719 } 3720 }); 3721 }; 3722 3723 Dropdown._clearMenus = function _clearMenus(event) { 3724 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 3725 return; 3726 } 3727 3728 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 3729 3730 for (var i = 0, len = toggles.length; i < len; i++) { 3731 var parent = Dropdown._getParentFromElement(toggles[i]); 3732 3733 var context = $__default["default"](toggles[i]).data(DATA_KEY$6); 3734 var relatedTarget = { 3735 relatedTarget: toggles[i] 3736 }; 3737 3738 if (event && event.type === 'click') { 3739 relatedTarget.clickEvent = event; 3740 } 3741 3742 if (!context) { 3743 continue; 3744 } 3745 3746 var dropdownMenu = context._menu; 3747 3748 if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { 3749 continue; 3750 } 3751 3752 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { 3753 continue; 3754 } 3755 3756 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 3757 $__default["default"](parent).trigger(hideEvent); 3758 3759 if (hideEvent.isDefaultPrevented()) { 3760 continue; 3761 } // If this is a touch-enabled device we remove the extra 3762 // empty mouseover listeners we added for iOS support 3763 3764 3765 if ('ontouchstart' in document.documentElement) { 3766 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 3767 } 3768 3769 toggles[i].setAttribute('aria-expanded', 'false'); 3770 3771 if (context._popper) { 3772 context._popper.destroy(); 3773 } 3774 3775 $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); 3776 $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 3777 } 3778 }; 3779 3780 Dropdown._getParentFromElement = function _getParentFromElement(element) { 3781 var parent; 3782 var selector = Util.getSelectorFromElement(element); 3783 3784 if (selector) { 3785 parent = document.querySelector(selector); 3786 } 3787 3788 return parent || element.parentNode; 3789 } // eslint-disable-next-line complexity 3790 ; 3791 3792 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 3793 // If not input/textarea: 3794 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 3795 // If input/textarea: 3796 // - If space key => not a dropdown command 3797 // - If key is other than escape 3798 // - If key is not up or down => not a dropdown command 3799 // - If trigger inside the menu => not a dropdown command 3800 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 3801 return; 3802 } 3803 3804 if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { 3805 return; 3806 } 3807 3808 var parent = Dropdown._getParentFromElement(this); 3809 3810 var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); 3811 3812 if (!isActive && event.which === ESCAPE_KEYCODE$1) { 3813 return; 3814 } 3815 3816 event.preventDefault(); 3817 event.stopPropagation(); 3818 3819 if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { 3820 if (event.which === ESCAPE_KEYCODE$1) { 3821 $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 3822 } 3823 3824 $__default["default"](this).trigger('click'); 3825 return; 3826 } 3827 3828 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 3829 return $__default["default"](item).is(':visible'); 3830 }); 3831 3832 if (items.length === 0) { 3833 return; 3834 } 3835 3836 var index = items.indexOf(event.target); 3837 3838 if (event.which === ARROW_UP_KEYCODE && index > 0) { 3839 // Up 3840 index--; 3841 } 3842 3843 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 3844 // Down 3845 index++; 3846 } 3847 3848 if (index < 0) { 3849 index = 0; 3850 } 3851 3852 items[index].focus(); 3853 }; 3854 3855 _createClass(Dropdown, null, [{ 3856 key: "VERSION", 3857 get: function get() { 3858 return VERSION$6; 3859 } 3860 }, { 3861 key: "Default", 3862 get: function get() { 3863 return Default$5; 3864 } 3865 }, { 3866 key: "DefaultType", 3867 get: function get() { 3868 return DefaultType$5; 3869 } 3870 }]); 3871 3872 return Dropdown; 3873 }(); 3874 /** 3875 * Data API implementation 3876 */ 3877 3878 3879 $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 3880 event.preventDefault(); 3881 event.stopPropagation(); 3882 3883 Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); 3884 }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { 3885 e.stopPropagation(); 3886 }); 3887 /** 3888 * jQuery 3889 */ 3890 3891 $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; 3892 $__default["default"].fn[NAME$6].Constructor = Dropdown; 3893 3894 $__default["default"].fn[NAME$6].noConflict = function () { 3895 $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 3896 return Dropdown._jQueryInterface; 3897 }; 3898 3899 /** 3900 * Constants 3901 */ 3902 3903 var NAME$5 = 'modal'; 3904 var VERSION$5 = '4.6.2'; 3905 var DATA_KEY$5 = 'bs.modal'; 3906 var EVENT_KEY$5 = "." + DATA_KEY$5; 3907 var DATA_API_KEY$2 = '.data-api'; 3908 var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; 3909 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 3910 3911 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 3912 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 3913 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 3914 var CLASS_NAME_OPEN = 'modal-open'; 3915 var CLASS_NAME_FADE$4 = 'fade'; 3916 var CLASS_NAME_SHOW$4 = 'show'; 3917 var CLASS_NAME_STATIC = 'modal-static'; 3918 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 3919 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 3920 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 3921 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 3922 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 3923 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 3924 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 3925 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; 3926 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 3927 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 3928 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 3929 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; 3930 var SELECTOR_DIALOG = '.modal-dialog'; 3931 var SELECTOR_MODAL_BODY = '.modal-body'; 3932 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; 3933 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; 3934 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 3935 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 3936 var Default$4 = { 3937 backdrop: true, 3938 keyboard: true, 3939 focus: true, 3940 show: true 3941 }; 3942 var DefaultType$4 = { 3943 backdrop: '(boolean|string)', 3944 keyboard: 'boolean', 3945 focus: 'boolean', 3946 show: 'boolean' 3947 }; 3948 /** 3949 * Class definition 3950 */ 3951 3952 var Modal = /*#__PURE__*/function () { 3953 function Modal(element, config) { 3954 this._config = this._getConfig(config); 3955 this._element = element; 3956 this._dialog = element.querySelector(SELECTOR_DIALOG); 3957 this._backdrop = null; 3958 this._isShown = false; 3959 this._isBodyOverflowing = false; 3960 this._ignoreBackdropClick = false; 3961 this._isTransitioning = false; 3962 this._scrollbarWidth = 0; 3963 } // Getters 3964 3965 3966 var _proto = Modal.prototype; 3967 3968 // Public 3969 _proto.toggle = function toggle(relatedTarget) { 3970 return this._isShown ? this.hide() : this.show(relatedTarget); 3971 }; 3972 3973 _proto.show = function show(relatedTarget) { 3974 var _this = this; 3975 3976 if (this._isShown || this._isTransitioning) { 3977 return; 3978 } 3979 3980 var showEvent = $__default["default"].Event(EVENT_SHOW$2, { 3981 relatedTarget: relatedTarget 3982 }); 3983 $__default["default"](this._element).trigger(showEvent); 3984 3985 if (showEvent.isDefaultPrevented()) { 3986 return; 3987 } 3988 3989 this._isShown = true; 3990 3991 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 3992 this._isTransitioning = true; 3993 } 3994 3995 this._checkScrollbar(); 3996 3997 this._setScrollbar(); 3998 3999 this._adjustDialog(); 4000 4001 this._setEscapeEvent(); 4002 4003 this._setResizeEvent(); 4004 4005 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { 4006 return _this.hide(event); 4007 }); 4008 $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 4009 $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 4010 if ($__default["default"](event.target).is(_this._element)) { 4011 _this._ignoreBackdropClick = true; 4012 } 4013 }); 4014 }); 4015 4016 this._showBackdrop(function () { 4017 return _this._showElement(relatedTarget); 4018 }); 4019 }; 4020 4021 _proto.hide = function hide(event) { 4022 var _this2 = this; 4023 4024 if (event) { 4025 event.preventDefault(); 4026 } 4027 4028 if (!this._isShown || this._isTransitioning) { 4029 return; 4030 } 4031 4032 var hideEvent = $__default["default"].Event(EVENT_HIDE$2); 4033 $__default["default"](this._element).trigger(hideEvent); 4034 4035 if (!this._isShown || hideEvent.isDefaultPrevented()) { 4036 return; 4037 } 4038 4039 this._isShown = false; 4040 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 4041 4042 if (transition) { 4043 this._isTransitioning = true; 4044 } 4045 4046 this._setEscapeEvent(); 4047 4048 this._setResizeEvent(); 4049 4050 $__default["default"](document).off(EVENT_FOCUSIN); 4051 $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); 4052 $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); 4053 $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 4054 4055 if (transition) { 4056 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4057 $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { 4058 return _this2._hideModal(event); 4059 }).emulateTransitionEnd(transitionDuration); 4060 } else { 4061 this._hideModal(); 4062 } 4063 }; 4064 4065 _proto.dispose = function dispose() { 4066 [window, this._element, this._dialog].forEach(function (htmlElement) { 4067 return $__default["default"](htmlElement).off(EVENT_KEY$5); 4068 }); 4069 /** 4070 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 4071 * Do not move `document` in `htmlElements` array 4072 * It will remove `EVENT_CLICK_DATA_API` event that should remain 4073 */ 4074 4075 $__default["default"](document).off(EVENT_FOCUSIN); 4076 $__default["default"].removeData(this._element, DATA_KEY$5); 4077 this._config = null; 4078 this._element = null; 4079 this._dialog = null; 4080 this._backdrop = null; 4081 this._isShown = null; 4082 this._isBodyOverflowing = null; 4083 this._ignoreBackdropClick = null; 4084 this._isTransitioning = null; 4085 this._scrollbarWidth = null; 4086 }; 4087 4088 _proto.handleUpdate = function handleUpdate() { 4089 this._adjustDialog(); 4090 } // Private 4091 ; 4092 4093 _proto._getConfig = function _getConfig(config) { 4094 config = _extends({}, Default$4, config); 4095 Util.typeCheckConfig(NAME$5, config, DefaultType$4); 4096 return config; 4097 }; 4098 4099 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 4100 var _this3 = this; 4101 4102 var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); 4103 $__default["default"](this._element).trigger(hideEventPrevented); 4104 4105 if (hideEventPrevented.isDefaultPrevented()) { 4106 return; 4107 } 4108 4109 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4110 4111 if (!isModalOverflowing) { 4112 this._element.style.overflowY = 'hidden'; 4113 } 4114 4115 this._element.classList.add(CLASS_NAME_STATIC); 4116 4117 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4118 $__default["default"](this._element).off(Util.TRANSITION_END); 4119 $__default["default"](this._element).one(Util.TRANSITION_END, function () { 4120 _this3._element.classList.remove(CLASS_NAME_STATIC); 4121 4122 if (!isModalOverflowing) { 4123 $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { 4124 _this3._element.style.overflowY = ''; 4125 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 4126 } 4127 }).emulateTransitionEnd(modalTransitionDuration); 4128 4129 this._element.focus(); 4130 }; 4131 4132 _proto._showElement = function _showElement(relatedTarget) { 4133 var _this4 = this; 4134 4135 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 4136 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 4137 4138 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4139 // Don't move modal's DOM position 4140 document.body.appendChild(this._element); 4141 } 4142 4143 this._element.style.display = 'block'; 4144 4145 this._element.removeAttribute('aria-hidden'); 4146 4147 this._element.setAttribute('aria-modal', true); 4148 4149 this._element.setAttribute('role', 'dialog'); 4150 4151 if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 4152 modalBody.scrollTop = 0; 4153 } else { 4154 this._element.scrollTop = 0; 4155 } 4156 4157 if (transition) { 4158 Util.reflow(this._element); 4159 } 4160 4161 $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); 4162 4163 if (this._config.focus) { 4164 this._enforceFocus(); 4165 } 4166 4167 var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { 4168 relatedTarget: relatedTarget 4169 }); 4170 4171 var transitionComplete = function transitionComplete() { 4172 if (_this4._config.focus) { 4173 _this4._element.focus(); 4174 } 4175 4176 _this4._isTransitioning = false; 4177 $__default["default"](_this4._element).trigger(shownEvent); 4178 }; 4179 4180 if (transition) { 4181 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4182 $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 4183 } else { 4184 transitionComplete(); 4185 } 4186 }; 4187 4188 _proto._enforceFocus = function _enforceFocus() { 4189 var _this5 = this; 4190 4191 $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 4192 .on(EVENT_FOCUSIN, function (event) { 4193 if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { 4194 _this5._element.focus(); 4195 } 4196 }); 4197 }; 4198 4199 _proto._setEscapeEvent = function _setEscapeEvent() { 4200 var _this6 = this; 4201 4202 if (this._isShown) { 4203 $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 4204 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 4205 event.preventDefault(); 4206 4207 _this6.hide(); 4208 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 4209 _this6._triggerBackdropTransition(); 4210 } 4211 }); 4212 } else if (!this._isShown) { 4213 $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); 4214 } 4215 }; 4216 4217 _proto._setResizeEvent = function _setResizeEvent() { 4218 var _this7 = this; 4219 4220 if (this._isShown) { 4221 $__default["default"](window).on(EVENT_RESIZE, function (event) { 4222 return _this7.handleUpdate(event); 4223 }); 4224 } else { 4225 $__default["default"](window).off(EVENT_RESIZE); 4226 } 4227 }; 4228 4229 _proto._hideModal = function _hideModal() { 4230 var _this8 = this; 4231 4232 this._element.style.display = 'none'; 4233 4234 this._element.setAttribute('aria-hidden', true); 4235 4236 this._element.removeAttribute('aria-modal'); 4237 4238 this._element.removeAttribute('role'); 4239 4240 this._isTransitioning = false; 4241 4242 this._showBackdrop(function () { 4243 $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); 4244 4245 _this8._resetAdjustments(); 4246 4247 _this8._resetScrollbar(); 4248 4249 $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); 4250 }); 4251 }; 4252 4253 _proto._removeBackdrop = function _removeBackdrop() { 4254 if (this._backdrop) { 4255 $__default["default"](this._backdrop).remove(); 4256 this._backdrop = null; 4257 } 4258 }; 4259 4260 _proto._showBackdrop = function _showBackdrop(callback) { 4261 var _this9 = this; 4262 4263 var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; 4264 4265 if (this._isShown && this._config.backdrop) { 4266 this._backdrop = document.createElement('div'); 4267 this._backdrop.className = CLASS_NAME_BACKDROP; 4268 4269 if (animate) { 4270 this._backdrop.classList.add(animate); 4271 } 4272 4273 $__default["default"](this._backdrop).appendTo(document.body); 4274 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { 4275 if (_this9._ignoreBackdropClick) { 4276 _this9._ignoreBackdropClick = false; 4277 return; 4278 } 4279 4280 if (event.target !== event.currentTarget) { 4281 return; 4282 } 4283 4284 if (_this9._config.backdrop === 'static') { 4285 _this9._triggerBackdropTransition(); 4286 } else { 4287 _this9.hide(); 4288 } 4289 }); 4290 4291 if (animate) { 4292 Util.reflow(this._backdrop); 4293 } 4294 4295 $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); 4296 4297 if (!callback) { 4298 return; 4299 } 4300 4301 if (!animate) { 4302 callback(); 4303 return; 4304 } 4305 4306 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 4307 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 4308 } else if (!this._isShown && this._backdrop) { 4309 $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); 4310 4311 var callbackRemove = function callbackRemove() { 4312 _this9._removeBackdrop(); 4313 4314 if (callback) { 4315 callback(); 4316 } 4317 }; 4318 4319 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 4320 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 4321 4322 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 4323 } else { 4324 callbackRemove(); 4325 } 4326 } else if (callback) { 4327 callback(); 4328 } 4329 } // ---------------------------------------------------------------------- 4330 // the following methods are used to handle overflowing modals 4331 // todo (fat): these should probably be refactored out of modal.js 4332 // ---------------------------------------------------------------------- 4333 ; 4334 4335 _proto._adjustDialog = function _adjustDialog() { 4336 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4337 4338 if (!this._isBodyOverflowing && isModalOverflowing) { 4339 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 4340 } 4341 4342 if (this._isBodyOverflowing && !isModalOverflowing) { 4343 this._element.style.paddingRight = this._scrollbarWidth + "px"; 4344 } 4345 }; 4346 4347 _proto._resetAdjustments = function _resetAdjustments() { 4348 this._element.style.paddingLeft = ''; 4349 this._element.style.paddingRight = ''; 4350 }; 4351 4352 _proto._checkScrollbar = function _checkScrollbar() { 4353 var rect = document.body.getBoundingClientRect(); 4354 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 4355 this._scrollbarWidth = this._getScrollbarWidth(); 4356 }; 4357 4358 _proto._setScrollbar = function _setScrollbar() { 4359 var _this10 = this; 4360 4361 if (this._isBodyOverflowing) { 4362 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 4363 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 4364 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 4365 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 4366 4367 $__default["default"](fixedContent).each(function (index, element) { 4368 var actualPadding = element.style.paddingRight; 4369 var calculatedPadding = $__default["default"](element).css('padding-right'); 4370 $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 4371 }); // Adjust sticky content margin 4372 4373 $__default["default"](stickyContent).each(function (index, element) { 4374 var actualMargin = element.style.marginRight; 4375 var calculatedMargin = $__default["default"](element).css('margin-right'); 4376 $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 4377 }); // Adjust body padding 4378 4379 var actualPadding = document.body.style.paddingRight; 4380 var calculatedPadding = $__default["default"](document.body).css('padding-right'); 4381 $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 4382 } 4383 4384 $__default["default"](document.body).addClass(CLASS_NAME_OPEN); 4385 }; 4386 4387 _proto._resetScrollbar = function _resetScrollbar() { 4388 // Restore fixed content padding 4389 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 4390 $__default["default"](fixedContent).each(function (index, element) { 4391 var padding = $__default["default"](element).data('padding-right'); 4392 $__default["default"](element).removeData('padding-right'); 4393 element.style.paddingRight = padding ? padding : ''; 4394 }); // Restore sticky content 4395 4396 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 4397 $__default["default"](elements).each(function (index, element) { 4398 var margin = $__default["default"](element).data('margin-right'); 4399 4400 if (typeof margin !== 'undefined') { 4401 $__default["default"](element).css('margin-right', margin).removeData('margin-right'); 4402 } 4403 }); // Restore body padding 4404 4405 var padding = $__default["default"](document.body).data('padding-right'); 4406 $__default["default"](document.body).removeData('padding-right'); 4407 document.body.style.paddingRight = padding ? padding : ''; 4408 }; 4409 4410 _proto._getScrollbarWidth = function _getScrollbarWidth() { 4411 // thx d.walsh 4412 var scrollDiv = document.createElement('div'); 4413 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 4414 document.body.appendChild(scrollDiv); 4415 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 4416 document.body.removeChild(scrollDiv); 4417 return scrollbarWidth; 4418 } // Static 4419 ; 4420 4421 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 4422 return this.each(function () { 4423 var data = $__default["default"](this).data(DATA_KEY$5); 4424 4425 var _config = _extends({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); 4426 4427 if (!data) { 4428 data = new Modal(this, _config); 4429 $__default["default"](this).data(DATA_KEY$5, data); 4430 } 4431 4432 if (typeof config === 'string') { 4433 if (typeof data[config] === 'undefined') { 4434 throw new TypeError("No method named \"" + config + "\""); 4435 } 4436 4437 data[config](relatedTarget); 4438 } else if (_config.show) { 4439 data.show(relatedTarget); 4440 } 4441 }); 4442 }; 4443 4444 _createClass(Modal, null, [{ 4445 key: "VERSION", 4446 get: function get() { 4447 return VERSION$5; 4448 } 4449 }, { 4450 key: "Default", 4451 get: function get() { 4452 return Default$4; 4453 } 4454 }]); 4455 4456 return Modal; 4457 }(); 4458 /** 4459 * Data API implementation 4460 */ 4461 4462 4463 $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 4464 var _this11 = this; 4465 4466 var target; 4467 var selector = Util.getSelectorFromElement(this); 4468 4469 if (selector) { 4470 target = document.querySelector(selector); 4471 } 4472 4473 var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 4474 4475 if (this.tagName === 'A' || this.tagName === 'AREA') { 4476 event.preventDefault(); 4477 } 4478 4479 var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { 4480 if (showEvent.isDefaultPrevented()) { 4481 // Only register focus restorer if modal will actually get shown 4482 return; 4483 } 4484 4485 $target.one(EVENT_HIDDEN$2, function () { 4486 if ($__default["default"](_this11).is(':visible')) { 4487 _this11.focus(); 4488 } 4489 }); 4490 }); 4491 4492 Modal._jQueryInterface.call($__default["default"](target), config, this); 4493 }); 4494 /** 4495 * jQuery 4496 */ 4497 4498 $__default["default"].fn[NAME$5] = Modal._jQueryInterface; 4499 $__default["default"].fn[NAME$5].Constructor = Modal; 4500 4501 $__default["default"].fn[NAME$5].noConflict = function () { 4502 $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 4503 return Modal._jQueryInterface; 4504 }; 4505 4506 /** 4507 * -------------------------------------------------------------------------- 4508 * Bootstrap (v4.6.2): tools/sanitizer.js 4509 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4510 * -------------------------------------------------------------------------- 4511 */ 4512 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 4513 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 4514 var DefaultWhitelist = { 4515 // Global attributes allowed on any supplied element below. 4516 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 4517 a: ['target', 'href', 'title', 'rel'], 4518 area: [], 4519 b: [], 4520 br: [], 4521 col: [], 4522 code: [], 4523 div: [], 4524 em: [], 4525 hr: [], 4526 h1: [], 4527 h2: [], 4528 h3: [], 4529 h4: [], 4530 h5: [], 4531 h6: [], 4532 i: [], 4533 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 4534 li: [], 4535 ol: [], 4536 p: [], 4537 pre: [], 4538 s: [], 4539 small: [], 4540 span: [], 4541 sub: [], 4542 sup: [], 4543 strong: [], 4544 u: [], 4545 ul: [] 4546 }; 4547 /** 4548 * A pattern that recognizes a commonly useful subset of URLs that are safe. 4549 * 4550 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 4551 */ 4552 4553 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 4554 /** 4555 * A pattern that matches safe data URLs. Only matches image, video and audio types. 4556 * 4557 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 4558 */ 4559 4560 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 4561 4562 function allowedAttribute(attr, allowedAttributeList) { 4563 var attrName = attr.nodeName.toLowerCase(); 4564 4565 if (allowedAttributeList.indexOf(attrName) !== -1) { 4566 if (uriAttrs.indexOf(attrName) !== -1) { 4567 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 4568 } 4569 4570 return true; 4571 } 4572 4573 var regExp = allowedAttributeList.filter(function (attrRegex) { 4574 return attrRegex instanceof RegExp; 4575 }); // Check if a regular expression validates the attribute. 4576 4577 for (var i = 0, len = regExp.length; i < len; i++) { 4578 if (regExp[i].test(attrName)) { 4579 return true; 4580 } 4581 } 4582 4583 return false; 4584 } 4585 4586 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 4587 if (unsafeHtml.length === 0) { 4588 return unsafeHtml; 4589 } 4590 4591 if (sanitizeFn && typeof sanitizeFn === 'function') { 4592 return sanitizeFn(unsafeHtml); 4593 } 4594 4595 var domParser = new window.DOMParser(); 4596 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 4597 var whitelistKeys = Object.keys(whiteList); 4598 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 4599 4600 var _loop = function _loop(i, len) { 4601 var el = elements[i]; 4602 var elName = el.nodeName.toLowerCase(); 4603 4604 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 4605 el.parentNode.removeChild(el); 4606 return "continue"; 4607 } 4608 4609 var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread 4610 4611 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 4612 attributeList.forEach(function (attr) { 4613 if (!allowedAttribute(attr, whitelistedAttributes)) { 4614 el.removeAttribute(attr.nodeName); 4615 } 4616 }); 4617 }; 4618 4619 for (var i = 0, len = elements.length; i < len; i++) { 4620 var _ret = _loop(i); 4621 4622 if (_ret === "continue") continue; 4623 } 4624 4625 return createdDocument.body.innerHTML; 4626 } 4627 4628 /** 4629 * Constants 4630 */ 4631 4632 var NAME$4 = 'tooltip'; 4633 var VERSION$4 = '4.6.2'; 4634 var DATA_KEY$4 = 'bs.tooltip'; 4635 var EVENT_KEY$4 = "." + DATA_KEY$4; 4636 var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; 4637 var CLASS_PREFIX$1 = 'bs-tooltip'; 4638 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 4639 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 4640 var CLASS_NAME_FADE$3 = 'fade'; 4641 var CLASS_NAME_SHOW$3 = 'show'; 4642 var HOVER_STATE_SHOW = 'show'; 4643 var HOVER_STATE_OUT = 'out'; 4644 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 4645 var SELECTOR_ARROW = '.arrow'; 4646 var TRIGGER_HOVER = 'hover'; 4647 var TRIGGER_FOCUS = 'focus'; 4648 var TRIGGER_CLICK = 'click'; 4649 var TRIGGER_MANUAL = 'manual'; 4650 var AttachmentMap = { 4651 AUTO: 'auto', 4652 TOP: 'top', 4653 RIGHT: 'right', 4654 BOTTOM: 'bottom', 4655 LEFT: 'left' 4656 }; 4657 var Default$3 = { 4658 animation: true, 4659 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 4660 trigger: 'hover focus', 4661 title: '', 4662 delay: 0, 4663 html: false, 4664 selector: false, 4665 placement: 'top', 4666 offset: 0, 4667 container: false, 4668 fallbackPlacement: 'flip', 4669 boundary: 'scrollParent', 4670 customClass: '', 4671 sanitize: true, 4672 sanitizeFn: null, 4673 whiteList: DefaultWhitelist, 4674 popperConfig: null 4675 }; 4676 var DefaultType$3 = { 4677 animation: 'boolean', 4678 template: 'string', 4679 title: '(string|element|function)', 4680 trigger: 'string', 4681 delay: '(number|object)', 4682 html: 'boolean', 4683 selector: '(string|boolean)', 4684 placement: '(string|function)', 4685 offset: '(number|string|function)', 4686 container: '(string|element|boolean)', 4687 fallbackPlacement: '(string|array)', 4688 boundary: '(string|element)', 4689 customClass: '(string|function)', 4690 sanitize: 'boolean', 4691 sanitizeFn: '(null|function)', 4692 whiteList: 'object', 4693 popperConfig: '(null|object)' 4694 }; 4695 var Event$1 = { 4696 HIDE: "hide" + EVENT_KEY$4, 4697 HIDDEN: "hidden" + EVENT_KEY$4, 4698 SHOW: "show" + EVENT_KEY$4, 4699 SHOWN: "shown" + EVENT_KEY$4, 4700 INSERTED: "inserted" + EVENT_KEY$4, 4701 CLICK: "click" + EVENT_KEY$4, 4702 FOCUSIN: "focusin" + EVENT_KEY$4, 4703 FOCUSOUT: "focusout" + EVENT_KEY$4, 4704 MOUSEENTER: "mouseenter" + EVENT_KEY$4, 4705 MOUSELEAVE: "mouseleave" + EVENT_KEY$4 4706 }; 4707 /** 4708 * Class definition 4709 */ 4710 4711 var Tooltip = /*#__PURE__*/function () { 4712 function Tooltip(element, config) { 4713 if (typeof Popper__default["default"] === 'undefined') { 4714 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 4715 } // Private 4716 4717 4718 this._isEnabled = true; 4719 this._timeout = 0; 4720 this._hoverState = ''; 4721 this._activeTrigger = {}; 4722 this._popper = null; // Protected 4723 4724 this.element = element; 4725 this.config = this._getConfig(config); 4726 this.tip = null; 4727 4728 this._setListeners(); 4729 } // Getters 4730 4731 4732 var _proto = Tooltip.prototype; 4733 4734 // Public 4735 _proto.enable = function enable() { 4736 this._isEnabled = true; 4737 }; 4738 4739 _proto.disable = function disable() { 4740 this._isEnabled = false; 4741 }; 4742 4743 _proto.toggleEnabled = function toggleEnabled() { 4744 this._isEnabled = !this._isEnabled; 4745 }; 4746 4747 _proto.toggle = function toggle(event) { 4748 if (!this._isEnabled) { 4749 return; 4750 } 4751 4752 if (event) { 4753 var dataKey = this.constructor.DATA_KEY; 4754 var context = $__default["default"](event.currentTarget).data(dataKey); 4755 4756 if (!context) { 4757 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 4758 $__default["default"](event.currentTarget).data(dataKey, context); 4759 } 4760 4761 context._activeTrigger.click = !context._activeTrigger.click; 4762 4763 if (context._isWithActiveTrigger()) { 4764 context._enter(null, context); 4765 } else { 4766 context._leave(null, context); 4767 } 4768 } else { 4769 if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { 4770 this._leave(null, this); 4771 4772 return; 4773 } 4774 4775 this._enter(null, this); 4776 } 4777 }; 4778 4779 _proto.dispose = function dispose() { 4780 clearTimeout(this._timeout); 4781 $__default["default"].removeData(this.element, this.constructor.DATA_KEY); 4782 $__default["default"](this.element).off(this.constructor.EVENT_KEY); 4783 $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 4784 4785 if (this.tip) { 4786 $__default["default"](this.tip).remove(); 4787 } 4788 4789 this._isEnabled = null; 4790 this._timeout = null; 4791 this._hoverState = null; 4792 this._activeTrigger = null; 4793 4794 if (this._popper) { 4795 this._popper.destroy(); 4796 } 4797 4798 this._popper = null; 4799 this.element = null; 4800 this.config = null; 4801 this.tip = null; 4802 }; 4803 4804 _proto.show = function show() { 4805 var _this = this; 4806 4807 if ($__default["default"](this.element).css('display') === 'none') { 4808 throw new Error('Please use show on visible elements'); 4809 } 4810 4811 var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); 4812 4813 if (this.isWithContent() && this._isEnabled) { 4814 $__default["default"](this.element).trigger(showEvent); 4815 var shadowRoot = Util.findShadowRoot(this.element); 4816 var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 4817 4818 if (showEvent.isDefaultPrevented() || !isInTheDom) { 4819 return; 4820 } 4821 4822 var tip = this.getTipElement(); 4823 var tipId = Util.getUID(this.constructor.NAME); 4824 tip.setAttribute('id', tipId); 4825 this.element.setAttribute('aria-describedby', tipId); 4826 this.setContent(); 4827 4828 if (this.config.animation) { 4829 $__default["default"](tip).addClass(CLASS_NAME_FADE$3); 4830 } 4831 4832 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 4833 4834 var attachment = this._getAttachment(placement); 4835 4836 this.addAttachmentClass(attachment); 4837 4838 var container = this._getContainer(); 4839 4840 $__default["default"](tip).data(this.constructor.DATA_KEY, this); 4841 4842 if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { 4843 $__default["default"](tip).appendTo(container); 4844 } 4845 4846 $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); 4847 this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment)); 4848 $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); 4849 $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 4850 // empty mouseover listeners to the body's immediate children; 4851 // only needed because of broken event delegation on iOS 4852 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4853 4854 if ('ontouchstart' in document.documentElement) { 4855 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 4856 } 4857 4858 var complete = function complete() { 4859 if (_this.config.animation) { 4860 _this._fixTransition(); 4861 } 4862 4863 var prevHoverState = _this._hoverState; 4864 _this._hoverState = null; 4865 $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); 4866 4867 if (prevHoverState === HOVER_STATE_OUT) { 4868 _this._leave(null, _this); 4869 } 4870 }; 4871 4872 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 4873 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 4874 $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4875 } else { 4876 complete(); 4877 } 4878 } 4879 }; 4880 4881 _proto.hide = function hide(callback) { 4882 var _this2 = this; 4883 4884 var tip = this.getTipElement(); 4885 var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); 4886 4887 var complete = function complete() { 4888 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 4889 tip.parentNode.removeChild(tip); 4890 } 4891 4892 _this2._cleanTipClass(); 4893 4894 _this2.element.removeAttribute('aria-describedby'); 4895 4896 $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 4897 4898 if (_this2._popper !== null) { 4899 _this2._popper.destroy(); 4900 } 4901 4902 if (callback) { 4903 callback(); 4904 } 4905 }; 4906 4907 $__default["default"](this.element).trigger(hideEvent); 4908 4909 if (hideEvent.isDefaultPrevented()) { 4910 return; 4911 } 4912 4913 $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 4914 // empty mouseover listeners we added for iOS support 4915 4916 if ('ontouchstart' in document.documentElement) { 4917 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 4918 } 4919 4920 this._activeTrigger[TRIGGER_CLICK] = false; 4921 this._activeTrigger[TRIGGER_FOCUS] = false; 4922 this._activeTrigger[TRIGGER_HOVER] = false; 4923 4924 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 4925 var transitionDuration = Util.getTransitionDurationFromElement(tip); 4926 $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4927 } else { 4928 complete(); 4929 } 4930 4931 this._hoverState = ''; 4932 }; 4933 4934 _proto.update = function update() { 4935 if (this._popper !== null) { 4936 this._popper.scheduleUpdate(); 4937 } 4938 } // Protected 4939 ; 4940 4941 _proto.isWithContent = function isWithContent() { 4942 return Boolean(this.getTitle()); 4943 }; 4944 4945 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 4946 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 4947 }; 4948 4949 _proto.getTipElement = function getTipElement() { 4950 this.tip = this.tip || $__default["default"](this.config.template)[0]; 4951 return this.tip; 4952 }; 4953 4954 _proto.setContent = function setContent() { 4955 var tip = this.getTipElement(); 4956 this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 4957 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); 4958 }; 4959 4960 _proto.setElementContent = function setElementContent($element, content) { 4961 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 4962 // Content is a DOM node or a jQuery 4963 if (this.config.html) { 4964 if (!$__default["default"](content).parent().is($element)) { 4965 $element.empty().append(content); 4966 } 4967 } else { 4968 $element.text($__default["default"](content).text()); 4969 } 4970 4971 return; 4972 } 4973 4974 if (this.config.html) { 4975 if (this.config.sanitize) { 4976 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 4977 } 4978 4979 $element.html(content); 4980 } else { 4981 $element.text(content); 4982 } 4983 }; 4984 4985 _proto.getTitle = function getTitle() { 4986 var title = this.element.getAttribute('data-original-title'); 4987 4988 if (!title) { 4989 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 4990 } 4991 4992 return title; 4993 } // Private 4994 ; 4995 4996 _proto._getPopperConfig = function _getPopperConfig(attachment) { 4997 var _this3 = this; 4998 4999 var defaultBsConfig = { 5000 placement: attachment, 5001 modifiers: { 5002 offset: this._getOffset(), 5003 flip: { 5004 behavior: this.config.fallbackPlacement 5005 }, 5006 arrow: { 5007 element: SELECTOR_ARROW 5008 }, 5009 preventOverflow: { 5010 boundariesElement: this.config.boundary 5011 } 5012 }, 5013 onCreate: function onCreate(data) { 5014 if (data.originalPlacement !== data.placement) { 5015 _this3._handlePopperPlacementChange(data); 5016 } 5017 }, 5018 onUpdate: function onUpdate(data) { 5019 return _this3._handlePopperPlacementChange(data); 5020 } 5021 }; 5022 return _extends({}, defaultBsConfig, this.config.popperConfig); 5023 }; 5024 5025 _proto._getOffset = function _getOffset() { 5026 var _this4 = this; 5027 5028 var offset = {}; 5029 5030 if (typeof this.config.offset === 'function') { 5031 offset.fn = function (data) { 5032 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); 5033 return data; 5034 }; 5035 } else { 5036 offset.offset = this.config.offset; 5037 } 5038 5039 return offset; 5040 }; 5041 5042 _proto._getContainer = function _getContainer() { 5043 if (this.config.container === false) { 5044 return document.body; 5045 } 5046 5047 if (Util.isElement(this.config.container)) { 5048 return $__default["default"](this.config.container); 5049 } 5050 5051 return $__default["default"](document).find(this.config.container); 5052 }; 5053 5054 _proto._getAttachment = function _getAttachment(placement) { 5055 return AttachmentMap[placement.toUpperCase()]; 5056 }; 5057 5058 _proto._setListeners = function _setListeners() { 5059 var _this5 = this; 5060 5061 var triggers = this.config.trigger.split(' '); 5062 triggers.forEach(function (trigger) { 5063 if (trigger === 'click') { 5064 $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 5065 return _this5.toggle(event); 5066 }); 5067 } else if (trigger !== TRIGGER_MANUAL) { 5068 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 5069 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 5070 $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { 5071 return _this5._enter(event); 5072 }).on(eventOut, _this5.config.selector, function (event) { 5073 return _this5._leave(event); 5074 }); 5075 } 5076 }); 5077 5078 this._hideModalHandler = function () { 5079 if (_this5.element) { 5080 _this5.hide(); 5081 } 5082 }; 5083 5084 $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 5085 5086 if (this.config.selector) { 5087 this.config = _extends({}, this.config, { 5088 trigger: 'manual', 5089 selector: '' 5090 }); 5091 } else { 5092 this._fixTitle(); 5093 } 5094 }; 5095 5096 _proto._fixTitle = function _fixTitle() { 5097 var titleType = typeof this.element.getAttribute('data-original-title'); 5098 5099 if (this.element.getAttribute('title') || titleType !== 'string') { 5100 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 5101 this.element.setAttribute('title', ''); 5102 } 5103 }; 5104 5105 _proto._enter = function _enter(event, context) { 5106 var dataKey = this.constructor.DATA_KEY; 5107 context = context || $__default["default"](event.currentTarget).data(dataKey); 5108 5109 if (!context) { 5110 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5111 $__default["default"](event.currentTarget).data(dataKey, context); 5112 } 5113 5114 if (event) { 5115 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 5116 } 5117 5118 if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 5119 context._hoverState = HOVER_STATE_SHOW; 5120 return; 5121 } 5122 5123 clearTimeout(context._timeout); 5124 context._hoverState = HOVER_STATE_SHOW; 5125 5126 if (!context.config.delay || !context.config.delay.show) { 5127 context.show(); 5128 return; 5129 } 5130 5131 context._timeout = setTimeout(function () { 5132 if (context._hoverState === HOVER_STATE_SHOW) { 5133 context.show(); 5134 } 5135 }, context.config.delay.show); 5136 }; 5137 5138 _proto._leave = function _leave(event, context) { 5139 var dataKey = this.constructor.DATA_KEY; 5140 context = context || $__default["default"](event.currentTarget).data(dataKey); 5141 5142 if (!context) { 5143 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5144 $__default["default"](event.currentTarget).data(dataKey, context); 5145 } 5146 5147 if (event) { 5148 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 5149 } 5150 5151 if (context._isWithActiveTrigger()) { 5152 return; 5153 } 5154 5155 clearTimeout(context._timeout); 5156 context._hoverState = HOVER_STATE_OUT; 5157 5158 if (!context.config.delay || !context.config.delay.hide) { 5159 context.hide(); 5160 return; 5161 } 5162 5163 context._timeout = setTimeout(function () { 5164 if (context._hoverState === HOVER_STATE_OUT) { 5165 context.hide(); 5166 } 5167 }, context.config.delay.hide); 5168 }; 5169 5170 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 5171 for (var trigger in this._activeTrigger) { 5172 if (this._activeTrigger[trigger]) { 5173 return true; 5174 } 5175 } 5176 5177 return false; 5178 }; 5179 5180 _proto._getConfig = function _getConfig(config) { 5181 var dataAttributes = $__default["default"](this.element).data(); 5182 Object.keys(dataAttributes).forEach(function (dataAttr) { 5183 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 5184 delete dataAttributes[dataAttr]; 5185 } 5186 }); 5187 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 5188 5189 if (typeof config.delay === 'number') { 5190 config.delay = { 5191 show: config.delay, 5192 hide: config.delay 5193 }; 5194 } 5195 5196 if (typeof config.title === 'number') { 5197 config.title = config.title.toString(); 5198 } 5199 5200 if (typeof config.content === 'number') { 5201 config.content = config.content.toString(); 5202 } 5203 5204 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 5205 5206 if (config.sanitize) { 5207 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 5208 } 5209 5210 return config; 5211 }; 5212 5213 _proto._getDelegateConfig = function _getDelegateConfig() { 5214 var config = {}; 5215 5216 if (this.config) { 5217 for (var key in this.config) { 5218 if (this.constructor.Default[key] !== this.config[key]) { 5219 config[key] = this.config[key]; 5220 } 5221 } 5222 } 5223 5224 return config; 5225 }; 5226 5227 _proto._cleanTipClass = function _cleanTipClass() { 5228 var $tip = $__default["default"](this.getTipElement()); 5229 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 5230 5231 if (tabClass !== null && tabClass.length) { 5232 $tip.removeClass(tabClass.join('')); 5233 } 5234 }; 5235 5236 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 5237 this.tip = popperData.instance.popper; 5238 5239 this._cleanTipClass(); 5240 5241 this.addAttachmentClass(this._getAttachment(popperData.placement)); 5242 }; 5243 5244 _proto._fixTransition = function _fixTransition() { 5245 var tip = this.getTipElement(); 5246 var initConfigAnimation = this.config.animation; 5247 5248 if (tip.getAttribute('x-placement') !== null) { 5249 return; 5250 } 5251 5252 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); 5253 this.config.animation = false; 5254 this.hide(); 5255 this.show(); 5256 this.config.animation = initConfigAnimation; 5257 } // Static 5258 ; 5259 5260 Tooltip._jQueryInterface = function _jQueryInterface(config) { 5261 return this.each(function () { 5262 var $element = $__default["default"](this); 5263 var data = $element.data(DATA_KEY$4); 5264 5265 var _config = typeof config === 'object' && config; 5266 5267 if (!data && /dispose|hide/.test(config)) { 5268 return; 5269 } 5270 5271 if (!data) { 5272 data = new Tooltip(this, _config); 5273 $element.data(DATA_KEY$4, data); 5274 } 5275 5276 if (typeof config === 'string') { 5277 if (typeof data[config] === 'undefined') { 5278 throw new TypeError("No method named \"" + config + "\""); 5279 } 5280 5281 data[config](); 5282 } 5283 }); 5284 }; 5285 5286 _createClass(Tooltip, null, [{ 5287 key: "VERSION", 5288 get: function get() { 5289 return VERSION$4; 5290 } 5291 }, { 5292 key: "Default", 5293 get: function get() { 5294 return Default$3; 5295 } 5296 }, { 5297 key: "NAME", 5298 get: function get() { 5299 return NAME$4; 5300 } 5301 }, { 5302 key: "DATA_KEY", 5303 get: function get() { 5304 return DATA_KEY$4; 5305 } 5306 }, { 5307 key: "Event", 5308 get: function get() { 5309 return Event$1; 5310 } 5311 }, { 5312 key: "EVENT_KEY", 5313 get: function get() { 5314 return EVENT_KEY$4; 5315 } 5316 }, { 5317 key: "DefaultType", 5318 get: function get() { 5319 return DefaultType$3; 5320 } 5321 }]); 5322 5323 return Tooltip; 5324 }(); 5325 /** 5326 * jQuery 5327 */ 5328 5329 5330 $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; 5331 $__default["default"].fn[NAME$4].Constructor = Tooltip; 5332 5333 $__default["default"].fn[NAME$4].noConflict = function () { 5334 $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 5335 return Tooltip._jQueryInterface; 5336 }; 5337 5338 /** 5339 * Constants 5340 */ 5341 5342 var NAME$3 = 'popover'; 5343 var VERSION$3 = '4.6.2'; 5344 var DATA_KEY$3 = 'bs.popover'; 5345 var EVENT_KEY$3 = "." + DATA_KEY$3; 5346 var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; 5347 var CLASS_PREFIX = 'bs-popover'; 5348 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 5349 var CLASS_NAME_FADE$2 = 'fade'; 5350 var CLASS_NAME_SHOW$2 = 'show'; 5351 var SELECTOR_TITLE = '.popover-header'; 5352 var SELECTOR_CONTENT = '.popover-body'; 5353 5354 var Default$2 = _extends({}, Tooltip.Default, { 5355 placement: 'right', 5356 trigger: 'click', 5357 content: '', 5358 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 5359 }); 5360 5361 var DefaultType$2 = _extends({}, Tooltip.DefaultType, { 5362 content: '(string|element|function)' 5363 }); 5364 5365 var Event = { 5366 HIDE: "hide" + EVENT_KEY$3, 5367 HIDDEN: "hidden" + EVENT_KEY$3, 5368 SHOW: "show" + EVENT_KEY$3, 5369 SHOWN: "shown" + EVENT_KEY$3, 5370 INSERTED: "inserted" + EVENT_KEY$3, 5371 CLICK: "click" + EVENT_KEY$3, 5372 FOCUSIN: "focusin" + EVENT_KEY$3, 5373 FOCUSOUT: "focusout" + EVENT_KEY$3, 5374 MOUSEENTER: "mouseenter" + EVENT_KEY$3, 5375 MOUSELEAVE: "mouseleave" + EVENT_KEY$3 5376 }; 5377 /** 5378 * Class definition 5379 */ 5380 5381 var Popover = /*#__PURE__*/function (_Tooltip) { 5382 _inheritsLoose(Popover, _Tooltip); 5383 5384 function Popover() { 5385 return _Tooltip.apply(this, arguments) || this; 5386 } 5387 5388 var _proto = Popover.prototype; 5389 5390 // Overrides 5391 _proto.isWithContent = function isWithContent() { 5392 return this.getTitle() || this._getContent(); 5393 }; 5394 5395 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 5396 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 5397 }; 5398 5399 _proto.getTipElement = function getTipElement() { 5400 this.tip = this.tip || $__default["default"](this.config.template)[0]; 5401 return this.tip; 5402 }; 5403 5404 _proto.setContent = function setContent() { 5405 var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events 5406 5407 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 5408 5409 var content = this._getContent(); 5410 5411 if (typeof content === 'function') { 5412 content = content.call(this.element); 5413 } 5414 5415 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 5416 $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); 5417 } // Private 5418 ; 5419 5420 _proto._getContent = function _getContent() { 5421 return this.element.getAttribute('data-content') || this.config.content; 5422 }; 5423 5424 _proto._cleanTipClass = function _cleanTipClass() { 5425 var $tip = $__default["default"](this.getTipElement()); 5426 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 5427 5428 if (tabClass !== null && tabClass.length > 0) { 5429 $tip.removeClass(tabClass.join('')); 5430 } 5431 } // Static 5432 ; 5433 5434 Popover._jQueryInterface = function _jQueryInterface(config) { 5435 return this.each(function () { 5436 var data = $__default["default"](this).data(DATA_KEY$3); 5437 5438 var _config = typeof config === 'object' ? config : null; 5439 5440 if (!data && /dispose|hide/.test(config)) { 5441 return; 5442 } 5443 5444 if (!data) { 5445 data = new Popover(this, _config); 5446 $__default["default"](this).data(DATA_KEY$3, data); 5447 } 5448 5449 if (typeof config === 'string') { 5450 if (typeof data[config] === 'undefined') { 5451 throw new TypeError("No method named \"" + config + "\""); 5452 } 5453 5454 data[config](); 5455 } 5456 }); 5457 }; 5458 5459 _createClass(Popover, null, [{ 5460 key: "VERSION", 5461 get: // Getters 5462 function get() { 5463 return VERSION$3; 5464 } 5465 }, { 5466 key: "Default", 5467 get: function get() { 5468 return Default$2; 5469 } 5470 }, { 5471 key: "NAME", 5472 get: function get() { 5473 return NAME$3; 5474 } 5475 }, { 5476 key: "DATA_KEY", 5477 get: function get() { 5478 return DATA_KEY$3; 5479 } 5480 }, { 5481 key: "Event", 5482 get: function get() { 5483 return Event; 5484 } 5485 }, { 5486 key: "EVENT_KEY", 5487 get: function get() { 5488 return EVENT_KEY$3; 5489 } 5490 }, { 5491 key: "DefaultType", 5492 get: function get() { 5493 return DefaultType$2; 5494 } 5495 }]); 5496 5497 return Popover; 5498 }(Tooltip); 5499 /** 5500 * jQuery 5501 */ 5502 5503 5504 $__default["default"].fn[NAME$3] = Popover._jQueryInterface; 5505 $__default["default"].fn[NAME$3].Constructor = Popover; 5506 5507 $__default["default"].fn[NAME$3].noConflict = function () { 5508 $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 5509 return Popover._jQueryInterface; 5510 }; 5511 5512 /** 5513 * Constants 5514 */ 5515 5516 var NAME$2 = 'scrollspy'; 5517 var VERSION$2 = '4.6.2'; 5518 var DATA_KEY$2 = 'bs.scrollspy'; 5519 var EVENT_KEY$2 = "." + DATA_KEY$2; 5520 var DATA_API_KEY$1 = '.data-api'; 5521 var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; 5522 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 5523 var CLASS_NAME_ACTIVE$1 = 'active'; 5524 var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; 5525 var EVENT_SCROLL = "scroll" + EVENT_KEY$2; 5526 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; 5527 var METHOD_OFFSET = 'offset'; 5528 var METHOD_POSITION = 'position'; 5529 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 5530 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 5531 var SELECTOR_NAV_LINKS = '.nav-link'; 5532 var SELECTOR_NAV_ITEMS = '.nav-item'; 5533 var SELECTOR_LIST_ITEMS = '.list-group-item'; 5534 var SELECTOR_DROPDOWN$1 = '.dropdown'; 5535 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 5536 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 5537 var Default$1 = { 5538 offset: 10, 5539 method: 'auto', 5540 target: '' 5541 }; 5542 var DefaultType$1 = { 5543 offset: 'number', 5544 method: 'string', 5545 target: '(string|element)' 5546 }; 5547 /** 5548 * Class definition 5549 */ 5550 5551 var ScrollSpy = /*#__PURE__*/function () { 5552 function ScrollSpy(element, config) { 5553 var _this = this; 5554 5555 this._element = element; 5556 this._scrollElement = element.tagName === 'BODY' ? window : element; 5557 this._config = this._getConfig(config); 5558 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 5559 this._offsets = []; 5560 this._targets = []; 5561 this._activeTarget = null; 5562 this._scrollHeight = 0; 5563 $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { 5564 return _this._process(event); 5565 }); 5566 this.refresh(); 5567 5568 this._process(); 5569 } // Getters 5570 5571 5572 var _proto = ScrollSpy.prototype; 5573 5574 // Public 5575 _proto.refresh = function refresh() { 5576 var _this2 = this; 5577 5578 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 5579 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 5580 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 5581 this._offsets = []; 5582 this._targets = []; 5583 this._scrollHeight = this._getScrollHeight(); 5584 var targets = [].slice.call(document.querySelectorAll(this._selector)); 5585 targets.map(function (element) { 5586 var target; 5587 var targetSelector = Util.getSelectorFromElement(element); 5588 5589 if (targetSelector) { 5590 target = document.querySelector(targetSelector); 5591 } 5592 5593 if (target) { 5594 var targetBCR = target.getBoundingClientRect(); 5595 5596 if (targetBCR.width || targetBCR.height) { 5597 // TODO (fat): remove sketch reliance on jQuery position/offset 5598 return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; 5599 } 5600 } 5601 5602 return null; 5603 }).filter(Boolean).sort(function (a, b) { 5604 return a[0] - b[0]; 5605 }).forEach(function (item) { 5606 _this2._offsets.push(item[0]); 5607 5608 _this2._targets.push(item[1]); 5609 }); 5610 }; 5611 5612 _proto.dispose = function dispose() { 5613 $__default["default"].removeData(this._element, DATA_KEY$2); 5614 $__default["default"](this._scrollElement).off(EVENT_KEY$2); 5615 this._element = null; 5616 this._scrollElement = null; 5617 this._config = null; 5618 this._selector = null; 5619 this._offsets = null; 5620 this._targets = null; 5621 this._activeTarget = null; 5622 this._scrollHeight = null; 5623 } // Private 5624 ; 5625 5626 _proto._getConfig = function _getConfig(config) { 5627 config = _extends({}, Default$1, typeof config === 'object' && config ? config : {}); 5628 5629 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 5630 var id = $__default["default"](config.target).attr('id'); 5631 5632 if (!id) { 5633 id = Util.getUID(NAME$2); 5634 $__default["default"](config.target).attr('id', id); 5635 } 5636 5637 config.target = "#" + id; 5638 } 5639 5640 Util.typeCheckConfig(NAME$2, config, DefaultType$1); 5641 return config; 5642 }; 5643 5644 _proto._getScrollTop = function _getScrollTop() { 5645 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 5646 }; 5647 5648 _proto._getScrollHeight = function _getScrollHeight() { 5649 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 5650 }; 5651 5652 _proto._getOffsetHeight = function _getOffsetHeight() { 5653 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 5654 }; 5655 5656 _proto._process = function _process() { 5657 var scrollTop = this._getScrollTop() + this._config.offset; 5658 5659 var scrollHeight = this._getScrollHeight(); 5660 5661 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 5662 5663 if (this._scrollHeight !== scrollHeight) { 5664 this.refresh(); 5665 } 5666 5667 if (scrollTop >= maxScroll) { 5668 var target = this._targets[this._targets.length - 1]; 5669 5670 if (this._activeTarget !== target) { 5671 this._activate(target); 5672 } 5673 5674 return; 5675 } 5676 5677 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 5678 this._activeTarget = null; 5679 5680 this._clear(); 5681 5682 return; 5683 } 5684 5685 for (var i = this._offsets.length; i--;) { 5686 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 5687 5688 if (isActiveTarget) { 5689 this._activate(this._targets[i]); 5690 } 5691 } 5692 }; 5693 5694 _proto._activate = function _activate(target) { 5695 this._activeTarget = target; 5696 5697 this._clear(); 5698 5699 var queries = this._selector.split(',').map(function (selector) { 5700 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 5701 }); 5702 5703 var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); 5704 5705 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 5706 $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); 5707 $link.addClass(CLASS_NAME_ACTIVE$1); 5708 } else { 5709 // Set triggered link as active 5710 $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active 5711 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 5712 5713 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item 5714 5715 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1); 5716 } 5717 5718 $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, { 5719 relatedTarget: target 5720 }); 5721 }; 5722 5723 _proto._clear = function _clear() { 5724 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 5725 return node.classList.contains(CLASS_NAME_ACTIVE$1); 5726 }).forEach(function (node) { 5727 return node.classList.remove(CLASS_NAME_ACTIVE$1); 5728 }); 5729 } // Static 5730 ; 5731 5732 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 5733 return this.each(function () { 5734 var data = $__default["default"](this).data(DATA_KEY$2); 5735 5736 var _config = typeof config === 'object' && config; 5737 5738 if (!data) { 5739 data = new ScrollSpy(this, _config); 5740 $__default["default"](this).data(DATA_KEY$2, data); 5741 } 5742 5743 if (typeof config === 'string') { 5744 if (typeof data[config] === 'undefined') { 5745 throw new TypeError("No method named \"" + config + "\""); 5746 } 5747 5748 data[config](); 5749 } 5750 }); 5751 }; 5752 5753 _createClass(ScrollSpy, null, [{ 5754 key: "VERSION", 5755 get: function get() { 5756 return VERSION$2; 5757 } 5758 }, { 5759 key: "Default", 5760 get: function get() { 5761 return Default$1; 5762 } 5763 }]); 5764 5765 return ScrollSpy; 5766 }(); 5767 /** 5768 * Data API implementation 5769 */ 5770 5771 5772 $__default["default"](window).on(EVENT_LOAD_DATA_API, function () { 5773 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 5774 var scrollSpysLength = scrollSpys.length; 5775 5776 for (var i = scrollSpysLength; i--;) { 5777 var $spy = $__default["default"](scrollSpys[i]); 5778 5779 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 5780 } 5781 }); 5782 /** 5783 * jQuery 5784 */ 5785 5786 $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface; 5787 $__default["default"].fn[NAME$2].Constructor = ScrollSpy; 5788 5789 $__default["default"].fn[NAME$2].noConflict = function () { 5790 $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 5791 return ScrollSpy._jQueryInterface; 5792 }; 5793 5794 /** 5795 * Constants 5796 */ 5797 5798 var NAME$1 = 'tab'; 5799 var VERSION$1 = '4.6.2'; 5800 var DATA_KEY$1 = 'bs.tab'; 5801 var EVENT_KEY$1 = "." + DATA_KEY$1; 5802 var DATA_API_KEY = '.data-api'; 5803 var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1]; 5804 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 5805 var CLASS_NAME_ACTIVE = 'active'; 5806 var CLASS_NAME_DISABLED = 'disabled'; 5807 var CLASS_NAME_FADE$1 = 'fade'; 5808 var CLASS_NAME_SHOW$1 = 'show'; 5809 var EVENT_HIDE$1 = "hide" + EVENT_KEY$1; 5810 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1; 5811 var EVENT_SHOW$1 = "show" + EVENT_KEY$1; 5812 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1; 5813 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY; 5814 var SELECTOR_DROPDOWN = '.dropdown'; 5815 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 5816 var SELECTOR_ACTIVE = '.active'; 5817 var SELECTOR_ACTIVE_UL = '> li > .active'; 5818 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 5819 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 5820 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 5821 /** 5822 * Class definition 5823 */ 5824 5825 var Tab = /*#__PURE__*/function () { 5826 function Tab(element) { 5827 this._element = element; 5828 } // Getters 5829 5830 5831 var _proto = Tab.prototype; 5832 5833 // Public 5834 _proto.show = function show() { 5835 var _this = this; 5836 5837 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) { 5838 return; 5839 } 5840 5841 var target; 5842 var previous; 5843 var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 5844 var selector = Util.getSelectorFromElement(this._element); 5845 5846 if (listElement) { 5847 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 5848 previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector)); 5849 previous = previous[previous.length - 1]; 5850 } 5851 5852 var hideEvent = $__default["default"].Event(EVENT_HIDE$1, { 5853 relatedTarget: this._element 5854 }); 5855 var showEvent = $__default["default"].Event(EVENT_SHOW$1, { 5856 relatedTarget: previous 5857 }); 5858 5859 if (previous) { 5860 $__default["default"](previous).trigger(hideEvent); 5861 } 5862 5863 $__default["default"](this._element).trigger(showEvent); 5864 5865 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 5866 return; 5867 } 5868 5869 if (selector) { 5870 target = document.querySelector(selector); 5871 } 5872 5873 this._activate(this._element, listElement); 5874 5875 var complete = function complete() { 5876 var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, { 5877 relatedTarget: _this._element 5878 }); 5879 var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, { 5880 relatedTarget: previous 5881 }); 5882 $__default["default"](previous).trigger(hiddenEvent); 5883 $__default["default"](_this._element).trigger(shownEvent); 5884 }; 5885 5886 if (target) { 5887 this._activate(target, target.parentNode, complete); 5888 } else { 5889 complete(); 5890 } 5891 }; 5892 5893 _proto.dispose = function dispose() { 5894 $__default["default"].removeData(this._element, DATA_KEY$1); 5895 this._element = null; 5896 } // Private 5897 ; 5898 5899 _proto._activate = function _activate(element, container, callback) { 5900 var _this2 = this; 5901 5902 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE); 5903 var active = activeElements[0]; 5904 var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1); 5905 5906 var complete = function complete() { 5907 return _this2._transitionComplete(element, active, callback); 5908 }; 5909 5910 if (active && isTransitioning) { 5911 var transitionDuration = Util.getTransitionDurationFromElement(active); 5912 $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5913 } else { 5914 complete(); 5915 } 5916 }; 5917 5918 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 5919 if (active) { 5920 $__default["default"](active).removeClass(CLASS_NAME_ACTIVE); 5921 var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 5922 5923 if (dropdownChild) { 5924 $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE); 5925 } 5926 5927 if (active.getAttribute('role') === 'tab') { 5928 active.setAttribute('aria-selected', false); 5929 } 5930 } 5931 5932 $__default["default"](element).addClass(CLASS_NAME_ACTIVE); 5933 5934 if (element.getAttribute('role') === 'tab') { 5935 element.setAttribute('aria-selected', true); 5936 } 5937 5938 Util.reflow(element); 5939 5940 if (element.classList.contains(CLASS_NAME_FADE$1)) { 5941 element.classList.add(CLASS_NAME_SHOW$1); 5942 } 5943 5944 var parent = element.parentNode; 5945 5946 if (parent && parent.nodeName === 'LI') { 5947 parent = parent.parentNode; 5948 } 5949 5950 if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 5951 var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0]; 5952 5953 if (dropdownElement) { 5954 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 5955 $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 5956 } 5957 5958 element.setAttribute('aria-expanded', true); 5959 } 5960 5961 if (callback) { 5962 callback(); 5963 } 5964 } // Static 5965 ; 5966 5967 Tab._jQueryInterface = function _jQueryInterface(config) { 5968 return this.each(function () { 5969 var $this = $__default["default"](this); 5970 var data = $this.data(DATA_KEY$1); 5971 5972 if (!data) { 5973 data = new Tab(this); 5974 $this.data(DATA_KEY$1, data); 5975 } 5976 5977 if (typeof config === 'string') { 5978 if (typeof data[config] === 'undefined') { 5979 throw new TypeError("No method named \"" + config + "\""); 5980 } 5981 5982 data[config](); 5983 } 5984 }); 5985 }; 5986 5987 _createClass(Tab, null, [{ 5988 key: "VERSION", 5989 get: function get() { 5990 return VERSION$1; 5991 } 5992 }]); 5993 5994 return Tab; 5995 }(); 5996 /** 5997 * Data API implementation 5998 */ 5999 6000 6001 $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 6002 event.preventDefault(); 6003 6004 Tab._jQueryInterface.call($__default["default"](this), 'show'); 6005 }); 6006 /** 6007 * jQuery 6008 */ 6009 6010 $__default["default"].fn[NAME$1] = Tab._jQueryInterface; 6011 $__default["default"].fn[NAME$1].Constructor = Tab; 6012 6013 $__default["default"].fn[NAME$1].noConflict = function () { 6014 $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 6015 return Tab._jQueryInterface; 6016 }; 6017 6018 /** 6019 * Constants 6020 */ 6021 6022 var NAME = 'toast'; 6023 var VERSION = '4.6.2'; 6024 var DATA_KEY = 'bs.toast'; 6025 var EVENT_KEY = "." + DATA_KEY; 6026 var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME]; 6027 var CLASS_NAME_FADE = 'fade'; 6028 var CLASS_NAME_HIDE = 'hide'; 6029 var CLASS_NAME_SHOW = 'show'; 6030 var CLASS_NAME_SHOWING = 'showing'; 6031 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY; 6032 var EVENT_HIDE = "hide" + EVENT_KEY; 6033 var EVENT_HIDDEN = "hidden" + EVENT_KEY; 6034 var EVENT_SHOW = "show" + EVENT_KEY; 6035 var EVENT_SHOWN = "shown" + EVENT_KEY; 6036 var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; 6037 var Default = { 6038 animation: true, 6039 autohide: true, 6040 delay: 500 6041 }; 6042 var DefaultType = { 6043 animation: 'boolean', 6044 autohide: 'boolean', 6045 delay: 'number' 6046 }; 6047 /** 6048 * Class definition 6049 */ 6050 6051 var Toast = /*#__PURE__*/function () { 6052 function Toast(element, config) { 6053 this._element = element; 6054 this._config = this._getConfig(config); 6055 this._timeout = null; 6056 6057 this._setListeners(); 6058 } // Getters 6059 6060 6061 var _proto = Toast.prototype; 6062 6063 // Public 6064 _proto.show = function show() { 6065 var _this = this; 6066 6067 var showEvent = $__default["default"].Event(EVENT_SHOW); 6068 $__default["default"](this._element).trigger(showEvent); 6069 6070 if (showEvent.isDefaultPrevented()) { 6071 return; 6072 } 6073 6074 this._clearTimeout(); 6075 6076 if (this._config.animation) { 6077 this._element.classList.add(CLASS_NAME_FADE); 6078 } 6079 6080 var complete = function complete() { 6081 _this._element.classList.remove(CLASS_NAME_SHOWING); 6082 6083 _this._element.classList.add(CLASS_NAME_SHOW); 6084 6085 $__default["default"](_this._element).trigger(EVENT_SHOWN); 6086 6087 if (_this._config.autohide) { 6088 _this._timeout = setTimeout(function () { 6089 _this.hide(); 6090 }, _this._config.delay); 6091 } 6092 }; 6093 6094 this._element.classList.remove(CLASS_NAME_HIDE); 6095 6096 Util.reflow(this._element); 6097 6098 this._element.classList.add(CLASS_NAME_SHOWING); 6099 6100 if (this._config.animation) { 6101 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6102 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6103 } else { 6104 complete(); 6105 } 6106 }; 6107 6108 _proto.hide = function hide() { 6109 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 6110 return; 6111 } 6112 6113 var hideEvent = $__default["default"].Event(EVENT_HIDE); 6114 $__default["default"](this._element).trigger(hideEvent); 6115 6116 if (hideEvent.isDefaultPrevented()) { 6117 return; 6118 } 6119 6120 this._close(); 6121 }; 6122 6123 _proto.dispose = function dispose() { 6124 this._clearTimeout(); 6125 6126 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 6127 this._element.classList.remove(CLASS_NAME_SHOW); 6128 } 6129 6130 $__default["default"](this._element).off(EVENT_CLICK_DISMISS); 6131 $__default["default"].removeData(this._element, DATA_KEY); 6132 this._element = null; 6133 this._config = null; 6134 } // Private 6135 ; 6136 6137 _proto._getConfig = function _getConfig(config) { 6138 config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {}); 6139 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 6140 return config; 6141 }; 6142 6143 _proto._setListeners = function _setListeners() { 6144 var _this2 = this; 6145 6146 $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () { 6147 return _this2.hide(); 6148 }); 6149 }; 6150 6151 _proto._close = function _close() { 6152 var _this3 = this; 6153 6154 var complete = function complete() { 6155 _this3._element.classList.add(CLASS_NAME_HIDE); 6156 6157 $__default["default"](_this3._element).trigger(EVENT_HIDDEN); 6158 }; 6159 6160 this._element.classList.remove(CLASS_NAME_SHOW); 6161 6162 if (this._config.animation) { 6163 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6164 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6165 } else { 6166 complete(); 6167 } 6168 }; 6169 6170 _proto._clearTimeout = function _clearTimeout() { 6171 clearTimeout(this._timeout); 6172 this._timeout = null; 6173 } // Static 6174 ; 6175 6176 Toast._jQueryInterface = function _jQueryInterface(config) { 6177 return this.each(function () { 6178 var $element = $__default["default"](this); 6179 var data = $element.data(DATA_KEY); 6180 6181 var _config = typeof config === 'object' && config; 6182 6183 if (!data) { 6184 data = new Toast(this, _config); 6185 $element.data(DATA_KEY, data); 6186 } 6187 6188 if (typeof config === 'string') { 6189 if (typeof data[config] === 'undefined') { 6190 throw new TypeError("No method named \"" + config + "\""); 6191 } 6192 6193 data[config](this); 6194 } 6195 }); 6196 }; 6197 6198 _createClass(Toast, null, [{ 6199 key: "VERSION", 6200 get: function get() { 6201 return VERSION; 6202 } 6203 }, { 6204 key: "DefaultType", 6205 get: function get() { 6206 return DefaultType; 6207 } 6208 }, { 6209 key: "Default", 6210 get: function get() { 6211 return Default; 6212 } 6213 }]); 6214 6215 return Toast; 6216 }(); 6217 /** 6218 * jQuery 6219 */ 6220 6221 6222 $__default["default"].fn[NAME] = Toast._jQueryInterface; 6223 $__default["default"].fn[NAME].Constructor = Toast; 6224 6225 $__default["default"].fn[NAME].noConflict = function () { 6226 $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT; 6227 return Toast._jQueryInterface; 6228 }; 6229 6230 exports.Alert = Alert; 6231 exports.Button = Button; 6232 exports.Carousel = Carousel; 6233 exports.Collapse = Collapse; 6234 exports.Dropdown = Dropdown; 6235 exports.Modal = Modal; 6236 exports.Popover = Popover; 6237 exports.Scrollspy = ScrollSpy; 6238 exports.Tab = Tab; 6239 exports.Toast = Toast; 6240 exports.Tooltip = Tooltip; 6241 exports.Util = Util; 6242 6243 Object.defineProperty(exports, '__esModule', { value: true }); 6244 6245})); 6246//# sourceMappingURL=bootstrap.js.map 6247 6248 6249/***/ }), 6250
vendor: 272,192 bytes, lines 6251-16625
6251/***/ "./node_modules/jquery/dist/jquery.js": 6252/*!********************************************!*\ 6253 !*** ./node_modules/jquery/dist/jquery.js ***! 6254 \********************************************/ 6255/***/ (function(module, exports) { 6256 6257var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 6258 * jQuery JavaScript Library v3.3.1 6259 * https://jquery.com/ 6260 * 6261 * Includes Sizzle.js 6262 * https://sizzlejs.com/ 6263 * 6264 * Copyright JS Foundation and other contributors 6265 * Released under the MIT license 6266 * https://jquery.org/license 6267 * 6268 * Date: 2018-01-20T17:24Z 6269 */ 6270( function( global, factory ) { 6271 6272 "use strict"; 6273 6274 if ( true && typeof module.exports === "object" ) { 6275 6276 // For CommonJS and CommonJS-like environments where a proper `window` 6277 // is present, execute the factory and get jQuery. 6278 // For environments that do not have a `window` with a `document` 6279 // (such as Node.js), expose a factory as module.exports. 6280 // This accentuates the need for the creation of a real `window`. 6281 // e.g. var jQuery = require("jquery")(window); 6282 // See ticket #14549 for more info. 6283 module.exports = global.document ? 6284 factory( global, true ) : 6285 function( w ) { 6286 if ( !w.document ) { 6287 throw new Error( "jQuery requires a window with a document" ); 6288 } 6289 return factory( w ); 6290 }; 6291 } else { 6292 factory( global ); 6293 } 6294 6295// Pass this if window is not defined yet 6296} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 6297 6298// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 6299// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 6300// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 6301// enough that all such attempts are guarded in a try block. 6302"use strict"; 6303 6304var arr = []; 6305 6306var document = window.document; 6307 6308var getProto = Object.getPrototypeOf; 6309 6310var slice = arr.slice; 6311 6312var concat = arr.concat; 6313 6314var push = arr.push; 6315 6316var indexOf = arr.indexOf; 6317 6318var class2type = {}; 6319 6320var toString = class2type.toString; 6321 6322var hasOwn = class2type.hasOwnProperty; 6323 6324var fnToString = hasOwn.toString; 6325 6326var ObjectFunctionString = fnToString.call( Object ); 6327 6328var support = {}; 6329 6330var isFunction = function isFunction( obj ) { 6331 6332 // Support: Chrome <=57, Firefox <=52 6333 // In some browsers, typeof returns "function" for HTML <object> elements 6334 // (i.e., `typeof document.createElement( "object" ) === "function"`). 6335 // We don't want to classify *any* DOM node as a function. 6336 return typeof obj === "function" && typeof obj.nodeType !== "number"; 6337 }; 6338 6339 6340var isWindow = function isWindow( obj ) { 6341 return obj != null && obj === obj.window; 6342 }; 6343 6344 6345 6346 6347 var preservedScriptAttributes = { 6348 type: true, 6349 src: true, 6350 noModule: true 6351 }; 6352 6353 function DOMEval( code, doc, node ) { 6354 doc = doc || document; 6355 6356 var i, 6357 script = doc.createElement( "script" ); 6358 6359 script.text = code; 6360 if ( node ) { 6361 for ( i in preservedScriptAttributes ) { 6362 if ( node[ i ] ) { 6363 script[ i ] = node[ i ]; 6364 } 6365 } 6366 } 6367 doc.head.appendChild( script ).parentNode.removeChild( script ); 6368 } 6369 6370 6371function toType( obj ) { 6372 if ( obj == null ) { 6373 return obj + ""; 6374 } 6375 6376 // Support: Android <=2.3 only (functionish RegExp) 6377 return typeof obj === "object" || typeof obj === "function" ? 6378 class2type[ toString.call( obj ) ] || "object" : 6379 typeof obj; 6380} 6381/* global Symbol */ 6382// Defining this global in .eslintrc.json would create a danger of using the global 6383// unguarded in another place, it seems safer to define global only for this module 6384 6385 6386 6387var 6388 version = "3.3.1", 6389 6390 // Define a local copy of jQuery 6391 jQuery = function( selector, context ) { 6392 6393 // The jQuery object is actually just the init constructor 'enhanced' 6394 // Need init if jQuery is called (just allow error to be thrown if not included) 6395 return new jQuery.fn.init( selector, context ); 6396 }, 6397 6398 // Support: Android <=4.0 only 6399 // Make sure we trim BOM and NBSP 6400 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 6401 6402jQuery.fn = jQuery.prototype = { 6403 6404 // The current version of jQuery being used 6405 jquery: version, 6406 6407 constructor: jQuery, 6408 6409 // The default length of a jQuery object is 0 6410 length: 0, 6411 6412 toArray: function() { 6413 return slice.call( this ); 6414 }, 6415 6416 // Get the Nth element in the matched element set OR 6417 // Get the whole matched element set as a clean array 6418 get: function( num ) { 6419 6420 // Return all the elements in a clean array 6421 if ( num == null ) { 6422 return slice.call( this ); 6423 } 6424 6425 // Return just the one element from the set 6426 return num < 0 ? this[ num + this.length ] : this[ num ]; 6427 }, 6428 6429 // Take an array of elements and push it onto the stack 6430 // (returning the new matched element set) 6431 pushStack: function( elems ) { 6432 6433 // Build a new jQuery matched element set 6434 var ret = jQuery.merge( this.constructor(), elems ); 6435 6436 // Add the old object onto the stack (as a reference) 6437 ret.prevObject = this; 6438 6439 // Return the newly-formed element set 6440 return ret; 6441 }, 6442 6443 // Execute a callback for every element in the matched set. 6444 each: function( callback ) { 6445 return jQuery.each( this, callback ); 6446 }, 6447 6448 map: function( callback ) { 6449 return this.pushStack( jQuery.map( this, function( elem, i ) { 6450 return callback.call( elem, i, elem ); 6451 } ) ); 6452 }, 6453 6454 slice: function() { 6455 return this.pushStack( slice.apply( this, arguments ) ); 6456 }, 6457 6458 first: function() { 6459 return this.eq( 0 ); 6460 }, 6461 6462 last: function() { 6463 return this.eq( -1 ); 6464 }, 6465 6466 eq: function( i ) { 6467 var len = this.length, 6468 j = +i + ( i < 0 ? len : 0 ); 6469 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 6470 }, 6471 6472 end: function() { 6473 return this.prevObject || this.constructor(); 6474 }, 6475 6476 // For internal use only. 6477 // Behaves like an Array's method, not like a jQuery method. 6478 push: push, 6479 sort: arr.sort, 6480 splice: arr.splice 6481}; 6482 6483jQuery.extend = jQuery.fn.extend = function() { 6484 var options, name, src, copy, copyIsArray, clone, 6485 target = arguments[ 0 ] || {}, 6486 i = 1, 6487 length = arguments.length, 6488 deep = false; 6489 6490 // Handle a deep copy situation 6491 if ( typeof target === "boolean" ) { 6492 deep = target; 6493 6494 // Skip the boolean and the target 6495 target = arguments[ i ] || {}; 6496 i++; 6497 } 6498 6499 // Handle case when target is a string or something (possible in deep copy) 6500 if ( typeof target !== "object" && !isFunction( target ) ) { 6501 target = {}; 6502 } 6503 6504 // Extend jQuery itself if only one argument is passed 6505 if ( i === length ) { 6506 target = this; 6507 i--; 6508 } 6509 6510 for ( ; i < length; i++ ) { 6511 6512 // Only deal with non-null/undefined values 6513 if ( ( options = arguments[ i ] ) != null ) { 6514 6515 // Extend the base object 6516 for ( name in options ) { 6517 src = target[ name ]; 6518 copy = options[ name ]; 6519 6520 // Prevent never-ending loop 6521 if ( target === copy ) { 6522 continue; 6523 } 6524 6525 // Recurse if we're merging plain objects or arrays 6526 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 6527 ( copyIsArray = Array.isArray( copy ) ) ) ) { 6528 6529 if ( copyIsArray ) { 6530 copyIsArray = false; 6531 clone = src && Array.isArray( src ) ? src : []; 6532 6533 } else { 6534 clone = src && jQuery.isPlainObject( src ) ? src : {}; 6535 } 6536 6537 // Never move original objects, clone them 6538 target[ name ] = jQuery.extend( deep, clone, copy ); 6539 6540 // Don't bring in undefined values 6541 } else if ( copy !== undefined ) { 6542 target[ name ] = copy; 6543 } 6544 } 6545 } 6546 } 6547 6548 // Return the modified object 6549 return target; 6550}; 6551 6552jQuery.extend( { 6553 6554 // Unique for each copy of jQuery on the page 6555 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 6556 6557 // Assume jQuery is ready without the ready module 6558 isReady: true, 6559 6560 error: function( msg ) { 6561 throw new Error( msg ); 6562 }, 6563 6564 noop: function() {}, 6565 6566 isPlainObject: function( obj ) { 6567 var proto, Ctor; 6568 6569 // Detect obvious negatives 6570 // Use toString instead of jQuery.type to catch host objects 6571 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 6572 return false; 6573 } 6574 6575 proto = getProto( obj ); 6576 6577 // Objects with no prototype (e.g., `Object.create( null )`) are plain 6578 if ( !proto ) { 6579 return true; 6580 } 6581 6582 // Objects with prototype are plain iff they were constructed by a global Object function 6583 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 6584 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 6585 }, 6586 6587 isEmptyObject: function( obj ) { 6588 6589 /* eslint-disable no-unused-vars */ 6590 // See https://github.com/eslint/eslint/issues/6125 6591 var name; 6592 6593 for ( name in obj ) { 6594 return false; 6595 } 6596 return true; 6597 }, 6598 6599 // Evaluates a script in a global context 6600 globalEval: function( code ) { 6601 DOMEval( code ); 6602 }, 6603 6604 each: function( obj, callback ) { 6605 var length, i = 0; 6606 6607 if ( isArrayLike( obj ) ) { 6608 length = obj.length; 6609 for ( ; i < length; i++ ) { 6610 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 6611 break; 6612 } 6613 } 6614 } else { 6615 for ( i in obj ) { 6616 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 6617 break; 6618 } 6619 } 6620 } 6621 6622 return obj; 6623 }, 6624 6625 // Support: Android <=4.0 only 6626 trim: function( text ) { 6627 return text == null ? 6628 "" : 6629 ( text + "" ).replace( rtrim, "" ); 6630 }, 6631 6632 // results is for internal usage only 6633 makeArray: function( arr, results ) { 6634 var ret = results || []; 6635 6636 if ( arr != null ) { 6637 if ( isArrayLike( Object( arr ) ) ) { 6638 jQuery.merge( ret, 6639 typeof arr === "string" ? 6640 [ arr ] : arr 6641 ); 6642 } else { 6643 push.call( ret, arr ); 6644 } 6645 } 6646 6647 return ret; 6648 }, 6649 6650 inArray: function( elem, arr, i ) { 6651 return arr == null ? -1 : indexOf.call( arr, elem, i ); 6652 }, 6653 6654 // Support: Android <=4.0 only, PhantomJS 1 only 6655 // push.apply(_, arraylike) throws on ancient WebKit 6656 merge: function( first, second ) { 6657 var len = +second.length, 6658 j = 0, 6659 i = first.length; 6660 6661 for ( ; j < len; j++ ) { 6662 first[ i++ ] = second[ j ]; 6663 } 6664 6665 first.length = i; 6666 6667 return first; 6668 }, 6669 6670 grep: function( elems, callback, invert ) { 6671 var callbackInverse, 6672 matches = [], 6673 i = 0, 6674 length = elems.length, 6675 callbackExpect = !invert; 6676 6677 // Go through the array, only saving the items 6678 // that pass the validator function 6679 for ( ; i < length; i++ ) { 6680 callbackInverse = !callback( elems[ i ], i ); 6681 if ( callbackInverse !== callbackExpect ) { 6682 matches.push( elems[ i ] ); 6683 } 6684 } 6685 6686 return matches; 6687 }, 6688 6689 // arg is for internal usage only 6690 map: function( elems, callback, arg ) { 6691 var length, value, 6692 i = 0, 6693 ret = []; 6694 6695 // Go through the array, translating each of the items to their new values 6696 if ( isArrayLike( elems ) ) { 6697 length = elems.length; 6698 for ( ; i < length; i++ ) { 6699 value = callback( elems[ i ], i, arg ); 6700 6701 if ( value != null ) { 6702 ret.push( value ); 6703 } 6704 } 6705 6706 // Go through every key on the object, 6707 } else { 6708 for ( i in elems ) { 6709 value = callback( elems[ i ], i, arg ); 6710 6711 if ( value != null ) { 6712 ret.push( value ); 6713 } 6714 } 6715 } 6716 6717 // Flatten any nested arrays 6718 return concat.apply( [], ret ); 6719 }, 6720 6721 // A global GUID counter for objects 6722 guid: 1, 6723 6724 // jQuery.support is not used in Core but other projects attach their 6725 // properties to it so it needs to exist. 6726 support: support 6727} ); 6728 6729if ( typeof Symbol === "function" ) { 6730 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 6731} 6732 6733// Populate the class2type map 6734jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 6735function( i, name ) { 6736 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 6737} ); 6738 6739function isArrayLike( obj ) { 6740 6741 // Support: real iOS 8.2 only (not reproducible in simulator) 6742 // `in` check used to prevent JIT error (gh-2145) 6743 // hasOwn isn't used here due to false negatives 6744 // regarding Nodelist length in IE 6745 var length = !!obj && "length" in obj && obj.length, 6746 type = toType( obj ); 6747 6748 if ( isFunction( obj ) || isWindow( obj ) ) { 6749 return false; 6750 } 6751 6752 return type === "array" || length === 0 || 6753 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 6754} 6755var Sizzle = 6756/*! 6757 * Sizzle CSS Selector Engine v2.3.3 6758 * https://sizzlejs.com/ 6759 * 6760 * Copyright jQuery Foundation and other contributors 6761 * Released under the MIT license 6762 * http://jquery.org/license 6763 * 6764 * Date: 2016-08-08 6765 */ 6766(function( window ) { 6767 6768var i, 6769 support, 6770 Expr, 6771 getText, 6772 isXML, 6773 tokenize, 6774 compile, 6775 select, 6776 outermostContext, 6777 sortInput, 6778 hasDuplicate, 6779 6780 // Local document vars 6781 setDocument, 6782 document, 6783 docElem, 6784 documentIsHTML, 6785 rbuggyQSA, 6786 rbuggyMatches, 6787 matches, 6788 contains, 6789 6790 // Instance-specific data 6791 expando = "sizzle" + 1 * new Date(), 6792 preferredDoc = window.document, 6793 dirruns = 0, 6794 done = 0, 6795 classCache = createCache(), 6796 tokenCache = createCache(), 6797 compilerCache = createCache(), 6798 sortOrder = function( a, b ) { 6799 if ( a === b ) { 6800 hasDuplicate = true; 6801 } 6802 return 0; 6803 }, 6804 6805 // Instance methods 6806 hasOwn = ({}).hasOwnProperty, 6807 arr = [], 6808 pop = arr.pop, 6809 push_native = arr.push, 6810 push = arr.push, 6811 slice = arr.slice, 6812 // Use a stripped-down indexOf as it's faster than native 6813 // https://jsperf.com/thor-indexof-vs-for/5 6814 indexOf = function( list, elem ) { 6815 var i = 0, 6816 len = list.length; 6817 for ( ; i < len; i++ ) { 6818 if ( list[i] === elem ) { 6819 return i; 6820 } 6821 } 6822 return -1; 6823 }, 6824 6825 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 6826 6827 // Regular expressions 6828 6829 // http://www.w3.org/TR/css3-selectors/#whitespace 6830 whitespace = "[\\x20\\t\\r\\n\\f]", 6831 6832 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 6833 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", 6834 6835 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 6836 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 6837 // Operator (capture 2) 6838 "*([*^$|!~]?=)" + whitespace + 6839 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 6840 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 6841 "*\\]", 6842 6843 pseudos = ":(" + identifier + ")(?:\\((" + 6844 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 6845 // 1. quoted (capture 3; capture 4 or capture 5) 6846 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 6847 // 2. simple (capture 6) 6848 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 6849 // 3. anything else (capture 2) 6850 ".*" + 6851 ")\\)|)", 6852 6853 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 6854 rwhitespace = new RegExp( whitespace + "+", "g" ), 6855 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 6856 6857 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 6858 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 6859 6860 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 6861 6862 rpseudo = new RegExp( pseudos ), 6863 ridentifier = new RegExp( "^" + identifier + "$" ), 6864 6865 matchExpr = { 6866 "ID": new RegExp( "^#(" + identifier + ")" ), 6867 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 6868 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 6869 "ATTR": new RegExp( "^" + attributes ), 6870 "PSEUDO": new RegExp( "^" + pseudos ), 6871 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 6872 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 6873 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 6874 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 6875 // For use in libraries implementing .is() 6876 // We use this for POS matching in `select` 6877 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 6878 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 6879 }, 6880 6881 rinputs = /^(?:input|select|textarea|button)$/i, 6882 rheader = /^h\d$/i, 6883 6884 rnative = /^[^{]+\{\s*\[native \w/, 6885 6886 // Easily-parseable/retrievable ID or TAG or CLASS selectors 6887 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 6888 6889 rsibling = /[+~]/, 6890 6891 // CSS escapes 6892 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 6893 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 6894 funescape = function( _, escaped, escapedWhitespace ) { 6895 var high = "0x" + escaped - 0x10000; 6896 // NaN means non-codepoint 6897 // Support: Firefox<24 6898 // Workaround erroneous numeric interpretation of +"0x" 6899 return high !== high || escapedWhitespace ? 6900 escaped : 6901 high < 0 ? 6902 // BMP codepoint 6903 String.fromCharCode( high + 0x10000 ) : 6904 // Supplemental Plane codepoint (surrogate pair) 6905 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 6906 }, 6907 6908 // CSS string/identifier serialization 6909 // https://drafts.csswg.org/cssom/#common-serializing-idioms 6910 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 6911 fcssescape = function( ch, asCodePoint ) { 6912 if ( asCodePoint ) { 6913 6914 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 6915 if ( ch === "\0" ) { 6916 return "\uFFFD"; 6917 } 6918 6919 // Control characters and (dependent upon position) numbers get escaped as code points 6920 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 6921 } 6922 6923 // Other potentially-special ASCII characters get backslash-escaped 6924 return "\\" + ch; 6925 }, 6926 6927 // Used for iframes 6928 // See setDocument() 6929 // Removing the function wrapper causes a "Permission Denied" 6930 // error in IE 6931 unloadHandler = function() { 6932 setDocument(); 6933 }, 6934 6935 disabledAncestor = addCombinator( 6936 function( elem ) { 6937 return elem.disabled === true && ("form" in elem || "label" in elem); 6938 }, 6939 { dir: "parentNode", next: "legend" } 6940 ); 6941 6942// Optimize for push.apply( _, NodeList ) 6943try { 6944 push.apply( 6945 (arr = slice.call( preferredDoc.childNodes )), 6946 preferredDoc.childNodes 6947 ); 6948 // Support: Android<4.0 6949 // Detect silently failing push.apply 6950 arr[ preferredDoc.childNodes.length ].nodeType; 6951} catch ( e ) { 6952 push = { apply: arr.length ? 6953 6954 // Leverage slice if possible 6955 function( target, els ) { 6956 push_native.apply( target, slice.call(els) ); 6957 } : 6958 6959 // Support: IE<9 6960 // Otherwise append directly 6961 function( target, els ) { 6962 var j = target.length, 6963 i = 0; 6964 // Can't trust NodeList.length 6965 while ( (target[j++] = els[i++]) ) {} 6966 target.length = j - 1; 6967 } 6968 }; 6969} 6970 6971function Sizzle( selector, context, results, seed ) { 6972 var m, i, elem, nid, match, groups, newSelector, 6973 newContext = context && context.ownerDocument, 6974 6975 // nodeType defaults to 9, since context defaults to document 6976 nodeType = context ? context.nodeType : 9; 6977 6978 results = results || []; 6979 6980 // Return early from calls with invalid selector or context 6981 if ( typeof selector !== "string" || !selector || 6982 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 6983 6984 return results; 6985 } 6986 6987 // Try to shortcut find operations (as opposed to filters) in HTML documents 6988 if ( !seed ) { 6989 6990 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 6991 setDocument( context ); 6992 } 6993 context = context || document; 6994 6995 if ( documentIsHTML ) { 6996 6997 // If the selector is sufficiently simple, try using a "get*By*" DOM method 6998 // (excepting DocumentFragment context, where the methods don't exist) 6999 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 7000 7001 // ID selector 7002 if ( (m = match[1]) ) { 7003 7004 // Document context 7005 if ( nodeType === 9 ) { 7006 if ( (elem = context.getElementById( m )) ) { 7007 7008 // Support: IE, Opera, Webkit 7009 // TODO: identify versions 7010 // getElementById can match elements by name instead of ID 7011 if ( elem.id === m ) { 7012 results.push( elem ); 7013 return results; 7014 } 7015 } else { 7016 return results; 7017 } 7018 7019 // Element context 7020 } else { 7021 7022 // Support: IE, Opera, Webkit 7023 // TODO: identify versions 7024 // getElementById can match elements by name instead of ID 7025 if ( newContext && (elem = newContext.getElementById( m )) && 7026 contains( context, elem ) && 7027 elem.id === m ) { 7028 7029 results.push( elem ); 7030 return results; 7031 } 7032 } 7033 7034 // Type selector 7035 } else if ( match[2] ) { 7036 push.apply( results, context.getElementsByTagName( selector ) ); 7037 return results; 7038 7039 // Class selector 7040 } else if ( (m = match[3]) && support.getElementsByClassName && 7041 context.getElementsByClassName ) { 7042 7043 push.apply( results, context.getElementsByClassName( m ) ); 7044 return results; 7045 } 7046 } 7047 7048 // Take advantage of querySelectorAll 7049 if ( support.qsa && 7050 !compilerCache[ selector + " " ] && 7051 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 7052 7053 if ( nodeType !== 1 ) { 7054 newContext = context; 7055 newSelector = selector; 7056 7057 // qSA looks outside Element context, which is not what we want 7058 // Thanks to Andrew Dupont for this workaround technique 7059 // Support: IE <=8 7060 // Exclude object elements 7061 } else if ( context.nodeName.toLowerCase() !== "object" ) { 7062 7063 // Capture the context ID, setting it first if necessary 7064 if ( (nid = context.getAttribute( "id" )) ) { 7065 nid = nid.replace( rcssescape, fcssescape ); 7066 } else { 7067 context.setAttribute( "id", (nid = expando) ); 7068 } 7069 7070 // Prefix every selector in the list 7071 groups = tokenize( selector ); 7072 i = groups.length; 7073 while ( i-- ) { 7074 groups[i] = "#" + nid + " " + toSelector( groups[i] ); 7075 } 7076 newSelector = groups.join( "," ); 7077 7078 // Expand context for sibling selectors 7079 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 7080 context; 7081 } 7082 7083 if ( newSelector ) { 7084 try { 7085 push.apply( results, 7086 newContext.querySelectorAll( newSelector ) 7087 ); 7088 return results; 7089 } catch ( qsaError ) { 7090 } finally { 7091 if ( nid === expando ) { 7092 context.removeAttribute( "id" ); 7093 } 7094 } 7095 } 7096 } 7097 } 7098 } 7099 7100 // All others 7101 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 7102} 7103 7104/** 7105 * Create key-value caches of limited size 7106 * @returns {function(string, object)} Returns the Object data after storing it on itself with 7107 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 7108 * deleting the oldest entry 7109 */ 7110function createCache() { 7111 var keys = []; 7112 7113 function cache( key, value ) { 7114 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 7115 if ( keys.push( key + " " ) > Expr.cacheLength ) { 7116 // Only keep the most recent entries 7117 delete cache[ keys.shift() ]; 7118 } 7119 return (cache[ key + " " ] = value); 7120 } 7121 return cache; 7122} 7123 7124/** 7125 * Mark a function for special use by Sizzle 7126 * @param {Function} fn The function to mark 7127 */ 7128function markFunction( fn ) { 7129 fn[ expando ] = true; 7130 return fn; 7131} 7132 7133/** 7134 * Support testing using an element 7135 * @param {Function} fn Passed the created element and returns a boolean result 7136 */ 7137function assert( fn ) { 7138 var el = document.createElement("fieldset"); 7139 7140 try { 7141 return !!fn( el ); 7142 } catch (e) { 7143 return false; 7144 } finally { 7145 // Remove from its parent by default 7146 if ( el.parentNode ) { 7147 el.parentNode.removeChild( el ); 7148 } 7149 // release memory in IE 7150 el = null; 7151 } 7152} 7153 7154/** 7155 * Adds the same handler for all of the specified attrs 7156 * @param {String} attrs Pipe-separated list of attributes 7157 * @param {Function} handler The method that will be applied 7158 */ 7159function addHandle( attrs, handler ) { 7160 var arr = attrs.split("|"), 7161 i = arr.length; 7162 7163 while ( i-- ) { 7164 Expr.attrHandle[ arr[i] ] = handler; 7165 } 7166} 7167 7168/** 7169 * Checks document order of two siblings 7170 * @param {Element} a 7171 * @param {Element} b 7172 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 7173 */ 7174function siblingCheck( a, b ) { 7175 var cur = b && a, 7176 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 7177 a.sourceIndex - b.sourceIndex; 7178 7179 // Use IE sourceIndex if available on both nodes 7180 if ( diff ) { 7181 return diff; 7182 } 7183 7184 // Check if b follows a 7185 if ( cur ) { 7186 while ( (cur = cur.nextSibling) ) { 7187 if ( cur === b ) { 7188 return -1; 7189 } 7190 } 7191 } 7192 7193 return a ? 1 : -1; 7194} 7195 7196/** 7197 * Returns a function to use in pseudos for input types 7198 * @param {String} type 7199 */ 7200function createInputPseudo( type ) { 7201 return function( elem ) { 7202 var name = elem.nodeName.toLowerCase(); 7203 return name === "input" && elem.type === type; 7204 }; 7205} 7206 7207/** 7208 * Returns a function to use in pseudos for buttons 7209 * @param {String} type 7210 */ 7211function createButtonPseudo( type ) { 7212 return function( elem ) { 7213 var name = elem.nodeName.toLowerCase(); 7214 return (name === "input" || name === "button") && elem.type === type; 7215 }; 7216} 7217 7218/** 7219 * Returns a function to use in pseudos for :enabled/:disabled 7220 * @param {Boolean} disabled true for :disabled; false for :enabled 7221 */ 7222function createDisabledPseudo( disabled ) { 7223 7224 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 7225 return function( elem ) { 7226 7227 // Only certain elements can match :enabled or :disabled 7228 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 7229 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 7230 if ( "form" in elem ) { 7231 7232 // Check for inherited disabledness on relevant non-disabled elements: 7233 // * listed form-associated elements in a disabled fieldset 7234 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 7235 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 7236 // * option elements in a disabled optgroup 7237 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 7238 // All such elements have a "form" property. 7239 if ( elem.parentNode && elem.disabled === false ) { 7240 7241 // Option elements defer to a parent optgroup if present 7242 if ( "label" in elem ) { 7243 if ( "label" in elem.parentNode ) { 7244 return elem.parentNode.disabled === disabled; 7245 } else { 7246 return elem.disabled === disabled; 7247 } 7248 } 7249 7250 // Support: IE 6 - 11 7251 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 7252 return elem.isDisabled === disabled || 7253 7254 // Where there is no isDisabled, check manually 7255 /* jshint -W018 */ 7256 elem.isDisabled !== !disabled && 7257 disabledAncestor( elem ) === disabled; 7258 } 7259 7260 return elem.disabled === disabled; 7261 7262 // Try to winnow out elements that can't be disabled before trusting the disabled property. 7263 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 7264 // even exist on them, let alone have a boolean value. 7265 } else if ( "label" in elem ) { 7266 return elem.disabled === disabled; 7267 } 7268 7269 // Remaining elements are neither :enabled nor :disabled 7270 return false; 7271 }; 7272} 7273 7274/** 7275 * Returns a function to use in pseudos for positionals 7276 * @param {Function} fn 7277 */ 7278function createPositionalPseudo( fn ) { 7279 return markFunction(function( argument ) { 7280 argument = +argument; 7281 return markFunction(function( seed, matches ) { 7282 var j, 7283 matchIndexes = fn( [], seed.length, argument ), 7284 i = matchIndexes.length; 7285 7286 // Match elements found at the specified indexes 7287 while ( i-- ) { 7288 if ( seed[ (j = matchIndexes[i]) ] ) { 7289 seed[j] = !(matches[j] = seed[j]); 7290 } 7291 } 7292 }); 7293 }); 7294} 7295 7296/** 7297 * Checks a node for validity as a Sizzle context 7298 * @param {Element|Object=} context 7299 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 7300 */ 7301function testContext( context ) { 7302 return context && typeof context.getElementsByTagName !== "undefined" && context; 7303} 7304 7305// Expose support vars for convenience 7306support = Sizzle.support = {}; 7307 7308/** 7309 * Detects XML nodes 7310 * @param {Element|Object} elem An element or a document 7311 * @returns {Boolean} True iff elem is a non-HTML XML node 7312 */ 7313isXML = Sizzle.isXML = function( elem ) { 7314 // documentElement is verified for cases where it doesn't yet exist 7315 // (such as loading iframes in IE - #4833) 7316 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 7317 return documentElement ? documentElement.nodeName !== "HTML" : false; 7318}; 7319 7320/** 7321 * Sets document-related variables once based on the current document 7322 * @param {Element|Object} [doc] An element or document object to use to set the document 7323 * @returns {Object} Returns the current document 7324 */ 7325setDocument = Sizzle.setDocument = function( node ) { 7326 var hasCompare, subWindow, 7327 doc = node ? node.ownerDocument || node : preferredDoc; 7328 7329 // Return early if doc is invalid or already selected 7330 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 7331 return document; 7332 } 7333 7334 // Update global variables 7335 document = doc; 7336 docElem = document.documentElement; 7337 documentIsHTML = !isXML( document ); 7338 7339 // Support: IE 9-11, Edge 7340 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 7341 if ( preferredDoc !== document && 7342 (subWindow = document.defaultView) && subWindow.top !== subWindow ) { 7343 7344 // Support: IE 11, Edge 7345 if ( subWindow.addEventListener ) { 7346 subWindow.addEventListener( "unload", unloadHandler, false ); 7347 7348 // Support: IE 9 - 10 only 7349 } else if ( subWindow.attachEvent ) { 7350 subWindow.attachEvent( "onunload", unloadHandler ); 7351 } 7352 } 7353 7354 /* Attributes 7355 ---------------------------------------------------------------------- */ 7356 7357 // Support: IE<8 7358 // Verify that getAttribute really returns attributes and not properties 7359 // (excepting IE8 booleans) 7360 support.attributes = assert(function( el ) { 7361 el.className = "i"; 7362 return !el.getAttribute("className"); 7363 }); 7364 7365 /* getElement(s)By* 7366 ---------------------------------------------------------------------- */ 7367 7368 // Check if getElementsByTagName("*") returns only elements 7369 support.getElementsByTagName = assert(function( el ) { 7370 el.appendChild( document.createComment("") ); 7371 return !el.getElementsByTagName("*").length; 7372 }); 7373 7374 // Support: IE<9 7375 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 7376 7377 // Support: IE<10 7378 // Check if getElementById returns elements by name 7379 // The broken getElementById methods don't pick up programmatically-set names, 7380 // so use a roundabout getElementsByName test 7381 support.getById = assert(function( el ) { 7382 docElem.appendChild( el ).id = expando; 7383 return !document.getElementsByName || !document.getElementsByName( expando ).length; 7384 }); 7385 7386 // ID filter and find 7387 if ( support.getById ) { 7388 Expr.filter["ID"] = function( id ) { 7389 var attrId = id.replace( runescape, funescape ); 7390 return function( elem ) { 7391 return elem.getAttribute("id") === attrId; 7392 }; 7393 }; 7394 Expr.find["ID"] = function( id, context ) { 7395 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 7396 var elem = context.getElementById( id ); 7397 return elem ? [ elem ] : []; 7398 } 7399 }; 7400 } else { 7401 Expr.filter["ID"] = function( id ) { 7402 var attrId = id.replace( runescape, funescape ); 7403 return function( elem ) { 7404 var node = typeof elem.getAttributeNode !== "undefined" && 7405 elem.getAttributeNode("id"); 7406 return node && node.value === attrId; 7407 }; 7408 }; 7409 7410 // Support: IE 6 - 7 only 7411 // getElementById is not reliable as a find shortcut 7412 Expr.find["ID"] = function( id, context ) { 7413 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 7414 var node, i, elems, 7415 elem = context.getElementById( id ); 7416 7417 if ( elem ) { 7418 7419 // Verify the id attribute 7420 node = elem.getAttributeNode("id"); 7421 if ( node && node.value === id ) { 7422 return [ elem ]; 7423 } 7424 7425 // Fall back on getElementsByName 7426 elems = context.getElementsByName( id ); 7427 i = 0; 7428 while ( (elem = elems[i++]) ) { 7429 node = elem.getAttributeNode("id"); 7430 if ( node && node.value === id ) { 7431 return [ elem ]; 7432 } 7433 } 7434 } 7435 7436 return []; 7437 } 7438 }; 7439 } 7440 7441 // Tag 7442 Expr.find["TAG"] = support.getElementsByTagName ? 7443 function( tag, context ) { 7444 if ( typeof context.getElementsByTagName !== "undefined" ) { 7445 return context.getElementsByTagName( tag ); 7446 7447 // DocumentFragment nodes don't have gEBTN 7448 } else if ( support.qsa ) { 7449 return context.querySelectorAll( tag ); 7450 } 7451 } : 7452 7453 function( tag, context ) { 7454 var elem, 7455 tmp = [], 7456 i = 0, 7457 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 7458 results = context.getElementsByTagName( tag ); 7459 7460 // Filter out possible comments 7461 if ( tag === "*" ) { 7462 while ( (elem = results[i++]) ) { 7463 if ( elem.nodeType === 1 ) { 7464 tmp.push( elem ); 7465 } 7466 } 7467 7468 return tmp; 7469 } 7470 return results; 7471 }; 7472 7473 // Class 7474 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 7475 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 7476 return context.getElementsByClassName( className ); 7477 } 7478 }; 7479 7480 /* QSA/matchesSelector 7481 ---------------------------------------------------------------------- */ 7482 7483 // QSA and matchesSelector support 7484 7485 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 7486 rbuggyMatches = []; 7487 7488 // qSa(:focus) reports false when true (Chrome 21) 7489 // We allow this because of a bug in IE8/9 that throws an error 7490 // whenever `document.activeElement` is accessed on an iframe 7491 // So, we allow :focus to pass through QSA all the time to avoid the IE error 7492 // See https://bugs.jquery.com/ticket/13378 7493 rbuggyQSA = []; 7494 7495 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 7496 // Build QSA regex 7497 // Regex strategy adopted from Diego Perini 7498 assert(function( el ) { 7499 // Select is set to empty string on purpose 7500 // This is to test IE's treatment of not explicitly 7501 // setting a boolean content attribute, 7502 // since its presence should be enough 7503 // https://bugs.jquery.com/ticket/12359 7504 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 7505 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 7506 "<option selected=''></option></select>"; 7507 7508 // Support: IE8, Opera 11-12.16 7509 // Nothing should be selected when empty strings follow ^= or $= or *= 7510 // The test attribute must be unknown in Opera but "safe" for WinRT 7511 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 7512 if ( el.querySelectorAll("[msallowcapture^='']").length ) { 7513 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 7514 } 7515 7516 // Support: IE8 7517 // Boolean attributes and "value" are not treated correctly 7518 if ( !el.querySelectorAll("[selected]").length ) { 7519 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 7520 } 7521 7522 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 7523 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 7524 rbuggyQSA.push("~="); 7525 } 7526 7527 // Webkit/Opera - :checked should return selected option elements 7528 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 7529 // IE8 throws error here and will not see later tests 7530 if ( !el.querySelectorAll(":checked").length ) { 7531 rbuggyQSA.push(":checked"); 7532 } 7533 7534 // Support: Safari 8+, iOS 8+ 7535 // https://bugs.webkit.org/show_bug.cgi?id=136851 7536 // In-page `selector#id sibling-combinator selector` fails 7537 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 7538 rbuggyQSA.push(".#.+[+~]"); 7539 } 7540 }); 7541 7542 assert(function( el ) { 7543 el.innerHTML = "<a href='' disabled='disabled'></a>" + 7544 "<select disabled='disabled'><option/></select>"; 7545 7546 // Support: Windows 8 Native Apps 7547 // The type and name attributes are restricted during .innerHTML assignment 7548 var input = document.createElement("input"); 7549 input.setAttribute( "type", "hidden" ); 7550 el.appendChild( input ).setAttribute( "name", "D" ); 7551 7552 // Support: IE8 7553 // Enforce case-sensitivity of name attribute 7554 if ( el.querySelectorAll("[name=d]").length ) { 7555 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 7556 } 7557 7558 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 7559 // IE8 throws error here and will not see later tests 7560 if ( el.querySelectorAll(":enabled").length !== 2 ) { 7561 rbuggyQSA.push( ":enabled", ":disabled" ); 7562 } 7563 7564 // Support: IE9-11+ 7565 // IE's :disabled selector does not pick up the children of disabled fieldsets 7566 docElem.appendChild( el ).disabled = true; 7567 if ( el.querySelectorAll(":disabled").length !== 2 ) { 7568 rbuggyQSA.push( ":enabled", ":disabled" ); 7569 } 7570 7571 // Opera 10-11 does not throw on post-comma invalid pseudos 7572 el.querySelectorAll("*,:x"); 7573 rbuggyQSA.push(",.*:"); 7574 }); 7575 } 7576 7577 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 7578 docElem.webkitMatchesSelector || 7579 docElem.mozMatchesSelector || 7580 docElem.oMatchesSelector || 7581 docElem.msMatchesSelector) )) ) { 7582 7583 assert(function( el ) { 7584 // Check to see if it's possible to do matchesSelector 7585 // on a disconnected node (IE 9) 7586 support.disconnectedMatch = matches.call( el, "*" ); 7587 7588 // This should fail with an exception 7589 // Gecko does not error, returns false instead 7590 matches.call( el, "[s!='']:x" ); 7591 rbuggyMatches.push( "!=", pseudos ); 7592 }); 7593 } 7594 7595 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 7596 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 7597 7598 /* Contains 7599 ---------------------------------------------------------------------- */ 7600 hasCompare = rnative.test( docElem.compareDocumentPosition ); 7601 7602 // Element contains another 7603 // Purposefully self-exclusive 7604 // As in, an element does not contain itself 7605 contains = hasCompare || rnative.test( docElem.contains ) ? 7606 function( a, b ) { 7607 var adown = a.nodeType === 9 ? a.documentElement : a, 7608 bup = b && b.parentNode; 7609 return a === bup || !!( bup && bup.nodeType === 1 && ( 7610 adown.contains ? 7611 adown.contains( bup ) : 7612 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 7613 )); 7614 } : 7615 function( a, b ) { 7616 if ( b ) { 7617 while ( (b = b.parentNode) ) { 7618 if ( b === a ) { 7619 return true; 7620 } 7621 } 7622 } 7623 return false; 7624 }; 7625 7626 /* Sorting 7627 ---------------------------------------------------------------------- */ 7628 7629 // Document order sorting 7630 sortOrder = hasCompare ? 7631 function( a, b ) { 7632 7633 // Flag for duplicate removal 7634 if ( a === b ) { 7635 hasDuplicate = true; 7636 return 0; 7637 } 7638 7639 // Sort on method existence if only one input has compareDocumentPosition 7640 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 7641 if ( compare ) { 7642 return compare; 7643 } 7644 7645 // Calculate position if both inputs belong to the same document 7646 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 7647 a.compareDocumentPosition( b ) : 7648 7649 // Otherwise we know they are disconnected 7650 1; 7651 7652 // Disconnected nodes 7653 if ( compare & 1 || 7654 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 7655 7656 // Choose the first element that is related to our preferred document 7657 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 7658 return -1; 7659 } 7660 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 7661 return 1; 7662 } 7663 7664 // Maintain original order 7665 return sortInput ? 7666 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 7667 0; 7668 } 7669 7670 return compare & 4 ? -1 : 1; 7671 } : 7672 function( a, b ) { 7673 // Exit early if the nodes are identical 7674 if ( a === b ) { 7675 hasDuplicate = true; 7676 return 0; 7677 } 7678 7679 var cur, 7680 i = 0, 7681 aup = a.parentNode, 7682 bup = b.parentNode, 7683 ap = [ a ], 7684 bp = [ b ]; 7685 7686 // Parentless nodes are either documents or disconnected 7687 if ( !aup || !bup ) { 7688 return a === document ? -1 : 7689 b === document ? 1 : 7690 aup ? -1 : 7691 bup ? 1 : 7692 sortInput ? 7693 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 7694 0; 7695 7696 // If the nodes are siblings, we can do a quick check 7697 } else if ( aup === bup ) { 7698 return siblingCheck( a, b ); 7699 } 7700 7701 // Otherwise we need full lists of their ancestors for comparison 7702 cur = a; 7703 while ( (cur = cur.parentNode) ) { 7704 ap.unshift( cur ); 7705 } 7706 cur = b; 7707 while ( (cur = cur.parentNode) ) { 7708 bp.unshift( cur ); 7709 } 7710 7711 // Walk down the tree looking for a discrepancy 7712 while ( ap[i] === bp[i] ) { 7713 i++; 7714 } 7715 7716 return i ? 7717 // Do a sibling check if the nodes have a common ancestor 7718 siblingCheck( ap[i], bp[i] ) : 7719 7720 // Otherwise nodes in our document sort first 7721 ap[i] === preferredDoc ? -1 : 7722 bp[i] === preferredDoc ? 1 : 7723 0; 7724 }; 7725 7726 return document; 7727}; 7728 7729Sizzle.matches = function( expr, elements ) { 7730 return Sizzle( expr, null, null, elements ); 7731}; 7732 7733Sizzle.matchesSelector = function( elem, expr ) { 7734 // Set document vars if needed 7735 if ( ( elem.ownerDocument || elem ) !== document ) { 7736 setDocument( elem ); 7737 } 7738 7739 // Make sure that attribute selectors are quoted 7740 expr = expr.replace( rattributeQuotes, "='$1']" ); 7741 7742 if ( support.matchesSelector && documentIsHTML && 7743 !compilerCache[ expr + " " ] && 7744 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 7745 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 7746 7747 try { 7748 var ret = matches.call( elem, expr ); 7749 7750 // IE 9's matchesSelector returns false on disconnected nodes 7751 if ( ret || support.disconnectedMatch || 7752 // As well, disconnected nodes are said to be in a document 7753 // fragment in IE 9 7754 elem.document && elem.document.nodeType !== 11 ) { 7755 return ret; 7756 } 7757 } catch (e) {} 7758 } 7759 7760 return Sizzle( expr, document, null, [ elem ] ).length > 0; 7761}; 7762 7763Sizzle.contains = function( context, elem ) { 7764 // Set document vars if needed 7765 if ( ( context.ownerDocument || context ) !== document ) { 7766 setDocument( context ); 7767 } 7768 return contains( context, elem ); 7769}; 7770 7771Sizzle.attr = function( elem, name ) { 7772 // Set document vars if needed 7773 if ( ( elem.ownerDocument || elem ) !== document ) { 7774 setDocument( elem ); 7775 } 7776 7777 var fn = Expr.attrHandle[ name.toLowerCase() ], 7778 // Don't get fooled by Object.prototype properties (jQuery #13807) 7779 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 7780 fn( elem, name, !documentIsHTML ) : 7781 undefined; 7782 7783 return val !== undefined ? 7784 val : 7785 support.attributes || !documentIsHTML ? 7786 elem.getAttribute( name ) : 7787 (val = elem.getAttributeNode(name)) && val.specified ? 7788 val.value : 7789 null; 7790}; 7791 7792Sizzle.escape = function( sel ) { 7793 return (sel + "").replace( rcssescape, fcssescape ); 7794}; 7795 7796Sizzle.error = function( msg ) { 7797 throw new Error( "Syntax error, unrecognized expression: " + msg ); 7798}; 7799 7800/** 7801 * Document sorting and removing duplicates 7802 * @param {ArrayLike} results 7803 */ 7804Sizzle.uniqueSort = function( results ) { 7805 var elem, 7806 duplicates = [], 7807 j = 0, 7808 i = 0; 7809 7810 // Unless we *know* we can detect duplicates, assume their presence 7811 hasDuplicate = !support.detectDuplicates; 7812 sortInput = !support.sortStable && results.slice( 0 ); 7813 results.sort( sortOrder ); 7814 7815 if ( hasDuplicate ) { 7816 while ( (elem = results[i++]) ) { 7817 if ( elem === results[ i ] ) { 7818 j = duplicates.push( i ); 7819 } 7820 } 7821 while ( j-- ) { 7822 results.splice( duplicates[ j ], 1 ); 7823 } 7824 } 7825 7826 // Clear input after sorting to release objects 7827 // See https://github.com/jquery/sizzle/pull/225 7828 sortInput = null; 7829 7830 return results; 7831}; 7832 7833/** 7834 * Utility function for retrieving the text value of an array of DOM nodes 7835 * @param {Array|Element} elem 7836 */ 7837getText = Sizzle.getText = function( elem ) { 7838 var node, 7839 ret = "", 7840 i = 0, 7841 nodeType = elem.nodeType; 7842 7843 if ( !nodeType ) { 7844 // If no nodeType, this is expected to be an array 7845 while ( (node = elem[i++]) ) { 7846 // Do not traverse comment nodes 7847 ret += getText( node ); 7848 } 7849 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 7850 // Use textContent for elements 7851 // innerText usage removed for consistency of new lines (jQuery #11153) 7852 if ( typeof elem.textContent === "string" ) { 7853 return elem.textContent; 7854 } else { 7855 // Traverse its children 7856 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 7857 ret += getText( elem ); 7858 } 7859 } 7860 } else if ( nodeType === 3 || nodeType === 4 ) { 7861 return elem.nodeValue; 7862 } 7863 // Do not include comment or processing instruction nodes 7864 7865 return ret; 7866}; 7867 7868Expr = Sizzle.selectors = { 7869 7870 // Can be adjusted by the user 7871 cacheLength: 50, 7872 7873 createPseudo: markFunction, 7874 7875 match: matchExpr, 7876 7877 attrHandle: {}, 7878 7879 find: {}, 7880 7881 relative: { 7882 ">": { dir: "parentNode", first: true }, 7883 " ": { dir: "parentNode" }, 7884 "+": { dir: "previousSibling", first: true }, 7885 "~": { dir: "previousSibling" } 7886 }, 7887 7888 preFilter: { 7889 "ATTR": function( match ) { 7890 match[1] = match[1].replace( runescape, funescape ); 7891 7892 // Move the given value to match[3] whether quoted or unquoted 7893 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 7894 7895 if ( match[2] === "~=" ) { 7896 match[3] = " " + match[3] + " "; 7897 } 7898 7899 return match.slice( 0, 4 ); 7900 }, 7901 7902 "CHILD": function( match ) { 7903 /* matches from matchExpr["CHILD"] 7904 1 type (only|nth|...) 7905 2 what (child|of-type) 7906 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 7907 4 xn-component of xn+y argument ([+-]?\d*n|) 7908 5 sign of xn-component 7909 6 x of xn-component 7910 7 sign of y-component 7911 8 y of y-component 7912 */ 7913 match[1] = match[1].toLowerCase(); 7914 7915 if ( match[1].slice( 0, 3 ) === "nth" ) { 7916 // nth-* requires argument 7917 if ( !match[3] ) { 7918 Sizzle.error( match[0] ); 7919 } 7920 7921 // numeric x and y parameters for Expr.filter.CHILD 7922 // remember that false/true cast respectively to 0/1 7923 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 7924 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 7925 7926 // other types prohibit arguments 7927 } else if ( match[3] ) { 7928 Sizzle.error( match[0] ); 7929 } 7930 7931 return match; 7932 }, 7933 7934 "PSEUDO": function( match ) { 7935 var excess, 7936 unquoted = !match[6] && match[2]; 7937 7938 if ( matchExpr["CHILD"].test( match[0] ) ) { 7939 return null; 7940 } 7941 7942 // Accept quoted arguments as-is 7943 if ( match[3] ) { 7944 match[2] = match[4] || match[5] || ""; 7945 7946 // Strip excess characters from unquoted arguments 7947 } else if ( unquoted && rpseudo.test( unquoted ) && 7948 // Get excess from tokenize (recursively) 7949 (excess = tokenize( unquoted, true )) && 7950 // advance to the next closing parenthesis 7951 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 7952 7953 // excess is a negative index 7954 match[0] = match[0].slice( 0, excess ); 7955 match[2] = unquoted.slice( 0, excess ); 7956 } 7957 7958 // Return only captures needed by the pseudo filter method (type and argument) 7959 return match.slice( 0, 3 ); 7960 } 7961 }, 7962 7963 filter: { 7964 7965 "TAG": function( nodeNameSelector ) { 7966 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 7967 return nodeNameSelector === "*" ? 7968 function() { return true; } : 7969 function( elem ) { 7970 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 7971 }; 7972 }, 7973 7974 "CLASS": function( className ) { 7975 var pattern = classCache[ className + " " ]; 7976 7977 return pattern || 7978 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 7979 classCache( className, function( elem ) { 7980 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 7981 }); 7982 }, 7983 7984 "ATTR": function( name, operator, check ) { 7985 return function( elem ) { 7986 var result = Sizzle.attr( elem, name ); 7987 7988 if ( result == null ) { 7989 return operator === "!="; 7990 } 7991 if ( !operator ) { 7992 return true; 7993 } 7994 7995 result += ""; 7996 7997 return operator === "=" ? result === check : 7998 operator === "!=" ? result !== check : 7999 operator === "^=" ? check && result.indexOf( check ) === 0 : 8000 operator === "*=" ? check && result.indexOf( check ) > -1 : 8001 operator === "$=" ? check && result.slice( -check.length ) === check : 8002 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 8003 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 8004 false; 8005 }; 8006 }, 8007 8008 "CHILD": function( type, what, argument, first, last ) { 8009 var simple = type.slice( 0, 3 ) !== "nth", 8010 forward = type.slice( -4 ) !== "last", 8011 ofType = what === "of-type"; 8012 8013 return first === 1 && last === 0 ? 8014 8015 // Shortcut for :nth-*(n) 8016 function( elem ) { 8017 return !!elem.parentNode; 8018 } : 8019 8020 function( elem, context, xml ) { 8021 var cache, uniqueCache, outerCache, node, nodeIndex, start, 8022 dir = simple !== forward ? "nextSibling" : "previousSibling", 8023 parent = elem.parentNode, 8024 name = ofType && elem.nodeName.toLowerCase(), 8025 useCache = !xml && !ofType, 8026 diff = false; 8027 8028 if ( parent ) { 8029 8030 // :(first|last|only)-(child|of-type) 8031 if ( simple ) { 8032 while ( dir ) { 8033 node = elem; 8034 while ( (node = node[ dir ]) ) { 8035 if ( ofType ? 8036 node.nodeName.toLowerCase() === name : 8037 node.nodeType === 1 ) { 8038 8039 return false; 8040 } 8041 } 8042 // Reverse direction for :only-* (if we haven't yet done so) 8043 start = dir = type === "only" && !start && "nextSibling"; 8044 } 8045 return true; 8046 } 8047 8048 start = [ forward ? parent.firstChild : parent.lastChild ]; 8049 8050 // non-xml :nth-child(...) stores cache data on `parent` 8051 if ( forward && useCache ) { 8052 8053 // Seek `elem` from a previously-cached index 8054 8055 // ...in a gzip-friendly way 8056 node = parent; 8057 outerCache = node[ expando ] || (node[ expando ] = {}); 8058 8059 // Support: IE <9 only 8060 // Defend against cloned attroperties (jQuery gh-1709) 8061 uniqueCache = outerCache[ node.uniqueID ] || 8062 (outerCache[ node.uniqueID ] = {}); 8063 8064 cache = uniqueCache[ type ] || []; 8065 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 8066 diff = nodeIndex && cache[ 2 ]; 8067 node = nodeIndex && parent.childNodes[ nodeIndex ]; 8068 8069 while ( (node = ++nodeIndex && node && node[ dir ] || 8070 8071 // Fallback to seeking `elem` from the start 8072 (diff = nodeIndex = 0) || start.pop()) ) { 8073 8074 // When found, cache indexes on `parent` and break 8075 if ( node.nodeType === 1 && ++diff && node === elem ) { 8076 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 8077 break; 8078 } 8079 } 8080 8081 } else { 8082 // Use previously-cached element index if available 8083 if ( useCache ) { 8084 // ...in a gzip-friendly way 8085 node = elem; 8086 outerCache = node[ expando ] || (node[ expando ] = {}); 8087 8088 // Support: IE <9 only 8089 // Defend against cloned attroperties (jQuery gh-1709) 8090 uniqueCache = outerCache[ node.uniqueID ] || 8091 (outerCache[ node.uniqueID ] = {}); 8092 8093 cache = uniqueCache[ type ] || []; 8094 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 8095 diff = nodeIndex; 8096 } 8097 8098 // xml :nth-child(...) 8099 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 8100 if ( diff === false ) { 8101 // Use the same loop as above to seek `elem` from the start 8102 while ( (node = ++nodeIndex && node && node[ dir ] || 8103 (diff = nodeIndex = 0) || start.pop()) ) { 8104 8105 if ( ( ofType ? 8106 node.nodeName.toLowerCase() === name : 8107 node.nodeType === 1 ) && 8108 ++diff ) { 8109 8110 // Cache the index of each encountered element 8111 if ( useCache ) { 8112 outerCache = node[ expando ] || (node[ expando ] = {}); 8113 8114 // Support: IE <9 only 8115 // Defend against cloned attroperties (jQuery gh-1709) 8116 uniqueCache = outerCache[ node.uniqueID ] || 8117 (outerCache[ node.uniqueID ] = {}); 8118 8119 uniqueCache[ type ] = [ dirruns, diff ]; 8120 } 8121 8122 if ( node === elem ) { 8123 break; 8124 } 8125 } 8126 } 8127 } 8128 } 8129 8130 // Incorporate the offset, then check against cycle size 8131 diff -= last; 8132 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 8133 } 8134 }; 8135 }, 8136 8137 "PSEUDO": function( pseudo, argument ) { 8138 // pseudo-class names are case-insensitive 8139 // http://www.w3.org/TR/selectors/#pseudo-classes 8140 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 8141 // Remember that setFilters inherits from pseudos 8142 var args, 8143 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 8144 Sizzle.error( "unsupported pseudo: " + pseudo ); 8145 8146 // The user may use createPseudo to indicate that 8147 // arguments are needed to create the filter function 8148 // just as Sizzle does 8149 if ( fn[ expando ] ) { 8150 return fn( argument ); 8151 } 8152 8153 // But maintain support for old signatures 8154 if ( fn.length > 1 ) { 8155 args = [ pseudo, pseudo, "", argument ]; 8156 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 8157 markFunction(function( seed, matches ) { 8158 var idx, 8159 matched = fn( seed, argument ), 8160 i = matched.length; 8161 while ( i-- ) { 8162 idx = indexOf( seed, matched[i] ); 8163 seed[ idx ] = !( matches[ idx ] = matched[i] ); 8164 } 8165 }) : 8166 function( elem ) { 8167 return fn( elem, 0, args ); 8168 }; 8169 } 8170 8171 return fn; 8172 } 8173 }, 8174 8175 pseudos: { 8176 // Potentially complex pseudos 8177 "not": markFunction(function( selector ) { 8178 // Trim the selector passed to compile 8179 // to avoid treating leading and trailing 8180 // spaces as combinators 8181 var input = [], 8182 results = [], 8183 matcher = compile( selector.replace( rtrim, "$1" ) ); 8184 8185 return matcher[ expando ] ? 8186 markFunction(function( seed, matches, context, xml ) { 8187 var elem, 8188 unmatched = matcher( seed, null, xml, [] ), 8189 i = seed.length; 8190 8191 // Match elements unmatched by `matcher` 8192 while ( i-- ) { 8193 if ( (elem = unmatched[i]) ) { 8194 seed[i] = !(matches[i] = elem); 8195 } 8196 } 8197 }) : 8198 function( elem, context, xml ) { 8199 input[0] = elem; 8200 matcher( input, null, xml, results ); 8201 // Don't keep the element (issue #299) 8202 input[0] = null; 8203 return !results.pop(); 8204 }; 8205 }), 8206 8207 "has": markFunction(function( selector ) { 8208 return function( elem ) { 8209 return Sizzle( selector, elem ).length > 0; 8210 }; 8211 }), 8212 8213 "contains": markFunction(function( text ) { 8214 text = text.replace( runescape, funescape ); 8215 return function( elem ) { 8216 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 8217 }; 8218 }), 8219 8220 // "Whether an element is represented by a :lang() selector 8221 // is based solely on the element's language value 8222 // being equal to the identifier C, 8223 // or beginning with the identifier C immediately followed by "-". 8224 // The matching of C against the element's language value is performed case-insensitively. 8225 // The identifier C does not have to be a valid language name." 8226 // http://www.w3.org/TR/selectors/#lang-pseudo 8227 "lang": markFunction( function( lang ) { 8228 // lang value must be a valid identifier 8229 if ( !ridentifier.test(lang || "") ) { 8230 Sizzle.error( "unsupported lang: " + lang ); 8231 } 8232 lang = lang.replace( runescape, funescape ).toLowerCase(); 8233 return function( elem ) { 8234 var elemLang; 8235 do { 8236 if ( (elemLang = documentIsHTML ? 8237 elem.lang : 8238 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 8239 8240 elemLang = elemLang.toLowerCase(); 8241 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 8242 } 8243 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 8244 return false; 8245 }; 8246 }), 8247 8248 // Miscellaneous 8249 "target": function( elem ) { 8250 var hash = window.location && window.location.hash; 8251 return hash && hash.slice( 1 ) === elem.id; 8252 }, 8253 8254 "root": function( elem ) { 8255 return elem === docElem; 8256 }, 8257 8258 "focus": function( elem ) { 8259 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 8260 }, 8261 8262 // Boolean properties 8263 "enabled": createDisabledPseudo( false ), 8264 "disabled": createDisabledPseudo( true ), 8265 8266 "checked": function( elem ) { 8267 // In CSS3, :checked should return both checked and selected elements 8268 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 8269 var nodeName = elem.nodeName.toLowerCase(); 8270 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 8271 }, 8272 8273 "selected": function( elem ) { 8274 // Accessing this property makes selected-by-default 8275 // options in Safari work properly 8276 if ( elem.parentNode ) { 8277 elem.parentNode.selectedIndex; 8278 } 8279 8280 return elem.selected === true; 8281 }, 8282 8283 // Contents 8284 "empty": function( elem ) { 8285 // http://www.w3.org/TR/selectors/#empty-pseudo 8286 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 8287 // but not by others (comment: 8; processing instruction: 7; etc.) 8288 // nodeType < 6 works because attributes (2) do not appear as children 8289 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 8290 if ( elem.nodeType < 6 ) { 8291 return false; 8292 } 8293 } 8294 return true; 8295 }, 8296 8297 "parent": function( elem ) { 8298 return !Expr.pseudos["empty"]( elem ); 8299 }, 8300 8301 // Element/input types 8302 "header": function( elem ) { 8303 return rheader.test( elem.nodeName ); 8304 }, 8305 8306 "input": function( elem ) { 8307 return rinputs.test( elem.nodeName ); 8308 }, 8309 8310 "button": function( elem ) { 8311 var name = elem.nodeName.toLowerCase(); 8312 return name === "input" && elem.type === "button" || name === "button"; 8313 }, 8314 8315 "text": function( elem ) { 8316 var attr; 8317 return elem.nodeName.toLowerCase() === "input" && 8318 elem.type === "text" && 8319 8320 // Support: IE<8 8321 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 8322 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 8323 }, 8324 8325 // Position-in-collection 8326 "first": createPositionalPseudo(function() { 8327 return [ 0 ]; 8328 }), 8329 8330 "last": createPositionalPseudo(function( matchIndexes, length ) { 8331 return [ length - 1 ]; 8332 }), 8333 8334 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 8335 return [ argument < 0 ? argument + length : argument ]; 8336 }), 8337 8338 "even": createPositionalPseudo(function( matchIndexes, length ) { 8339 var i = 0; 8340 for ( ; i < length; i += 2 ) { 8341 matchIndexes.push( i ); 8342 } 8343 return matchIndexes; 8344 }), 8345 8346 "odd": createPositionalPseudo(function( matchIndexes, length ) { 8347 var i = 1; 8348 for ( ; i < length; i += 2 ) { 8349 matchIndexes.push( i ); 8350 } 8351 return matchIndexes; 8352 }), 8353 8354 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 8355 var i = argument < 0 ? argument + length : argument; 8356 for ( ; --i >= 0; ) { 8357 matchIndexes.push( i ); 8358 } 8359 return matchIndexes; 8360 }), 8361 8362 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 8363 var i = argument < 0 ? argument + length : argument; 8364 for ( ; ++i < length; ) { 8365 matchIndexes.push( i ); 8366 } 8367 return matchIndexes; 8368 }) 8369 } 8370}; 8371 8372Expr.pseudos["nth"] = Expr.pseudos["eq"]; 8373 8374// Add button/input type pseudos 8375for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 8376 Expr.pseudos[ i ] = createInputPseudo( i ); 8377} 8378for ( i in { submit: true, reset: true } ) { 8379 Expr.pseudos[ i ] = createButtonPseudo( i ); 8380} 8381 8382// Easy API for creating new setFilters 8383function setFilters() {} 8384setFilters.prototype = Expr.filters = Expr.pseudos; 8385Expr.setFilters = new setFilters(); 8386 8387tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 8388 var matched, match, tokens, type, 8389 soFar, groups, preFilters, 8390 cached = tokenCache[ selector + " " ]; 8391 8392 if ( cached ) { 8393 return parseOnly ? 0 : cached.slice( 0 ); 8394 } 8395 8396 soFar = selector; 8397 groups = []; 8398 preFilters = Expr.preFilter; 8399 8400 while ( soFar ) { 8401 8402 // Comma and first run 8403 if ( !matched || (match = rcomma.exec( soFar )) ) { 8404 if ( match ) { 8405 // Don't consume trailing commas as valid 8406 soFar = soFar.slice( match[0].length ) || soFar; 8407 } 8408 groups.push( (tokens = []) ); 8409 } 8410 8411 matched = false; 8412 8413 // Combinators 8414 if ( (match = rcombinators.exec( soFar )) ) { 8415 matched = match.shift(); 8416 tokens.push({ 8417 value: matched, 8418 // Cast descendant combinators to space 8419 type: match[0].replace( rtrim, " " ) 8420 }); 8421 soFar = soFar.slice( matched.length ); 8422 } 8423 8424 // Filters 8425 for ( type in Expr.filter ) { 8426 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 8427 (match = preFilters[ type ]( match ))) ) { 8428 matched = match.shift(); 8429 tokens.push({ 8430 value: matched, 8431 type: type, 8432 matches: match 8433 }); 8434 soFar = soFar.slice( matched.length ); 8435 } 8436 } 8437 8438 if ( !matched ) { 8439 break; 8440 } 8441 } 8442 8443 // Return the length of the invalid excess 8444 // if we're just parsing 8445 // Otherwise, throw an error or return tokens 8446 return parseOnly ? 8447 soFar.length : 8448 soFar ? 8449 Sizzle.error( selector ) : 8450 // Cache the tokens 8451 tokenCache( selector, groups ).slice( 0 ); 8452}; 8453 8454function toSelector( tokens ) { 8455 var i = 0, 8456 len = tokens.length, 8457 selector = ""; 8458 for ( ; i < len; i++ ) { 8459 selector += tokens[i].value; 8460 } 8461 return selector; 8462} 8463 8464function addCombinator( matcher, combinator, base ) { 8465 var dir = combinator.dir, 8466 skip = combinator.next, 8467 key = skip || dir, 8468 checkNonElements = base && key === "parentNode", 8469 doneName = done++; 8470 8471 return combinator.first ? 8472 // Check against closest ancestor/preceding element 8473 function( elem, context, xml ) { 8474 while ( (elem = elem[ dir ]) ) { 8475 if ( elem.nodeType === 1 || checkNonElements ) { 8476 return matcher( elem, context, xml ); 8477 } 8478 } 8479 return false; 8480 } : 8481 8482 // Check against all ancestor/preceding elements 8483 function( elem, context, xml ) { 8484 var oldCache, uniqueCache, outerCache, 8485 newCache = [ dirruns, doneName ]; 8486 8487 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 8488 if ( xml ) { 8489 while ( (elem = elem[ dir ]) ) { 8490 if ( elem.nodeType === 1 || checkNonElements ) { 8491 if ( matcher( elem, context, xml ) ) { 8492 return true; 8493 } 8494 } 8495 } 8496 } else { 8497 while ( (elem = elem[ dir ]) ) { 8498 if ( elem.nodeType === 1 || checkNonElements ) { 8499 outerCache = elem[ expando ] || (elem[ expando ] = {}); 8500 8501 // Support: IE <9 only 8502 // Defend against cloned attroperties (jQuery gh-1709) 8503 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 8504 8505 if ( skip && skip === elem.nodeName.toLowerCase() ) { 8506 elem = elem[ dir ] || elem; 8507 } else if ( (oldCache = uniqueCache[ key ]) && 8508 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 8509 8510 // Assign to newCache so results back-propagate to previous elements 8511 return (newCache[ 2 ] = oldCache[ 2 ]); 8512 } else { 8513 // Reuse newcache so results back-propagate to previous elements 8514 uniqueCache[ key ] = newCache; 8515 8516 // A match means we're done; a fail means we have to keep checking 8517 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 8518 return true; 8519 } 8520 } 8521 } 8522 } 8523 } 8524 return false; 8525 }; 8526} 8527 8528function elementMatcher( matchers ) { 8529 return matchers.length > 1 ? 8530 function( elem, context, xml ) { 8531 var i = matchers.length; 8532 while ( i-- ) { 8533 if ( !matchers[i]( elem, context, xml ) ) { 8534 return false; 8535 } 8536 } 8537 return true; 8538 } : 8539 matchers[0]; 8540} 8541 8542function multipleContexts( selector, contexts, results ) { 8543 var i = 0, 8544 len = contexts.length; 8545 for ( ; i < len; i++ ) { 8546 Sizzle( selector, contexts[i], results ); 8547 } 8548 return results; 8549} 8550 8551function condense( unmatched, map, filter, context, xml ) { 8552 var elem, 8553 newUnmatched = [], 8554 i = 0, 8555 len = unmatched.length, 8556 mapped = map != null; 8557 8558 for ( ; i < len; i++ ) { 8559 if ( (elem = unmatched[i]) ) { 8560 if ( !filter || filter( elem, context, xml ) ) { 8561 newUnmatched.push( elem ); 8562 if ( mapped ) { 8563 map.push( i ); 8564 } 8565 } 8566 } 8567 } 8568 8569 return newUnmatched; 8570} 8571 8572function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 8573 if ( postFilter && !postFilter[ expando ] ) { 8574 postFilter = setMatcher( postFilter ); 8575 } 8576 if ( postFinder && !postFinder[ expando ] ) { 8577 postFinder = setMatcher( postFinder, postSelector ); 8578 } 8579 return markFunction(function( seed, results, context, xml ) { 8580 var temp, i, elem, 8581 preMap = [], 8582 postMap = [], 8583 preexisting = results.length, 8584 8585 // Get initial elements from seed or context 8586 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 8587 8588 // Prefilter to get matcher input, preserving a map for seed-results synchronization 8589 matcherIn = preFilter && ( seed || !selector ) ? 8590 condense( elems, preMap, preFilter, context, xml ) : 8591 elems, 8592 8593 matcherOut = matcher ? 8594 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 8595 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 8596 8597 // ...intermediate processing is necessary 8598 [] : 8599 8600 // ...otherwise use results directly 8601 results : 8602 matcherIn; 8603 8604 // Find primary matches 8605 if ( matcher ) { 8606 matcher( matcherIn, matcherOut, context, xml ); 8607 } 8608 8609 // Apply postFilter 8610 if ( postFilter ) { 8611 temp = condense( matcherOut, postMap ); 8612 postFilter( temp, [], context, xml ); 8613 8614 // Un-match failing elements by moving them back to matcherIn 8615 i = temp.length; 8616 while ( i-- ) { 8617 if ( (elem = temp[i]) ) { 8618 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 8619 } 8620 } 8621 } 8622 8623 if ( seed ) { 8624 if ( postFinder || preFilter ) { 8625 if ( postFinder ) { 8626 // Get the final matcherOut by condensing this intermediate into postFinder contexts 8627 temp = []; 8628 i = matcherOut.length; 8629 while ( i-- ) { 8630 if ( (elem = matcherOut[i]) ) { 8631 // Restore matcherIn since elem is not yet a final match 8632 temp.push( (matcherIn[i] = elem) ); 8633 } 8634 } 8635 postFinder( null, (matcherOut = []), temp, xml ); 8636 } 8637 8638 // Move matched elements from seed to results to keep them synchronized 8639 i = matcherOut.length; 8640 while ( i-- ) { 8641 if ( (elem = matcherOut[i]) && 8642 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 8643 8644 seed[temp] = !(results[temp] = elem); 8645 } 8646 } 8647 } 8648 8649 // Add elements to results, through postFinder if defined 8650 } else { 8651 matcherOut = condense( 8652 matcherOut === results ? 8653 matcherOut.splice( preexisting, matcherOut.length ) : 8654 matcherOut 8655 ); 8656 if ( postFinder ) { 8657 postFinder( null, results, matcherOut, xml ); 8658 } else { 8659 push.apply( results, matcherOut ); 8660 } 8661 } 8662 }); 8663} 8664 8665function matcherFromTokens( tokens ) { 8666 var checkContext, matcher, j, 8667 len = tokens.length, 8668 leadingRelative = Expr.relative[ tokens[0].type ], 8669 implicitRelative = leadingRelative || Expr.relative[" "], 8670 i = leadingRelative ? 1 : 0, 8671 8672 // The foundational matcher ensures that elements are reachable from top-level context(s) 8673 matchContext = addCombinator( function( elem ) { 8674 return elem === checkContext; 8675 }, implicitRelative, true ), 8676 matchAnyContext = addCombinator( function( elem ) { 8677 return indexOf( checkContext, elem ) > -1; 8678 }, implicitRelative, true ), 8679 matchers = [ function( elem, context, xml ) { 8680 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 8681 (checkContext = context).nodeType ? 8682 matchContext( elem, context, xml ) : 8683 matchAnyContext( elem, context, xml ) ); 8684 // Avoid hanging onto element (issue #299) 8685 checkContext = null; 8686 return ret; 8687 } ]; 8688 8689 for ( ; i < len; i++ ) { 8690 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 8691 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 8692 } else { 8693 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 8694 8695 // Return special upon seeing a positional matcher 8696 if ( matcher[ expando ] ) { 8697 // Find the next relative operator (if any) for proper handling 8698 j = ++i; 8699 for ( ; j < len; j++ ) { 8700 if ( Expr.relative[ tokens[j].type ] ) { 8701 break; 8702 } 8703 } 8704 return setMatcher( 8705 i > 1 && elementMatcher( matchers ), 8706 i > 1 && toSelector( 8707 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 8708 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 8709 ).replace( rtrim, "$1" ), 8710 matcher, 8711 i < j && matcherFromTokens( tokens.slice( i, j ) ), 8712 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 8713 j < len && toSelector( tokens ) 8714 ); 8715 } 8716 matchers.push( matcher ); 8717 } 8718 } 8719 8720 return elementMatcher( matchers ); 8721} 8722 8723function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 8724 var bySet = setMatchers.length > 0, 8725 byElement = elementMatchers.length > 0, 8726 superMatcher = function( seed, context, xml, results, outermost ) { 8727 var elem, j, matcher, 8728 matchedCount = 0, 8729 i = "0", 8730 unmatched = seed && [], 8731 setMatched = [], 8732 contextBackup = outermostContext, 8733 // We must always have either seed elements or outermost context 8734 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 8735 // Use integer dirruns iff this is the outermost matcher 8736 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 8737 len = elems.length; 8738 8739 if ( outermost ) { 8740 outermostContext = context === document || context || outermost; 8741 } 8742 8743 // Add elements passing elementMatchers directly to results 8744 // Support: IE<9, Safari 8745 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 8746 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 8747 if ( byElement && elem ) { 8748 j = 0; 8749 if ( !context && elem.ownerDocument !== document ) { 8750 setDocument( elem ); 8751 xml = !documentIsHTML; 8752 } 8753 while ( (matcher = elementMatchers[j++]) ) { 8754 if ( matcher( elem, context || document, xml) ) { 8755 results.push( elem ); 8756 break; 8757 } 8758 } 8759 if ( outermost ) { 8760 dirruns = dirrunsUnique; 8761 } 8762 } 8763 8764 // Track unmatched elements for set filters 8765 if ( bySet ) { 8766 // They will have gone through all possible matchers 8767 if ( (elem = !matcher && elem) ) { 8768 matchedCount--; 8769 } 8770 8771 // Lengthen the array for every element, matched or not 8772 if ( seed ) { 8773 unmatched.push( elem ); 8774 } 8775 } 8776 } 8777 8778 // `i` is now the count of elements visited above, and adding it to `matchedCount` 8779 // makes the latter nonnegative. 8780 matchedCount += i; 8781 8782 // Apply set filters to unmatched elements 8783 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 8784 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 8785 // no element matchers and no seed. 8786 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 8787 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 8788 // numerically zero. 8789 if ( bySet && i !== matchedCount ) { 8790 j = 0; 8791 while ( (matcher = setMatchers[j++]) ) { 8792 matcher( unmatched, setMatched, context, xml ); 8793 } 8794 8795 if ( seed ) { 8796 // Reintegrate element matches to eliminate the need for sorting 8797 if ( matchedCount > 0 ) { 8798 while ( i-- ) { 8799 if ( !(unmatched[i] || setMatched[i]) ) { 8800 setMatched[i] = pop.call( results ); 8801 } 8802 } 8803 } 8804 8805 // Discard index placeholder values to get only actual matches 8806 setMatched = condense( setMatched ); 8807 } 8808 8809 // Add matches to results 8810 push.apply( results, setMatched ); 8811 8812 // Seedless set matches succeeding multiple successful matchers stipulate sorting 8813 if ( outermost && !seed && setMatched.length > 0 && 8814 ( matchedCount + setMatchers.length ) > 1 ) { 8815 8816 Sizzle.uniqueSort( results ); 8817 } 8818 } 8819 8820 // Override manipulation of globals by nested matchers 8821 if ( outermost ) { 8822 dirruns = dirrunsUnique; 8823 outermostContext = contextBackup; 8824 } 8825 8826 return unmatched; 8827 }; 8828 8829 return bySet ? 8830 markFunction( superMatcher ) : 8831 superMatcher; 8832} 8833 8834compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 8835 var i, 8836 setMatchers = [], 8837 elementMatchers = [], 8838 cached = compilerCache[ selector + " " ]; 8839 8840 if ( !cached ) { 8841 // Generate a function of recursive functions that can be used to check each element 8842 if ( !match ) { 8843 match = tokenize( selector ); 8844 } 8845 i = match.length; 8846 while ( i-- ) { 8847 cached = matcherFromTokens( match[i] ); 8848 if ( cached[ expando ] ) { 8849 setMatchers.push( cached ); 8850 } else { 8851 elementMatchers.push( cached ); 8852 } 8853 } 8854 8855 // Cache the compiled function 8856 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 8857 8858 // Save selector and tokenization 8859 cached.selector = selector; 8860 } 8861 return cached; 8862}; 8863 8864/** 8865 * A low-level selection function that works with Sizzle's compiled 8866 * selector functions 8867 * @param {String|Function} selector A selector or a pre-compiled 8868 * selector function built with Sizzle.compile 8869 * @param {Element} context 8870 * @param {Array} [results] 8871 * @param {Array} [seed] A set of elements to match against 8872 */ 8873select = Sizzle.select = function( selector, context, results, seed ) { 8874 var i, tokens, token, type, find, 8875 compiled = typeof selector === "function" && selector, 8876 match = !seed && tokenize( (selector = compiled.selector || selector) ); 8877 8878 results = results || []; 8879 8880 // Try to minimize operations if there is only one selector in the list and no seed 8881 // (the latter of which guarantees us context) 8882 if ( match.length === 1 ) { 8883 8884 // Reduce context if the leading compound selector is an ID 8885 tokens = match[0] = match[0].slice( 0 ); 8886 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 8887 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { 8888 8889 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 8890 if ( !context ) { 8891 return results; 8892 8893 // Precompiled matchers will still verify ancestry, so step up a level 8894 } else if ( compiled ) { 8895 context = context.parentNode; 8896 } 8897 8898 selector = selector.slice( tokens.shift().value.length ); 8899 } 8900 8901 // Fetch a seed set for right-to-left matching 8902 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 8903 while ( i-- ) { 8904 token = tokens[i]; 8905 8906 // Abort if we hit a combinator 8907 if ( Expr.relative[ (type = token.type) ] ) { 8908 break; 8909 } 8910 if ( (find = Expr.find[ type ]) ) { 8911 // Search, expanding context for leading sibling combinators 8912 if ( (seed = find( 8913 token.matches[0].replace( runescape, funescape ), 8914 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 8915 )) ) { 8916 8917 // If seed is empty or no tokens remain, we can return early 8918 tokens.splice( i, 1 ); 8919 selector = seed.length && toSelector( tokens ); 8920 if ( !selector ) { 8921 push.apply( results, seed ); 8922 return results; 8923 } 8924 8925 break; 8926 } 8927 } 8928 } 8929 } 8930 8931 // Compile and execute a filtering function if one is not provided 8932 // Provide `match` to avoid retokenization if we modified the selector above 8933 ( compiled || compile( selector, match ) )( 8934 seed, 8935 context, 8936 !documentIsHTML, 8937 results, 8938 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 8939 ); 8940 return results; 8941}; 8942 8943// One-time assignments 8944 8945// Sort stability 8946support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 8947 8948// Support: Chrome 14-35+ 8949// Always assume duplicates if they aren't passed to the comparison function 8950support.detectDuplicates = !!hasDuplicate; 8951 8952// Initialize against the default document 8953setDocument(); 8954 8955// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 8956// Detached nodes confoundingly follow *each other* 8957support.sortDetached = assert(function( el ) { 8958 // Should return 1, but returns 4 (following) 8959 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; 8960}); 8961 8962// Support: IE<8 8963// Prevent attribute/property "interpolation" 8964// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 8965if ( !assert(function( el ) { 8966 el.innerHTML = "<a href='#'></a>"; 8967 return el.firstChild.getAttribute("href") === "#" ; 8968}) ) { 8969 addHandle( "type|href|height|width", function( elem, name, isXML ) { 8970 if ( !isXML ) { 8971 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 8972 } 8973 }); 8974} 8975 8976// Support: IE<9 8977// Use defaultValue in place of getAttribute("value") 8978if ( !support.attributes || !assert(function( el ) { 8979 el.innerHTML = "<input/>"; 8980 el.firstChild.setAttribute( "value", "" ); 8981 return el.firstChild.getAttribute( "value" ) === ""; 8982}) ) { 8983 addHandle( "value", function( elem, name, isXML ) { 8984 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 8985 return elem.defaultValue; 8986 } 8987 }); 8988} 8989 8990// Support: IE<9 8991// Use getAttributeNode to fetch booleans when getAttribute lies 8992if ( !assert(function( el ) { 8993 return el.getAttribute("disabled") == null; 8994}) ) { 8995 addHandle( booleans, function( elem, name, isXML ) { 8996 var val; 8997 if ( !isXML ) { 8998 return elem[ name ] === true ? name.toLowerCase() : 8999 (val = elem.getAttributeNode( name )) && val.specified ? 9000 val.value : 9001 null; 9002 } 9003 }); 9004} 9005 9006return Sizzle; 9007 9008})( window ); 9009 9010 9011 9012jQuery.find = Sizzle; 9013jQuery.expr = Sizzle.selectors; 9014 9015// Deprecated 9016jQuery.expr[ ":" ] = jQuery.expr.pseudos; 9017jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 9018jQuery.text = Sizzle.getText; 9019jQuery.isXMLDoc = Sizzle.isXML; 9020jQuery.contains = Sizzle.contains; 9021jQuery.escapeSelector = Sizzle.escape; 9022 9023 9024 9025 9026var dir = function( elem, dir, until ) { 9027 var matched = [], 9028 truncate = until !== undefined; 9029 9030 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 9031 if ( elem.nodeType === 1 ) { 9032 if ( truncate && jQuery( elem ).is( until ) ) { 9033 break; 9034 } 9035 matched.push( elem ); 9036 } 9037 } 9038 return matched; 9039}; 9040 9041 9042var siblings = function( n, elem ) { 9043 var matched = []; 9044 9045 for ( ; n; n = n.nextSibling ) { 9046 if ( n.nodeType === 1 && n !== elem ) { 9047 matched.push( n ); 9048 } 9049 } 9050 9051 return matched; 9052}; 9053 9054 9055var rneedsContext = jQuery.expr.match.needsContext; 9056 9057 9058 9059function nodeName( elem, name ) { 9060 9061 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 9062 9063}; 9064var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 9065 9066 9067 9068// Implement the identical functionality for filter and not 9069function winnow( elements, qualifier, not ) { 9070 if ( isFunction( qualifier ) ) { 9071 return jQuery.grep( elements, function( elem, i ) { 9072 return !!qualifier.call( elem, i, elem ) !== not; 9073 } ); 9074 } 9075 9076 // Single element 9077 if ( qualifier.nodeType ) { 9078 return jQuery.grep( elements, function( elem ) { 9079 return ( elem === qualifier ) !== not; 9080 } ); 9081 } 9082 9083 // Arraylike of elements (jQuery, arguments, Array) 9084 if ( typeof qualifier !== "string" ) { 9085 return jQuery.grep( elements, function( elem ) { 9086 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 9087 } ); 9088 } 9089 9090 // Filtered directly for both simple and complex selectors 9091 return jQuery.filter( qualifier, elements, not ); 9092} 9093 9094jQuery.filter = function( expr, elems, not ) { 9095 var elem = elems[ 0 ]; 9096 9097 if ( not ) { 9098 expr = ":not(" + expr + ")"; 9099 } 9100 9101 if ( elems.length === 1 && elem.nodeType === 1 ) { 9102 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 9103 } 9104 9105 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 9106 return elem.nodeType === 1; 9107 } ) ); 9108}; 9109 9110jQuery.fn.extend( { 9111 find: function( selector ) { 9112 var i, ret, 9113 len = this.length, 9114 self = this; 9115 9116 if ( typeof selector !== "string" ) { 9117 return this.pushStack( jQuery( selector ).filter( function() { 9118 for ( i = 0; i < len; i++ ) { 9119 if ( jQuery.contains( self[ i ], this ) ) { 9120 return true; 9121 } 9122 } 9123 } ) ); 9124 } 9125 9126 ret = this.pushStack( [] ); 9127 9128 for ( i = 0; i < len; i++ ) { 9129 jQuery.find( selector, self[ i ], ret ); 9130 } 9131 9132 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 9133 }, 9134 filter: function( selector ) { 9135 return this.pushStack( winnow( this, selector || [], false ) ); 9136 }, 9137 not: function( selector ) { 9138 return this.pushStack( winnow( this, selector || [], true ) ); 9139 }, 9140 is: function( selector ) { 9141 return !!winnow( 9142 this, 9143 9144 // If this is a positional/relative selector, check membership in the returned set 9145 // so $("p:first").is("p:last") won't return true for a doc with two "p". 9146 typeof selector === "string" && rneedsContext.test( selector ) ? 9147 jQuery( selector ) : 9148 selector || [], 9149 false 9150 ).length; 9151 } 9152} ); 9153 9154 9155// Initialize a jQuery object 9156 9157 9158// A central reference to the root jQuery(document) 9159var rootjQuery, 9160 9161 // A simple way to check for HTML strings 9162 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 9163 // Strict HTML recognition (#11290: must start with <) 9164 // Shortcut simple #id case for speed 9165 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 9166 9167 init = jQuery.fn.init = function( selector, context, root ) { 9168 var match, elem; 9169 9170 // HANDLE: $(""), $(null), $(undefined), $(false) 9171 if ( !selector ) { 9172 return this; 9173 } 9174 9175 // Method init() accepts an alternate rootjQuery 9176 // so migrate can support jQuery.sub (gh-2101) 9177 root = root || rootjQuery; 9178 9179 // Handle HTML strings 9180 if ( typeof selector === "string" ) { 9181 if ( selector[ 0 ] === "<" && 9182 selector[ selector.length - 1 ] === ">" && 9183 selector.length >= 3 ) { 9184 9185 // Assume that strings that start and end with <> are HTML and skip the regex check 9186 match = [ null, selector, null ]; 9187 9188 } else { 9189 match = rquickExpr.exec( selector ); 9190 } 9191 9192 // Match html or make sure no context is specified for #id 9193 if ( match && ( match[ 1 ] || !context ) ) { 9194 9195 // HANDLE: $(html) -> $(array) 9196 if ( match[ 1 ] ) { 9197 context = context instanceof jQuery ? context[ 0 ] : context; 9198 9199 // Option to run scripts is true for back-compat 9200 // Intentionally let the error be thrown if parseHTML is not present 9201 jQuery.merge( this, jQuery.parseHTML( 9202 match[ 1 ], 9203 context && context.nodeType ? context.ownerDocument || context : document, 9204 true 9205 ) ); 9206 9207 // HANDLE: $(html, props) 9208 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 9209 for ( match in context ) { 9210 9211 // Properties of context are called as methods if possible 9212 if ( isFunction( this[ match ] ) ) { 9213 this[ match ]( context[ match ] ); 9214 9215 // ...and otherwise set as attributes 9216 } else { 9217 this.attr( match, context[ match ] ); 9218 } 9219 } 9220 } 9221 9222 return this; 9223 9224 // HANDLE: $(#id) 9225 } else { 9226 elem = document.getElementById( match[ 2 ] ); 9227 9228 if ( elem ) { 9229 9230 // Inject the element directly into the jQuery object 9231 this[ 0 ] = elem; 9232 this.length = 1; 9233 } 9234 return this; 9235 } 9236 9237 // HANDLE: $(expr, $(...)) 9238 } else if ( !context || context.jquery ) { 9239 return ( context || root ).find( selector ); 9240 9241 // HANDLE: $(expr, context) 9242 // (which is just equivalent to: $(context).find(expr) 9243 } else { 9244 return this.constructor( context ).find( selector ); 9245 } 9246 9247 // HANDLE: $(DOMElement) 9248 } else if ( selector.nodeType ) { 9249 this[ 0 ] = selector; 9250 this.length = 1; 9251 return this; 9252 9253 // HANDLE: $(function) 9254 // Shortcut for document ready 9255 } else if ( isFunction( selector ) ) { 9256 return root.ready !== undefined ? 9257 root.ready( selector ) : 9258 9259 // Execute immediately if ready is not present 9260 selector( jQuery ); 9261 } 9262 9263 return jQuery.makeArray( selector, this ); 9264 }; 9265 9266// Give the init function the jQuery prototype for later instantiation 9267init.prototype = jQuery.fn; 9268 9269// Initialize central reference 9270rootjQuery = jQuery( document ); 9271 9272 9273var rparentsprev = /^(?:parents|prev(?:Until|All))/, 9274 9275 // Methods guaranteed to produce a unique set when starting from a unique set 9276 guaranteedUnique = { 9277 children: true, 9278 contents: true, 9279 next: true, 9280 prev: true 9281 }; 9282 9283jQuery.fn.extend( { 9284 has: function( target ) { 9285 var targets = jQuery( target, this ), 9286 l = targets.length; 9287 9288 return this.filter( function() { 9289 var i = 0; 9290 for ( ; i < l; i++ ) { 9291 if ( jQuery.contains( this, targets[ i ] ) ) { 9292 return true; 9293 } 9294 } 9295 } ); 9296 }, 9297 9298 closest: function( selectors, context ) { 9299 var cur, 9300 i = 0, 9301 l = this.length, 9302 matched = [], 9303 targets = typeof selectors !== "string" && jQuery( selectors ); 9304 9305 // Positional selectors never match, since there's no _selection_ context 9306 if ( !rneedsContext.test( selectors ) ) { 9307 for ( ; i < l; i++ ) { 9308 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 9309 9310 // Always skip document fragments 9311 if ( cur.nodeType < 11 && ( targets ? 9312 targets.index( cur ) > -1 : 9313 9314 // Don't pass non-elements to Sizzle 9315 cur.nodeType === 1 && 9316 jQuery.find.matchesSelector( cur, selectors ) ) ) { 9317 9318 matched.push( cur ); 9319 break; 9320 } 9321 } 9322 } 9323 } 9324 9325 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 9326 }, 9327 9328 // Determine the position of an element within the set 9329 index: function( elem ) { 9330 9331 // No argument, return index in parent 9332 if ( !elem ) { 9333 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 9334 } 9335 9336 // Index in selector 9337 if ( typeof elem === "string" ) { 9338 return indexOf.call( jQuery( elem ), this[ 0 ] ); 9339 } 9340 9341 // Locate the position of the desired element 9342 return indexOf.call( this, 9343 9344 // If it receives a jQuery object, the first element is used 9345 elem.jquery ? elem[ 0 ] : elem 9346 ); 9347 }, 9348 9349 add: function( selector, context ) { 9350 return this.pushStack( 9351 jQuery.uniqueSort( 9352 jQuery.merge( this.get(), jQuery( selector, context ) ) 9353 ) 9354 ); 9355 }, 9356 9357 addBack: function( selector ) { 9358 return this.add( selector == null ? 9359 this.prevObject : this.prevObject.filter( selector ) 9360 ); 9361 } 9362} ); 9363 9364function sibling( cur, dir ) { 9365 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 9366 return cur; 9367} 9368 9369jQuery.each( { 9370 parent: function( elem ) { 9371 var parent = elem.parentNode; 9372 return parent && parent.nodeType !== 11 ? parent : null; 9373 }, 9374 parents: function( elem ) { 9375 return dir( elem, "parentNode" ); 9376 }, 9377 parentsUntil: function( elem, i, until ) { 9378 return dir( elem, "parentNode", until ); 9379 }, 9380 next: function( elem ) { 9381 return sibling( elem, "nextSibling" ); 9382 }, 9383 prev: function( elem ) { 9384 return sibling( elem, "previousSibling" ); 9385 }, 9386 nextAll: function( elem ) { 9387 return dir( elem, "nextSibling" ); 9388 }, 9389 prevAll: function( elem ) { 9390 return dir( elem, "previousSibling" ); 9391 }, 9392 nextUntil: function( elem, i, until ) { 9393 return dir( elem, "nextSibling", until ); 9394 }, 9395 prevUntil: function( elem, i, until ) { 9396 return dir( elem, "previousSibling", until ); 9397 }, 9398 siblings: function( elem ) { 9399 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 9400 }, 9401 children: function( elem ) { 9402 return siblings( elem.firstChild ); 9403 }, 9404 contents: function( elem ) { 9405 if ( nodeName( elem, "iframe" ) ) { 9406 return elem.contentDocument; 9407 } 9408 9409 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 9410 // Treat the template element as a regular one in browsers that 9411 // don't support it. 9412 if ( nodeName( elem, "template" ) ) { 9413 elem = elem.content || elem; 9414 } 9415 9416 return jQuery.merge( [], elem.childNodes ); 9417 } 9418}, function( name, fn ) { 9419 jQuery.fn[ name ] = function( until, selector ) { 9420 var matched = jQuery.map( this, fn, until ); 9421 9422 if ( name.slice( -5 ) !== "Until" ) { 9423 selector = until; 9424 } 9425 9426 if ( selector && typeof selector === "string" ) { 9427 matched = jQuery.filter( selector, matched ); 9428 } 9429 9430 if ( this.length > 1 ) { 9431 9432 // Remove duplicates 9433 if ( !guaranteedUnique[ name ] ) { 9434 jQuery.uniqueSort( matched ); 9435 } 9436 9437 // Reverse order for parents* and prev-derivatives 9438 if ( rparentsprev.test( name ) ) { 9439 matched.reverse(); 9440 } 9441 } 9442 9443 return this.pushStack( matched ); 9444 }; 9445} ); 9446var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 9447 9448 9449 9450// Convert String-formatted options into Object-formatted ones 9451function createOptions( options ) { 9452 var object = {}; 9453 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 9454 object[ flag ] = true; 9455 } ); 9456 return object; 9457} 9458 9459/* 9460 * Create a callback list using the following parameters: 9461 * 9462 * options: an optional list of space-separated options that will change how 9463 * the callback list behaves or a more traditional option object 9464 * 9465 * By default a callback list will act like an event callback list and can be 9466 * "fired" multiple times. 9467 * 9468 * Possible options: 9469 * 9470 * once: will ensure the callback list can only be fired once (like a Deferred) 9471 * 9472 * memory: will keep track of previous values and will call any callback added 9473 * after the list has been fired right away with the latest "memorized" 9474 * values (like a Deferred) 9475 * 9476 * unique: will ensure a callback can only be added once (no duplicate in the list) 9477 * 9478 * stopOnFalse: interrupt callings when a callback returns false 9479 * 9480 */ 9481jQuery.Callbacks = function( options ) { 9482 9483 // Convert options from String-formatted to Object-formatted if needed 9484 // (we check in cache first) 9485 options = typeof options === "string" ? 9486 createOptions( options ) : 9487 jQuery.extend( {}, options ); 9488 9489 var // Flag to know if list is currently firing 9490 firing, 9491 9492 // Last fire value for non-forgettable lists 9493 memory, 9494 9495 // Flag to know if list was already fired 9496 fired, 9497 9498 // Flag to prevent firing 9499 locked, 9500 9501 // Actual callback list 9502 list = [], 9503 9504 // Queue of execution data for repeatable lists 9505 queue = [], 9506 9507 // Index of currently firing callback (modified by add/remove as needed) 9508 firingIndex = -1, 9509 9510 // Fire callbacks 9511 fire = function() { 9512 9513 // Enforce single-firing 9514 locked = locked || options.once; 9515 9516 // Execute callbacks for all pending executions, 9517 // respecting firingIndex overrides and runtime changes 9518 fired = firing = true; 9519 for ( ; queue.length; firingIndex = -1 ) { 9520 memory = queue.shift(); 9521 while ( ++firingIndex < list.length ) { 9522 9523 // Run callback and check for early termination 9524 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 9525 options.stopOnFalse ) { 9526 9527 // Jump to end and forget the data so .add doesn't re-fire 9528 firingIndex = list.length; 9529 memory = false; 9530 } 9531 } 9532 } 9533 9534 // Forget the data if we're done with it 9535 if ( !options.memory ) { 9536 memory = false; 9537 } 9538 9539 firing = false; 9540 9541 // Clean up if we're done firing for good 9542 if ( locked ) { 9543 9544 // Keep an empty list if we have data for future add calls 9545 if ( memory ) { 9546 list = []; 9547 9548 // Otherwise, this object is spent 9549 } else { 9550 list = ""; 9551 } 9552 } 9553 }, 9554 9555 // Actual Callbacks object 9556 self = { 9557 9558 // Add a callback or a collection of callbacks to the list 9559 add: function() { 9560 if ( list ) { 9561 9562 // If we have memory from a past run, we should fire after adding 9563 if ( memory && !firing ) { 9564 firingIndex = list.length - 1; 9565 queue.push( memory ); 9566 } 9567 9568 ( function add( args ) { 9569 jQuery.each( args, function( _, arg ) { 9570 if ( isFunction( arg ) ) { 9571 if ( !options.unique || !self.has( arg ) ) { 9572 list.push( arg ); 9573 } 9574 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 9575 9576 // Inspect recursively 9577 add( arg ); 9578 } 9579 } ); 9580 } )( arguments ); 9581 9582 if ( memory && !firing ) { 9583 fire(); 9584 } 9585 } 9586 return this; 9587 }, 9588 9589 // Remove a callback from the list 9590 remove: function() { 9591 jQuery.each( arguments, function( _, arg ) { 9592 var index; 9593 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 9594 list.splice( index, 1 ); 9595 9596 // Handle firing indexes 9597 if ( index <= firingIndex ) { 9598 firingIndex--; 9599 } 9600 } 9601 } ); 9602 return this; 9603 }, 9604 9605 // Check if a given callback is in the list. 9606 // If no argument is given, return whether or not list has callbacks attached. 9607 has: function( fn ) { 9608 return fn ? 9609 jQuery.inArray( fn, list ) > -1 : 9610 list.length > 0; 9611 }, 9612 9613 // Remove all callbacks from the list 9614 empty: function() { 9615 if ( list ) { 9616 list = []; 9617 } 9618 return this; 9619 }, 9620 9621 // Disable .fire and .add 9622 // Abort any current/pending executions 9623 // Clear all callbacks and values 9624 disable: function() { 9625 locked = queue = []; 9626 list = memory = ""; 9627 return this; 9628 }, 9629 disabled: function() { 9630 return !list; 9631 }, 9632 9633 // Disable .fire 9634 // Also disable .add unless we have memory (since it would have no effect) 9635 // Abort any pending executions 9636 lock: function() { 9637 locked = queue = []; 9638 if ( !memory && !firing ) { 9639 list = memory = ""; 9640 } 9641 return this; 9642 }, 9643 locked: function() { 9644 return !!locked; 9645 }, 9646 9647 // Call all callbacks with the given context and arguments 9648 fireWith: function( context, args ) { 9649 if ( !locked ) { 9650 args = args || []; 9651 args = [ context, args.slice ? args.slice() : args ]; 9652 queue.push( args ); 9653 if ( !firing ) { 9654 fire(); 9655 } 9656 } 9657 return this; 9658 }, 9659 9660 // Call all the callbacks with the given arguments 9661 fire: function() { 9662 self.fireWith( this, arguments ); 9663 return this; 9664 }, 9665 9666 // To know if the callbacks have already been called at least once 9667 fired: function() { 9668 return !!fired; 9669 } 9670 }; 9671 9672 return self; 9673}; 9674 9675 9676function Identity( v ) { 9677 return v; 9678} 9679function Thrower( ex ) { 9680 throw ex; 9681} 9682 9683function adoptValue( value, resolve, reject, noValue ) { 9684 var method; 9685 9686 try { 9687 9688 // Check for promise aspect first to privilege synchronous behavior 9689 if ( value && isFunction( ( method = value.promise ) ) ) { 9690 method.call( value ).done( resolve ).fail( reject ); 9691 9692 // Other thenables 9693 } else if ( value && isFunction( ( method = value.then ) ) ) { 9694 method.call( value, resolve, reject ); 9695 9696 // Other non-thenables 9697 } else { 9698 9699 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 9700 // * false: [ value ].slice( 0 ) => resolve( value ) 9701 // * true: [ value ].slice( 1 ) => resolve() 9702 resolve.apply( undefined, [ value ].slice( noValue ) ); 9703 } 9704 9705 // For Promises/A+, convert exceptions into rejections 9706 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 9707 // Deferred#then to conditionally suppress rejection. 9708 } catch ( value ) { 9709 9710 // Support: Android 4.0 only 9711 // Strict mode functions invoked without .call/.apply get global-object context 9712 reject.apply( undefined, [ value ] ); 9713 } 9714} 9715 9716jQuery.extend( { 9717 9718 Deferred: function( func ) { 9719 var tuples = [ 9720 9721 // action, add listener, callbacks, 9722 // ... .then handlers, argument index, [final state] 9723 [ "notify", "progress", jQuery.Callbacks( "memory" ), 9724 jQuery.Callbacks( "memory" ), 2 ], 9725 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 9726 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 9727 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 9728 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 9729 ], 9730 state = "pending", 9731 promise = { 9732 state: function() { 9733 return state; 9734 }, 9735 always: function() { 9736 deferred.done( arguments ).fail( arguments ); 9737 return this; 9738 }, 9739 "catch": function( fn ) { 9740 return promise.then( null, fn ); 9741 }, 9742 9743 // Keep pipe for back-compat 9744 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 9745 var fns = arguments; 9746 9747 return jQuery.Deferred( function( newDefer ) { 9748 jQuery.each( tuples, function( i, tuple ) { 9749 9750 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 9751 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 9752 9753 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 9754 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 9755 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 9756 deferred[ tuple[ 1 ] ]( function() { 9757 var returned = fn && fn.apply( this, arguments ); 9758 if ( returned && isFunction( returned.promise ) ) { 9759 returned.promise() 9760 .progress( newDefer.notify ) 9761 .done( newDefer.resolve ) 9762 .fail( newDefer.reject ); 9763 } else { 9764 newDefer[ tuple[ 0 ] + "With" ]( 9765 this, 9766 fn ? [ returned ] : arguments 9767 ); 9768 } 9769 } ); 9770 } ); 9771 fns = null; 9772 } ).promise(); 9773 }, 9774 then: function( onFulfilled, onRejected, onProgress ) { 9775 var maxDepth = 0; 9776 function resolve( depth, deferred, handler, special ) { 9777 return function() { 9778 var that = this, 9779 args = arguments, 9780 mightThrow = function() { 9781 var returned, then; 9782 9783 // Support: Promises/A+ section 2.3.3.3.3 9784 // https://promisesaplus.com/#point-59 9785 // Ignore double-resolution attempts 9786 if ( depth < maxDepth ) { 9787 return; 9788 } 9789 9790 returned = handler.apply( that, args ); 9791 9792 // Support: Promises/A+ section 2.3.1 9793 // https://promisesaplus.com/#point-48 9794 if ( returned === deferred.promise() ) { 9795 throw new TypeError( "Thenable self-resolution" ); 9796 } 9797 9798 // Support: Promises/A+ sections 2.3.3.1, 3.5 9799 // https://promisesaplus.com/#point-54 9800 // https://promisesaplus.com/#point-75 9801 // Retrieve `then` only once 9802 then = returned && 9803 9804 // Support: Promises/A+ section 2.3.4 9805 // https://promisesaplus.com/#point-64 9806 // Only check objects and functions for thenability 9807 ( typeof returned === "object" || 9808 typeof returned === "function" ) && 9809 returned.then; 9810 9811 // Handle a returned thenable 9812 if ( isFunction( then ) ) { 9813 9814 // Special processors (notify) just wait for resolution 9815 if ( special ) { 9816 then.call( 9817 returned, 9818 resolve( maxDepth, deferred, Identity, special ), 9819 resolve( maxDepth, deferred, Thrower, special ) 9820 ); 9821 9822 // Normal processors (resolve) also hook into progress 9823 } else { 9824 9825 // ...and disregard older resolution values 9826 maxDepth++; 9827 9828 then.call( 9829 returned, 9830 resolve( maxDepth, deferred, Identity, special ), 9831 resolve( maxDepth, deferred, Thrower, special ), 9832 resolve( maxDepth, deferred, Identity, 9833 deferred.notifyWith ) 9834 ); 9835 } 9836 9837 // Handle all other returned values 9838 } else { 9839 9840 // Only substitute handlers pass on context 9841 // and multiple values (non-spec behavior) 9842 if ( handler !== Identity ) { 9843 that = undefined; 9844 args = [ returned ]; 9845 } 9846 9847 // Process the value(s) 9848 // Default process is resolve 9849 ( special || deferred.resolveWith )( that, args ); 9850 } 9851 }, 9852 9853 // Only normal processors (resolve) catch and reject exceptions 9854 process = special ? 9855 mightThrow : 9856 function() { 9857 try { 9858 mightThrow(); 9859 } catch ( e ) { 9860 9861 if ( jQuery.Deferred.exceptionHook ) { 9862 jQuery.Deferred.exceptionHook( e, 9863 process.stackTrace ); 9864 } 9865 9866 // Support: Promises/A+ section 2.3.3.3.4.1 9867 // https://promisesaplus.com/#point-61 9868 // Ignore post-resolution exceptions 9869 if ( depth + 1 >= maxDepth ) { 9870 9871 // Only substitute handlers pass on context 9872 // and multiple values (non-spec behavior) 9873 if ( handler !== Thrower ) { 9874 that = undefined; 9875 args = [ e ]; 9876 } 9877 9878 deferred.rejectWith( that, args ); 9879 } 9880 } 9881 }; 9882 9883 // Support: Promises/A+ section 2.3.3.3.1 9884 // https://promisesaplus.com/#point-57 9885 // Re-resolve promises immediately to dodge false rejection from 9886 // subsequent errors 9887 if ( depth ) { 9888 process(); 9889 } else { 9890 9891 // Call an optional hook to record the stack, in case of exception 9892 // since it's otherwise lost when execution goes async 9893 if ( jQuery.Deferred.getStackHook ) { 9894 process.stackTrace = jQuery.Deferred.getStackHook(); 9895 } 9896 window.setTimeout( process ); 9897 } 9898 }; 9899 } 9900 9901 return jQuery.Deferred( function( newDefer ) { 9902 9903 // progress_handlers.add( ... ) 9904 tuples[ 0 ][ 3 ].add( 9905 resolve( 9906 0, 9907 newDefer, 9908 isFunction( onProgress ) ? 9909 onProgress : 9910 Identity, 9911 newDefer.notifyWith 9912 ) 9913 ); 9914 9915 // fulfilled_handlers.add( ... ) 9916 tuples[ 1 ][ 3 ].add( 9917 resolve( 9918 0, 9919 newDefer, 9920 isFunction( onFulfilled ) ? 9921 onFulfilled : 9922 Identity 9923 ) 9924 ); 9925 9926 // rejected_handlers.add( ... ) 9927 tuples[ 2 ][ 3 ].add( 9928 resolve( 9929 0, 9930 newDefer, 9931 isFunction( onRejected ) ? 9932 onRejected : 9933 Thrower 9934 ) 9935 ); 9936 } ).promise(); 9937 }, 9938 9939 // Get a promise for this deferred 9940 // If obj is provided, the promise aspect is added to the object 9941 promise: function( obj ) { 9942 return obj != null ? jQuery.extend( obj, promise ) : promise; 9943 } 9944 }, 9945 deferred = {}; 9946 9947 // Add list-specific methods 9948 jQuery.each( tuples, function( i, tuple ) { 9949 var list = tuple[ 2 ], 9950 stateString = tuple[ 5 ]; 9951 9952 // promise.progress = list.add 9953 // promise.done = list.add 9954 // promise.fail = list.add 9955 promise[ tuple[ 1 ] ] = list.add; 9956 9957 // Handle state 9958 if ( stateString ) { 9959 list.add( 9960 function() { 9961 9962 // state = "resolved" (i.e., fulfilled) 9963 // state = "rejected" 9964 state = stateString; 9965 }, 9966 9967 // rejected_callbacks.disable 9968 // fulfilled_callbacks.disable 9969 tuples[ 3 - i ][ 2 ].disable, 9970 9971 // rejected_handlers.disable 9972 // fulfilled_handlers.disable 9973 tuples[ 3 - i ][ 3 ].disable, 9974 9975 // progress_callbacks.lock 9976 tuples[ 0 ][ 2 ].lock, 9977 9978 // progress_handlers.lock 9979 tuples[ 0 ][ 3 ].lock 9980 ); 9981 } 9982 9983 // progress_handlers.fire 9984 // fulfilled_handlers.fire 9985 // rejected_handlers.fire 9986 list.add( tuple[ 3 ].fire ); 9987 9988 // deferred.notify = function() { deferred.notifyWith(...) } 9989 // deferred.resolve = function() { deferred.resolveWith(...) } 9990 // deferred.reject = function() { deferred.rejectWith(...) } 9991 deferred[ tuple[ 0 ] ] = function() { 9992 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 9993 return this; 9994 }; 9995 9996 // deferred.notifyWith = list.fireWith 9997 // deferred.resolveWith = list.fireWith 9998 // deferred.rejectWith = list.fireWith 9999 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 10000 } ); 10001 10002 // Make the deferred a promise 10003 promise.promise( deferred ); 10004 10005 // Call given func if any 10006 if ( func ) { 10007 func.call( deferred, deferred ); 10008 } 10009 10010 // All done! 10011 return deferred; 10012 }, 10013 10014 // Deferred helper 10015 when: function( singleValue ) { 10016 var 10017 10018 // count of uncompleted subordinates 10019 remaining = arguments.length, 10020 10021 // count of unprocessed arguments 10022 i = remaining, 10023 10024 // subordinate fulfillment data 10025 resolveContexts = Array( i ), 10026 resolveValues = slice.call( arguments ), 10027 10028 // the master Deferred 10029 master = jQuery.Deferred(), 10030 10031 // subordinate callback factory 10032 updateFunc = function( i ) { 10033 return function( value ) { 10034 resolveContexts[ i ] = this; 10035 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 10036 if ( !( --remaining ) ) { 10037 master.resolveWith( resolveContexts, resolveValues ); 10038 } 10039 }; 10040 }; 10041 10042 // Single- and empty arguments are adopted like Promise.resolve 10043 if ( remaining <= 1 ) { 10044 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 10045 !remaining ); 10046 10047 // Use .then() to unwrap secondary thenables (cf. gh-3000) 10048 if ( master.state() === "pending" || 10049 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 10050 10051 return master.then(); 10052 } 10053 } 10054 10055 // Multiple arguments are aggregated like Promise.all array elements 10056 while ( i-- ) { 10057 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 10058 } 10059 10060 return master.promise(); 10061 } 10062} ); 10063 10064 10065// These usually indicate a programmer mistake during development, 10066// warn about them ASAP rather than swallowing them by default. 10067var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 10068 10069jQuery.Deferred.exceptionHook = function( error, stack ) { 10070 10071 // Support: IE 8 - 9 only 10072 // Console exists when dev tools are open, which can happen at any time 10073 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 10074 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 10075 } 10076}; 10077 10078 10079 10080 10081jQuery.readyException = function( error ) { 10082 window.setTimeout( function() { 10083 throw error; 10084 } ); 10085}; 10086 10087 10088 10089 10090// The deferred used on DOM ready 10091var readyList = jQuery.Deferred(); 10092 10093jQuery.fn.ready = function( fn ) { 10094 10095 readyList 10096 .then( fn ) 10097 10098 // Wrap jQuery.readyException in a function so that the lookup 10099 // happens at the time of error handling instead of callback 10100 // registration. 10101 .catch( function( error ) { 10102 jQuery.readyException( error ); 10103 } ); 10104 10105 return this; 10106}; 10107 10108jQuery.extend( { 10109 10110 // Is the DOM ready to be used? Set to true once it occurs. 10111 isReady: false, 10112 10113 // A counter to track how many items to wait for before 10114 // the ready event fires. See #6781 10115 readyWait: 1, 10116 10117 // Handle when the DOM is ready 10118 ready: function( wait ) { 10119 10120 // Abort if there are pending holds or we're already ready 10121 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 10122 return; 10123 } 10124 10125 // Remember that the DOM is ready 10126 jQuery.isReady = true; 10127 10128 // If a normal DOM Ready event fired, decrement, and wait if need be 10129 if ( wait !== true && --jQuery.readyWait > 0 ) { 10130 return; 10131 } 10132 10133 // If there are functions bound, to execute 10134 readyList.resolveWith( document, [ jQuery ] ); 10135 } 10136} ); 10137 10138jQuery.ready.then = readyList.then; 10139 10140// The ready event handler and self cleanup method 10141function completed() { 10142 document.removeEventListener( "DOMContentLoaded", completed ); 10143 window.removeEventListener( "load", completed ); 10144 jQuery.ready(); 10145} 10146 10147// Catch cases where $(document).ready() is called 10148// after the browser event has already occurred. 10149// Support: IE <=9 - 10 only 10150// Older IE sometimes signals "interactive" too soon 10151if ( document.readyState === "complete" || 10152 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 10153 10154 // Handle it asynchronously to allow scripts the opportunity to delay ready 10155 window.setTimeout( jQuery.ready ); 10156 10157} else { 10158 10159 // Use the handy event callback 10160 document.addEventListener( "DOMContentLoaded", completed ); 10161 10162 // A fallback to window.onload, that will always work 10163 window.addEventListener( "load", completed ); 10164} 10165 10166 10167 10168 10169// Multifunctional method to get and set values of a collection 10170// The value/s can optionally be executed if it's a function 10171var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 10172 var i = 0, 10173 len = elems.length, 10174 bulk = key == null; 10175 10176 // Sets many values 10177 if ( toType( key ) === "object" ) { 10178 chainable = true; 10179 for ( i in key ) { 10180 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 10181 } 10182 10183 // Sets one value 10184 } else if ( value !== undefined ) { 10185 chainable = true; 10186 10187 if ( !isFunction( value ) ) { 10188 raw = true; 10189 } 10190 10191 if ( bulk ) { 10192 10193 // Bulk operations run against the entire set 10194 if ( raw ) { 10195 fn.call( elems, value ); 10196 fn = null; 10197 10198 // ...except when executing function values 10199 } else { 10200 bulk = fn; 10201 fn = function( elem, key, value ) { 10202 return bulk.call( jQuery( elem ), value ); 10203 }; 10204 } 10205 } 10206 10207 if ( fn ) { 10208 for ( ; i < len; i++ ) { 10209 fn( 10210 elems[ i ], key, raw ? 10211 value : 10212 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 10213 ); 10214 } 10215 } 10216 } 10217 10218 if ( chainable ) { 10219 return elems; 10220 } 10221 10222 // Gets 10223 if ( bulk ) { 10224 return fn.call( elems ); 10225 } 10226 10227 return len ? fn( elems[ 0 ], key ) : emptyGet; 10228}; 10229 10230 10231// Matches dashed string for camelizing 10232var rmsPrefix = /^-ms-/, 10233 rdashAlpha = /-([a-z])/g; 10234 10235// Used by camelCase as callback to replace() 10236function fcamelCase( all, letter ) { 10237 return letter.toUpperCase(); 10238} 10239 10240// Convert dashed to camelCase; used by the css and data modules 10241// Support: IE <=9 - 11, Edge 12 - 15 10242// Microsoft forgot to hump their vendor prefix (#9572) 10243function camelCase( string ) { 10244 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 10245} 10246var acceptData = function( owner ) { 10247 10248 // Accepts only: 10249 // - Node 10250 // - Node.ELEMENT_NODE 10251 // - Node.DOCUMENT_NODE 10252 // - Object 10253 // - Any 10254 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 10255}; 10256 10257 10258 10259 10260function Data() { 10261 this.expando = jQuery.expando + Data.uid++; 10262} 10263 10264Data.uid = 1; 10265 10266Data.prototype = { 10267 10268 cache: function( owner ) { 10269 10270 // Check if the owner object already has a cache 10271 var value = owner[ this.expando ]; 10272 10273 // If not, create one 10274 if ( !value ) { 10275 value = {}; 10276 10277 // We can accept data for non-element nodes in modern browsers, 10278 // but we should not, see #8335. 10279 // Always return an empty object. 10280 if ( acceptData( owner ) ) { 10281 10282 // If it is a node unlikely to be stringify-ed or looped over 10283 // use plain assignment 10284 if ( owner.nodeType ) { 10285 owner[ this.expando ] = value; 10286 10287 // Otherwise secure it in a non-enumerable property 10288 // configurable must be true to allow the property to be 10289 // deleted when data is removed 10290 } else { 10291 Object.defineProperty( owner, this.expando, { 10292 value: value, 10293 configurable: true 10294 } ); 10295 } 10296 } 10297 } 10298 10299 return value; 10300 }, 10301 set: function( owner, data, value ) { 10302 var prop, 10303 cache = this.cache( owner ); 10304 10305 // Handle: [ owner, key, value ] args 10306 // Always use camelCase key (gh-2257) 10307 if ( typeof data === "string" ) { 10308 cache[ camelCase( data ) ] = value; 10309 10310 // Handle: [ owner, { properties } ] args 10311 } else { 10312 10313 // Copy the properties one-by-one to the cache object 10314 for ( prop in data ) { 10315 cache[ camelCase( prop ) ] = data[ prop ]; 10316 } 10317 } 10318 return cache; 10319 }, 10320 get: function( owner, key ) { 10321 return key === undefined ? 10322 this.cache( owner ) : 10323 10324 // Always use camelCase key (gh-2257) 10325 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 10326 }, 10327 access: function( owner, key, value ) { 10328 10329 // In cases where either: 10330 // 10331 // 1. No key was specified 10332 // 2. A string key was specified, but no value provided 10333 // 10334 // Take the "read" path and allow the get method to determine 10335 // which value to return, respectively either: 10336 // 10337 // 1. The entire cache object 10338 // 2. The data stored at the key 10339 // 10340 if ( key === undefined || 10341 ( ( key && typeof key === "string" ) && value === undefined ) ) { 10342 10343 return this.get( owner, key ); 10344 } 10345 10346 // When the key is not a string, or both a key and value 10347 // are specified, set or extend (existing objects) with either: 10348 // 10349 // 1. An object of properties 10350 // 2. A key and value 10351 // 10352 this.set( owner, key, value ); 10353 10354 // Since the "set" path can have two possible entry points 10355 // return the expected data based on which path was taken[*] 10356 return value !== undefined ? value : key; 10357 }, 10358 remove: function( owner, key ) { 10359 var i, 10360 cache = owner[ this.expando ]; 10361 10362 if ( cache === undefined ) { 10363 return; 10364 } 10365 10366 if ( key !== undefined ) { 10367 10368 // Support array or space separated string of keys 10369 if ( Array.isArray( key ) ) { 10370 10371 // If key is an array of keys... 10372 // We always set camelCase keys, so remove that. 10373 key = key.map( camelCase ); 10374 } else { 10375 key = camelCase( key ); 10376 10377 // If a key with the spaces exists, use it. 10378 // Otherwise, create an array by matching non-whitespace 10379 key = key in cache ? 10380 [ key ] : 10381 ( key.match( rnothtmlwhite ) || [] ); 10382 } 10383 10384 i = key.length; 10385 10386 while ( i-- ) { 10387 delete cache[ key[ i ] ]; 10388 } 10389 } 10390 10391 // Remove the expando if there's no more data 10392 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 10393 10394 // Support: Chrome <=35 - 45 10395 // Webkit & Blink performance suffers when deleting properties 10396 // from DOM nodes, so set to undefined instead 10397 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 10398 if ( owner.nodeType ) { 10399 owner[ this.expando ] = undefined; 10400 } else { 10401 delete owner[ this.expando ]; 10402 } 10403 } 10404 }, 10405 hasData: function( owner ) { 10406 var cache = owner[ this.expando ]; 10407 return cache !== undefined && !jQuery.isEmptyObject( cache ); 10408 } 10409}; 10410var dataPriv = new Data(); 10411 10412var dataUser = new Data(); 10413 10414 10415 10416// Implementation Summary 10417// 10418// 1. Enforce API surface and semantic compatibility with 1.9.x branch 10419// 2. Improve the module's maintainability by reducing the storage 10420// paths to a single mechanism. 10421// 3. Use the same single mechanism to support "private" and "user" data. 10422// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 10423// 5. Avoid exposing implementation details on user objects (eg. expando properties) 10424// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 10425 10426var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 10427 rmultiDash = /[A-Z]/g; 10428 10429function getData( data ) { 10430 if ( data === "true" ) { 10431 return true; 10432 } 10433 10434 if ( data === "false" ) { 10435 return false; 10436 } 10437 10438 if ( data === "null" ) { 10439 return null; 10440 } 10441 10442 // Only convert to a number if it doesn't change the string 10443 if ( data === +data + "" ) { 10444 return +data; 10445 } 10446 10447 if ( rbrace.test( data ) ) { 10448 return JSON.parse( data ); 10449 } 10450 10451 return data; 10452} 10453 10454function dataAttr( elem, key, data ) { 10455 var name; 10456 10457 // If nothing was found internally, try to fetch any 10458 // data from the HTML5 data-* attribute 10459 if ( data === undefined && elem.nodeType === 1 ) { 10460 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 10461 data = elem.getAttribute( name ); 10462 10463 if ( typeof data === "string" ) { 10464 try { 10465 data = getData( data ); 10466 } catch ( e ) {} 10467 10468 // Make sure we set the data so it isn't changed later 10469 dataUser.set( elem, key, data ); 10470 } else { 10471 data = undefined; 10472 } 10473 } 10474 return data; 10475} 10476 10477jQuery.extend( { 10478 hasData: function( elem ) { 10479 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 10480 }, 10481 10482 data: function( elem, name, data ) { 10483 return dataUser.access( elem, name, data ); 10484 }, 10485 10486 removeData: function( elem, name ) { 10487 dataUser.remove( elem, name ); 10488 }, 10489 10490 // TODO: Now that all calls to _data and _removeData have been replaced 10491 // with direct calls to dataPriv methods, these can be deprecated. 10492 _data: function( elem, name, data ) { 10493 return dataPriv.access( elem, name, data ); 10494 }, 10495 10496 _removeData: function( elem, name ) { 10497 dataPriv.remove( elem, name ); 10498 } 10499} ); 10500 10501jQuery.fn.extend( { 10502 data: function( key, value ) { 10503 var i, name, data, 10504 elem = this[ 0 ], 10505 attrs = elem && elem.attributes; 10506 10507 // Gets all values 10508 if ( key === undefined ) { 10509 if ( this.length ) { 10510 data = dataUser.get( elem ); 10511 10512 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 10513 i = attrs.length; 10514 while ( i-- ) { 10515 10516 // Support: IE 11 only 10517 // The attrs elements can be null (#14894) 10518 if ( attrs[ i ] ) { 10519 name = attrs[ i ].name; 10520 if ( name.indexOf( "data-" ) === 0 ) { 10521 name = camelCase( name.slice( 5 ) ); 10522 dataAttr( elem, name, data[ name ] ); 10523 } 10524 } 10525 } 10526 dataPriv.set( elem, "hasDataAttrs", true ); 10527 } 10528 } 10529 10530 return data; 10531 } 10532 10533 // Sets multiple values 10534 if ( typeof key === "object" ) { 10535 return this.each( function() { 10536 dataUser.set( this, key ); 10537 } ); 10538 } 10539 10540 return access( this, function( value ) { 10541 var data; 10542 10543 // The calling jQuery object (element matches) is not empty 10544 // (and therefore has an element appears at this[ 0 ]) and the 10545 // `value` parameter was not undefined. An empty jQuery object 10546 // will result in `undefined` for elem = this[ 0 ] which will 10547 // throw an exception if an attempt to read a data cache is made. 10548 if ( elem && value === undefined ) { 10549 10550 // Attempt to get data from the cache 10551 // The key will always be camelCased in Data 10552 data = dataUser.get( elem, key ); 10553 if ( data !== undefined ) { 10554 return data; 10555 } 10556 10557 // Attempt to "discover" the data in 10558 // HTML5 custom data-* attrs 10559 data = dataAttr( elem, key ); 10560 if ( data !== undefined ) { 10561 return data; 10562 } 10563 10564 // We tried really hard, but the data doesn't exist. 10565 return; 10566 } 10567 10568 // Set the data... 10569 this.each( function() { 10570 10571 // We always store the camelCased key 10572 dataUser.set( this, key, value ); 10573 } ); 10574 }, null, value, arguments.length > 1, null, true ); 10575 }, 10576 10577 removeData: function( key ) { 10578 return this.each( function() { 10579 dataUser.remove( this, key ); 10580 } ); 10581 } 10582} ); 10583 10584 10585jQuery.extend( { 10586 queue: function( elem, type, data ) { 10587 var queue; 10588 10589 if ( elem ) { 10590 type = ( type || "fx" ) + "queue"; 10591 queue = dataPriv.get( elem, type ); 10592 10593 // Speed up dequeue by getting out quickly if this is just a lookup 10594 if ( data ) { 10595 if ( !queue || Array.isArray( data ) ) { 10596 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 10597 } else { 10598 queue.push( data ); 10599 } 10600 } 10601 return queue || []; 10602 } 10603 }, 10604 10605 dequeue: function( elem, type ) { 10606 type = type || "fx"; 10607 10608 var queue = jQuery.queue( elem, type ), 10609 startLength = queue.length, 10610 fn = queue.shift(), 10611 hooks = jQuery._queueHooks( elem, type ), 10612 next = function() { 10613 jQuery.dequeue( elem, type ); 10614 }; 10615 10616 // If the fx queue is dequeued, always remove the progress sentinel 10617 if ( fn === "inprogress" ) { 10618 fn = queue.shift(); 10619 startLength--; 10620 } 10621 10622 if ( fn ) { 10623 10624 // Add a progress sentinel to prevent the fx queue from being 10625 // automatically dequeued 10626 if ( type === "fx" ) { 10627 queue.unshift( "inprogress" ); 10628 } 10629 10630 // Clear up the last queue stop function 10631 delete hooks.stop; 10632 fn.call( elem, next, hooks ); 10633 } 10634 10635 if ( !startLength && hooks ) { 10636 hooks.empty.fire(); 10637 } 10638 }, 10639 10640 // Not public - generate a queueHooks object, or return the current one 10641 _queueHooks: function( elem, type ) { 10642 var key = type + "queueHooks"; 10643 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 10644 empty: jQuery.Callbacks( "once memory" ).add( function() { 10645 dataPriv.remove( elem, [ type + "queue", key ] ); 10646 } ) 10647 } ); 10648 } 10649} ); 10650 10651jQuery.fn.extend( { 10652 queue: function( type, data ) { 10653 var setter = 2; 10654 10655 if ( typeof type !== "string" ) { 10656 data = type; 10657 type = "fx"; 10658 setter--; 10659 } 10660 10661 if ( arguments.length < setter ) { 10662 return jQuery.queue( this[ 0 ], type ); 10663 } 10664 10665 return data === undefined ? 10666 this : 10667 this.each( function() { 10668 var queue = jQuery.queue( this, type, data ); 10669 10670 // Ensure a hooks for this queue 10671 jQuery._queueHooks( this, type ); 10672 10673 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 10674 jQuery.dequeue( this, type ); 10675 } 10676 } ); 10677 }, 10678 dequeue: function( type ) { 10679 return this.each( function() { 10680 jQuery.dequeue( this, type ); 10681 } ); 10682 }, 10683 clearQueue: function( type ) { 10684 return this.queue( type || "fx", [] ); 10685 }, 10686 10687 // Get a promise resolved when queues of a certain type 10688 // are emptied (fx is the type by default) 10689 promise: function( type, obj ) { 10690 var tmp, 10691 count = 1, 10692 defer = jQuery.Deferred(), 10693 elements = this, 10694 i = this.length, 10695 resolve = function() { 10696 if ( !( --count ) ) { 10697 defer.resolveWith( elements, [ elements ] ); 10698 } 10699 }; 10700 10701 if ( typeof type !== "string" ) { 10702 obj = type; 10703 type = undefined; 10704 } 10705 type = type || "fx"; 10706 10707 while ( i-- ) { 10708 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 10709 if ( tmp && tmp.empty ) { 10710 count++; 10711 tmp.empty.add( resolve ); 10712 } 10713 } 10714 resolve(); 10715 return defer.promise( obj ); 10716 } 10717} ); 10718var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 10719 10720var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 10721 10722 10723var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 10724 10725var isHiddenWithinTree = function( elem, el ) { 10726 10727 // isHiddenWithinTree might be called from jQuery#filter function; 10728 // in that case, element will be second argument 10729 elem = el || elem; 10730 10731 // Inline style trumps all 10732 return elem.style.display === "none" || 10733 elem.style.display === "" && 10734 10735 // Otherwise, check computed style 10736 // Support: Firefox <=43 - 45 10737 // Disconnected elements can have computed display: none, so first confirm that elem is 10738 // in the document. 10739 jQuery.contains( elem.ownerDocument, elem ) && 10740 10741 jQuery.css( elem, "display" ) === "none"; 10742 }; 10743 10744var swap = function( elem, options, callback, args ) { 10745 var ret, name, 10746 old = {}; 10747 10748 // Remember the old values, and insert the new ones 10749 for ( name in options ) { 10750 old[ name ] = elem.style[ name ]; 10751 elem.style[ name ] = options[ name ]; 10752 } 10753 10754 ret = callback.apply( elem, args || [] ); 10755 10756 // Revert the old values 10757 for ( name in options ) { 10758 elem.style[ name ] = old[ name ]; 10759 } 10760 10761 return ret; 10762}; 10763 10764 10765 10766 10767function adjustCSS( elem, prop, valueParts, tween ) { 10768 var adjusted, scale, 10769 maxIterations = 20, 10770 currentValue = tween ? 10771 function() { 10772 return tween.cur(); 10773 } : 10774 function() { 10775 return jQuery.css( elem, prop, "" ); 10776 }, 10777 initial = currentValue(), 10778 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 10779 10780 // Starting value computation is required for potential unit mismatches 10781 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 10782 rcssNum.exec( jQuery.css( elem, prop ) ); 10783 10784 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 10785 10786 // Support: Firefox <=54 10787 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 10788 initial = initial / 2; 10789 10790 // Trust units reported by jQuery.css 10791 unit = unit || initialInUnit[ 3 ]; 10792 10793 // Iteratively approximate from a nonzero starting point 10794 initialInUnit = +initial || 1; 10795 10796 while ( maxIterations-- ) { 10797 10798 // Evaluate and update our best guess (doubling guesses that zero out). 10799 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 10800 jQuery.style( elem, prop, initialInUnit + unit ); 10801 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 10802 maxIterations = 0; 10803 } 10804 initialInUnit = initialInUnit / scale; 10805 10806 } 10807 10808 initialInUnit = initialInUnit * 2; 10809 jQuery.style( elem, prop, initialInUnit + unit ); 10810 10811 // Make sure we update the tween properties later on 10812 valueParts = valueParts || []; 10813 } 10814 10815 if ( valueParts ) { 10816 initialInUnit = +initialInUnit || +initial || 0; 10817 10818 // Apply relative offset (+=/-=) if specified 10819 adjusted = valueParts[ 1 ] ? 10820 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 10821 +valueParts[ 2 ]; 10822 if ( tween ) { 10823 tween.unit = unit; 10824 tween.start = initialInUnit; 10825 tween.end = adjusted; 10826 } 10827 } 10828 return adjusted; 10829} 10830 10831 10832var defaultDisplayMap = {}; 10833 10834function getDefaultDisplay( elem ) { 10835 var temp, 10836 doc = elem.ownerDocument, 10837 nodeName = elem.nodeName, 10838 display = defaultDisplayMap[ nodeName ]; 10839 10840 if ( display ) { 10841 return display; 10842 } 10843 10844 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 10845 display = jQuery.css( temp, "display" ); 10846 10847 temp.parentNode.removeChild( temp ); 10848 10849 if ( display === "none" ) { 10850 display = "block"; 10851 } 10852 defaultDisplayMap[ nodeName ] = display; 10853 10854 return display; 10855} 10856 10857function showHide( elements, show ) { 10858 var display, elem, 10859 values = [], 10860 index = 0, 10861 length = elements.length; 10862 10863 // Determine new display value for elements that need to change 10864 for ( ; index < length; index++ ) { 10865 elem = elements[ index ]; 10866 if ( !elem.style ) { 10867 continue; 10868 } 10869 10870 display = elem.style.display; 10871 if ( show ) { 10872 10873 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 10874 // check is required in this first loop unless we have a nonempty display value (either 10875 // inline or about-to-be-restored) 10876 if ( display === "none" ) { 10877 values[ index ] = dataPriv.get( elem, "display" ) || null; 10878 if ( !values[ index ] ) { 10879 elem.style.display = ""; 10880 } 10881 } 10882 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 10883 values[ index ] = getDefaultDisplay( elem ); 10884 } 10885 } else { 10886 if ( display !== "none" ) { 10887 values[ index ] = "none"; 10888 10889 // Remember what we're overwriting 10890 dataPriv.set( elem, "display", display ); 10891 } 10892 } 10893 } 10894 10895 // Set the display of the elements in a second loop to avoid constant reflow 10896 for ( index = 0; index < length; index++ ) { 10897 if ( values[ index ] != null ) { 10898 elements[ index ].style.display = values[ index ]; 10899 } 10900 } 10901 10902 return elements; 10903} 10904 10905jQuery.fn.extend( { 10906 show: function() { 10907 return showHide( this, true ); 10908 }, 10909 hide: function() { 10910 return showHide( this ); 10911 }, 10912 toggle: function( state ) { 10913 if ( typeof state === "boolean" ) { 10914 return state ? this.show() : this.hide(); 10915 } 10916 10917 return this.each( function() { 10918 if ( isHiddenWithinTree( this ) ) { 10919 jQuery( this ).show(); 10920 } else { 10921 jQuery( this ).hide(); 10922 } 10923 } ); 10924 } 10925} ); 10926var rcheckableType = ( /^(?:checkbox|radio)$/i ); 10927 10928var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); 10929 10930var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 10931 10932 10933 10934// We have to close these tags to support XHTML (#13200) 10935var wrapMap = { 10936 10937 // Support: IE <=9 only 10938 option: [ 1, "<select multiple='multiple'>", "</select>" ], 10939 10940 // XHTML parsers do not magically insert elements in the 10941 // same way that tag soup parsers do. So we cannot shorten 10942 // this by omitting <tbody> or other required elements. 10943 thead: [ 1, "<table>", "</table>" ], 10944 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 10945 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 10946 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 10947 10948 _default: [ 0, "", "" ] 10949}; 10950 10951// Support: IE <=9 only 10952wrapMap.optgroup = wrapMap.option; 10953 10954wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 10955wrapMap.th = wrapMap.td; 10956 10957 10958function getAll( context, tag ) { 10959 10960 // Support: IE <=9 - 11 only 10961 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 10962 var ret; 10963 10964 if ( typeof context.getElementsByTagName !== "undefined" ) { 10965 ret = context.getElementsByTagName( tag || "*" ); 10966 10967 } else if ( typeof context.querySelectorAll !== "undefined" ) { 10968 ret = context.querySelectorAll( tag || "*" ); 10969 10970 } else { 10971 ret = []; 10972 } 10973 10974 if ( tag === undefined || tag && nodeName( context, tag ) ) { 10975 return jQuery.merge( [ context ], ret ); 10976 } 10977 10978 return ret; 10979} 10980 10981 10982// Mark scripts as having already been evaluated 10983function setGlobalEval( elems, refElements ) { 10984 var i = 0, 10985 l = elems.length; 10986 10987 for ( ; i < l; i++ ) { 10988 dataPriv.set( 10989 elems[ i ], 10990 "globalEval", 10991 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 10992 ); 10993 } 10994} 10995 10996 10997var rhtml = /<|&#?\w+;/; 10998 10999function buildFragment( elems, context, scripts, selection, ignored ) { 11000 var elem, tmp, tag, wrap, contains, j, 11001 fragment = context.createDocumentFragment(), 11002 nodes = [], 11003 i = 0, 11004 l = elems.length; 11005 11006 for ( ; i < l; i++ ) { 11007 elem = elems[ i ]; 11008 11009 if ( elem || elem === 0 ) { 11010 11011 // Add nodes directly 11012 if ( toType( elem ) === "object" ) { 11013 11014 // Support: Android <=4.0 only, PhantomJS 1 only 11015 // push.apply(_, arraylike) throws on ancient WebKit 11016 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 11017 11018 // Convert non-html into a text node 11019 } else if ( !rhtml.test( elem ) ) { 11020 nodes.push( context.createTextNode( elem ) ); 11021 11022 // Convert html into DOM nodes 11023 } else { 11024 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 11025 11026 // Deserialize a standard representation 11027 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 11028 wrap = wrapMap[ tag ] || wrapMap._default; 11029 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 11030 11031 // Descend through wrappers to the right content 11032 j = wrap[ 0 ]; 11033 while ( j-- ) { 11034 tmp = tmp.lastChild; 11035 } 11036 11037 // Support: Android <=4.0 only, PhantomJS 1 only 11038 // push.apply(_, arraylike) throws on ancient WebKit 11039 jQuery.merge( nodes, tmp.childNodes ); 11040 11041 // Remember the top-level container 11042 tmp = fragment.firstChild; 11043 11044 // Ensure the created nodes are orphaned (#12392) 11045 tmp.textContent = ""; 11046 } 11047 } 11048 } 11049 11050 // Remove wrapper from fragment 11051 fragment.textContent = ""; 11052 11053 i = 0; 11054 while ( ( elem = nodes[ i++ ] ) ) { 11055 11056 // Skip elements already in the context collection (trac-4087) 11057 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 11058 if ( ignored ) { 11059 ignored.push( elem ); 11060 } 11061 continue; 11062 } 11063 11064 contains = jQuery.contains( elem.ownerDocument, elem ); 11065 11066 // Append to fragment 11067 tmp = getAll( fragment.appendChild( elem ), "script" ); 11068 11069 // Preserve script evaluation history 11070 if ( contains ) { 11071 setGlobalEval( tmp ); 11072 } 11073 11074 // Capture executables 11075 if ( scripts ) { 11076 j = 0; 11077 while ( ( elem = tmp[ j++ ] ) ) { 11078 if ( rscriptType.test( elem.type || "" ) ) { 11079 scripts.push( elem ); 11080 } 11081 } 11082 } 11083 } 11084 11085 return fragment; 11086} 11087 11088 11089( function() { 11090 var fragment = document.createDocumentFragment(), 11091 div = fragment.appendChild( document.createElement( "div" ) ), 11092 input = document.createElement( "input" ); 11093 11094 // Support: Android 4.0 - 4.3 only 11095 // Check state lost if the name is set (#11217) 11096 // Support: Windows Web Apps (WWA) 11097 // `name` and `type` must use .setAttribute for WWA (#14901) 11098 input.setAttribute( "type", "radio" ); 11099 input.setAttribute( "checked", "checked" ); 11100 input.setAttribute( "name", "t" ); 11101 11102 div.appendChild( input ); 11103 11104 // Support: Android <=4.1 only 11105 // Older WebKit doesn't clone checked state correctly in fragments 11106 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 11107 11108 // Support: IE <=11 only 11109 // Make sure textarea (and checkbox) defaultValue is properly cloned 11110 div.innerHTML = "<textarea>x</textarea>"; 11111 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 11112} )(); 11113var documentElement = document.documentElement; 11114 11115 11116 11117var 11118 rkeyEvent = /^key/, 11119 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 11120 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 11121 11122function returnTrue() { 11123 return true; 11124} 11125 11126function returnFalse() { 11127 return false; 11128} 11129 11130// Support: IE <=9 only 11131// See #13393 for more info 11132function safeActiveElement() { 11133 try { 11134 return document.activeElement; 11135 } catch ( err ) { } 11136} 11137 11138function on( elem, types, selector, data, fn, one ) { 11139 var origFn, type; 11140 11141 // Types can be a map of types/handlers 11142 if ( typeof types === "object" ) { 11143 11144 // ( types-Object, selector, data ) 11145 if ( typeof selector !== "string" ) { 11146 11147 // ( types-Object, data ) 11148 data = data || selector; 11149 selector = undefined; 11150 } 11151 for ( type in types ) { 11152 on( elem, type, selector, data, types[ type ], one ); 11153 } 11154 return elem; 11155 } 11156 11157 if ( data == null && fn == null ) { 11158 11159 // ( types, fn ) 11160 fn = selector; 11161 data = selector = undefined; 11162 } else if ( fn == null ) { 11163 if ( typeof selector === "string" ) { 11164 11165 // ( types, selector, fn ) 11166 fn = data; 11167 data = undefined; 11168 } else { 11169 11170 // ( types, data, fn ) 11171 fn = data; 11172 data = selector; 11173 selector = undefined; 11174 } 11175 } 11176 if ( fn === false ) { 11177 fn = returnFalse; 11178 } else if ( !fn ) { 11179 return elem; 11180 } 11181 11182 if ( one === 1 ) { 11183 origFn = fn; 11184 fn = function( event ) { 11185 11186 // Can use an empty set, since event contains the info 11187 jQuery().off( event ); 11188 return origFn.apply( this, arguments ); 11189 }; 11190 11191 // Use same guid so caller can remove using origFn 11192 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 11193 } 11194 return elem.each( function() { 11195 jQuery.event.add( this, types, fn, data, selector ); 11196 } ); 11197} 11198 11199/* 11200 * Helper functions for managing events -- not part of the public interface. 11201 * Props to Dean Edwards' addEvent library for many of the ideas. 11202 */ 11203jQuery.event = { 11204 11205 global: {}, 11206 11207 add: function( elem, types, handler, data, selector ) { 11208 11209 var handleObjIn, eventHandle, tmp, 11210 events, t, handleObj, 11211 special, handlers, type, namespaces, origType, 11212 elemData = dataPriv.get( elem ); 11213 11214 // Don't attach events to noData or text/comment nodes (but allow plain objects) 11215 if ( !elemData ) { 11216 return; 11217 } 11218 11219 // Caller can pass in an object of custom data in lieu of the handler 11220 if ( handler.handler ) { 11221 handleObjIn = handler; 11222 handler = handleObjIn.handler; 11223 selector = handleObjIn.selector; 11224 } 11225 11226 // Ensure that invalid selectors throw exceptions at attach time 11227 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 11228 if ( selector ) { 11229 jQuery.find.matchesSelector( documentElement, selector ); 11230 } 11231 11232 // Make sure that the handler has a unique ID, used to find/remove it later 11233 if ( !handler.guid ) { 11234 handler.guid = jQuery.guid++; 11235 } 11236 11237 // Init the element's event structure and main handler, if this is the first 11238 if ( !( events = elemData.events ) ) { 11239 events = elemData.events = {}; 11240 } 11241 if ( !( eventHandle = elemData.handle ) ) { 11242 eventHandle = elemData.handle = function( e ) { 11243 11244 // Discard the second event of a jQuery.event.trigger() and 11245 // when an event is called after a page has unloaded 11246 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 11247 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 11248 }; 11249 } 11250 11251 // Handle multiple events separated by a space 11252 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 11253 t = types.length; 11254 while ( t-- ) { 11255 tmp = rtypenamespace.exec( types[ t ] ) || []; 11256 type = origType = tmp[ 1 ]; 11257 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 11258 11259 // There *must* be a type, no attaching namespace-only handlers 11260 if ( !type ) { 11261 continue; 11262 } 11263 11264 // If event changes its type, use the special event handlers for the changed type 11265 special = jQuery.event.special[ type ] || {}; 11266 11267 // If selector defined, determine special event api type, otherwise given type 11268 type = ( selector ? special.delegateType : special.bindType ) || type; 11269 11270 // Update special based on newly reset type 11271 special = jQuery.event.special[ type ] || {}; 11272 11273 // handleObj is passed to all event handlers 11274 handleObj = jQuery.extend( { 11275 type: type, 11276 origType: origType, 11277 data: data, 11278 handler: handler, 11279 guid: handler.guid, 11280 selector: selector, 11281 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 11282 namespace: namespaces.join( "." ) 11283 }, handleObjIn ); 11284 11285 // Init the event handler queue if we're the first 11286 if ( !( handlers = events[ type ] ) ) { 11287 handlers = events[ type ] = []; 11288 handlers.delegateCount = 0; 11289 11290 // Only use addEventListener if the special events handler returns false 11291 if ( !special.setup || 11292 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 11293 11294 if ( elem.addEventListener ) { 11295 elem.addEventListener( type, eventHandle ); 11296 } 11297 } 11298 } 11299 11300 if ( special.add ) { 11301 special.add.call( elem, handleObj ); 11302 11303 if ( !handleObj.handler.guid ) { 11304 handleObj.handler.guid = handler.guid; 11305 } 11306 } 11307 11308 // Add to the element's handler list, delegates in front 11309 if ( selector ) { 11310 handlers.splice( handlers.delegateCount++, 0, handleObj ); 11311 } else { 11312 handlers.push( handleObj ); 11313 } 11314 11315 // Keep track of which events have ever been used, for event optimization 11316 jQuery.event.global[ type ] = true; 11317 } 11318 11319 }, 11320 11321 // Detach an event or set of events from an element 11322 remove: function( elem, types, handler, selector, mappedTypes ) { 11323 11324 var j, origCount, tmp, 11325 events, t, handleObj, 11326 special, handlers, type, namespaces, origType, 11327 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 11328 11329 if ( !elemData || !( events = elemData.events ) ) { 11330 return; 11331 } 11332 11333 // Once for each type.namespace in types; type may be omitted 11334 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 11335 t = types.length; 11336 while ( t-- ) { 11337 tmp = rtypenamespace.exec( types[ t ] ) || []; 11338 type = origType = tmp[ 1 ]; 11339 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 11340 11341 // Unbind all events (on this namespace, if provided) for the element 11342 if ( !type ) { 11343 for ( type in events ) { 11344 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 11345 } 11346 continue; 11347 } 11348 11349 special = jQuery.event.special[ type ] || {}; 11350 type = ( selector ? special.delegateType : special.bindType ) || type; 11351 handlers = events[ type ] || []; 11352 tmp = tmp[ 2 ] && 11353 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 11354 11355 // Remove matching events 11356 origCount = j = handlers.length; 11357 while ( j-- ) { 11358 handleObj = handlers[ j ]; 11359 11360 if ( ( mappedTypes || origType === handleObj.origType ) && 11361 ( !handler || handler.guid === handleObj.guid ) && 11362 ( !tmp || tmp.test( handleObj.namespace ) ) && 11363 ( !selector || selector === handleObj.selector || 11364 selector === "**" && handleObj.selector ) ) { 11365 handlers.splice( j, 1 ); 11366 11367 if ( handleObj.selector ) { 11368 handlers.delegateCount--; 11369 } 11370 if ( special.remove ) { 11371 special.remove.call( elem, handleObj ); 11372 } 11373 } 11374 } 11375 11376 // Remove generic event handler if we removed something and no more handlers exist 11377 // (avoids potential for endless recursion during removal of special event handlers) 11378 if ( origCount && !handlers.length ) { 11379 if ( !special.teardown || 11380 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 11381 11382 jQuery.removeEvent( elem, type, elemData.handle ); 11383 } 11384 11385 delete events[ type ]; 11386 } 11387 } 11388 11389 // Remove data and the expando if it's no longer used 11390 if ( jQuery.isEmptyObject( events ) ) { 11391 dataPriv.remove( elem, "handle events" ); 11392 } 11393 }, 11394 11395 dispatch: function( nativeEvent ) { 11396 11397 // Make a writable jQuery.Event from the native event object 11398 var event = jQuery.event.fix( nativeEvent ); 11399 11400 var i, j, ret, matched, handleObj, handlerQueue, 11401 args = new Array( arguments.length ), 11402 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], 11403 special = jQuery.event.special[ event.type ] || {}; 11404 11405 // Use the fix-ed jQuery.Event rather than the (read-only) native event 11406 args[ 0 ] = event; 11407 11408 for ( i = 1; i < arguments.length; i++ ) { 11409 args[ i ] = arguments[ i ]; 11410 } 11411 11412 event.delegateTarget = this; 11413 11414 // Call the preDispatch hook for the mapped type, and let it bail if desired 11415 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 11416 return; 11417 } 11418 11419 // Determine handlers 11420 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 11421 11422 // Run delegates first; they may want to stop propagation beneath us 11423 i = 0; 11424 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 11425 event.currentTarget = matched.elem; 11426 11427 j = 0; 11428 while ( ( handleObj = matched.handlers[ j++ ] ) && 11429 !event.isImmediatePropagationStopped() ) { 11430 11431 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 11432 // a subset or equal to those in the bound event (both can have no namespace). 11433 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 11434 11435 event.handleObj = handleObj; 11436 event.data = handleObj.data; 11437 11438 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 11439 handleObj.handler ).apply( matched.elem, args ); 11440 11441 if ( ret !== undefined ) { 11442 if ( ( event.result = ret ) === false ) { 11443 event.preventDefault(); 11444 event.stopPropagation(); 11445 } 11446 } 11447 } 11448 } 11449 } 11450 11451 // Call the postDispatch hook for the mapped type 11452 if ( special.postDispatch ) { 11453 special.postDispatch.call( this, event ); 11454 } 11455 11456 return event.result; 11457 }, 11458 11459 handlers: function( event, handlers ) { 11460 var i, handleObj, sel, matchedHandlers, matchedSelectors, 11461 handlerQueue = [], 11462 delegateCount = handlers.delegateCount, 11463 cur = event.target; 11464 11465 // Find delegate handlers 11466 if ( delegateCount && 11467 11468 // Support: IE <=9 11469 // Black-hole SVG <use> instance trees (trac-13180) 11470 cur.nodeType && 11471 11472 // Support: Firefox <=42 11473 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 11474 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 11475 // Support: IE 11 only 11476 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 11477 !( event.type === "click" && event.button >= 1 ) ) { 11478 11479 for ( ; cur !== this; cur = cur.parentNode || this ) { 11480 11481 // Don't check non-elements (#13208) 11482 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 11483 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 11484 matchedHandlers = []; 11485 matchedSelectors = {}; 11486 for ( i = 0; i < delegateCount; i++ ) { 11487 handleObj = handlers[ i ]; 11488 11489 // Don't conflict with Object.prototype properties (#13203) 11490 sel = handleObj.selector + " "; 11491 11492 if ( matchedSelectors[ sel ] === undefined ) { 11493 matchedSelectors[ sel ] = handleObj.needsContext ? 11494 jQuery( sel, this ).index( cur ) > -1 : 11495 jQuery.find( sel, this, null, [ cur ] ).length; 11496 } 11497 if ( matchedSelectors[ sel ] ) { 11498 matchedHandlers.push( handleObj ); 11499 } 11500 } 11501 if ( matchedHandlers.length ) { 11502 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 11503 } 11504 } 11505 } 11506 } 11507 11508 // Add the remaining (directly-bound) handlers 11509 cur = this; 11510 if ( delegateCount < handlers.length ) { 11511 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 11512 } 11513 11514 return handlerQueue; 11515 }, 11516 11517 addProp: function( name, hook ) { 11518 Object.defineProperty( jQuery.Event.prototype, name, { 11519 enumerable: true, 11520 configurable: true, 11521 11522 get: isFunction( hook ) ? 11523 function() { 11524 if ( this.originalEvent ) { 11525 return hook( this.originalEvent ); 11526 } 11527 } : 11528 function() { 11529 if ( this.originalEvent ) { 11530 return this.originalEvent[ name ]; 11531 } 11532 }, 11533 11534 set: function( value ) { 11535 Object.defineProperty( this, name, { 11536 enumerable: true, 11537 configurable: true, 11538 writable: true, 11539 value: value 11540 } ); 11541 } 11542 } ); 11543 }, 11544 11545 fix: function( originalEvent ) { 11546 return originalEvent[ jQuery.expando ] ? 11547 originalEvent : 11548 new jQuery.Event( originalEvent ); 11549 }, 11550 11551 special: { 11552 load: { 11553 11554 // Prevent triggered image.load events from bubbling to window.load 11555 noBubble: true 11556 }, 11557 focus: { 11558 11559 // Fire native event if possible so blur/focus sequence is correct 11560 trigger: function() { 11561 if ( this !== safeActiveElement() && this.focus ) { 11562 this.focus(); 11563 return false; 11564 } 11565 }, 11566 delegateType: "focusin" 11567 }, 11568 blur: { 11569 trigger: function() { 11570 if ( this === safeActiveElement() && this.blur ) { 11571 this.blur(); 11572 return false; 11573 } 11574 }, 11575 delegateType: "focusout" 11576 }, 11577 click: { 11578 11579 // For checkbox, fire native event so checked state will be right 11580 trigger: function() { 11581 if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { 11582 this.click(); 11583 return false; 11584 } 11585 }, 11586 11587 // For cross-browser consistency, don't fire native .click() on links 11588 _default: function( event ) { 11589 return nodeName( event.target, "a" ); 11590 } 11591 }, 11592 11593 beforeunload: { 11594 postDispatch: function( event ) { 11595 11596 // Support: Firefox 20+ 11597 // Firefox doesn't alert if the returnValue field is not set. 11598 if ( event.result !== undefined && event.originalEvent ) { 11599 event.originalEvent.returnValue = event.result; 11600 } 11601 } 11602 } 11603 } 11604}; 11605 11606jQuery.removeEvent = function( elem, type, handle ) { 11607 11608 // This "if" is needed for plain objects 11609 if ( elem.removeEventListener ) { 11610 elem.removeEventListener( type, handle ); 11611 } 11612}; 11613 11614jQuery.Event = function( src, props ) { 11615 11616 // Allow instantiation without the 'new' keyword 11617 if ( !( this instanceof jQuery.Event ) ) { 11618 return new jQuery.Event( src, props ); 11619 } 11620 11621 // Event object 11622 if ( src && src.type ) { 11623 this.originalEvent = src; 11624 this.type = src.type; 11625 11626 // Events bubbling up the document may have been marked as prevented 11627 // by a handler lower down the tree; reflect the correct value. 11628 this.isDefaultPrevented = src.defaultPrevented || 11629 src.defaultPrevented === undefined && 11630 11631 // Support: Android <=2.3 only 11632 src.returnValue === false ? 11633 returnTrue : 11634 returnFalse; 11635 11636 // Create target properties 11637 // Support: Safari <=6 - 7 only 11638 // Target should not be a text node (#504, #13143) 11639 this.target = ( src.target && src.target.nodeType === 3 ) ? 11640 src.target.parentNode : 11641 src.target; 11642 11643 this.currentTarget = src.currentTarget; 11644 this.relatedTarget = src.relatedTarget; 11645 11646 // Event type 11647 } else { 11648 this.type = src; 11649 } 11650 11651 // Put explicitly provided properties onto the event object 11652 if ( props ) { 11653 jQuery.extend( this, props ); 11654 } 11655 11656 // Create a timestamp if incoming event doesn't have one 11657 this.timeStamp = src && src.timeStamp || Date.now(); 11658 11659 // Mark it as fixed 11660 this[ jQuery.expando ] = true; 11661}; 11662 11663// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 11664// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 11665jQuery.Event.prototype = { 11666 constructor: jQuery.Event, 11667 isDefaultPrevented: returnFalse, 11668 isPropagationStopped: returnFalse, 11669 isImmediatePropagationStopped: returnFalse, 11670 isSimulated: false, 11671 11672 preventDefault: function() { 11673 var e = this.originalEvent; 11674 11675 this.isDefaultPrevented = returnTrue; 11676 11677 if ( e && !this.isSimulated ) { 11678 e.preventDefault(); 11679 } 11680 }, 11681 stopPropagation: function() { 11682 var e = this.originalEvent; 11683 11684 this.isPropagationStopped = returnTrue; 11685 11686 if ( e && !this.isSimulated ) { 11687 e.stopPropagation(); 11688 } 11689 }, 11690 stopImmediatePropagation: function() { 11691 var e = this.originalEvent; 11692 11693 this.isImmediatePropagationStopped = returnTrue; 11694 11695 if ( e && !this.isSimulated ) { 11696 e.stopImmediatePropagation(); 11697 } 11698 11699 this.stopPropagation(); 11700 } 11701}; 11702 11703// Includes all common event props including KeyEvent and MouseEvent specific props 11704jQuery.each( { 11705 altKey: true, 11706 bubbles: true, 11707 cancelable: true, 11708 changedTouches: true, 11709 ctrlKey: true, 11710 detail: true, 11711 eventPhase: true, 11712 metaKey: true, 11713 pageX: true, 11714 pageY: true, 11715 shiftKey: true, 11716 view: true, 11717 "char": true, 11718 charCode: true, 11719 key: true, 11720 keyCode: true, 11721 button: true, 11722 buttons: true, 11723 clientX: true, 11724 clientY: true, 11725 offsetX: true, 11726 offsetY: true, 11727 pointerId: true, 11728 pointerType: true, 11729 screenX: true, 11730 screenY: true, 11731 targetTouches: true, 11732 toElement: true, 11733 touches: true, 11734 11735 which: function( event ) { 11736 var button = event.button; 11737 11738 // Add which for key events 11739 if ( event.which == null && rkeyEvent.test( event.type ) ) { 11740 return event.charCode != null ? event.charCode : event.keyCode; 11741 } 11742 11743 // Add which for click: 1 === left; 2 === middle; 3 === right 11744 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 11745 if ( button & 1 ) { 11746 return 1; 11747 } 11748 11749 if ( button & 2 ) { 11750 return 3; 11751 } 11752 11753 if ( button & 4 ) { 11754 return 2; 11755 } 11756 11757 return 0; 11758 } 11759 11760 return event.which; 11761 } 11762}, jQuery.event.addProp ); 11763 11764// Create mouseenter/leave events using mouseover/out and event-time checks 11765// so that event delegation works in jQuery. 11766// Do the same for pointerenter/pointerleave and pointerover/pointerout 11767// 11768// Support: Safari 7 only 11769// Safari sends mouseenter too often; see: 11770// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 11771// for the description of the bug (it existed in older Chrome versions as well). 11772jQuery.each( { 11773 mouseenter: "mouseover", 11774 mouseleave: "mouseout", 11775 pointerenter: "pointerover", 11776 pointerleave: "pointerout" 11777}, function( orig, fix ) { 11778 jQuery.event.special[ orig ] = { 11779 delegateType: fix, 11780 bindType: fix, 11781 11782 handle: function( event ) { 11783 var ret, 11784 target = this, 11785 related = event.relatedTarget, 11786 handleObj = event.handleObj; 11787 11788 // For mouseenter/leave call the handler if related is outside the target. 11789 // NB: No relatedTarget if the mouse left/entered the browser window 11790 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 11791 event.type = handleObj.origType; 11792 ret = handleObj.handler.apply( this, arguments ); 11793 event.type = fix; 11794 } 11795 return ret; 11796 } 11797 }; 11798} ); 11799 11800jQuery.fn.extend( { 11801 11802 on: function( types, selector, data, fn ) { 11803 return on( this, types, selector, data, fn ); 11804 }, 11805 one: function( types, selector, data, fn ) { 11806 return on( this, types, selector, data, fn, 1 ); 11807 }, 11808 off: function( types, selector, fn ) { 11809 var handleObj, type; 11810 if ( types && types.preventDefault && types.handleObj ) { 11811 11812 // ( event ) dispatched jQuery.Event 11813 handleObj = types.handleObj; 11814 jQuery( types.delegateTarget ).off( 11815 handleObj.namespace ? 11816 handleObj.origType + "." + handleObj.namespace : 11817 handleObj.origType, 11818 handleObj.selector, 11819 handleObj.handler 11820 ); 11821 return this; 11822 } 11823 if ( typeof types === "object" ) { 11824 11825 // ( types-object [, selector] ) 11826 for ( type in types ) { 11827 this.off( type, selector, types[ type ] ); 11828 } 11829 return this; 11830 } 11831 if ( selector === false || typeof selector === "function" ) { 11832 11833 // ( types [, fn] ) 11834 fn = selector; 11835 selector = undefined; 11836 } 11837 if ( fn === false ) { 11838 fn = returnFalse; 11839 } 11840 return this.each( function() { 11841 jQuery.event.remove( this, types, fn, selector ); 11842 } ); 11843 } 11844} ); 11845 11846 11847var 11848 11849 /* eslint-disable max-len */ 11850 11851 // See https://github.com/eslint/eslint/issues/3229 11852 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, 11853 11854 /* eslint-enable */ 11855 11856 // Support: IE <=10 - 11, Edge 12 - 13 only 11857 // In IE/Edge using regex groups here causes severe slowdowns. 11858 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 11859 rnoInnerhtml = /<script|<style|<link/i, 11860 11861 // checked="checked" or checked 11862 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 11863 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 11864 11865// Prefer a tbody over its parent table for containing new rows 11866function manipulationTarget( elem, content ) { 11867 if ( nodeName( elem, "table" ) && 11868 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 11869 11870 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 11871 } 11872 11873 return elem; 11874} 11875 11876// Replace/restore the type attribute of script elements for safe DOM manipulation 11877function disableScript( elem ) { 11878 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 11879 return elem; 11880} 11881function restoreScript( elem ) { 11882 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 11883 elem.type = elem.type.slice( 5 ); 11884 } else { 11885 elem.removeAttribute( "type" ); 11886 } 11887 11888 return elem; 11889} 11890 11891function cloneCopyEvent( src, dest ) { 11892 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 11893 11894 if ( dest.nodeType !== 1 ) { 11895 return; 11896 } 11897 11898 // 1. Copy private data: events, handlers, etc. 11899 if ( dataPriv.hasData( src ) ) { 11900 pdataOld = dataPriv.access( src ); 11901 pdataCur = dataPriv.set( dest, pdataOld ); 11902 events = pdataOld.events; 11903 11904 if ( events ) { 11905 delete pdataCur.handle; 11906 pdataCur.events = {}; 11907 11908 for ( type in events ) { 11909 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 11910 jQuery.event.add( dest, type, events[ type ][ i ] ); 11911 } 11912 } 11913 } 11914 } 11915 11916 // 2. Copy user data 11917 if ( dataUser.hasData( src ) ) { 11918 udataOld = dataUser.access( src ); 11919 udataCur = jQuery.extend( {}, udataOld ); 11920 11921 dataUser.set( dest, udataCur ); 11922 } 11923} 11924 11925// Fix IE bugs, see support tests 11926function fixInput( src, dest ) { 11927 var nodeName = dest.nodeName.toLowerCase(); 11928 11929 // Fails to persist the checked state of a cloned checkbox or radio button. 11930 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 11931 dest.checked = src.checked; 11932 11933 // Fails to return the selected option to the default selected state when cloning options 11934 } else if ( nodeName === "input" || nodeName === "textarea" ) { 11935 dest.defaultValue = src.defaultValue; 11936 } 11937} 11938 11939function domManip( collection, args, callback, ignored ) { 11940 11941 // Flatten any nested arrays 11942 args = concat.apply( [], args ); 11943 11944 var fragment, first, scripts, hasScripts, node, doc, 11945 i = 0, 11946 l = collection.length, 11947 iNoClone = l - 1, 11948 value = args[ 0 ], 11949 valueIsFunction = isFunction( value ); 11950 11951 // We can't cloneNode fragments that contain checked, in WebKit 11952 if ( valueIsFunction || 11953 ( l > 1 && typeof value === "string" && 11954 !support.checkClone && rchecked.test( value ) ) ) { 11955 return collection.each( function( index ) { 11956 var self = collection.eq( index ); 11957 if ( valueIsFunction ) { 11958 args[ 0 ] = value.call( this, index, self.html() ); 11959 } 11960 domManip( self, args, callback, ignored ); 11961 } ); 11962 } 11963 11964 if ( l ) { 11965 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 11966 first = fragment.firstChild; 11967 11968 if ( fragment.childNodes.length === 1 ) { 11969 fragment = first; 11970 } 11971 11972 // Require either new content or an interest in ignored elements to invoke the callback 11973 if ( first || ignored ) { 11974 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 11975 hasScripts = scripts.length; 11976 11977 // Use the original fragment for the last item 11978 // instead of the first because it can end up 11979 // being emptied incorrectly in certain situations (#8070). 11980 for ( ; i < l; i++ ) { 11981 node = fragment; 11982 11983 if ( i !== iNoClone ) { 11984 node = jQuery.clone( node, true, true ); 11985 11986 // Keep references to cloned scripts for later restoration 11987 if ( hasScripts ) { 11988 11989 // Support: Android <=4.0 only, PhantomJS 1 only 11990 // push.apply(_, arraylike) throws on ancient WebKit 11991 jQuery.merge( scripts, getAll( node, "script" ) ); 11992 } 11993 } 11994 11995 callback.call( collection[ i ], node, i ); 11996 } 11997 11998 if ( hasScripts ) { 11999 doc = scripts[ scripts.length - 1 ].ownerDocument; 12000 12001 // Reenable scripts 12002 jQuery.map( scripts, restoreScript ); 12003 12004 // Evaluate executable scripts on first document insertion 12005 for ( i = 0; i < hasScripts; i++ ) { 12006 node = scripts[ i ]; 12007 if ( rscriptType.test( node.type || "" ) && 12008 !dataPriv.access( node, "globalEval" ) && 12009 jQuery.contains( doc, node ) ) { 12010 12011 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 12012 12013 // Optional AJAX dependency, but won't run scripts if not present 12014 if ( jQuery._evalUrl ) { 12015 jQuery._evalUrl( node.src ); 12016 } 12017 } else { 12018 DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); 12019 } 12020 } 12021 } 12022 } 12023 } 12024 } 12025 12026 return collection; 12027} 12028 12029function remove( elem, selector, keepData ) { 12030 var node, 12031 nodes = selector ? jQuery.filter( selector, elem ) : elem, 12032 i = 0; 12033 12034 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 12035 if ( !keepData && node.nodeType === 1 ) { 12036 jQuery.cleanData( getAll( node ) ); 12037 } 12038 12039 if ( node.parentNode ) { 12040 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 12041 setGlobalEval( getAll( node, "script" ) ); 12042 } 12043 node.parentNode.removeChild( node ); 12044 } 12045 } 12046 12047 return elem; 12048} 12049 12050jQuery.extend( { 12051 htmlPrefilter: function( html ) { 12052 return html.replace( rxhtmlTag, "<$1></$2>" ); 12053 }, 12054 12055 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 12056 var i, l, srcElements, destElements, 12057 clone = elem.cloneNode( true ), 12058 inPage = jQuery.contains( elem.ownerDocument, elem ); 12059 12060 // Fix IE cloning issues 12061 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 12062 !jQuery.isXMLDoc( elem ) ) { 12063 12064 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 12065 destElements = getAll( clone ); 12066 srcElements = getAll( elem ); 12067 12068 for ( i = 0, l = srcElements.length; i < l; i++ ) { 12069 fixInput( srcElements[ i ], destElements[ i ] ); 12070 } 12071 } 12072 12073 // Copy the events from the original to the clone 12074 if ( dataAndEvents ) { 12075 if ( deepDataAndEvents ) { 12076 srcElements = srcElements || getAll( elem ); 12077 destElements = destElements || getAll( clone ); 12078 12079 for ( i = 0, l = srcElements.length; i < l; i++ ) { 12080 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 12081 } 12082 } else { 12083 cloneCopyEvent( elem, clone ); 12084 } 12085 } 12086 12087 // Preserve script evaluation history 12088 destElements = getAll( clone, "script" ); 12089 if ( destElements.length > 0 ) { 12090 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 12091 } 12092 12093 // Return the cloned set 12094 return clone; 12095 }, 12096 12097 cleanData: function( elems ) { 12098 var data, elem, type, 12099 special = jQuery.event.special, 12100 i = 0; 12101 12102 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 12103 if ( acceptData( elem ) ) { 12104 if ( ( data = elem[ dataPriv.expando ] ) ) { 12105 if ( data.events ) { 12106 for ( type in data.events ) { 12107 if ( special[ type ] ) { 12108 jQuery.event.remove( elem, type ); 12109 12110 // This is a shortcut to avoid jQuery.event.remove's overhead 12111 } else { 12112 jQuery.removeEvent( elem, type, data.handle ); 12113 } 12114 } 12115 } 12116 12117 // Support: Chrome <=35 - 45+ 12118 // Assign undefined instead of using delete, see Data#remove 12119 elem[ dataPriv.expando ] = undefined; 12120 } 12121 if ( elem[ dataUser.expando ] ) { 12122 12123 // Support: Chrome <=35 - 45+ 12124 // Assign undefined instead of using delete, see Data#remove 12125 elem[ dataUser.expando ] = undefined; 12126 } 12127 } 12128 } 12129 } 12130} ); 12131 12132jQuery.fn.extend( { 12133 detach: function( selector ) { 12134 return remove( this, selector, true ); 12135 }, 12136 12137 remove: function( selector ) { 12138 return remove( this, selector ); 12139 }, 12140 12141 text: function( value ) { 12142 return access( this, function( value ) { 12143 return value === undefined ? 12144 jQuery.text( this ) : 12145 this.empty().each( function() { 12146 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 12147 this.textContent = value; 12148 } 12149 } ); 12150 }, null, value, arguments.length ); 12151 }, 12152 12153 append: function() { 12154 return domManip( this, arguments, function( elem ) { 12155 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 12156 var target = manipulationTarget( this, elem ); 12157 target.appendChild( elem ); 12158 } 12159 } ); 12160 }, 12161 12162 prepend: function() { 12163 return domManip( this, arguments, function( elem ) { 12164 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 12165 var target = manipulationTarget( this, elem ); 12166 target.insertBefore( elem, target.firstChild ); 12167 } 12168 } ); 12169 }, 12170 12171 before: function() { 12172 return domManip( this, arguments, function( elem ) { 12173 if ( this.parentNode ) { 12174 this.parentNode.insertBefore( elem, this ); 12175 } 12176 } ); 12177 }, 12178 12179 after: function() { 12180 return domManip( this, arguments, function( elem ) { 12181 if ( this.parentNode ) { 12182 this.parentNode.insertBefore( elem, this.nextSibling ); 12183 } 12184 } ); 12185 }, 12186 12187 empty: function() { 12188 var elem, 12189 i = 0; 12190 12191 for ( ; ( elem = this[ i ] ) != null; i++ ) { 12192 if ( elem.nodeType === 1 ) { 12193 12194 // Prevent memory leaks 12195 jQuery.cleanData( getAll( elem, false ) ); 12196 12197 // Remove any remaining nodes 12198 elem.textContent = ""; 12199 } 12200 } 12201 12202 return this; 12203 }, 12204 12205 clone: function( dataAndEvents, deepDataAndEvents ) { 12206 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 12207 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 12208 12209 return this.map( function() { 12210 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 12211 } ); 12212 }, 12213 12214 html: function( value ) { 12215 return access( this, function( value ) { 12216 var elem = this[ 0 ] || {}, 12217 i = 0, 12218 l = this.length; 12219 12220 if ( value === undefined && elem.nodeType === 1 ) { 12221 return elem.innerHTML; 12222 } 12223 12224 // See if we can take a shortcut and just use innerHTML 12225 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 12226 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 12227 12228 value = jQuery.htmlPrefilter( value ); 12229 12230 try { 12231 for ( ; i < l; i++ ) { 12232 elem = this[ i ] || {}; 12233 12234 // Remove element nodes and prevent memory leaks 12235 if ( elem.nodeType === 1 ) { 12236 jQuery.cleanData( getAll( elem, false ) ); 12237 elem.innerHTML = value; 12238 } 12239 } 12240 12241 elem = 0; 12242 12243 // If using innerHTML throws an exception, use the fallback method 12244 } catch ( e ) {} 12245 } 12246 12247 if ( elem ) { 12248 this.empty().append( value ); 12249 } 12250 }, null, value, arguments.length ); 12251 }, 12252 12253 replaceWith: function() { 12254 var ignored = []; 12255 12256 // Make the changes, replacing each non-ignored context element with the new content 12257 return domManip( this, arguments, function( elem ) { 12258 var parent = this.parentNode; 12259 12260 if ( jQuery.inArray( this, ignored ) < 0 ) { 12261 jQuery.cleanData( getAll( this ) ); 12262 if ( parent ) { 12263 parent.replaceChild( elem, this ); 12264 } 12265 } 12266 12267 // Force callback invocation 12268 }, ignored ); 12269 } 12270} ); 12271 12272jQuery.each( { 12273 appendTo: "append", 12274 prependTo: "prepend", 12275 insertBefore: "before", 12276 insertAfter: "after", 12277 replaceAll: "replaceWith" 12278}, function( name, original ) { 12279 jQuery.fn[ name ] = function( selector ) { 12280 var elems, 12281 ret = [], 12282 insert = jQuery( selector ), 12283 last = insert.length - 1, 12284 i = 0; 12285 12286 for ( ; i <= last; i++ ) { 12287 elems = i === last ? this : this.clone( true ); 12288 jQuery( insert[ i ] )[ original ]( elems ); 12289 12290 // Support: Android <=4.0 only, PhantomJS 1 only 12291 // .get() because push.apply(_, arraylike) throws on ancient WebKit 12292 push.apply( ret, elems.get() ); 12293 } 12294 12295 return this.pushStack( ret ); 12296 }; 12297} ); 12298var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 12299 12300var getStyles = function( elem ) { 12301 12302 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 12303 // IE throws on elements created in popups 12304 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 12305 var view = elem.ownerDocument.defaultView; 12306 12307 if ( !view || !view.opener ) { 12308 view = window; 12309 } 12310 12311 return view.getComputedStyle( elem ); 12312 }; 12313 12314var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 12315 12316 12317 12318( function() { 12319 12320 // Executing both pixelPosition & boxSizingReliable tests require only one layout 12321 // so they're executed at the same time to save the second computation. 12322 function computeStyleTests() { 12323 12324 // This is a singleton, we need to execute it only once 12325 if ( !div ) { 12326 return; 12327 } 12328 12329 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 12330 "margin-top:1px;padding:0;border:0"; 12331 div.style.cssText = 12332 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 12333 "margin:auto;border:1px;padding:1px;" + 12334 "width:60%;top:1%"; 12335 documentElement.appendChild( container ).appendChild( div ); 12336 12337 var divStyle = window.getComputedStyle( div ); 12338 pixelPositionVal = divStyle.top !== "1%"; 12339 12340 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 12341 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 12342 12343 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 12344 // Some styles come back with percentage values, even though they shouldn't 12345 div.style.right = "60%"; 12346 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 12347 12348 // Support: IE 9 - 11 only 12349 // Detect misreporting of content dimensions for box-sizing:border-box elements 12350 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 12351 12352 // Support: IE 9 only 12353 // Detect overflow:scroll screwiness (gh-3699) 12354 div.style.position = "absolute"; 12355 scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; 12356 12357 documentElement.removeChild( container ); 12358 12359 // Nullify the div so it wouldn't be stored in the memory and 12360 // it will also be a sign that checks already performed 12361 div = null; 12362 } 12363 12364 function roundPixelMeasures( measure ) { 12365 return Math.round( parseFloat( measure ) ); 12366 } 12367 12368 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 12369 reliableMarginLeftVal, 12370 container = document.createElement( "div" ), 12371 div = document.createElement( "div" ); 12372 12373 // Finish early in limited (non-browser) environments 12374 if ( !div.style ) { 12375 return; 12376 } 12377 12378 // Support: IE <=9 - 11 only 12379 // Style of cloned element affects source element cloned (#8908) 12380 div.style.backgroundClip = "content-box"; 12381 div.cloneNode( true ).style.backgroundClip = ""; 12382 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 12383 12384 jQuery.extend( support, { 12385 boxSizingReliable: function() { 12386 computeStyleTests(); 12387 return boxSizingReliableVal; 12388 }, 12389 pixelBoxStyles: function() { 12390 computeStyleTests(); 12391 return pixelBoxStylesVal; 12392 }, 12393 pixelPosition: function() { 12394 computeStyleTests(); 12395 return pixelPositionVal; 12396 }, 12397 reliableMarginLeft: function() { 12398 computeStyleTests(); 12399 return reliableMarginLeftVal; 12400 }, 12401 scrollboxSize: function() { 12402 computeStyleTests(); 12403 return scrollboxSizeVal; 12404 } 12405 } ); 12406} )(); 12407 12408 12409function curCSS( elem, name, computed ) { 12410 var width, minWidth, maxWidth, ret, 12411 12412 // Support: Firefox 51+ 12413 // Retrieving style before computed somehow 12414 // fixes an issue with getting wrong values 12415 // on detached elements 12416 style = elem.style; 12417 12418 computed = computed || getStyles( elem ); 12419 12420 // getPropertyValue is needed for: 12421 // .css('filter') (IE 9 only, #12537) 12422 // .css('--customProperty) (#3144) 12423 if ( computed ) { 12424 ret = computed.getPropertyValue( name ) || computed[ name ]; 12425 12426 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 12427 ret = jQuery.style( elem, name ); 12428 } 12429 12430 // A tribute to the "awesome hack by Dean Edwards" 12431 // Android Browser returns percentage for some values, 12432 // but width seems to be reliably pixels. 12433 // This is against the CSSOM draft spec: 12434 // https://drafts.csswg.org/cssom/#resolved-values 12435 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 12436 12437 // Remember the original values 12438 width = style.width; 12439 minWidth = style.minWidth; 12440 maxWidth = style.maxWidth; 12441 12442 // Put in the new values to get a computed value out 12443 style.minWidth = style.maxWidth = style.width = ret; 12444 ret = computed.width; 12445 12446 // Revert the changed values 12447 style.width = width; 12448 style.minWidth = minWidth; 12449 style.maxWidth = maxWidth; 12450 } 12451 } 12452 12453 return ret !== undefined ? 12454 12455 // Support: IE <=9 - 11 only 12456 // IE returns zIndex value as an integer. 12457 ret + "" : 12458 ret; 12459} 12460 12461 12462function addGetHookIf( conditionFn, hookFn ) { 12463 12464 // Define the hook, we'll check on the first run if it's really needed. 12465 return { 12466 get: function() { 12467 if ( conditionFn() ) { 12468 12469 // Hook not needed (or it's not possible to use it due 12470 // to missing dependency), remove it. 12471 delete this.get; 12472 return; 12473 } 12474 12475 // Hook needed; redefine it so that the support test is not executed again. 12476 return ( this.get = hookFn ).apply( this, arguments ); 12477 } 12478 }; 12479} 12480 12481 12482var 12483 12484 // Swappable if display is none or starts with table 12485 // except "table", "table-cell", or "table-caption" 12486 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 12487 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 12488 rcustomProp = /^--/, 12489 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 12490 cssNormalTransform = { 12491 letterSpacing: "0", 12492 fontWeight: "400" 12493 }, 12494 12495 cssPrefixes = [ "Webkit", "Moz", "ms" ], 12496 emptyStyle = document.createElement( "div" ).style; 12497 12498// Return a css property mapped to a potentially vendor prefixed property 12499function vendorPropName( name ) { 12500 12501 // Shortcut for names that are not vendor prefixed 12502 if ( name in emptyStyle ) { 12503 return name; 12504 } 12505 12506 // Check for vendor prefixed names 12507 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 12508 i = cssPrefixes.length; 12509 12510 while ( i-- ) { 12511 name = cssPrefixes[ i ] + capName; 12512 if ( name in emptyStyle ) { 12513 return name; 12514 } 12515 } 12516} 12517 12518// Return a property mapped along what jQuery.cssProps suggests or to 12519// a vendor prefixed property. 12520function finalPropName( name ) { 12521 var ret = jQuery.cssProps[ name ]; 12522 if ( !ret ) { 12523 ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; 12524 } 12525 return ret; 12526} 12527 12528function setPositiveNumber( elem, value, subtract ) { 12529 12530 // Any relative (+/-) values have already been 12531 // normalized at this point 12532 var matches = rcssNum.exec( value ); 12533 return matches ? 12534 12535 // Guard against undefined "subtract", e.g., when used as in cssHooks 12536 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 12537 value; 12538} 12539 12540function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 12541 var i = dimension === "width" ? 1 : 0, 12542 extra = 0, 12543 delta = 0; 12544 12545 // Adjustment may not be necessary 12546 if ( box === ( isBorderBox ? "border" : "content" ) ) { 12547 return 0; 12548 } 12549 12550 for ( ; i < 4; i += 2 ) { 12551 12552 // Both box models exclude margin 12553 if ( box === "margin" ) { 12554 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 12555 } 12556 12557 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 12558 if ( !isBorderBox ) { 12559 12560 // Add padding 12561 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 12562 12563 // For "border" or "margin", add border 12564 if ( box !== "padding" ) { 12565 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12566 12567 // But still keep track of it otherwise 12568 } else { 12569 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12570 } 12571 12572 // If we get here with a border-box (content + padding + border), we're seeking "content" or 12573 // "padding" or "margin" 12574 } else { 12575 12576 // For "content", subtract padding 12577 if ( box === "content" ) { 12578 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 12579 } 12580 12581 // For "content" or "padding", subtract border 12582 if ( box !== "margin" ) { 12583 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12584 } 12585 } 12586 } 12587 12588 // Account for positive content-box scroll gutter when requested by providing computedVal 12589 if ( !isBorderBox && computedVal >= 0 ) { 12590 12591 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 12592 // Assuming integer scroll gutter, subtract the rest and round down 12593 delta += Math.max( 0, Math.ceil( 12594 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 12595 computedVal - 12596 delta - 12597 extra - 12598 0.5 12599 ) ); 12600 } 12601 12602 return delta; 12603} 12604 12605function getWidthOrHeight( elem, dimension, extra ) { 12606 12607 // Start with computed style 12608 var styles = getStyles( elem ), 12609 val = curCSS( elem, dimension, styles ), 12610 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 12611 valueIsBorderBox = isBorderBox; 12612 12613 // Support: Firefox <=54 12614 // Return a confounding non-pixel value or feign ignorance, as appropriate. 12615 if ( rnumnonpx.test( val ) ) { 12616 if ( !extra ) { 12617 return val; 12618 } 12619 val = "auto"; 12620 } 12621 12622 // Check for style in case a browser which returns unreliable values 12623 // for getComputedStyle silently falls back to the reliable elem.style 12624 valueIsBorderBox = valueIsBorderBox && 12625 ( support.boxSizingReliable() || val === elem.style[ dimension ] ); 12626 12627 // Fall back to offsetWidth/offsetHeight when value is "auto" 12628 // This happens for inline elements with no explicit setting (gh-3571) 12629 // Support: Android <=4.1 - 4.3 only 12630 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 12631 if ( val === "auto" || 12632 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) { 12633 12634 val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ]; 12635 12636 // offsetWidth/offsetHeight provide border-box values 12637 valueIsBorderBox = true; 12638 } 12639 12640 // Normalize "" and auto 12641 val = parseFloat( val ) || 0; 12642 12643 // Adjust for the element's box model 12644 return ( val + 12645 boxModelAdjustment( 12646 elem, 12647 dimension, 12648 extra || ( isBorderBox ? "border" : "content" ), 12649 valueIsBorderBox, 12650 styles, 12651 12652 // Provide the current computed size to request scroll gutter calculation (gh-3589) 12653 val 12654 ) 12655 ) + "px"; 12656} 12657 12658jQuery.extend( { 12659 12660 // Add in style property hooks for overriding the default 12661 // behavior of getting and setting a style property 12662 cssHooks: { 12663 opacity: { 12664 get: function( elem, computed ) { 12665 if ( computed ) { 12666 12667 // We should always get a number back from opacity 12668 var ret = curCSS( elem, "opacity" ); 12669 return ret === "" ? "1" : ret; 12670 } 12671 } 12672 } 12673 }, 12674 12675 // Don't automatically add "px" to these possibly-unitless properties 12676 cssNumber: { 12677 "animationIterationCount": true, 12678 "columnCount": true, 12679 "fillOpacity": true, 12680 "flexGrow": true, 12681 "flexShrink": true, 12682 "fontWeight": true, 12683 "lineHeight": true, 12684 "opacity": true, 12685 "order": true, 12686 "orphans": true, 12687 "widows": true, 12688 "zIndex": true, 12689 "zoom": true 12690 }, 12691 12692 // Add in properties whose names you wish to fix before 12693 // setting or getting the value 12694 cssProps: {}, 12695 12696 // Get and set the style property on a DOM Node 12697 style: function( elem, name, value, extra ) { 12698 12699 // Don't set styles on text and comment nodes 12700 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 12701 return; 12702 } 12703 12704 // Make sure that we're working with the right name 12705 var ret, type, hooks, 12706 origName = camelCase( name ), 12707 isCustomProp = rcustomProp.test( name ), 12708 style = elem.style; 12709 12710 // Make sure that we're working with the right name. We don't 12711 // want to query the value if it is a CSS custom property 12712 // since they are user-defined. 12713 if ( !isCustomProp ) { 12714 name = finalPropName( origName ); 12715 } 12716 12717 // Gets hook for the prefixed version, then unprefixed version 12718 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12719 12720 // Check if we're setting a value 12721 if ( value !== undefined ) { 12722 type = typeof value; 12723 12724 // Convert "+=" or "-=" to relative numbers (#7345) 12725 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 12726 value = adjustCSS( elem, name, ret ); 12727 12728 // Fixes bug #9237 12729 type = "number"; 12730 } 12731 12732 // Make sure that null and NaN values aren't set (#7116) 12733 if ( value == null || value !== value ) { 12734 return; 12735 } 12736 12737 // If a number was passed in, add the unit (except for certain CSS properties) 12738 if ( type === "number" ) { 12739 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 12740 } 12741 12742 // background-* props affect original clone's values 12743 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 12744 style[ name ] = "inherit"; 12745 } 12746 12747 // If a hook was provided, use that value, otherwise just set the specified value 12748 if ( !hooks || !( "set" in hooks ) || 12749 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 12750 12751 if ( isCustomProp ) { 12752 style.setProperty( name, value ); 12753 } else { 12754 style[ name ] = value; 12755 } 12756 } 12757 12758 } else { 12759 12760 // If a hook was provided get the non-computed value from there 12761 if ( hooks && "get" in hooks && 12762 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 12763 12764 return ret; 12765 } 12766 12767 // Otherwise just get the value from the style object 12768 return style[ name ]; 12769 } 12770 }, 12771 12772 css: function( elem, name, extra, styles ) { 12773 var val, num, hooks, 12774 origName = camelCase( name ), 12775 isCustomProp = rcustomProp.test( name ); 12776 12777 // Make sure that we're working with the right name. We don't 12778 // want to modify the value if it is a CSS custom property 12779 // since they are user-defined. 12780 if ( !isCustomProp ) { 12781 name = finalPropName( origName ); 12782 } 12783 12784 // Try prefixed name followed by the unprefixed name 12785 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12786 12787 // If a hook was provided get the computed value from there 12788 if ( hooks && "get" in hooks ) { 12789 val = hooks.get( elem, true, extra ); 12790 } 12791 12792 // Otherwise, if a way to get the computed value exists, use that 12793 if ( val === undefined ) { 12794 val = curCSS( elem, name, styles ); 12795 } 12796 12797 // Convert "normal" to computed value 12798 if ( val === "normal" && name in cssNormalTransform ) { 12799 val = cssNormalTransform[ name ]; 12800 } 12801 12802 // Make numeric if forced or a qualifier was provided and val looks numeric 12803 if ( extra === "" || extra ) { 12804 num = parseFloat( val ); 12805 return extra === true || isFinite( num ) ? num || 0 : val; 12806 } 12807 12808 return val; 12809 } 12810} ); 12811 12812jQuery.each( [ "height", "width" ], function( i, dimension ) { 12813 jQuery.cssHooks[ dimension ] = { 12814 get: function( elem, computed, extra ) { 12815 if ( computed ) { 12816 12817 // Certain elements can have dimension info if we invisibly show them 12818 // but it must have a current display style that would benefit 12819 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 12820 12821 // Support: Safari 8+ 12822 // Table columns in Safari have non-zero offsetWidth & zero 12823 // getBoundingClientRect().width unless display is changed. 12824 // Support: IE <=11 only 12825 // Running getBoundingClientRect on a disconnected node 12826 // in IE throws an error. 12827 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 12828 swap( elem, cssShow, function() { 12829 return getWidthOrHeight( elem, dimension, extra ); 12830 } ) : 12831 getWidthOrHeight( elem, dimension, extra ); 12832 } 12833 }, 12834 12835 set: function( elem, value, extra ) { 12836 var matches, 12837 styles = getStyles( elem ), 12838 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 12839 subtract = extra && boxModelAdjustment( 12840 elem, 12841 dimension, 12842 extra, 12843 isBorderBox, 12844 styles 12845 ); 12846 12847 // Account for unreliable border-box dimensions by comparing offset* to computed and 12848 // faking a content-box to get border and padding (gh-3699) 12849 if ( isBorderBox && support.scrollboxSize() === styles.position ) { 12850 subtract -= Math.ceil( 12851 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 12852 parseFloat( styles[ dimension ] ) - 12853 boxModelAdjustment( elem, dimension, "border", false, styles ) - 12854 0.5 12855 ); 12856 } 12857 12858 // Convert to pixels if value adjustment is needed 12859 if ( subtract && ( matches = rcssNum.exec( value ) ) && 12860 ( matches[ 3 ] || "px" ) !== "px" ) { 12861 12862 elem.style[ dimension ] = value; 12863 value = jQuery.css( elem, dimension ); 12864 } 12865 12866 return setPositiveNumber( elem, value, subtract ); 12867 } 12868 }; 12869} ); 12870 12871jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 12872 function( elem, computed ) { 12873 if ( computed ) { 12874 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 12875 elem.getBoundingClientRect().left - 12876 swap( elem, { marginLeft: 0 }, function() { 12877 return elem.getBoundingClientRect().left; 12878 } ) 12879 ) + "px"; 12880 } 12881 } 12882); 12883 12884// These hooks are used by animate to expand properties 12885jQuery.each( { 12886 margin: "", 12887 padding: "", 12888 border: "Width" 12889}, function( prefix, suffix ) { 12890 jQuery.cssHooks[ prefix + suffix ] = { 12891 expand: function( value ) { 12892 var i = 0, 12893 expanded = {}, 12894 12895 // Assumes a single number if not a string 12896 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 12897 12898 for ( ; i < 4; i++ ) { 12899 expanded[ prefix + cssExpand[ i ] + suffix ] = 12900 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 12901 } 12902 12903 return expanded; 12904 } 12905 }; 12906 12907 if ( prefix !== "margin" ) { 12908 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 12909 } 12910} ); 12911 12912jQuery.fn.extend( { 12913 css: function( name, value ) { 12914 return access( this, function( elem, name, value ) { 12915 var styles, len, 12916 map = {}, 12917 i = 0; 12918 12919 if ( Array.isArray( name ) ) { 12920 styles = getStyles( elem ); 12921 len = name.length; 12922 12923 for ( ; i < len; i++ ) { 12924 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 12925 } 12926 12927 return map; 12928 } 12929 12930 return value !== undefined ? 12931 jQuery.style( elem, name, value ) : 12932 jQuery.css( elem, name ); 12933 }, name, value, arguments.length > 1 ); 12934 } 12935} ); 12936 12937 12938function Tween( elem, options, prop, end, easing ) { 12939 return new Tween.prototype.init( elem, options, prop, end, easing ); 12940} 12941jQuery.Tween = Tween; 12942 12943Tween.prototype = { 12944 constructor: Tween, 12945 init: function( elem, options, prop, end, easing, unit ) { 12946 this.elem = elem; 12947 this.prop = prop; 12948 this.easing = easing || jQuery.easing._default; 12949 this.options = options; 12950 this.start = this.now = this.cur(); 12951 this.end = end; 12952 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 12953 }, 12954 cur: function() { 12955 var hooks = Tween.propHooks[ this.prop ]; 12956 12957 return hooks && hooks.get ? 12958 hooks.get( this ) : 12959 Tween.propHooks._default.get( this ); 12960 }, 12961 run: function( percent ) { 12962 var eased, 12963 hooks = Tween.propHooks[ this.prop ]; 12964 12965 if ( this.options.duration ) { 12966 this.pos = eased = jQuery.easing[ this.easing ]( 12967 percent, this.options.duration * percent, 0, 1, this.options.duration 12968 ); 12969 } else { 12970 this.pos = eased = percent; 12971 } 12972 this.now = ( this.end - this.start ) * eased + this.start; 12973 12974 if ( this.options.step ) { 12975 this.options.step.call( this.elem, this.now, this ); 12976 } 12977 12978 if ( hooks && hooks.set ) { 12979 hooks.set( this ); 12980 } else { 12981 Tween.propHooks._default.set( this ); 12982 } 12983 return this; 12984 } 12985}; 12986 12987Tween.prototype.init.prototype = Tween.prototype; 12988 12989Tween.propHooks = { 12990 _default: { 12991 get: function( tween ) { 12992 var result; 12993 12994 // Use a property on the element directly when it is not a DOM element, 12995 // or when there is no matching style property that exists. 12996 if ( tween.elem.nodeType !== 1 || 12997 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 12998 return tween.elem[ tween.prop ]; 12999 } 13000 13001 // Passing an empty string as a 3rd parameter to .css will automatically 13002 // attempt a parseFloat and fallback to a string if the parse fails. 13003 // Simple values such as "10px" are parsed to Float; 13004 // complex values such as "rotate(1rad)" are returned as-is. 13005 result = jQuery.css( tween.elem, tween.prop, "" ); 13006 13007 // Empty strings, null, undefined and "auto" are converted to 0. 13008 return !result || result === "auto" ? 0 : result; 13009 }, 13010 set: function( tween ) { 13011 13012 // Use step hook for back compat. 13013 // Use cssHook if its there. 13014 // Use .style if available and use plain properties where available. 13015 if ( jQuery.fx.step[ tween.prop ] ) { 13016 jQuery.fx.step[ tween.prop ]( tween ); 13017 } else if ( tween.elem.nodeType === 1 && 13018 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 13019 jQuery.cssHooks[ tween.prop ] ) ) { 13020 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 13021 } else { 13022 tween.elem[ tween.prop ] = tween.now; 13023 } 13024 } 13025 } 13026}; 13027 13028// Support: IE <=9 only 13029// Panic based approach to setting things on disconnected nodes 13030Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 13031 set: function( tween ) { 13032 if ( tween.elem.nodeType && tween.elem.parentNode ) { 13033 tween.elem[ tween.prop ] = tween.now; 13034 } 13035 } 13036}; 13037 13038jQuery.easing = { 13039 linear: function( p ) { 13040 return p; 13041 }, 13042 swing: function( p ) { 13043 return 0.5 - Math.cos( p * Math.PI ) / 2; 13044 }, 13045 _default: "swing" 13046}; 13047 13048jQuery.fx = Tween.prototype.init; 13049 13050// Back compat <1.8 extension point 13051jQuery.fx.step = {}; 13052 13053 13054 13055 13056var 13057 fxNow, inProgress, 13058 rfxtypes = /^(?:toggle|show|hide)$/, 13059 rrun = /queueHooks$/; 13060 13061function schedule() { 13062 if ( inProgress ) { 13063 if ( document.hidden === false && window.requestAnimationFrame ) { 13064 window.requestAnimationFrame( schedule ); 13065 } else { 13066 window.setTimeout( schedule, jQuery.fx.interval ); 13067 } 13068 13069 jQuery.fx.tick(); 13070 } 13071} 13072 13073// Animations created synchronously will run synchronously 13074function createFxNow() { 13075 window.setTimeout( function() { 13076 fxNow = undefined; 13077 } ); 13078 return ( fxNow = Date.now() ); 13079} 13080 13081// Generate parameters to create a standard animation 13082function genFx( type, includeWidth ) { 13083 var which, 13084 i = 0, 13085 attrs = { height: type }; 13086 13087 // If we include width, step value is 1 to do all cssExpand values, 13088 // otherwise step value is 2 to skip over Left and Right 13089 includeWidth = includeWidth ? 1 : 0; 13090 for ( ; i < 4; i += 2 - includeWidth ) { 13091 which = cssExpand[ i ]; 13092 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 13093 } 13094 13095 if ( includeWidth ) { 13096 attrs.opacity = attrs.width = type; 13097 } 13098 13099 return attrs; 13100} 13101 13102function createTween( value, prop, animation ) { 13103 var tween, 13104 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 13105 index = 0, 13106 length = collection.length; 13107 for ( ; index < length; index++ ) { 13108 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 13109 13110 // We're done with this property 13111 return tween; 13112 } 13113 } 13114} 13115 13116function defaultPrefilter( elem, props, opts ) { 13117 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 13118 isBox = "width" in props || "height" in props, 13119 anim = this, 13120 orig = {}, 13121 style = elem.style, 13122 hidden = elem.nodeType && isHiddenWithinTree( elem ), 13123 dataShow = dataPriv.get( elem, "fxshow" ); 13124 13125 // Queue-skipping animations hijack the fx hooks 13126 if ( !opts.queue ) { 13127 hooks = jQuery._queueHooks( elem, "fx" ); 13128 if ( hooks.unqueued == null ) { 13129 hooks.unqueued = 0; 13130 oldfire = hooks.empty.fire; 13131 hooks.empty.fire = function() { 13132 if ( !hooks.unqueued ) { 13133 oldfire(); 13134 } 13135 }; 13136 } 13137 hooks.unqueued++; 13138 13139 anim.always( function() { 13140 13141 // Ensure the complete handler is called before this completes 13142 anim.always( function() { 13143 hooks.unqueued--; 13144 if ( !jQuery.queue( elem, "fx" ).length ) { 13145 hooks.empty.fire(); 13146 } 13147 } ); 13148 } ); 13149 } 13150 13151 // Detect show/hide animations 13152 for ( prop in props ) { 13153 value = props[ prop ]; 13154 if ( rfxtypes.test( value ) ) { 13155 delete props[ prop ]; 13156 toggle = toggle || value === "toggle"; 13157 if ( value === ( hidden ? "hide" : "show" ) ) { 13158 13159 // Pretend to be hidden if this is a "show" and 13160 // there is still data from a stopped show/hide 13161 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 13162 hidden = true; 13163 13164 // Ignore all other no-op show/hide data 13165 } else { 13166 continue; 13167 } 13168 } 13169 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 13170 } 13171 } 13172 13173 // Bail out if this is a no-op like .hide().hide() 13174 propTween = !jQuery.isEmptyObject( props ); 13175 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 13176 return; 13177 } 13178 13179 // Restrict "overflow" and "display" styles during box animations 13180 if ( isBox && elem.nodeType === 1 ) { 13181 13182 // Support: IE <=9 - 11, Edge 12 - 15 13183 // Record all 3 overflow attributes because IE does not infer the shorthand 13184 // from identically-valued overflowX and overflowY and Edge just mirrors 13185 // the overflowX value there. 13186 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 13187 13188 // Identify a display type, preferring old show/hide data over the CSS cascade 13189 restoreDisplay = dataShow && dataShow.display; 13190 if ( restoreDisplay == null ) { 13191 restoreDisplay = dataPriv.get( elem, "display" ); 13192 } 13193 display = jQuery.css( elem, "display" ); 13194 if ( display === "none" ) { 13195 if ( restoreDisplay ) { 13196 display = restoreDisplay; 13197 } else { 13198 13199 // Get nonempty value(s) by temporarily forcing visibility 13200 showHide( [ elem ], true ); 13201 restoreDisplay = elem.style.display || restoreDisplay; 13202 display = jQuery.css( elem, "display" ); 13203 showHide( [ elem ] ); 13204 } 13205 } 13206 13207 // Animate inline elements as inline-block 13208 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 13209 if ( jQuery.css( elem, "float" ) === "none" ) { 13210 13211 // Restore the original display value at the end of pure show/hide animations 13212 if ( !propTween ) { 13213 anim.done( function() { 13214 style.display = restoreDisplay; 13215 } ); 13216 if ( restoreDisplay == null ) { 13217 display = style.display; 13218 restoreDisplay = display === "none" ? "" : display; 13219 } 13220 } 13221 style.display = "inline-block"; 13222 } 13223 } 13224 } 13225 13226 if ( opts.overflow ) { 13227 style.overflow = "hidden"; 13228 anim.always( function() { 13229 style.overflow = opts.overflow[ 0 ]; 13230 style.overflowX = opts.overflow[ 1 ]; 13231 style.overflowY = opts.overflow[ 2 ]; 13232 } ); 13233 } 13234 13235 // Implement show/hide animations 13236 propTween = false; 13237 for ( prop in orig ) { 13238 13239 // General show/hide setup for this element animation 13240 if ( !propTween ) { 13241 if ( dataShow ) { 13242 if ( "hidden" in dataShow ) { 13243 hidden = dataShow.hidden; 13244 } 13245 } else { 13246 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 13247 } 13248 13249 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 13250 if ( toggle ) { 13251 dataShow.hidden = !hidden; 13252 } 13253 13254 // Show elements before animating them 13255 if ( hidden ) { 13256 showHide( [ elem ], true ); 13257 } 13258 13259 /* eslint-disable no-loop-func */ 13260 13261 anim.done( function() { 13262 13263 /* eslint-enable no-loop-func */ 13264 13265 // The final step of a "hide" animation is actually hiding the element 13266 if ( !hidden ) { 13267 showHide( [ elem ] ); 13268 } 13269 dataPriv.remove( elem, "fxshow" ); 13270 for ( prop in orig ) { 13271 jQuery.style( elem, prop, orig[ prop ] ); 13272 } 13273 } ); 13274 } 13275 13276 // Per-property setup 13277 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 13278 if ( !( prop in dataShow ) ) { 13279 dataShow[ prop ] = propTween.start; 13280 if ( hidden ) { 13281 propTween.end = propTween.start; 13282 propTween.start = 0; 13283 } 13284 } 13285 } 13286} 13287 13288function propFilter( props, specialEasing ) { 13289 var index, name, easing, value, hooks; 13290 13291 // camelCase, specialEasing and expand cssHook pass 13292 for ( index in props ) { 13293 name = camelCase( index ); 13294 easing = specialEasing[ name ]; 13295 value = props[ index ]; 13296 if ( Array.isArray( value ) ) { 13297 easing = value[ 1 ]; 13298 value = props[ index ] = value[ 0 ]; 13299 } 13300 13301 if ( index !== name ) { 13302 props[ name ] = value; 13303 delete props[ index ]; 13304 } 13305 13306 hooks = jQuery.cssHooks[ name ]; 13307 if ( hooks && "expand" in hooks ) { 13308 value = hooks.expand( value ); 13309 delete props[ name ]; 13310 13311 // Not quite $.extend, this won't overwrite existing keys. 13312 // Reusing 'index' because we have the correct "name" 13313 for ( index in value ) { 13314 if ( !( index in props ) ) { 13315 props[ index ] = value[ index ]; 13316 specialEasing[ index ] = easing; 13317 } 13318 } 13319 } else { 13320 specialEasing[ name ] = easing; 13321 } 13322 } 13323} 13324 13325function Animation( elem, properties, options ) { 13326 var result, 13327 stopped, 13328 index = 0, 13329 length = Animation.prefilters.length, 13330 deferred = jQuery.Deferred().always( function() { 13331 13332 // Don't match elem in the :animated selector 13333 delete tick.elem; 13334 } ), 13335 tick = function() { 13336 if ( stopped ) { 13337 return false; 13338 } 13339 var currentTime = fxNow || createFxNow(), 13340 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 13341 13342 // Support: Android 2.3 only 13343 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 13344 temp = remaining / animation.duration || 0, 13345 percent = 1 - temp, 13346 index = 0, 13347 length = animation.tweens.length; 13348 13349 for ( ; index < length; index++ ) { 13350 animation.tweens[ index ].run( percent ); 13351 } 13352 13353 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 13354 13355 // If there's more to do, yield 13356 if ( percent < 1 && length ) { 13357 return remaining; 13358 } 13359 13360 // If this was an empty animation, synthesize a final progress notification 13361 if ( !length ) { 13362 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 13363 } 13364 13365 // Resolve the animation and report its conclusion 13366 deferred.resolveWith( elem, [ animation ] ); 13367 return false; 13368 }, 13369 animation = deferred.promise( { 13370 elem: elem, 13371 props: jQuery.extend( {}, properties ), 13372 opts: jQuery.extend( true, { 13373 specialEasing: {}, 13374 easing: jQuery.easing._default 13375 }, options ), 13376 originalProperties: properties, 13377 originalOptions: options, 13378 startTime: fxNow || createFxNow(), 13379 duration: options.duration, 13380 tweens: [], 13381 createTween: function( prop, end ) { 13382 var tween = jQuery.Tween( elem, animation.opts, prop, end, 13383 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 13384 animation.tweens.push( tween ); 13385 return tween; 13386 }, 13387 stop: function( gotoEnd ) { 13388 var index = 0, 13389 13390 // If we are going to the end, we want to run all the tweens 13391 // otherwise we skip this part 13392 length = gotoEnd ? animation.tweens.length : 0; 13393 if ( stopped ) { 13394 return this; 13395 } 13396 stopped = true; 13397 for ( ; index < length; index++ ) { 13398 animation.tweens[ index ].run( 1 ); 13399 } 13400 13401 // Resolve when we played the last frame; otherwise, reject 13402 if ( gotoEnd ) { 13403 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 13404 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 13405 } else { 13406 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 13407 } 13408 return this; 13409 } 13410 } ), 13411 props = animation.props; 13412 13413 propFilter( props, animation.opts.specialEasing ); 13414 13415 for ( ; index < length; index++ ) { 13416 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 13417 if ( result ) { 13418 if ( isFunction( result.stop ) ) { 13419 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 13420 result.stop.bind( result ); 13421 } 13422 return result; 13423 } 13424 } 13425 13426 jQuery.map( props, createTween, animation ); 13427 13428 if ( isFunction( animation.opts.start ) ) { 13429 animation.opts.start.call( elem, animation ); 13430 } 13431 13432 // Attach callbacks from options 13433 animation 13434 .progress( animation.opts.progress ) 13435 .done( animation.opts.done, animation.opts.complete ) 13436 .fail( animation.opts.fail ) 13437 .always( animation.opts.always ); 13438 13439 jQuery.fx.timer( 13440 jQuery.extend( tick, { 13441 elem: elem, 13442 anim: animation, 13443 queue: animation.opts.queue 13444 } ) 13445 ); 13446 13447 return animation; 13448} 13449 13450jQuery.Animation = jQuery.extend( Animation, { 13451 13452 tweeners: { 13453 "*": [ function( prop, value ) { 13454 var tween = this.createTween( prop, value ); 13455 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 13456 return tween; 13457 } ] 13458 }, 13459 13460 tweener: function( props, callback ) { 13461 if ( isFunction( props ) ) { 13462 callback = props; 13463 props = [ "*" ]; 13464 } else { 13465 props = props.match( rnothtmlwhite ); 13466 } 13467 13468 var prop, 13469 index = 0, 13470 length = props.length; 13471 13472 for ( ; index < length; index++ ) { 13473 prop = props[ index ]; 13474 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 13475 Animation.tweeners[ prop ].unshift( callback ); 13476 } 13477 }, 13478 13479 prefilters: [ defaultPrefilter ], 13480 13481 prefilter: function( callback, prepend ) { 13482 if ( prepend ) { 13483 Animation.prefilters.unshift( callback ); 13484 } else { 13485 Animation.prefilters.push( callback ); 13486 } 13487 } 13488} ); 13489 13490jQuery.speed = function( speed, easing, fn ) { 13491 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 13492 complete: fn || !fn && easing || 13493 isFunction( speed ) && speed, 13494 duration: speed, 13495 easing: fn && easing || easing && !isFunction( easing ) && easing 13496 }; 13497 13498 // Go to the end state if fx are off 13499 if ( jQuery.fx.off ) { 13500 opt.duration = 0; 13501 13502 } else { 13503 if ( typeof opt.duration !== "number" ) { 13504 if ( opt.duration in jQuery.fx.speeds ) { 13505 opt.duration = jQuery.fx.speeds[ opt.duration ]; 13506 13507 } else { 13508 opt.duration = jQuery.fx.speeds._default; 13509 } 13510 } 13511 } 13512 13513 // Normalize opt.queue - true/undefined/null -> "fx" 13514 if ( opt.queue == null || opt.queue === true ) { 13515 opt.queue = "fx"; 13516 } 13517 13518 // Queueing 13519 opt.old = opt.complete; 13520 13521 opt.complete = function() { 13522 if ( isFunction( opt.old ) ) { 13523 opt.old.call( this ); 13524 } 13525 13526 if ( opt.queue ) { 13527 jQuery.dequeue( this, opt.queue ); 13528 } 13529 }; 13530 13531 return opt; 13532}; 13533 13534jQuery.fn.extend( { 13535 fadeTo: function( speed, to, easing, callback ) { 13536 13537 // Show any hidden elements after setting opacity to 0 13538 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 13539 13540 // Animate to the value specified 13541 .end().animate( { opacity: to }, speed, easing, callback ); 13542 }, 13543 animate: function( prop, speed, easing, callback ) { 13544 var empty = jQuery.isEmptyObject( prop ), 13545 optall = jQuery.speed( speed, easing, callback ), 13546 doAnimation = function() { 13547 13548 // Operate on a copy of prop so per-property easing won't be lost 13549 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 13550 13551 // Empty animations, or finishing resolves immediately 13552 if ( empty || dataPriv.get( this, "finish" ) ) { 13553 anim.stop( true ); 13554 } 13555 }; 13556 doAnimation.finish = doAnimation; 13557 13558 return empty || optall.queue === false ? 13559 this.each( doAnimation ) : 13560 this.queue( optall.queue, doAnimation ); 13561 }, 13562 stop: function( type, clearQueue, gotoEnd ) { 13563 var stopQueue = function( hooks ) { 13564 var stop = hooks.stop; 13565 delete hooks.stop; 13566 stop( gotoEnd ); 13567 }; 13568 13569 if ( typeof type !== "string" ) { 13570 gotoEnd = clearQueue; 13571 clearQueue = type; 13572 type = undefined; 13573 } 13574 if ( clearQueue && type !== false ) { 13575 this.queue( type || "fx", [] ); 13576 } 13577 13578 return this.each( function() { 13579 var dequeue = true, 13580 index = type != null && type + "queueHooks", 13581 timers = jQuery.timers, 13582 data = dataPriv.get( this ); 13583 13584 if ( index ) { 13585 if ( data[ index ] && data[ index ].stop ) { 13586 stopQueue( data[ index ] ); 13587 } 13588 } else { 13589 for ( index in data ) { 13590 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 13591 stopQueue( data[ index ] ); 13592 } 13593 } 13594 } 13595 13596 for ( index = timers.length; index--; ) { 13597 if ( timers[ index ].elem === this && 13598 ( type == null || timers[ index ].queue === type ) ) { 13599 13600 timers[ index ].anim.stop( gotoEnd ); 13601 dequeue = false; 13602 timers.splice( index, 1 ); 13603 } 13604 } 13605 13606 // Start the next in the queue if the last step wasn't forced. 13607 // Timers currently will call their complete callbacks, which 13608 // will dequeue but only if they were gotoEnd. 13609 if ( dequeue || !gotoEnd ) { 13610 jQuery.dequeue( this, type ); 13611 } 13612 } ); 13613 }, 13614 finish: function( type ) { 13615 if ( type !== false ) { 13616 type = type || "fx"; 13617 } 13618 return this.each( function() { 13619 var index, 13620 data = dataPriv.get( this ), 13621 queue = data[ type + "queue" ], 13622 hooks = data[ type + "queueHooks" ], 13623 timers = jQuery.timers, 13624 length = queue ? queue.length : 0; 13625 13626 // Enable finishing flag on private data 13627 data.finish = true; 13628 13629 // Empty the queue first 13630 jQuery.queue( this, type, [] ); 13631 13632 if ( hooks && hooks.stop ) { 13633 hooks.stop.call( this, true ); 13634 } 13635 13636 // Look for any active animations, and finish them 13637 for ( index = timers.length; index--; ) { 13638 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 13639 timers[ index ].anim.stop( true ); 13640 timers.splice( index, 1 ); 13641 } 13642 } 13643 13644 // Look for any animations in the old queue and finish them 13645 for ( index = 0; index < length; index++ ) { 13646 if ( queue[ index ] && queue[ index ].finish ) { 13647 queue[ index ].finish.call( this ); 13648 } 13649 } 13650 13651 // Turn off finishing flag 13652 delete data.finish; 13653 } ); 13654 } 13655} ); 13656 13657jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 13658 var cssFn = jQuery.fn[ name ]; 13659 jQuery.fn[ name ] = function( speed, easing, callback ) { 13660 return speed == null || typeof speed === "boolean" ? 13661 cssFn.apply( this, arguments ) : 13662 this.animate( genFx( name, true ), speed, easing, callback ); 13663 }; 13664} ); 13665 13666// Generate shortcuts for custom animations 13667jQuery.each( { 13668 slideDown: genFx( "show" ), 13669 slideUp: genFx( "hide" ), 13670 slideToggle: genFx( "toggle" ), 13671 fadeIn: { opacity: "show" }, 13672 fadeOut: { opacity: "hide" }, 13673 fadeToggle: { opacity: "toggle" } 13674}, function( name, props ) { 13675 jQuery.fn[ name ] = function( speed, easing, callback ) { 13676 return this.animate( props, speed, easing, callback ); 13677 }; 13678} ); 13679 13680jQuery.timers = []; 13681jQuery.fx.tick = function() { 13682 var timer, 13683 i = 0, 13684 timers = jQuery.timers; 13685 13686 fxNow = Date.now(); 13687 13688 for ( ; i < timers.length; i++ ) { 13689 timer = timers[ i ]; 13690 13691 // Run the timer and safely remove it when done (allowing for external removal) 13692 if ( !timer() && timers[ i ] === timer ) { 13693 timers.splice( i--, 1 ); 13694 } 13695 } 13696 13697 if ( !timers.length ) { 13698 jQuery.fx.stop(); 13699 } 13700 fxNow = undefined; 13701}; 13702 13703jQuery.fx.timer = function( timer ) { 13704 jQuery.timers.push( timer ); 13705 jQuery.fx.start(); 13706}; 13707 13708jQuery.fx.interval = 13; 13709jQuery.fx.start = function() { 13710 if ( inProgress ) { 13711 return; 13712 } 13713 13714 inProgress = true; 13715 schedule(); 13716}; 13717 13718jQuery.fx.stop = function() { 13719 inProgress = null; 13720}; 13721 13722jQuery.fx.speeds = { 13723 slow: 600, 13724 fast: 200, 13725 13726 // Default speed 13727 _default: 400 13728}; 13729 13730 13731// Based off of the plugin by Clint Helfers, with permission. 13732// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 13733jQuery.fn.delay = function( time, type ) { 13734 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 13735 type = type || "fx"; 13736 13737 return this.queue( type, function( next, hooks ) { 13738 var timeout = window.setTimeout( next, time ); 13739 hooks.stop = function() { 13740 window.clearTimeout( timeout ); 13741 }; 13742 } ); 13743}; 13744 13745 13746( function() { 13747 var input = document.createElement( "input" ), 13748 select = document.createElement( "select" ), 13749 opt = select.appendChild( document.createElement( "option" ) ); 13750 13751 input.type = "checkbox"; 13752 13753 // Support: Android <=4.3 only 13754 // Default value for a checkbox should be "on" 13755 support.checkOn = input.value !== ""; 13756 13757 // Support: IE <=11 only 13758 // Must access selectedIndex to make default options select 13759 support.optSelected = opt.selected; 13760 13761 // Support: IE <=11 only 13762 // An input loses its value after becoming a radio 13763 input = document.createElement( "input" ); 13764 input.value = "t"; 13765 input.type = "radio"; 13766 support.radioValue = input.value === "t"; 13767} )(); 13768 13769 13770var boolHook, 13771 attrHandle = jQuery.expr.attrHandle; 13772 13773jQuery.fn.extend( { 13774 attr: function( name, value ) { 13775 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 13776 }, 13777 13778 removeAttr: function( name ) { 13779 return this.each( function() { 13780 jQuery.removeAttr( this, name ); 13781 } ); 13782 } 13783} ); 13784 13785jQuery.extend( { 13786 attr: function( elem, name, value ) { 13787 var ret, hooks, 13788 nType = elem.nodeType; 13789 13790 // Don't get/set attributes on text, comment and attribute nodes 13791 if ( nType === 3 || nType === 8 || nType === 2 ) { 13792 return; 13793 } 13794 13795 // Fallback to prop when attributes are not supported 13796 if ( typeof elem.getAttribute === "undefined" ) { 13797 return jQuery.prop( elem, name, value ); 13798 } 13799 13800 // Attribute hooks are determined by the lowercase version 13801 // Grab necessary hook if one is defined 13802 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13803 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 13804 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 13805 } 13806 13807 if ( value !== undefined ) { 13808 if ( value === null ) { 13809 jQuery.removeAttr( elem, name ); 13810 return; 13811 } 13812 13813 if ( hooks && "set" in hooks && 13814 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13815 return ret; 13816 } 13817 13818 elem.setAttribute( name, value + "" ); 13819 return value; 13820 } 13821 13822 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13823 return ret; 13824 } 13825 13826 ret = jQuery.find.attr( elem, name ); 13827 13828 // Non-existent attributes return null, we normalize to undefined 13829 return ret == null ? undefined : ret; 13830 }, 13831 13832 attrHooks: { 13833 type: { 13834 set: function( elem, value ) { 13835 if ( !support.radioValue && value === "radio" && 13836 nodeName( elem, "input" ) ) { 13837 var val = elem.value; 13838 elem.setAttribute( "type", value ); 13839 if ( val ) { 13840 elem.value = val; 13841 } 13842 return value; 13843 } 13844 } 13845 } 13846 }, 13847 13848 removeAttr: function( elem, value ) { 13849 var name, 13850 i = 0, 13851 13852 // Attribute names can contain non-HTML whitespace characters 13853 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 13854 attrNames = value && value.match( rnothtmlwhite ); 13855 13856 if ( attrNames && elem.nodeType === 1 ) { 13857 while ( ( name = attrNames[ i++ ] ) ) { 13858 elem.removeAttribute( name ); 13859 } 13860 } 13861 } 13862} ); 13863 13864// Hooks for boolean attributes 13865boolHook = { 13866 set: function( elem, value, name ) { 13867 if ( value === false ) { 13868 13869 // Remove boolean attributes when set to false 13870 jQuery.removeAttr( elem, name ); 13871 } else { 13872 elem.setAttribute( name, name ); 13873 } 13874 return name; 13875 } 13876}; 13877 13878jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 13879 var getter = attrHandle[ name ] || jQuery.find.attr; 13880 13881 attrHandle[ name ] = function( elem, name, isXML ) { 13882 var ret, handle, 13883 lowercaseName = name.toLowerCase(); 13884 13885 if ( !isXML ) { 13886 13887 // Avoid an infinite loop by temporarily removing this function from the getter 13888 handle = attrHandle[ lowercaseName ]; 13889 attrHandle[ lowercaseName ] = ret; 13890 ret = getter( elem, name, isXML ) != null ? 13891 lowercaseName : 13892 null; 13893 attrHandle[ lowercaseName ] = handle; 13894 } 13895 return ret; 13896 }; 13897} ); 13898 13899 13900 13901 13902var rfocusable = /^(?:input|select|textarea|button)$/i, 13903 rclickable = /^(?:a|area)$/i; 13904 13905jQuery.fn.extend( { 13906 prop: function( name, value ) { 13907 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 13908 }, 13909 13910 removeProp: function( name ) { 13911 return this.each( function() { 13912 delete this[ jQuery.propFix[ name ] || name ]; 13913 } ); 13914 } 13915} ); 13916 13917jQuery.extend( { 13918 prop: function( elem, name, value ) { 13919 var ret, hooks, 13920 nType = elem.nodeType; 13921 13922 // Don't get/set properties on text, comment and attribute nodes 13923 if ( nType === 3 || nType === 8 || nType === 2 ) { 13924 return; 13925 } 13926 13927 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13928 13929 // Fix name and attach hooks 13930 name = jQuery.propFix[ name ] || name; 13931 hooks = jQuery.propHooks[ name ]; 13932 } 13933 13934 if ( value !== undefined ) { 13935 if ( hooks && "set" in hooks && 13936 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13937 return ret; 13938 } 13939 13940 return ( elem[ name ] = value ); 13941 } 13942 13943 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13944 return ret; 13945 } 13946 13947 return elem[ name ]; 13948 }, 13949 13950 propHooks: { 13951 tabIndex: { 13952 get: function( elem ) { 13953 13954 // Support: IE <=9 - 11 only 13955 // elem.tabIndex doesn't always return the 13956 // correct value when it hasn't been explicitly set 13957 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 13958 // Use proper attribute retrieval(#12072) 13959 var tabindex = jQuery.find.attr( elem, "tabindex" ); 13960 13961 if ( tabindex ) { 13962 return parseInt( tabindex, 10 ); 13963 } 13964 13965 if ( 13966 rfocusable.test( elem.nodeName ) || 13967 rclickable.test( elem.nodeName ) && 13968 elem.href 13969 ) { 13970 return 0; 13971 } 13972 13973 return -1; 13974 } 13975 } 13976 }, 13977 13978 propFix: { 13979 "for": "htmlFor", 13980 "class": "className" 13981 } 13982} ); 13983 13984// Support: IE <=11 only 13985// Accessing the selectedIndex property 13986// forces the browser to respect setting selected 13987// on the option 13988// The getter ensures a default option is selected 13989// when in an optgroup 13990// eslint rule "no-unused-expressions" is disabled for this code 13991// since it considers such accessions noop 13992if ( !support.optSelected ) { 13993 jQuery.propHooks.selected = { 13994 get: function( elem ) { 13995 13996 /* eslint no-unused-expressions: "off" */ 13997 13998 var parent = elem.parentNode; 13999 if ( parent && parent.parentNode ) { 14000 parent.parentNode.selectedIndex; 14001 } 14002 return null; 14003 }, 14004 set: function( elem ) { 14005 14006 /* eslint no-unused-expressions: "off" */ 14007 14008 var parent = elem.parentNode; 14009 if ( parent ) { 14010 parent.selectedIndex; 14011 14012 if ( parent.parentNode ) { 14013 parent.parentNode.selectedIndex; 14014 } 14015 } 14016 } 14017 }; 14018} 14019 14020jQuery.each( [ 14021 "tabIndex", 14022 "readOnly", 14023 "maxLength", 14024 "cellSpacing", 14025 "cellPadding", 14026 "rowSpan", 14027 "colSpan", 14028 "useMap", 14029 "frameBorder", 14030 "contentEditable" 14031], function() { 14032 jQuery.propFix[ this.toLowerCase() ] = this; 14033} ); 14034 14035 14036 14037 14038 // Strip and collapse whitespace according to HTML spec 14039 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 14040 function stripAndCollapse( value ) { 14041 var tokens = value.match( rnothtmlwhite ) || []; 14042 return tokens.join( " " ); 14043 } 14044 14045 14046function getClass( elem ) { 14047 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 14048} 14049 14050function classesToArray( value ) { 14051 if ( Array.isArray( value ) ) { 14052 return value; 14053 } 14054 if ( typeof value === "string" ) { 14055 return value.match( rnothtmlwhite ) || []; 14056 } 14057 return []; 14058} 14059 14060jQuery.fn.extend( { 14061 addClass: function( value ) { 14062 var classes, elem, cur, curValue, clazz, j, finalValue, 14063 i = 0; 14064 14065 if ( isFunction( value ) ) { 14066 return this.each( function( j ) { 14067 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 14068 } ); 14069 } 14070 14071 classes = classesToArray( value ); 14072 14073 if ( classes.length ) { 14074 while ( ( elem = this[ i++ ] ) ) { 14075 curValue = getClass( elem ); 14076 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 14077 14078 if ( cur ) { 14079 j = 0; 14080 while ( ( clazz = classes[ j++ ] ) ) { 14081 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 14082 cur += clazz + " "; 14083 } 14084 } 14085 14086 // Only assign if different to avoid unneeded rendering. 14087 finalValue = stripAndCollapse( cur ); 14088 if ( curValue !== finalValue ) { 14089 elem.setAttribute( "class", finalValue ); 14090 } 14091 } 14092 } 14093 } 14094 14095 return this; 14096 }, 14097 14098 removeClass: function( value ) { 14099 var classes, elem, cur, curValue, clazz, j, finalValue, 14100 i = 0; 14101 14102 if ( isFunction( value ) ) { 14103 return this.each( function( j ) { 14104 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 14105 } ); 14106 } 14107 14108 if ( !arguments.length ) { 14109 return this.attr( "class", "" ); 14110 } 14111 14112 classes = classesToArray( value ); 14113 14114 if ( classes.length ) { 14115 while ( ( elem = this[ i++ ] ) ) { 14116 curValue = getClass( elem ); 14117 14118 // This expression is here for better compressibility (see addClass) 14119 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 14120 14121 if ( cur ) { 14122 j = 0; 14123 while ( ( clazz = classes[ j++ ] ) ) { 14124 14125 // Remove *all* instances 14126 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 14127 cur = cur.replace( " " + clazz + " ", " " ); 14128 } 14129 } 14130 14131 // Only assign if different to avoid unneeded rendering. 14132 finalValue = stripAndCollapse( cur ); 14133 if ( curValue !== finalValue ) { 14134 elem.setAttribute( "class", finalValue ); 14135 } 14136 } 14137 } 14138 } 14139 14140 return this; 14141 }, 14142 14143 toggleClass: function( value, stateVal ) { 14144 var type = typeof value, 14145 isValidValue = type === "string" || Array.isArray( value ); 14146 14147 if ( typeof stateVal === "boolean" && isValidValue ) { 14148 return stateVal ? this.addClass( value ) : this.removeClass( value ); 14149 } 14150 14151 if ( isFunction( value ) ) { 14152 return this.each( function( i ) { 14153 jQuery( this ).toggleClass( 14154 value.call( this, i, getClass( this ), stateVal ), 14155 stateVal 14156 ); 14157 } ); 14158 } 14159 14160 return this.each( function() { 14161 var className, i, self, classNames; 14162 14163 if ( isValidValue ) { 14164 14165 // Toggle individual class names 14166 i = 0; 14167 self = jQuery( this ); 14168 classNames = classesToArray( value ); 14169 14170 while ( ( className = classNames[ i++ ] ) ) { 14171 14172 // Check each className given, space separated list 14173 if ( self.hasClass( className ) ) { 14174 self.removeClass( className ); 14175 } else { 14176 self.addClass( className ); 14177 } 14178 } 14179 14180 // Toggle whole class name 14181 } else if ( value === undefined || type === "boolean" ) { 14182 className = getClass( this ); 14183 if ( className ) { 14184 14185 // Store className if set 14186 dataPriv.set( this, "__className__", className ); 14187 } 14188 14189 // If the element has a class name or if we're passed `false`, 14190 // then remove the whole classname (if there was one, the above saved it). 14191 // Otherwise bring back whatever was previously saved (if anything), 14192 // falling back to the empty string if nothing was stored. 14193 if ( this.setAttribute ) { 14194 this.setAttribute( "class", 14195 className || value === false ? 14196 "" : 14197 dataPriv.get( this, "__className__" ) || "" 14198 ); 14199 } 14200 } 14201 } ); 14202 }, 14203 14204 hasClass: function( selector ) { 14205 var className, elem, 14206 i = 0; 14207 14208 className = " " + selector + " "; 14209 while ( ( elem = this[ i++ ] ) ) { 14210 if ( elem.nodeType === 1 && 14211 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 14212 return true; 14213 } 14214 } 14215 14216 return false; 14217 } 14218} ); 14219 14220 14221 14222 14223var rreturn = /\r/g; 14224 14225jQuery.fn.extend( { 14226 val: function( value ) { 14227 var hooks, ret, valueIsFunction, 14228 elem = this[ 0 ]; 14229 14230 if ( !arguments.length ) { 14231 if ( elem ) { 14232 hooks = jQuery.valHooks[ elem.type ] || 14233 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 14234 14235 if ( hooks && 14236 "get" in hooks && 14237 ( ret = hooks.get( elem, "value" ) ) !== undefined 14238 ) { 14239 return ret; 14240 } 14241 14242 ret = elem.value; 14243 14244 // Handle most common string cases 14245 if ( typeof ret === "string" ) { 14246 return ret.replace( rreturn, "" ); 14247 } 14248 14249 // Handle cases where value is null/undef or number 14250 return ret == null ? "" : ret; 14251 } 14252 14253 return; 14254 } 14255 14256 valueIsFunction = isFunction( value ); 14257 14258 return this.each( function( i ) { 14259 var val; 14260 14261 if ( this.nodeType !== 1 ) { 14262 return; 14263 } 14264 14265 if ( valueIsFunction ) { 14266 val = value.call( this, i, jQuery( this ).val() ); 14267 } else { 14268 val = value; 14269 } 14270 14271 // Treat null/undefined as ""; convert numbers to string 14272 if ( val == null ) { 14273 val = ""; 14274 14275 } else if ( typeof val === "number" ) { 14276 val += ""; 14277 14278 } else if ( Array.isArray( val ) ) { 14279 val = jQuery.map( val, function( value ) { 14280 return value == null ? "" : value + ""; 14281 } ); 14282 } 14283 14284 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 14285 14286 // If set returns undefined, fall back to normal setting 14287 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 14288 this.value = val; 14289 } 14290 } ); 14291 } 14292} ); 14293 14294jQuery.extend( { 14295 valHooks: { 14296 option: { 14297 get: function( elem ) { 14298 14299 var val = jQuery.find.attr( elem, "value" ); 14300 return val != null ? 14301 val : 14302 14303 // Support: IE <=10 - 11 only 14304 // option.text throws exceptions (#14686, #14858) 14305 // Strip and collapse whitespace 14306 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 14307 stripAndCollapse( jQuery.text( elem ) ); 14308 } 14309 }, 14310 select: { 14311 get: function( elem ) { 14312 var value, option, i, 14313 options = elem.options, 14314 index = elem.selectedIndex, 14315 one = elem.type === "select-one", 14316 values = one ? null : [], 14317 max = one ? index + 1 : options.length; 14318 14319 if ( index < 0 ) { 14320 i = max; 14321 14322 } else { 14323 i = one ? index : 0; 14324 } 14325 14326 // Loop through all the selected options 14327 for ( ; i < max; i++ ) { 14328 option = options[ i ]; 14329 14330 // Support: IE <=9 only 14331 // IE8-9 doesn't update selected after form reset (#2551) 14332 if ( ( option.selected || i === index ) && 14333 14334 // Don't return options that are disabled or in a disabled optgroup 14335 !option.disabled && 14336 ( !option.parentNode.disabled || 14337 !nodeName( option.parentNode, "optgroup" ) ) ) { 14338 14339 // Get the specific value for the option 14340 value = jQuery( option ).val(); 14341 14342 // We don't need an array for one selects 14343 if ( one ) { 14344 return value; 14345 } 14346 14347 // Multi-Selects return an array 14348 values.push( value ); 14349 } 14350 } 14351 14352 return values; 14353 }, 14354 14355 set: function( elem, value ) { 14356 var optionSet, option, 14357 options = elem.options, 14358 values = jQuery.makeArray( value ), 14359 i = options.length; 14360 14361 while ( i-- ) { 14362 option = options[ i ]; 14363 14364 /* eslint-disable no-cond-assign */ 14365 14366 if ( option.selected = 14367 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 14368 ) { 14369 optionSet = true; 14370 } 14371 14372 /* eslint-enable no-cond-assign */ 14373 } 14374 14375 // Force browsers to behave consistently when non-matching value is set 14376 if ( !optionSet ) { 14377 elem.selectedIndex = -1; 14378 } 14379 return values; 14380 } 14381 } 14382 } 14383} ); 14384 14385// Radios and checkboxes getter/setter 14386jQuery.each( [ "radio", "checkbox" ], function() { 14387 jQuery.valHooks[ this ] = { 14388 set: function( elem, value ) { 14389 if ( Array.isArray( value ) ) { 14390 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 14391 } 14392 } 14393 }; 14394 if ( !support.checkOn ) { 14395 jQuery.valHooks[ this ].get = function( elem ) { 14396 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 14397 }; 14398 } 14399} ); 14400 14401 14402 14403 14404// Return jQuery for attributes-only inclusion 14405 14406 14407support.focusin = "onfocusin" in window; 14408 14409 14410var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 14411 stopPropagationCallback = function( e ) { 14412 e.stopPropagation(); 14413 }; 14414 14415jQuery.extend( jQuery.event, { 14416 14417 trigger: function( event, data, elem, onlyHandlers ) { 14418 14419 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 14420 eventPath = [ elem || document ], 14421 type = hasOwn.call( event, "type" ) ? event.type : event, 14422 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 14423 14424 cur = lastElement = tmp = elem = elem || document; 14425 14426 // Don't do events on text and comment nodes 14427 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 14428 return; 14429 } 14430 14431 // focus/blur morphs to focusin/out; ensure we're not firing them right now 14432 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 14433 return; 14434 } 14435 14436 if ( type.indexOf( "." ) > -1 ) { 14437 14438 // Namespaced trigger; create a regexp to match event type in handle() 14439 namespaces = type.split( "." ); 14440 type = namespaces.shift(); 14441 namespaces.sort(); 14442 } 14443 ontype = type.indexOf( ":" ) < 0 && "on" + type; 14444 14445 // Caller can pass in a jQuery.Event object, Object, or just an event type string 14446 event = event[ jQuery.expando ] ? 14447 event : 14448 new jQuery.Event( type, typeof event === "object" && event ); 14449 14450 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 14451 event.isTrigger = onlyHandlers ? 2 : 3; 14452 event.namespace = namespaces.join( "." ); 14453 event.rnamespace = event.namespace ? 14454 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 14455 null; 14456 14457 // Clean up the event in case it is being reused 14458 event.result = undefined; 14459 if ( !event.target ) { 14460 event.target = elem; 14461 } 14462 14463 // Clone any incoming data and prepend the event, creating the handler arg list 14464 data = data == null ? 14465 [ event ] : 14466 jQuery.makeArray( data, [ event ] ); 14467 14468 // Allow special events to draw outside the lines 14469 special = jQuery.event.special[ type ] || {}; 14470 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 14471 return; 14472 } 14473 14474 // Determine event propagation path in advance, per W3C events spec (#9951) 14475 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 14476 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 14477 14478 bubbleType = special.delegateType || type; 14479 if ( !rfocusMorph.test( bubbleType + type ) ) { 14480 cur = cur.parentNode; 14481 } 14482 for ( ; cur; cur = cur.parentNode ) { 14483 eventPath.push( cur ); 14484 tmp = cur; 14485 } 14486 14487 // Only add window if we got to document (e.g., not plain obj or detached DOM) 14488 if ( tmp === ( elem.ownerDocument || document ) ) { 14489 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 14490 } 14491 } 14492 14493 // Fire handlers on the event path 14494 i = 0; 14495 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 14496 lastElement = cur; 14497 event.type = i > 1 ? 14498 bubbleType : 14499 special.bindType || type; 14500 14501 // jQuery handler 14502 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 14503 dataPriv.get( cur, "handle" ); 14504 if ( handle ) { 14505 handle.apply( cur, data ); 14506 } 14507 14508 // Native handler 14509 handle = ontype && cur[ ontype ]; 14510 if ( handle && handle.apply && acceptData( cur ) ) { 14511 event.result = handle.apply( cur, data ); 14512 if ( event.result === false ) { 14513 event.preventDefault(); 14514 } 14515 } 14516 } 14517 event.type = type; 14518 14519 // If nobody prevented the default action, do it now 14520 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 14521 14522 if ( ( !special._default || 14523 special._default.apply( eventPath.pop(), data ) === false ) && 14524 acceptData( elem ) ) { 14525 14526 // Call a native DOM method on the target with the same name as the event. 14527 // Don't do default actions on window, that's where global variables be (#6170) 14528 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 14529 14530 // Don't re-trigger an onFOO event when we call its FOO() method 14531 tmp = elem[ ontype ]; 14532 14533 if ( tmp ) { 14534 elem[ ontype ] = null; 14535 } 14536 14537 // Prevent re-triggering of the same event, since we already bubbled it above 14538 jQuery.event.triggered = type; 14539 14540 if ( event.isPropagationStopped() ) { 14541 lastElement.addEventListener( type, stopPropagationCallback ); 14542 } 14543 14544 elem[ type ](); 14545 14546 if ( event.isPropagationStopped() ) { 14547 lastElement.removeEventListener( type, stopPropagationCallback ); 14548 } 14549 14550 jQuery.event.triggered = undefined; 14551 14552 if ( tmp ) { 14553 elem[ ontype ] = tmp; 14554 } 14555 } 14556 } 14557 } 14558 14559 return event.result; 14560 }, 14561 14562 // Piggyback on a donor event to simulate a different one 14563 // Used only for `focus(in | out)` events 14564 simulate: function( type, elem, event ) { 14565 var e = jQuery.extend( 14566 new jQuery.Event(), 14567 event, 14568 { 14569 type: type, 14570 isSimulated: true 14571 } 14572 ); 14573 14574 jQuery.event.trigger( e, null, elem ); 14575 } 14576 14577} ); 14578 14579jQuery.fn.extend( { 14580 14581 trigger: function( type, data ) { 14582 return this.each( function() { 14583 jQuery.event.trigger( type, data, this ); 14584 } ); 14585 }, 14586 triggerHandler: function( type, data ) { 14587 var elem = this[ 0 ]; 14588 if ( elem ) { 14589 return jQuery.event.trigger( type, data, elem, true ); 14590 } 14591 } 14592} ); 14593 14594 14595// Support: Firefox <=44 14596// Firefox doesn't have focus(in | out) events 14597// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 14598// 14599// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 14600// focus(in | out) events fire after focus & blur events, 14601// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 14602// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 14603if ( !support.focusin ) { 14604 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 14605 14606 // Attach a single capturing handler on the document while someone wants focusin/focusout 14607 var handler = function( event ) { 14608 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 14609 }; 14610 14611 jQuery.event.special[ fix ] = { 14612 setup: function() { 14613 var doc = this.ownerDocument || this, 14614 attaches = dataPriv.access( doc, fix ); 14615 14616 if ( !attaches ) { 14617 doc.addEventListener( orig, handler, true ); 14618 } 14619 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 14620 }, 14621 teardown: function() { 14622 var doc = this.ownerDocument || this, 14623 attaches = dataPriv.access( doc, fix ) - 1; 14624 14625 if ( !attaches ) { 14626 doc.removeEventListener( orig, handler, true ); 14627 dataPriv.remove( doc, fix ); 14628 14629 } else { 14630 dataPriv.access( doc, fix, attaches ); 14631 } 14632 } 14633 }; 14634 } ); 14635} 14636var location = window.location; 14637 14638var nonce = Date.now(); 14639 14640var rquery = ( /\?/ ); 14641 14642 14643 14644// Cross-browser xml parsing 14645jQuery.parseXML = function( data ) { 14646 var xml; 14647 if ( !data || typeof data !== "string" ) { 14648 return null; 14649 } 14650 14651 // Support: IE 9 - 11 only 14652 // IE throws on parseFromString with invalid input. 14653 try { 14654 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 14655 } catch ( e ) { 14656 xml = undefined; 14657 } 14658 14659 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 14660 jQuery.error( "Invalid XML: " + data ); 14661 } 14662 return xml; 14663}; 14664 14665 14666var 14667 rbracket = /\[\]$/, 14668 rCRLF = /\r?\n/g, 14669 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 14670 rsubmittable = /^(?:input|select|textarea|keygen)/i; 14671 14672function buildParams( prefix, obj, traditional, add ) { 14673 var name; 14674 14675 if ( Array.isArray( obj ) ) { 14676 14677 // Serialize array item. 14678 jQuery.each( obj, function( i, v ) { 14679 if ( traditional || rbracket.test( prefix ) ) { 14680 14681 // Treat each array item as a scalar. 14682 add( prefix, v ); 14683 14684 } else { 14685 14686 // Item is non-scalar (array or object), encode its numeric index. 14687 buildParams( 14688 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 14689 v, 14690 traditional, 14691 add 14692 ); 14693 } 14694 } ); 14695 14696 } else if ( !traditional && toType( obj ) === "object" ) { 14697 14698 // Serialize object item. 14699 for ( name in obj ) { 14700 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 14701 } 14702 14703 } else { 14704 14705 // Serialize scalar item. 14706 add( prefix, obj ); 14707 } 14708} 14709 14710// Serialize an array of form elements or a set of 14711// key/values into a query string 14712jQuery.param = function( a, traditional ) { 14713 var prefix, 14714 s = [], 14715 add = function( key, valueOrFunction ) { 14716 14717 // If value is a function, invoke it and use its return value 14718 var value = isFunction( valueOrFunction ) ? 14719 valueOrFunction() : 14720 valueOrFunction; 14721 14722 s[ s.length ] = encodeURIComponent( key ) + "=" + 14723 encodeURIComponent( value == null ? "" : value ); 14724 }; 14725 14726 // If an array was passed in, assume that it is an array of form elements. 14727 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 14728 14729 // Serialize the form elements 14730 jQuery.each( a, function() { 14731 add( this.name, this.value ); 14732 } ); 14733 14734 } else { 14735 14736 // If traditional, encode the "old" way (the way 1.3.2 or older 14737 // did it), otherwise encode params recursively. 14738 for ( prefix in a ) { 14739 buildParams( prefix, a[ prefix ], traditional, add ); 14740 } 14741 } 14742 14743 // Return the resulting serialization 14744 return s.join( "&" ); 14745}; 14746 14747jQuery.fn.extend( { 14748 serialize: function() { 14749 return jQuery.param( this.serializeArray() ); 14750 }, 14751 serializeArray: function() { 14752 return this.map( function() { 14753 14754 // Can add propHook for "elements" to filter or add form elements 14755 var elements = jQuery.prop( this, "elements" ); 14756 return elements ? jQuery.makeArray( elements ) : this; 14757 } ) 14758 .filter( function() { 14759 var type = this.type; 14760 14761 // Use .is( ":disabled" ) so that fieldset[disabled] works 14762 return this.name && !jQuery( this ).is( ":disabled" ) && 14763 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 14764 ( this.checked || !rcheckableType.test( type ) ); 14765 } ) 14766 .map( function( i, elem ) { 14767 var val = jQuery( this ).val(); 14768 14769 if ( val == null ) { 14770 return null; 14771 } 14772 14773 if ( Array.isArray( val ) ) { 14774 return jQuery.map( val, function( val ) { 14775 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14776 } ); 14777 } 14778 14779 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14780 } ).get(); 14781 } 14782} ); 14783 14784 14785var 14786 r20 = /%20/g, 14787 rhash = /#.*$/, 14788 rantiCache = /([?&])_=[^&]*/, 14789 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 14790 14791 // #7653, #8125, #8152: local protocol detection 14792 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 14793 rnoContent = /^(?:GET|HEAD)$/, 14794 rprotocol = /^\/\//, 14795 14796 /* Prefilters 14797 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 14798 * 2) These are called: 14799 * - BEFORE asking for a transport 14800 * - AFTER param serialization (s.data is a string if s.processData is true) 14801 * 3) key is the dataType 14802 * 4) the catchall symbol "*" can be used 14803 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 14804 */ 14805 prefilters = {}, 14806 14807 /* Transports bindings 14808 * 1) key is the dataType 14809 * 2) the catchall symbol "*" can be used 14810 * 3) selection will start with transport dataType and THEN go to "*" if needed 14811 */ 14812 transports = {}, 14813 14814 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 14815 allTypes = "*/".concat( "*" ), 14816 14817 // Anchor tag for parsing the document origin 14818 originAnchor = document.createElement( "a" ); 14819 originAnchor.href = location.href; 14820 14821// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 14822function addToPrefiltersOrTransports( structure ) { 14823 14824 // dataTypeExpression is optional and defaults to "*" 14825 return function( dataTypeExpression, func ) { 14826 14827 if ( typeof dataTypeExpression !== "string" ) { 14828 func = dataTypeExpression; 14829 dataTypeExpression = "*"; 14830 } 14831 14832 var dataType, 14833 i = 0, 14834 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 14835 14836 if ( isFunction( func ) ) { 14837 14838 // For each dataType in the dataTypeExpression 14839 while ( ( dataType = dataTypes[ i++ ] ) ) { 14840 14841 // Prepend if requested 14842 if ( dataType[ 0 ] === "+" ) { 14843 dataType = dataType.slice( 1 ) || "*"; 14844 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 14845 14846 // Otherwise append 14847 } else { 14848 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 14849 } 14850 } 14851 } 14852 }; 14853} 14854 14855// Base inspection function for prefilters and transports 14856function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 14857 14858 var inspected = {}, 14859 seekingTransport = ( structure === transports ); 14860 14861 function inspect( dataType ) { 14862 var selected; 14863 inspected[ dataType ] = true; 14864 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 14865 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 14866 if ( typeof dataTypeOrTransport === "string" && 14867 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 14868 14869 options.dataTypes.unshift( dataTypeOrTransport ); 14870 inspect( dataTypeOrTransport ); 14871 return false; 14872 } else if ( seekingTransport ) { 14873 return !( selected = dataTypeOrTransport ); 14874 } 14875 } ); 14876 return selected; 14877 } 14878 14879 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 14880} 14881 14882// A special extend for ajax options 14883// that takes "flat" options (not to be deep extended) 14884// Fixes #9887 14885function ajaxExtend( target, src ) { 14886 var key, deep, 14887 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 14888 14889 for ( key in src ) { 14890 if ( src[ key ] !== undefined ) { 14891 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 14892 } 14893 } 14894 if ( deep ) { 14895 jQuery.extend( true, target, deep ); 14896 } 14897 14898 return target; 14899} 14900 14901/* Handles responses to an ajax request: 14902 * - finds the right dataType (mediates between content-type and expected dataType) 14903 * - returns the corresponding response 14904 */ 14905function ajaxHandleResponses( s, jqXHR, responses ) { 14906 14907 var ct, type, finalDataType, firstDataType, 14908 contents = s.contents, 14909 dataTypes = s.dataTypes; 14910 14911 // Remove auto dataType and get content-type in the process 14912 while ( dataTypes[ 0 ] === "*" ) { 14913 dataTypes.shift(); 14914 if ( ct === undefined ) { 14915 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 14916 } 14917 } 14918 14919 // Check if we're dealing with a known content-type 14920 if ( ct ) { 14921 for ( type in contents ) { 14922 if ( contents[ type ] && contents[ type ].test( ct ) ) { 14923 dataTypes.unshift( type ); 14924 break; 14925 } 14926 } 14927 } 14928 14929 // Check to see if we have a response for the expected dataType 14930 if ( dataTypes[ 0 ] in responses ) { 14931 finalDataType = dataTypes[ 0 ]; 14932 } else { 14933 14934 // Try convertible dataTypes 14935 for ( type in responses ) { 14936 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 14937 finalDataType = type; 14938 break; 14939 } 14940 if ( !firstDataType ) { 14941 firstDataType = type; 14942 } 14943 } 14944 14945 // Or just use first one 14946 finalDataType = finalDataType || firstDataType; 14947 } 14948 14949 // If we found a dataType 14950 // We add the dataType to the list if needed 14951 // and return the corresponding response 14952 if ( finalDataType ) { 14953 if ( finalDataType !== dataTypes[ 0 ] ) { 14954 dataTypes.unshift( finalDataType ); 14955 } 14956 return responses[ finalDataType ]; 14957 } 14958} 14959 14960/* Chain conversions given the request and the original response 14961 * Also sets the responseXXX fields on the jqXHR instance 14962 */ 14963function ajaxConvert( s, response, jqXHR, isSuccess ) { 14964 var conv2, current, conv, tmp, prev, 14965 converters = {}, 14966 14967 // Work with a copy of dataTypes in case we need to modify it for conversion 14968 dataTypes = s.dataTypes.slice(); 14969 14970 // Create converters map with lowercased keys 14971 if ( dataTypes[ 1 ] ) { 14972 for ( conv in s.converters ) { 14973 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 14974 } 14975 } 14976 14977 current = dataTypes.shift(); 14978 14979 // Convert to each sequential dataType 14980 while ( current ) { 14981 14982 if ( s.responseFields[ current ] ) { 14983 jqXHR[ s.responseFields[ current ] ] = response; 14984 } 14985 14986 // Apply the dataFilter if provided 14987 if ( !prev && isSuccess && s.dataFilter ) { 14988 response = s.dataFilter( response, s.dataType ); 14989 } 14990 14991 prev = current; 14992 current = dataTypes.shift(); 14993 14994 if ( current ) { 14995 14996 // There's only work to do if current dataType is non-auto 14997 if ( current === "*" ) { 14998 14999 current = prev; 15000 15001 // Convert response if prev dataType is non-auto and differs from current 15002 } else if ( prev !== "*" && prev !== current ) { 15003 15004 // Seek a direct converter 15005 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 15006 15007 // If none found, seek a pair 15008 if ( !conv ) { 15009 for ( conv2 in converters ) { 15010 15011 // If conv2 outputs current 15012 tmp = conv2.split( " " ); 15013 if ( tmp[ 1 ] === current ) { 15014 15015 // If prev can be converted to accepted input 15016 conv = converters[ prev + " " + tmp[ 0 ] ] || 15017 converters[ "* " + tmp[ 0 ] ]; 15018 if ( conv ) { 15019 15020 // Condense equivalence converters 15021 if ( conv === true ) { 15022 conv = converters[ conv2 ]; 15023 15024 // Otherwise, insert the intermediate dataType 15025 } else if ( converters[ conv2 ] !== true ) { 15026 current = tmp[ 0 ]; 15027 dataTypes.unshift( tmp[ 1 ] ); 15028 } 15029 break; 15030 } 15031 } 15032 } 15033 } 15034 15035 // Apply converter (if not an equivalence) 15036 if ( conv !== true ) { 15037 15038 // Unless errors are allowed to bubble, catch and return them 15039 if ( conv && s.throws ) { 15040 response = conv( response ); 15041 } else { 15042 try { 15043 response = conv( response ); 15044 } catch ( e ) { 15045 return { 15046 state: "parsererror", 15047 error: conv ? e : "No conversion from " + prev + " to " + current 15048 }; 15049 } 15050 } 15051 } 15052 } 15053 } 15054 } 15055 15056 return { state: "success", data: response }; 15057} 15058 15059jQuery.extend( { 15060 15061 // Counter for holding the number of active queries 15062 active: 0, 15063 15064 // Last-Modified header cache for next request 15065 lastModified: {}, 15066 etag: {}, 15067 15068 ajaxSettings: { 15069 url: location.href, 15070 type: "GET", 15071 isLocal: rlocalProtocol.test( location.protocol ), 15072 global: true, 15073 processData: true, 15074 async: true, 15075 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 15076 15077 /* 15078 timeout: 0, 15079 data: null, 15080 dataType: null, 15081 username: null, 15082 password: null, 15083 cache: null, 15084 throws: false, 15085 traditional: false, 15086 headers: {}, 15087 */ 15088 15089 accepts: { 15090 "*": allTypes, 15091 text: "text/plain", 15092 html: "text/html", 15093 xml: "application/xml, text/xml", 15094 json: "application/json, text/javascript" 15095 }, 15096 15097 contents: { 15098 xml: /\bxml\b/, 15099 html: /\bhtml/, 15100 json: /\bjson\b/ 15101 }, 15102 15103 responseFields: { 15104 xml: "responseXML", 15105 text: "responseText", 15106 json: "responseJSON" 15107 }, 15108 15109 // Data converters 15110 // Keys separate source (or catchall "*") and destination types with a single space 15111 converters: { 15112 15113 // Convert anything to text 15114 "* text": String, 15115 15116 // Text to html (true = no transformation) 15117 "text html": true, 15118 15119 // Evaluate text as a json expression 15120 "text json": JSON.parse, 15121 15122 // Parse text as xml 15123 "text xml": jQuery.parseXML 15124 }, 15125 15126 // For options that shouldn't be deep extended: 15127 // you can add your own custom options here if 15128 // and when you create one that shouldn't be 15129 // deep extended (see ajaxExtend) 15130 flatOptions: { 15131 url: true, 15132 context: true 15133 } 15134 }, 15135 15136 // Creates a full fledged settings object into target 15137 // with both ajaxSettings and settings fields. 15138 // If target is omitted, writes into ajaxSettings. 15139 ajaxSetup: function( target, settings ) { 15140 return settings ? 15141 15142 // Building a settings object 15143 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 15144 15145 // Extending ajaxSettings 15146 ajaxExtend( jQuery.ajaxSettings, target ); 15147 }, 15148 15149 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 15150 ajaxTransport: addToPrefiltersOrTransports( transports ), 15151 15152 // Main method 15153 ajax: function( url, options ) { 15154 15155 // If url is an object, simulate pre-1.5 signature 15156 if ( typeof url === "object" ) { 15157 options = url; 15158 url = undefined; 15159 } 15160 15161 // Force options to be an object 15162 options = options || {}; 15163 15164 var transport, 15165 15166 // URL without anti-cache param 15167 cacheURL, 15168 15169 // Response headers 15170 responseHeadersString, 15171 responseHeaders, 15172 15173 // timeout handle 15174 timeoutTimer, 15175 15176 // Url cleanup var 15177 urlAnchor, 15178 15179 // Request state (becomes false upon send and true upon completion) 15180 completed, 15181 15182 // To know if global events are to be dispatched 15183 fireGlobals, 15184 15185 // Loop variable 15186 i, 15187 15188 // uncached part of the url 15189 uncached, 15190 15191 // Create the final options object 15192 s = jQuery.ajaxSetup( {}, options ), 15193 15194 // Callbacks context 15195 callbackContext = s.context || s, 15196 15197 // Context for global events is callbackContext if it is a DOM node or jQuery collection 15198 globalEventContext = s.context && 15199 ( callbackContext.nodeType || callbackContext.jquery ) ? 15200 jQuery( callbackContext ) : 15201 jQuery.event, 15202 15203 // Deferreds 15204 deferred = jQuery.Deferred(), 15205 completeDeferred = jQuery.Callbacks( "once memory" ), 15206 15207 // Status-dependent callbacks 15208 statusCode = s.statusCode || {}, 15209 15210 // Headers (they are sent all at once) 15211 requestHeaders = {}, 15212 requestHeadersNames = {}, 15213 15214 // Default abort message 15215 strAbort = "canceled", 15216 15217 // Fake xhr 15218 jqXHR = { 15219 readyState: 0, 15220 15221 // Builds headers hashtable if needed 15222 getResponseHeader: function( key ) { 15223 var match; 15224 if ( completed ) { 15225 if ( !responseHeaders ) { 15226 responseHeaders = {}; 15227 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 15228 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 15229 } 15230 } 15231 match = responseHeaders[ key.toLowerCase() ]; 15232 } 15233 return match == null ? null : match; 15234 }, 15235 15236 // Raw string 15237 getAllResponseHeaders: function() { 15238 return completed ? responseHeadersString : null; 15239 }, 15240 15241 // Caches the header 15242 setRequestHeader: function( name, value ) { 15243 if ( completed == null ) { 15244 name = requestHeadersNames[ name.toLowerCase() ] = 15245 requestHeadersNames[ name.toLowerCase() ] || name; 15246 requestHeaders[ name ] = value; 15247 } 15248 return this; 15249 }, 15250 15251 // Overrides response content-type header 15252 overrideMimeType: function( type ) { 15253 if ( completed == null ) { 15254 s.mimeType = type; 15255 } 15256 return this; 15257 }, 15258 15259 // Status-dependent callbacks 15260 statusCode: function( map ) { 15261 var code; 15262 if ( map ) { 15263 if ( completed ) { 15264 15265 // Execute the appropriate callbacks 15266 jqXHR.always( map[ jqXHR.status ] ); 15267 } else { 15268 15269 // Lazy-add the new callbacks in a way that preserves old ones 15270 for ( code in map ) { 15271 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 15272 } 15273 } 15274 } 15275 return this; 15276 }, 15277 15278 // Cancel the request 15279 abort: function( statusText ) { 15280 var finalText = statusText || strAbort; 15281 if ( transport ) { 15282 transport.abort( finalText ); 15283 } 15284 done( 0, finalText ); 15285 return this; 15286 } 15287 }; 15288 15289 // Attach deferreds 15290 deferred.promise( jqXHR ); 15291 15292 // Add protocol if not provided (prefilters might expect it) 15293 // Handle falsy url in the settings object (#10093: consistency with old signature) 15294 // We also use the url parameter if available 15295 s.url = ( ( url || s.url || location.href ) + "" ) 15296 .replace( rprotocol, location.protocol + "//" ); 15297 15298 // Alias method option to type as per ticket #12004 15299 s.type = options.method || options.type || s.method || s.type; 15300 15301 // Extract dataTypes list 15302 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 15303 15304 // A cross-domain request is in order when the origin doesn't match the current origin. 15305 if ( s.crossDomain == null ) { 15306 urlAnchor = document.createElement( "a" ); 15307 15308 // Support: IE <=8 - 11, Edge 12 - 15 15309 // IE throws exception on accessing the href property if url is malformed, 15310 // e.g. http://example.com:80x/ 15311 try { 15312 urlAnchor.href = s.url; 15313 15314 // Support: IE <=8 - 11 only 15315 // Anchor's host property isn't correctly set when s.url is relative 15316 urlAnchor.href = urlAnchor.href; 15317 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 15318 urlAnchor.protocol + "//" + urlAnchor.host; 15319 } catch ( e ) { 15320 15321 // If there is an error parsing the URL, assume it is crossDomain, 15322 // it can be rejected by the transport if it is invalid 15323 s.crossDomain = true; 15324 } 15325 } 15326 15327 // Convert data if not already a string 15328 if ( s.data && s.processData && typeof s.data !== "string" ) { 15329 s.data = jQuery.param( s.data, s.traditional ); 15330 } 15331 15332 // Apply prefilters 15333 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 15334 15335 // If request was aborted inside a prefilter, stop there 15336 if ( completed ) { 15337 return jqXHR; 15338 } 15339 15340 // We can fire global events as of now if asked to 15341 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 15342 fireGlobals = jQuery.event && s.global; 15343 15344 // Watch for a new set of requests 15345 if ( fireGlobals && jQuery.active++ === 0 ) { 15346 jQuery.event.trigger( "ajaxStart" ); 15347 } 15348 15349 // Uppercase the type 15350 s.type = s.type.toUpperCase(); 15351 15352 // Determine if request has content 15353 s.hasContent = !rnoContent.test( s.type ); 15354 15355 // Save the URL in case we're toying with the If-Modified-Since 15356 // and/or If-None-Match header later on 15357 // Remove hash to simplify url manipulation 15358 cacheURL = s.url.replace( rhash, "" ); 15359 15360 // More options handling for requests with no content 15361 if ( !s.hasContent ) { 15362 15363 // Remember the hash so we can put it back 15364 uncached = s.url.slice( cacheURL.length ); 15365 15366 // If data is available and should be processed, append data to url 15367 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 15368 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 15369 15370 // #9682: remove data so that it's not used in an eventual retry 15371 delete s.data; 15372 } 15373 15374 // Add or update anti-cache param if needed 15375 if ( s.cache === false ) { 15376 cacheURL = cacheURL.replace( rantiCache, "$1" ); 15377 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; 15378 } 15379 15380 // Put hash and anti-cache on the URL that will be requested (gh-1732) 15381 s.url = cacheURL + uncached; 15382 15383 // Change '%20' to '+' if this is encoded form body content (gh-2658) 15384 } else if ( s.data && s.processData && 15385 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 15386 s.data = s.data.replace( r20, "+" ); 15387 } 15388 15389 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 15390 if ( s.ifModified ) { 15391 if ( jQuery.lastModified[ cacheURL ] ) { 15392 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 15393 } 15394 if ( jQuery.etag[ cacheURL ] ) { 15395 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 15396 } 15397 } 15398 15399 // Set the correct header, if data is being sent 15400 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 15401 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 15402 } 15403 15404 // Set the Accepts header for the server, depending on the dataType 15405 jqXHR.setRequestHeader( 15406 "Accept", 15407 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 15408 s.accepts[ s.dataTypes[ 0 ] ] + 15409 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 15410 s.accepts[ "*" ] 15411 ); 15412 15413 // Check for headers option 15414 for ( i in s.headers ) { 15415 jqXHR.setRequestHeader( i, s.headers[ i ] ); 15416 } 15417 15418 // Allow custom headers/mimetypes and early abort 15419 if ( s.beforeSend && 15420 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 15421 15422 // Abort if not done already and return 15423 return jqXHR.abort(); 15424 } 15425 15426 // Aborting is no longer a cancellation 15427 strAbort = "abort"; 15428 15429 // Install callbacks on deferreds 15430 completeDeferred.add( s.complete ); 15431 jqXHR.done( s.success ); 15432 jqXHR.fail( s.error ); 15433 15434 // Get transport 15435 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 15436 15437 // If no transport, we auto-abort 15438 if ( !transport ) { 15439 done( -1, "No Transport" ); 15440 } else { 15441 jqXHR.readyState = 1; 15442 15443 // Send global event 15444 if ( fireGlobals ) { 15445 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 15446 } 15447 15448 // If request was aborted inside ajaxSend, stop there 15449 if ( completed ) { 15450 return jqXHR; 15451 } 15452 15453 // Timeout 15454 if ( s.async && s.timeout > 0 ) { 15455 timeoutTimer = window.setTimeout( function() { 15456 jqXHR.abort( "timeout" ); 15457 }, s.timeout ); 15458 } 15459 15460 try { 15461 completed = false; 15462 transport.send( requestHeaders, done ); 15463 } catch ( e ) { 15464 15465 // Rethrow post-completion exceptions 15466 if ( completed ) { 15467 throw e; 15468 } 15469 15470 // Propagate others as results 15471 done( -1, e ); 15472 } 15473 } 15474 15475 // Callback for when everything is done 15476 function done( status, nativeStatusText, responses, headers ) { 15477 var isSuccess, success, error, response, modified, 15478 statusText = nativeStatusText; 15479 15480 // Ignore repeat invocations 15481 if ( completed ) { 15482 return; 15483 } 15484 15485 completed = true; 15486 15487 // Clear timeout if it exists 15488 if ( timeoutTimer ) { 15489 window.clearTimeout( timeoutTimer ); 15490 } 15491 15492 // Dereference transport for early garbage collection 15493 // (no matter how long the jqXHR object will be used) 15494 transport = undefined; 15495 15496 // Cache response headers 15497 responseHeadersString = headers || ""; 15498 15499 // Set readyState 15500 jqXHR.readyState = status > 0 ? 4 : 0; 15501 15502 // Determine if successful 15503 isSuccess = status >= 200 && status < 300 || status === 304; 15504 15505 // Get response data 15506 if ( responses ) { 15507 response = ajaxHandleResponses( s, jqXHR, responses ); 15508 } 15509 15510 // Convert no matter what (that way responseXXX fields are always set) 15511 response = ajaxConvert( s, response, jqXHR, isSuccess ); 15512 15513 // If successful, handle type chaining 15514 if ( isSuccess ) { 15515 15516 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 15517 if ( s.ifModified ) { 15518 modified = jqXHR.getResponseHeader( "Last-Modified" ); 15519 if ( modified ) { 15520 jQuery.lastModified[ cacheURL ] = modified; 15521 } 15522 modified = jqXHR.getResponseHeader( "etag" ); 15523 if ( modified ) { 15524 jQuery.etag[ cacheURL ] = modified; 15525 } 15526 } 15527 15528 // if no content 15529 if ( status === 204 || s.type === "HEAD" ) { 15530 statusText = "nocontent"; 15531 15532 // if not modified 15533 } else if ( status === 304 ) { 15534 statusText = "notmodified"; 15535 15536 // If we have data, let's convert it 15537 } else { 15538 statusText = response.state; 15539 success = response.data; 15540 error = response.error; 15541 isSuccess = !error; 15542 } 15543 } else { 15544 15545 // Extract error from statusText and normalize for non-aborts 15546 error = statusText; 15547 if ( status || !statusText ) { 15548 statusText = "error"; 15549 if ( status < 0 ) { 15550 status = 0; 15551 } 15552 } 15553 } 15554 15555 // Set data for the fake xhr object 15556 jqXHR.status = status; 15557 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 15558 15559 // Success/Error 15560 if ( isSuccess ) { 15561 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 15562 } else { 15563 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 15564 } 15565 15566 // Status-dependent callbacks 15567 jqXHR.statusCode( statusCode ); 15568 statusCode = undefined; 15569 15570 if ( fireGlobals ) { 15571 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 15572 [ jqXHR, s, isSuccess ? success : error ] ); 15573 } 15574 15575 // Complete 15576 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 15577 15578 if ( fireGlobals ) { 15579 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 15580 15581 // Handle the global AJAX counter 15582 if ( !( --jQuery.active ) ) { 15583 jQuery.event.trigger( "ajaxStop" ); 15584 } 15585 } 15586 } 15587 15588 return jqXHR; 15589 }, 15590 15591 getJSON: function( url, data, callback ) { 15592 return jQuery.get( url, data, callback, "json" ); 15593 }, 15594 15595 getScript: function( url, callback ) { 15596 return jQuery.get( url, undefined, callback, "script" ); 15597 } 15598} ); 15599 15600jQuery.each( [ "get", "post" ], function( i, method ) { 15601 jQuery[ method ] = function( url, data, callback, type ) { 15602 15603 // Shift arguments if data argument was omitted 15604 if ( isFunction( data ) ) { 15605 type = type || callback; 15606 callback = data; 15607 data = undefined; 15608 } 15609 15610 // The url can be an options object (which then must have .url) 15611 return jQuery.ajax( jQuery.extend( { 15612 url: url, 15613 type: method, 15614 dataType: type, 15615 data: data, 15616 success: callback 15617 }, jQuery.isPlainObject( url ) && url ) ); 15618 }; 15619} ); 15620 15621 15622jQuery._evalUrl = function( url ) { 15623 return jQuery.ajax( { 15624 url: url, 15625 15626 // Make this explicit, since user can override this through ajaxSetup (#11264) 15627 type: "GET", 15628 dataType: "script", 15629 cache: true, 15630 async: false, 15631 global: false, 15632 "throws": true 15633 } ); 15634}; 15635 15636 15637jQuery.fn.extend( { 15638 wrapAll: function( html ) { 15639 var wrap; 15640 15641 if ( this[ 0 ] ) { 15642 if ( isFunction( html ) ) { 15643 html = html.call( this[ 0 ] ); 15644 } 15645 15646 // The elements to wrap the target around 15647 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 15648 15649 if ( this[ 0 ].parentNode ) { 15650 wrap.insertBefore( this[ 0 ] ); 15651 } 15652 15653 wrap.map( function() { 15654 var elem = this; 15655 15656 while ( elem.firstElementChild ) { 15657 elem = elem.firstElementChild; 15658 } 15659 15660 return elem; 15661 } ).append( this ); 15662 } 15663 15664 return this; 15665 }, 15666 15667 wrapInner: function( html ) { 15668 if ( isFunction( html ) ) { 15669 return this.each( function( i ) { 15670 jQuery( this ).wrapInner( html.call( this, i ) ); 15671 } ); 15672 } 15673 15674 return this.each( function() { 15675 var self = jQuery( this ), 15676 contents = self.contents(); 15677 15678 if ( contents.length ) { 15679 contents.wrapAll( html ); 15680 15681 } else { 15682 self.append( html ); 15683 } 15684 } ); 15685 }, 15686 15687 wrap: function( html ) { 15688 var htmlIsFunction = isFunction( html ); 15689 15690 return this.each( function( i ) { 15691 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 15692 } ); 15693 }, 15694 15695 unwrap: function( selector ) { 15696 this.parent( selector ).not( "body" ).each( function() { 15697 jQuery( this ).replaceWith( this.childNodes ); 15698 } ); 15699 return this; 15700 } 15701} ); 15702 15703 15704jQuery.expr.pseudos.hidden = function( elem ) { 15705 return !jQuery.expr.pseudos.visible( elem ); 15706}; 15707jQuery.expr.pseudos.visible = function( elem ) { 15708 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 15709}; 15710 15711 15712 15713 15714jQuery.ajaxSettings.xhr = function() { 15715 try { 15716 return new window.XMLHttpRequest(); 15717 } catch ( e ) {} 15718}; 15719 15720var xhrSuccessStatus = { 15721 15722 // File protocol always yields status code 0, assume 200 15723 0: 200, 15724 15725 // Support: IE <=9 only 15726 // #1450: sometimes IE returns 1223 when it should be 204 15727 1223: 204 15728 }, 15729 xhrSupported = jQuery.ajaxSettings.xhr(); 15730 15731support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 15732support.ajax = xhrSupported = !!xhrSupported; 15733 15734jQuery.ajaxTransport( function( options ) { 15735 var callback, errorCallback; 15736 15737 // Cross domain only allowed if supported through XMLHttpRequest 15738 if ( support.cors || xhrSupported && !options.crossDomain ) { 15739 return { 15740 send: function( headers, complete ) { 15741 var i, 15742 xhr = options.xhr(); 15743 15744 xhr.open( 15745 options.type, 15746 options.url, 15747 options.async, 15748 options.username, 15749 options.password 15750 ); 15751 15752 // Apply custom fields if provided 15753 if ( options.xhrFields ) { 15754 for ( i in options.xhrFields ) { 15755 xhr[ i ] = options.xhrFields[ i ]; 15756 } 15757 } 15758 15759 // Override mime type if needed 15760 if ( options.mimeType && xhr.overrideMimeType ) { 15761 xhr.overrideMimeType( options.mimeType ); 15762 } 15763 15764 // X-Requested-With header 15765 // For cross-domain requests, seeing as conditions for a preflight are 15766 // akin to a jigsaw puzzle, we simply never set it to be sure. 15767 // (it can always be set on a per-request basis or even using ajaxSetup) 15768 // For same-domain requests, won't change header if already provided. 15769 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 15770 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 15771 } 15772 15773 // Set headers 15774 for ( i in headers ) { 15775 xhr.setRequestHeader( i, headers[ i ] ); 15776 } 15777 15778 // Callback 15779 callback = function( type ) { 15780 return function() { 15781 if ( callback ) { 15782 callback = errorCallback = xhr.onload = 15783 xhr.onerror = xhr.onabort = xhr.ontimeout = 15784 xhr.onreadystatechange = null; 15785 15786 if ( type === "abort" ) { 15787 xhr.abort(); 15788 } else if ( type === "error" ) { 15789 15790 // Support: IE <=9 only 15791 // On a manual native abort, IE9 throws 15792 // errors on any property access that is not readyState 15793 if ( typeof xhr.status !== "number" ) { 15794 complete( 0, "error" ); 15795 } else { 15796 complete( 15797 15798 // File: protocol always yields status 0; see #8605, #14207 15799 xhr.status, 15800 xhr.statusText 15801 ); 15802 } 15803 } else { 15804 complete( 15805 xhrSuccessStatus[ xhr.status ] || xhr.status, 15806 xhr.statusText, 15807 15808 // Support: IE <=9 only 15809 // IE9 has no XHR2 but throws on binary (trac-11426) 15810 // For XHR2 non-text, let the caller handle it (gh-2498) 15811 ( xhr.responseType || "text" ) !== "text" || 15812 typeof xhr.responseText !== "string" ? 15813 { binary: xhr.response } : 15814 { text: xhr.responseText }, 15815 xhr.getAllResponseHeaders() 15816 ); 15817 } 15818 } 15819 }; 15820 }; 15821 15822 // Listen to events 15823 xhr.onload = callback(); 15824 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 15825 15826 // Support: IE 9 only 15827 // Use onreadystatechange to replace onabort 15828 // to handle uncaught aborts 15829 if ( xhr.onabort !== undefined ) { 15830 xhr.onabort = errorCallback; 15831 } else { 15832 xhr.onreadystatechange = function() { 15833 15834 // Check readyState before timeout as it changes 15835 if ( xhr.readyState === 4 ) { 15836 15837 // Allow onerror to be called first, 15838 // but that will not handle a native abort 15839 // Also, save errorCallback to a variable 15840 // as xhr.onerror cannot be accessed 15841 window.setTimeout( function() { 15842 if ( callback ) { 15843 errorCallback(); 15844 } 15845 } ); 15846 } 15847 }; 15848 } 15849 15850 // Create the abort callback 15851 callback = callback( "abort" ); 15852 15853 try { 15854 15855 // Do send the request (this may raise an exception) 15856 xhr.send( options.hasContent && options.data || null ); 15857 } catch ( e ) { 15858 15859 // #14683: Only rethrow if this hasn't been notified as an error yet 15860 if ( callback ) { 15861 throw e; 15862 } 15863 } 15864 }, 15865 15866 abort: function() { 15867 if ( callback ) { 15868 callback(); 15869 } 15870 } 15871 }; 15872 } 15873} ); 15874 15875 15876 15877 15878// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 15879jQuery.ajaxPrefilter( function( s ) { 15880 if ( s.crossDomain ) { 15881 s.contents.script = false; 15882 } 15883} ); 15884 15885// Install script dataType 15886jQuery.ajaxSetup( { 15887 accepts: { 15888 script: "text/javascript, application/javascript, " + 15889 "application/ecmascript, application/x-ecmascript" 15890 }, 15891 contents: { 15892 script: /\b(?:java|ecma)script\b/ 15893 }, 15894 converters: { 15895 "text script": function( text ) { 15896 jQuery.globalEval( text ); 15897 return text; 15898 } 15899 } 15900} ); 15901 15902// Handle cache's special case and crossDomain 15903jQuery.ajaxPrefilter( "script", function( s ) { 15904 if ( s.cache === undefined ) { 15905 s.cache = false; 15906 } 15907 if ( s.crossDomain ) { 15908 s.type = "GET"; 15909 } 15910} ); 15911 15912// Bind script tag hack transport 15913jQuery.ajaxTransport( "script", function( s ) { 15914 15915 // This transport only deals with cross domain requests 15916 if ( s.crossDomain ) { 15917 var script, callback; 15918 return { 15919 send: function( _, complete ) { 15920 script = jQuery( "<script>" ).prop( { 15921 charset: s.scriptCharset, 15922 src: s.url 15923 } ).on( 15924 "load error", 15925 callback = function( evt ) { 15926 script.remove(); 15927 callback = null; 15928 if ( evt ) { 15929 complete( evt.type === "error" ? 404 : 200, evt.type ); 15930 } 15931 } 15932 ); 15933 15934 // Use native DOM manipulation to avoid our domManip AJAX trickery 15935 document.head.appendChild( script[ 0 ] ); 15936 }, 15937 abort: function() { 15938 if ( callback ) { 15939 callback(); 15940 } 15941 } 15942 }; 15943 } 15944} ); 15945 15946 15947 15948 15949var oldCallbacks = [], 15950 rjsonp = /(=)\?(?=&|$)|\?\?/; 15951 15952// Default jsonp settings 15953jQuery.ajaxSetup( { 15954 jsonp: "callback", 15955 jsonpCallback: function() { 15956 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 15957 this[ callback ] = true; 15958 return callback; 15959 } 15960} ); 15961 15962// Detect, normalize options and install callbacks for jsonp requests 15963jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 15964 15965 var callbackName, overwritten, responseContainer, 15966 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 15967 "url" : 15968 typeof s.data === "string" && 15969 ( s.contentType || "" ) 15970 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 15971 rjsonp.test( s.data ) && "data" 15972 ); 15973 15974 // Handle iff the expected data type is "jsonp" or we have a parameter to set 15975 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 15976 15977 // Get callback name, remembering preexisting value associated with it 15978 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 15979 s.jsonpCallback() : 15980 s.jsonpCallback; 15981 15982 // Insert callback into url or form data 15983 if ( jsonProp ) { 15984 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 15985 } else if ( s.jsonp !== false ) { 15986 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 15987 } 15988 15989 // Use data converter to retrieve json after script execution 15990 s.converters[ "script json" ] = function() { 15991 if ( !responseContainer ) { 15992 jQuery.error( callbackName + " was not called" ); 15993 } 15994 return responseContainer[ 0 ]; 15995 }; 15996 15997 // Force json dataType 15998 s.dataTypes[ 0 ] = "json"; 15999 16000 // Install callback 16001 overwritten = window[ callbackName ]; 16002 window[ callbackName ] = function() { 16003 responseContainer = arguments; 16004 }; 16005 16006 // Clean-up function (fires after converters) 16007 jqXHR.always( function() { 16008 16009 // If previous value didn't exist - remove it 16010 if ( overwritten === undefined ) { 16011 jQuery( window ).removeProp( callbackName ); 16012 16013 // Otherwise restore preexisting value 16014 } else { 16015 window[ callbackName ] = overwritten; 16016 } 16017 16018 // Save back as free 16019 if ( s[ callbackName ] ) { 16020 16021 // Make sure that re-using the options doesn't screw things around 16022 s.jsonpCallback = originalSettings.jsonpCallback; 16023 16024 // Save the callback name for future use 16025 oldCallbacks.push( callbackName ); 16026 } 16027 16028 // Call if it was a function and we have a response 16029 if ( responseContainer && isFunction( overwritten ) ) { 16030 overwritten( responseContainer[ 0 ] ); 16031 } 16032 16033 responseContainer = overwritten = undefined; 16034 } ); 16035 16036 // Delegate to script 16037 return "script"; 16038 } 16039} ); 16040 16041 16042 16043 16044// Support: Safari 8 only 16045// In Safari 8 documents created via document.implementation.createHTMLDocument 16046// collapse sibling forms: the second one becomes a child of the first one. 16047// Because of that, this security measure has to be disabled in Safari 8. 16048// https://bugs.webkit.org/show_bug.cgi?id=137337 16049support.createHTMLDocument = ( function() { 16050 var body = document.implementation.createHTMLDocument( "" ).body; 16051 body.innerHTML = "<form></form><form></form>"; 16052 return body.childNodes.length === 2; 16053} )(); 16054 16055 16056// Argument "data" should be string of html 16057// context (optional): If specified, the fragment will be created in this context, 16058// defaults to document 16059// keepScripts (optional): If true, will include scripts passed in the html string 16060jQuery.parseHTML = function( data, context, keepScripts ) { 16061 if ( typeof data !== "string" ) { 16062 return []; 16063 } 16064 if ( typeof context === "boolean" ) { 16065 keepScripts = context; 16066 context = false; 16067 } 16068 16069 var base, parsed, scripts; 16070 16071 if ( !context ) { 16072 16073 // Stop scripts or inline event handlers from being executed immediately 16074 // by using document.implementation 16075 if ( support.createHTMLDocument ) { 16076 context = document.implementation.createHTMLDocument( "" ); 16077 16078 // Set the base href for the created document 16079 // so any parsed elements with URLs 16080 // are based on the document's URL (gh-2965) 16081 base = context.createElement( "base" ); 16082 base.href = document.location.href; 16083 context.head.appendChild( base ); 16084 } else { 16085 context = document; 16086 } 16087 } 16088 16089 parsed = rsingleTag.exec( data ); 16090 scripts = !keepScripts && []; 16091 16092 // Single tag 16093 if ( parsed ) { 16094 return [ context.createElement( parsed[ 1 ] ) ]; 16095 } 16096 16097 parsed = buildFragment( [ data ], context, scripts ); 16098 16099 if ( scripts && scripts.length ) { 16100 jQuery( scripts ).remove(); 16101 } 16102 16103 return jQuery.merge( [], parsed.childNodes ); 16104}; 16105 16106 16107/** 16108 * Load a url into a page 16109 */ 16110jQuery.fn.load = function( url, params, callback ) { 16111 var selector, type, response, 16112 self = this, 16113 off = url.indexOf( " " ); 16114 16115 if ( off > -1 ) { 16116 selector = stripAndCollapse( url.slice( off ) ); 16117 url = url.slice( 0, off ); 16118 } 16119 16120 // If it's a function 16121 if ( isFunction( params ) ) { 16122 16123 // We assume that it's the callback 16124 callback = params; 16125 params = undefined; 16126 16127 // Otherwise, build a param string 16128 } else if ( params && typeof params === "object" ) { 16129 type = "POST"; 16130 } 16131 16132 // If we have elements to modify, make the request 16133 if ( self.length > 0 ) { 16134 jQuery.ajax( { 16135 url: url, 16136 16137 // If "type" variable is undefined, then "GET" method will be used. 16138 // Make value of this field explicit since 16139 // user can override it through ajaxSetup method 16140 type: type || "GET", 16141 dataType: "html", 16142 data: params 16143 } ).done( function( responseText ) { 16144 16145 // Save response for use in complete callback 16146 response = arguments; 16147 16148 self.html( selector ? 16149 16150 // If a selector was specified, locate the right elements in a dummy div 16151 // Exclude scripts to avoid IE 'Permission Denied' errors 16152 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 16153 16154 // Otherwise use the full result 16155 responseText ); 16156 16157 // If the request succeeds, this function gets "data", "status", "jqXHR" 16158 // but they are ignored because response was set above. 16159 // If it fails, this function gets "jqXHR", "status", "error" 16160 } ).always( callback && function( jqXHR, status ) { 16161 self.each( function() { 16162 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 16163 } ); 16164 } ); 16165 } 16166 16167 return this; 16168}; 16169 16170 16171 16172 16173// Attach a bunch of functions for handling common AJAX events 16174jQuery.each( [ 16175 "ajaxStart", 16176 "ajaxStop", 16177 "ajaxComplete", 16178 "ajaxError", 16179 "ajaxSuccess", 16180 "ajaxSend" 16181], function( i, type ) { 16182 jQuery.fn[ type ] = function( fn ) { 16183 return this.on( type, fn ); 16184 }; 16185} ); 16186 16187 16188 16189 16190jQuery.expr.pseudos.animated = function( elem ) { 16191 return jQuery.grep( jQuery.timers, function( fn ) { 16192 return elem === fn.elem; 16193 } ).length; 16194}; 16195 16196 16197 16198 16199jQuery.offset = { 16200 setOffset: function( elem, options, i ) { 16201 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 16202 position = jQuery.css( elem, "position" ), 16203 curElem = jQuery( elem ), 16204 props = {}; 16205 16206 // Set position first, in-case top/left are set even on static elem 16207 if ( position === "static" ) { 16208 elem.style.position = "relative"; 16209 } 16210 16211 curOffset = curElem.offset(); 16212 curCSSTop = jQuery.css( elem, "top" ); 16213 curCSSLeft = jQuery.css( elem, "left" ); 16214 calculatePosition = ( position === "absolute" || position === "fixed" ) && 16215 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 16216 16217 // Need to be able to calculate position if either 16218 // top or left is auto and position is either absolute or fixed 16219 if ( calculatePosition ) { 16220 curPosition = curElem.position(); 16221 curTop = curPosition.top; 16222 curLeft = curPosition.left; 16223 16224 } else { 16225 curTop = parseFloat( curCSSTop ) || 0; 16226 curLeft = parseFloat( curCSSLeft ) || 0; 16227 } 16228 16229 if ( isFunction( options ) ) { 16230 16231 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 16232 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 16233 } 16234 16235 if ( options.top != null ) { 16236 props.top = ( options.top - curOffset.top ) + curTop; 16237 } 16238 if ( options.left != null ) { 16239 props.left = ( options.left - curOffset.left ) + curLeft; 16240 } 16241 16242 if ( "using" in options ) { 16243 options.using.call( elem, props ); 16244 16245 } else { 16246 curElem.css( props ); 16247 } 16248 } 16249}; 16250 16251jQuery.fn.extend( { 16252 16253 // offset() relates an element's border box to the document origin 16254 offset: function( options ) { 16255 16256 // Preserve chaining for setter 16257 if ( arguments.length ) { 16258 return options === undefined ? 16259 this : 16260 this.each( function( i ) { 16261 jQuery.offset.setOffset( this, options, i ); 16262 } ); 16263 } 16264 16265 var rect, win, 16266 elem = this[ 0 ]; 16267 16268 if ( !elem ) { 16269 return; 16270 } 16271 16272 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 16273 // Support: IE <=11 only 16274 // Running getBoundingClientRect on a 16275 // disconnected node in IE throws an error 16276 if ( !elem.getClientRects().length ) { 16277 return { top: 0, left: 0 }; 16278 } 16279 16280 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 16281 rect = elem.getBoundingClientRect(); 16282 win = elem.ownerDocument.defaultView; 16283 return { 16284 top: rect.top + win.pageYOffset, 16285 left: rect.left + win.pageXOffset 16286 }; 16287 }, 16288 16289 // position() relates an element's margin box to its offset parent's padding box 16290 // This corresponds to the behavior of CSS absolute positioning 16291 position: function() { 16292 if ( !this[ 0 ] ) { 16293 return; 16294 } 16295 16296 var offsetParent, offset, doc, 16297 elem = this[ 0 ], 16298 parentOffset = { top: 0, left: 0 }; 16299 16300 // position:fixed elements are offset from the viewport, which itself always has zero offset 16301 if ( jQuery.css( elem, "position" ) === "fixed" ) { 16302 16303 // Assume position:fixed implies availability of getBoundingClientRect 16304 offset = elem.getBoundingClientRect(); 16305 16306 } else { 16307 offset = this.offset(); 16308 16309 // Account for the *real* offset parent, which can be the document or its root element 16310 // when a statically positioned element is identified 16311 doc = elem.ownerDocument; 16312 offsetParent = elem.offsetParent || doc.documentElement; 16313 while ( offsetParent && 16314 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 16315 jQuery.css( offsetParent, "position" ) === "static" ) { 16316 16317 offsetParent = offsetParent.parentNode; 16318 } 16319 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 16320 16321 // Incorporate borders into its offset, since they are outside its content origin 16322 parentOffset = jQuery( offsetParent ).offset(); 16323 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 16324 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 16325 } 16326 } 16327 16328 // Subtract parent offsets and element margins 16329 return { 16330 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 16331 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 16332 }; 16333 }, 16334 16335 // This method will return documentElement in the following cases: 16336 // 1) For the element inside the iframe without offsetParent, this method will return 16337 // documentElement of the parent window 16338 // 2) For the hidden or detached element 16339 // 3) For body or html element, i.e. in case of the html node - it will return itself 16340 // 16341 // but those exceptions were never presented as a real life use-cases 16342 // and might be considered as more preferable results. 16343 // 16344 // This logic, however, is not guaranteed and can change at any point in the future 16345 offsetParent: function() { 16346 return this.map( function() { 16347 var offsetParent = this.offsetParent; 16348 16349 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 16350 offsetParent = offsetParent.offsetParent; 16351 } 16352 16353 return offsetParent || documentElement; 16354 } ); 16355 } 16356} ); 16357 16358// Create scrollLeft and scrollTop methods 16359jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 16360 var top = "pageYOffset" === prop; 16361 16362 jQuery.fn[ method ] = function( val ) { 16363 return access( this, function( elem, method, val ) { 16364 16365 // Coalesce documents and windows 16366 var win; 16367 if ( isWindow( elem ) ) { 16368 win = elem; 16369 } else if ( elem.nodeType === 9 ) { 16370 win = elem.defaultView; 16371 } 16372 16373 if ( val === undefined ) { 16374 return win ? win[ prop ] : elem[ method ]; 16375 } 16376 16377 if ( win ) { 16378 win.scrollTo( 16379 !top ? val : win.pageXOffset, 16380 top ? val : win.pageYOffset 16381 ); 16382 16383 } else { 16384 elem[ method ] = val; 16385 } 16386 }, method, val, arguments.length ); 16387 }; 16388} ); 16389 16390// Support: Safari <=7 - 9.1, Chrome <=37 - 49 16391// Add the top/left cssHooks using jQuery.fn.position 16392// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 16393// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 16394// getComputedStyle returns percent when specified for top/left/bottom/right; 16395// rather than make the css module depend on the offset module, just check for it here 16396jQuery.each( [ "top", "left" ], function( i, prop ) { 16397 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 16398 function( elem, computed ) { 16399 if ( computed ) { 16400 computed = curCSS( elem, prop ); 16401 16402 // If curCSS returns percentage, fallback to offset 16403 return rnumnonpx.test( computed ) ? 16404 jQuery( elem ).position()[ prop ] + "px" : 16405 computed; 16406 } 16407 } 16408 ); 16409} ); 16410 16411 16412// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 16413jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 16414 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 16415 function( defaultExtra, funcName ) { 16416 16417 // Margin is only for outerHeight, outerWidth 16418 jQuery.fn[ funcName ] = function( margin, value ) { 16419 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 16420 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 16421 16422 return access( this, function( elem, type, value ) { 16423 var doc; 16424 16425 if ( isWindow( elem ) ) { 16426 16427 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 16428 return funcName.indexOf( "outer" ) === 0 ? 16429 elem[ "inner" + name ] : 16430 elem.document.documentElement[ "client" + name ]; 16431 } 16432 16433 // Get document width or height 16434 if ( elem.nodeType === 9 ) { 16435 doc = elem.documentElement; 16436 16437 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 16438 // whichever is greatest 16439 return Math.max( 16440 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 16441 elem.body[ "offset" + name ], doc[ "offset" + name ], 16442 doc[ "client" + name ] 16443 ); 16444 } 16445 16446 return value === undefined ? 16447 16448 // Get width or height on the element, requesting but not forcing parseFloat 16449 jQuery.css( elem, type, extra ) : 16450 16451 // Set width or height on the element 16452 jQuery.style( elem, type, value, extra ); 16453 }, type, chainable ? margin : undefined, chainable ); 16454 }; 16455 } ); 16456} ); 16457 16458 16459jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 16460 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 16461 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 16462 function( i, name ) { 16463 16464 // Handle event binding 16465 jQuery.fn[ name ] = function( data, fn ) { 16466 return arguments.length > 0 ? 16467 this.on( name, null, data, fn ) : 16468 this.trigger( name ); 16469 }; 16470} ); 16471 16472jQuery.fn.extend( { 16473 hover: function( fnOver, fnOut ) { 16474 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 16475 } 16476} ); 16477 16478 16479 16480 16481jQuery.fn.extend( { 16482 16483 bind: function( types, data, fn ) { 16484 return this.on( types, null, data, fn ); 16485 }, 16486 unbind: function( types, fn ) { 16487 return this.off( types, null, fn ); 16488 }, 16489 16490 delegate: function( selector, types, data, fn ) { 16491 return this.on( types, selector, data, fn ); 16492 }, 16493 undelegate: function( selector, types, fn ) { 16494 16495 // ( namespace ) or ( selector, types [, fn] ) 16496 return arguments.length === 1 ? 16497 this.off( selector, "**" ) : 16498 this.off( types, selector || "**", fn ); 16499 } 16500} ); 16501 16502// Bind a function to a context, optionally partially applying any 16503// arguments. 16504// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 16505// However, it is not slated for removal any time soon 16506jQuery.proxy = function( fn, context ) { 16507 var tmp, args, proxy; 16508 16509 if ( typeof context === "string" ) { 16510 tmp = fn[ context ]; 16511 context = fn; 16512 fn = tmp; 16513 } 16514 16515 // Quick check to determine if target is callable, in the spec 16516 // this throws a TypeError, but we will just return undefined. 16517 if ( !isFunction( fn ) ) { 16518 return undefined; 16519 } 16520 16521 // Simulated bind 16522 args = slice.call( arguments, 2 ); 16523 proxy = function() { 16524 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 16525 }; 16526 16527 // Set the guid of unique handler to the same of original handler, so it can be removed 16528 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 16529 16530 return proxy; 16531}; 16532 16533jQuery.holdReady = function( hold ) { 16534 if ( hold ) { 16535 jQuery.readyWait++; 16536 } else { 16537 jQuery.ready( true ); 16538 } 16539}; 16540jQuery.isArray = Array.isArray; 16541jQuery.parseJSON = JSON.parse; 16542jQuery.nodeName = nodeName; 16543jQuery.isFunction = isFunction; 16544jQuery.isWindow = isWindow; 16545jQuery.camelCase = camelCase; 16546jQuery.type = toType; 16547 16548jQuery.now = Date.now; 16549 16550jQuery.isNumeric = function( obj ) { 16551 16552 // As of jQuery 3.0, isNumeric is limited to 16553 // strings and numbers (primitives or objects) 16554 // that can be coerced to finite numbers (gh-2662) 16555 var type = jQuery.type( obj ); 16556 return ( type === "number" || type === "string" ) && 16557 16558 // parseFloat NaNs numeric-cast false positives ("") 16559 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 16560 // subtraction forces infinities to NaN 16561 !isNaN( obj - parseFloat( obj ) ); 16562}; 16563 16564 16565 16566 16567// Register as a named AMD module, since jQuery can be concatenated with other 16568// files that may use define, but not via a proper concatenation script that 16569// understands anonymous AMD modules. A named AMD is safest and most robust 16570// way to register. Lowercase jquery is used because AMD module names are 16571// derived from file names, and jQuery is normally delivered in a lowercase 16572// file name. Do this after creating the global so that if an AMD module wants 16573// to call noConflict to hide this version of jQuery, it will work. 16574 16575// Note that for maximum portability, libraries that are not jQuery should 16576// declare themselves as anonymous modules, and avoid setting a global if an 16577// AMD loader is present. jQuery is a special case. For more information, see 16578// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 16579 16580if ( true ) { 16581 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 16582 return jQuery; 16583 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 16584 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 16585} 16586 16587 16588 16589 16590var 16591 16592 // Map over jQuery in case of overwrite 16593 _jQuery = window.jQuery, 16594 16595 // Map over the $ in case of overwrite 16596 _$ = window.$; 16597 16598jQuery.noConflict = function( deep ) { 16599 if ( window.$ === jQuery ) { 16600 window.$ = _$; 16601 } 16602 16603 if ( deep && window.jQuery === jQuery ) { 16604 window.jQuery = _jQuery; 16605 } 16606 16607 return jQuery; 16608}; 16609 16610// Expose jQuery and $ identifiers, even in AMD 16611// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 16612// and CommonJS for browser emulators (#13566) 16613if ( !noGlobal ) { 16614 window.jQuery = window.$ = jQuery; 16615} 16616 16617 16618 16619 16620return jQuery; 16621} ); 16622 16623 16624/***/ }), 16625
16626/***/ "./assets/src/sass/app.scss": 16627/*!**********************************!*\ 16628 !*** ./assets/src/sass/app.scss ***! 16629 \**********************************/ 16630/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 16631 16632"use strict"; 16633__webpack_require__.r(__webpack_exports__); 16634// extracted by mini-css-extract-plugin 16635 16636 16637/***/ }), 16638
vendor: 89,080 bytes, lines 16639-19268
16639/***/ "./node_modules/popper.js/dist/esm/popper.js": 16640/*!***************************************************!*\ 16641 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 16642 \***************************************************/ 16643/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 16644 16645"use strict"; 16646__webpack_require__.r(__webpack_exports__); 16647/* harmony export */ __webpack_require__.d(__webpack_exports__, { 16648/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 16649/* harmony export */ }); 16650/**! 16651 * @fileOverview Kickass library to create and place poppers near their reference elements. 16652 * @version 1.16.1 16653 * @license 16654 * Copyright (c) 2016 Federico Zivolo and contributors 16655 * 16656 * Permission is hereby granted, free of charge, to any person obtaining a copy 16657 * of this software and associated documentation files (the "Software"), to deal 16658 * in the Software without restriction, including without limitation the rights 16659 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16660 * copies of the Software, and to permit persons to whom the Software is 16661 * furnished to do so, subject to the following conditions: 16662 * 16663 * The above copyright notice and this permission notice shall be included in all 16664 * copies or substantial portions of the Software. 16665 * 16666 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16667 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16668 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16669 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16670 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16671 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 16672 * SOFTWARE. 16673 */ 16674var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 16675 16676var timeoutDuration = function () { 16677 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 16678 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 16679 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 16680 return 1; 16681 } 16682 } 16683 return 0; 16684}(); 16685 16686function microtaskDebounce(fn) { 16687 var called = false; 16688 return function () { 16689 if (called) { 16690 return; 16691 } 16692 called = true; 16693 window.Promise.resolve().then(function () { 16694 called = false; 16695 fn(); 16696 }); 16697 }; 16698} 16699 16700function taskDebounce(fn) { 16701 var scheduled = false; 16702 return function () { 16703 if (!scheduled) { 16704 scheduled = true; 16705 setTimeout(function () { 16706 scheduled = false; 16707 fn(); 16708 }, timeoutDuration); 16709 } 16710 }; 16711} 16712 16713var supportsMicroTasks = isBrowser && window.Promise; 16714 16715/** 16716* Create a debounced version of a method, that's asynchronously deferred 16717* but called in the minimum time possible. 16718* 16719* @method 16720* @memberof Popper.Utils 16721* @argument {Function} fn 16722* @returns {Function} 16723*/ 16724var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 16725 16726/** 16727 * Check if the given variable is a function 16728 * @method 16729 * @memberof Popper.Utils 16730 * @argument {Any} functionToCheck - variable to check 16731 * @returns {Boolean} answer to: is a function? 16732 */ 16733function isFunction(functionToCheck) { 16734 var getType = {}; 16735 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 16736} 16737 16738/** 16739 * Get CSS computed property of the given element 16740 * @method 16741 * @memberof Popper.Utils 16742 * @argument {Eement} element 16743 * @argument {String} property 16744 */ 16745function getStyleComputedProperty(element, property) { 16746 if (element.nodeType !== 1) { 16747 return []; 16748 } 16749 // NOTE: 1 DOM access here 16750 var window = element.ownerDocument.defaultView; 16751 var css = window.getComputedStyle(element, null); 16752 return property ? css[property] : css; 16753} 16754 16755/** 16756 * Returns the parentNode or the host of the element 16757 * @method 16758 * @memberof Popper.Utils 16759 * @argument {Element} element 16760 * @returns {Element} parent 16761 */ 16762function getParentNode(element) { 16763 if (element.nodeName === 'HTML') { 16764 return element; 16765 } 16766 return element.parentNode || element.host; 16767} 16768 16769/** 16770 * Returns the scrolling parent of the given element 16771 * @method 16772 * @memberof Popper.Utils 16773 * @argument {Element} element 16774 * @returns {Element} scroll parent 16775 */ 16776function getScrollParent(element) { 16777 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 16778 if (!element) { 16779 return document.body; 16780 } 16781 16782 switch (element.nodeName) { 16783 case 'HTML': 16784 case 'BODY': 16785 return element.ownerDocument.body; 16786 case '#document': 16787 return element.body; 16788 } 16789 16790 // Firefox want us to check `-x` and `-y` variations as well 16791 16792 var _getStyleComputedProp = getStyleComputedProperty(element), 16793 overflow = _getStyleComputedProp.overflow, 16794 overflowX = _getStyleComputedProp.overflowX, 16795 overflowY = _getStyleComputedProp.overflowY; 16796 16797 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 16798 return element; 16799 } 16800 16801 return getScrollParent(getParentNode(element)); 16802} 16803 16804/** 16805 * Returns the reference node of the reference object, or the reference object itself. 16806 * @method 16807 * @memberof Popper.Utils 16808 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 16809 * @returns {Element} parent 16810 */ 16811function getReferenceNode(reference) { 16812 return reference && reference.referenceNode ? reference.referenceNode : reference; 16813} 16814 16815var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 16816var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 16817 16818/** 16819 * Determines if the browser is Internet Explorer 16820 * @method 16821 * @memberof Popper.Utils 16822 * @param {Number} version to check 16823 * @returns {Boolean} isIE 16824 */ 16825function isIE(version) { 16826 if (version === 11) { 16827 return isIE11; 16828 } 16829 if (version === 10) { 16830 return isIE10; 16831 } 16832 return isIE11 || isIE10; 16833} 16834 16835/** 16836 * Returns the offset parent of the given element 16837 * @method 16838 * @memberof Popper.Utils 16839 * @argument {Element} element 16840 * @returns {Element} offset parent 16841 */ 16842function getOffsetParent(element) { 16843 if (!element) { 16844 return document.documentElement; 16845 } 16846 16847 var noOffsetParent = isIE(10) ? document.body : null; 16848 16849 // NOTE: 1 DOM access here 16850 var offsetParent = element.offsetParent || null; 16851 // Skip hidden elements which don't have an offsetParent 16852 while (offsetParent === noOffsetParent && element.nextElementSibling) { 16853 offsetParent = (element = element.nextElementSibling).offsetParent; 16854 } 16855 16856 var nodeName = offsetParent && offsetParent.nodeName; 16857 16858 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 16859 return element ? element.ownerDocument.documentElement : document.documentElement; 16860 } 16861 16862 // .offsetParent will return the closest TH, TD or TABLE in case 16863 // no offsetParent is present, I hate this job... 16864 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 16865 return getOffsetParent(offsetParent); 16866 } 16867 16868 return offsetParent; 16869} 16870 16871function isOffsetContainer(element) { 16872 var nodeName = element.nodeName; 16873 16874 if (nodeName === 'BODY') { 16875 return false; 16876 } 16877 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 16878} 16879 16880/** 16881 * Finds the root node (document, shadowDOM root) of the given element 16882 * @method 16883 * @memberof Popper.Utils 16884 * @argument {Element} node 16885 * @returns {Element} root node 16886 */ 16887function getRoot(node) { 16888 if (node.parentNode !== null) { 16889 return getRoot(node.parentNode); 16890 } 16891 16892 return node; 16893} 16894 16895/** 16896 * Finds the offset parent common to the two provided nodes 16897 * @method 16898 * @memberof Popper.Utils 16899 * @argument {Element} element1 16900 * @argument {Element} element2 16901 * @returns {Element} common offset parent 16902 */ 16903function findCommonOffsetParent(element1, element2) { 16904 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16905 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 16906 return document.documentElement; 16907 } 16908 16909 // Here we make sure to give as "start" the element that comes first in the DOM 16910 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 16911 var start = order ? element1 : element2; 16912 var end = order ? element2 : element1; 16913 16914 // Get common ancestor container 16915 var range = document.createRange(); 16916 range.setStart(start, 0); 16917 range.setEnd(end, 0); 16918 var commonAncestorContainer = range.commonAncestorContainer; 16919 16920 // Both nodes are inside #document 16921 16922 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 16923 if (isOffsetContainer(commonAncestorContainer)) { 16924 return commonAncestorContainer; 16925 } 16926 16927 return getOffsetParent(commonAncestorContainer); 16928 } 16929 16930 // one of the nodes is inside shadowDOM, find which one 16931 var element1root = getRoot(element1); 16932 if (element1root.host) { 16933 return findCommonOffsetParent(element1root.host, element2); 16934 } else { 16935 return findCommonOffsetParent(element1, getRoot(element2).host); 16936 } 16937} 16938 16939/** 16940 * Gets the scroll value of the given element in the given side (top and left) 16941 * @method 16942 * @memberof Popper.Utils 16943 * @argument {Element} element 16944 * @argument {String} side `top` or `left` 16945 * @returns {number} amount of scrolled pixels 16946 */ 16947function getScroll(element) { 16948 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 16949 16950 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 16951 var nodeName = element.nodeName; 16952 16953 if (nodeName === 'BODY' || nodeName === 'HTML') { 16954 var html = element.ownerDocument.documentElement; 16955 var scrollingElement = element.ownerDocument.scrollingElement || html; 16956 return scrollingElement[upperSide]; 16957 } 16958 16959 return element[upperSide]; 16960} 16961 16962/* 16963 * Sum or subtract the element scroll values (left and top) from a given rect object 16964 * @method 16965 * @memberof Popper.Utils 16966 * @param {Object} rect - Rect object you want to change 16967 * @param {HTMLElement} element - The element from the function reads the scroll values 16968 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 16969 * @return {Object} rect - The modifier rect object 16970 */ 16971function includeScroll(rect, element) { 16972 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16973 16974 var scrollTop = getScroll(element, 'top'); 16975 var scrollLeft = getScroll(element, 'left'); 16976 var modifier = subtract ? -1 : 1; 16977 rect.top += scrollTop * modifier; 16978 rect.bottom += scrollTop * modifier; 16979 rect.left += scrollLeft * modifier; 16980 rect.right += scrollLeft * modifier; 16981 return rect; 16982} 16983 16984/* 16985 * Helper to detect borders of a given element 16986 * @method 16987 * @memberof Popper.Utils 16988 * @param {CSSStyleDeclaration} styles 16989 * Result of `getStyleComputedProperty` on the given element 16990 * @param {String} axis - `x` or `y` 16991 * @return {number} borders - The borders size of the given axis 16992 */ 16993 16994function getBordersSize(styles, axis) { 16995 var sideA = axis === 'x' ? 'Left' : 'Top'; 16996 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 16997 16998 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 16999} 17000 17001function getSize(axis, body, html, computedStyle) { 17002 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 17003} 17004 17005function getWindowSizes(document) { 17006 var body = document.body; 17007 var html = document.documentElement; 17008 var computedStyle = isIE(10) && getComputedStyle(html); 17009 17010 return { 17011 height: getSize('Height', body, html, computedStyle), 17012 width: getSize('Width', body, html, computedStyle) 17013 }; 17014} 17015 17016var classCallCheck = function (instance, Constructor) { 17017 if (!(instance instanceof Constructor)) { 17018 throw new TypeError("Cannot call a class as a function"); 17019 } 17020}; 17021 17022var createClass = function () { 17023 function defineProperties(target, props) { 17024 for (var i = 0; i < props.length; i++) { 17025 var descriptor = props[i]; 17026 descriptor.enumerable = descriptor.enumerable || false; 17027 descriptor.configurable = true; 17028 if ("value" in descriptor) descriptor.writable = true; 17029 Object.defineProperty(target, descriptor.key, descriptor); 17030 } 17031 } 17032 17033 return function (Constructor, protoProps, staticProps) { 17034 if (protoProps) defineProperties(Constructor.prototype, protoProps); 17035 if (staticProps) defineProperties(Constructor, staticProps); 17036 return Constructor; 17037 }; 17038}(); 17039 17040 17041 17042 17043 17044var defineProperty = function (obj, key, value) { 17045 if (key in obj) { 17046 Object.defineProperty(obj, key, { 17047 value: value, 17048 enumerable: true, 17049 configurable: true, 17050 writable: true 17051 }); 17052 } else { 17053 obj[key] = value; 17054 } 17055 17056 return obj; 17057}; 17058 17059var _extends = Object.assign || function (target) { 17060 for (var i = 1; i < arguments.length; i++) { 17061 var source = arguments[i]; 17062 17063 for (var key in source) { 17064 if (Object.prototype.hasOwnProperty.call(source, key)) { 17065 target[key] = source[key]; 17066 } 17067 } 17068 } 17069 17070 return target; 17071}; 17072 17073/** 17074 * Given element offsets, generate an output similar to getBoundingClientRect 17075 * @method 17076 * @memberof Popper.Utils 17077 * @argument {Object} offsets 17078 * @returns {Object} ClientRect like output 17079 */ 17080function getClientRect(offsets) { 17081 return _extends({}, offsets, { 17082 right: offsets.left + offsets.width, 17083 bottom: offsets.top + offsets.height 17084 }); 17085} 17086 17087/** 17088 * Get bounding client rect of given element 17089 * @method 17090 * @memberof Popper.Utils 17091 * @param {HTMLElement} element 17092 * @return {Object} client rect 17093 */ 17094function getBoundingClientRect(element) { 17095 var rect = {}; 17096 17097 // IE10 10 FIX: Please, don't ask, the element isn't 17098 // considered in DOM in some circumstances... 17099 // This isn't reproducible in IE10 compatibility mode of IE11 17100 try { 17101 if (isIE(10)) { 17102 rect = element.getBoundingClientRect(); 17103 var scrollTop = getScroll(element, 'top'); 17104 var scrollLeft = getScroll(element, 'left'); 17105 rect.top += scrollTop; 17106 rect.left += scrollLeft; 17107 rect.bottom += scrollTop; 17108 rect.right += scrollLeft; 17109 } else { 17110 rect = element.getBoundingClientRect(); 17111 } 17112 } catch (e) {} 17113 17114 var result = { 17115 left: rect.left, 17116 top: rect.top, 17117 width: rect.right - rect.left, 17118 height: rect.bottom - rect.top 17119 }; 17120 17121 // subtract scrollbar size from sizes 17122 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 17123 var width = sizes.width || element.clientWidth || result.width; 17124 var height = sizes.height || element.clientHeight || result.height; 17125 17126 var horizScrollbar = element.offsetWidth - width; 17127 var vertScrollbar = element.offsetHeight - height; 17128 17129 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 17130 // we make this check conditional for performance reasons 17131 if (horizScrollbar || vertScrollbar) { 17132 var styles = getStyleComputedProperty(element); 17133 horizScrollbar -= getBordersSize(styles, 'x'); 17134 vertScrollbar -= getBordersSize(styles, 'y'); 17135 17136 result.width -= horizScrollbar; 17137 result.height -= vertScrollbar; 17138 } 17139 17140 return getClientRect(result); 17141} 17142 17143function getOffsetRectRelativeToArbitraryNode(children, parent) { 17144 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 17145 17146 var isIE10 = isIE(10); 17147 var isHTML = parent.nodeName === 'HTML'; 17148 var childrenRect = getBoundingClientRect(children); 17149 var parentRect = getBoundingClientRect(parent); 17150 var scrollParent = getScrollParent(children); 17151 17152 var styles = getStyleComputedProperty(parent); 17153 var borderTopWidth = parseFloat(styles.borderTopWidth); 17154 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 17155 17156 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 17157 if (fixedPosition && isHTML) { 17158 parentRect.top = Math.max(parentRect.top, 0); 17159 parentRect.left = Math.max(parentRect.left, 0); 17160 } 17161 var offsets = getClientRect({ 17162 top: childrenRect.top - parentRect.top - borderTopWidth, 17163 left: childrenRect.left - parentRect.left - borderLeftWidth, 17164 width: childrenRect.width, 17165 height: childrenRect.height 17166 }); 17167 offsets.marginTop = 0; 17168 offsets.marginLeft = 0; 17169 17170 // Subtract margins of documentElement in case it's being used as parent 17171 // we do this only on HTML because it's the only element that behaves 17172 // differently when margins are applied to it. The margins are included in 17173 // the box of the documentElement, in the other cases not. 17174 if (!isIE10 && isHTML) { 17175 var marginTop = parseFloat(styles.marginTop); 17176 var marginLeft = parseFloat(styles.marginLeft); 17177 17178 offsets.top -= borderTopWidth - marginTop; 17179 offsets.bottom -= borderTopWidth - marginTop; 17180 offsets.left -= borderLeftWidth - marginLeft; 17181 offsets.right -= borderLeftWidth - marginLeft; 17182 17183 // Attach marginTop and marginLeft because in some circumstances we may need them 17184 offsets.marginTop = marginTop; 17185 offsets.marginLeft = marginLeft; 17186 } 17187 17188 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 17189 offsets = includeScroll(offsets, parent); 17190 } 17191 17192 return offsets; 17193} 17194 17195function getViewportOffsetRectRelativeToArtbitraryNode(element) { 17196 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17197 17198 var html = element.ownerDocument.documentElement; 17199 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 17200 var width = Math.max(html.clientWidth, window.innerWidth || 0); 17201 var height = Math.max(html.clientHeight, window.innerHeight || 0); 17202 17203 var scrollTop = !excludeScroll ? getScroll(html) : 0; 17204 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 17205 17206 var offset = { 17207 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 17208 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 17209 width: width, 17210 height: height 17211 }; 17212 17213 return getClientRect(offset); 17214} 17215 17216/** 17217 * Check if the given element is fixed or is inside a fixed parent 17218 * @method 17219 * @memberof Popper.Utils 17220 * @argument {Element} element 17221 * @argument {Element} customContainer 17222 * @returns {Boolean} answer to "isFixed?" 17223 */ 17224function isFixed(element) { 17225 var nodeName = element.nodeName; 17226 if (nodeName === 'BODY' || nodeName === 'HTML') { 17227 return false; 17228 } 17229 if (getStyleComputedProperty(element, 'position') === 'fixed') { 17230 return true; 17231 } 17232 var parentNode = getParentNode(element); 17233 if (!parentNode) { 17234 return false; 17235 } 17236 return isFixed(parentNode); 17237} 17238 17239/** 17240 * Finds the first parent of an element that has a transformed property defined 17241 * @method 17242 * @memberof Popper.Utils 17243 * @argument {Element} element 17244 * @returns {Element} first transformed parent or documentElement 17245 */ 17246 17247function getFixedPositionOffsetParent(element) { 17248 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 17249 if (!element || !element.parentElement || isIE()) { 17250 return document.documentElement; 17251 } 17252 var el = element.parentElement; 17253 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 17254 el = el.parentElement; 17255 } 17256 return el || document.documentElement; 17257} 17258 17259/** 17260 * Computed the boundaries limits and return them 17261 * @method 17262 * @memberof Popper.Utils 17263 * @param {HTMLElement} popper 17264 * @param {HTMLElement} reference 17265 * @param {number} padding 17266 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 17267 * @param {Boolean} fixedPosition - Is in fixed position mode 17268 * @returns {Object} Coordinates of the boundaries 17269 */ 17270function getBoundaries(popper, reference, padding, boundariesElement) { 17271 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 17272 17273 // NOTE: 1 DOM access here 17274 17275 var boundaries = { top: 0, left: 0 }; 17276 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 17277 17278 // Handle viewport case 17279 if (boundariesElement === 'viewport') { 17280 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 17281 } else { 17282 // Handle other cases based on DOM element used as boundaries 17283 var boundariesNode = void 0; 17284 if (boundariesElement === 'scrollParent') { 17285 boundariesNode = getScrollParent(getParentNode(reference)); 17286 if (boundariesNode.nodeName === 'BODY') { 17287 boundariesNode = popper.ownerDocument.documentElement; 17288 } 17289 } else if (boundariesElement === 'window') { 17290 boundariesNode = popper.ownerDocument.documentElement; 17291 } else { 17292 boundariesNode = boundariesElement; 17293 } 17294 17295 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 17296 17297 // In case of HTML, we need a different computation 17298 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 17299 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 17300 height = _getWindowSizes.height, 17301 width = _getWindowSizes.width; 17302 17303 boundaries.top += offsets.top - offsets.marginTop; 17304 boundaries.bottom = height + offsets.top; 17305 boundaries.left += offsets.left - offsets.marginLeft; 17306 boundaries.right = width + offsets.left; 17307 } else { 17308 // for all the other DOM elements, this one is good 17309 boundaries = offsets; 17310 } 17311 } 17312 17313 // Add paddings 17314 padding = padding || 0; 17315 var isPaddingNumber = typeof padding === 'number'; 17316 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 17317 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 17318 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 17319 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 17320 17321 return boundaries; 17322} 17323 17324function getArea(_ref) { 17325 var width = _ref.width, 17326 height = _ref.height; 17327 17328 return width * height; 17329} 17330 17331/** 17332 * Utility used to transform the `auto` placement to the placement with more 17333 * available space. 17334 * @method 17335 * @memberof Popper.Utils 17336 * @argument {Object} data - The data object generated by update method 17337 * @argument {Object} options - Modifiers configuration and options 17338 * @returns {Object} The data object, properly modified 17339 */ 17340function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 17341 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 17342 17343 if (placement.indexOf('auto') === -1) { 17344 return placement; 17345 } 17346 17347 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 17348 17349 var rects = { 17350 top: { 17351 width: boundaries.width, 17352 height: refRect.top - boundaries.top 17353 }, 17354 right: { 17355 width: boundaries.right - refRect.right, 17356 height: boundaries.height 17357 }, 17358 bottom: { 17359 width: boundaries.width, 17360 height: boundaries.bottom - refRect.bottom 17361 }, 17362 left: { 17363 width: refRect.left - boundaries.left, 17364 height: boundaries.height 17365 } 17366 }; 17367 17368 var sortedAreas = Object.keys(rects).map(function (key) { 17369 return _extends({ 17370 key: key 17371 }, rects[key], { 17372 area: getArea(rects[key]) 17373 }); 17374 }).sort(function (a, b) { 17375 return b.area - a.area; 17376 }); 17377 17378 var filteredAreas = sortedAreas.filter(function (_ref2) { 17379 var width = _ref2.width, 17380 height = _ref2.height; 17381 return width >= popper.clientWidth && height >= popper.clientHeight; 17382 }); 17383 17384 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 17385 17386 var variation = placement.split('-')[1]; 17387 17388 return computedPlacement + (variation ? '-' + variation : ''); 17389} 17390 17391/** 17392 * Get offsets to the reference element 17393 * @method 17394 * @memberof Popper.Utils 17395 * @param {Object} state 17396 * @param {Element} popper - the popper element 17397 * @param {Element} reference - the reference element (the popper will be relative to this) 17398 * @param {Element} fixedPosition - is in fixed position mode 17399 * @returns {Object} An object containing the offsets which will be applied to the popper 17400 */ 17401function getReferenceOffsets(state, popper, reference) { 17402 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 17403 17404 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 17405 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 17406} 17407 17408/** 17409 * Get the outer sizes of the given element (offset size + margins) 17410 * @method 17411 * @memberof Popper.Utils 17412 * @argument {Element} element 17413 * @returns {Object} object containing width and height properties 17414 */ 17415function getOuterSizes(element) { 17416 var window = element.ownerDocument.defaultView; 17417 var styles = window.getComputedStyle(element); 17418 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 17419 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 17420 var result = { 17421 width: element.offsetWidth + y, 17422 height: element.offsetHeight + x 17423 }; 17424 return result; 17425} 17426 17427/** 17428 * Get the opposite placement of the given one 17429 * @method 17430 * @memberof Popper.Utils 17431 * @argument {String} placement 17432 * @returns {String} flipped placement 17433 */ 17434function getOppositePlacement(placement) { 17435 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 17436 return placement.replace(/left|right|bottom|top/g, function (matched) { 17437 return hash[matched]; 17438 }); 17439} 17440 17441/** 17442 * Get offsets to the popper 17443 * @method 17444 * @memberof Popper.Utils 17445 * @param {Object} position - CSS position the Popper will get applied 17446 * @param {HTMLElement} popper - the popper element 17447 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 17448 * @param {String} placement - one of the valid placement options 17449 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 17450 */ 17451function getPopperOffsets(popper, referenceOffsets, placement) { 17452 placement = placement.split('-')[0]; 17453 17454 // Get popper node sizes 17455 var popperRect = getOuterSizes(popper); 17456 17457 // Add position, width and height to our offsets object 17458 var popperOffsets = { 17459 width: popperRect.width, 17460 height: popperRect.height 17461 }; 17462 17463 // depending by the popper placement we have to compute its offsets slightly differently 17464 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 17465 var mainSide = isHoriz ? 'top' : 'left'; 17466 var secondarySide = isHoriz ? 'left' : 'top'; 17467 var measurement = isHoriz ? 'height' : 'width'; 17468 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 17469 17470 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 17471 if (placement === secondarySide) { 17472 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 17473 } else { 17474 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 17475 } 17476 17477 return popperOffsets; 17478} 17479 17480/** 17481 * Mimics the `find` method of Array 17482 * @method 17483 * @memberof Popper.Utils 17484 * @argument {Array} arr 17485 * @argument prop 17486 * @argument value 17487 * @returns index or -1 17488 */ 17489function find(arr, check) { 17490 // use native find if supported 17491 if (Array.prototype.find) { 17492 return arr.find(check); 17493 } 17494 17495 // use `filter` to obtain the same behavior of `find` 17496 return arr.filter(check)[0]; 17497} 17498 17499/** 17500 * Return the index of the matching object 17501 * @method 17502 * @memberof Popper.Utils 17503 * @argument {Array} arr 17504 * @argument prop 17505 * @argument value 17506 * @returns index or -1 17507 */ 17508function findIndex(arr, prop, value) { 17509 // use native findIndex if supported 17510 if (Array.prototype.findIndex) { 17511 return arr.findIndex(function (cur) { 17512 return cur[prop] === value; 17513 }); 17514 } 17515 17516 // use `find` + `indexOf` if `findIndex` isn't supported 17517 var match = find(arr, function (obj) { 17518 return obj[prop] === value; 17519 }); 17520 return arr.indexOf(match); 17521} 17522 17523/** 17524 * Loop trough the list of modifiers and run them in order, 17525 * each of them will then edit the data object. 17526 * @method 17527 * @memberof Popper.Utils 17528 * @param {dataObject} data 17529 * @param {Array} modifiers 17530 * @param {String} ends - Optional modifier name used as stopper 17531 * @returns {dataObject} 17532 */ 17533function runModifiers(modifiers, data, ends) { 17534 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 17535 17536 modifiersToRun.forEach(function (modifier) { 17537 if (modifier['function']) { 17538 // eslint-disable-line dot-notation 17539 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 17540 } 17541 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 17542 if (modifier.enabled && isFunction(fn)) { 17543 // Add properties to offsets to make them a complete clientRect object 17544 // we do this before each modifier to make sure the previous one doesn't 17545 // mess with these values 17546 data.offsets.popper = getClientRect(data.offsets.popper); 17547 data.offsets.reference = getClientRect(data.offsets.reference); 17548 17549 data = fn(data, modifier); 17550 } 17551 }); 17552 17553 return data; 17554} 17555 17556/** 17557 * Updates the position of the popper, computing the new offsets and applying 17558 * the new style.<br /> 17559 * Prefer `scheduleUpdate` over `update` because of performance reasons. 17560 * @method 17561 * @memberof Popper 17562 */ 17563function update() { 17564 // if popper is destroyed, don't perform any further update 17565 if (this.state.isDestroyed) { 17566 return; 17567 } 17568 17569 var data = { 17570 instance: this, 17571 styles: {}, 17572 arrowStyles: {}, 17573 attributes: {}, 17574 flipped: false, 17575 offsets: {} 17576 }; 17577 17578 // compute reference element offsets 17579 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 17580 17581 // compute auto placement, store placement inside the data object, 17582 // modifiers will be able to edit `placement` if needed 17583 // and refer to originalPlacement to know the original value 17584 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 17585 17586 // store the computed placement inside `originalPlacement` 17587 data.originalPlacement = data.placement; 17588 17589 data.positionFixed = this.options.positionFixed; 17590 17591 // compute the popper offsets 17592 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 17593 17594 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 17595 17596 // run the modifiers 17597 data = runModifiers(this.modifiers, data); 17598 17599 // the first `update` will call `onCreate` callback 17600 // the other ones will call `onUpdate` callback 17601 if (!this.state.isCreated) { 17602 this.state.isCreated = true; 17603 this.options.onCreate(data); 17604 } else { 17605 this.options.onUpdate(data); 17606 } 17607} 17608 17609/** 17610 * Helper used to know if the given modifier is enabled. 17611 * @method 17612 * @memberof Popper.Utils 17613 * @returns {Boolean} 17614 */ 17615function isModifierEnabled(modifiers, modifierName) { 17616 return modifiers.some(function (_ref) { 17617 var name = _ref.name, 17618 enabled = _ref.enabled; 17619 return enabled && name === modifierName; 17620 }); 17621} 17622 17623/** 17624 * Get the prefixed supported property name 17625 * @method 17626 * @memberof Popper.Utils 17627 * @argument {String} property (camelCase) 17628 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 17629 */ 17630function getSupportedPropertyName(property) { 17631 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 17632 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 17633 17634 for (var i = 0; i < prefixes.length; i++) { 17635 var prefix = prefixes[i]; 17636 var toCheck = prefix ? '' + prefix + upperProp : property; 17637 if (typeof document.body.style[toCheck] !== 'undefined') { 17638 return toCheck; 17639 } 17640 } 17641 return null; 17642} 17643 17644/** 17645 * Destroys the popper. 17646 * @method 17647 * @memberof Popper 17648 */ 17649function destroy() { 17650 this.state.isDestroyed = true; 17651 17652 // touch DOM only if `applyStyle` modifier is enabled 17653 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 17654 this.popper.removeAttribute('x-placement'); 17655 this.popper.style.position = ''; 17656 this.popper.style.top = ''; 17657 this.popper.style.left = ''; 17658 this.popper.style.right = ''; 17659 this.popper.style.bottom = ''; 17660 this.popper.style.willChange = ''; 17661 this.popper.style[getSupportedPropertyName('transform')] = ''; 17662 } 17663 17664 this.disableEventListeners(); 17665 17666 // remove the popper if user explicitly asked for the deletion on destroy 17667 // do not use `remove` because IE11 doesn't support it 17668 if (this.options.removeOnDestroy) { 17669 this.popper.parentNode.removeChild(this.popper); 17670 } 17671 return this; 17672} 17673 17674/** 17675 * Get the window associated with the element 17676 * @argument {Element} element 17677 * @returns {Window} 17678 */ 17679function getWindow(element) { 17680 var ownerDocument = element.ownerDocument; 17681 return ownerDocument ? ownerDocument.defaultView : window; 17682} 17683 17684function attachToScrollParents(scrollParent, event, callback, scrollParents) { 17685 var isBody = scrollParent.nodeName === 'BODY'; 17686 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 17687 target.addEventListener(event, callback, { passive: true }); 17688 17689 if (!isBody) { 17690 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 17691 } 17692 scrollParents.push(target); 17693} 17694 17695/** 17696 * Setup needed event listeners used to update the popper position 17697 * @method 17698 * @memberof Popper.Utils 17699 * @private 17700 */ 17701function setupEventListeners(reference, options, state, updateBound) { 17702 // Resize event listener on window 17703 state.updateBound = updateBound; 17704 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 17705 17706 // Scroll event listener on scroll parents 17707 var scrollElement = getScrollParent(reference); 17708 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 17709 state.scrollElement = scrollElement; 17710 state.eventsEnabled = true; 17711 17712 return state; 17713} 17714 17715/** 17716 * It will add resize/scroll events and start recalculating 17717 * position of the popper element when they are triggered. 17718 * @method 17719 * @memberof Popper 17720 */ 17721function enableEventListeners() { 17722 if (!this.state.eventsEnabled) { 17723 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 17724 } 17725} 17726 17727/** 17728 * Remove event listeners used to update the popper position 17729 * @method 17730 * @memberof Popper.Utils 17731 * @private 17732 */ 17733function removeEventListeners(reference, state) { 17734 // Remove resize event listener on window 17735 getWindow(reference).removeEventListener('resize', state.updateBound); 17736 17737 // Remove scroll event listener on scroll parents 17738 state.scrollParents.forEach(function (target) { 17739 target.removeEventListener('scroll', state.updateBound); 17740 }); 17741 17742 // Reset state 17743 state.updateBound = null; 17744 state.scrollParents = []; 17745 state.scrollElement = null; 17746 state.eventsEnabled = false; 17747 return state; 17748} 17749 17750/** 17751 * It will remove resize/scroll events and won't recalculate popper position 17752 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 17753 * unless you call `update` method manually. 17754 * @method 17755 * @memberof Popper 17756 */ 17757function disableEventListeners() { 17758 if (this.state.eventsEnabled) { 17759 cancelAnimationFrame(this.scheduleUpdate); 17760 this.state = removeEventListeners(this.reference, this.state); 17761 } 17762} 17763 17764/** 17765 * Tells if a given input is a number 17766 * @method 17767 * @memberof Popper.Utils 17768 * @param {*} input to check 17769 * @return {Boolean} 17770 */ 17771function isNumeric(n) { 17772 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 17773} 17774 17775/** 17776 * Set the style to the given popper 17777 * @method 17778 * @memberof Popper.Utils 17779 * @argument {Element} element - Element to apply the style to 17780 * @argument {Object} styles 17781 * Object with a list of properties and values which will be applied to the element 17782 */ 17783function setStyles(element, styles) { 17784 Object.keys(styles).forEach(function (prop) { 17785 var unit = ''; 17786 // add unit if the value is numeric and is one of the following 17787 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 17788 unit = 'px'; 17789 } 17790 element.style[prop] = styles[prop] + unit; 17791 }); 17792} 17793 17794/** 17795 * Set the attributes to the given popper 17796 * @method 17797 * @memberof Popper.Utils 17798 * @argument {Element} element - Element to apply the attributes to 17799 * @argument {Object} styles 17800 * Object with a list of properties and values which will be applied to the element 17801 */ 17802function setAttributes(element, attributes) { 17803 Object.keys(attributes).forEach(function (prop) { 17804 var value = attributes[prop]; 17805 if (value !== false) { 17806 element.setAttribute(prop, attributes[prop]); 17807 } else { 17808 element.removeAttribute(prop); 17809 } 17810 }); 17811} 17812 17813/** 17814 * @function 17815 * @memberof Modifiers 17816 * @argument {Object} data - The data object generated by `update` method 17817 * @argument {Object} data.styles - List of style properties - values to apply to popper element 17818 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 17819 * @argument {Object} options - Modifiers configuration and options 17820 * @returns {Object} The same data object 17821 */ 17822function applyStyle(data) { 17823 // any property present in `data.styles` will be applied to the popper, 17824 // in this way we can make the 3rd party modifiers add custom styles to it 17825 // Be aware, modifiers could override the properties defined in the previous 17826 // lines of this modifier! 17827 setStyles(data.instance.popper, data.styles); 17828 17829 // any property present in `data.attributes` will be applied to the popper, 17830 // they will be set as HTML attributes of the element 17831 setAttributes(data.instance.popper, data.attributes); 17832 17833 // if arrowElement is defined and arrowStyles has some properties 17834 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 17835 setStyles(data.arrowElement, data.arrowStyles); 17836 } 17837 17838 return data; 17839} 17840 17841/** 17842 * Set the x-placement attribute before everything else because it could be used 17843 * to add margins to the popper margins needs to be calculated to get the 17844 * correct popper offsets. 17845 * @method 17846 * @memberof Popper.modifiers 17847 * @param {HTMLElement} reference - The reference element used to position the popper 17848 * @param {HTMLElement} popper - The HTML element used as popper 17849 * @param {Object} options - Popper.js options 17850 */ 17851function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 17852 // compute reference element offsets 17853 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 17854 17855 // compute auto placement, store placement inside the data object, 17856 // modifiers will be able to edit `placement` if needed 17857 // and refer to originalPlacement to know the original value 17858 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 17859 17860 popper.setAttribute('x-placement', placement); 17861 17862 // Apply `position` to popper before anything else because 17863 // without the position applied we can't guarantee correct computations 17864 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 17865 17866 return options; 17867} 17868 17869/** 17870 * @function 17871 * @memberof Popper.Utils 17872 * @argument {Object} data - The data object generated by `update` method 17873 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 17874 * @returns {Object} The popper's position offsets rounded 17875 * 17876 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 17877 * good as it can be within reason. 17878 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 17879 * 17880 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 17881 * as well on High DPI screens). 17882 * 17883 * Firefox prefers no rounding for positioning and does not have blurriness on 17884 * high DPI screens. 17885 * 17886 * Only horizontal placement and left/right values need to be considered. 17887 */ 17888function getRoundedOffsets(data, shouldRound) { 17889 var _data$offsets = data.offsets, 17890 popper = _data$offsets.popper, 17891 reference = _data$offsets.reference; 17892 var round = Math.round, 17893 floor = Math.floor; 17894 17895 var noRound = function noRound(v) { 17896 return v; 17897 }; 17898 17899 var referenceWidth = round(reference.width); 17900 var popperWidth = round(popper.width); 17901 17902 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 17903 var isVariation = data.placement.indexOf('-') !== -1; 17904 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 17905 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 17906 17907 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 17908 var verticalToInteger = !shouldRound ? noRound : round; 17909 17910 return { 17911 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 17912 top: verticalToInteger(popper.top), 17913 bottom: verticalToInteger(popper.bottom), 17914 right: horizontalToInteger(popper.right) 17915 }; 17916} 17917 17918var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 17919 17920/** 17921 * @function 17922 * @memberof Modifiers 17923 * @argument {Object} data - The data object generated by `update` method 17924 * @argument {Object} options - Modifiers configuration and options 17925 * @returns {Object} The data object, properly modified 17926 */ 17927function computeStyle(data, options) { 17928 var x = options.x, 17929 y = options.y; 17930 var popper = data.offsets.popper; 17931 17932 // Remove this legacy support in Popper.js v2 17933 17934 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 17935 return modifier.name === 'applyStyle'; 17936 }).gpuAcceleration; 17937 if (legacyGpuAccelerationOption !== undefined) { 17938 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 17939 } 17940 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 17941 17942 var offsetParent = getOffsetParent(data.instance.popper); 17943 var offsetParentRect = getBoundingClientRect(offsetParent); 17944 17945 // Styles 17946 var styles = { 17947 position: popper.position 17948 }; 17949 17950 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 17951 17952 var sideA = x === 'bottom' ? 'top' : 'bottom'; 17953 var sideB = y === 'right' ? 'left' : 'right'; 17954 17955 // if gpuAcceleration is set to `true` and transform is supported, 17956 // we use `translate3d` to apply the position to the popper we 17957 // automatically use the supported prefixed version if needed 17958 var prefixedProperty = getSupportedPropertyName('transform'); 17959 17960 // now, let's make a step back and look at this code closely (wtf?) 17961 // If the content of the popper grows once it's been positioned, it 17962 // may happen that the popper gets misplaced because of the new content 17963 // overflowing its reference element 17964 // To avoid this problem, we provide two options (x and y), which allow 17965 // the consumer to define the offset origin. 17966 // If we position a popper on top of a reference element, we can set 17967 // `x` to `top` to make the popper grow towards its top instead of 17968 // its bottom. 17969 var left = void 0, 17970 top = void 0; 17971 if (sideA === 'bottom') { 17972 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 17973 // and not the bottom of the html element 17974 if (offsetParent.nodeName === 'HTML') { 17975 top = -offsetParent.clientHeight + offsets.bottom; 17976 } else { 17977 top = -offsetParentRect.height + offsets.bottom; 17978 } 17979 } else { 17980 top = offsets.top; 17981 } 17982 if (sideB === 'right') { 17983 if (offsetParent.nodeName === 'HTML') { 17984 left = -offsetParent.clientWidth + offsets.right; 17985 } else { 17986 left = -offsetParentRect.width + offsets.right; 17987 } 17988 } else { 17989 left = offsets.left; 17990 } 17991 if (gpuAcceleration && prefixedProperty) { 17992 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 17993 styles[sideA] = 0; 17994 styles[sideB] = 0; 17995 styles.willChange = 'transform'; 17996 } else { 17997 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 17998 var invertTop = sideA === 'bottom' ? -1 : 1; 17999 var invertLeft = sideB === 'right' ? -1 : 1; 18000 styles[sideA] = top * invertTop; 18001 styles[sideB] = left * invertLeft; 18002 styles.willChange = sideA + ', ' + sideB; 18003 } 18004 18005 // Attributes 18006 var attributes = { 18007 'x-placement': data.placement 18008 }; 18009 18010 // Update `data` attributes, styles and arrowStyles 18011 data.attributes = _extends({}, attributes, data.attributes); 18012 data.styles = _extends({}, styles, data.styles); 18013 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 18014 18015 return data; 18016} 18017 18018/** 18019 * Helper used to know if the given modifier depends from another one.<br /> 18020 * It checks if the needed modifier is listed and enabled. 18021 * @method 18022 * @memberof Popper.Utils 18023 * @param {Array} modifiers - list of modifiers 18024 * @param {String} requestingName - name of requesting modifier 18025 * @param {String} requestedName - name of requested modifier 18026 * @returns {Boolean} 18027 */ 18028function isModifierRequired(modifiers, requestingName, requestedName) { 18029 var requesting = find(modifiers, function (_ref) { 18030 var name = _ref.name; 18031 return name === requestingName; 18032 }); 18033 18034 var isRequired = !!requesting && modifiers.some(function (modifier) { 18035 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 18036 }); 18037 18038 if (!isRequired) { 18039 var _requesting = '`' + requestingName + '`'; 18040 var requested = '`' + requestedName + '`'; 18041 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 18042 } 18043 return isRequired; 18044} 18045 18046/** 18047 * @function 18048 * @memberof Modifiers 18049 * @argument {Object} data - The data object generated by update method 18050 * @argument {Object} options - Modifiers configuration and options 18051 * @returns {Object} The data object, properly modified 18052 */ 18053function arrow(data, options) { 18054 var _data$offsets$arrow; 18055 18056 // arrow depends on keepTogether in order to work 18057 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 18058 return data; 18059 } 18060 18061 var arrowElement = options.element; 18062 18063 // if arrowElement is a string, suppose it's a CSS selector 18064 if (typeof arrowElement === 'string') { 18065 arrowElement = data.instance.popper.querySelector(arrowElement); 18066 18067 // if arrowElement is not found, don't run the modifier 18068 if (!arrowElement) { 18069 return data; 18070 } 18071 } else { 18072 // if the arrowElement isn't a query selector we must check that the 18073 // provided DOM node is child of its popper node 18074 if (!data.instance.popper.contains(arrowElement)) { 18075 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 18076 return data; 18077 } 18078 } 18079 18080 var placement = data.placement.split('-')[0]; 18081 var _data$offsets = data.offsets, 18082 popper = _data$offsets.popper, 18083 reference = _data$offsets.reference; 18084 18085 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 18086 18087 var len = isVertical ? 'height' : 'width'; 18088 var sideCapitalized = isVertical ? 'Top' : 'Left'; 18089 var side = sideCapitalized.toLowerCase(); 18090 var altSide = isVertical ? 'left' : 'top'; 18091 var opSide = isVertical ? 'bottom' : 'right'; 18092 var arrowElementSize = getOuterSizes(arrowElement)[len]; 18093 18094 // 18095 // extends keepTogether behavior making sure the popper and its 18096 // reference have enough pixels in conjunction 18097 // 18098 18099 // top/left side 18100 if (reference[opSide] - arrowElementSize < popper[side]) { 18101 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 18102 } 18103 // bottom/right side 18104 if (reference[side] + arrowElementSize > popper[opSide]) { 18105 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 18106 } 18107 data.offsets.popper = getClientRect(data.offsets.popper); 18108 18109 // compute center of the popper 18110 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 18111 18112 // Compute the sideValue using the updated popper offsets 18113 // take popper margin in account because we don't have this info available 18114 var css = getStyleComputedProperty(data.instance.popper); 18115 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 18116 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 18117 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 18118 18119 // prevent arrowElement from being placed not contiguously to its popper 18120 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 18121 18122 data.arrowElement = arrowElement; 18123 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 18124 18125 return data; 18126} 18127 18128/** 18129 * Get the opposite placement variation of the given one 18130 * @method 18131 * @memberof Popper.Utils 18132 * @argument {String} placement variation 18133 * @returns {String} flipped placement variation 18134 */ 18135function getOppositeVariation(variation) { 18136 if (variation === 'end') { 18137 return 'start'; 18138 } else if (variation === 'start') { 18139 return 'end'; 18140 } 18141 return variation; 18142} 18143 18144/** 18145 * List of accepted placements to use as values of the `placement` option.<br /> 18146 * Valid placements are: 18147 * - `auto` 18148 * - `top` 18149 * - `right` 18150 * - `bottom` 18151 * - `left` 18152 * 18153 * Each placement can have a variation from this list: 18154 * - `-start` 18155 * - `-end` 18156 * 18157 * Variations are interpreted easily if you think of them as the left to right 18158 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 18159 * is right.<br /> 18160 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 18161 * 18162 * Some valid examples are: 18163 * - `top-end` (on top of reference, right aligned) 18164 * - `right-start` (on right of reference, top aligned) 18165 * - `bottom` (on bottom, centered) 18166 * - `auto-end` (on the side with more space available, alignment depends by placement) 18167 * 18168 * @static 18169 * @type {Array} 18170 * @enum {String} 18171 * @readonly 18172 * @method placements 18173 * @memberof Popper 18174 */ 18175var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 18176 18177// Get rid of `auto` `auto-start` and `auto-end` 18178var validPlacements = placements.slice(3); 18179 18180/** 18181 * Given an initial placement, returns all the subsequent placements 18182 * clockwise (or counter-clockwise). 18183 * 18184 * @method 18185 * @memberof Popper.Utils 18186 * @argument {String} placement - A valid placement (it accepts variations) 18187 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 18188 * @returns {Array} placements including their variations 18189 */ 18190function clockwise(placement) { 18191 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 18192 18193 var index = validPlacements.indexOf(placement); 18194 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 18195 return counter ? arr.reverse() : arr; 18196} 18197 18198var BEHAVIORS = { 18199 FLIP: 'flip', 18200 CLOCKWISE: 'clockwise', 18201 COUNTERCLOCKWISE: 'counterclockwise' 18202}; 18203 18204/** 18205 * @function 18206 * @memberof Modifiers 18207 * @argument {Object} data - The data object generated by update method 18208 * @argument {Object} options - Modifiers configuration and options 18209 * @returns {Object} The data object, properly modified 18210 */ 18211function flip(data, options) { 18212 // if `inner` modifier is enabled, we can't use the `flip` modifier 18213 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 18214 return data; 18215 } 18216 18217 if (data.flipped && data.placement === data.originalPlacement) { 18218 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 18219 return data; 18220 } 18221 18222 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 18223 18224 var placement = data.placement.split('-')[0]; 18225 var placementOpposite = getOppositePlacement(placement); 18226 var variation = data.placement.split('-')[1] || ''; 18227 18228 var flipOrder = []; 18229 18230 switch (options.behavior) { 18231 case BEHAVIORS.FLIP: 18232 flipOrder = [placement, placementOpposite]; 18233 break; 18234 case BEHAVIORS.CLOCKWISE: 18235 flipOrder = clockwise(placement); 18236 break; 18237 case BEHAVIORS.COUNTERCLOCKWISE: 18238 flipOrder = clockwise(placement, true); 18239 break; 18240 default: 18241 flipOrder = options.behavior; 18242 } 18243 18244 flipOrder.forEach(function (step, index) { 18245 if (placement !== step || flipOrder.length === index + 1) { 18246 return data; 18247 } 18248 18249 placement = data.placement.split('-')[0]; 18250 placementOpposite = getOppositePlacement(placement); 18251 18252 var popperOffsets = data.offsets.popper; 18253 var refOffsets = data.offsets.reference; 18254 18255 // using floor because the reference offsets may contain decimals we are not going to consider here 18256 var floor = Math.floor; 18257 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 18258 18259 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 18260 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 18261 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 18262 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 18263 18264 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 18265 18266 // flip the variation if required 18267 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 18268 18269 // flips variation if reference element overflows boundaries 18270 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 18271 18272 // flips variation if popper content overflows boundaries 18273 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 18274 18275 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 18276 18277 if (overlapsRef || overflowsBoundaries || flippedVariation) { 18278 // this boolean to detect any flip loop 18279 data.flipped = true; 18280 18281 if (overlapsRef || overflowsBoundaries) { 18282 placement = flipOrder[index + 1]; 18283 } 18284 18285 if (flippedVariation) { 18286 variation = getOppositeVariation(variation); 18287 } 18288 18289 data.placement = placement + (variation ? '-' + variation : ''); 18290 18291 // this object contains `position`, we want to preserve it along with 18292 // any additional property we may add in the future 18293 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 18294 18295 data = runModifiers(data.instance.modifiers, data, 'flip'); 18296 } 18297 }); 18298 return data; 18299} 18300 18301/** 18302 * @function 18303 * @memberof Modifiers 18304 * @argument {Object} data - The data object generated by update method 18305 * @argument {Object} options - Modifiers configuration and options 18306 * @returns {Object} The data object, properly modified 18307 */ 18308function keepTogether(data) { 18309 var _data$offsets = data.offsets, 18310 popper = _data$offsets.popper, 18311 reference = _data$offsets.reference; 18312 18313 var placement = data.placement.split('-')[0]; 18314 var floor = Math.floor; 18315 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 18316 var side = isVertical ? 'right' : 'bottom'; 18317 var opSide = isVertical ? 'left' : 'top'; 18318 var measurement = isVertical ? 'width' : 'height'; 18319 18320 if (popper[side] < floor(reference[opSide])) { 18321 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 18322 } 18323 if (popper[opSide] > floor(reference[side])) { 18324 data.offsets.popper[opSide] = floor(reference[side]); 18325 } 18326 18327 return data; 18328} 18329 18330/** 18331 * Converts a string containing value + unit into a px value number 18332 * @function 18333 * @memberof {modifiers~offset} 18334 * @private 18335 * @argument {String} str - Value + unit string 18336 * @argument {String} measurement - `height` or `width` 18337 * @argument {Object} popperOffsets 18338 * @argument {Object} referenceOffsets 18339 * @returns {Number|String} 18340 * Value in pixels, or original string if no values were extracted 18341 */ 18342function toValue(str, measurement, popperOffsets, referenceOffsets) { 18343 // separate value from unit 18344 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 18345 var value = +split[1]; 18346 var unit = split[2]; 18347 18348 // If it's not a number it's an operator, I guess 18349 if (!value) { 18350 return str; 18351 } 18352 18353 if (unit.indexOf('%') === 0) { 18354 var element = void 0; 18355 switch (unit) { 18356 case '%p': 18357 element = popperOffsets; 18358 break; 18359 case '%': 18360 case '%r': 18361 default: 18362 element = referenceOffsets; 18363 } 18364 18365 var rect = getClientRect(element); 18366 return rect[measurement] / 100 * value; 18367 } else if (unit === 'vh' || unit === 'vw') { 18368 // if is a vh or vw, we calculate the size based on the viewport 18369 var size = void 0; 18370 if (unit === 'vh') { 18371 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 18372 } else { 18373 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 18374 } 18375 return size / 100 * value; 18376 } else { 18377 // if is an explicit pixel unit, we get rid of the unit and keep the value 18378 // if is an implicit unit, it's px, and we return just the value 18379 return value; 18380 } 18381} 18382 18383/** 18384 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 18385 * @function 18386 * @memberof {modifiers~offset} 18387 * @private 18388 * @argument {String} offset 18389 * @argument {Object} popperOffsets 18390 * @argument {Object} referenceOffsets 18391 * @argument {String} basePlacement 18392 * @returns {Array} a two cells array with x and y offsets in numbers 18393 */ 18394function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 18395 var offsets = [0, 0]; 18396 18397 // Use height if placement is left or right and index is 0 otherwise use width 18398 // in this way the first offset will use an axis and the second one 18399 // will use the other one 18400 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 18401 18402 // Split the offset string to obtain a list of values and operands 18403 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 18404 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 18405 return frag.trim(); 18406 }); 18407 18408 // Detect if the offset string contains a pair of values or a single one 18409 // they could be separated by comma or space 18410 var divider = fragments.indexOf(find(fragments, function (frag) { 18411 return frag.search(/,|\s/) !== -1; 18412 })); 18413 18414 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 18415 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 18416 } 18417 18418 // If divider is found, we divide the list of values and operands to divide 18419 // them by ofset X and Y. 18420 var splitRegex = /\s*,\s*|\s+/; 18421 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 18422 18423 // Convert the values with units to absolute pixels to allow our computations 18424 ops = ops.map(function (op, index) { 18425 // Most of the units rely on the orientation of the popper 18426 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 18427 var mergeWithPrevious = false; 18428 return op 18429 // This aggregates any `+` or `-` sign that aren't considered operators 18430 // e.g.: 10 + +5 => [10, +, +5] 18431 .reduce(function (a, b) { 18432 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 18433 a[a.length - 1] = b; 18434 mergeWithPrevious = true; 18435 return a; 18436 } else if (mergeWithPrevious) { 18437 a[a.length - 1] += b; 18438 mergeWithPrevious = false; 18439 return a; 18440 } else { 18441 return a.concat(b); 18442 } 18443 }, []) 18444 // Here we convert the string values into number values (in px) 18445 .map(function (str) { 18446 return toValue(str, measurement, popperOffsets, referenceOffsets); 18447 }); 18448 }); 18449 18450 // Loop trough the offsets arrays and execute the operations 18451 ops.forEach(function (op, index) { 18452 op.forEach(function (frag, index2) { 18453 if (isNumeric(frag)) { 18454 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 18455 } 18456 }); 18457 }); 18458 return offsets; 18459} 18460 18461/** 18462 * @function 18463 * @memberof Modifiers 18464 * @argument {Object} data - The data object generated by update method 18465 * @argument {Object} options - Modifiers configuration and options 18466 * @argument {Number|String} options.offset=0 18467 * The offset value as described in the modifier description 18468 * @returns {Object} The data object, properly modified 18469 */ 18470function offset(data, _ref) { 18471 var offset = _ref.offset; 18472 var placement = data.placement, 18473 _data$offsets = data.offsets, 18474 popper = _data$offsets.popper, 18475 reference = _data$offsets.reference; 18476 18477 var basePlacement = placement.split('-')[0]; 18478 18479 var offsets = void 0; 18480 if (isNumeric(+offset)) { 18481 offsets = [+offset, 0]; 18482 } else { 18483 offsets = parseOffset(offset, popper, reference, basePlacement); 18484 } 18485 18486 if (basePlacement === 'left') { 18487 popper.top += offsets[0]; 18488 popper.left -= offsets[1]; 18489 } else if (basePlacement === 'right') { 18490 popper.top += offsets[0]; 18491 popper.left += offsets[1]; 18492 } else if (basePlacement === 'top') { 18493 popper.left += offsets[0]; 18494 popper.top -= offsets[1]; 18495 } else if (basePlacement === 'bottom') { 18496 popper.left += offsets[0]; 18497 popper.top += offsets[1]; 18498 } 18499 18500 data.popper = popper; 18501 return data; 18502} 18503 18504/** 18505 * @function 18506 * @memberof Modifiers 18507 * @argument {Object} data - The data object generated by `update` method 18508 * @argument {Object} options - Modifiers configuration and options 18509 * @returns {Object} The data object, properly modified 18510 */ 18511function preventOverflow(data, options) { 18512 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 18513 18514 // If offsetParent is the reference element, we really want to 18515 // go one step up and use the next offsetParent as reference to 18516 // avoid to make this modifier completely useless and look like broken 18517 if (data.instance.reference === boundariesElement) { 18518 boundariesElement = getOffsetParent(boundariesElement); 18519 } 18520 18521 // NOTE: DOM access here 18522 // resets the popper's position so that the document size can be calculated excluding 18523 // the size of the popper element itself 18524 var transformProp = getSupportedPropertyName('transform'); 18525 var popperStyles = data.instance.popper.style; // assignment to help minification 18526 var top = popperStyles.top, 18527 left = popperStyles.left, 18528 transform = popperStyles[transformProp]; 18529 18530 popperStyles.top = ''; 18531 popperStyles.left = ''; 18532 popperStyles[transformProp] = ''; 18533 18534 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 18535 18536 // NOTE: DOM access here 18537 // restores the original style properties after the offsets have been computed 18538 popperStyles.top = top; 18539 popperStyles.left = left; 18540 popperStyles[transformProp] = transform; 18541 18542 options.boundaries = boundaries; 18543 18544 var order = options.priority; 18545 var popper = data.offsets.popper; 18546 18547 var check = { 18548 primary: function primary(placement) { 18549 var value = popper[placement]; 18550 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 18551 value = Math.max(popper[placement], boundaries[placement]); 18552 } 18553 return defineProperty({}, placement, value); 18554 }, 18555 secondary: function secondary(placement) { 18556 var mainSide = placement === 'right' ? 'left' : 'top'; 18557 var value = popper[mainSide]; 18558 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 18559 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 18560 } 18561 return defineProperty({}, mainSide, value); 18562 } 18563 }; 18564 18565 order.forEach(function (placement) { 18566 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 18567 popper = _extends({}, popper, check[side](placement)); 18568 }); 18569 18570 data.offsets.popper = popper; 18571 18572 return data; 18573} 18574 18575/** 18576 * @function 18577 * @memberof Modifiers 18578 * @argument {Object} data - The data object generated by `update` method 18579 * @argument {Object} options - Modifiers configuration and options 18580 * @returns {Object} The data object, properly modified 18581 */ 18582function shift(data) { 18583 var placement = data.placement; 18584 var basePlacement = placement.split('-')[0]; 18585 var shiftvariation = placement.split('-')[1]; 18586 18587 // if shift shiftvariation is specified, run the modifier 18588 if (shiftvariation) { 18589 var _data$offsets = data.offsets, 18590 reference = _data$offsets.reference, 18591 popper = _data$offsets.popper; 18592 18593 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 18594 var side = isVertical ? 'left' : 'top'; 18595 var measurement = isVertical ? 'width' : 'height'; 18596 18597 var shiftOffsets = { 18598 start: defineProperty({}, side, reference[side]), 18599 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 18600 }; 18601 18602 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 18603 } 18604 18605 return data; 18606} 18607 18608/** 18609 * @function 18610 * @memberof Modifiers 18611 * @argument {Object} data - The data object generated by update method 18612 * @argument {Object} options - Modifiers configuration and options 18613 * @returns {Object} The data object, properly modified 18614 */ 18615function hide(data) { 18616 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 18617 return data; 18618 } 18619 18620 var refRect = data.offsets.reference; 18621 var bound = find(data.instance.modifiers, function (modifier) { 18622 return modifier.name === 'preventOverflow'; 18623 }).boundaries; 18624 18625 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 18626 // Avoid unnecessary DOM access if visibility hasn't changed 18627 if (data.hide === true) { 18628 return data; 18629 } 18630 18631 data.hide = true; 18632 data.attributes['x-out-of-boundaries'] = ''; 18633 } else { 18634 // Avoid unnecessary DOM access if visibility hasn't changed 18635 if (data.hide === false) { 18636 return data; 18637 } 18638 18639 data.hide = false; 18640 data.attributes['x-out-of-boundaries'] = false; 18641 } 18642 18643 return data; 18644} 18645 18646/** 18647 * @function 18648 * @memberof Modifiers 18649 * @argument {Object} data - The data object generated by `update` method 18650 * @argument {Object} options - Modifiers configuration and options 18651 * @returns {Object} The data object, properly modified 18652 */ 18653function inner(data) { 18654 var placement = data.placement; 18655 var basePlacement = placement.split('-')[0]; 18656 var _data$offsets = data.offsets, 18657 popper = _data$offsets.popper, 18658 reference = _data$offsets.reference; 18659 18660 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 18661 18662 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 18663 18664 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 18665 18666 data.placement = getOppositePlacement(placement); 18667 data.offsets.popper = getClientRect(popper); 18668 18669 return data; 18670} 18671 18672/** 18673 * Modifier function, each modifier can have a function of this type assigned 18674 * to its `fn` property.<br /> 18675 * These functions will be called on each update, this means that you must 18676 * make sure they are performant enough to avoid performance bottlenecks. 18677 * 18678 * @function ModifierFn 18679 * @argument {dataObject} data - The data object generated by `update` method 18680 * @argument {Object} options - Modifiers configuration and options 18681 * @returns {dataObject} The data object, properly modified 18682 */ 18683 18684/** 18685 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 18686 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 18687 * needed by the library. 18688 * 18689 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 18690 * All the other properties are configurations that could be tweaked. 18691 * @namespace modifiers 18692 */ 18693var modifiers = { 18694 /** 18695 * Modifier used to shift the popper on the start or end of its reference 18696 * element.<br /> 18697 * It will read the variation of the `placement` property.<br /> 18698 * It can be one either `-end` or `-start`. 18699 * @memberof modifiers 18700 * @inner 18701 */ 18702 shift: { 18703 /** @prop {number} order=100 - Index used to define the order of execution */ 18704 order: 100, 18705 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18706 enabled: true, 18707 /** @prop {ModifierFn} */ 18708 fn: shift 18709 }, 18710 18711 /** 18712 * The `offset` modifier can shift your popper on both its axis. 18713 * 18714 * It accepts the following units: 18715 * - `px` or unit-less, interpreted as pixels 18716 * - `%` or `%r`, percentage relative to the length of the reference element 18717 * - `%p`, percentage relative to the length of the popper element 18718 * - `vw`, CSS viewport width unit 18719 * - `vh`, CSS viewport height unit 18720 * 18721 * For length is intended the main axis relative to the placement of the popper.<br /> 18722 * This means that if the placement is `top` or `bottom`, the length will be the 18723 * `width`. In case of `left` or `right`, it will be the `height`. 18724 * 18725 * You can provide a single value (as `Number` or `String`), or a pair of values 18726 * as `String` divided by a comma or one (or more) white spaces.<br /> 18727 * The latter is a deprecated method because it leads to confusion and will be 18728 * removed in v2.<br /> 18729 * Additionally, it accepts additions and subtractions between different units. 18730 * Note that multiplications and divisions aren't supported. 18731 * 18732 * Valid examples are: 18733 * ``` 18734 * 10 18735 * '10%' 18736 * '10, 10' 18737 * '10%, 10' 18738 * '10 + 10%' 18739 * '10 - 5vh + 3%' 18740 * '-10px + 5vh, 5px - 6%' 18741 * ``` 18742 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 18743 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 18744 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 18745 * 18746 * @memberof modifiers 18747 * @inner 18748 */ 18749 offset: { 18750 /** @prop {number} order=200 - Index used to define the order of execution */ 18751 order: 200, 18752 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18753 enabled: true, 18754 /** @prop {ModifierFn} */ 18755 fn: offset, 18756 /** @prop {Number|String} offset=0 18757 * The offset value as described in the modifier description 18758 */ 18759 offset: 0 18760 }, 18761 18762 /** 18763 * Modifier used to prevent the popper from being positioned outside the boundary. 18764 * 18765 * A scenario exists where the reference itself is not within the boundaries.<br /> 18766 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 18767 * In this case we need to decide whether the popper should either: 18768 * 18769 * - detach from the reference and remain "trapped" in the boundaries, or 18770 * - if it should ignore the boundary and "escape with its reference" 18771 * 18772 * When `escapeWithReference` is set to`true` and reference is completely 18773 * outside its boundaries, the popper will overflow (or completely leave) 18774 * the boundaries in order to remain attached to the edge of the reference. 18775 * 18776 * @memberof modifiers 18777 * @inner 18778 */ 18779 preventOverflow: { 18780 /** @prop {number} order=300 - Index used to define the order of execution */ 18781 order: 300, 18782 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18783 enabled: true, 18784 /** @prop {ModifierFn} */ 18785 fn: preventOverflow, 18786 /** 18787 * @prop {Array} [priority=['left','right','top','bottom']] 18788 * Popper will try to prevent overflow following these priorities by default, 18789 * then, it could overflow on the left and on top of the `boundariesElement` 18790 */ 18791 priority: ['left', 'right', 'top', 'bottom'], 18792 /** 18793 * @prop {number} padding=5 18794 * Amount of pixel used to define a minimum distance between the boundaries 18795 * and the popper. This makes sure the popper always has a little padding 18796 * between the edges of its container 18797 */ 18798 padding: 5, 18799 /** 18800 * @prop {String|HTMLElement} boundariesElement='scrollParent' 18801 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 18802 * `viewport` or any DOM element. 18803 */ 18804 boundariesElement: 'scrollParent' 18805 }, 18806 18807 /** 18808 * Modifier used to make sure the reference and its popper stay near each other 18809 * without leaving any gap between the two. Especially useful when the arrow is 18810 * enabled and you want to ensure that it points to its reference element. 18811 * It cares only about the first axis. You can still have poppers with margin 18812 * between the popper and its reference element. 18813 * @memberof modifiers 18814 * @inner 18815 */ 18816 keepTogether: { 18817 /** @prop {number} order=400 - Index used to define the order of execution */ 18818 order: 400, 18819 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18820 enabled: true, 18821 /** @prop {ModifierFn} */ 18822 fn: keepTogether 18823 }, 18824 18825 /** 18826 * This modifier is used to move the `arrowElement` of the popper to make 18827 * sure it is positioned between the reference element and its popper element. 18828 * It will read the outer size of the `arrowElement` node to detect how many 18829 * pixels of conjunction are needed. 18830 * 18831 * It has no effect if no `arrowElement` is provided. 18832 * @memberof modifiers 18833 * @inner 18834 */ 18835 arrow: { 18836 /** @prop {number} order=500 - Index used to define the order of execution */ 18837 order: 500, 18838 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18839 enabled: true, 18840 /** @prop {ModifierFn} */ 18841 fn: arrow, 18842 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 18843 element: '[x-arrow]' 18844 }, 18845 18846 /** 18847 * Modifier used to flip the popper's placement when it starts to overlap its 18848 * reference element. 18849 * 18850 * Requires the `preventOverflow` modifier before it in order to work. 18851 * 18852 * **NOTE:** this modifier will interrupt the current update cycle and will 18853 * restart it if it detects the need to flip the placement. 18854 * @memberof modifiers 18855 * @inner 18856 */ 18857 flip: { 18858 /** @prop {number} order=600 - Index used to define the order of execution */ 18859 order: 600, 18860 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18861 enabled: true, 18862 /** @prop {ModifierFn} */ 18863 fn: flip, 18864 /** 18865 * @prop {String|Array} behavior='flip' 18866 * The behavior used to change the popper's placement. It can be one of 18867 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 18868 * placements (with optional variations) 18869 */ 18870 behavior: 'flip', 18871 /** 18872 * @prop {number} padding=5 18873 * The popper will flip if it hits the edges of the `boundariesElement` 18874 */ 18875 padding: 5, 18876 /** 18877 * @prop {String|HTMLElement} boundariesElement='viewport' 18878 * The element which will define the boundaries of the popper position. 18879 * The popper will never be placed outside of the defined boundaries 18880 * (except if `keepTogether` is enabled) 18881 */ 18882 boundariesElement: 'viewport', 18883 /** 18884 * @prop {Boolean} flipVariations=false 18885 * The popper will switch placement variation between `-start` and `-end` when 18886 * the reference element overlaps its boundaries. 18887 * 18888 * The original placement should have a set variation. 18889 */ 18890 flipVariations: false, 18891 /** 18892 * @prop {Boolean} flipVariationsByContent=false 18893 * The popper will switch placement variation between `-start` and `-end` when 18894 * the popper element overlaps its reference boundaries. 18895 * 18896 * The original placement should have a set variation. 18897 */ 18898 flipVariationsByContent: false 18899 }, 18900 18901 /** 18902 * Modifier used to make the popper flow toward the inner of the reference element. 18903 * By default, when this modifier is disabled, the popper will be placed outside 18904 * the reference element. 18905 * @memberof modifiers 18906 * @inner 18907 */ 18908 inner: { 18909 /** @prop {number} order=700 - Index used to define the order of execution */ 18910 order: 700, 18911 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 18912 enabled: false, 18913 /** @prop {ModifierFn} */ 18914 fn: inner 18915 }, 18916 18917 /** 18918 * Modifier used to hide the popper when its reference element is outside of the 18919 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 18920 * be used to hide with a CSS selector the popper when its reference is 18921 * out of boundaries. 18922 * 18923 * Requires the `preventOverflow` modifier before it in order to work. 18924 * @memberof modifiers 18925 * @inner 18926 */ 18927 hide: { 18928 /** @prop {number} order=800 - Index used to define the order of execution */ 18929 order: 800, 18930 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18931 enabled: true, 18932 /** @prop {ModifierFn} */ 18933 fn: hide 18934 }, 18935 18936 /** 18937 * Computes the style that will be applied to the popper element to gets 18938 * properly positioned. 18939 * 18940 * Note that this modifier will not touch the DOM, it just prepares the styles 18941 * so that `applyStyle` modifier can apply it. This separation is useful 18942 * in case you need to replace `applyStyle` with a custom implementation. 18943 * 18944 * This modifier has `850` as `order` value to maintain backward compatibility 18945 * with previous versions of Popper.js. Expect the modifiers ordering method 18946 * to change in future major versions of the library. 18947 * 18948 * @memberof modifiers 18949 * @inner 18950 */ 18951 computeStyle: { 18952 /** @prop {number} order=850 - Index used to define the order of execution */ 18953 order: 850, 18954 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18955 enabled: true, 18956 /** @prop {ModifierFn} */ 18957 fn: computeStyle, 18958 /** 18959 * @prop {Boolean} gpuAcceleration=true 18960 * If true, it uses the CSS 3D transformation to position the popper. 18961 * Otherwise, it will use the `top` and `left` properties 18962 */ 18963 gpuAcceleration: true, 18964 /** 18965 * @prop {string} [x='bottom'] 18966 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 18967 * Change this if your popper should grow in a direction different from `bottom` 18968 */ 18969 x: 'bottom', 18970 /** 18971 * @prop {string} [x='left'] 18972 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 18973 * Change this if your popper should grow in a direction different from `right` 18974 */ 18975 y: 'right' 18976 }, 18977 18978 /** 18979 * Applies the computed styles to the popper element. 18980 * 18981 * All the DOM manipulations are limited to this modifier. This is useful in case 18982 * you want to integrate Popper.js inside a framework or view library and you 18983 * want to delegate all the DOM manipulations to it. 18984 * 18985 * Note that if you disable this modifier, you must make sure the popper element 18986 * has its position set to `absolute` before Popper.js can do its work! 18987 * 18988 * Just disable this modifier and define your own to achieve the desired effect. 18989 * 18990 * @memberof modifiers 18991 * @inner 18992 */ 18993 applyStyle: { 18994 /** @prop {number} order=900 - Index used to define the order of execution */ 18995 order: 900, 18996 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18997 enabled: true, 18998 /** @prop {ModifierFn} */ 18999 fn: applyStyle, 19000 /** @prop {Function} */ 19001 onLoad: applyStyleOnLoad, 19002 /** 19003 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 19004 * @prop {Boolean} gpuAcceleration=true 19005 * If true, it uses the CSS 3D transformation to position the popper. 19006 * Otherwise, it will use the `top` and `left` properties 19007 */ 19008 gpuAcceleration: undefined 19009 } 19010}; 19011 19012/** 19013 * The `dataObject` is an object containing all the information used by Popper.js. 19014 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 19015 * @name dataObject 19016 * @property {Object} data.instance The Popper.js instance 19017 * @property {String} data.placement Placement applied to popper 19018 * @property {String} data.originalPlacement Placement originally defined on init 19019 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 19020 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 19021 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 19022 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 19023 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 19024 * @property {Object} data.boundaries Offsets of the popper boundaries 19025 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 19026 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 19027 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 19028 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 19029 */ 19030 19031/** 19032 * Default options provided to Popper.js constructor.<br /> 19033 * These can be overridden using the `options` argument of Popper.js.<br /> 19034 * To override an option, simply pass an object with the same 19035 * structure of the `options` object, as the 3rd argument. For example: 19036 * ``` 19037 * new Popper(ref, pop, { 19038 * modifiers: { 19039 * preventOverflow: { enabled: false } 19040 * } 19041 * }) 19042 * ``` 19043 * @type {Object} 19044 * @static 19045 * @memberof Popper 19046 */ 19047var Defaults = { 19048 /** 19049 * Popper's placement. 19050 * @prop {Popper.placements} placement='bottom' 19051 */ 19052 placement: 'bottom', 19053 19054 /** 19055 * Set this to true if you want popper to position it self in 'fixed' mode 19056 * @prop {Boolean} positionFixed=false 19057 */ 19058 positionFixed: false, 19059 19060 /** 19061 * Whether events (resize, scroll) are initially enabled. 19062 * @prop {Boolean} eventsEnabled=true 19063 */ 19064 eventsEnabled: true, 19065 19066 /** 19067 * Set to true if you want to automatically remove the popper when 19068 * you call the `destroy` method. 19069 * @prop {Boolean} removeOnDestroy=false 19070 */ 19071 removeOnDestroy: false, 19072 19073 /** 19074 * Callback called when the popper is created.<br /> 19075 * By default, it is set to no-op.<br /> 19076 * Access Popper.js instance with `data.instance`. 19077 * @prop {onCreate} 19078 */ 19079 onCreate: function onCreate() {}, 19080 19081 /** 19082 * Callback called when the popper is updated. This callback is not called 19083 * on the initialization/creation of the popper, but only on subsequent 19084 * updates.<br /> 19085 * By default, it is set to no-op.<br /> 19086 * Access Popper.js instance with `data.instance`. 19087 * @prop {onUpdate} 19088 */ 19089 onUpdate: function onUpdate() {}, 19090 19091 /** 19092 * List of modifiers used to modify the offsets before they are applied to the popper. 19093 * They provide most of the functionalities of Popper.js. 19094 * @prop {modifiers} 19095 */ 19096 modifiers: modifiers 19097}; 19098 19099/** 19100 * @callback onCreate 19101 * @param {dataObject} data 19102 */ 19103 19104/** 19105 * @callback onUpdate 19106 * @param {dataObject} data 19107 */ 19108 19109// Utils 19110// Methods 19111var Popper = function () { 19112 /** 19113 * Creates a new Popper.js instance. 19114 * @class Popper 19115 * @param {Element|referenceObject} reference - The reference element used to position the popper 19116 * @param {Element} popper - The HTML / XML element used as the popper 19117 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 19118 * @return {Object} instance - The generated Popper.js instance 19119 */ 19120 function Popper(reference, popper) { 19121 var _this = this; 19122 19123 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 19124 classCallCheck(this, Popper); 19125 19126 this.scheduleUpdate = function () { 19127 return requestAnimationFrame(_this.update); 19128 }; 19129 19130 // make update() debounced, so that it only runs at most once-per-tick 19131 this.update = debounce(this.update.bind(this)); 19132 19133 // with {} we create a new object with the options inside it 19134 this.options = _extends({}, Popper.Defaults, options); 19135 19136 // init state 19137 this.state = { 19138 isDestroyed: false, 19139 isCreated: false, 19140 scrollParents: [] 19141 }; 19142 19143 // get reference and popper elements (allow jQuery wrappers) 19144 this.reference = reference && reference.jquery ? reference[0] : reference; 19145 this.popper = popper && popper.jquery ? popper[0] : popper; 19146 19147 // Deep merge modifiers options 19148 this.options.modifiers = {}; 19149 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 19150 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 19151 }); 19152 19153 // Refactoring modifiers' list (Object => Array) 19154 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 19155 return _extends({ 19156 name: name 19157 }, _this.options.modifiers[name]); 19158 }) 19159 // sort the modifiers by order 19160 .sort(function (a, b) { 19161 return a.order - b.order; 19162 }); 19163 19164 // modifiers have the ability to execute arbitrary code when Popper.js get inited 19165 // such code is executed in the same order of its modifier 19166 // they could add new properties to their options configuration 19167 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 19168 this.modifiers.forEach(function (modifierOptions) { 19169 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 19170 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 19171 } 19172 }); 19173 19174 // fire the first update to position the popper in the right place 19175 this.update(); 19176 19177 var eventsEnabled = this.options.eventsEnabled; 19178 if (eventsEnabled) { 19179 // setup event listeners, they will take care of update the position in specific situations 19180 this.enableEventListeners(); 19181 } 19182 19183 this.state.eventsEnabled = eventsEnabled; 19184 } 19185 19186 // We can't use class properties because they don't get listed in the 19187 // class prototype and break stuff like Sinon stubs 19188 19189 19190 createClass(Popper, [{ 19191 key: 'update', 19192 value: function update$$1() { 19193 return update.call(this); 19194 } 19195 }, { 19196 key: 'destroy', 19197 value: function destroy$$1() { 19198 return destroy.call(this); 19199 } 19200 }, { 19201 key: 'enableEventListeners', 19202 value: function enableEventListeners$$1() { 19203 return enableEventListeners.call(this); 19204 } 19205 }, { 19206 key: 'disableEventListeners', 19207 value: function disableEventListeners$$1() { 19208 return disableEventListeners.call(this); 19209 } 19210 19211 /** 19212 * Schedules an update. It will run on the next UI update available. 19213 * @method scheduleUpdate 19214 * @memberof Popper 19215 */ 19216 19217 19218 /** 19219 * Collection of utilities useful when writing custom modifiers. 19220 * Starting from version 1.7, this method is available only if you 19221 * include `popper-utils.js` before `popper.js`. 19222 * 19223 * **DEPRECATION**: This way to access PopperUtils is deprecated 19224 * and will be removed in v2! Use the PopperUtils module directly instead. 19225 * Due to the high instability of the methods contained in Utils, we can't 19226 * guarantee them to follow semver. Use them at your own risk! 19227 * @static 19228 * @private 19229 * @type {Object} 19230 * @deprecated since version 1.8 19231 * @member Utils 19232 * @memberof Popper 19233 */ 19234 19235 }]); 19236 return Popper; 19237}(); 19238 19239/** 19240 * The `referenceObject` is an object that provides an interface compatible with Popper.js 19241 * and lets you use it as replacement of a real DOM node.<br /> 19242 * You can use this method to position a popper relatively to a set of coordinates 19243 * in case you don't have a DOM node to use as reference. 19244 * 19245 * ``` 19246 * new Popper(referenceObject, popperNode); 19247 * ``` 19248 * 19249 * NB: This feature isn't supported in Internet Explorer 10. 19250 * @name referenceObject 19251 * @property {Function} data.getBoundingClientRect 19252 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 19253 * @property {number} data.clientWidth 19254 * An ES6 getter that will return the width of the virtual reference element. 19255 * @property {number} data.clientHeight 19256 * An ES6 getter that will return the height of the virtual reference element. 19257 */ 19258 19259 19260Popper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils; 19261Popper.placements = placements; 19262Popper.Defaults = Defaults; 19263 19264/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popper); 19265//# sourceMappingURL=popper.js.map 19266 19267 19268/***/ })
vendor: 7,389 bytes, lines 19268-19448
19268 19269 19270/******/ }); 19271/************************************************************************/ 19272/******/ // The module cache 19273/******/ var __webpack_module_cache__ = {}; 19274/******/ 19275/******/ // The require function 19276/******/ function __webpack_require__(moduleId) { 19277/******/ // Check if module is in cache 19278/******/ var cachedModule = __webpack_module_cache__[moduleId]; 19279/******/ if (cachedModule !== undefined) { 19280/******/ return cachedModule.exports; 19281/******/ } 19282/******/ // Create a new module (and put it into the cache) 19283/******/ var module = __webpack_module_cache__[moduleId] = { 19284/******/ // no module.id needed 19285/******/ // no module.loaded needed 19286/******/ exports: {} 19287/******/ }; 19288/******/ 19289/******/ // Execute the module function 19290/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 19291/******/ 19292/******/ // Return the exports of the module 19293/******/ return module.exports; 19294/******/ } 19295/******/ 19296/******/ // expose the modules object (__webpack_modules__) 19297/******/ __webpack_require__.m = __webpack_modules__; 19298/******/ 19299/************************************************************************/ 19300/******/ /* webpack/runtime/chunk loaded */ 19301/******/ (() => { 19302/******/ var deferred = []; 19303/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 19304/******/ if(chunkIds) { 19305/******/ priority = priority || 0; 19306/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 19307/******/ deferred[i] = [chunkIds, fn, priority]; 19308/******/ return; 19309/******/ } 19310/******/ var notFulfilled = Infinity; 19311/******/ for (var i = 0; i < deferred.length; i++) { 19312/******/ var [chunkIds, fn, priority] = deferred[i]; 19313/******/ var fulfilled = true; 19314/******/ for (var j = 0; j < chunkIds.length; j++) { 19315/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 19316/******/ chunkIds.splice(j--, 1); 19317/******/ } else { 19318/******/ fulfilled = false; 19319/******/ if(priority < notFulfilled) notFulfilled = priority; 19320/******/ } 19321/******/ } 19322/******/ if(fulfilled) { 19323/******/ deferred.splice(i--, 1) 19324/******/ var r = fn(); 19325/******/ if (r !== undefined) result = r; 19326/******/ } 19327/******/ } 19328/******/ return result; 19329/******/ }; 19330/******/ })(); 19331/******/ 19332/******/ /* webpack/runtime/compat get default export */ 19333/******/ (() => { 19334/******/ // getDefaultExport function for compatibility with non-harmony modules 19335/******/ __webpack_require__.n = (module) => { 19336/******/ var getter = module && module.__esModule ? 19337/******/ () => (module['default']) : 19338/******/ () => (module); 19339/******/ __webpack_require__.d(getter, { a: getter }); 19340/******/ return getter; 19341/******/ }; 19342/******/ })(); 19343/******/ 19344/******/ /* webpack/runtime/define property getters */ 19345/******/ (() => { 19346/******/ // define getter functions for harmony exports 19347/******/ __webpack_require__.d = (exports, definition) => { 19348/******/ for(var key in definition) { 19349/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 19350/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 19351/******/ } 19352/******/ } 19353/******/ }; 19354/******/ })(); 19355/******/ 19356/******/ /* webpack/runtime/global */ 19357/******/ (() => { 19358/******/ __webpack_require__.g = (function() { 19359/******/ if (typeof globalThis === 'object') return globalThis; 19360/******/ try { 19361/******/ return this || new Function('return this')(); 19362/******/ } catch (e) { 19363/******/ if (typeof window === 'object') return window; 19364/******/ } 19365/******/ })(); 19366/******/ })(); 19367/******/ 19368/******/ /* webpack/runtime/hasOwnProperty shorthand */ 19369/******/ (() => { 19370/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 19371/******/ })(); 19372/******/ 19373/******/ /* webpack/runtime/make namespace object */ 19374/******/ (() => { 19375/******/ // define __esModule on exports 19376/******/ __webpack_require__.r = (exports) => { 19377/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 19378/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 19379/******/ } 19380/******/ Object.defineProperty(exports, '__esModule', { value: true }); 19381/******/ }; 19382/******/ })(); 19383/******/ 19384/******/ /* webpack/runtime/jsonp chunk loading */ 19385/******/ (() => { 19386/******/ // no baseURI 19387/******/ 19388/******/ // object to store loaded and loading chunks 19389/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 19390/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 19391/******/ var installedChunks = { 19392/******/ "/assets/dist/js/app": 0, 19393/******/ "assets/dist/css/app": 0 19394/******/ }; 19395/******/ 19396/******/ // no chunk on demand loading 19397/******/ 19398/******/ // no prefetching 19399/******/ 19400/******/ // no preloaded 19401/******/ 19402/******/ // no HMR 19403/******/ 19404/******/ // no HMR manifest 19405/******/ 19406/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 19407/******/ 19408/******/ // install a JSONP callback for chunk loading 19409/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 19410/******/ var [chunkIds, moreModules, runtime] = data; 19411/******/ // add "moreModules" to the modules object, 19412/******/ // then flag all "chunkIds" as loaded and fire callback 19413/******/ var moduleId, chunkId, i = 0; 19414/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 19415/******/ for(moduleId in moreModules) { 19416/******/ if(__webpack_require__.o(moreModules, moduleId)) { 19417/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 19418/******/ } 19419/******/ } 19420/******/ if(runtime) var result = runtime(__webpack_require__); 19421/******/ } 19422/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 19423/******/ for(;i < chunkIds.length; i++) { 19424/******/ chunkId = chunkIds[i]; 19425/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 19426/******/ installedChunks[chunkId][0](); 19427/******/ } 19428/******/ installedChunks[chunkId] = 0; 19429/******/ } 19430/******/ return __webpack_require__.O(result); 19431/******/ } 19432/******/ 19433/******/ var chunkLoadingGlobal = self["webpackChunkoc_bootstrap_starter_kit"] = self["webpackChunkoc_bootstrap_starter_kit"] || []; 19434/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 19435/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 19436/******/ })(); 19437/******/ 19438/************************************************************************/ 19439/******/ 19440/******/ // startup 19441/******/ // Load entry module and return exports 19442/******/ // This entry module depends on other loaded chunks and execution need to be delayed 19443/******/ __webpack_require__.O(undefined, ["assets/dist/css/app"], () => (__webpack_require__("./assets/src/js/app.js"))) 19444/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["assets/dist/css/app"], () => (__webpack_require__("./assets/src/sass/app.scss"))) 19445/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 19446/******/ 19447/******/ })() 19448;
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.