/* Minification failed. Returning unminified contents.
(5856,37-38): run-time error JS1195: Expected expression: >
(5858,10-11): run-time error JS1195: Expected expression: )
(6168,83-84): run-time error JS1195: Expected expression: >
(6175,14-15): run-time error JS1195: Expected expression: )
(6176,9-10): run-time error JS1002: Syntax error: }
(6207,5-6): run-time error JS1002: Syntax error: }
(6211,49-50): run-time error JS1004: Expected ';': {
(6589,57-58): run-time error JS1195: Expected expression: .
(6589,69-70): run-time error JS1004: Expected ';': )
(6590,56-57): run-time error JS1195: Expected expression: .
(6590,67-68): run-time error JS1004: Expected ';': )
(6591,57-58): run-time error JS1195: Expected expression: .
(6591,69-70): run-time error JS1004: Expected ';': )
(6595,60-71): run-time error JS1197: Too many errors. The file might not be a JavaScript file: projectCode
(6303,9,6313,10): run-time error JS1018: 'return' statement outside of function: return {
            state: state,
            search: search,
            searching: searching,
            editCurrentBoothClick: editCurrentBoothClick,
            createNewBoothClick: createNewBoothClick,
            registration: self.registration,
            editingSelectedBooth: self.editingSelectedBooth,
            findBoothClick: findBoothClick,
            allowCreateBooth: allowCreateBooth
        }
(6199,9,6206,10): run-time error JS1018: 'return' statement outside of function: return {
            verificationCode: verificationCode,
            verifyingCode: verifyingCode,
            verifyCode: verifyCode,
            invalidCode: invalidCode,
            backToLoginClicked: backToLoginClicked,
            state: state
        }
 */
/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,y,s,c,v,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=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(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(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+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(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[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(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 ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=y)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];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[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,y,v,e){return y&&!y[S]&&(y=Ce(y)),v&&!v[S]&&(v=Ce(v,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?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),v?v(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(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,y,v,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(y=o,m=0<(v=i).length,x=0<y.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=y[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=v[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+v.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ve(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)&&ve(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="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 S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function $(){E.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",$),C.addEventListener("load",$));var B=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)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,v.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||S.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(t,e){S.event.special[t]={setup:function(){return Se(this,t,Ce),!1},trigger:function(){return Se(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!v.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ye(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(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||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return B(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ye(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace($e,"$1")||void 0),""!==a||ie(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var ze=["Webkit","Moz","ms"],Ue=E.createElement("div").style,Xe={};function Ve(e){var t=S.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Re.test(t),l=e.style;if(u||(t=Ve(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Re.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return B(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).addClass(t.call(this,e,vt(this)))}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).removeClass(t.call(this,e,vt(this)))}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=yt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){S(this).toggleClass(t.call(this,e,vt(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=S(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function $t(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Bt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),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,y=S.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?S(v):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.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&&(y.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),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=E.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=S.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in(g=S.event&&y.global)&&0==S.active++&&S.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(Et.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},y.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]}(y,T,n)),!i&&-1<S.inArray("script",y.dataTypes)&&S.inArray("json",y.dataTypes)<0&&(y.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===y.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(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!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(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.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(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=yt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
;
/*! jQuery UI - v1.13.2 - 2022-07-14
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(V.isPlainObject(i)?t[e]=V.isPlainObject(t[e])?V.widget.extend({},t[e],i):V.widget.extend({},i):t[e]=i);return t},V.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;V.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=V.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V.data(this,a);t?(t.option(i||{}),t._init&&t._init()):V.data(this,a,new e(i,this))})),n}},V.Widget=function(){},V.Widget._childConstructors=[],V.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=V(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||V(),i=n.add?(function(){var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})}(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}});var s,x,k,o,l,h,c,u,C;V.widget;function D(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function I(t,e){return parseInt(V.css(t,e),10)||0}function T(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,C=V.fn.position,V.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=V("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?V.position.scrollbarWidth():0,height:e?V.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=V(t||window),i=T(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?V(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},V.fn.position=function(u){if(!u||!u.of)return C.apply(this,arguments);var d,p,f,g,m,t,_="string"==typeof(u=V.extend({},u)).of?V(document).find(u.of):V(u.of),v=V.position.getWithinInfo(u.within),b=V.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:T(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=V.extend({},g=e.offset),V.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=D(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=V(this),r=a.outerWidth(),l=a.outerHeight(),e=I(this,"marginLeft"),s=I(this,"marginTop"),n=r+e+I(this,"marginRight")+b.width,o=l+s+I(this,"marginBottom")+b.height,h=V.extend({},m),c=D(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},V.each(["left","top"],function(t,e){V.ui.position[y[t]]&&V.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&k(e+i)<p&&(o.horizontal="center"),f<l&&k(s+n)<f&&(o.vertical="middle"),x(k(e),k(i))>x(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<k(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||k(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<k(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||k(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){V.ui.position.flip.left.apply(this,arguments),V.ui.position.fit.left.apply(this,arguments)},top:function(){V.ui.position.flip.top.apply(this,arguments),V.ui.position.fit.top.apply(this,arguments)}}};V.ui.position,V.extend(V.expr.pseudos,{data:V.expr.createPseudo?V.expr.createPseudo(function(e){return function(t){return!!V.data(t,e)}}):function(t,e,i){return!!V.data(t,i[3])}}),V.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var t,d=V,p={},e=p.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,g=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],m=d.Color=function(t,e,i,s){return new d.Color.fn.parse(t,e,i,s)},_={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},v={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},b=m.support={},y=d("<p>")[0],w=d.each;function P(t){return null==t?t+"":"object"==typeof t?p[e.call(t)]||"object":typeof t}function M(t,e,i){var s=v[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function S(s){var n=m(),o=n._rgba=[];return s=s.toLowerCase(),w(g,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[_[e].cache]=i[_[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&d.extend(o,B.transparent),n):B[s]}function H(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}y.style.cssText="background-color:rgba(1,1,1,.5)",b.rgba=-1<y.style.backgroundColor.indexOf("rgba"),w(_,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),d.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){p["[object "+e+"]"]=e.toLowerCase()}),(m.fn=d.extend(m.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=d(n).css(t),t=void 0);var o=this,s=P(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(S(n)||B._default):"array"===s?(w(_.rgba.props,function(t,e){a[e.idx]=M(n[e.idx],e)}),this):"object"===s?(w(_,n instanceof m?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;w(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=M(n[t],e,!0)}),o[s]&&d.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=m(t),o=!0,a=this;return w(_,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],w(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return w(_,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=m(t))._space(),i=_[e],t=0===this.alpha()?m("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return w(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=v[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=m(t)._rgba;return m(d.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=d.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=d.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+d.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=m.fn,_.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},_.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*H(s,i,e+1/3)),Math.round(255*H(s,i,e)),Math.round(255*H(s,i,e-1/3)),t]},w(_,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;m.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=P(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return w(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=M(t,e)}),r?((t=m(r(n)))[o]=n,t):m(n)},w(e,function(a,r){m.fn[a]||(m.fn[a]=function(t){var e,i=P(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=P(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(m.hook=function(t){t=t.split(" ");w(t,function(t,o){d.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==P(e)||(i=S(e)))){if(e=m(i||e),!b.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=d.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},d.fx.step[o]=function(t){t.colorInit||(t.start=m(t.elem,o),t.end=m(t.end),t.colorInit=!0),d.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),d.cssHooks.borderColor={expand:function(i){var s={};return w(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var z,A,O,N,E,W,F,L,R,Y,B=d.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},j="ui-effects-",q="ui-effects-style",K="ui-effects-animated";function U(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function X(t,e,i,s){return t={effect:t=V.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!V.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&V.extend(t,e),i=i||e.duration,t.duration=V.fx.off?0:"number"==typeof i?i:i in V.fx.speeds?V.fx.speeds[i]:V.fx.speeds._default,t.complete=s||e.complete,t}function $(t){return!t||"number"==typeof t||V.fx.speeds[t]||("string"==typeof t&&!V.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function G(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}V.effects={effect:{}},N=["add","remove","toggle"],E={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},V.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){V.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(d.style(t.elem,e,t.end),t.setAttr=!0)}}),V.fn.addBack||(V.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),V.effects.animateClass=function(n,t,e,i){var o=V.speed(t,e,i);return this.queue(function(){var i=V(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:V(this),start:U(this)}}),s=function(){V.each(N,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=U(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(E[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:(O=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):O.apply(this,arguments)}),removeClass:(A=V.fn.removeClass,function(t,e,i,s){return 1<arguments.length?V.effects.animateClass.call(this,{remove:t},e,i,s):A.apply(this,arguments)}),toggleClass:(z=V.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?V.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):z.apply(this,arguments):V.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return V.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),V.expr&&V.expr.pseudos&&V.expr.pseudos.animated&&(V.expr.pseudos.animated=(W=V.expr.pseudos.animated,function(t){return!!V(t).data(K)||W(t)})),!1!==V.uiBackCompat&&V.extend(V.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(j+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(j+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=V("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(q,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(q)||"",t.removeData(q)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=V("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=j+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),V.fn.extend({effect:function(){function t(t){var e=V(this),i=V.effects.mode(e,r)||o;e.data(K,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||V.effects.saveStyle(e),"function"==typeof t&&t()}var s=X.apply(this,arguments),n=V.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return V.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=V(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===V.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(K),V.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(R=V.fn.show,function(t){if($(t))return R.apply(this,arguments);t=X.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(L=V.fn.hide,function(t){if($(t))return L.apply(this,arguments);t=X.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(F=V.fn.toggle,function(t){if($(t)||"boolean"==typeof t)return F.apply(this,arguments);t=X.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return V.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):G(this.css("clip"),this)},transfer:function(t,e){var i=V(this),s=V(t.to),n="fixed"===s.css("position"),o=V("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=V("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=G(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},Y={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){Y[t]=function(t){return Math.pow(t,e+2)}}),V.extend(Y,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(Y,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});y=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g<c;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),V.effects.unshift(n,t,1+o)}),V.effects.define("clip","hide",function(t,e){var i={},s=V(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},V.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("drop","hide",function(t,e){var i=V(this),s="show"===t.mode,n=t.direction||"left",o="up"===n||"down"===n?"top":"left",a="up"===n||"left"===n?"-=":"+=",r="+="==a?"-=":"+=",l={opacity:0};V.effects.createPlaceholder(i),n=t.distance||i["top"==o?"outerHeight":"outerWidth"](!0)/2,l[o]=a+n,s&&(i.css(l),l[o]=r+n,l.opacity=1),i.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=V(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/h),f=Math.ceil(c.outerHeight()/l),g=[];function m(){g.push(this),g.length===l*h&&(c.css({visibility:"visible"}),V(g).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*f,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*p,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l<o;l++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),V.effects.unshift(i,s,1+o)}),V.effects.define("shake",function(t,e){var i=1,s=V(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,l=Math.round(t.duration/r),h="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},n=s.queue().length;for(V.effects.createPlaceholder(s),u[h]=(c?"-=":"+=")+o,d[h]=(c?"+=":"-=")+2*o,p[h]=(c?"-=":"+=")+2*o,s.animate(u,l,t.easing);i<a;i++)s.animate(d,l,t.easing).animate(p,l,t.easing);s.animate(d,l,t.easing).animate(u,l/2,t.easing).queue(e),V.effects.unshift(s,n,1+r)}),V.effects.define("slide","show",function(t,e){var i,s,n=V(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};V.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),y=!1!==V.uiBackCompat?V.effects.define("transfer",function(t,e){V(this).transfer(t,e)}):y;V.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=V("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=V(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&V(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(V(t)))},V.extend(V.expr.pseudos,{focusable:function(t){return V.ui.focusable(t,null!=V.attr(t,"tabindex"))}});var Q,J;V.ui.focusable,V.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):V(this[0].form)},V.ui.formResetMixin={_formResetHandler:function(){var e=V(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");V.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(V.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};V.expr.pseudos||(V.expr.pseudos=V.expr[":"]),V.uniqueSort||(V.uniqueSort=V.unique),V.escapeSelector||(Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,J=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},V.escapeSelector=function(t){return(t+"").replace(Q,J)}),V.fn.even&&V.fn.odd||V.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});var Z;V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+V.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},V.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=V(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:V(this[0].ownerDocument||document)},V.extend(V.expr.pseudos,{tabbable:function(t){var e=V.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&V.ui.focusable(t,i)}}),V.fn.extend({uniqueId:(Z=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++Z)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}}),V.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),V.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},V.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=V.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:V(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!V(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=V(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=V(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||V(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(V(this).children(".ui-menu-item-wrapper").text()))})}});V.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:V.map(t,function(t){return"string"==typeof t?{label:t,value:t}:V.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(V.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;V.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return V("<li>").append(V("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(e))},100))}});V.ui.autocomplete;var tt=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(tt,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V("<span>"),this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var et;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===V.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=V("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==V.uiBackCompat&&(V.widget("ui.button",V.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),V.fn.button=(et=V.fn.button,function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t=V(this).attr("type"),e=V.data(this,"ui-"+("checkbox"!==t&&"radio"!==t?"button":"checkboxradio"));return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for button widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V(this).attr("type"),e="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",t=V.data(this,"ui-"+e);t?(t.option(i||{}),t._init&&t._init()):"button"!=e?V(this).checkboxradio(V.extend({icon:!1},i)):et.call(V(this),i)})),n}),V.fn.buttonset=function(){return V.ui.controlgroup||V.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var it;V.ui.button;function st(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=nt(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function nt(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,ot)}function ot(){V.datepicker._isDisabledDatepicker((it.inline?it.dpDiv.parent():it.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function at(t,e){for(var i in V.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(st.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return at(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(V(t),n)).settings=V.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?nt(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=V(t);e.append=V([]),e.trigger=V([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),V.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=V("<span>").addClass(this._appendClass).text(s),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),this._get(e,"buttonImageOnly")?e.trigger=V("<img>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):(e.trigger=V("<button type='button'>").addClass(this._triggerClass),i?e.trigger.html(V("<img>").attr({src:i,alt:s,title:s})):e.trigger.text(s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===t[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==t[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=V(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),V.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",a)),at(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=V(t),s=V.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),V.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),it===s&&(it=null,this._curInst=null))},_enableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return V.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?V.extend({},V.datepicker._defaults):o?"all"===e?V.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),e=this._getMinMaxDate(o,"min"),i=this._getMinMaxDate(o,"max"),at(o.settings,s),null!==e&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,e)),null!==i&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,i)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(V(t),o),this._autoSize(o),this._setDate(o,n),this._updateAlternate(o),this._updateDatepicker(o))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=V.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,V.datepicker._datepickerShowing)switch(t.keyCode){case 9:V.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",s.dpDiv))[0]&&V.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=V.datepicker._get(s,"onSelect"))?(i=V.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&V.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&V.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?V.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=V.datepicker._getInst(t.target);if(V.datepicker._get(i,"constrainInput"))return e=V.datepicker._possibleChars(V.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){t=V.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{V.datepicker.parseDate(V.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,V.datepicker._getFormatConfig(t))&&(V.datepicker._setDateFromField(t),V.datepicker._updateAlternate(t),V.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=V("input",t.parentNode)[0]),V.datepicker._isDisabledDatepicker(t)||V.datepicker._lastInput===t||(n=V.datepicker._getInst(t),V.datepicker._curInst&&V.datepicker._curInst!==n&&(V.datepicker._curInst.dpDiv.stop(!0,!0),n&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(i=(s=V.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(at(n.settings,i),n.lastVal=null,V.datepicker._lastInput=t,V.datepicker._setDateFromField(n),V.datepicker._inDialog&&(t.value=""),V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(t),V.datepicker._pos[1]+=t.offsetHeight),e=!1,V(t).parents().each(function(){return!(e|="fixed"===V(this).css("position"))}),s={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(n),s=V.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=V.datepicker._get(n,"showAnim"),s=V.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(V(t))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[i]?n.dpDiv.show(i,V.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),V.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),V.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(it=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a"),o=V.datepicker._get(t,"onUpdateDatepicker");0<n.length&&ot.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),e=t.yearshtml=null},0)),o&&o.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:V(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:V(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?V(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?V(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||V.expr.pseudos.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=V(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==V.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){V.datepicker._tidyDialog(s)},V.effects&&(V.effects.effect[e]||V.effects[e])?s.dpDiv.hide(e,V.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;V.datepicker._curInst&&(e=V(t.target),t=V.datepicker._getInst(e[0]),(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!e.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===t)||V.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=V(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e,i),this._updateDatepicker(t))},_gotoToday:function(t){var e=V(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=V(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=V(t);V(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=parseInt(V("a",s).attr("data-date")),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=V(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=V(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),V(document).find(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o,a=0,r=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,r="string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10),l=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,c=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,u=(t?t.monthNames:null)||this._defaults.monthNames,d=-1,p=-1,f=-1,g=-1,m=!1,_=function(t){t=w+1<e.length&&e.charAt(w+1)===t;return t&&w++,t},v=function(t){var e=_(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(a).match(e);if(!e)throw"Missing number at position "+a;return a+=e[0].length,parseInt(e[0],10)},b=function(t,e,i){var s=-1,e=V.map(_(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(V.each(e,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase())return s=e[0],a+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+a},y=function(){if(n.charAt(a)!==e.charAt(w))throw"Unexpected literal at position "+a;a++},w=0;w<e.length;w++)if(m)"'"!==e.charAt(w)||_("'")?y():m=!1;else switch(e.charAt(w)){case"d":f=v("d");break;case"D":b("D",l,h);break;case"o":g=v("o");break;case"m":p=v("m");break;case"M":p=b("M",c,u);break;case"y":d=v("y");break;case"@":d=(o=new Date(v("@"))).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"!":d=(o=new Date((v("!")-this._ticksTo1970)/1e4)).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"'":_("'")?y():m=!0;break;default:y()}if(a<n.length&&(s=n.substr(a),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===d?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=r?0:-100)),-1<g)for(p=1,f=g;;){if(f<=(i=this._getDaysInMonth(d,p-1)))break;p++,f-=i}if((o=this._daylightSavingAdjust(new Date(d,p-1,f))).getFullYear()!==d||o.getMonth()+1!==p||o.getDate()!==f)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,h=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),l,h);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return V.datepicker.parseDate(V.datepicker._get(r,"dateFormat"),t,V.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?V.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){V.datepicker._adjustDate(i,-e,"M")},next:function(){V.datepicker._adjustDate(i,+e,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(i)},selectDay:function(){return V.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(i,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,x,k,C,D,I,T,P,M,S,H,z,A=new Date,O=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),N=this._get(t,"isRTL"),E=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),F=this._get(t,"navigationAsDateFormat"),L=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),A=this._get(t,"stepMonths"),Y=1!==L[0]||1!==L[1],B=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),j=this._getMinMaxDate(t,"min"),q=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),q)for(e=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-L[0]*L[1]+1,q.getDate())),e=j&&e<j?j:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-A,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML,R=this._get(t,"nextText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+A,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:R}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML,A=this._get(t,"currentText"),W=this._get(t,"gotoCurrent")&&t.currentDay?B:O,A=F?this.formatDate(A,W,this._getFormatConfig(t)):A,R="",t.inline||(R=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),F="",E&&(F=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(N?R:"").append(this._isInRange(t,W)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(N?"":R)[0].outerHTML),n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),a=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),c=this._get(t,"beforeShowDay"),u=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<L[0];m++){for(_="",this.maxRows=4,v=0;v<L[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),y=" ui-corner-all",w="",Y){if(w+="<div class='ui-datepicker-group",1<L[1])switch(v){case 0:w+=" ui-datepicker-group-first",y=" ui-corner-"+(N?"right":"left");break;case L[1]-1:w+=" ui-datepicker-group-last",y=" ui-corner-"+(N?"left":"right");break;default:w+=" ui-datepicker-group-middle",y=""}w+="'>"}for(w+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===m?N?s:i:"")+(/all|right/.test(y)&&0===m?N?i:s:"")+this._generateMonthYearHeader(t,K,U,j,q,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)x+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+a[k=(g+n)%7]+"'>"+r[k]+"</span></th>";for(w+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P<I;P++){for(w+="<tr>",M=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(T)+"</td>":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T<j||q&&q<T,M+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(T.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===T.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(z?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!u?"":" "+S[1]+(T.getTime()===B.getTime()?" "+this._currentClass:"")+(T.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(H&&!u||!S[2]?"":" title='"+S[2].replace(/'/g,"&#39;")+"'")+(z?"":" data-handler='selectDay' data-event='click' data-month='"+T.getMonth()+"' data-year='"+T.getFullYear()+"'")+">"+(H&&!u?"&#xa0;":z?"<span class='ui-state-default'>"+T.getDate()+"</span>":"<a class='ui-state-default"+(T.getTime()===O.getTime()?" ui-state-highlight":"")+(T.getTime()===B.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#' aria-current='"+(T.getTime()===B.getTime()?"true":"false")+"' data-date='"+T.getDate()+"'>"+T.getDate()+"</a>")+"</td>",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+"</tr>"}11<++K&&(K=0,U++),_+=w+="</tbody></table>"+(Y?"</div>"+(0<L[0]&&v===L[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="<div class='ui-datepicker-title'>",y="";if(o||!f)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+_+"' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!l||c>=s.getMonth())&&(!h||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(m||(b+=y+(!o&&f&&g?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!g)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' aria-label='"+v+"' data-handler='selectYear' data-event='change'>";d<=p;d++)t.yearshtml+="<option value='"+d+"'"+(d===i?" selected='selected'":"")+">"+d+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,o=null,a=this._get(t,"yearRange");return a&&(t=a.split(":"),a=(new Date).getFullYear(),n=parseInt(t[0],10),o=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=a),t[1].match(/[+\-].*/)&&(o+=a)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new st,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker,V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var rt=!1;V(document).on("mouseup",function(){rt=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!rt){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),rt=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,rt=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},V.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&V(t).trigger("blur")};V.widget("ui.draggable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<V(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=V(this);return V("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===V(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),V.ui.ddmanager&&!e.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),V.ui.ddmanager&&V.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new V.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return V.ui.ddmanager&&!this.options.dropBehaviour&&(i=V.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,i)?V(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),V.ui.ddmanager&&V.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),V.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new V.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!V(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i="function"==typeof e.helper,t=i?V(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=V(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,V(n).width()-this.helperProportions.width-this.margins.left,(V(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[V(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,V(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,V(window).scrollLeft()+V(window).width()-this.helperProportions.width-this.margins.left,V(window).scrollTop()+(V(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-V(a).scrollTop()<s.scrollSensitivity?n=V(a).scrollTop(V(a).scrollTop()-s.scrollSpeed):V(window).height()-(t.pageY-V(a).scrollTop())<s.scrollSensitivity&&(n=V(a).scrollTop(V(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-V(a).scrollLeft()<s.scrollSensitivity?n=V(a).scrollLeft(V(a).scrollLeft()-s.scrollSpeed):V(window).width()-(t.pageX-V(a).scrollLeft())<s.scrollSensitivity&&(n=V(a).scrollLeft(V(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&V.ui.ddmanager&&!s.dropBehaviour&&V.ui.ddmanager.prepareOffsets(i,t)}}),V.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],V(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=V(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,l,h,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||c+p<m||!V.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),V.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=V.makeArray(V(i.stack)).sort(function(t,e){return(parseInt(V(t).css("zIndex"),10)||0)-(parseInt(V(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(V(i[0]).css("zIndex"),10)||0,V(i).each(function(t){V(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),V.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&V(e.helper).css("zIndex",i._zIndex)}});V.ui.draggable;V.widget("ui.resizable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===V(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),V.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(V("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=String.prototype.trim.call(i[e])),n=V("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||V("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0},r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=o.top-u):(p=h-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=o.left-c):(d=l-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});V.ui.resizable;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("<button type='button'></button>").button({label:V("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=V("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog;function lt(t,e,i){return e<=t&&t<e+i}V.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){V.ui.ddmanager.droppables[t]=V.ui.ddmanager.droppables[t]||[],V.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=V.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept="function"==typeof e?e:function(t){return t.is(e)}:"scope"===t&&(i=V.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=V.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=V.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||V.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=V(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&V.ui.intersect(i,V.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),V.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,c=l+e.proportions().width,u=h+e.proportions().height;switch(i){case"fit":return l<=n&&a<=c&&h<=o&&r<=u;case"intersect":return l<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&h<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return lt(s.pageY,h,e.proportions().height)&&lt(s.pageX,l,e.proportions().width);case"touch":return(h<=o&&o<=u||h<=r&&r<=u||o<h&&u<r)&&(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a);default:return!1}},!(V.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=V.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return V.each((V.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&V.ui.intersect(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&V.ui.ddmanager.prepareOffsets(n,o),V.each(V.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=V.ui.intersect(n,this,this.options.tolerance,o))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return V(this).droppable("instance").options.scope===e})).length&&((t=V(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)}})!==V.uiBackCompat&&V.widget("ui.droppable",V.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});V.ui.droppable,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return l<a&&(t=l,l=a,a=t),h<r&&(t=h,h=r,r=t),this.helper.css({left:a,top:r,width:l-a,height:h-r}),this.selectees.each(function(){var t=V.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>l||i.right<a||i.top>h||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<l&&i.top>r&&i.bottom<h),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,V(".ui-unselecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),V(".ui-selecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=V("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(V.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=V("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";V.each(t,function(t,e){var i;e.optgroup!==o&&(i=V("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=V("<li>"),s=V("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.trigger("focus"))},_documentClick:{mousedown:function(t){this.isOpen&&(V(t.target).closest(".ui-selectmenu-menu, #"+V.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case V.ui.keyCode.TAB:case V.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case V.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case V.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case V.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case V.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case V.ui.keyCode.LEFT:this._move("prev",t);break;case V.ui.keyCode.RIGHT:this._move("next",t);break;case V.ui.keyCode.HOME:case V.ui.keyCode.PAGE_UP:this._move("first",t);break;case V.ui.keyCode.END:case V.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){e.hidden||s.push(i._parseOption(V(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),V.widget("ui.slider",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(V(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){V(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=V("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),a={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(a),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=V(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!V(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!Array.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,l=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",V(this).stop(1,1)[l?"animate":"css"](h,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=V(t.target).data("ui-slider-handle-index");switch(t.keyCode){case V.ui.keyCode.HOME:case V.ui.keyCode.END:case V.ui.keyCode.PAGE_UP:case V.ui.keyCode.PAGE_DOWN:case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(V(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case V.ui.keyCode.HOME:i=this._valueMin();break;case V.ui.keyCode.END:i=this._valueMax();break;case V.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=V(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(V(t.target),null,"ui-state-active"))}}}),V.widget("ui.sortable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),V.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),V(t.target).parents().each(function(){if(V.data(this,n.widgetName+"-item")===n)return i=V(this),!1}),!!(i=V.data(t.target,n.widgetName+"-item")===n?V(t.target):i)&&(!(this.options.handle&&!e&&(V(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=V("parent"!==o.appendTo?o.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},V.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),V.extend(this.offset,{parent:this._getParentOffset()}),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=V("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,n,o=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),o.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||V.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&V.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return V.ui.ddmanager&&!this.options.dropBehaviour&&V.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,V(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new V.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),V.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?V(this.domPosition.prev).after(this.currentItem):V(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},V(t).each(function(){var t=(V(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(V(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,h="x"===this.options.axis||r<s+h&&s+h<l,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=V(r[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push(["function"==typeof n.options.items?n.options.items.call(n.element):V(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){o.push(this)}for(a.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):V(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(l);return V(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=V.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,l,h=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):V(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=V(u[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],t,{item:this.currentItem}):V(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],l=(a=c[e][i=0]).length;i<l;i++)(r=V(a[i])).data(this.widgetName+"-item",o),h.push({item:r,instance:o,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?V(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,n=i.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var t=V("<"+n+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("<tr>",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V("<td>&#160;</td>",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)<i&&(i=Math.abs(t[h]-a),s=this.items[e],this.direction=r?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[u]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?V(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&V.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=V(i.containment)[0],e=V(i.containment).offset(),i="hidden"!==V(t).css("overflow"),this.containment=[e.left+(parseInt(V(t).css("borderLeftWidth"),10)||0)+(parseInt(V(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(V(t).css("borderTopWidth"),10)||0)+(parseInt(V(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(V(t).css("borderLeftWidth"),10)||0)-(parseInt(V(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(V(t).css("borderTopWidth"),10)||0)-(parseInt(V(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===V.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||V([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});function ht(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}V.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===V.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===V.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(V(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=V.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?"function"==typeof e?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:ht(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:ht(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:ht(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:ht(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:ht(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());ht(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==V.uiBackCompat&&V.widget("ui.spinner",V.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var ct;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(ct=/#.*$/,function(t){var e=t.href.replace(ct,""),i=location.href.replace(ct,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=V.uniqueSort(t.disabled.concat(V.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=V(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(V(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):V()}},_tabKeydown:function(t){var e=V(V.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:i++;break;case V.ui.keyCode.UP:case V.ui.keyCode.LEFT:s=!1,i--;break;case V.ui.keyCode.END:i=this.anchors.length-1;break;case V.ui.keyCode.HOME:i=0;break;case V.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case V.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===V.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===V.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===V.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==V.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("<div>").attr("role","tooltip"),i=V("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip});;
/* http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery.ui.datepicker-de.js*/
/* German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail@milianw.de). */
jQuery(function ($) {
    $.datepicker.regional['de-DE'] = {
        closeText: 'schließen',
        prevText: '&#x3c;zurück',
        nextText: 'Vor&#x3e;',
        currentText: 'heute',
        monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
		'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
        monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
        dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
        dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
        dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
        weekHeader: 'Wo',
        dateFormat: 'dd.mm.yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''
    };
    $.datepicker.setDefaults($.datepicker.regional['de-DE']);
});;
/* Source http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery.ui.datepicker-en-GB.js*/
/* English/UK initialisation for the jQuery UI date picker plugin. */
/* Written by Stuart. */
jQuery(function($){
	$.datepicker.regional['en-GB'] = {
		closeText: 'Done',
		prevText: 'Prev',
		nextText: 'Next',
		currentText: 'Today',
		monthNames: ['January','February','March','April','May','June',
		'July','August','September','October','November','December'],
		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
		weekHeader: 'Wk',
		dateFormat: 'dd/mm/yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['en-GB']);
});
;
/*http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery.ui.datepicker-fr.js*/
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function ($) {
    $.datepicker.regional['fr-CA'] = {
        closeText: 'Fermer',
        prevText: '&#x3c;Préc',
        nextText: 'Suiv&#x3e;',
        currentText: 'Courant',
        monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
		'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
        monthNamesShort: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun',
		'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'],
        dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
        dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
        dayNamesMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
        weekHeader: 'Sm',
        dateFormat: 'dd/mm/yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''
    };
    $.datepicker.setDefaults($.datepicker.regional['fr-CA']);
});;
/*http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery.ui.datepicker-fr.js*/
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function ($) {
    $.datepicker.regional['fr-FR'] = {
        closeText: 'Fermer',
        prevText: '&#x3c;Préc',
        nextText: 'Suiv&#x3e;',
        currentText: 'Courant',
        monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
		'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
        monthNamesShort: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun',
		'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'],
        dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
        dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
        dayNamesMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
        weekHeader: 'Sm',
        dateFormat: 'dd/mm/yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''
    };
    $.datepicker.setDefaults($.datepicker.regional['fr-FR']);
});;
/*!
 * Modernizr v2.8.3
 * www.modernizr.com
 *
 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
 * Available under the BSD and MIT licenses: www.modernizr.com/license/
 */

/*
 * Modernizr tests which native CSS3 and HTML5 features are available in
 * the current UA and makes the results available to you in two ways:
 * as properties on a global Modernizr object, and as classes on the
 * <html> element. This information allows you to progressively enhance
 * your pages with a granular level of control over the experience.
 *
 * Modernizr has an optional (not included) conditional resource loader
 * called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
 * To get a build that includes Modernizr.load(), as well as choosing
 * which tests to include, go to www.modernizr.com/download/
 *
 * Authors        Faruk Ates, Paul Irish, Alex Sexton
 * Contributors   Ryan Seddon, Ben Alman
 */

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.8.3',

    Modernizr = {},

    /*>>cssclasses*/
    // option for enabling the HTML classes to be added
    enableClasses = true,
    /*>>cssclasses*/

    docElement = document.documentElement,

    /**
     * Create our "modernizr" element that we do most feature tests on.
     */
    mod = 'modernizr',
    modElem = document.createElement(mod),
    mStyle = modElem.style,

    /**
     * Create the input element for various Web Forms feature tests.
     */
    inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,

    /*>>smile*/
    smile = ':)',
    /*>>smile*/

    toString = {}.toString,

    // TODO :: make the prefixes more granular
    /*>>prefixes*/
    // List of property values to set for css tests. See ticket #21
    prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
    /*>>prefixes*/

    /*>>domprefixes*/
    // Following spec is to expose vendor-specific style properties as:
    //   elem.style.WebkitBorderRadius
    // and the following would be incorrect:
    //   elem.style.webkitBorderRadius

    // Webkit ghosts their properties in lowercase but Opera & Moz do not.
    // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
    //   erik.eae.net/archives/2008/03/10/21.48.10/

    // More here: github.com/Modernizr/Modernizr/issues/issue/21
    omPrefixes = 'Webkit Moz O ms',

    cssomPrefixes = omPrefixes.split(' '),

    domPrefixes = omPrefixes.toLowerCase().split(' '),
    /*>>domprefixes*/

    /*>>ns*/
    ns = {'svg': 'http://www.w3.org/2000/svg'},
    /*>>ns*/

    tests = {},
    inputs = {},
    attrs = {},

    classes = [],

    slice = classes.slice,

    featureName, // used in testing loop


    /*>>teststyles*/
    // Inject element with style element and some CSS rules
    injectElementWithStyles = function( rule, callback, nodes, testnames ) {

      var style, ret, node, docOverflow,
          div = document.createElement('div'),
          // After page load injecting a fake body doesn't work so check if body exists
          body = document.body,
          // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
          fakeBody = body || document.createElement('body');

      if ( parseInt(nodes, 10) ) {
          // In order not to give false positives we create a node for each test
          // This also allows the method to scale for unspecified uses
          while ( nodes-- ) {
              node = document.createElement('div');
              node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
              div.appendChild(node);
          }
      }

      // <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
      // when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
      // with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
      // msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
      // Documents served as xml will throw if using &shy; so use xml friendly encoded version. See issue #277
      style = ['&#173;','<style id="s', mod, '">', rule, '</style>'].join('');
      div.id = mod;
      // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
      // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
      (body ? div : fakeBody).innerHTML += style;
      fakeBody.appendChild(div);
      if ( !body ) {
          //avoid crashing IE8, if background image is used
          fakeBody.style.background = '';
          //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
          fakeBody.style.overflow = 'hidden';
          docOverflow = docElement.style.overflow;
          docElement.style.overflow = 'hidden';
          docElement.appendChild(fakeBody);
      }

      ret = callback(div, rule);
      // If this is done after page load we don't want to remove the body so check if body exists
      if ( !body ) {
          fakeBody.parentNode.removeChild(fakeBody);
          docElement.style.overflow = docOverflow;
      } else {
          div.parentNode.removeChild(div);
      }

      return !!ret;

    },
    /*>>teststyles*/

    /*>>mq*/
    // adapted from matchMedia polyfill
    // by Scott Jehl and Paul Irish
    // gist.github.com/786768
    testMediaQuery = function( mq ) {

      var matchMedia = window.matchMedia || window.msMatchMedia;
      if ( matchMedia ) {
        return matchMedia(mq) && matchMedia(mq).matches || false;
      }

      var bool;

      injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
        bool = (window.getComputedStyle ?
                  getComputedStyle(node, null) :
                  node.currentStyle)['position'] == 'absolute';
      });

      return bool;

     },
     /*>>mq*/


    /*>>hasevent*/
    //
    // isEventSupported determines if a given element supports the given event
    // kangax.github.com/iseventsupported/
    //
    // The following results are known incorrects:
    //   Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
    //   Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
    //   ...
    isEventSupported = (function() {

      var TAGNAMES = {
        'select': 'input', 'change': 'input',
        'submit': 'form', 'reset': 'form',
        'error': 'img', 'load': 'img', 'abort': 'img'
      };

      function isEventSupported( eventName, element ) {

        element = element || document.createElement(TAGNAMES[eventName] || 'div');
        eventName = 'on' + eventName;

        // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
        var isSupported = eventName in element;

        if ( !isSupported ) {
          // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
          if ( !element.setAttribute ) {
            element = document.createElement('div');
          }
          if ( element.setAttribute && element.removeAttribute ) {
            element.setAttribute(eventName, '');
            isSupported = is(element[eventName], 'function');

            // If property was created, "remove it" (by setting value to `undefined`)
            if ( !is(element[eventName], 'undefined') ) {
              element[eventName] = undefined;
            }
            element.removeAttribute(eventName);
          }
        }

        element = null;
        return isSupported;
      }
      return isEventSupported;
    })(),
    /*>>hasevent*/

    // TODO :: Add flag for hasownprop ? didn't last time

    // hasOwnProperty shim by kangax needed for Safari 2.0 support
    _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;

    if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
      hasOwnProp = function (object, property) {
        return _hasOwnProperty.call(object, property);
      };
    }
    else {
      hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
        return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
      };
    }

    // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
    // es5.github.com/#x15.3.4.5

    if (!Function.prototype.bind) {
      Function.prototype.bind = function bind(that) {

        var target = this;

        if (typeof target != "function") {
            throw new TypeError();
        }

        var args = slice.call(arguments, 1),
            bound = function () {

            if (this instanceof bound) {

              var F = function(){};
              F.prototype = target.prototype;
              var self = new F();

              var result = target.apply(
                  self,
                  args.concat(slice.call(arguments))
              );
              if (Object(result) === result) {
                  return result;
              }
              return self;

            } else {

              return target.apply(
                  that,
                  args.concat(slice.call(arguments))
              );

            }

        };

        return bound;
      };
    }

    /**
     * setCss applies given styles to the Modernizr DOM node.
     */
    function setCss( str ) {
        mStyle.cssText = str;
    }

    /**
     * setCssAll extrapolates all vendor-specific css strings.
     */
    function setCssAll( str1, str2 ) {
        return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
    }

    /**
     * is returns a boolean for if typeof obj is exactly type.
     */
    function is( obj, type ) {
        return typeof obj === type;
    }

    /**
     * contains returns a boolean for if substr is found within str.
     */
    function contains( str, substr ) {
        return !!~('' + str).indexOf(substr);
    }

    /*>>testprop*/

    // testProps is a generic CSS / DOM property test.

    // In testing support for a given CSS property, it's legit to test:
    //    `elem.style[styleName] !== undefined`
    // If the property is supported it will return an empty string,
    // if unsupported it will return undefined.

    // We'll take advantage of this quick test and skip setting a style
    // on our modernizr element, but instead just testing undefined vs
    // empty string.

    // Because the testing of the CSS property names (with "-", as
    // opposed to the camelCase DOM properties) is non-portable and
    // non-standard but works in WebKit and IE (but not Gecko or Opera),
    // we explicitly reject properties with dashes so that authors
    // developing in WebKit or IE first don't end up with
    // browser-specific content by accident.

    function testProps( props, prefixed ) {
        for ( var i in props ) {
            var prop = props[i];
            if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
                return prefixed == 'pfx' ? prop : true;
            }
        }
        return false;
    }
    /*>>testprop*/

    // TODO :: add testDOMProps
    /**
     * testDOMProps is a generic DOM property test; if a browser supports
     *   a certain property, it won't return undefined for it.
     */
    function testDOMProps( props, obj, elem ) {
        for ( var i in props ) {
            var item = obj[props[i]];
            if ( item !== undefined) {

                // return the property name as a string
                if (elem === false) return props[i];

                // let's bind a function
                if (is(item, 'function')){
                  // default to autobind unless override
                  return item.bind(elem || obj);
                }

                // return the unbound function or obj or value
                return item;
            }
        }
        return false;
    }

    /*>>testallprops*/
    /**
     * testPropsAll tests a list of DOM properties we want to check against.
     *   We specify literally ALL possible (known and/or likely) properties on
     *   the element including the non-vendor prefixed one, for forward-
     *   compatibility.
     */
    function testPropsAll( prop, prefixed, elem ) {

        var ucProp  = prop.charAt(0).toUpperCase() + prop.slice(1),
            props   = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');

        // did they call .prefixed('boxSizing') or are we just testing a prop?
        if(is(prefixed, "string") || is(prefixed, "undefined")) {
          return testProps(props, prefixed);

        // otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
        } else {
          props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
          return testDOMProps(props, prefixed, elem);
        }
    }
    /*>>testallprops*/


    /**
     * Tests
     * -----
     */

    // The *new* flexbox
    // dev.w3.org/csswg/css3-flexbox

    tests['flexbox'] = function() {
      return testPropsAll('flexWrap');
    };

    // The *old* flexbox
    // www.w3.org/TR/2009/WD-css3-flexbox-20090723/

    tests['flexboxlegacy'] = function() {
        return testPropsAll('boxDirection');
    };

    // On the S60 and BB Storm, getContext exists, but always returns undefined
    // so we actually have to call getContext() to verify
    // github.com/Modernizr/Modernizr/issues/issue/97/

    tests['canvas'] = function() {
        var elem = document.createElement('canvas');
        return !!(elem.getContext && elem.getContext('2d'));
    };

    tests['canvastext'] = function() {
        return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
    };

    // webk.it/70117 is tracking a legit WebGL feature detect proposal

    // We do a soft detect which may false positive in order to avoid
    // an expensive context creation: bugzil.la/732441

    tests['webgl'] = function() {
        return !!window.WebGLRenderingContext;
    };

    /*
     * The Modernizr.touch test only indicates if the browser supports
     *    touch events, which does not necessarily reflect a touchscreen
     *    device, as evidenced by tablets running Windows 7 or, alas,
     *    the Palm Pre / WebOS (touch) phones.
     *
     * Additionally, Chrome (desktop) used to lie about its support on this,
     *    but that has since been rectified: crbug.com/36415
     *
     * We also test for Firefox 4 Multitouch Support.
     *
     * For more info, see: modernizr.github.com/Modernizr/touch.html
     */

    tests['touch'] = function() {
        var bool;

        if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
          bool = true;
        } else {
          injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
            bool = node.offsetTop === 9;
          });
        }

        return bool;
    };


    // geolocation is often considered a trivial feature detect...
    // Turns out, it's quite tricky to get right:
    //
    // Using !!navigator.geolocation does two things we don't want. It:
    //   1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
    //   2. Disables page caching in WebKit: webk.it/43956
    //
    // Meanwhile, in Firefox < 8, an about:config setting could expose
    // a false positive that would throw an exception: bugzil.la/688158

    tests['geolocation'] = function() {
        return 'geolocation' in navigator;
    };


    tests['postmessage'] = function() {
      return !!window.postMessage;
    };


    // Chrome incognito mode used to throw an exception when using openDatabase
    // It doesn't anymore.
    tests['websqldatabase'] = function() {
      return !!window.openDatabase;
    };

    // Vendors had inconsistent prefixing with the experimental Indexed DB:
    // - Webkit's implementation is accessible through webkitIndexedDB
    // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
    // For speed, we don't test the legacy (and beta-only) indexedDB
    tests['indexedDB'] = function() {
      return !!testPropsAll("indexedDB", window);
    };

    // documentMode logic from YUI to filter out IE8 Compat Mode
    //   which false positives.
    tests['hashchange'] = function() {
      return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
    };

    // Per 1.6:
    // This used to be Modernizr.historymanagement but the longer
    // name has been deprecated in favor of a shorter and property-matching one.
    // The old API is still available in 1.6, but as of 2.0 will throw a warning,
    // and in the first release thereafter disappear entirely.
    tests['history'] = function() {
      return !!(window.history && history.pushState);
    };

    tests['draganddrop'] = function() {
        var div = document.createElement('div');
        return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
    };

    // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
    // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
    // FF10 still uses prefixes, so check for it until then.
    // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
    tests['websockets'] = function() {
        return 'WebSocket' in window || 'MozWebSocket' in window;
    };


    // css-tricks.com/rgba-browser-support/
    tests['rgba'] = function() {
        // Set an rgba() color and check the returned value

        setCss('background-color:rgba(150,255,150,.5)');

        return contains(mStyle.backgroundColor, 'rgba');
    };

    tests['hsla'] = function() {
        // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
        //   except IE9 who retains it as hsla

        setCss('background-color:hsla(120,40%,100%,.5)');

        return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
    };

    tests['multiplebgs'] = function() {
        // Setting multiple images AND a color on the background shorthand property
        //  and then querying the style.background property value for the number of
        //  occurrences of "url(" is a reliable method for detecting ACTUAL support for this!

        setCss('background:url(https://),url(https://),red url(https://)');

        // If the UA supports multiple backgrounds, there should be three occurrences
        //   of the string "url(" in the return value for elemStyle.background

        return (/(url\s*\(.*?){3}/).test(mStyle.background);
    };



    // this will false positive in Opera Mini
    //   github.com/Modernizr/Modernizr/issues/396

    tests['backgroundsize'] = function() {
        return testPropsAll('backgroundSize');
    };

    tests['borderimage'] = function() {
        return testPropsAll('borderImage');
    };


    // Super comprehensive table about all the unique implementations of
    // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance

    tests['borderradius'] = function() {
        return testPropsAll('borderRadius');
    };

    // WebOS unfortunately false positives on this test.
    tests['boxshadow'] = function() {
        return testPropsAll('boxShadow');
    };

    // FF3.0 will false positive on this test
    tests['textshadow'] = function() {
        return document.createElement('div').style.textShadow === '';
    };


    tests['opacity'] = function() {
        // Browsers that actually have CSS Opacity implemented have done so
        //  according to spec, which means their return values are within the
        //  range of [0.0,1.0] - including the leading zero.

        setCssAll('opacity:.55');

        // The non-literal . in this regex is intentional:
        //   German Chrome returns this value as 0,55
        // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
        return (/^0.55$/).test(mStyle.opacity);
    };


    // Note, Android < 4 will pass this test, but can only animate
    //   a single property at a time
    //   goo.gl/v3V4Gp
    tests['cssanimations'] = function() {
        return testPropsAll('animationName');
    };


    tests['csscolumns'] = function() {
        return testPropsAll('columnCount');
    };


    tests['cssgradients'] = function() {
        /**
         * For CSS Gradients syntax, please see:
         * webkit.org/blog/175/introducing-css-gradients/
         * developer.mozilla.org/en/CSS/-moz-linear-gradient
         * developer.mozilla.org/en/CSS/-moz-radial-gradient
         * dev.w3.org/csswg/css3-images/#gradients-
         */

        var str1 = 'background-image:',
            str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
            str3 = 'linear-gradient(left top,#9f9, white);';

        setCss(
             // legacy webkit syntax (FIXME: remove when syntax not in use anymore)
              (str1 + '-webkit- '.split(' ').join(str2 + str1) +
             // standard syntax             // trailing 'background-image:'
              prefixes.join(str3 + str1)).slice(0, -str1.length)
        );

        return contains(mStyle.backgroundImage, 'gradient');
    };


    tests['cssreflections'] = function() {
        return testPropsAll('boxReflect');
    };


    tests['csstransforms'] = function() {
        return !!testPropsAll('transform');
    };


    tests['csstransforms3d'] = function() {

        var ret = !!testPropsAll('perspective');

        // Webkit's 3D transforms are passed off to the browser's own graphics renderer.
        //   It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
        //   some conditions. As a result, Webkit typically recognizes the syntax but
        //   will sometimes throw a false positive, thus we must do a more thorough check:
        if ( ret && 'webkitPerspective' in docElement.style ) {

          // Webkit allows this media query to succeed only if the feature is enabled.
          // `@media (transform-3d),(-webkit-transform-3d){ ... }`
          injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
            ret = node.offsetLeft === 9 && node.offsetHeight === 3;
          });
        }
        return ret;
    };


    tests['csstransitions'] = function() {
        return testPropsAll('transition');
    };


    /*>>fontface*/
    // @font-face detection routine by Diego Perini
    // javascript.nwbox.com/CSSSupport/

    // false positives:
    //   WebOS github.com/Modernizr/Modernizr/issues/342
    //   WP7   github.com/Modernizr/Modernizr/issues/538
    tests['fontface'] = function() {
        var bool;

        injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
          var style = document.getElementById('smodernizr'),
              sheet = style.sheet || style.styleSheet,
              cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';

          bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
        });

        return bool;
    };
    /*>>fontface*/

    // CSS generated content detection
    tests['generatedcontent'] = function() {
        var bool;

        injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
          bool = node.offsetHeight >= 3;
        });

        return bool;
    };



    // These tests evaluate support of the video/audio elements, as well as
    // testing what types of content they support.
    //
    // We're using the Boolean constructor here, so that we can extend the value
    // e.g.  Modernizr.video     // true
    //       Modernizr.video.ogg // 'probably'
    //
    // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
    //                     thx to NielsLeenheer and zcorpan

    // Note: in some older browsers, "no" was a return value instead of empty string.
    //   It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
    //   It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5

    tests['video'] = function() {
        var elem = document.createElement('video'),
            bool = false;

        // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('video/ogg; codecs="theora"')      .replace(/^no$/,'');

                // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
                bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');

                bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
            }

        } catch(e) { }

        return bool;
    };

    tests['audio'] = function() {
        var elem = document.createElement('audio'),
            bool = false;

        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
                bool.mp3  = elem.canPlayType('audio/mpeg;')               .replace(/^no$/,'');

                // Mimetypes accepted:
                //   developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
                //   bit.ly/iphoneoscodecs
                bool.wav  = elem.canPlayType('audio/wav; codecs="1"')     .replace(/^no$/,'');
                bool.m4a  = ( elem.canPlayType('audio/x-m4a;')            ||
                              elem.canPlayType('audio/aac;'))             .replace(/^no$/,'');
            }
        } catch(e) { }

        return bool;
    };


    // In FF4, if disabled, window.localStorage should === null.

    // Normally, we could not test that directly and need to do a
    //   `('localStorage' in window) && ` test first because otherwise Firefox will
    //   throw bugzil.la/365772 if cookies are disabled

    // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
    // will throw the exception:
    //   QUOTA_EXCEEDED_ERRROR DOM Exception 22.
    // Peculiarly, getItem and removeItem calls do not throw.

    // Because we are forced to try/catch this, we'll go aggressive.

    // Just FWIW: IE8 Compat mode supports these features completely:
    //   www.quirksmode.org/dom/html5.html
    // But IE8 doesn't support either with local files

    tests['localstorage'] = function() {
        try {
            localStorage.setItem(mod, mod);
            localStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };

    tests['sessionstorage'] = function() {
        try {
            sessionStorage.setItem(mod, mod);
            sessionStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };


    tests['webworkers'] = function() {
        return !!window.Worker;
    };


    tests['applicationcache'] = function() {
        return !!window.applicationCache;
    };


    // Thanks to Erik Dahlstrom
    tests['svg'] = function() {
        return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
    };

    // specifically for SVG inline in HTML, not within XHTML
    // test page: paulirish.com/demo/inline-svg
    tests['inlinesvg'] = function() {
      var div = document.createElement('div');
      div.innerHTML = '<svg/>';
      return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
    };

    // SVG SMIL animation
    tests['smil'] = function() {
        return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
    };

    // This test is only for clip paths in SVG proper, not clip paths on HTML content
    // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg

    // However read the comments to dig into applying SVG clippaths to HTML content here:
    //   github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
    tests['svgclippaths'] = function() {
        return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
    };

    /*>>webforms*/
    // input features and input types go directly onto the ret object, bypassing the tests loop.
    // Hold this guy to execute in a moment.
    function webforms() {
        /*>>input*/
        // Run through HTML5's new input attributes to see if the UA understands any.
        // We're using f which is the <input> element created early on
        // Mike Taylr has created a comprehensive resource for testing these attributes
        //   when applied to all input types:
        //   miketaylr.com/code/input-type-attr.html
        // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary

        // Only input placeholder is tested while textarea's placeholder is not.
        // Currently Safari 4 and Opera 11 have support only for the input placeholder
        // Both tests are available in feature-detects/forms-placeholder.js
        Modernizr['input'] = (function( props ) {
            for ( var i = 0, len = props.length; i < len; i++ ) {
                attrs[ props[i] ] = !!(props[i] in inputElem);
            }
            if (attrs.list){
              // safari false positive's on datalist: webk.it/74252
              // see also github.com/Modernizr/Modernizr/issues/146
              attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
            }
            return attrs;
        })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
        /*>>input*/

        /*>>inputtypes*/
        // Run through HTML5's new input types to see if the UA understands any.
        //   This is put behind the tests runloop because it doesn't return a
        //   true/false like all the other tests; instead, it returns an object
        //   containing each input type with its corresponding true/false value

        // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
        Modernizr['inputtypes'] = (function(props) {

            for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {

                inputElem.setAttribute('type', inputElemType = props[i]);
                bool = inputElem.type !== 'text';

                // We first check to see if the type we give it sticks..
                // If the type does, we feed it a textual value, which shouldn't be valid.
                // If the value doesn't stick, we know there's input sanitization which infers a custom UI
                if ( bool ) {

                    inputElem.value         = smile;
                    inputElem.style.cssText = 'position:absolute;visibility:hidden;';

                    if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {

                      docElement.appendChild(inputElem);
                      defaultView = document.defaultView;

                      // Safari 2-4 allows the smiley as a value, despite making a slider
                      bool =  defaultView.getComputedStyle &&
                              defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
                              // Mobile android web browser has false positive, so must
                              // check the height to see if the widget is actually there.
                              (inputElem.offsetHeight !== 0);

                      docElement.removeChild(inputElem);

                    } else if ( /^(search|tel)$/.test(inputElemType) ){
                      // Spec doesn't define any special parsing or detectable UI
                      //   behaviors so we pass these through as true

                      // Interestingly, opera fails the earlier test, so it doesn't
                      //  even make it here.

                    } else if ( /^(url|email)$/.test(inputElemType) ) {
                      // Real url and email support comes with prebaked validation.
                      bool = inputElem.checkValidity && inputElem.checkValidity() === false;

                    } else {
                      // If the upgraded input compontent rejects the :) text, we got a winner
                      bool = inputElem.value != smile;
                    }
                }

                inputs[ props[i] ] = !!bool;
            }
            return inputs;
        })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
        /*>>inputtypes*/
    }
    /*>>webforms*/


    // End of test definitions
    // -----------------------



    // Run through all tests and detect their support in the current UA.
    // todo: hypothetically we could be doing an array of tests and use a basic loop here.
    for ( var feature in tests ) {
        if ( hasOwnProp(tests, feature) ) {
            // run the test, throw the return value into the Modernizr,
            //   then based on that boolean, define an appropriate className
            //   and push it into an array of classes we'll join later.
            featureName  = feature.toLowerCase();
            Modernizr[featureName] = tests[feature]();

            classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
        }
    }

    /*>>webforms*/
    // input tests need to run.
    Modernizr.input || webforms();
    /*>>webforms*/


    /**
     * addTest allows the user to define their own feature tests
     * the result will be added onto the Modernizr object,
     * as well as an appropriate className set on the html element
     *
     * @param feature - String naming the feature
     * @param test - Function returning true if feature is supported, false if not
     */
     Modernizr.addTest = function ( feature, test ) {
       if ( typeof feature == 'object' ) {
         for ( var key in feature ) {
           if ( hasOwnProp( feature, key ) ) {
             Modernizr.addTest( key, feature[ key ] );
           }
         }
       } else {

         feature = feature.toLowerCase();

         if ( Modernizr[feature] !== undefined ) {
           // we're going to quit if you're trying to overwrite an existing test
           // if we were to allow it, we'd do this:
           //   var re = new RegExp("\\b(no-)?" + feature + "\\b");
           //   docElement.className = docElement.className.replace( re, '' );
           // but, no rly, stuff 'em.
           return Modernizr;
         }

         test = typeof test == 'function' ? test() : test;

         if (typeof enableClasses !== "undefined" && enableClasses) {
           docElement.className += ' ' + (test ? '' : 'no-') + feature;
         }
         Modernizr[feature] = test;

       }

       return Modernizr; // allow chaining.
     };


    // Reset modElem.cssText to nothing to reduce memory footprint.
    setCss('');
    modElem = inputElem = null;

    /*>>shiv*/
    /**
     * @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
     */
    ;(function(window, document) {
        /*jshint evil:true */
        /** version */
        var version = '3.7.0';

        /** Preset options */
        var options = window.html5 || {};

        /** Used to skip problem elements */
        var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;

        /** Not all elements can be cloned in IE **/
        var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;

        /** Detect whether the browser supports default html5 styles */
        var supportsHtml5Styles;

        /** Name of the expando, to work with multiple documents or to re-shiv one document */
        var expando = '_html5shiv';

        /** The id for the the documents expando */
        var expanID = 0;

        /** Cached data for each document */
        var expandoData = {};

        /** Detect whether the browser supports unknown elements */
        var supportsUnknownElements;

        (function() {
          try {
            var a = document.createElement('a');
            a.innerHTML = '<xyz></xyz>';
            //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
            supportsHtml5Styles = ('hidden' in a);

            supportsUnknownElements = a.childNodes.length == 1 || (function() {
              // assign a false positive if unable to shiv
              (document.createElement)('a');
              var frag = document.createDocumentFragment();
              return (
                typeof frag.cloneNode == 'undefined' ||
                typeof frag.createDocumentFragment == 'undefined' ||
                typeof frag.createElement == 'undefined'
              );
            }());
          } catch(e) {
            // assign a false positive if detection fails => unable to shiv
            supportsHtml5Styles = true;
            supportsUnknownElements = true;
          }

        }());

        /*--------------------------------------------------------------------------*/

        /**
         * Creates a style sheet with the given CSS text and adds it to the document.
         * @private
         * @param {Document} ownerDocument The document.
         * @param {String} cssText The CSS text.
         * @returns {StyleSheet} The style element.
         */
        function addStyleSheet(ownerDocument, cssText) {
          var p = ownerDocument.createElement('p'),
          parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;

          p.innerHTML = 'x<style>' + cssText + '</style>';
          return parent.insertBefore(p.lastChild, parent.firstChild);
        }

        /**
         * Returns the value of `html5.elements` as an array.
         * @private
         * @returns {Array} An array of shived element node names.
         */
        function getElements() {
          var elements = html5.elements;
          return typeof elements == 'string' ? elements.split(' ') : elements;
        }

        /**
         * Returns the data associated to the given document
         * @private
         * @param {Document} ownerDocument The document.
         * @returns {Object} An object of data.
         */
        function getExpandoData(ownerDocument) {
          var data = expandoData[ownerDocument[expando]];
          if (!data) {
            data = {};
            expanID++;
            ownerDocument[expando] = expanID;
            expandoData[expanID] = data;
          }
          return data;
        }

        /**
         * returns a shived element for the given nodeName and document
         * @memberOf html5
         * @param {String} nodeName name of the element
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived element.
         */
        function createElement(nodeName, ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createElement(nodeName);
          }
          if (!data) {
            data = getExpandoData(ownerDocument);
          }
          var node;

          if (data.cache[nodeName]) {
            node = data.cache[nodeName].cloneNode();
          } else if (saveClones.test(nodeName)) {
            node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
          } else {
            node = data.createElem(nodeName);
          }

          // Avoid adding some elements to fragments in IE < 9 because
          // * Attributes like `name` or `type` cannot be set/changed once an element
          //   is inserted into a document/fragment
          // * Link elements with `src` attributes that are inaccessible, as with
          //   a 403 response, will cause the tab/window to crash
          // * Script elements appended to fragments will execute when their `src`
          //   or `text` property is set
          return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
        }

        /**
         * returns a shived DocumentFragment for the given document
         * @memberOf html5
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived DocumentFragment.
         */
        function createDocumentFragment(ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createDocumentFragment();
          }
          data = data || getExpandoData(ownerDocument);
          var clone = data.frag.cloneNode(),
          i = 0,
          elems = getElements(),
          l = elems.length;
          for(;i<l;i++){
            clone.createElement(elems[i]);
          }
          return clone;
        }

        /**
         * Shivs the `createElement` and `createDocumentFragment` methods of the document.
         * @private
         * @param {Document|DocumentFragment} ownerDocument The document.
         * @param {Object} data of the document.
         */
        function shivMethods(ownerDocument, data) {
          if (!data.cache) {
            data.cache = {};
            data.createElem = ownerDocument.createElement;
            data.createFrag = ownerDocument.createDocumentFragment;
            data.frag = data.createFrag();
          }


          ownerDocument.createElement = function(nodeName) {
            //abort shiv
            if (!html5.shivMethods) {
              return data.createElem(nodeName);
            }
            return createElement(nodeName, ownerDocument, data);
          };

          ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
                                                          'var n=f.cloneNode(),c=n.createElement;' +
                                                          'h.shivMethods&&(' +
                                                          // unroll the `createElement` calls
                                                          getElements().join().replace(/[\w\-]+/g, function(nodeName) {
            data.createElem(nodeName);
            data.frag.createElement(nodeName);
            return 'c("' + nodeName + '")';
          }) +
            ');return n}'
                                                         )(html5, data.frag);
        }

        /*--------------------------------------------------------------------------*/

        /**
         * Shivs the given document.
         * @memberOf html5
         * @param {Document} ownerDocument The document to shiv.
         * @returns {Document} The shived document.
         */
        function shivDocument(ownerDocument) {
          if (!ownerDocument) {
            ownerDocument = document;
          }
          var data = getExpandoData(ownerDocument);

          if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
            data.hasCSS = !!addStyleSheet(ownerDocument,
                                          // corrects block display not defined in IE6/7/8/9
                                          'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
                                            // adds styling not present in IE6/7/8/9
                                            'mark{background:#FF0;color:#000}' +
                                            // hides non-rendered elements
                                            'template{display:none}'
                                         );
          }
          if (!supportsUnknownElements) {
            shivMethods(ownerDocument, data);
          }
          return ownerDocument;
        }

        /*--------------------------------------------------------------------------*/

        /**
         * The `html5` object is exposed so that more elements can be shived and
         * existing shiving can be detected on iframes.
         * @type Object
         * @example
         *
         * // options can be changed before the script is included
         * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
         */
        var html5 = {

          /**
           * An array or space separated string of node names of the elements to shiv.
           * @memberOf html5
           * @type Array|String
           */
          'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',

          /**
           * current version of html5shiv
           */
          'version': version,

          /**
           * A flag to indicate that the HTML5 style sheet should be inserted.
           * @memberOf html5
           * @type Boolean
           */
          'shivCSS': (options.shivCSS !== false),

          /**
           * Is equal to true if a browser supports creating unknown/HTML5 elements
           * @memberOf html5
           * @type boolean
           */
          'supportsUnknownElements': supportsUnknownElements,

          /**
           * A flag to indicate that the document's `createElement` and `createDocumentFragment`
           * methods should be overwritten.
           * @memberOf html5
           * @type Boolean
           */
          'shivMethods': (options.shivMethods !== false),

          /**
           * A string to describe the type of `html5` object ("default" or "default print").
           * @memberOf html5
           * @type String
           */
          'type': 'default',

          // shivs the document according to the specified `html5` object options
          'shivDocument': shivDocument,

          //creates a shived element
          createElement: createElement,

          //creates a shived documentFragment
          createDocumentFragment: createDocumentFragment
        };

        /*--------------------------------------------------------------------------*/

        // expose html5
        window.html5 = html5;

        // shiv the document
        shivDocument(document);

    }(this, document));
    /*>>shiv*/

    // Assign private properties to the return object with prefix
    Modernizr._version      = version;

    // expose these for the plugin API. Look in the source for how to join() them against your input
    /*>>prefixes*/
    Modernizr._prefixes     = prefixes;
    /*>>prefixes*/
    /*>>domprefixes*/
    Modernizr._domPrefixes  = domPrefixes;
    Modernizr._cssomPrefixes  = cssomPrefixes;
    /*>>domprefixes*/

    /*>>mq*/
    // Modernizr.mq tests a given media query, live against the current state of the window
    // A few important notes:
    //   * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
    //   * A max-width or orientation query will be evaluated against the current state, which may change later.
    //   * You must specify values. Eg. If you are testing support for the min-width media query use:
    //       Modernizr.mq('(min-width:0)')
    // usage:
    // Modernizr.mq('only screen and (max-width:768)')
    Modernizr.mq            = testMediaQuery;
    /*>>mq*/

    /*>>hasevent*/
    // Modernizr.hasEvent() detects support for a given event, with an optional element to test on
    // Modernizr.hasEvent('gesturestart', elem)
    Modernizr.hasEvent      = isEventSupported;
    /*>>hasevent*/

    /*>>testprop*/
    // Modernizr.testProp() investigates whether a given style property is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testProp('pointerEvents')
    Modernizr.testProp      = function(prop){
        return testProps([prop]);
    };
    /*>>testprop*/

    /*>>testallprops*/
    // Modernizr.testAllProps() investigates whether a given style property,
    //   or any of its vendor-prefixed variants, is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testAllProps('boxSizing')
    Modernizr.testAllProps  = testPropsAll;
    /*>>testallprops*/


    /*>>teststyles*/
    // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
    // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
    Modernizr.testStyles    = injectElementWithStyles;
    /*>>teststyles*/


    /*>>prefixed*/
    // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
    // Modernizr.prefixed('boxSizing') // 'MozBoxSizing'

    // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
    // Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
    //
    //     str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');

    // If you're trying to ascertain which transition end event to bind to, you might do something like...
    //
    //     var transEndEventNames = {
    //       'WebkitTransition' : 'webkitTransitionEnd',
    //       'MozTransition'    : 'transitionend',
    //       'OTransition'      : 'oTransitionEnd',
    //       'msTransition'     : 'MSTransitionEnd',
    //       'transition'       : 'transitionend'
    //     },
    //     transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];

    Modernizr.prefixed      = function(prop, obj, elem){
      if(!obj) {
        return testPropsAll(prop, 'pfx');
      } else {
        // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
        return testPropsAll(prop, obj, elem);
      }
    };
    /*>>prefixed*/


    /*>>cssclasses*/
    // Remove "no-js" class from <html> element, if it exists:
    docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +

                            // Add the new classes to the <html> element.
                            (enableClasses ? ' js ' + classes.join(' ') : '');
    /*>>cssclasses*/

    return Modernizr;

})(this, this.document);
;
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 3.0.1
 *
 * Requires jQuery >= 1.2.6
 */

(function (factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS style for Browserify
        module.exports = factory;
    } else {
        // Browser globals
        factory(jQuery);
    }
}(function ($) {
    $.fn.bgiframe = function (s) {
        s = $.extend({
            top: 'auto', // auto == borderTopWidth
            left: 'auto', // auto == borderLeftWidth
            width: 'auto', // auto == offsetWidth
            height: 'auto', // auto == offsetHeight
            opacity: true,
            src: 'javascript:false;',
            conditional: /MSIE 6\.0/.test(navigator.userAgent) // expression or function. return false to prevent iframe insertion
        }, s);

        // wrap conditional in a function if it isn't already
        if (!$.isFunction(s.conditional)) {
            var condition = s.conditional;
            s.conditional = function () { return condition; };
        }

        var $iframe = $('<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' +
                           'style="display:block;position:absolute;z-index:-1;"/>');

        return this.each(function () {
            var $this = $(this);
            if (s.conditional(this) === false) { return; }
            var existing = $this.children('iframe.bgiframe');
            var $el = existing.length === 0 ? $iframe.clone() : existing;
            $el.css({
                'top': s.top == 'auto' ?
                    ((parseInt($this.css('borderTopWidth'), 10) || 0) * -1) + 'px' : prop(s.top),
                'left': s.left == 'auto' ?
                    ((parseInt($this.css('borderLeftWidth'), 10) || 0) * -1) + 'px' : prop(s.left),
                'width': s.width == 'auto' ? (this.offsetWidth + 'px') : prop(s.width),
                'height': s.height == 'auto' ? (this.offsetHeight + 'px') : prop(s.height),
                'opacity': s.opacity === true ? 0 : undefined
            });

            if (existing.length === 0) {
                $this.prepend($el);
            }
        });
    };

    // old alias
    $.fn.bgIframe = $.fn.bgiframe;

    function prop(n) {
        return n && n.constructor === Number ? n + 'px' : n;
    }

}));;
/*!
 * jQuery blockUI plugin
 * Version 2.70.0-2014.11.23
 * Requires jQuery v1.7 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2013 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */

; (function () {
   /*jshint eqeqeq:false curly:false latedef:false */
   "use strict";

   function setup($) {
      $.fn._fadeIn = $.fn.fadeIn;

      var noOp = $.noop || function () { };

      // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
      // confusing userAgent strings on Vista)
      var msie = /MSIE/.test(navigator.userAgent);
      var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
      var mode = document.documentMode || 0;
      var setExpr = $.isFunction(document.createElement('div').style.setExpression);

      // global $ methods for blocking/unblocking the entire page
      $.blockUI = function (opts) { install(window, opts); };
      $.unblockUI = function (opts) { remove(window, opts); };

      // convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
      $.growlUI = function (title, message, timeout, onClose) {
         var $m = $('<div class="growlUI"></div>');
         if (title) $m.append('<h1>' + title + '</h1>');
         if (message) $m.append('<h2>' + message + '</h2>');
         if (timeout === undefined) timeout = 3000;

         // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
         var callBlock = function (opts) {
            opts = opts || {};

            $.blockUI({
               message: $m,
               fadeIn: typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
               fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
               timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
               centerY: false,
               showOverlay: false,
               onUnblock: onClose,
               css: $.blockUI.defaults.growlCSS
            });
         };

         callBlock();
         var nonmousedOpacity = $m.css('opacity');
         $m.mouseover(function () {
            callBlock({
               fadeIn: 0,
               timeout: 30000
            });

            var displayBlock = $('.blockMsg');
            displayBlock.stop(); // cancel fadeout if it has started
            displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
         }).mouseout(function () {
            $('.blockMsg').fadeOut(1000);
         });
         // End konapun additions
      };

      // plugin method for blocking element content
      $.fn.block = function (opts) {
         if (this[0] === window) {
            $.blockUI(opts);
            return this;
         }
         var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
         this.each(function () {
            var $el = $(this);
            if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
               return;
            $el.unblock({ fadeOut: 0 });
         });

         return this.each(function () {
            if ($.css(this, 'position') == 'static') {
               this.style.position = 'relative';
               $(this).data('blockUI.static', true);
            }
            this.style.zoom = 1; // force 'hasLayout' in ie
            install(this, opts);
         });
      };

      // plugin method for unblocking element content
      $.fn.unblock = function (opts) {
         if (this[0] === window) {
            $.unblockUI(opts);
            return this;
         }
         return this.each(function () {
            remove(this, opts);
         });
      };

      $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!

      // override these in your code to change the default behavior and style
      $.blockUI.defaults = {
         // message displayed when blocking (use null for no message)
         message: '<h1>Please wait...</h1>',

         title: null,		// title string; only used when theme == true
         draggable: true,	// only used when theme == true (requires jquery-ui.js to be loaded)

         theme: false, // set to true to use with jQuery UI themes

         // styles for the message when blocking; if you wish to disable
         // these and use an external stylesheet then do this in your code:
         // $.blockUI.defaults.css = {};
         css: {
            padding: 0,
            margin: 0,
            width: '30%',
            top: '40%',
            left: '35%',
            textAlign: 'center',
            color: '#000',
            border: '3px solid #aaa',
            backgroundColor: '#fff',
            cursor: 'wait'
         },

         // minimal style set used when themes are used
         themedCSS: {
            width: '30%',
            top: '40%',
            left: '35%'
         },

         // styles for the overlay
         overlayCSS: {
            backgroundColor: '#000',
            opacity: 0.6,
            cursor: 'wait'
         },

         // style to replace wait cursor before unblocking to correct issue
         // of lingering wait cursor
         cursorReset: 'default',

         // styles applied when using $.growlUI
         growlCSS: {
            width: '350px',
            top: '10px',
            left: '',
            right: '10px',
            border: 'none',
            padding: '5px',
            opacity: 0.6,
            cursor: 'default',
            color: '#fff',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            'border-radius': '10px'
         },

         // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
         // (hat tip to Jorge H. N. de Vasconcelos)
         /*jshint scripturl:true */
         iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',

         // force usage of iframe in non-IE browsers (handy for blocking applets)
         forceIframe: false,

         // z-index for the blocking overlay
         baseZ: 1000,

         // set these to true to have the message automatically centered
         centerX: true, // <-- only effects element blocking (page block controlled via css above)
         centerY: true,

         // allow body element to be stetched in ie6; this makes blocking look better
         // on "short" pages.  disable if you wish to prevent changes to the body height
         allowBodyStretch: true,

         // enable if you want key and mouse events to be disabled for content that is blocked
         bindEvents: true,

         // be default blockUI will supress tab navigation from leaving blocking content
         // (if bindEvents is true)
         constrainTabKey: true,

         // fadeIn time in millis; set to 0 to disable fadeIn on block
         fadeIn: 200,

         // fadeOut time in millis; set to 0 to disable fadeOut on unblock
         fadeOut: 400,

         // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
         timeout: 0,

         // disable if you don't want to show the overlay
         showOverlay: true,

         // if true, focus will be placed in the first available input field when
         // page blocking
         focusInput: true,

         // elements that can receive focus
         focusableElements: ':input:enabled:visible',

         // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
         // no longer needed in 2012
         // applyPlatformOpacityRules: true,

         // callback method invoked when fadeIn has completed and blocking message is visible
         onBlock: null,

         // callback method invoked when unblocking has completed; the callback is
         // passed the element that has been unblocked (which is the window object for page
         // blocks) and the options that were passed to the unblock call:
         //	onUnblock(element, options)
         onUnblock: null,

         // callback method invoked when the overlay area is clicked.
         // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
         onOverlayClick: null,

         // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
         quirksmodeOffsetHack: 4,

         // class name of the message block
         blockMsgClass: 'blockMsg',

         // if it is already blocked, then ignore it (don't unblock and reblock)
         ignoreIfBlocked: false
      };

      // private data and functions follow...

      var pageBlock = null;
      var pageBlockEls = [];

      function install(el, opts) {
         var css, themedCSS;
         var full = (el == window);
         var msg = (opts && opts.message !== undefined ? opts.message : undefined);
         opts = $.extend({}, $.blockUI.defaults, opts || {});

         if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
            return;

         opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
         css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
         if (opts.onOverlayClick)
            opts.overlayCSS.cursor = 'pointer';

         themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
         msg = msg === undefined ? opts.message : msg;

         // remove the current block (if there is one)
         if (full && pageBlock)
            remove(window, { fadeOut: 0 });

         // if an existing element is being used as the blocking content then we capture
         // its current place in the DOM (and current display style) so we can restore
         // it when we unblock
         if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
            var node = msg.jquery ? msg[0] : msg;
            var data = {};
            $(el).data('blockUI.history', data);
            data.el = node;
            data.parent = node.parentNode;
            data.display = node.style.display;
            data.position = node.style.position;
            if (data.parent)
               data.parent.removeChild(node);
         }

         $(el).data('blockUI.onUnblock', opts.onUnblock);
         var z = opts.baseZ;

         // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
         // layer1 is the iframe layer which is used to supress bleed through of underlying content
         // layer2 is the overlay layer which has opacity and a wait cursor (by default)
         // layer3 is the message content that is displayed while blocking
         var lyr1, lyr2, lyr3, s;
         if (msie || opts.forceIframe)
            lyr1 = $('<iframe class="blockUI" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + opts.iframeSrc + '"></iframe>');
         else
            lyr1 = $('<div class="blockUI" style="display:none"></div>');

         if (opts.theme)
            lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:' + (z++) + ';display:none"></div>');
         else
            lyr2 = $('<div class="blockUI blockOverlay" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');

         if (opts.theme && full) {
            s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:fixed">';
            if (opts.title) {
               s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
            }
            s += '<div class="ui-widget-content ui-dialog-content"></div>';
            s += '</div>';
         }
         else if (opts.theme) {
            s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:absolute">';
            if (opts.title) {
               s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
            }
            s += '<div class="ui-widget-content ui-dialog-content"></div>';
            s += '</div>';
         }
         else if (full) {
            s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:' + (z + 10) + ';display:none;position:fixed"></div>';
         }
         else {
            s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:' + (z + 10) + ';display:none;position:absolute"></div>';
         }
         lyr3 = $(s);

         // if we have a message, style it
         if (msg) {
            if (opts.theme) {
               lyr3.css(themedCSS);
               lyr3.addClass('ui-widget-content');
            }
            else
               lyr3.css(css);
         }

         // style the overlay
         if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
            lyr2.css(opts.overlayCSS);
         lyr2.css('position', full ? 'fixed' : 'absolute');

         // make iframe layer transparent in IE
         if (msie || opts.forceIframe)
            lyr1.css('opacity', 0.0);

         //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
         var layers = [lyr1, lyr2, lyr3], $par = full ? $('body') : $(el);
         $.each(layers, function () {
            this.appendTo($par);
         });

         if (opts.theme && opts.draggable && $.fn.draggable) {
            lyr3.draggable({
               handle: '.ui-dialog-titlebar',
               cancel: 'li'
            });
         }

         // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
         var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
         if (ie6 || expr) {
            // give body 100% height
            if (full && opts.allowBodyStretch && $.support.boxModel)
               $('html,body').css('height', '100%');

            // fix ie6 issue when blocked element has a border width
            if ((ie6 || !$.support.boxModel) && !full) {
               var t = sz(el, 'borderTopWidth'), l = sz(el, 'borderLeftWidth');
               var fixT = t ? '(0 - ' + t + ')' : 0;
               var fixL = l ? '(0 - ' + l + ')' : 0;
            }

            // simulate fixed position
            $.each(layers, function (i, o) {
               var s = o[0].style;
               s.position = 'absolute';
               if (i < 2) {
                  if (full)
                     s.setExpression('height', 'Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:' + opts.quirksmodeOffsetHack + ') + "px"');
                  else
                     s.setExpression('height', 'this.parentNode.offsetHeight + "px"');
                  if (full)
                     s.setExpression('width', 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
                  else
                     s.setExpression('width', 'this.parentNode.offsetWidth + "px"');
                  if (fixL) s.setExpression('left', fixL);
                  if (fixT) s.setExpression('top', fixT);
               }
               else if (opts.centerY) {
                  if (full) s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
                  s.marginTop = 0;
               }
               else if (!opts.centerY && full) {
                  var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
                  var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + ' + top + ') + "px"';
                  s.setExpression('top', expression);
               }
            });
         }

         // show the message
         if (msg) {
            if (opts.theme)
               lyr3.find('.ui-widget-content').append(msg);
            else
               lyr3.append(msg);
            if (msg.jquery || msg.nodeType)
               $(msg).show();
         }

         if ((msie || opts.forceIframe) && opts.showOverlay)
            lyr1.show(); // opacity is zero
         if (opts.fadeIn) {
            var cb = opts.onBlock ? opts.onBlock : noOp;
            var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
            var cb2 = msg ? cb : noOp;
            if (opts.showOverlay)
               lyr2._fadeIn(opts.fadeIn, cb1);
            if (msg)
               lyr3._fadeIn(opts.fadeIn, cb2);
         }
         else {
            if (opts.showOverlay)
               lyr2.show();
            if (msg)
               lyr3.show();
            if (opts.onBlock)
               opts.onBlock.bind(lyr3)();
         }

         // bind key and mouse events
         bind(1, el, opts);

         if (full) {
            pageBlock = lyr3[0];
            pageBlockEls = $(opts.focusableElements, pageBlock);
            if (opts.focusInput)
               setTimeout(focus, 20);
         }
         else
            center(lyr3[0], opts.centerX, opts.centerY);

         if (opts.timeout) {
            // auto-unblock
            var to = setTimeout(function () {
               if (full)
                  $.unblockUI(opts);
               else
                  $(el).unblock(opts);
            }, opts.timeout);
            $(el).data('blockUI.timeout', to);
         }
      }

      // remove the block
      function remove(el, opts) {
         var count;
         var full = (el == window);
         var $el = $(el);
         var data = $el.data('blockUI.history');
         var to = $el.data('blockUI.timeout');
         if (to) {
            clearTimeout(to);
            $el.removeData('blockUI.timeout');
         }
         opts = $.extend({}, $.blockUI.defaults, opts || {});
         bind(0, el, opts); // unbind events

         if (opts.onUnblock === null) {
            opts.onUnblock = $el.data('blockUI.onUnblock');
            $el.removeData('blockUI.onUnblock');
         }

         var els;
         if (full) // crazy selector to handle odd field errors in ie6/7
            els = $('body').children().filter('.blockUI').add('body > .blockUI');
         else
            els = $el.find('>.blockUI');

         // fix cursor issue
         if (opts.cursorReset) {
            if (els.length > 1)
               els[1].style.cursor = opts.cursorReset;
            if (els.length > 2)
               els[2].style.cursor = opts.cursorReset;
         }

         if (full)
            pageBlock = pageBlockEls = null;

         if (opts.fadeOut) {
            count = els.length;
            els.stop().fadeOut(opts.fadeOut, function () {
               if (--count === 0)
                  reset(els, data, opts, el);
            });
         }
         else
            reset(els, data, opts, el);
      }

      // move blocking element back into the DOM where it started
      function reset(els, data, opts, el) {
         var $el = $(el);
         if ($el.data('blockUI.isBlocked'))
            return;

         els.each(function (i, o) {
            // remove via DOM calls so we don't lose event handlers
            if (this.parentNode)
               this.parentNode.removeChild(this);
         });

         if (data && data.el) {
            data.el.style.display = data.display;
            data.el.style.position = data.position;
            data.el.style.cursor = 'default'; // #59
            if (data.parent)
               data.parent.appendChild(data.el);
            $el.removeData('blockUI.history');
         }

         if ($el.data('blockUI.static')) {
            $el.css('position', 'static'); // #22
         }

         if (typeof opts.onUnblock == 'function')
            opts.onUnblock(el, opts);

         // fix issue in Safari 6 where block artifacts remain until reflow
         var body = $(document.body), w = body.width(), cssW = body[0].style.width;
         body.width(w - 1).width(w);
         body[0].style.width = cssW;
      }

      // bind/unbind the handler
      function bind(b, el, opts) {
         var full = el == window, $el = $(el);

         // don't bother unbinding if there is nothing to unbind
         if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
            return;

         $el.data('blockUI.isBlocked', b);

         // don't bind events when overlay is not in use or if bindEvents is false
         if (!full || !opts.bindEvents || (b && !opts.showOverlay))
            return;

         // bind anchors and inputs for mouse and key events
         var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
         if (b)
            $(document).bind(events, opts, handler);
         else
            $(document).unbind(events, handler);

         // former impl...
         //		var $e = $('a,:input');
         //		b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
      }

      // event handler to suppress keyboard/mouse events when blocking
      function handler(e) {
         // allow tab navigation (conditionally)
         if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
            if (pageBlock && e.data.constrainTabKey) {
               var els = pageBlockEls;
               var fwd = !e.shiftKey && e.target === els[els.length - 1];
               var back = e.shiftKey && e.target === els[0];
               if (fwd || back) {
                  setTimeout(function () { focus(back); }, 10);
                  return false;
               }
            }
         }
         var opts = e.data;
         var target = $(e.target);
         if (target.hasClass('blockOverlay') && opts.onOverlayClick)
            opts.onOverlayClick(e);

         // allow events within the message content
         if (target.parents('div.' + opts.blockMsgClass).length > 0)
            return true;

         // allow events for content that is not being blocked
         return target.parents().children().filter('div.blockUI').length === 0;
      }

      function focus(back) {
         if (!pageBlockEls)
            return;
         var e = pageBlockEls[back === true ? pageBlockEls.length - 1 : 0];
         if (e)
            e.focus();
      }

      function center(el, x, y) {
         var p = el.parentNode, s = el.style;
         var l = ((p.offsetWidth - el.offsetWidth) / 2) - sz(p, 'borderLeftWidth');
         var t = ((p.offsetHeight - el.offsetHeight) / 2) - sz(p, 'borderTopWidth');
         if (x) s.left = l > 0 ? (l + 'px') : '0';
         if (y) s.top = t > 0 ? (t + 'px') : '0';
      }

      function sz(el, p) {
         return parseInt($.css(el, p), 10) || 0;
      }

   }


   /*global define:true */
   if (typeof define === 'function' && define.amd && define.amd.jQuery) {
      define(['jquery'], setup);
   } else {
      setup(jQuery);
   }

})();

;
//fgnass.github.com/spin.js#v2.0.0
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});;
/*
Version: 1.0.9

Documentation: http://baymard.com/labs/country-selector#documentation

Copyright (C) 2011 by Jamie Appleseed, Baymard Institute (baymard.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
(function ($) {
    var settings = {
        'sort': false,
        'sort-attr': 'data-priority',
        'sort-desc': false,
        'autoselect': true,
        'alternative-spellings': true,
        'alternative-spellings-attr': 'data-alternative-spellings',
        'remove-valueless-options': true,
        'copy-attributes-to-text-field': true,
        'autocomplete-plugin': 'jquery_ui',
        'relevancy-sorting': true,
        'relevancy-sorting-partial-match-value': 1,
        'relevancy-sorting-strict-match-value': 5,
        'relevancy-sorting-booster-attr': 'data-relevancy-booster',
        'minLength': 0,
        'delay': 0,
        'autoFocus': true,
        handle_invalid_input: function (context) {
            var selected_finder = 'option:selected:first';
            if (context.settings['remove-valueless-options']) {
                selected_finder = 'option:selected[value!=""]:first';
            }
            context.$text_field.val(context.$select_field.find(selected_finder).text());
        },
        handle_select_field: function ($select_field) {
            return $select_field.hide();
        },
        insert_text_field: function (context) {
            var $text_field = $('<input type="text"></input>');
            if (settings['copy-attributes-to-text-field']) {
                var attrs = {};
                var raw_attrs = context.$select_field[0].attributes;
                for (var i = 0; i < raw_attrs.length; i++) {
                    var key = raw_attrs[i].nodeName;
                    var value = raw_attrs[i].nodeValue;
                    if (key !== 'name' && key !== 'id' && typeof context.$select_field.attr(key) !== 'undefined') {
                        attrs[key] = value;
                    }
                };
                $text_field.attr(attrs);
            }
            $text_field.blur(function () {
                var valid_values = context.$select_field.find('option').map(function (i, option) { return $(option).text(); });
                if (($.inArray($text_field.val(), valid_values) < 0) && typeof settings['handle_invalid_input'] === 'function') {
                    settings['handle_invalid_input'](context);
                }
            });
            // give the input box the ability to select all text on mouse click
            if (context.settings['autoselect']) {
                $text_field.click(function () {
                    this.select();
                });
            }
            var selected_finder = 'option:selected:first';
            if (context.settings['remove-valueless-options']) {
                selected_finder = 'option:selected[value!=""]:first';
            }
            return $text_field.val(context.$select_field.find(selected_finder).text())
              .insertAfter(context.$select_field);
        },
        extract_options: function ($select_field) {
            var options = [];
            var $options = $select_field.find('option');
            var number_of_options = $options.length;

            // go over each option in the select tag
            $options.each(function () {
                var $option = $(this);
                var option = {
                    'real-value': $option.attr('value'),
                    'label': $option.text()
                }
                if (settings['remove-valueless-options'] && option['real-value'] === '') {
                    // skip options without a value
                } else {
                    // prepare the 'matches' string which must be filtered on later
                    option['matches'] = option['label'];
                    var alternative_spellings = $option.attr(settings['alternative-spellings-attr']);
                    if (alternative_spellings) {
                        option['matches'] += ' ' + alternative_spellings;
                    }
                    // give each option a weight paramter for sorting
                    if (settings['sort']) {
                        var weight = parseInt($option.attr(settings['sort-attr']), 10);
                        if (weight) {
                            option['weight'] = weight;
                        } else {
                            option['weight'] = number_of_options;
                        }
                    }
                    // add relevancy score
                    if (settings['relevancy-sorting']) {
                        option['relevancy-score'] = 0;
                        option['relevancy-score-booster'] = 1;
                        var boost_by = parseFloat($option.attr(settings['relevancy-sorting-booster-attr']));
                        if (boost_by) {
                            option['relevancy-score-booster'] = boost_by;
                        }
                    }
                    // add option to combined array
                    options.push(option);
                }
            });
            // sort the options based on weight
            if (settings['sort']) {
                if (settings['sort-desc']) {
                    options.sort(function (a, b) { return b['weight'] - a['weight']; });
                } else {
                    options.sort(function (a, b) { return a['weight'] - b['weight']; });
                }
            }

            // return the set of options, each with the following attributes: real-value, label, matches, weight (optional)
            return options;
        }
    };

    var public_methods = {
        init: function (customizations) {

            if (/msie/.test(navigator.userAgent.toLowerCase()) && parseInt(navigator.appVersion, 10) <= 6) {

                return this;

            } else {

                settings = $.extend(settings, customizations);

                return this.each(function () {
                    var $select_field = $(this);

                    var context = {
                        '$select_field': $select_field,
                        'options': settings['extract_options']($select_field),
                        'settings': settings
                    };

                    context['$text_field'] = settings['insert_text_field'](context);

                    settings['handle_select_field']($select_field);

                    if (typeof settings['autocomplete-plugin'] === 'string') {
                        adapters[settings['autocomplete-plugin']](context);
                    } else {
                        settings['autocomplete-plugin'](context);
                    }
                });

            }

        }
    };

    var adapters = {
        jquery_ui: function (context) {
            // loose matching of search terms
            var filter_options = function (term) {
                var split_term = term.split(' ');
                var matchers = [];
                for (var i = 0; i < split_term.length; i++) {
                    if (split_term[i].length > 0) {
                        var matcher = {};
                        matcher['partial'] = new RegExp($.ui.autocomplete.escapeRegex(split_term[i]), "i");
                        if (context.settings['relevancy-sorting']) {
                            matcher['strict'] = new RegExp("^" + $.ui.autocomplete.escapeRegex(split_term[i]), "i");
                        }
                        matchers.push(matcher);
                    }
                };

                return $.grep(context.options, function (option) {
                    var partial_matches = 0;
                    if (context.settings['relevancy-sorting']) {
                        var strict_match = false;
                        var split_option_matches = option.matches.split(' ');
                    }
                    for (var i = 0; i < matchers.length; i++) {
                        if (matchers[i]['partial'].test(option.matches)) {
                            partial_matches++;
                        }
                        if (context.settings['relevancy-sorting']) {
                            for (var q = 0; q < split_option_matches.length; q++) {
                                if (matchers[i]['strict'].test(split_option_matches[q])) {
                                    strict_match = true;
                                    break;
                                }
                            };
                        }
                    };
                    if (context.settings['relevancy-sorting']) {
                        var option_score = 0;
                        option_score += partial_matches * context.settings['relevancy-sorting-partial-match-value'];
                        if (strict_match) {
                            option_score += context.settings['relevancy-sorting-strict-match-value'];
                        }
                        option_score = option_score * option['relevancy-score-booster'];
                        option['relevancy-score'] = option_score;
                    }
                    return (!term || matchers.length === partial_matches);
                });
            }
            // update the select field value using either selected option or current input in the text field
            var update_select_value = function (option) {
                if (option) {
                    if (context.$select_field.val() !== option['real-value']) {
                        context.$select_field.val(option['real-value']);
                        context.$select_field.change();
                    }
                } else {
                    var option_name = context.$text_field.val().toLowerCase();
                    var matching_option = { 'real-value': false };
                    for (var i = 0; i < context.options.length; i++) {
                        if (option_name === context.options[i]['label'].toLowerCase()) {
                            matching_option = context.options[i];
                            break;
                        }
                    };
                    if (context.$select_field.val() !== matching_option['real-value']) {
                        context.$select_field.val(matching_option['real-value'] || '');
                        context.$select_field.change();
                    }
                    if (matching_option['real-value']) {
                        context.$text_field.val(matching_option['label']);
                    }
                    if (typeof context.settings['handle_invalid_input'] === 'function' && context.$select_field.val() === '') {
                        context.settings['handle_invalid_input'](context);
                    }
                }
            }
            // jQuery UI autocomplete settings & behavior
            context.$text_field.autocomplete({
                'minLength': context.settings['minLength'],
                'delay': context.settings['delay'],
                'autoFocus': context.settings['autoFocus'],
                source: function (request, response) {
                    var filtered_options = filter_options(request.term);
                    if (context.settings['relevancy-sorting']) {
                        filtered_options = filtered_options.sort(function (a, b) {
                            if (b['relevancy-score'] == a['relevancy-score']) {
                                return b['label'] < a['label'] ? 1 : -1;
                            } else {
                                return b['relevancy-score'] - a['relevancy-score'];
                            }
                        });
                    }
                    response(filtered_options);
                },
                select: function (event, ui) {
                    update_select_value(ui.item);
                },
                change: function (event, ui) {
                    update_select_value(ui.item);
                }
            });
            // force refresh value of select field when form is submitted
            context.$text_field.parents('form:first').submit(function () {
                update_select_value();
            });
            // select current value
            update_select_value();
        }
    };

    $.fn.selectToAutocomplete = function (method) {
        if (public_methods[method]) {
            return public_methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return public_methods.init.apply(this, arguments);
        } else {
            $.error('Method ' + method + ' does not exist on jQuery.fn.selectToAutocomplete');
        }
    };

})(jQuery);;
/** Abstract base class for collection plugins v1.0.1.
	Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
	Licensed under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. */
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);;
/* http://keith-wood.name/timeEntry.html
   Time entry for jQuery v2.0.1.
   Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
   Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
   Please attribute the author if you use it. */
(function($){var n='timeEntry';$.JQPlugin.createPlugin({name:n,defaultOptions:{appendText:'',showSeconds:false,unlimitedHours:false,timeSteps:[1,1,1],initialField:null,noSeparatorEntry:false,tabToExit:false,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:'spinnerDefault.png',spinnerSize:[20,20,8],spinnerBigImage:'',spinnerBigSize:[40,40,16],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null,beforeSetTime:null},regionalOptions:{'':{show24Hours:false,separator:':',ampmPrefix:'',ampmNames:['AM','PM'],spinnerTexts:['Now','Previous field','Next field','Increment','Decrement']}},_getters:['getOffset','getTime','isDisabled'],_appendClass:n+'-append',_controlClass:n+'-control',_expandClass:n+'-expand',_disabledInputs:[],_instSettings:function(a,b){return{_field:0,_selectedHour:0,_selectedMinute:0,_selectedSecond:0}},_postAttach:function(b,c){b.on('focus.'+c.name,this._doFocus).on('blur.'+c.name,this._doBlur).on('click.'+c.name,this._doClick).on('keydown.'+c.name,this._doKeyDown).on('keypress.'+c.name,this._doKeyPress).on('paste.'+c.name,function(a){setTimeout(function(){o._parseTime(c)},1)})},_optionsChanged:function(a,b,c){var d=this._extractTime(b);$.extend(b.options,c);b.options.show24Hours=b.options.show24Hours||b.options.unlimitedHours;b._field=0;if(d){this._setTime(b,new Date(0,0,0,d[0],d[1],d[2]))}a.next('span.'+this._appendClass).remove();a.parent().find('span.'+this._controlClass).remove();if($.fn.mousewheel){a.unmousewheel()}var e=(!b.options.spinnerImage?null:$('<span class="'+this._controlClass+'" style="display: inline-block; '+'background: url(\''+b.options.spinnerImage+'\') 0 0 no-repeat; width: '+b.options.spinnerSize[0]+'px; height: '+b.options.spinnerSize[1]+'px;"></span>'));a.after(b.options.appendText?'<span class="'+this._appendClass+'">'+b.options.appendText+'</span>':'').after(e||'');if(b.options.useMouseWheel&&$.fn.mousewheel){a.mousewheel(this._doMouseWheel)}if(e){e.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseover(this._expandSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner)}},enable:function(a){this._enableDisable(a,false)},disable:function(a){this._enableDisable(a,true)},_enableDisable:function(b,c){var d=this._getInst(b);if(!d){return}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()==='span'){this._changeSpinner(d,b.nextSibling,(c?5:-1))}this._disabledInputs=$.map(this._disabledInputs,function(a){return(a===b?null:a)});if(c){this._disabledInputs.push(b)}},isDisabled:function(a){return $.inArray(a,this._disabledInputs)>-1},_preDestroy:function(b,c){b=$(b).off('.'+n);if($.fn.mousewheel){b.unmousewheel()}this._disabledInputs=$.map(this._disabledInputs,function(a){return(a===b[0]?null:a)});b.siblings('.'+this._appendClass+',.'+this._controlClass).remove()},setTime:function(a,b){var c=this._getInst(a);if(c){if(b===null||b===''){$(a).val('')}else{this._setTime(c,b?($.isArray(b)?b:(typeof b==='object'?new Date(b.getTime()):b)):null)}}},getTime:function(a){var b=this._getInst(a);var c=(b?this._extractTime(b):null);return(!c?null:new Date(0,0,0,c[0],c[1],c[2]))},getOffset:function(a){var b=this._getInst(a);var c=(b?this._extractTime(b):null);return(!c?0:(c[0]*3600+c[1]*60+c[2])*1000)},_doFocus:function(a){var b=(a.nodeName&&a.nodeName.toLowerCase()==='input'?a:this);if(o._lastInput===b||o.isDisabled(b)){o._focussed=false;return}var c=o._getInst(b);o._focussed=true;o._lastInput=b;o._blurredInput=null;$.extend(c.options,($.isFunction(c.options.beforeShow)?c.options.beforeShow.apply(b,[b]):{}));o._parseTime(c,a.nodeName?null:a);setTimeout(function(){o._showField(c)},10)},_doBlur:function(a){o._blurredInput=o._lastInput;o._lastInput=null},_doClick:function(a){var b=a.target;var c=o._getInst(b);var d=c._field;if(!o._focussed){c._field=o._getSelection(c,b,a)}if(d!==c._field){c._lastChr=''}o._showField(c);o._focussed=false},_getSelection:function(b,c,d){var e=0;var f=[b.elem.val().split(b.options.separator)[0].length,2,2];if(c.selectionStart!==null){var g=0;for(var h=0;h<=Math.max(1,b._secondField,b._ampmField);h++){g+=(h!==b._ampmField?f[h]+b.options.separator.length:b.options.ampmPrefix.length+b.options.ampmNames[0].length);e=h;if(c.selectionStart<g){break}}}else if(c.createTextRange&&d!=null){var i=$(d.srcElement);var j=c.createTextRange();var k=function(a){return{thin:2,medium:4,thick:6}[a]||a};var l=d.clientX+document.documentElement.scrollLeft-(i.offset().left+parseInt(k(i.css('border-left-width')),10))-j.offsetLeft;for(var h=0;h<=Math.max(1,b._secondField,b._ampmField);h++){var g=(h!==b._ampmField?(h*fieldSize)+2:(b._ampmField*fieldSize)+b.options.ampmPrefix.length+b.options.ampmNames[0].length);j.collapse();j.moveEnd('character',g);e=h;if(l<j.boundingWidth){break}}}return e},_doKeyDown:function(a){if(a.keyCode>=48){return true}var b=o._getInst(a.target);switch(a.keyCode){case 9:return(b.options.tabToExit?true:(a.shiftKey?o._changeField(b,-1,true):o._changeField(b,+1,true)));case 35:if(a.ctrlKey){o._setValue(b,'')}else{b._field=Math.max(1,b._secondField,b._ampmField);o._adjustField(b,0)}break;case 36:if(a.ctrlKey){o._setTime(b)}else{b._field=0;o._adjustField(b,0)}break;case 37:o._changeField(b,-1,false);break;case 38:o._adjustField(b,+1);break;case 39:o._changeField(b,+1,false);break;case 40:o._adjustField(b,-1);break;case 46:o._setValue(b,'');break;case 8:b._lastChr='';default:return true}return false},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode===undefined?a.keyCode:a.charCode);if(b<' '){return true}var c=o._getInst(a.target);o._handleKeyPress(c,b);return false},_handleKeyPress:function(a,b){if(b===a.options.separator){this._changeField(a,+1,false)}else if(b>='0'&&b<='9'){var c=parseInt(b,10);var d=parseInt(a._lastChr+b,10);var e=(a._field!==0?a._selectedHour:(a.options.unlimitedHours?d:(a.options.show24Hours?(d<24?d:c):(d>=1&&d<=12?d:(c>0?c:a._selectedHour))%12+(a._selectedHour>=12?12:0))));var f=(a._field!==1?a._selectedMinute:(d<60?d:c));var g=(a._field!==a._secondField?a._selectedSecond:(d<60?d:c));var h=this._constrainTime(a,[e,f,g]);this._setTime(a,(a.options.unlimitedHours?h:new Date(0,0,0,h[0],h[1],h[2])));if(a.options.noSeparatorEntry&&a._lastChr){this._changeField(a,+1,false)}else{a._lastChr=(a.options.unlimitedHours&&a._field===0?a._lastChr+b:b)}}else if(!a.options.show24Hours){b=b.toLowerCase();if((b===a.options.ampmNames[0].substring(0,1).toLowerCase()&&a._selectedHour>=12)||(b===a.options.ampmNames[1].substring(0,1).toLowerCase()&&a._selectedHour<12)){var i=a._field;a._field=a._ampmField;this._adjustField(a,+1);a._field=i;this._showField(a)}}},_doMouseWheel:function(a,b){if(o.isDisabled(a.target)){return}var c=o._getInst(a.target);c.elem.focus();if(!c.elem.val()){o._parseTime(c)}o._adjustField(c,b);a.preventDefault()},_expandSpinner:function(b){var c=o._getSpinnerTarget(b);var d=o._getInst(o._getInput(c));if(o.isDisabled(d.elem[0])){return}if(d.options.spinnerBigImage){d._expanded=true;var e=$(c).offset();var f=null;$(c).parents().each(function(){var a=$(this);if(a.css('position')==='relative'||a.css('position')==='absolute'){f=a.offset()}return!f});$('<div class="'+o._expandClass+'" style="position: absolute; left: '+(e.left-(d.options.spinnerBigSize[0]-d.options.spinnerSize[0])/2-(f?f.left:0))+'px; top: '+(e.top-(d.options.spinnerBigSize[1]-d.options.spinnerSize[1])/2-(f?f.top:0))+'px; width: '+d.options.spinnerBigSize[0]+'px; height: '+d.options.spinnerBigSize[1]+'px; background: transparent url('+d.options.spinnerBigImage+') no-repeat 0px 0px; z-index: 10;"></div>').mousedown(o._handleSpinner).mouseup(o._endSpinner).mouseout(o._endExpand).mousemove(o._describeSpinner).insertAfter(c)}},_getInput:function(a){return $(a).siblings('.'+this._getMarker())[0]},_describeSpinner:function(a){var b=o._getSpinnerTarget(a);var c=o._getInst(o._getInput(b));b.title=c.options.spinnerTexts[o._getSpinnerRegion(c,a)]},_handleSpinner:function(a){var b=o._getSpinnerTarget(a);var c=o._getInput(b);if(o.isDisabled(c)){return}if(c===o._blurredInput){o._lastInput=c;o._blurredInput=null}var d=o._getInst(c);o._doFocus(c);var e=o._getSpinnerRegion(d,a);o._changeSpinner(d,b,e);o._actionSpinner(d,e);o._timer=null;o._handlingSpinner=true;if(e>=3&&d.options.spinnerRepeat[0]){o._timer=setTimeout(function(){o._repeatSpinner(d,e)},d.options.spinnerRepeat[0]);$(b).one('mouseout',o._releaseSpinner).one('mouseup',o._releaseSpinner)}},_actionSpinner:function(a,b){if(!a.elem.val()){o._parseTime(a)}switch(b){case 0:this._setTime(a);break;case 1:this._changeField(a,-1,false);break;case 2:this._changeField(a,+1,false);break;case 3:this._adjustField(a,+1);break;case 4:this._adjustField(a,-1);break}},_repeatSpinner:function(a,b){if(!o._timer){return}o._lastInput=o._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){o._repeatSpinner(a,b)},a.options.spinnerRepeat[1])},_releaseSpinner:function(a){clearTimeout(o._timer);o._timer=null},_endExpand:function(a){o._timer=null;var b=o._getSpinnerTarget(a);var c=o._getInput(b);var d=o._getInst(c);$(b).remove();d._expanded=false},_endSpinner:function(a){o._timer=null;var b=o._getSpinnerTarget(a);var c=o._getInput(b);var d=o._getInst(c);if(!o.isDisabled(c)){o._changeSpinner(d,b,-1)}if(o._handlingSpinner){o._lastInput=o._blurredInput}if(o._lastInput&&o._handlingSpinner){o._showField(d)}o._handlingSpinner=false},_getSpinnerTarget:function(a){return a.target||a.srcElement},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=$(c).offset();var e=[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop];var f=(a.options.spinnerIncDecOnly?99:b.clientX+e[0]-d.left);var g=b.clientY+e[1]-d.top;var h=a.options[a._expanded?'spinnerBigSize':'spinnerSize'];var i=(a.options.spinnerIncDecOnly?99:h[0]-1-f);var j=h[1]-1-g;if(h[2]>0&&Math.abs(f-i)<=h[2]&&Math.abs(g-j)<=h[2]){return 0}var k=Math.min(f,g,i,j);return(k===f?1:(k===i?2:(k===g?3:4)))},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a.options[a._expanded?'spinnerBigSize':'spinnerSize'][0])+'px 0px')},_parseTime:function(a,b){var c=this._extractTime(a);if(c){a._selectedHour=c[0];a._selectedMinute=c[1];a._selectedSecond=c[2]}else{var d=this._constrainTime(a);a._selectedHour=d[0];a._selectedMinute=d[1];a._selectedSecond=(a.options.showSeconds?d[2]:0)}a._secondField=(a.options.showSeconds?2:-1);a._ampmField=(a.options.show24Hours?-1:(a.options.showSeconds?3:2));a._lastChr='';var e=function(){if(a.elem.val()!==''){o._showTime(a)}};if(typeof a.options.initialField==='number'){a._field=Math.max(0,Math.min(Math.max(1,a._secondField,a._ampmField),a.options.initialField));e()}else{setTimeout(function(){a._field=o._getSelection(a,a.elem[0],b);e()},0)}},_extractTime:function(a,b){b=b||a.elem.val();var c=b.split(a.options.separator);if(a.options.separator===''&&b!==''){c[0]=b.substring(0,2);c[1]=b.substring(2,4);c[2]=b.substring(4,6)}if(c.length>=2){var d=!a.options.show24Hours&&(b.indexOf(a.options.ampmNames[0])>-1);var e=!a.options.show24Hours&&(b.indexOf(a.options.ampmNames[1])>-1);var f=parseInt(c[0],10);f=(isNaN(f)?0:f);f=((d||e)&&f===12?0:f)+(e?12:0);var g=parseInt(c[1],10);g=(isNaN(g)?0:g);var h=(c.length>=3?parseInt(c[2],10):0);h=(isNaN(h)||!a.options.showSeconds?0:h);return this._constrainTime(a,[f,g,h])}return null},_constrainTime:function(a,b){var c=(b!==null&&b!==undefined);if(!c){var d=this._determineTime(a.options.defaultTime,a)||new Date();b=[d.getHours(),d.getMinutes(),d.getSeconds()]}var e=false;for(var i=0;i<a.options.timeSteps.length;i++){if(e){b[i]=0}else if(a.options.timeSteps[i]>1){b[i]=Math.round(b[i]/a.options.timeSteps[i])*a.options.timeSteps[i];e=true}}return b},_showTime:function(a){var b=(a.options.unlimitedHours?a._selectedHour:this._formatNumber(a.options.show24Hours?a._selectedHour:((a._selectedHour+11)%12)+1))+a.options.separator+this._formatNumber(a._selectedMinute)+(a.options.showSeconds?a.options.separator+this._formatNumber(a._selectedSecond):'')+(a.options.show24Hours?'':a.options.ampmPrefix+a.options.ampmNames[(a._selectedHour<12?0:1)]);this._setValue(a,b);this._showField(a)},_showField:function(a){var b=a.elem[0];if(a.elem.is(':hidden')||o._lastInput!==b){return}var c=[a.elem.val().split(a.options.separator)[0].length,2,2];var d=0;var e=0;while(e<a._field){d+=c[e]+(e===Math.max(1,a._secondField)?0:a.options.separator.length);e++}var f=d+(a._field!==a._ampmField?c[e]:a.options.ampmPrefix.length+a.options.ampmNames[0].length);if(b.setSelectionRange){b.setSelectionRange(d,f)}else if(b.createTextRange){var g=b.createTextRange();g.moveStart('character',d);g.moveEnd('character',f-a.elem.val().length);g.select()}if(!b.disabled){b.focus()}},_formatNumber:function(a){return(a<10?'0':'')+a},_setValue:function(a,b){if(b!==a.elem.val()){a.elem.val(b).trigger('change')}},_changeField:function(a,b,c){var d=(a.elem.val()===''||a._field===(b===-1?0:Math.max(1,a._secondField,a._ampmField)));if(!d){a._field+=b}this._showField(a);a._lastChr='';return(d&&c)},_adjustField:function(a,b){if(a.elem.val()===''){b=0}if(a.options.unlimitedHours){this._setTime(a,[a._selectedHour+(a._field===0?b*a.options.timeSteps[0]:0),a._selectedMinute+(a._field===1?b*a.options.timeSteps[1]:0),a._selectedSecond+(a._field===a._secondField?b*a.options.timeSteps[2]:0)])}else{this._setTime(a,new Date(0,0,0,a._selectedHour+(a._field===0?b*a.options.timeSteps[0]:0)+(a._field===a._ampmField?b*12:0),a._selectedMinute+(a._field===1?b*a.options.timeSteps[1]:0),a._selectedSecond+(a._field===a._secondField?b*a.options.timeSteps[2]:0)))}},_setTime:function(a,b){if(a.options.unlimitedHours&&$.isArray(b)){var c=b}else{b=this._determineTime(b,a);var c=(b?[b.getHours(),b.getMinutes(),b.getSeconds()]:null)}c=this._constrainTime(a,c);b=new Date(0,0,0,c[0],c[1],c[2]);var b=this._normaliseTime(b);var d=this._normaliseTime(this._determineTime(a.options.minTime,a));var e=this._normaliseTime(this._determineTime(a.options.maxTime,a));if(a.options.unlimitedHours){while(c[2]<0){c[2]+=60;c[1]--}while(c[2]>59){c[2]-=60;c[1]++}while(c[1]<0){c[1]+=60;c[0]--}while(c[1]>59){c[1]-=60;c[0]++}d=(a.options.minTime!=null&&$.isArray(a.options.minTime))?a.options.minTime:[0,0,0];if(c[0]<d[0]){c=d.slice(0,3)}else if(c[0]===d[0]){if(c[1]<d[1]){c[1]=d[1];c[2]=d[2]}else if(c[1]===d[1]){if(c[2]<d[2]){c[2]=d[2]}}}if(a.options.maxTime!=null&&$.isArray(a.options.maxTime)){if(c[0]>a.options.maxTime[0]){c=a.options.maxTime.slice(0,3)}else if(c[0]===a.options.maxTime[0]){if(c[1]>a.options.maxTime[1]){c[1]=a.options.maxTime[1];c[2]=a.options.maxTime[2]}else if(c[1]===a.options.maxTime[1]){if(c[2]>a.options.maxTime[2]){c[2]=a.options.maxTime[2]}}}}}else{if(d&&e&&d>e){if(b<d&&b>e){b=(Math.abs(b-d)<Math.abs(b-e)?d:e)}}else{b=(d&&b<d?d:(e&&b>e?e:b))}c[0]=b.getHours();c[1]=b.getMinutes();c[2]=b.getSeconds()}if($.isFunction(a.options.beforeSetTime)){b=a.options.beforeSetTime.apply(a.elem[0],[this.getTime(a.elem[0]),b,d,e]);c[0]=b.getHours();c[1]=b.getMinutes();c[2]=b.getSeconds()}a._selectedHour=c[0];a._selectedMinute=c[1];a._selectedSecond=c[2];this._showTime(a)},_determineTime:function(i,j){var k=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var l=function(a){var b=o._extractTime(j,a);var c=new Date();var d=(b?b[0]:c.getHours());var e=(b?b[1]:c.getMinutes());var f=(b?b[2]:c.getSeconds());if(!b){var g=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var h=g.exec(a);while(h){switch(h[2]||'s'){case's':case'S':f+=parseInt(h[1],10);break;case'm':case'M':e+=parseInt(h[1],10);break;case'h':case'H':d+=parseInt(h[1],10);break}h=g.exec(a)}}c=new Date(0,0,10,d,e,f,0);if(/^!/.test(a)){if(c.getDate()>10){c=new Date(0,0,10,23,59,59)}else if(c.getDate()<10){c=new Date(0,0,10,0,0,0)}}return c};var m=function(a){return new Date(0,0,0,a[0],a[1]||0,a[2]||0,0)};return(i?(typeof i==='string'?l(i):(typeof i==='number'?k(i):($.isArray(i)?m(i):i))):null)},_normaliseTime:function(a){if(!a){return null}a.setFullYear(1900);a.setMonth(0);a.setDate(0);return a}});var o=$.timeEntry})(jQuery);;
/*
    http://www.JSON.org/json2.js
    2010-03-20

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html


    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.


    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/

/*jslint evil: true, strict: false */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/


// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (!this.JSON) {
    this.JSON = {};
}

(function () {

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function (key) {

            return isFinite(this.valueOf()) ?
                   this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z' : null;
        };

        String.prototype.toJSON =
        Number.prototype.toJSON =
        Boolean.prototype.toJSON = function (key) {
            return this.valueOf();
        };
    }

    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        gap,
        indent,
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        escapable.lastIndex = 0;
        return escapable.test(string) ?
            '"' + string.replace(escapable, function (a) {
                var c = meta[a];
                return typeof c === 'string' ? c :
                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
            }) + '"' :
            '"' + string + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0 ? '[]' :
                    gap ? '[\n' + gap +
                            partial.join(',\n' + gap) + '\n' +
                                mind + ']' :
                          '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    k = rep[i];
                    if (typeof k === 'string') {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0 ? '{}' :
                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
                        mind + '}' : '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                     typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            text = String(text);
            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function' ?
                    walk({'': j}, '') : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
}());
;
(function () {
    function Ba(a) { switch (a) { case "'": return "\x26#39;"; case "\x26": return "\x26amp;"; case "\x3c": return "\x26lt;"; case "\x3e": return "\x26gt;"; case '"': return "\x26quot;"; case "\u00a9": return "\x26copy;"; case "\u2028": return "\x3cbr\x3e"; case "\u2029": return "\x3cp\x3e"; default: return a } } function l() { } function t() { } function la(a) { l.prototype.init.call(this, a, l.TYPE.STANDARD) } function ma(a) { k[a] || (k[a] = new la(a)); return k[a] } function S(a, b) { l.prototype.init.call(this, b + "_" + a, l.TYPE.AGENT) } function L(a,
        b) { var c = b + "_" + a; k[c] || (k[c] = new S(a, b)); return k[c] } function T(a, b) { t.prototype.init.call(this, a, b) } function U(a, b) { t.prototype.init.call(this, a, b) } function n(a) { l.prototype.init.call(this, a, l.TYPE.INVITE); this.active = !1; this.filterLogic = null; this.rules = {}; this.autoRejectTimeout = this.inviteTimeout = this.inviteDelay = this.ruleTree = null } function u(a) { k[a] || (k[a] = new n(a)); return k[a] } function A(a, b, c, e, d, g, C, y) {
            t.prototype.init.call(this, a, b); this.hasInviteAfterAccept = g; this.hasInviteAfterReject = C; this.rejectTime =
                y; null !== f.getCssAnimation(b) || "Custom" == c ? this.renderer = new n.RENDERER[c].renderClass(a, b, n.START_POSITION[e], n.END_POSITION[d]) : this.renderer = new n.RENDERER.Appear.renderClass(a, b, n.START_POSITION[e], n.END_POSITION[d])
        } function D(a) { return u(a) ? u(a).getTracker() : null } function r() { } function J(a, b, c, e) { r.prototype.init.call(this, a, b, c, e) } function K(a, b, c, e) { r.prototype.init.call(this, a, b, null, e) } function M(a, b, c, e) { r.prototype.init.call(this, a, b, null, e) } function E(a, b, c, e) {
            E.prototype.init.call(this,
                a, b, null, null)
        } function h() { } function N(a, b, c, e, d) { h.prototype.init.call(this, a, b, c, e, d) } function O(a, b, c, e, d) { h.prototype.init.call(this, a, b, c, e, d) } function V(a, b, c, e, d) { h.prototype.init.call(this, a, b, c, e, d) } function F(a) {
            na++; if (1E3 < na) throw Error("Error processing rule filter logic, preventing recursion"); for (var b = 0, c = 0, e = 0; e < a.length; e++)"(" == a.charAt(e) ? c++ : ")" == a.charAt(e) && c-- , "," == a.charAt(e) && 1 == c && (b = e); if (0 == a.indexOf("AND(")) return c = F(a.substring(4, b)), a = F(a.substring(b + 1, a.length - 1)),
                new W(c, a); if (0 == a.indexOf("OR(")) return c = F(a.substring(3, b)), a = F(a.substring(b + 1, a.length - 1)), new X(c, a); if (0 == a.indexOf("NOT(")) return c = F(a.substring(4, a.length - 1)), new Y(c); if (!isNaN(parseInt(a, 10))) return new Z(parseInt(a, 10)); throw Error("Encountered unexpected character in filter logic");
        } function z() { } function Z(a) { this.ruleId = a; z.prototype.init.call(this, null, null) } function W(a, b) { z.prototype.init.call(this, a, b) } function X(a, b) { z.prototype.init.call(this, a, b) } function Y(a) {
            z.prototype.init.call(this,
                a, null)
        } function Ca(a, b, c, e) {
            var d = document.createElement("div"); d.id = "liveagent_invite_button_" + a; var g = document.createElement("img"); g.style.cursor = "pointer"; g.style.position = "absolute"; g.style.right = "-20px"; g.style.top = "-20px"; g.src = f.addPrefixToURL(m.contentServerUrl, m.urlPrefix, !0) + "/images/x.png"; f.addEventListener(g, "click", function () { p.rejectChat(a) }); d.appendChild(g); g = document.createElement("img"); g.style.cursor = "pointer"; g.style.clear = "right"; g.src = b; g.width = c; g.height = e; f.addEventListener(g,
                "click", function () { p.startChat(a) }); d.appendChild(g); document.body.appendChild(d); return d
        } function oa(a, b, c) { "undefined" == typeof c && (c = !0); this.getLabel = function () { return a }; this.getValue = function () { return b }; this.getDisplayToAgent = function () { return c }; var e = new aa; this.getMapper = function () { return e }; this.doKnowledgeSearch = !1; this.getDoKnowledgeSearch = function () { return this.doKnowledgeSearch }; this.setDoKnowledgeSearch = function () { this.doKnowledgeSearch = !0 } } function aa() {
            var a = [], b = []; this.getEntityMaps =
                function () { return a }; this.getTranscriptFields = function () { return b }
        } function pa(a, b, c, e, d) { this.getEntityName = function () { return a }; this.getFieldName = function () { return b }; this.getFastFill = function () { return c }; this.getAutoQuery = function () { return e }; this.getExactMatch = function () { return d } } function qa(a) {
        this.saveToTranscript = ""; this.showOnCreate = !1; this.linkToEntityField = this.linkToEntityName = ""; var b = new ra; this.getEntityName = function () { return a }; this.getSaveTranscript = function () { return this.saveTranscript };
            this.getShowOnCreate = function () { return this.showOnCreate }; this.getLinkToEntityName = function () { return this.linkToEntityName }; this.getLinkToEntityField = function () { return this.linkToEntityField }; this.getEntityMapper = function () { return b }; this.setSaveTranscript = function (a) { this.saveTranscript = a }; this.setShowOnCreate = function (a) { this.showOnCreate = a }; this.setLinkToEntityName = function (a) { this.linkToEntityName = a }; this.setLinkToEntityField = function (a) { this.linkToEntityField = a }
        } function ra() {
            var a = []; this.getEntityFieldsMaps =
                function () { return a }
        } function sa(a, b, c, e, d) { this.getFieldName = function () { return a }; this.getLabel = function () { return b }; this.getDoFind = function () { return c }; this.getIsExactMatch = function () { return e }; this.getDoCreate = function () { return d } } function P() {
            if (!ta) {
                ta = !0; f.log("DOM is ready. Setting up environment."); null == v.getOref() && v.setOref(document.referrer); null == v.getVisitCount() && v.setVisitCount(1); if (window._laq) for (var a = 0; a < window._laq.length; a++)window._laq[a].call(window); q.connection.setCallback("liveagent._.handlePing");
                ua()
            }
        } function ua() { var a = [], b = {}; ba && (b.chatted = 1); x ? (b.sid = x, f.log("Reusing existing session.")) : (a.push(new q.Noun("VisitorId")), f.log("Requesting new session.")); a.push(new q.Noun("Settings", { buttonIds: "[" + va() + "]", updateBreadcrumb: 1, urlPrefix: m.urlPrefix })); q.connection.send(a, b) } function wa(a, b) { b.endpointUrl && a.setEndpoint(b.endpointUrl); b.prechatUrl && a.setPrechat(b.prechatUrl); b.language && a.setLanguage(b.language); a.setOnlineState(b.isAvailable) } function Da() {
            if (q.connection.isRunning()) if (null ==
                x || ca) ca = !1, ua(); else { f.log("Pinging server to keep presence"); Q = null; var a = {}; a.sid = x; ba && (a.chatted = 1); a.r = (new Date).getMilliseconds(); var b = [new q.Noun("Availability", { ids: "[" + va() + "]" })]; q.connection.send(b, a) }
        } function da() { f.log("Disconnecting from Live Agent"); q.connection.setIsRunning(!1); for (var a in k) k.hasOwnProperty(a) && k[a].setOnlineState(!1) } function va() {
            var a = [], b = {}, c; for (c in k) k.hasOwnProperty(c) && k[c].getType() == l.TYPE.STANDARD && (b[c] = k[c]); for (var e in b) a.push(e); var b = {}, d;
            for (d in k) k.hasOwnProperty(d) && k[d].getType() == l.TYPE.AGENT && (b[d] = k[d]); for (e in b) a.push(e); d = {}; for (var g in k) k.hasOwnProperty(g) && k[g].getType() == l.TYPE.INVITE && (d[g] = k[g]); for (e in d) a.push(e); e = ""; for (g = 0; g < a.length; g++)e += a[g], g < a.length - 1 && (e += ","); return e
        } function xa(a, b, c, e) {
        document.cookie = "liveagent_chatted\x3d1;path\x3d/;"; ba = !0; var d; d = "deployment_id\x3d" + m.deploymentId; d = d + "\x26org_id\x3d" + m.orgId; d += "\x26button_id\x3d"; d += a; c && (d += "\x26agent_id\x3d", d += c); e && (d += "\x26do_fallback\x3d1");
            d += "\x26session_id\x3d"; d += x; a = c ? k[c + "_" + a].getEndpoint(d) : k[a].getEndpoint(d); c = "height\x3d" + m.chatWindowHeight; c = c + ",width\x3d" + m.chatWindowWidth; c += ",menubar\x3dno"; c += ",toolbar\x3dno"; c += ",location\x3dno"; c += ",personalbar\x3dno"; window.open("", b, c); Ea(b, a)
        } function Ea(a, b) {
            function c(a, b, c) { var e = document.createElement("input"); e.name = b; e.value = c; a.appendChild(e) } var e = v.getVisitCount(); null == e && (e = "0"); var d = document.createElement("form"); d.style.display = "none"; c(d, "deploymentId", m.deploymentId);
            c(d, "orgId", m.orgId); c(d, "vc", e); c(d, "sid", x); c(d, "ptid", v.getPermanentId()); c(d, "det", f.jsonEncode(ya)); c(d, "oref", v.getOref()); c(d, "pages", f.jsonEncode(B.getPages())); c(d, "sessionStart", (new Date).getTime() - B.getSessionStart()); c(d, "ent", f.jsonEncode(za)); ea && c(d, "visitorName", ea); d.method = "POST"; d.action = b; d.target = a; document.body.appendChild(d); d.submit()
        } function fa(a) { a ? f.log("Server Warning: " + a) : f.log("Server sent an anoymous warning.") } function Aa(a) {
            a ? f.log("Server Error: " + a) : f.log("Server responded with an error.");
            da()
        } if (!window.liveAgentDeployment) {
        window.liveAgentDeployment = !0; var p = {}; window.liveagent && (p = window.liveagent); window.liveagent = p; var f = {
            getCookie: function (a) { var b = document.cookie, c = b.indexOf(a + "\x3d"); if (-1 == c) return null; c += (a + "\x3d").length; a = b.indexOf(";", c); -1 == a && (a = b.length); return b.substring(c, a) }, setCookie: function (a, b, c) { a = a + "\x3d" + b + ";"; c && (c = new Date, c.setFullYear(c.getFullYear() + 10), a += "expires\x3d" + c.toGMTString() + ";"); document.cookie = a + "path\x3d/;" }, addEventListener: function (a,
                b, c) { if (a.addEventListener) a.addEventListener(b, c, !1); else if (a.attachEvent) a.attachEvent("on" + b, c, !1); else throw Error("Could not add event listener"); }, log: function (a) { R && window.console && window.console.log && window.console.log("LIVE AGENT: " + a) }, logGroupStart: function (a) { R && window.console && (window.console.group ? window.console.groupCollapsed("LIVE AGENT: " + a) : f.log(a)) }, logGroupEnd: function () { R && window.console && window.console.group && window.console.groupEnd() }, getLanguage: function () {
                    return "undefined" !=
                        typeof window.navigator.language ? window.navigator.language : "undefined" != typeof window.navigator.userLanguage ? window.navigator.userLanguage : ""
                }, arrayHasItem: function (a, b) { if (Array.prototype.indexOf) return -1 < a.indexOf(b); for (var c = 0; c < a.length; c++)if (a[c] == b) return !0 }, jsonEncode: function (a, b, c) {
                    function e(a) { g.lastIndex = 0; return g.test(a) ? '"' + a.replace(g, function (a) { var b = f[a]; return "string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + a + '"' } function d(a, b) {
                        var c, g, f,
                        C, y = w, k, h = b[a]; h && "object" === typeof h && "function" === typeof h.toJSON && (h = h.toJSON(a)); "function" === typeof m && (h = m.call(b, a, h)); switch (typeof h) {
                            case "string": return e(h); case "number": return isFinite(h) ? String(h) : "null"; case "boolean": case "null": return String(h); case "object": if (!h) return "null"; w += l; k = []; if ("[object Array]" === Object.prototype.toString.apply(h)) { C = h.length; for (c = 0; c < C; c += 1)k[c] = d(c, h) || "null"; f = 0 === k.length ? "[]" : w ? "[\n" + w + k.join(",\n" + w) + "\n" + y + "]" : "[" + k.join(",") + "]"; w = y; return f } if (m &&
                                "object" === typeof m) for (C = m.length, c = 0; c < C; c += 1)"string" === typeof m[c] && (g = m[c], (f = d(g, h)) && k.push(e(g) + (w ? ": " : ":") + f)); else for (g in h) Object.prototype.hasOwnProperty.call(Object(h), g) && (f = d(g, h)) && k.push(e(g) + (w ? ": " : ":") + f); f = 0 === k.length ? "{}" : w ? "{\n" + w + k.join(",\n" + w) + "\n" + y + "}" : "{" + k.join(",") + "}"; w = y; return f
                        }
                    } if ("undefined" !== typeof window.JSON) return window.JSON.stringify(a, b, c); if (void 0 === a || null === a) return "null"; var g = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
                        f = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, y, w = "", l = "", m = b; if ("number" === typeof c) for (y = 0; y < c; y += 1)l += " "; else "string" === typeof c && (l = c); if (b && "function" !== typeof b && ("object" !== typeof b || "number" !== typeof b.length)) throw Error("Error during JSON.stringify"); return d("", { "": a })
                }, jsonDecode: function (a) {
                    a = String(a); if ("undefined" !== typeof window.JSON) return window.JSON.parse(a); var b = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
                    b.lastIndex = 0; b.test(a) && (a = a.replace(b, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) })); if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return eval("(" + a + ")"); throw Error("Error during JSON.parse");
                }, getCssAnimation: function (a) {
                    var b = ["Webkit", "Moz", "O", "ms", "Khtml"]; if (void 0 !== a.style.animationName) return ""; for (var c = 0; c < b.length; c++)if (void 0 !==
                        a.style[b[c] + "AnimationName"]) return b[c].toLowerCase(); return null
                }, addPrefixToURL: function (a, b, c) { if (!f.isEmpty(a) && !f.isEmpty(b) && 0 !== a.indexOf(b)) { c && (b = f.escapeToHtml(b)); var e = /(https?:\/\/)(.*)/i; c = a.replace(e, "$1"); a = a.replace(e, "$2"); b = b.replace(e, "$2"); a = c + b + "/" + a } return a }, getDomainFromUrl: function (a) {
                    if (f.isEmpty(a)) return ""; var b; ga || (ga = document.createElement("a")); b = ga; b.href = a; a = a.match(/:(\d+)/g); b = b.protocol + "//" + b.hostname || window.location.protocol + "//" + window.location.hostname;
                    return a ? b + a[0] : b
                }, isEmpty: function (a) { return null === a || void 0 === a || "" === a }, escapeToHtml: function (a) { return null === a || void 0 === a || "" === a ? "" : a = a.replace(/[&<>"'\u00a9\u2028\u2029]/g, Ba) }, isValidEntityId: function (a) { return a && "string" === typeof a && (18 === a.length || 15 === a.length) }, getKeyPrefix: function (a) { return this.isValidEntityId(a) ? a.substr(0, 3) : null }, isOrganizationId: function (a) { return "00D" === this.getKeyPrefix(a) }, isDeploymentId: function (a) { return "572" === this.getKeyPrefix(a) }, trim: function (a) {
                    return a &&
                        a.replace(/^[\s\u0000-\u0020]*|[\s\u0000-\u0020]*$/g, "") || ""
                }
        }, ga, v = { getVisitCount: function () { var a = parseInt(f.getCookie("liveagent_vc"), 10); return isNaN(a) ? null : a }, getOref: function () { return f.getCookie("liveagent_oref") }, getPermanentId: function () { var a = f.getCookie("liveagent_ptid"); return null != a ? a : "" }, setVisitCount: function (a) { f.setCookie("liveagent_vc", a, !0) }, setOref: function (a) { return f.setCookie("liveagent_oref", a, !0) }, setPermanentId: function (a) { f.setCookie("liveagent_ptid", a, !0) } }, B = new function () {
            function a() {
                return window.localStorage ?
                    window.localStorage : window.sessionStorage
            } function b() { var a = document.createElement("div"); a.style.display = "none"; document.body.appendChild(a); a.id = "liveagent_userdata_provider"; a.addBehavior("#default#userData"); a.load("liveagent"); return { getItem: function (b) { return a.getAttribute(b) }, setItem: function (b, c) { a.setAttribute(b, c); a.save("liveagent") }, removeItem: function (b) { a.removeAttribute(b); a.save("liveagent") } } } function c() {
                var a = {}; return {
                    getItem: function (b) { return a[b] }, setItem: function (b, c) {
                    a[b] =
                        c
                    }, removeItem: function (b) { delete a[b] }
                }
            } function e() { g.setItem(d.SESSION_ID, x); g.setItem(d.PAGE_COUNT, "0"); g.setItem(d.SESSION_START, (new Date).getTime().toString()) } var d = { SESSION_ID: "liveAgentSid", PAGE_COUNT: "liveAgentPc", SESSION_START: "liveAgentStart", PAGE: "liveAgentPage_", PAGE_TIME: "liveAgentPageTime_" }; a.isSupported = function () {
                try {
                    if (window.localStorage || window.sessionStorage) {
                        var a = window.localStorage ? window.localStorage : window.sessionStorage; a.setItem("liveAgentTestKey", "1"); a.removeItem("liveAgentTestKey");
                        return !0
                    } return !1
                } catch (b) { return !1 }
            }; b.isSupported = function () { return document.createElement("div").addBehavior }; var g; g = a.isSupported() ? a() : b.isSupported() ? b() : c(); this.init = function () {
                if (g.getItem(d.SESSION_ID)) { if (g.getItem(d.SESSION_ID) != x) { g.removeItem(d.SESSION_START); for (var a = g.getItem(d.PAGE_COUNT), b = 25 > a ? 0 : a - 25; b < a; b++)g.removeItem(d.PAGE + b), g.removeItem(d.PAGE_TIME + b); e() } } else e(); a = parseInt(g.getItem(d.PAGE_COUNT), 10); 25 <= a && (g.removeItem(d.PAGE + (a - 25)), g.removeItem(d.PAGE_TIME + (a - 25)));
                g.setItem(d.PAGE_COUNT, (a + 1).toString()); g.setItem(d.PAGE + a.toString(), window.location.href); g.setItem(d.PAGE_TIME + a.toString(), (new Date).getTime())
            }; this.getPageCount = function () { return parseInt(g.getItem(d.PAGE_COUNT), 10) }; this.getSessionStart = function () { return g.getItem(d.SESSION_START) }; this.getPages = function () {
                for (var a = [], b = this.getPageCount(), c = 25 > b ? 0 : b - 25; c < b; c++)a.unshift({ location: g.getItem(d.PAGE + c.toString()), time: ((new Date).getTime() - parseInt(g.getItem(d.PAGE_TIME + c.toString()), 10)).toString() });
                return a
            }; this.getCurrentPage = function () { return g.getItem(d.PAGE + (this.getPageCount() - 1).toString()) }; this.clear = function () { g.clear() }
        }; l.TYPE = { STANDARD: "STANDARD", INVITE: "INVITE", AGENT: "AGENT" }; l.EVENT = { BUTTON_AVAILABLE: "BUTTON_AVAILABLE", BUTTON_UNAVAILABLE: "BUTTON_UNAVAILABLE", BUTTON_ACCEPTED: "BUTTON_ACCEPTED", BUTTON_REJECTED: "BUTTON_REJECTED" }; l.prototype.init = function (a, b) { this.buttonId = a; this.type = b; this.onlineState = null; this.trackers = []; this.language = this.prechat = this.endpoint = null }; l.prototype.getType =
            function () { return this.type }; l.prototype.getOnlineState = function () { return this.onlineState }; l.prototype.setOnlineState = function (a) { this.onlineState = a; for (var b = 0; b < this.trackers.length; b++)this.trackers[b].setState(a) }; l.prototype.addTracker = function (a) { this.trackers.push(a) }; l.prototype.setPrechat = function (a) { this.prechat = a }; l.prototype.setEndpoint = function (a) { this.endpoint = a }; l.prototype.getEndpoint = function (a) {
                function b() {
                    var b = m.contentServerUrl, c = m.urlPrefix; if (null == b) throw Error("You cannot call liveagent.startChat until the asynchronous call to liveagent.init has completed!");
                    m.contentServerUrl = f.addPrefixToURL(b, c, !0); b = this.endpoint; b = !f.isEmpty(b) && -1 < f.getDomainFromUrl(b).indexOf("force") ? f.addPrefixToURL(b, c, !0) : b; this.endpoint = b; b = (null != this.endpoint ? this.endpoint : m.contentServerUrl + m.chatPage) + "?language\x3d" + (this.language ? this.language : ""); f.isEmpty(c) || (b += "\x26proxy\x3d" + c + "\x26proxyKey\x3d" + m.prefixKey + "\x26org_id\x3d" + m.orgId + "\x26deployment_id\x3d" + m.deploymentId); return b += "#" + a
                } var c = null, c = null == this.prechat ? b.call(this) : this.prechat + "?endpoint\x3d" +
                    encodeURIComponent(b.call(this)); return m.contentServerUrl + m.prechatHandler + "?endpoint\x3d" + encodeURIComponent(c)
            }; l.prototype.setLanguage = function (a) { this.language = a }; l.prototype.startChat = function (a) { return this.dispatchEvent(l.EVENT.BUTTON_ACCEPTED) ? (xa(this.buttonId, a), !0) : !1 }; l.prototype.rejectChat = function () { return this.dispatchEvent(l.EVENT.BUTTON_REJECTED) ? !0 : !1 }; l.prototype.dispatchEvent = function (a) { return ha.hasOwnProperty(this.buttonId) ? !1 === ha[this.buttonId].call(this, a) ? !1 : !0 : !0 }; t.prototype.init =
                function (a, b) { this.buttonId = a; this.element = b }; t.prototype.getId = function () { return this.buttonId }; t.prototype.setState = function (a) { f.log("Setting state for button " + this.buttonId + " to " + (a ? "online" : "offline")); return k[this.buttonId].dispatchEvent(a ? l.EVENT.BUTTON_AVAILABLE : l.EVENT.BUTTON_UNAVAILABLE) ? !0 : !1 }; la.prototype = new l; S.prototype = new l; S.prototype.startChat = function (a, b) { if (this.dispatchEvent(l.EVENT.BUTTON_ACCEPTED)) { var c = this.buttonId.split("_"); xa(c[1], a, c[0], b); return !0 } return !1 }; T.prototype =
                    new t; T.prototype.setState = function (a) { t.prototype.setState.call(this, a) && (this.element.style.display = a ? "" : "none") }; U.prototype = new t; U.prototype.setState = function (a) { t.prototype.setState.call(this, a) && (this.element.style.display = a ? "none" : "") }; var ia = !1, G = null, ja = {}, H = {}; n.prototype = new l; n.RENDERER = { Slide: { renderClass: J }, Fade: { renderClass: K }, Appear: { renderClass: M }, Custom: { renderClass: E } }; n.START_POSITION = {
                        TopLeft: { xPercent: 0, xPosition: -1, xOffset: -1, yPercent: 0, yPosition: -1, yOffset: -1 }, TopLeftTop: {
                            xPercent: 0,
                            xPosition: 0, xOffset: 1, yPercent: 0, yPosition: -1, yOffset: -1
                        }, Top: { xPercent: .5, xPosition: -.5, xOffset: 0, yPercent: 0, yPosition: -1, yOffset: -1 }, TopRightTop: { xPercent: 1, xPosition: -1, xOffset: -1, yPercent: 0, yPosition: -1, yOffset: -1 }, TopRight: { xPercent: 1, xPosition: 0, xOffset: 1, yPercent: 0, yPosition: -1, yOffset: -1 }, TopRightRight: { xPercent: 1, xPosition: 0, xOffset: 1, yPercent: 0, yPosition: 0, yOffset: 1 }, Right: { xPercent: 1, xPosition: 0, xOffset: 1, yPercent: .5, yPosition: -.5, yOffset: 0 }, BottomRightRight: {
                            xPercent: 1, xPosition: 0, xOffset: 1,
                            yPercent: 1, yPosition: -1, yOffset: -1
                        }, BottomRight: { xPercent: 1, xPosition: 0, xOffset: 1, yPercent: 1, yPosition: 0, yOffset: 1 }, BottomRightBottom: { xPercent: 1, xPosition: -1, xOffset: -1, yPercent: 1, yPosition: 0, yOffset: 1 }, Bottom: { xPercent: .5, xPosition: -.5, xOffset: 0, yPercent: 1, yPosition: 0, yOffset: 1 }, BottomLeftBottom: { xPercent: 0, xPosition: 0, xOffset: 1, yPercent: 1, yPosition: 0, yOffset: 1 }, BottomLeft: { xPercent: 0, xPosition: -1, xOffset: -1, yPercent: 1, yPosition: 0, yOffset: 1 }, BottomLeftLeft: {
                            xPercent: 0, xPosition: -1, xOffset: -1, yPercent: 1,
                            yPosition: -1, yOffset: -1
                        }, Left: { xPercent: 0, xPosition: -1, xOffset: -1, yPercent: .5, yPosition: -.5, yOffset: 0 }, TopLeftLeft: { xPercent: 0, xPosition: -1, xOffset: -1, yPercent: 0, yPosition: 0, yOffset: 1 }
                    }; n.END_POSITION = {
                        TopLeft: { xPercent: 0, xOffset: 1, yPercent: 0, yOffset: 1 }, Top: { xPercent: .5, xOffset: 0, yPercent: 0, yOffset: 1 }, TopRight: { xPercent: 1, xOffset: -1, yPercent: 0, yOffset: 1 }, Left: { xPercent: 0, xOffset: 1, yPercent: .5, yOffset: 0 }, Center: { xPercent: .5, xOffset: 0, yPercent: .5, yOffset: 0 }, Right: {
                            xPercent: 1, xOffset: -1, yPercent: .5,
                            yOffset: 0
                        }, BottomLeft: { xPercent: 0, xOffset: 1, yPercent: 1, yOffset: -1 }, Bottom: { xPercent: .5, xOffset: 0, yPercent: 1, yOffset: -1 }, BottomRight: { xPercent: 1, xOffset: -1, yPercent: 1, yOffset: -1 }
                    }; n.prototype.setRules = function (a, b) {
                        if (a && b) {
                            for (var c in a) {
                                var e = a[c], d = null; switch (e.type) {
                                    case h.TYPE.NUMBER_OF_PAGE_VIEWS: d = new N(e.order, this.buttonId, B.getPageCount(), e.operator, parseInt(e.value, 10)); break; case h.TYPE.URL_MATCH: d = new N(e.order, this.buttonId, B.getCurrentPage(), e.operator, e.value); break; case h.TYPE.SECONDS_ON_PAGE: d =
                                        new O(e.order, this.buttonId, (new Date).getTime(), e.operator, 1E3 * parseInt(e.value, 10)); break; case h.TYPE.SECONDS_ON_SITE: d = new O(e.order, this.buttonId, parseInt(B.getSessionStart(), 10), e.operator, 1E3 * parseInt(e.value, 10)); break; case h.TYPE.CUSTOM_VARIABLE: d = new V(e.order, this.buttonId, e.name, e.operator, e.value), H.hasOwnProperty(e.name) || (H[e.name] = []), H[e.name].push(this.buttonId)
                                }null != d && this.addRule(d)
                            } this.filterLogic = b; this.ruleTree = F(b)
                        }
                    }; n.prototype.setOnlineState = function (a) {
                    a || null === this.inviteTimeout ||
                        (clearTimeout(this.inviteTimeout), this.inviteTimeout = null); a || null === this.autoRejectTimeout || (clearTimeout(this.autoRejectTimeout), this.autoRejectTimeout = null); l.prototype.setOnlineState.call(this, a)
                    }; n.prototype.isActive = function () { return this.active }; n.prototype.setActive = function (a) { this.active = a }; n.prototype.addTracker = function (a) { this.trackers = []; l.prototype.addTracker.call(this, a) }; n.prototype.getTracker = function () {
                        if (1 != this.trackers.length) throw Error("InviteButtons should have exactly 1 tracker");
                        return this.trackers[0]
                    }; n.prototype.startChat = function (a) { return this.active && l.prototype.startChat.call(this, a) ? (this.getTracker().accept(), !0) : !1 }; n.prototype.rejectChat = function () { return this.active && l.prototype.rejectChat.call(this) ? (this.getTracker().reject(), !0) : !1 }; n.prototype.trigger = function () {
                        if (f.getCookie("liveagent_invite_rejected_" + this.buttonId)) return !1; var a = !0; null != this.ruleTree && (f.logGroupStart("Invite " + this.buttonId + " Rule Evaluation"), f.log("Filter Logic: " + this.filterLogic),
                            a = this.ruleTree.evaluate(this), f.logGroupEnd()); if (!a && null != this.inviteDelay) { var b = this; this.inviteTimeout = window.setTimeout(function () { b.setOnlineState(!0) }, this.inviteDelay); this.inviteDelay = null } return a
                    }; n.prototype.addRule = function (a) { this.rules[a.getId()] = a }; n.prototype.getRule = function (a) { return this.rules[a] }; n.prototype.getInviteDelay = function () { return this.inviteDelay }; n.prototype.setInviteDelay = function (a) { f.log("Setting invite delay to: " + a); this.inviteDelay = a }; n.prototype.setAutoRejectTimeout =
                        function (a) { this.autoRejectTimeout = a }; A.prototype = new t; A.prototype.setState = function (a) { a && !ia && u(this.buttonId).trigger() && t.prototype.setState.call(this, !0) ? (ia = !0, G = this.buttonId, this.renderer.render()) : !a && u(this.buttonId).isActive() && t.prototype.setState.call(this, !1) && (ia = !1, this.remove(!0)) }; A.prototype.renderFinish = function () {
                            u(this.buttonId).setActive(!0); if (-1 != this.rejectTime) {
                                var a = this.buttonId; u(this.buttonId).setAutoRejectTimeout(window.setTimeout(function () { u(a).rejectChat() }, 1E3 *
                                    this.rejectTime))
                            } this.renderer.renderFinish()
                        }; A.prototype.accept = function () { this.hasInviteAfterAccept || f.setCookie("liveagent_invite_rejected_" + this.buttonId, !0, !1); this.remove(!1) }; A.prototype.reject = function () { this.hasInviteAfterReject || f.setCookie("liveagent_invite_rejected_" + this.buttonId, !0, !1); this.remove(!0) }; A.prototype.remove = function (a) { u(this.buttonId).setActive(!1); this.renderer.remove(a) }; A.prototype.removeFinish = function () { this.renderer.remove(!1) }; r.prototype.init = function (a, b, c,
                            e) {
                                window.innerWidth ? this.realWidth = window.innerWidth : document.documentElement && document.documentElement.clientWidth ? this.realWidth = document.documentElement.clientWidth : document.body && (this.realWidth = document.body.clientWidth); window.innerHeight ? this.realHeight = window.innerHeight : document.documentElement && document.documentElement.clientHeight ? this.realHeight = document.documentElement.clientHeight : document.body && (this.realHeight = document.body.clientHeight); this.offset = 25; this.buttonId = a; this.animationPrefix =
                                    f.getCssAnimation(b); this.element = b; this.element.style.position = null !== this.animationPrefix ? "fixed" : "absolute"; this.element.style.left = "-1000px"; this.element.style.top = "-1000px"; this.element.style.zIndex = "10000"; this.element.style.display = ""; this.width = this.element.offsetWidth; this.height = this.element.offsetHeight; this.startPosition = c; this.endPosition = e
                        }; r.prototype.render = function () { this.element.style.display = "" }; r.prototype.renderFinish = function () { }; r.prototype.remove = function (a) {
                            this.element.style.left =
                            "-1000px"; this.element.style.top = "-1000px"
                        }; r.prototype.addRenderListeners = function () { var a = this.buttonId, b = "AnimationIteration", c = "AnimationEnd"; "" == this.animationPrefix ? (b = b.toLowerCase(), c = c.toLowerCase()) : (b = this.animationPrefix + b, c = this.animationPrefix + c); f.addEventListener(this.element, b, function () { D(a).renderFinish() }); f.addEventListener(this.element, c, function () { D(a).removeFinish() }) }; J.prototype = new r; J.prototype.render = function () {
                            r.prototype.addRenderListeners.call(this); var a = this.width *
                                this.startPosition.xPosition + this.offset * this.startPosition.xOffset, b = this.height * this.startPosition.yPosition + this.offset * this.startPosition.yOffset, c = this.width * this.endPosition.xPercent * -1 + this.offset * this.endPosition.xOffset, e = this.height * this.endPosition.yPercent * -1 + this.offset * this.endPosition.yOffset, d = ""; "" !== this.animationPrefix && (d = "-" + this.animationPrefix + "-"); var g = document.createElement("style"); g.innerHTML = "@" + d + "keyframes slide" + this.buttonId + "{from { margin-left: " + a + "px; margin-top: " +
                                    b + "px; left: " + 100 * this.startPosition.xPercent + "%; top: " + 100 * this.startPosition.yPercent + "%; }to { margin-left: " + c + "px; margin-top: " + e + "px; left: " + 100 * this.endPosition.xPercent + "%; top: " + 100 * this.endPosition.yPercent + "%; }}"; document.getElementsByTagName("head")[0].appendChild(g); this.element.style[d + "animation-name"] = "slide" + this.buttonId; this.element.style[d + "animation-duration"] = "1s"; this.element.style[d + "animation-iteration-count"] = "2"; this.element.style[d + "animation-direction"] = "alternate";
                            this.element.style[d + "animation-timing-function"] = "ease-in-out"; this.element.style.setProperty(d + "animation-name", "slide" + this.buttonId, ""); this.element.style.setProperty(d + "animation-duration", "1s", ""); this.element.style.setProperty(d + "animation-iteration-count", "2", ""); this.element.style.setProperty(d + "animation-direction", "alternate", ""); this.element.style.setProperty(d + "animation-timing-function", "ease-in-out", ""); r.prototype.render.call(this)
                        }; J.prototype.renderFinish = function () {
                            var a = ""; "" !==
                                this.animationPrefix && (a = "-" + this.animationPrefix + "-"); this.element.style[a + "animation-play-state"] = "paused"; this.element.style.setProperty(a + "animation-play-state", "paused", "")
                        }; J.prototype.remove = function (a) {
                            var b = ""; "" !== this.animationPrefix && (b = "-" + this.animationPrefix + "-"); a ? (this.element.style[b + "animation-play-state"] = "running", this.element.style.setProperty(b + "animation-play-state", "running", "")) : (this.element.style[b + "animation-name"] = "", this.element.style.setProperty(b + "animation-name",
                                "", ""), r.prototype.remove.call(this, a))
                        }; K.prototype = new r; K.prototype.render = function () {
                            r.prototype.addRenderListeners.call(this); var a = ""; "" !== this.animationPrefix && (a = "-" + this.animationPrefix + "-"); var b = document.createElement("style"); b.innerHTML = "@" + a + "keyframes fade" + this.buttonId + "{from { opacity: 0; }to { opacity: 1; }}"; document.getElementsByTagName("head")[0].appendChild(b); this.element.style[a + "animation-name"] = "fade" + this.buttonId; this.element.style[a + "animation-duration"] = "1s"; this.element.style[a +
                                "animation-iteration-count"] = "2"; this.element.style[a + "animation-direction"] = "alternate"; this.element.style[a + "animation-timing-function"] = "ease-in-out"; this.element.style.setProperty(a + "animation-name", "fade" + this.buttonId, ""); this.element.style.setProperty(a + "animation-duration", "1s", ""); this.element.style.setProperty(a + "animation-iteration-count", "2", ""); this.element.style.setProperty(a + "animation-direction", "alternate", ""); this.element.style.setProperty(a + "animation-timing-function", "ease-in-out",
                                    ""); this.element.style.marginLeft = this.width * this.endPosition.xPercent * -1 + this.offset * this.endPosition.xOffset + "px"; this.element.style.left = 100 * this.endPosition.xPercent + "%"; this.element.style.marginTop = this.height * this.endPosition.yPercent * -1 + this.offset * this.endPosition.yOffset + "px"; this.element.style.top = 100 * this.endPosition.yPercent + "%"; r.prototype.render.call(this)
                        }; K.prototype.renderFinish = function () {
                            var a = ""; "" !== this.animationPrefix && (a = "-" + this.animationPrefix + "-"); this.element.style[a + "animation-play-state"] =
                                "paused"; this.element.style.setProperty(a + "animation-play-state", "paused", "")
                        }; K.prototype.remove = function (a) { var b = ""; "" !== this.animationPrefix && (b = "-" + this.animationPrefix + "-"); a ? (this.element.style[b + "animation-play-state"] = "running", this.element.style.setProperty(b + "animation-play-state", "running", ""), this.element.style.opacity = 0) : (this.element.style[b + "animation-name"] = "", this.element.style.setProperty(b + "animation-name", "", ""), r.prototype.remove.call(this, a)) }; M.prototype = new r; M.prototype.render =
                            function () { this.element.style.marginLeft = this.width * this.endPosition.xPercent * -1 + this.offset * this.endPosition.xOffset + "px"; this.element.style.left = 100 * this.endPosition.xPercent + "%"; this.element.style.marginTop = this.height * this.endPosition.yPercent * -1 + this.offset * this.endPosition.yOffset + "px"; this.element.style.top = 100 * this.endPosition.yPercent + "%"; r.prototype.render.call(this); D(this.buttonId).renderFinish() }; M.prototype.remove = function (a) {
                                a ? D(this.buttonId).removeFinish() : r.prototype.remove.call(this,
                                    a)
                            }; E.prototype = new r; E.prototype.render = function () { D(this.buttonId).renderFinish() }; E.prototype.renderFinish = function () { }; E.prototype.remove = function (a) { a && D(this.buttonId).removeFinish() }; h.TYPE = { NUMBER_OF_PAGE_VIEWS: "NUMBER_OF_PAGE_VIEWS", URL_MATCH: "URL_MATCH", SECONDS_ON_PAGE: "SECONDS_ON_PAGE", SECONDS_ON_SITE: "SECONDS_ON_SITE", CUSTOM_VARIABLE: "CUSTOM_VARIABLE" }; h.OPERATOR = {
                                EQUALS: "EQUALS", NOT_EQUAL: "NOT_EQUAL", START_WITH: "START_WITH", CONTAINS: "CONTAINS", NOT_CONTAIN: "NOT_CONTAIN", LESS_THAN: "LESS_THAN",
                                GREATER_THAN: "GREATER_THAN", LESS_OR_EQUAL: "LESS_OR_EQUAL", GREATER_OR_EQUAL: "GREATER_OR_EQUAL"
                            }; h.prototype.init = function (a, b, c, e, d) { this.ruleId = a; this.buttonId = b; this.compareFrom = c; this.operator = e; this.compareTo = d }; h.prototype.getId = function () { return this.ruleId }; h.prototype.evaluate = function (a, b) {
                                switch (this.operator) {
                                    case h.OPERATOR.EQUALS: return f.log("Evaluate: " + a + " \x3d\x3d " + b), a == b; case h.OPERATOR.NOT_EQUAL: return f.log("Evaluate: " + a + " !\x3d " + b), a != b; case h.OPERATOR.START_WITH: return f.log("Evaluate: " +
                                        a + " indexOf " + b + " \x3d\x3d 0"), 0 == a.indexOf(b); case h.OPERATOR.CONTAINS: return f.log("Evaluate: " + a + " indexOf " + b + " !\x3d -1"), -1 != a.indexOf(b); case h.OPERATOR.NOT_CONTAIN: return f.log("Evaluate: " + a + " indexOf " + b + " \x3d\x3d -1"), -1 == a.indexOf(b); case h.OPERATOR.LESS_THAN: return f.log("Evaluate: " + parseFloat(a) + " \x3c " + parseFloat(b)), parseFloat(a) < parseFloat(b); case h.OPERATOR.GREATER_THAN: return f.log("Evaluate: " + parseFloat(a) + " \x3e " + parseFloat(b)), parseFloat(a) > parseFloat(b); case h.OPERATOR.LESS_OR_EQUAL: return f.log("Evaluate: " +
                                            parseFloat(a) + " \x3c\x3d " + parseFloat(b)), parseFloat(a) <= parseFloat(b); case h.OPERATOR.GREATER_OR_EQUAL: return f.log("Evaluate: " + parseFloat(a) + " \x3e\x3d " + parseFloat(b)), parseFloat(a) >= parseFloat(b)
                                }
                            }; N.prototype = new h; N.prototype.evaluate = function () { f.log("Evaluating StandardInviteRule"); return h.prototype.evaluate.call(this, this.compareFrom, this.compareTo) }; O.prototype = new h; O.prototype.evaluate = function () {
                                f.log("Evaluating TimerInviteRule"); var a = (new Date).getTime() - this.compareFrom, b = h.prototype.evaluate.call(this,
                                    a, this.compareTo); !b && a <= this.compareTo && (a = this.compareTo - a, (null == u(this.buttonId).getInviteDelay() || a < u(this.buttonId).getInviteDelay()) && u(this.buttonId).setInviteDelay(a)); return b
                            }; V.prototype = new h; V.prototype.evaluate = function () { if (ja.hasOwnProperty(this.compareFrom)) return f.log("Evaluating CustomInviteRule"), h.prototype.evaluate.call(this, ja[this.compareFrom].toString(), this.compareTo); f.log("CustomInviteRule evaluation failed due to missing custom variable"); return !1 }; var na = 0; z.prototype.init =
                                function (a, b) { this.left = a; this.right = b }; z.prototype.evaluate = function (a) { return !1 }; Z.prototype = new z; Z.prototype.evaluate = function (a) { f.log("Evaluating Atom Node: " + this.ruleId); return a.getRule(this.ruleId).evaluate() }; W.prototype = new z; W.prototype.evaluate = function (a) { f.logGroupStart("Evaluating And Node"); a = this.left.evaluate(a) && this.right.evaluate(a); f.logGroupEnd(); return a }; X.prototype = new z; X.prototype.evaluate = function (a) {
                                    f.logGroupStart("Evaluating Or Node"); a = this.left.evaluate(a) || this.right.evaluate(a);
                                    f.logGroupEnd(); return a
                                }; Y.prototype = new z; Y.prototype.evaluate = function (a) { f.logGroupStart("Evaluating Not Node"); a = !this.left.evaluate(a); f.logGroupEnd(); return a }; oa.prototype.toJSON = function () { return { label: this.getLabel(), value: this.getValue(), displayToAgent: this.getDisplayToAgent(), entityMaps: this.getMapper().getEntityMaps(), transcriptFields: this.getMapper().getTranscriptFields(), doKnowledgeSearch: this.getDoKnowledgeSearch() } }; aa.prototype.map = function (a, b, c, e, d) {
                                "undefined" == typeof c && (c = !0);
                                    "undefined" == typeof e && (e = !0); "undefined" == typeof d && (d = !0); this.getEntityMaps().push(new pa(a, b, c, e, d))
                                }; aa.prototype.saveToTranscript = function (a) { this.getTranscriptFields().push(a) }; pa.prototype.toJSON = function () { return { entityName: this.getEntityName(), fieldName: this.getFieldName(), fastFill: this.getFastFill(), autoQuery: this.getAutoQuery(), exactMatch: this.getExactMatch() } }; var I = {}; p._ = I; I.handlePing = function (a) { q.connection.handlePing(a) }; I.error = function (a) {
                                    a ? f.log("Server Error: " + a) : f.log("Server responded with an error.");
                                    da()
                                }; I.warning = function (a) { a ? f.log("Server Warning: " + a) : f.log("Server sent an anoymous warning.") }; I.setNewPtid = function (a) { v.setPermanentId(a) }; I.clearStorage = function () { B.clear() }; p.init = function (a, b, c) {
                                    if ("string" != typeof a) throw Error("The url to init must be strings"); if (!f.isOrganizationId(c)) throw Error("Invalid OrganizationId Parameter Value: " + c); if (!f.isDeploymentId(b)) throw Error("Invalid DeploymentId Parameter Value: " + b); m.url = a; m.deploymentId = b; m.orgId = c; f.log("System Initialized. Waiting for the DOM to be ready");
                                    "complete" === document.readyState ? setTimeout(P, 1) : document.addEventListener ? (document.addEventListener("DOMContentLoaded", P, !1), window.addEventListener("load", P, !1)) : window.attachEvent ? window.attachEvent("onload", P) : f.log("No available event model. Exiting.")
                                }; p.getSid = function () { return x }; p.enableLogging = function () { R = !0 }; p.setLocation = function (a) { }; p.setChatWindowWidth = function (a) { m.chatWindowWidth = a }; p.setChatWindowHeight = function (a) { m.chatWindowHeight = a }; p.disconnect = function () { da() }; p.startChat =
                                    function (a, b, c) { (b ? L(a, b) : k[a]).startChat("liveagent" + Math.round(1E5 * Math.random()) + (new Date).getTime(), c) }; p.startChatWithWindow = function (a, b, c, e) { (c ? L(a, c) : k[a]).startChat(b, e) }; p.rejectChat = function (a) { k[a].rejectChat() }; p.showWhenOnline = function (a, b, c) { if (q.connection.isRunning()) throw Error("You cannot add a button after page initialization."); a = c ? L(a, c) : ma(a); a.addTracker(new T(a.buttonId, b)) }; p.showWhenOffline = function (a, b, c) {
                                        if (q.connection.isRunning()) throw Error("You cannot add a button after page initialization.");
                                        a = c ? L(a, c) : ma(a); a.addTracker(new U(a.buttonId, b))
                                    }; p.addCustomDetail = function (a, b, c) {
                                        if (q.connection.isRunning()) throw Error("You cannot add a detail after page initialization."); if ("undefined" == typeof a || "undefined" == typeof b || null === a || null === b) throw Error("CustomDetail contains null value"); var e = new oa(a, b, c); ya.push(e); var d = {
                                            map: function (a, b, c, f, h) {
                                                if ("undefined" == typeof a || null === a || "undefined" == typeof b || null === b || null === c || null === f || null === h) throw Error("CustomDetail.map contains null value");
                                                e.getMapper().map(a, b, c, f, h); return d
                                            }, saveToTranscript: function (a) { if ("undefined" == typeof a || null === a) throw Error("CustomDetail.saveToTranscript contains null value"); e.getMapper().saveToTranscript(a); return d }, doKnowledgeSearch: function () { e.setDoKnowledgeSearch(); return d }
                                        }; return d
                                    }; p.setName = function (a) { if (q.connection.isRunning()) throw Error("You cannot set the name after page initialization."); ea = a }; p.addButtonEventHandler = function (a, b) { "function" == typeof b && (ha[a] = b) }; p.BUTTON_EVENT = l.EVENT;
            p.setCustomVariable = function (a, b) { ja[a] = b; if (H.hasOwnProperty(a)) for (var c = 0; c < H[a].length; c++) { var e = u(H[a][c]); e.getOnlineState() && e.setOnlineState(!0) } }; p.findOrCreate = function (a) {
                if (q.connection.isRunning()) throw Error("You cannot find or create after page initialization."); var b = new qa(a); za.push(b); var c = {
                    map: function (a, d, g, f, h) { b.getEntityMapper().map(a, d, g, f, h); return c }, saveToTranscript: function (a) { b.setSaveTranscript(a); return c }, showOnCreate: function () { b.setShowOnCreate(!0); return c }, linkToEntity: function (a,
                        d) { if (ka.hasOwnProperty(a) && ka[a] == b.getEntityName()) return fa("Warning: Recursive links detected, skip link " + b.getEntityName() + " to " + a), c; b.setLinkToEntityName(a); b.setLinkToEntityField(d); ka[b.getEntityName()] = a; return c }
                }; return c
            }; p.addURLPrefix = function (a) { if (q.connection.isRunning()) throw Error("You cannot set a URL Prefix after page initialization."); if ("string" != typeof a) throw Error("The parameter to addURLPrefix must be a string"); m.url = f.addPrefixToURL(m.url, a, !0); m.urlPrefix = a }; var q =
                { VisitorMessage: { ERROR: "Error", WARNING: "Warning" }, SystemMessage: { ASYNC_RESULT: "AsyncResult", SWITCH_SERVER: "SwitchServer" } }; (function () {
                    var a = null, b = !1, c = null, e = null, d = {}; (function () {
                    d.send = function (b, f) {
                        if (null !== c) d.onError.call(window, "Did not handle response before sending another message"); else {
                        "undefined" == typeof f && (f = {}); var h = "Visitor", k = "", l = !1; 1 < b.length ? (h = "System", k = "MultiNoun", f.nouns = "", l = !0) : k = b[0].getName(); h = m.url + "/rest/" + h + "/" + k + ".jsonp?"; for (k = 0; k < b.length; k++) {
                            l && (f.nouns += b[k].getName() +
                                ","); f[b[k].getName() + ".prefix"] = "Visitor"; for (var n in b[k].getData()) b[k].getData().hasOwnProperty(n) && (f[b[k].getName() + "." + n] = b[k].getData()[n])
                        } l && (f.nouns = f.nouns.substr(0, f.nouns.length - 1)); for (var p in f) f.hasOwnProperty(p) && (h += p + "\x3d" + f[p] + "\x26"); h += "callback\x3d" + a; h += "\x26deployment_id\x3d" + m.deploymentId; h += "\x26org_id\x3d" + m.orgId; h += "\x26version\x3d40"; l = document.createElement("script"); l.type = "text/javascript"; l.src = h; c = document.body.appendChild(l); e = window.setTimeout(function () {
                            d.onError.call(window,
                                "Server failed to respond.")
                        }, m.pingTimeout)
                        }
                    }; d.handlePing = function (a) { e && (clearTimeout(e), e = null); b = !0; a = a.messages; for (var f = 0; f < a.length; f++)d.messageHandler.call(window, a[f].type, a[f].message); d.onSuccess.call(window); null !== c && (document.body.removeChild(c), c = null) }; d.messageHandler = function (a, b) { }; d.onSuccess = function () { }; d.onError = function (a) { }; d.isRunning = function () { return b }; d.setIsRunning = function (a) { b = a }; d.setCallback = function (b) { a = b }
                    })(); q.connection = d; q.Noun = function (a, b) {
                    this.getName =
                        function () { return a }; this.getData = function () { return b }
                    }
                })(); qa.prototype.toJSON = function () { return { entityName: this.getEntityName(), saveToTranscript: this.getSaveTranscript(), showOnCreate: this.getShowOnCreate(), linkToEntityName: this.getLinkToEntityName(), linkToEntityField: this.getLinkToEntityField(), entityFieldsMaps: this.getEntityMapper().getEntityFieldsMaps() } }; ra.prototype.map = function (a, b, c, e, d) {
                "undefined" == typeof c && (c = !0); "undefined" == typeof e && (e = !0); "undefined" == typeof d && (d = !0); this.getEntityFieldsMaps().push(new sa(a,
                    b, c, e, d))
                }; sa.prototype.toJSON = function () { return { fieldName: this.getFieldName(), label: this.getLabel(), doFind: this.getDoFind(), isExactMatch: this.getIsExactMatch(), doCreate: this.getDoCreate() } }; var x = f.getCookie("liveagent_sid"), ba = f.getCookie("liveagent_chatted"), ta = !1, R = !1, k = {}, ya = [], za = [], ea = null, ha = {}, Q = null, ka = {}, ca = !1, m = { url: null, deploymentId: null, orgId: null, pingRate: null, pingTimeout: 5E3, chatWindowWidth: 482, chatWindowHeight: 450, contentServerUrl: null, chatPage: "/s/chat", prechatHandler: "/s/prechatVisitor" };
            q.connection.messageHandler = function (a, b) {
                switch (a) {
                    case "VisitorId": b.sessionId && (f.log("Received new session ID"), x = b.sessionId, document.cookie = "liveagent_sid\x3d" + encodeURIComponent(x) + ";path\x3d/;", null != v.getVisitCount() && v.setVisitCount(v.getVisitCount() + 1), v.getPermanentId() || v.setPermanentId(x)); break; case "Settings": B.init(); f.log("Ping rate set to " + b.pingRate + "ms"); m.pingRate = b.pingRate; m.contentServerUrl = b.contentServerUrl; m.prefixKey = b.prefixKey; for (var c = 0; c < b.buttons.length; c++)switch (b.buttons[c].type) {
                        case "ToAgent": case "Standard": var e =
                            b.buttons[c], d = k[e.id]; d && wa(d, e); break; case "Invite": var e = b.buttons[c], g = null, g = e.inviteImageUrl ? Ca(e.id, e.inviteImageUrl, e.inviteImageWidth, e.inviteImageHeight) : document.getElementById("liveagent_invite_button_" + e.id); null == g ? fa("Warning: Button " + e.id + " disabled because HTML element was not found") : (d = u(e.id), d.addTracker(new A(e.id, g, e.inviteRenderer, e.inviteStartPosition, e.inviteEndPosition, e.hasInviteAfterAccept, e.hasInviteAfterReject, e.inviteRejectTime)), g = f.jsonDecode(e.inviteRules), d.setRules(g.rules,
                                g.filter), wa(d, e))
                    }break; case "Availability": c = {}; for (e = 0; e < b.results.length; e++)(d = k[b.results[e].id]) && (c[b.results[e].id] = { button: d, isAvailable: b.results[e].isAvailable }); null != G && c.hasOwnProperty(G) && (c[G].button.setOnlineState(c[G].isAvailable), delete c[G]); for (g in c) c.hasOwnProperty(g) && c[g].button.setOnlineState(c[g].isAvailable); break; case q.VisitorMessage.WARNING: fa(b.text); break; case q.VisitorMessage.ERROR: Aa(b.text); break; case q.SystemMessage.SWITCH_SERVER: c = b.newUrl; if ("string" === typeof c) m.url =
                        c, f.log("Received updated LiveAgent server url: " + c + "! Consider updating this site's deployment code."); else throw Error("Trying to set invalid LiveAgent server url: " + c); ca = !0
                }
            }; q.connection.onSuccess = function () { null !== Q && clearTimeout(Q); Q = window.setTimeout(Da, m.pingRate) }; q.connection.onError = function (a) { Aa(a) }
        }
})();;
$(document).ready(function () {
    if (!Modernizr.csstransitions) {
        $("div").removeClass(".fade");
    }
});

function ShowDialogBox(message, title, buttons, width, height, callbackAfterClick) {
    var id = "dlg" + new Date().getTime();
    //There is a known bug with bootstrap fade effect in IE10.  
    //Doing IE10 detection and removing the fade class.
    var fade = Modernizr.csstransitions ? "fade" : "";
    var dlgWrapper = $("<div id='" + id + "' class='modal " + fade + "'></div>");
    var dlgWrapper1 = $("<div class='modal-dialog modal-dialog-middle'></div>");
    dlgWrapper.append(dlgWrapper1);
    var dlg = $("<div class='modal-content'></div>");
    dlgWrapper1.append(dlg);

    if (title != null && title != "") {
        var hdr = $("<div class='modal-header'></div>");
        hdr.html(title);
        dlg.append(hdr);
    }

    var bdy = $("<div class='modal-body'></div>");
    bdy.html(message);
    dlg.append(bdy);

    var ftr = $("<div class='modal-footer'></div>");
    $.each(buttons, function (i, button) {
        var btn = $("<a href='#' class='btn btn-large btn-ges'></a>");
        btn.text(button.Label);
        if (i == 0) btn.addClass("primary");
        btn.click(function () {
            var close = true;
            if (typeof button.OnClick == "function") {
                var response = button.OnClick();
                close = (typeof response == "undefined" || response == null);
                if (!close) close = response;
            }
            if (close) {
                $("#" + id).modal("hide");
            }

            if ($.isFunction(callbackAfterClick))
                callbackAfterClick();
        });
        ftr.append(btn);
    });
    dlg.children(".btn").button();
    dlg.append(ftr);
    $("body").append(dlgWrapper);

    $("#" + id).modal({
        "backdrop": "static",
        "keyboard": true,
        "show": true // ensure the modal is shown immediately
    });

    return dlg;
}

function ShowInputDialogBox(message, title, inputs, okButtonText, cancelButtonText, validationCallback, callbackAfterOkClick, callbackAfterCancelClick) {
    var id = "dlg" + new Date().getTime();
    //There is a known bug with bootstrap fade effect in IE10.  
    //Doing IE10 detection and removing the fade class.
    var fade = Modernizr.csstransitions ? "fade" : "";
    var dlgWrapper = $("<div id='" + id + "' class='modal " + fade + "'></div>");
    var dlgWrapper1 = $("<div class='modal-dialog modal-dialog-middle'></div>");
    dlgWrapper.append(dlgWrapper1);
    var dlg = $("<div class='modal-content'></div>");
    dlgWrapper1.append(dlg);

    if (title != null && title != "") {
        var hdr = $("<div class='modal-header'></div>");
        hdr.html(title);
        dlg.append(hdr);
    }

    var bdy = $("<div class='modal-body'></div>");
    bdy.html(message);

    //input value
    var inputContainer = $("<div class='form-group'></div>");
    $.each(inputs, function (i, input) {
        var inputBox = $("<input type='text' class='form-control' />");
        inputBox.attr("placeholder", input.placeholder ? input.placeholder : "");
        inputBox.val(input.defaultValue ? input.defaultValue : "");
        inputBox.attr("id", input.id ? input.id : "ShowInputDialog-input-" + i);
        inputContainer.append(inputBox);
    });
    bdy.append(inputContainer);
    dlg.append(bdy);

    var ftr = $("<div class='modal-footer'></div>");

    //ok button
    var okButton = $("<a href='#' class='btn btn-large btn-ges primary'></a>");
    okButton.text(okButtonText);
    okButton.click(function () {
        var inputValues = getInputValues();

        if (typeof (validationCallback) == "function") {
            var validationMessages = validationCallback(inputValues);
            bdy.find(".failtext").remove();
            if (validationMessages && validationMessages.length) {
                //show validation
                validationMessages.forEach(function (message) {
                    bdy.append("<div class='failtext'>" + message + "</div>");
                });
            }
            else {
                
                if (typeof (callbackAfterOkClick) == "function") {
                    callbackAfterOkClick(inputValues);
                }
                $("#" + id).modal("hide");
            }
        }
        else {
            if (typeof (callbackAfterOkClick) == "function") {
                callbackAfterOkClick(inputValues);
            }
            $("#" + id).modal("hide");
        }
    });
    ftr.append(okButton);

    //cancel button
    var cancelButton = $("<a href='#' class='btn btn-large btn-ges'></a>");
    cancelButton.text(cancelButtonText);
    cancelButton.click(function () {
        var inputValues = getInputValues();
        if (typeof (callbackAfterCancelClick) == "function") {
            callbackAfterCancelClick();
        }
        $("#" + id).modal("hide");
    });
    ftr.append(cancelButton);

    dlg.children(".btn").button();
    dlg.append(ftr);
    $("body").append(dlgWrapper);

    $("#" + id).modal({
        "backdrop": "static",
        "keyboard": true,
        "show": true // ensure the modal is shown immediately
    });

    return dlg;

    function getInputValues() {
        var inputValues = [];
        inputs.forEach(function (input, i) {
            inputValues.push({
                id: input.id,
                value: $("#" + (input.id ? input.id : "ShowInputDialog-input-" + i)).val()
            });
        });
        return inputValues;
    }
}

function ShowMessageBox(message, title, onOk, width, height, hide_icon, defaultFocus) {
    try {

        var dialog = ShowDialogBox(message, title, [
            { Label: translations.C427, OnClick: onOk }
        ], width, height);


        if (defaultFocus == true) {
            //Set the focus on the 'Ok' button
            FocusOkButton(dialog);
        }
    } catch (e) {
        window.alert(e.message, translations.C18);
    }
}

function ShowAjaxError(request, message, title, width, height) {
    var error_details;
    if (request.status == 500) {
        error_details = $("<div />").html(message).append($("<div id='error_details' style='display:none;' />").html(request.responseText));
    } else {
        error_details = formatAjaxError(request, request.status, request.statusText);
    }
    ShowDialogBox(error_details, title, null, width, height);
}

function ShowConfirmBox(message, title, onYes, onNo, width, height) {
    try {
        ShowDialogBox(message, title, [
            { Label: translations.C646, OnClick: onYes },
            { Label: translations.C647, OnClick: onNo }
        ], width, height);
    } catch (e) {
        window.alert(e.message, translations.C18);
    }
}

function ShowWaitDialog(text, onBlock) {
    $.blockUI({
        message: '.',
        overlayCSS: {
            backgroundColor: '#006282',
            opacity: 0.4
        },
        onBlock: (typeof (onBlock) == "function") ? onBlock : null
    });

    ShowSpinner($('.blockUI.blockMsg'));
}

function ShowSpinner(element) {
    options = {
        lines: 10, // The number of lines to draw
        length: 10, // The length of each line
        width: 5, // The line thickness
        radius: 15, // The radius of the inner circle
        corners: 1, // Corner roundness (0..1)
        rotate: 0, // The rotation offset
        direction: 1, // 1: clockwise, -1: counterclockwise
        color: '#000', // #rgb or #rrggbb or array of colors
        speed: 1, // Rounds per second
        trail: 60, // Afterglow percentage
        shadow: false, // Whether to render a shadow
        hwaccel: false, // Whether to use hardware acceleration
        className: 'spinner', // The CSS class to assign to the spinner
        zIndex: 2e9, // The z-index (defaults to 2000000000)
        top: '50%', // Top position relative to parent
        left: '50%' // Left position relative to parent
    };
    //var target = document.getElementById('foo')
    var spinner = new Spinner(options).spin();
    $(element).append(spinner.el);
}

function HideWaitDialog() {
    $.unblockUI();
}

function DisableScreen() {
    //There is a known bug with bootstrap fade effect in IE10.  
    //Doing IE10 detection and removing the fade class.
    var fade;
    if (Modernizr.csstransitions) {
        fade = "fade in"
    }
    else {
        fade = ""
    }
    $("body").append("<div class='modal-backdrop " + fade + "'></div>");
}

function EnableScreen() {
    $(".modal-backdrop").remove();
}

jQuery.fn.center = function () {
    this.css("position", "absolute");
    this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
    this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
    return this;
}

function ShowAlertMessage(message, title, errorLevel, showClose, onClose) {
    var id = "alertMsg" + new Date().getTime();
    var alertMsg = $("<div class='alert alert-block' />").attr("id", id);
    alertMsg.addClass(errorLevel || "ges-alert");
    if (showClose) {
        var btn = $("<button data-dismiss='alert' class='close' type='button'><img src='/Content/bootstrap/img/icn-alert-close.png' alt='Close' /></button>");
        if (typeof onClose == "function") {
            btn.click(function () { if (typeof onClose == "function") onClose(); });
        }
        alertMsg.append(btn);
    }
    alertMsg.append($("<h4/>").html(title));
    alertMsg.append(message);
    $(".col-1:first").prepend(alertMsg);
    return $("#" + id);
}

function ShowSuccessAlertMessage(message, title, showClose, onClose) {
    return ShowAlertMessage(message, title, "alert-success", showClose, onClose);
}

function ShowInfoAlertMessage(message, title, showClose, onClose) {
    return ShowAlertMessage(message, title, "alert-info", showClose, onClose);
}

function ShowWarningAlertMessage(message, title, showClose, onClose) {
    return ShowAlertMessage(message, title, " ", showClose, onClose);
}

function ShowErrorAlertMessage(message, title, showClose, onClose) {
    return ShowAlertMessage(message, title, "alert-error", showClose, onClose);
}

function FocusOkButton(dialog) {
    //Set the focus on the 'Ok' button
    if (dialog != undefined && dialog != null) {
        dialog.on('shown.bs.modal', function () {
            dialog.find('.primary').focus();
        });
    }
};
// Minified by MiniME from toptensoftware.com
function _MaskAPI(){this.version="0.4b";this.instances=0;this.objects={}}var MaskAPI=new _MaskAPI();function Mask(b,a){
this.mask=b;this.type=typeof a=="string"?a:"string";this.error=[];this.errorCodes=[];this.value="";this.strippedValue=""
;this.allowPartial=false;this.id=MaskAPI.instances++;this.ref="MaskAPI.objects['"+this.id+"']";MaskAPI.objects[this.id]=
this}Mask.prototype.attach=function(a){$addEvent(a,"onkeydown","return "+this.ref+".isAllowKeyPress(event, this);",true)
;$addEvent(a,"onkeyup","return "+this.ref+".getKeyPress(event, this);",true);$addEvent(a,"onblur","this.value = "+this.
ref+".format(this.value);",true)};Mask.prototype.isAllowKeyPress=function(b,c){if(this.type!="string")return true;var a=
new qEvent(b);if(a.keyCode>47&&c.value.length>=this.mask.length&&!a.ctrlKey)return false;return true};Mask.prototype.
getKeyPress=function(f,d,e){this.allowPartial=true;var b=new qEvent(f);if(b.keyCode>47||e==true||(b.keyCode==8||b.
keyCode==46)){var c=d.value,a;if(b.keyCode==8||b.keyCode==46)a=true;else a=false;if(this.type=="number")this.value=this.
setNumber(c,a);else if(this.type=="date")this.value=this.setDateKeyPress(c,a);else this.value=this.setGeneric(c,a);d.
value=this.value}this.allowPartial=false;return true};Mask.prototype.format=function(a){if(this.type=="number")this.
value=this.setNumber(a);else if(this.type=="date")this.value=this.setDate(a);else this.value=this.setGeneric(a);
return this.value};Mask.prototype.throwError=function(b,c,a){this.error[this.error.length]=c;this.errorCodes[this.
errorCodes.length]=b;if(typeof a=="string")return a;return true};Mask.prototype.setGeneric=function(i,m){var a=i,j=this.
mask,n="x#*",g=[],d="",h,e,c=[],f=0,k={x:"A-Za-z","#":"0-9","*":"A-Za-z0-9"};a=a.replace(new RegExp("[^"+k["*"]+"]","gi"
),"");if(m==true&&a.length==this.strippedValue.length)a=a.substring(0,a.length-1);this.strippedValue=a;var o=[];for(var 
b=0;b<j.length;b++){e=j.charAt(b);h=n.indexOf(e)>-1;if(e=="!")e=j.charAt(b++);if(h&&!this.allowPartial||h&&this.
allowPartial&&g.length<a.length)g[g.length]="["+k[e]+"]";c[c.length]={chr:e,mask:h}}var l=false;if(!this.allowPartial&&!
new RegExp(g.join("")).test(a))return this.throwError(1,'The value "'+i+'" must be in the format '+this.mask+".",i);else
 if(this.allowPartial&&a.length>0||!this.allowPartial)for(var b=0;b<c.length;b++){if(c[b].mask){while(a.length>0&&!new 
RegExp(g[f]).test(a.charAt(f)))a=a.length==1?"":a.substring(1);if(a.length>0){d+=a.charAt(f);l=true}f++}else d+=c[b].chr
;if(this.allowPartial&&f>a.length)break}if(this.allowPartial&&!l)d="";if(this.allowPartial)if(d.length<c.length)this.
nextValidChar=k[c[d.length].chr];else this.nextValidChar=null;return d};Mask.prototype.setNumber=function(m,p){var a=
String(m).replace(/[^\d.-]*/gi,""),b=this.mask;a=a.replace(/\./,"d").replace(/\./g,"").replace(/d/,".");if(!
/^[\$]?((\$?[\+-]?([0#]{1,3},)?[0#]*(\.[0#]*)?)|([\+-]?\([\+-]?([0#]{1,3},)?[0#]*(\.[0#]*)?\)))$/.test(b))return this.
throwError(1,"An invalid mask was specified for the \nMask constructor.",m);if(p==true&&a.length==this.strippedValue.
length)a=a.substring(0,a.length-1);if(this.allowPartial&&a.replace(/[^0-9]/,"").length==0)return a;this.strippedValue=a;
if(a.length==0)a=NaN;var l=Number(a);if(isNaN(l))return this.throwError(2,"The value entered was not a number.",m);if(b.
length==0)return a;var d=String(Math.abs(a.indexOf(".")>-1?a.split(".")[0]:a)),c=a.indexOf(".")>-1?a.split(".")[1]:"",n=
c,o=l!=0&&-Math.abs(l)*1==l,g={$:/^[\$]/.test(b),"(":o&&b.indexOf("(")>-1,"+":b.indexOf("+")!=-1&&!o};g["-"]=o&&(!g["("]
||b.indexOf("-")!=-1);b=b.replace(/[^#0.,]*/gi,"");var e=b.indexOf(".")>-1?b.split(".")[1]:"";if(e.length==0){d=String(
Math.round(Number(d)));c=""}else{var q=e.lastIndexOf("0")+1;if(c.length>e.length)c=String(Math.round(Number(c.substring(
0,e.length+1))/10));else while(c.length<q)c+="0"}var j=b.indexOf(".")>-1?b.split(".")[0]:b;j=j.replace(/[^0#]+/gi,"");
var k=j.indexOf("0")+1;if(k>0){k=j.length-k+1;while(d.length<k)d="0"+d}if(/[#0]+,[#0]{3}/.test(b)){var h=[],f=0,i=Number
(d);while(i>999){h[f]="00"+String(i%1000);h[f]=h[f].substring(h[f].length-3);i=Math.floor(i/1000);f++}h[f]=String(i%1000
);d=h.reverse().join(",")}if(c.length>0&&!this.allowPartial||e.length>0&&this.allowPartial&&a.indexOf(".")>-1&&n.length
>=c.length)a=d+"."+c;else if(e.length>0&&this.allowPartial&&a.indexOf(".")>-1&&n.length<c.length)a=d+"."+n;else a=d;if(g
.$)a=this.mask.replace(/(^[\$])(.+)/gi,"$")+a;if(g["+"])a="+"+a;if(g["-"])a="-"+a;if(g["("])a="("+a+")";return a};Mask.
prototype.setDate=function(k){var m=k,l=this.mask,c,i,b,d,f,e,j;c=l.split(/[^mdy]+/);j=l.split(/[mdy]+/);i=m.split(
/[^0-9]/);if(j[0].length==0)j.splice(0,1);for(var a=0;a<c.length;a++){e=c[a].charAt(0).toLowerCase();if(e=="m")b=
parseInt(i[a],10)-1;else if(e=="d")d=parseInt(i[a],10);else if(e=="y")f=parseInt(i[a],10)}if(String(f).length<3){f=2000+
f;if(new Date().getFullYear()+5<f)f=f-100}var h=new Date(f,b,d);if(h.getDate()!=d)return this.throwError(1,
"An invalid day was entered.",k);else if(h.getMonth()!=b)return this.throwError(2,"An invalid month was entered.",k);var
 g="";for(var a=0;a<c.length;a++){e=c[a].charAt(0).toLowerCase();if(e=="m"){b++;if(c[a].length==2){b="0"+b;b=b.substring
(b.length-2)}g+=b}else if(e=="d"){if(c[a].length==2){d="0"+d;d=d.substring(d.length-2)}g+=d}else if(e=="y")if(c[a].
length==2)g+=h.getYear();else g+=h.getFullYear();if(a<c.length-1)g+=j[a]}return g};Mask.prototype.setDateKeyPress=
function(s,r){var e=s,n=this.mask,p=e.charAt(e.length-1),b,f,d,l,o,g="",h="",c="",i,q,k;if(r==true){while(/[^0-9]/gi.
test(e.charAt(e.length-1)))e=e.substring(0,e.length-1);if(/[^0-9]/gi.test(this.strippedValue.charAt(this.strippedValue.
length-1)))e=e.substring(0,e.length-1);if(e.length==0)return""}b=n.split(/[^mdy]/);var m=n.split(/[mdy]+/);if(m[0].
length==0)m.splice(0,1);f=e.split(/[^0-9]/);q=f.length>0?f.length-1:0;d=b[q].charAt(0);l=b[q].length;for(var a=0;a<f.
length;a++){i=b[a].charAt(0).toLowerCase();if(i=="m")g=parseInt(f[a],10)-1;else if(i=="d")h=parseInt(f[a],10);else if(i
=="y")c=parseInt(f[a],10)}var j="";for(var a=0;a<f.length;a++){i=b[a].charAt(0).toLowerCase();if(i=="m"){k=/[^0-9]/.test
(p)&&d=="m";g++;if(f[a].length==2&&g<10||b[a].length==2&&d!="m"||g>1&&d=="m"||k&&b[a].length==2){g="0"+g;g=g.substring(g
.length-2)}o=String(g).length;l=2;j+=g}else if(i=="d"){k=/[^0-9]/.test(p)&&d=="d";if(f[a].length==2&&h<10||b[a].length==
2&&d!="d"||h>3&&d=="d"||k&&b[a].length==2){h="0"+h;h=h.substring(h.length-2)}o=String(h).length;l=2;j+=h}else if(i=="y")
{k=/[^0-9]/.test(p)&&d=="y";if(d=="y")c=String(c);else if(b[a].length==2)c=d.getYear();else c=d.getFullYear();if(f[a].
length==2&&c<10||b[a].length==2&&d!="y"||k&&b[a].length==2){c="0"+c;c=c.substring(c.length-2)}l=b[a].length;o=String(c).
length;j+=c}if((l==o||k)&&i==d&&a<m.length||a<m.length&&i!=d)j+=m[a]}if(j.length>n.length)j=j.substring(0,n.length);this
.strippedValue=j=="NaN"?"":j;return this.strippedValue};function qEvent(a){if(window.Event){var b=a.type.substring(0,3)
=="key";this.keyCode=b?parseInt(a.which,10):0;this.button=!b?parseInt(a.which,10):0;this.srcElement=a.target;this.type=a
.type;this.x=a.pageX;this.y=a.pageY;this.screenX=a.screenX;this.screenY=a.screenY;if(document.layers){this.altKey=(a.
modifiers&Event.ALT_MASK)>0;this.ctrlKey=(a.modifiers&Event.CONTROL_MASK)>0;this.shiftKey=(a.modifiers&Event.SHIFT_MASK)
>0;this.keyCode=this.translateKeyCode(this.keyCode)}else{this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.
shiftKey}}else{a=window.event;this.keyCode=parseInt(a.keyCode,10);this.button=a.button;this.srcElement=a.srcElement;this
.type=a.type;if(document.all){this.x=a.clientX+document.body.scrollLeft;this.y=a.clientY+document.body.scrollTop}else{
this.x=a.clientX;this.y=a.clientY}this.screenX=a.screenX;this.screenY=a.screenY;this.altKey=a.altKey;this.ctrlKey=a.
ctrlKey;this.shiftKey=a.shiftKey}if(this.button==0){this.setKeyPressed(this.keyCode);this.keyChar=String.fromCharCode(
this.keyCode)}}qEvent.prototype.translateKeyCode=function(a){var b={};if(!!document.layers){if(this.keyCode>96&&this.
keyCode<123)return this.keyCode-32;b={96:192,126:192,33:49,64:50,35:51,36:52,37:53,94:54,38:55,42:56,40:57,41:48,92:220,
124:220,125:221,93:221,91:219,123:219,39:222,34:222,47:191,63:191,46:190,62:190,44:188,60:188,45:189,95:189,43:187,61:
187,59:186,58:186,null:null}}return!!b[a]?b[a]:a};qEvent.prototype.setKP=function(a,b){this.keyPressedCode=a;this.
keyNonChar=typeof b=="string";this.keyPressed=this.keyNonChar?b:String.fromCharCode(a);this.isNumeric=parseInt(this.
keyPressed,10)==this.keyPressed;this.isAlpha=this.keyCode>64&&this.keyCode<91&&!this.altKey&&!this.ctrlKey;return true};
qEvent.prototype.setKeyPressed=function(a){var b=this.shiftKey;if(!b&&(a>64&&a<91))return this.setKP(a+32);if(a>95&&a<
106)return this.setKP(a-48);switch(a){case 49:case 51:case 52:case 53:if(b)a=a-16;break;case 50:if(b)a=64;break;case 54:
if(b)a=94;break;case 55:if(b)a=38;break;case 56:if(b)a=42;break;case 57:if(b)a=40;break;case 48:if(b)a=41;break;case 192
:if(b)a=126;else a=96;break;case 189:if(b)a=95;else a=45;break;case 187:if(b)a=43;else a=61;break;case 220:if(b)a=124;
else a=92;break;case 221:if(b)a=125;else a=93;break;case 219:if(b)a=123;else a=91;break;case 222:if(b)a=34;else a=39;
break;case 186:if(b)a=58;else a=59;break;case 191:if(b)a=63;else a=47;break;case 190:if(b)a=62;else a=46;break;case 188:
if(b)a=60;else a=44;break;case 106:case 57379:a=42;break;case 107:case 57380:a=43;break;case 109:case 57381:a=45;break;
case 110:a=46;break;case 111:case 57378:a=47;break;case 8:return this.setKP(a,"[backspace]");case 9:return this.setKP(a,
"[tab]");case 13:return this.setKP(a,"[enter]");case 16:case 57389:return this.setKP(a,"[shift]");case 17:case 57390:
return this.setKP(a,"[ctrl]");case 18:case 57388:return this.setKP(a,"[alt]");case 19:case 57402:return this.setKP(a,
"[break]");case 20:return this.setKP(a,"[capslock]");case 32:return this.setKP(a,"[space]");case 91:return this.setKP(a,
"[windows]");case 93:return this.setKP(a,"[properties]");case 33:case 57371:return this.setKP(-a*1,"[pgup]");case 34:
case 57372:return this.setKP(-a*1,"[pgdown]");case 35:case 57370:return this.setKP(-a*1,"[end]");case 36:case 57369:
return this.setKP(-a*1,"[home]");case 37:case 57375:return this.setKP(-a*1,"[left]");case 38:case 57373:return this.
setKP(-a*1,"[up]");case 39:case 57376:return this.setKP(-a*1,"[right]");case 40:case 57374:return this.setKP(-a*1,
"[down]");case 45:case 57382:return this.setKP(-a*1,"[insert]");case 46:case 57383:return this.setKP(-a*1,"[delete]");
case 144:case 57400:return this.setKP(-a*1,"[numlock]")}if(a>111&&a<124)return this.setKP(-a*1,"[f"+a-111+"]");
return this.setKP(a)};function $addEvent(c,f,e,d){var b=f.toLowerCase(),g=typeof d=="boolean"?d:true,a=c[b]?c[b].
toString():"";a=a.substring(a.indexOf("{")+1,a.lastIndexOf("}"));a=(g?a+e:e+a)+"\n";return c[b]=!!window.Event?new 
Function("event",a):new Function(a)};
/*
 * jQuery clueTip plugin
 * Version 1.0.6  (January 13, 2010)
 * @requires jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
 
/*
 *
 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
 *
 * Examples can be found at http://plugins.learningjquery.com/cluetip/demo/
 *
*/
(function($){$.cluetip={version:'1.0.6'};var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;}
if(js=='destroy'){return this.removeData('thisInfo').unbind('.cluetip');}
return this.each(function(index){var link=this,$this=$(this);var opts=$.extend(true,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=+opts.cluezIndex;$this.data('thisInfo',{title:link.title,zIndex:cluezIndex});var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join(''))
[insertionType](insertionElement).hide();$cluetip=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:cluezIndex});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore($cluetip).hide();}
var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-1,opacity:.1,top:1+i,left:1+i}));}
$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);}
var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true;}
if(opts.local&&opts.localPrefix){tipAttribute=opts.localPrefix+tipAttribute;}
if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();}
var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight,defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=parseInt(opts.width,10)||275,tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'),10)||0)+(parseInt($cluetip.css('paddingRight'),10)||0)+dropShadowSteps,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';}
tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();}
if(opts.escapeTitle){tipTitle=tipTitle.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');}
var localContent;function returnFalse(){return false;}
var activate=function(event){if(!opts.onActivate($this)){return false;}
isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);}
if(opts.hoverClass){$this.addClass(opts.hoverClass);}
linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if(link.tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();}
if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(link.tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}}
var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1});}
wHeight=$(window).height();if(js){if(typeof js=='function'){js=js.call(link);}
$cluetipInner.html(js);cluetipShow(pY);}
else if(tipParts){var tpl=tipParts.length;$cluetipInner.html(tpl?tipParts[0]:'');if(tpl>1){for(var i=1;i<tpl;i++){$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>');}}
cluetipShow(pY);}
else if(!opts.local&&tipAttribute.indexOf('#')!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)){$cluetipInner.html('<img src="'+tipAttribute+'" alt="'+tipTitle+'" />');cluetipShow(pY);}else if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);}else{var optionBeforeSend=opts.ajaxSettings.beforeSend,optionError=opts.ajaxSettings.error,optionSuccess=opts.ajaxSettings.success,optionComplete=opts.ajaxSettings.complete;var ajaxSettings={cache:false,url:tipAttribute,beforeSend:function(xhr){if(optionBeforeSend){optionBeforeSend.call(link,xhr,$cluetip,$cluetipInner);}
$cluetipOuter.children().empty();if(opts.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show();}},error:function(xhr,textStatus){if(isActive){if(optionError){optionError.call(link,xhr,textStatus,$cluetip,$cluetipInner);}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>');}}},success:function(data,textStatus){cluetipContents=opts.ajaxProcess.call(link,data);if(isActive){if(optionSuccess){optionSuccess.call(link,data,textStatus,$cluetip,$cluetipInner);}
$cluetipInner.html(cluetipContents);}},complete:function(xhr,textStatus){if(optionComplete){optionComplete.call(link,xhr,textStatus,$cluetip,$cluetipInner);}
imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(isActive){cluetipShow(pY);}}});}else{$cluetipWait.hide();if(isActive){cluetipShow(pY);}}}};var ajaxMergedSettings=$.extend(true,{},opts.ajaxSettings,ajaxSettings);$.ajax(ajaxMergedSettings);}}else if(opts.local){var $localContent=$(tipAttribute+(/#\S+$/.test(tipAttribute)?'':':eq('+index+')')).clone(true).show();$cluetipInner.html($localContent);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);}
function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.bind('click.cluetip',function(){cluetipClose();return false;});if(opts.mouseOutClose){$cluetip.bind('mouseleave.cluetip',function(){cluetipClose();});}else{$cluetip.unbind('mouseleave.cluetip');}}
var direction='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||link.tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;}
if(direction==''){posX<linkLeft?direction='left':direction='right';}
$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();}
$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.openSpeed||0);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth,zIndex:$this.data('thisInfo').zIndex-1}).show();}
if($.fn.bgiframe){$cluetip.bgiframe();}
if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);}
opts.onShow.call(link,$cluetip,$cluetipInner);};var inactivate=function(event){isActive=false;$cluetipWait.hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);}
if(opts.hoverClass){$this.removeClass(opts.hoverClass);}};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass();opts.onHide.call(link,$cluetip,$cluetipInner);$this.removeClass('cluetip-clicked');if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);}
$this.css('cursor','');if(opts.arrows){$cluetipArrows.css({top:''});}};$(document).bind('hideCluetip',function(e){cluetipClose();});if((/click|toggle/).test(opts.activation)){$this.bind('click.cluetip',function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);}
this.blur();return false;});}else if(opts.activation=='focus'){$this.bind('focus.cluetip',function(event){activate(event);});$this.bind('blur.cluetip',function(event){inactivate(event);});}else{$this[opts.clickThrough?'unbind':'bind']('click',returnFalse);var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.bind('mousemove.cluetip',function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove.cluetip');}});}else{$this.bind('mouseenter.cluetip',function(event){activate(event);mouseTracks(event);}).bind('mouseleave.cluetip',function(event){inactivate(event);$this.unbind('mousemove.cluetip');});}
$this.bind('mouseover.cluetip',function(event){$this.attr('title','');}).bind('mouseleave.cluetip',function(event){$this.attr('title',$this.data('thisInfo').title);});}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,ci){},onHide:function(ct,ci){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;}
if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery);;
/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

(function() {(function(n){var A=this||(0,eval)("this"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||"undefined"===typeof jQuery||(v=jQuery);(function(n){"function"===typeof define&&define.amd?define(["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(A.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);
d=a.a.setTimeout(b,c)}}function Z(a,c){c&&"change"!==c?"beforeChange"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a="undefined"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.L=function(a,c,d){a[c]=d};a.version="3.5.1";a.b("version",
a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b){a.a.Na(l,b,e)});b[c]=l.join(" ")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h="function"===typeof Symbol,m={},k={};m[R&&/Firefox\/2/i.test(R.userAgent)?
"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];m.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)k[b[c]]=a});var l={propertychange:!0},p=w&&function(){for(var a=3,b=w.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:n}(),q=/\S+/g,t;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],
D:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:"function"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Pa:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},wc:function(b){var c=[];b&&a.a.D(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,
b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)d.push(b.call(c,a[e],e));return d},jb:function(a,b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},Nb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Na:function(b,c,d){var e=a.a.A(a.a.bc(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=
b.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.oa(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,l=[];d<e;d++){var k=b[d].cloneNode(!0);l.push(c?a.oa(k):k)}return l},va:function(b,c){a.a.Tb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Xc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],
l=e.parentNode,k=0,f=c.length;k<f;k++)l.insertBefore(c[k],e);k=0;for(f=d.length;k<f;k++)a.removeNode(d[k])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Zc:function(a,b){7>p?a.setAttribute("selected",b):a.selected=b},Db:function(a){return null===a||a===n?"":a.trim?
a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&&
a.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f="on"+c;b.attachEvent(f,
k);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,e,!1);else t||(t="function"==typeof v(b).on?"on":"bind"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.R(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if("function"==typeof w.createEvent)if("function"==
typeof b.dispatchEvent)d=w.createEvent(k[c]||"HTMLEvents"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&("object"===typeof b.classList?
(l=b.classList[d?"add":"remove"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):"string"===typeof b.className.baseVal?e(b.className,"baseVal",c,d):e(b,"className",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d="";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'"]/g,function(a){return"&#"+a.charCodeAt(0)+";"});a.mergeAttributes(w.createElement("<input name='"+
c+"'/>"),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Zd:6===p,$d:7===p,W:p,Lc:function(b,c){for(var d=a.a.la(b.getElementsByTagName("input")).concat(a.a.la(b.getElementsByTagName("textarea"))),
e="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},l=[],k=d.length-1;0<=k;k--)e(d[k])&&l.push(d[k]);return l},Nd:function(b){return"string"==typeof b&&(b=a.a.Db(b))?H&&H.parse?H.parse(b):(new Function("return "+b))():null},hc:function(b,c,d){if(!H||!H.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return H.stringify(a.a.f(b),c,d)},Od:function(c,d,e){e=e||{};var l=e.params||{},k=e.includeFields||this.Jc,f=c;if("object"==typeof c&&"form"===a.a.R(c))for(var f=c.action,h=k.length-1;0<=h;h--)for(var g=a.a.Lc(c,k[h]),m=g.length-1;0<=m;m--)l[g[m].name]=g[m].value;d=a.a.f(d);var p=w.createElement("form");p.style.display="none";p.action=f;p.method="post";for(var q in d)c=w.createElement("input"),c.type="hidden",c.name=q,c.value=a.a.hc(a.a.f(d[q])),p.appendChild(c);b(l,function(a,b){var c=w.createElement("input");
c.type="hidden";c.name=a;c.value=b;p.appendChild(c)});w.body.appendChild(p);e.submitter?e.submitter(p):p.submit();setTimeout(function(){p.parentNode.removeChild(p)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.D);a.b("utils.arrayFirst",a.a.Lb);a.b("utils.arrayFilter",a.a.jb);a.b("utils.arrayGetDistinctValues",a.a.wc);a.b("utils.arrayIndexOf",a.a.A);a.b("utils.arrayMap",a.a.Mb);a.b("utils.arrayPushAll",a.a.Nb);a.b("utils.arrayRemoveItem",a.a.Pa);a.b("utils.cloneNodes",a.a.Ca);a.b("utils.createSymbolOrString",
a.a.Da);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",a.a.Jc);a.b("utils.getFormFields",a.a.Lc);a.b("utils.objectMap",a.a.Ga);a.b("utils.peekObservable",a.a.bc);a.b("utils.postJson",a.a.Od);a.b("utils.parseJson",a.a.Nd);a.b("utils.registerEventHandler",a.a.B);a.b("utils.stringifyJson",a.a.hc);a.b("utils.range",a.a.Pd);a.b("utils.toggleDomNodeCssClass",a.a.Eb);a.b("utils.triggerEvent",a.a.Fb);a.b("utils.unwrapObservable",a.a.f);a.b("utils.objectForEach",a.a.P);a.b("utils.addOrRemoveItem",
a.a.Na);a.b("utils.setTextContent",a.a.Bb);a.b("unwrap",a.a.f);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c="__ko__"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||"null"===f||!d[f]){if(!e)return n;f=a[c]="ko"+b++;d[f]=
{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==n))&&(a[b]=c)},Ub:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b("utils.domData",a.a.g);a.b("utils.domData.clear",a.a.g.clear);a.a.K=new function(){function b(b,c){var d=a.a.g.get(b,e);
d===n&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.g.clear(c);a.a.K.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},yb:function(c,
d){var f=b(c,!1);f&&(a.a.Pa(f,d),0==f.length&&a.a.g.set(c,e,n))},oa:function(b){a.u.G(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName("*")))});return b},removeNode:function(b){a.oa(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&"function"==typeof v.cleanData&&v.cleanData([a])}}};a.oa=a.a.K.oa;a.removeNode=a.a.K.removeNode;a.b("cleanNode",a.oa);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.K);a.b("utils.domNodeDisposal.addDisposeCallback",
a.a.K.za);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.K.yb);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode;
l.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement("div"),t;t=(p=p.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&f[p[1]]||b;p=t[0];t="ignored<div>"+t[1]+c+t[2]+"</div>";"function"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b,
c);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if("string"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b("utils.parseHtmlFragment",a.a.ua);a.b("utils.setHtml",a.a.fc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=f&&e.push({ud:c,Kd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],
e)}var c={};return{Xb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},bd:function(a,b){var f=c[a];if(f===n)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},cd:function(c,e){var f=
[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ud,k=[m];e&&a.a.Nb(k,e);a.aa.bd(f[g].Kd,k);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},Uc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.aa);a.b("memoization.memoize",a.aa.Xb);a.b("memoization.unmemoize",a.aa.bd);a.b("memoization.parseMemoText",a.aa.Uc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.aa.cd);a.na=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=
++c){h=f;a.a.Gc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):d=w&&"onreadystatechange"in w.createElement("script")?function(a){var b=w.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);
b=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Sd:b}}();a.b("tasks",a.na);a.b("tasks.schedule",a.na.zb);a.b("tasks.runEarly",a.na.Sd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},
c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f="function"==typeof e?e:"notifyWhenChangesStop"==e?Y:X;a.ub(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(c){var e,f=!1;return function(){if(!f){a.na.cancel(e);e=a.na.zb(c);try{f=!0,b.notifySubscribers(n,"dirty")}finally{f=
!1}}}}))},notify:function(a,c){a.equalityComparer="always"==c?null:K}};var W={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Ta);a.ic=function(b,c,d){this.da=b;this.lc=c;this.mc=d;this.Ib=!1;this.fb=this.Jb=null;a.L(this,"dispose",this.s);a.L(this,"disposeWhenNodeIsRemoved",this.l)};a.ic.prototype.s=function(){this.Ib||(this.fb&&a.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)};a.ic.prototype.l=function(b){this.Jb=b;a.a.K.za(b,this.fb=this.s.bind(this))};
a.T=function(){a.a.Ab(this,D);D.qb(this)};var D={qb:function(a){a.U={change:[]};a.sc=1},subscribe:function(b,c,d){var e=this;d=d||"change";var f=new a.ic(e,c?b.bind(c):b,function(){a.a.Pa(e.U[d],f);e.hb&&e.hb(d)});e.Qa&&e.Qa(d);e.U[d]||(e.U[d]=[]);e.U[d].push(f);return f},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Gb();if(this.Wa(c)){var d="change"===c&&this.ed||this.U[c].slice(0);try{a.u.xc();for(var e=0,f;f=d[e];++e)f.Ib||f.lc(b)}finally{a.u.end()}}},ob:function(){return this.sc},
Dd:function(a){return this.ob()!==a},Gb:function(){++this.sc},ub:function(b){var c=this,d=a.O(c),e,f,g,h,m;c.gb||(c.gb=c.notifySubscribers,c.notifySubscribers=Z);var k=b(function(){c.Ja=!1;d&&h===c&&(h=c.nc?c.nc():c());var a=f||m&&c.sb(g,h);m=f=e=!1;a&&c.gb(g=h)});c.qc=function(a,b){b&&c.Ja||(m=!b);c.ed=c.U.change.slice(0);c.Ja=e=!0;h=a;k()};c.pc=function(a){e||(g=a,c.gb(a,"beforeChange"))};c.rc=function(){m=!0};c.gd=function(){c.sb(g,c.v(!0))&&(f=!0)}},Wa:function(a){return this.U[a]&&this.U[a].length},
Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var c=0;a.a.P(this.U,function(a,b){"dirty"!==a&&(c+=b.length)});return c},sb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return"[object Object]"},extend:function(b){var c=this;b&&a.a.P(b,function(b,e){var f=a.Ta[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.L(D,"init",D.qb);a.L(D,"subscribe",D.subscribe);a.L(D,"extend",D.extend);a.L(D,"getSubscriptionsCount",D.Bd);a.a.Ba&&a.a.setPrototypeOf(D,
Function.prototype);a.T.fn=D;a.Qc=function(a){return null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.T);a.b("isSubscribable",a.Qc);a.S=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{xc:b,end:c,cc:function(b){if(e){if(!a.Qc(b))throw Error("Only subscribable things can act as dependencies");e.od.call(e.pd,b,b.fd||(b.fd=++f))}},G:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},qa:function(){if(e)return e.o.qa()},
Va:function(){if(e)return e.o.Va()},Ya:function(){if(e)return e.Ya},o:function(){if(e)return e.o}}}();a.b("computedContext",a.S);a.b("computedContext.getDependenciesCount",a.S.qa);a.b("computedContext.getDependencies",a.S.Va);a.b("computedContext.isInitial",a.S.Ya);a.b("computedContext.registerDependency",a.S.cc);a.b("ignoreDependencies",a.Yd=a.u.G);var I=a.a.Da("_latestValue");a.ta=function(b){function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya(),c[I]=arguments[0],c.xa()),this;
a.u.cc(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.T.fn);a.T.fn.qb(c);a.a.Ab(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,v:function(){return this[I]},xa:function(){this.notifySubscribers(this[I],"spectate");this.notifySubscribers(this[I])},ya:function(){this.notifySubscribers(this[I],"beforeChange")}};a.a.Ba&&a.a.setPrototypeOf(F,a.T.fn);var G=a.ta.Ma="__ko_proto__";F[G]=a.ta;a.O=function(b){if((b="function"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");
return!!b};a.Za=function(b){return"function"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Nc)};a.b("observable",a.ta);a.b("isObservable",a.O);a.b("isWriteableObservable",a.Za);a.b("isWritableObservable",a.Za);a.b("observable.fn",F);a.L(F,"peek",F.v);a.L(F,"valueHasMutated",F.xa);a.L(F,"valueWillMutate",F.ya);a.Ha=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.ta(b);a.a.Ab(b,
a.Ha.fn);return b.extend({trackArrayChanges:!0})};a.Ha.fn={remove:function(b){for(var c=this.v(),d=[],e="function"!=typeof b||a.O(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.ya();if(c[f]!==g)throw Error("Array modified during remove; cannot remove item");d.push(g);c.splice(f,1);f--}}d.length&&this.xa();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.ya();c.splice(0,c.length);this.xa();return d}return b?this.remove(function(c){return 0<=
a.a.A(b,c)}):[]},destroy:function(b){var c=this.v(),d="function"!=typeof b||a.O(b)?function(a){return a===b}:b;this.ya();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.xa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ya(),this.v()[d]=c,this.xa())},sorted:function(a){var c=this().slice(0);
return a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ha.fn,a.ta.fn);a.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){a.Ha.fn[b]=function(){var a=this.v();this.ya();this.zc(a,b,arguments);var d=a[b].apply(a,arguments);this.xa();return d===a?this:d}});a.a.D(["slice"],function(b){a.Ha.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Pc=function(b){return a.O(b)&&"function"==typeof b.remove&&"function"==
typeof b.push};a.b("observableArray",a.Ha);a.b("isObservableArray",a.Pc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa("arrayChange")){if(!f||1<m)f=a.a.Pb(k,d,b.Ob);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")}}e?c():(e=!0,h=b.subscribe(function(){++m},null,"spectate"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Ob={};c&&"object"==typeof c&&a.a.extend(b.Ob,c);b.Ob.sparse=!0;if(!b.zc){var e=!1,f=null,g,h,m=0,
k,l=b.Qa,p=b.hb;b.Qa=function(a){l&&l.call(b,a);"arrayChange"===a&&d()};b.hb=function(a){p&&p.call(b,a);"arrayChange"!==a||b.Wa("arrayChange")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.zc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,g=d.length,h=0;switch(c){case "push":h=p;case "unshift":for(c=0;c<g;c++)l("added",d[c],h+c);break;case "pop":h=p-1;case "shift":p&&l("deleted",b[h],h);break;case "splice":c=Math.min(Math.max(0,0>d[0]?p+d[0]:
d[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;c<h;++c,++n)c<p&&L.push(l("deleted",b[c],c)),c<g&&U.push(l("added",d[n],c));a.a.Kc(L,U);break;default:return}f=k}}}};var r=a.a.Da("_state");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}g.ra||
a.u.cc(e);(g.ka||g.J&&e.Xa())&&e.ha();return g.X}"object"===typeof b?d=b:(d=d||{},b&&(d.read=b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={X:n,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:d.read,nb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Rb:null,I:{},V:0,Ic:null};e[r]=g;e.Nc="function"===typeof f;a.a.Ba||a.a.extend(e,a.T.fn);a.T.fn.qb(e);a.a.Ab(e,C);d.pure?(g.wb=!0,g.J=!0,a.a.extend(e,da)):
d.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.jc=!0,g.l.nodeType||(g.l=null));g.J||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.K.za(g.l,g.Rb=function(){e.s()});return e};var C={equalityComparer:K,qa:function(){return this[r].V},Va:function(){var b=[];a.a.P(this[r].I,function(a,d){b[d.Ka]=d.da});return b},Vb:function(b){if(!this[r].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Vb&&a.Vb(b)})},uc:function(a,c,d){if(this[r].wb&&
c===this)throw Error("A 'pure' computed must not be called recursively");this[r].I[a]=d;d.Ka=this[r].V++;d.La=c.ob()},Xa:function(){var a,c,d=this[r].I;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ia&&c.da.Ja||c.da.Dd(c.La)))return!0},Jd:function(){this.Ia&&!this[r].rb&&this.Ia(!1)},ja:function(){var a=this[r];return a.ka||0<a.V},Rd:function(){this.Ja?this[r].ka&&(this[r].sa=!0):this.Hc()},$c:function(a){if(a.Hb){var c=a.subscribe(this.Jd,this,"dirty"),d=a.subscribe(this.Rd,
this);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Hc,this)},Hc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[r].Ic),this[r].Ic=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var c=this[r],d=c.Sa,e=!1;if(!c.rb&&!c.ra){if(c.l&&!a.a.Sb(c.l)||d&&d()){if(!c.jc){this.s();return}}else c.jc=!1;c.rb=!0;try{e=this.zd(b)}finally{c.rb=!1}return e}},zd:function(b){var c=this[r],d=!1,e=c.wb?n:!c.V,d={qd:this,mb:c.I,Qb:c.V};a.u.xc({pd:d,
od:ba,o:this,Ya:e});c.I={};c.V=0;var f=this.yd(c,d);c.V?d=this.sb(c.X,f):(this.s(),d=!0);d&&(c.J?this.Gb():this.notifySubscribers(c.X,"beforeChange"),c.X=f,this.notifySubscribers(c.X,"spectate"),!c.J&&b&&this.notifySubscribers(c.X),this.rc&&this.rc());e&&this.notifySubscribers(c.X,"awake");return d},yd:function(b,c){try{var d=b.Wc;return b.nb?d.call(b.nb):d()}finally{a.u.end(),c.Qb&&!b.J&&a.a.P(c.mb,aa),b.sa=b.ka=!1}},v:function(a){var c=this[r];(c.ka&&(a||!c.V)||c.J&&this.Xa())&&this.ha();return c.X},
ub:function(b){a.T.fn.ub.call(this,b);this.nc=function(){this[r].J||(this[r].sa?this.ha():this[r].ka=!1);return this[r].X};this.Ia=function(a){this.pc(this[r].X);this[r].ka=!0;a&&(this[r].sa=!0);this.qc(this,!a)}},s:function(){var b=this[r];!b.J&&b.I&&a.a.P(b.I,function(a,b){b.s&&b.s()});b.l&&b.Rb&&a.a.K.yb(b.l,b.Rb);b.I=n;b.V=0;b.ra=!0;b.sa=!1;b.ka=!1;b.J=!1;b.l=n;b.Sa=n;b.Wc=n;this.Nc||(b.nb=n)}},da={Qa:function(b){var c=this,d=c[r];if(!d.ra&&d.J&&"change"==b){d.J=!1;if(d.sa||c.Xa())d.I=null,d.V=
0,c.ha()&&c.Gb();else{var e=[];a.a.P(d.I,function(a,b){e[b.Ka]=a});a.a.D(e,function(a,b){var e=d.I[a],m=c.$c(e.da);m.Ka=b;m.La=e.La;d.I[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.ra||c.notifySubscribers(d.X,"awake")}},hb:function(b){var c=this[r];c.ra||"change"!=b||this.Wa("change")||(a.a.P(c.I,function(a,b){b.s&&(c.I[a]={da:b.da,Ka:b.Ka,La:b.La},b.s())}),c.J=!0,this.notifySubscribers(n,"asleep"))},ob:function(){var b=this[r];b.J&&(b.sa||this.Xa())&&this.ha();return a.T.fn.ob.call(this)}},ea={Qa:function(a){"change"!=
a&&"beforeChange"!=a||this.v()}};a.a.Ba&&a.a.setPrototypeOf(C,a.T.fn);var N=a.ta.Ma;C[N]=a.o;a.Oc=function(a){return"function"==typeof a&&a[N]===C[N]};a.Fd=function(b){return a.Oc(b)&&b[r]&&b[r].wb};a.b("computed",a.o);a.b("dependentObservable",a.o);a.b("isComputed",a.Oc);a.b("isPureComputed",a.Fd);a.b("computed.fn",C);a.L(C,"peek",C.v);a.L(C,"dispose",C.s);a.L(C,"isActive",C.ja);a.L(C,"getDependenciesCount",C.qa);a.L(C,"getDependencies",C.Va);a.xb=function(b,c){if("function"===typeof b)return a.o(b,
c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b("pureComputed",a.xb);(function(){function b(a,f,g){g=g||new d;a=f(a);if("object"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":h[c]=d;break;case "object":case "undefined":var l=g.get(d);h[c]=l!==
n?l:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.ad=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.O(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys,
b);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b("toJS",a.ad);a.b("toJSON",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return"function"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b("when",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?
a.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case "option":"string"===typeof c?(a.a.g.set(b,a.c.options.$b,n),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===
typeof c?c:"");break;case "select":if(""===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.M(b.options[f]),h==c||""===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.w);a.b("selectExtensions.readValue",a.w.M);a.b("selectExtensions.writeValue",a.w.cb);a.m=function(){function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,
-1));b+="\n,";var c=[],d=b.match(e),p,q=[],h=0;if(1<d.length){for(var x=0,B;B=d[x];++x){var u=B.charCodeAt(0);if(44===u){if(0>=h){c.push(p&&q.length?{key:p,value:q.join("")}:{unknown:p||q.join("")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1<B.length&&(47===B.charCodeAt(1)||42===B.charCodeAt(1)))continue;else 47===u&&x&&1<B.length?(u=d[x-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),x=-1,B="/"):40===u||123===u||91===u?++h:
41===u||125===u||93===u?--h:p||q.length||34!==u&&39!==u||(B=B.slice(1,-1));q.push(B)}if(0<h)throw Error("Unbalanced parentheses, braces, or brackets");}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1,"typeof":1},
h={};return{Ra:[],wa:h,ac:b,vb:function(e,f){function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.preprocess&&!(e=k.preprocess(e,b,l)))return;if(k=h[b])f=e,0<=a.a.A(c,f)?f=!1:(k=f.match(d),f=null===k?!1:k[1]?"Object("+k[1]+")"+k[2]:f),k=f;k&&q.push("'"+("string"==typeof h[b]?h[b]:b)+"':function(_z){"+f+"=_z}")}g&&(e="function(){return "+e+" }");p.push("'"+b+"':"+e)}f=f||{};var p=[],q=[],g=f.valueAccessors,x=f.bindingParams,B="string"===typeof e?b(e):e;a.a.D(B,function(a){l(a.key||a.unknown,
a.value)});q.length&&l("_ko_property_writers","{"+q.join(",")+" }");return p.join(",")},Id:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},eb:function(b,c,d,e,f){if(b&&a.O(b))!a.Za(b)||f&&b.v()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.m);a.b("expressionRewriting.bindingRewriteValidators",a.m.Ra);a.b("expressionRewriting.parseObjectLiteral",a.m.ac);a.b("expressionRewriting.preProcessBindings",a.m.vb);a.b("expressionRewriting._twoWayBindings",
a.m.wa);a.b("jsonExpressionRewriting",a.m);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.m.vb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?
0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&"\x3c!--test--\x3e"===w.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0},k="__ko_matchedEndComment__";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Tb(c)},va:function(c,d){if(b(c)){a.h.Ea(c);for(var e=
c.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.va(c,d)},Vc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Wb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.h.Vc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error("Found invalid end comment, as the first child of "+
a);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,k))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},Cd:b,Vd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Sc:function(d){if(m[a.a.R(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=
g:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b("virtualElements",a.h);a.b("virtualElements.allowedBindings",a.h.ea);a.b("virtualElements.emptyNode",a.h.Ea);a.b("virtualElements.insertAfter",a.h.Wb);a.b("virtualElements.prepend",a.h.Vc);a.b("virtualElements.setDomNodeChildren",a.h.va);(function(){a.ga=function(){this.nd={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=
b.getAttribute("data-bind")||a.j.getComponentNameForNode(b);case 8:return a.h.Cd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.tc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.tc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.h.Vd(b);default:return null}},
parseBindingsString:function(b,c,d,e){try{var f=this.nd,g=b+(e&&e.valueAccessors||""),h;if(!(h=f[g])){var m,k="with($context){with($data||{}){return{"+a.m.vb(b,e)+"}}}";m=new Function("$context","$element",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+l.message,l;}}});a.ga.instance=new a.ga})();a.b("bindingProvider",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}function c(c,d,e){this.node=c;this.yc=
d;this.kb=[];this.H=!1;d.N||a.a.K.za(c,b);e&&e.N&&(e.N.kb.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return"function"===typeof b?f(b.bind(null,c,e)):a.a.Ga(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.h.nextSibling(e),l.call(f,e);
d=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),k(b,e)}a.i.ma(c,a.i.H)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.R(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.D(k.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));
ca(c)}}),e.length--),c.push({key:f,Mc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error("You cannot apply bindings multiple times to the same element.");f.hd=!0}k||(f.context=d);f.Zb||(f.Zb={});var g;if(c&&"function"!==typeof c)g=c;else{var p=a.ga.instance,q=p.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):q.call(p,b,d)){if(d[t])d[t]();if(d[B])d[B]()}return g},null,{l:b});g&&m.ja()||(m=null)}var x=d,u;if(g){var J=function(){return a.a.Ga(m?m():
g,e)},r=m?function(a){return function(){return e(m()[a])}}:function(a){return g[a]};J.get=function(a){return g[a]&&e(r(a))};J.has=function(a){return a in g};a.i.H in g&&a.i.subscribe(b,a.i.H,function(){var c=(0,g[a.i.H])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Ec(d[0]))}});a.i.pa in g&&(x=a.i.Cb(b,d),a.i.subscribe(b,a.i.pa,function(){var c=(0,g[a.i.pa])();c&&a.h.firstChild(b)&&c(b)}));f=l(g);a.a.D(f,function(c){var d=c.Mc.init,e=c.Mc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error("The binding '"+
f+"' cannot be used with virtual elements");try{"function"==typeof d&&a.u.G(function(){var a=d(b,r(f),J,x.$data,x);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error("Multiple bindings ("+u+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=f}}),"function"==typeof e&&a.$(function(){e(b,r(f),J,x.$data,x)},null,{l:b})}catch(k){throw k.message='Unable to process binding "'+f+": "+g[f]+'"\nMessage: '+k.message,
k;}})}f=u===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&x}}function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}var t=a.a.Da("_subscribable"),x=a.a.Da("_ancestorBindingInfo"),B=a.a.Da("_dataDependency");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.fa=function(b,c,d,e,f){function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c[x])):(l.$parents=[],l.$root=f,l.ko=a);l[t]=q;g?f=l.$data:(l.$rawData=
b,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[t]&&!a.S.o().Vb(c[t]))c[t]();m&&(l[B]=m);return l.$data}var l=this,g=b===J,h=g?n:b,p="function"==typeof h&&!a.O(h),q,m=f&&f.dataDependency;f&&f.exportDependencies?k():(q=a.xb(k),q.v(),q.ja()?q.equalityComparer=null:l[t]=n)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&"object"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f="function"==typeof b&&!a.O(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,
this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,"function"==typeof b?b(c):b)},c)};var z=a.a.g.Z();c.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};c.prototype.sd=function(b){a.a.Pa(this.kb,b);!this.kb.length&&this.H&&this.Cc()};c.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=
null,a.a.K.yb(this.node,b),a.i.ma(this.node,a.i.pa),this.Tc())};a.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(b,c,d,e,f){var k=a.a.g.Ub(b,z,{});k.Fa||(k.Fa=new a.T);f&&f.notifyImmediately&&k.Zb[c]&&a.u.G(d,e,[b]);return k.Fa.subscribe(d,e,c)},ma:function(b,c){var d=a.a.g.get(b,z);if(d&&(d.Zb[c]=!0,d.Fa&&d.Fa.notifySubscribers(b,c),c==a.i.H))if(d.N)d.N.Cc();else if(d.N===n&&d.Fa&&d.Fa.Wa(a.i.pa))throw Error("descendantsComplete event not supported for bindings on this node");
},Cb:function(b,d){var e=a.a.g.Ub(b,z,{});e.N||(e.N=new c(b,e,d[x]));return d[x]==e?d:d.extend(function(a){a[x]=e})}};a.Td=function(b){return(b=a.a.g.get(b,z))&&b.context};a.ib=function(b,c,d){1===b.nodeType&&a.h.Sc(b);return p(b,c,q(d))};a.ld=function(b,c,d){d=q(d);return a.ib(b,g(c,d,b),d)};a.Oa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(q(a),b)};a.vc=function(a,b,c){!v&&A.jQuery&&(v=A.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");
}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b("bindingHandlers",a.c);a.b("bindingEvent",a.i);a.b("bindingEvent.subscribe",a.i.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.i.Cb);a.b("applyBindings",a.vc);a.b("applyBindingsToDescendants",a.Oa);
a.b("applyBindingAccessorsToNode",a.ib);a.b("applyBindingsToNode",a.ld);a.b("contextFor",a.Dc);a.b("dataFor",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,
c)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}):
a.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b("components",a.j);a.b("components.get",a.j.get);a.b("components.clearCachedDefinition",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc("loadTemplate",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc("loadViewModel",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});
else if("function"===typeof b[m])d(b[m]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.R(b)){case "script":return a.a.ua(b.text);case "textarea":return a.a.ua(b.value);case "template":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?
T||A.require?(T||A.require)([b.require],function(a){a&&"object"===typeof a&&a.Xd&&a["default"]&&(a=a["default"]);c(a)}):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.j.tb(b))throw Error("Component "+b+" is already registered");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];
a.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var h=w.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+
c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m="createViewModel";a.b("components.register",a.j.register);a.b("components.isRegistered",a.j.tb);a.b("components.unregister",a.j.unregister);a.b("components.defaultLoader",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f,
function(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');
var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,
b,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;"function"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;"string"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error("No component name specified");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error("Unknown component '"+h+"'");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t});
d=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={"class":"className","for":"htmlFor"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===
d||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));"name"===c&&a.a.Yc(b,h?"":d)})}};(function(){a.c.checked={after:["value","attr"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k,
d,"checked",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has("checkedValue"))return a.a.f(d.get("checkedValue"));if(q)return d.has("value")?a.a.f(d.get("value")):b.value}),h="checkbox"==b.type,m="radio"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,"click",e);a.o(f,null,{l:b});
k=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c["class"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&"object"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c["class"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.c.disable=
{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){"string"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c);
if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=
!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,"focus",f);a.a.B(b,"focusin",f);a.a.B(b,"blur",g);a.a.B(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===
d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?"focusin":"focusout"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus="hasfocus";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get("as");var u=h.get("noChildContext");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t=
"render"==h.get("completeOn"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext("function"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();a.c.let={init:function(b,
c,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if("select"!==a.a.R(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.jb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=
0<=a.a.A(t,a.w.M(d[0]));a.a.Zc(d[0],e);x&&!e&&a.u.G(a.a.Fb,null,[b,"change"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.f(c()),l=d.get("valueAllowUnset")&&d.has("value"),p=d.get("optionsIncludeDestroyed");c={};var q,t=[];l||(h?t=a.a.Mb(e(),a.w.M):0<=b.selectedIndex&&t.push(a.w.M(b.options[b.selectedIndex])));k&&("undefined"==typeof k.length&&(k=[k]),q=a.a.jb(k,function(b){return p||b===n||null===b||!a.a.f(b._destroy)}),d.has("optionsCaption")&&(k=a.a.f(d.get("optionsCaption")),null!==
k&&k!==n&&q.unshift(Q)));var x=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(k=function(b,c){g(0,c);a.u.G(d.get("optionsAfterRender"),null,[c[0],b!==Q?b:n])});a.a.ec(b,q,function(c,e,g){g.length&&(t=!l&&g[0].selected?[a.w.M(g[0])]:[],x=!0);e=b.ownerDocument.createElement("option");c===Q?(a.a.Bb(e,d.get("optionsCaption")),a.w.cb(e,n)):(g=f(c,d.get("optionsValue"),c),a.w.cb(e,a.a.f(g)),c=f(c,d.get("optionsText"),g),
a.a.Bb(e,c));return[e]},c,k);if(!l){var B;h?B=t.length&&e().length<t.length:B=t.length&&0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex])!==t[0]:t.length||0<=b.selectedIndex;B&&a.u.G(a.a.Fb,null,[b,"change"])}(l||a.S.Ya())&&a.i.ma(b,a.i.H);a.a.wd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.$b=a.a.g.Z();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.w.M(b))});a.m.eb(e,d,"selectedOptions",
f)}function f(){var d=a.a.f(c()),e=b.scrollTop;d&&"number"==typeof d.length&&a.a.D(b.getElementsByTagName("option"),function(b){var c=0<=a.a.A(d,a.w.M(b));b.selected!=c&&a.a.Zc(b,c)});b.scrollTop=e}if("select"!=a.a.R(b))throw Error("selectedOptions binding applies only to SELECT elements");var g;a.i.subscribe(b,a.i.H,function(){g?e():(a.a.B(b,"change",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.wa.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.f(c()||
{});a.a.P(d,function(c,d){d=a.a.f(d);if(null===d||d===n||!1===d)d="";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+"px")}})}};a.c.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.B(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?
a.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Bb(b,c())}};a.h.ea.text=!0;(function(){if(A&&A.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=A.navigator.userAgent,d,e,f,g,h;(d=A.opera&&A.opera.version&&parseInt(A.opera.version()))||(h=b(c.match(/Edge\/([^ ]+)$/)))||b(c.match(/Chrome\/([^ ]+)/))||(e=b(c.match(/Version\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||
(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,"selectionchange",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d="";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z,
4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,"textInput",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l("keypress",z);11>g&&l("propertychange",function(a){y||"value"!==a.propertyName||A(a)});8==g&&(l("keyup",z),l("keydown",z));p&&(p(b,A),l("dragend",r));(!g||9<=g)&&l("input",A);5>e&&"textarea"===a.a.R(b)?(l("keydown",r),l("paste",r),l("cut",r)):11>d?l("keydown",r):4>f?(l("DOMAutoComplete",z),l("dragdrop",z),l("drop",z)):h&&"number"===b.type&&l("keydown",r);l("change",
z);l("blur",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c("textInput",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f="input"==
e;if(!f||"checkbox"!=b.type&&"radio"!=b.type){var g=[],h=d.get("valueUpdate"),m=!1,k=null;h&&("string"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,"change"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,"value",f)};!a.a.W||!f||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.A(g,"propertychange")||(a.a.B(b,"propertychange",function(){m=!0}),a.a.B(b,"focus",function(){m=!1}),a.a.B(b,"blur",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,"after")&&
(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&"file"==b.type?function(){var d=a.a.f(c());null===d||d===n||""===d?b.value="":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)"select"===e?(g=d.get("valueAllowUnset"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if("select"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get("valueAllowUnset")?p():l():(a.a.B(b,"change",l),q=a.o(p,null,{l:b}))},
null,{notifyImmediately:!0})}else a.a.B(b,"change",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");
a.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ca.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error("Unknown template type: "+b);};a.ca.prototype.renderTemplate=
function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,
l)){var p=m[l];if("function"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error("This template engine does not support the '"+l+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.m.vb(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b("__tr_ambtns",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c=
a.a.R(b);this.ab="script"===c?1:"textarea"===c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[b];var c=arguments[0];"innerHTML"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+"_";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F;
if(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text("");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F,
c,{bb:arguments[0]})};a.b("templateSources",a.C);a.b("templateSources.domElement",a.C.F);a.b("templateSources.anonymousTemplate",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):
(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.templateEngine||g;a.kc.xd(f,B,n);f=B.renderTemplate(f,h,m,n);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");n=!1;switch(e){case "replaceChildren":a.h.va(b,
f);n=!0;break;case "replaceNode":a.a.Xc(b,f);n=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}n&&(c(f,h),m.afterRender&&a.u.G(m.afterRender,null,[f,h[m.as||"$data"]]),"replaceChildren"==e&&a.i.ma(b,a.i.H));return f}function f(b,c,d){return a.O(b)?b():"function"===typeof b?b(c,d):b}var g;a.gc=function(b){if(b!=n&&!(b instanceof a.ca))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.dc=function(b,c,h,m,t){h=h||{};if((h.templateEngine||g)==
n)throw Error("Set a template engine before calling renderTemplate");t=t||"replaceChildren";if(m){var x=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(m,t,n,g,h);"replaceNode"==t&&(m=g,x=d(m))},null,{Sa:function(){return!x||!a.a.Sb(x)},l:x&&"replaceNode"==t?x.parentNode:x})}return a.aa.Xb(function(d){a.dc(b,c,h,d,"replaceNode")})};a.Qd=function(b,d,g,h,m){function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}
function r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildContext,extend:function(a){a.$index=c;z&&(a[z+"Index"]=c)}});var d=f(b,a,v);return e(h,"ignoreTargetNode",d,v,g)}var v,z=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Pc(d))return a.$(function(){var b=a.a.f(d)||[];"undefined"==typeof b.length&&(b=[b]);w&&(b=a.a.jb(b,function(b){return b===n||null===b||
!a.a.f(b._destroy)}));x(b)},null,{l:h});x(d.v());var A=d.subscribe(function(a){x(d(),a)},null,"arrayChange");A.l(h);return A};var h=a.a.g.Z(),m=a.a.g.Z();a.c.template={init:function(b,c){var d=a.a.f(c());if("string"==typeof d||"name"in d)a.h.Ea(b);else if("nodes"in d){d=d.nodes||[];if(a.O(d))throw Error('The "nodes" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Yb(d),a.a.g.set(e,m,!0));(new a.C.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=
a.a.Yb(d),(new a.C.ia(b)).nodes(e);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.f(g);d=!0;e=null;"string"==typeof c?c={}:(g="name"in c?c.name:b,"if"in c&&(d=a.a.f(c["if"])),d&&"ifnot"in c&&(d=!a.a.f(c.ifnot)),d&&!g&&(d=!1));"foreach"in c?e=a.Qd(g,d&&c.foreach||[],c,b,f):d?(d=f,"data"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),
e=a.dc(g,d,c,b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&"function"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?n:f)}};a.m.Ra.template=function(b){b=a.m.ac(b);return 1==b.length&&b[0].unknown||a.m.Id(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.h.ea.template=!0})();a.b("setTemplateEngine",a.gc);a.b("renderTemplate",a.dc);a.a.Kc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===
m.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Pb=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d.length,r=n-p||1,v=p+n+1,u,w,z;for(l=0;l<=p;l++)for(w=u,k.push(u=[]),z=h(n,l+r),q=m(0,l-1);q<=z;q++)u[q]=q?l?b[l-1]===d[q-1]?w[q-1]:h(w[q]||v,u[q-1]||v)+1:q+1:l+1;h=[];m=[];r=[];l=p;for(q=n;l||q;)n=k[l][q]-1,q&&n===k[l][q-1]?m.push(h[h.length]={status:e,value:d[--q],index:q}):l&&n===k[l-1][q]?r.push(h[h.length]={status:f,value:b[--l],index:l}):
(--q,--l,g.sparse||h.push({status:"retained",value:d[q]}));a.a.Kc(r,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Pb);(function(){function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))||[];0<k.length&&(a.a.Xc(k,l),h&&a.u.G(h,null,[d,l,m]));k.length=0;a.a.Nb(k,l)},null,{l:b,Sa:function(){return!a.a.kd(k)}});
return{Y:k,$:l.ja()?l:n}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.ec=function(e,f,g,h,m,k){function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.push(y)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];"undefined"==typeof f.length&&(f=[f]);h=h||{};var t=a.a.g.get(e,c),r=!t,v=[],u=0,w=0,z=[],A=[],C=[],D=[],F=[],y,I=0;if(r)a.a.D(f,l);else{if(!k||t&&t._countWaitingForRemove){var E=
a.a.Mb(t,function(a){return a.Aa});k=a.a.Pb(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=k[E];E++)switch(H=G.moved,K=G.index,G.status){case "deleted":for(;u<K;)p(u++);H===n&&(y=t[u],y.$&&(y.$.s(),y.$=n),a.a.Ua(y.Y,e).length&&(h.beforeRemove&&(v.push(y),I++,y.Aa===d?y=null:C.push(y)),y&&z.push.apply(z,y.Y)));u++;break;case "added":for(;w<K;)p(u++);H!==n?(A.push(v.length),p(H)):l(G.value)}for(;w<f.length;)p(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);q(h.beforeMove,D);a.a.D(z,
h.beforeRemove?a.oa:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(A.length)for(;(E=A.shift())!=n;){y=v[E];for(M=n;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M)}for(E=0;y=v[E];E++){y.Y||a.a.extend(y,b(e,g,y.Aa,m,y.pb));for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M);!y.Ed&&m&&(m(y.Aa,y.Y,y.pb),y.Ed=!0,M=y.Y[y.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();q(h.beforeRemove,C);for(E=0;E<C.length;++E)C[E].Aa=d;q(h.afterMove,D);
q(h.afterAdd,F)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.ec);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b("nativeTemplateEngine",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();
this.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=v.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement("div"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+
a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(v.tmpl.tag.ko_code={open:"__.push($1 || '');"},v.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.$a.prototype=new a.ca;a.$a.prototype.constructor=a.$a;var b=new a.$a;0<b.Hd&&a.gc(b);a.b("jqueryTmplTemplateEngine",a.$a)})()})})();})();
;
/*=============================================================================
	Author:			Eric M. Barnard - @ericmbarnard								
	License:		MIT (http://opensource.org/licenses/mit-license.php)		
																				
	Description:	Validation Library for KnockoutJS							
	Version:		2.0.4											
===============================================================================
*/

!function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?e(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],e):e(ko,ko.validation={})}(function(f,e){if(void 0===f)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");f.validation=e;var t,i,a,c=f.validation,o=f.utils,p=o.unwrapObservable,n=o.arrayForEach,u=o.extend,r={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},s=u({},r);s.html5Attributes=["required","pattern","min","max","step"],s.html5InputTypes=["email","number","date"],s.reset=function(){u(s,r)},c.configuration=s,c.utils=(t=(new Date).getTime(),i={},a="__ko_validation__",{isArray:function(e){return e.isArray||"[object Array]"===Object.prototype.toString.call(e)},isObject:function(e){return null!==e&&"object"==typeof e},isNumber:function(e){return!isNaN(e)},isObservableArray:function(e){return!!e&&"function"==typeof e.remove&&"function"==typeof e.removeAll&&"function"==typeof e.destroy&&"function"==typeof e.destroyAll&&"function"==typeof e.indexOf&&"function"==typeof e.replace},values:function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},getValue:function(e){return"function"==typeof e?e():e},hasAttribute:function(e,t){return null!==e.getAttribute(t)},getAttribute:function(e,t){return e.getAttribute(t)},setAttribute:function(e,t,r){return e.setAttribute(t,r)},isValidatable:function(e){return!!(e&&e.rules&&e.isValid&&e.isModified)},insertAfter:function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},newId:function(){return t+=1},getConfigOptions:function(e){return c.utils.contextFor(e)||c.configuration},setDomData:function(e,t){var r=e[a];r||(e[a]=r=c.utils.newId()),i[r]=t},getDomData:function(e){var t=e[a];if(t)return i[t]},contextFor:function(e){switch(e.nodeType){case 1:case 8:var t=c.utils.getDomData(e);if(t)return t;if(e.parentNode)return c.utils.contextFor(e.parentNode)}},isEmptyVal:function(e){return null==e||""===e},getOriginalElementTitle:function(e){var t=c.utils.getAttribute(e,"data-orig-title"),r=e.title;return c.utils.hasAttribute(e,"data-orig-title")?t:r},async:function(e){window.setImmediate?window.setImmediate(e):window.setTimeout(e,0)},forEach:function(e,t){if(c.utils.isArray(e))return n(e,t);for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)}});var l,d,v,g=(l=0,d=c.configuration,v=c.utils,{init:function(e,t){0<l&&!t||((e=e||{}).errorElementClass=e.errorElementClass||e.errorClass||d.errorElementClass,e.errorMessageClass=e.errorMessageClass||e.errorClass||d.errorMessageClass,u(d,e),d.registerExtenders&&c.registerExtenders(),l=1)},reset:c.configuration.reset,group:function(t,r){var i={options:r=u(u({},d.grouping),r),graphMonitor:f.observable(),flagged:[],subscriptions:[],validatables:[]},a=null;return(a=r.observable?f.computed(function(){return i.graphMonitor(),b(t,i),F(i.validatables)}):function(){return b(t,i),F(i.validatables)}).showAllMessages=function(t){void 0===t&&(t=!0),a.forEach(function(e){v.isValidatable(e)&&e.isModified(t)})},a.isAnyMessageShown=function(){return!!a.find(function(e){return v.isValidatable(e)&&!e.isValid()&&e.isModified()})},a.filter=function(e){return e=e||function(){return!0},a(),o.arrayFilter(i.validatables,e)},a.find=function(e){return e=e||function(){return!0},a(),o.arrayFirst(i.validatables,e)},a.forEach=function(e){e=e||function(){},a(),n(i.validatables,e)},a.map=function(e){return e=e||function(e){return e},a(),o.arrayMap(i.validatables,e)},a._updateState=function(e){if(!v.isObject(e))throw new Error("An object is required.");if(t=e,!r.observable)return b(e,i),F(i.validatables);i.graphMonitor.valueHasMutated()},a},formatMessage:function(e,t,r){if(v.isObject(t)&&t.typeAttr&&(t=t.value),"function"==typeof e)return e(t,r);var i=p(t);return null==i&&(i=[]),v.isArray(i)||(i=[i]),e.replace(/{(\d+)}/gi,function(e,t){return void 0!==i[t]?i[t]:e})},addRule:function(e,t){return e.extend({validatable:!0}),o.arrayFirst(e.rules(),function(e){return e.rule&&e.rule===t.rule})||e.rules.push(t),e},addAnonymousRule:function(e,t){void 0===t.message&&(t.message="Error"),t.onlyIf&&(t.condition=t.onlyIf),c.addRule(e,t)},addExtender:function(r){f.extenders[r]=function(e,t){return t&&(t.message||t.onlyIf)?c.addRule(e,{rule:r,message:t.message,params:!!v.isEmptyVal(t.params)||t.params,condition:t.onlyIf}):c.addRule(e,{rule:r,params:t})}},registerExtenders:function(){if(d.registerExtenders)for(var e in c.rules)c.rules.hasOwnProperty(e)&&(f.extenders[e]||c.addExtender(e))},insertValidationMessage:function(e){var t=document.createElement("SPAN");return t.className=v.getConfigOptions(e).errorMessageClass,v.insertAfter(e,t),t},parseInputValidationAttributes:function(i,a){n(c.configuration.html5Attributes,function(e){if(v.hasAttribute(i,e)){var t=i.getAttribute(e)||!0;if("min"===e||"max"===e){var r=i.getAttribute("type");void 0!==r&&r||(r="text"),t={typeAttr:r,value:t}}c.addRule(a(),{rule:e,params:t})}});var t=i.getAttribute("type");n(c.configuration.html5InputTypes,function(e){e===t&&c.addRule(a(),{rule:"date"===e?"dateISO":e,params:!0})})},writeInputValidationAttributes:function(i,e){var t=e();if(t&&t.rules){var a=t.rules();n(c.configuration.html5Attributes,function(t){var r=o.arrayFirst(a,function(e){return e.rule&&e.rule.toLowerCase()===t.toLowerCase()});r&&f.computed({read:function(){var e=f.unwrap(r.params);"pattern"===r.rule&&e instanceof RegExp&&(e=e.source),i.setAttribute(t,e)},disposeWhenNodeIsRemoved:i})}),a=null}},makeBindingHandlerValidatable:function(e){var n=f.bindingHandlers[e].init;f.bindingHandlers[e].init=function(e,t,r,i,a){return n(e,t,r,i,a),f.bindingHandlers.validationCore.init(e,t,r,i,a)}},setRules:function(e,t){var d=function(e,t){if(e&&t)for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(e[r]){var a=e[r],n=p(a),s={},u={};for(var l in i)i.hasOwnProperty(l)&&(c.rules[l]?s[l]=i[l]:u[l]=i[l]);if(f.isObservable(a)&&a.extend(s),n&&v.isArray(n))for(var o=0;o<n.length;o++)d(n[o],u);else d(n,u)}}};d(e,t)}});function m(e){n(e.subscriptions,function(e){e.dispose()}),e.subscriptions=[]}function b(e,t){t.validatables=[],m(t),function t(e,r,i){var a=[],n=e.peek?e.peek():e;!0!==e.__kv_traversed&&(r.options.deep&&(e.__kv_traversed=!0,r.flagged.push(e)),i=void 0!==i?i:r.options.deep?1:-1,f.isObservable(e)&&(e.errors||v.isValidatable(e)||e.extend({validatable:!0}),r.validatables.push(e),r.options.live&&v.isObservableArray(e)&&r.subscriptions.push(e.subscribe(function(){r.graphMonitor.valueHasMutated()}))),n&&!n._destroy&&(v.isArray(n)?a=n:v.isObject(n)&&(a=v.values(n))),0!==i&&v.forEach(a,function(e){!e||e.nodeType||f.isComputed(e)&&!e.rules||t(e,r,i+1)}))}(e,t),function(e){e.options.deep&&(n(e.flagged,function(e){delete e.__kv_traversed}),e.flagged.length=0),e.options.live||m(e)}(t)}function F(e){var t=[];return n(e,function(e){v.isValidatable(e)&&!e.isValid()&&t.push(e.error.peek())}),t}function y(u){var l="max"===u;return function(e,t){if(c.utils.isEmptyVal(e))return!0;var r,i,a,n,s;switch(r=void 0===t.typeAttr?(i="text",t):(i=t.typeAttr,t.value),isNaN(r)||r instanceof Date||(i="number"),i.toLowerCase()){case"week":if(a=/^(\d{4})-W(\d{2})$/,null===(n=e.match(a)))throw new Error("Invalid value for "+u+" attribute for week input.  Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return!!(s=r.match(a))&&(l?n[1]<s[1]||n[1]===s[1]&&n[2]<=s[2]:n[1]>s[1]||n[1]===s[1]&&n[2]>=s[2]);case"month":if(a=/^(\d{4})-(\d{2})$/,null===(n=e.match(a)))throw new Error("Invalid value for "+u+" attribute for month input.  Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return!!(s=r.match(a))&&(l?n[1]<s[1]||n[1]===s[1]&&n[2]<=s[2]:n[1]>s[1]||n[1]===s[1]&&n[2]>=s[2]);case"number":case"range":return l?!isNaN(e)&&parseFloat(e)<=parseFloat(r):!isNaN(e)&&parseFloat(e)>=parseFloat(r);default:return l?e<=r:r<=e}}}function h(i,a,n){i.isValidating(!0);function e(e){var t=!1,r="";i.__valid__()&&(e.message?(t=e.isValid,r=e.message):t=e,t||(i.error(c.formatMessage(r||n.message||a.message,p(n.params),i)),i.__valid__(t))),i.isValidating(!1)}c.utils.async(function(){a.validator(i(),void 0===n.params||p(n.params),e)})}u(f.validation,g),c.rules={},c.rules.required={validator:function(e,t){var r;return null==e?!t:("string"==typeof(r=e)&&(r=String.prototype.trim?e.trim():e.replace(/^\s+|\s+$/g,"")),!t||0<(r+"").length)},message:"This field is required."},c.rules.min={validator:y("min"),message:"Please enter a value greater than or equal to {0}."},c.rules.max={validator:y("max"),message:"Please enter a value less than or equal to {0}."},c.rules.minLength={validator:function(e,t){return!!c.utils.isEmptyVal(e)||(c.utils.isNumber(e)?""+e:e).length>=t},message:"Please enter at least {0} characters."},c.rules.maxLength={validator:function(e,t){return!!c.utils.isEmptyVal(e)||(c.utils.isNumber(e)?""+e:e).length<=t},message:"Please enter no more than {0} characters."},c.rules.pattern={validator:function(e,t){return c.utils.isEmptyVal(e)||null!==e.toString().match(t)},message:"Please check this value."},c.rules.step={validator:function(e,t){if(c.utils.isEmptyVal(e)||"any"===t)return!0;var r=100*e%(100*t);return Math.abs(r)<1e-5||Math.abs(1-r)<1e-5},message:"The value must increment by {0}."},c.rules.email={validator:function(e,t){return!t||(c.utils.isEmptyVal(e)||t&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e))},message:"Please enter a proper email address."},c.rules.date={validator:function(e,t){return!t||(c.utils.isEmptyVal(e)||t&&!/Invalid|NaN/.test(new Date(e)))},message:"Please enter a proper date."},c.rules.dateISO={validator:function(e,t){return!t||(c.utils.isEmptyVal(e)||t&&/^\d{4}[-/](?:0?[1-9]|1[012])[-/](?:0?[1-9]|[12][0-9]|3[01])$/.test(e))},message:"Please enter a proper date."},c.rules.number={validator:function(e,t){return!t||(c.utils.isEmptyVal(e)||t&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e))},message:"Please enter a number."},c.rules.digit={validator:function(e,t){return!t||(c.utils.isEmptyVal(e)||t&&/^\d+$/.test(e))},message:"Please enter a digit."},c.rules.phoneUS={validator:function(e,t){return!t||(!!c.utils.isEmptyVal(e)||"string"==typeof e&&(e=e.replace(/\s+/g,""),t&&9<e.length&&e.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)))},message:"Please specify a valid phone number."},c.rules.equal={validator:function(e,t){var r=t;return e===c.utils.getValue(r)},message:"Values must equal."},c.rules.notEqual={validator:function(e,t){var r=t;return e!==c.utils.getValue(r)},message:"Please choose another value."},c.rules.unique={validator:function(t,r){var e=c.utils.getValue(r.collection),i=c.utils.getValue(r.externalValue),a=0;return!t||!e||(o.arrayFilter(e,function(e){t===(r.valueAccessor?r.valueAccessor(e):e)&&a++}),a<(i?1:2))},message:"Please make sure the value is unique."},c.registerExtenders(),f.bindingHandlers.validationCore={init:function(e,t,r,i,a){var n=c.utils.getConfigOptions(e),s=t();if(n.parseInputAttributes&&c.utils.async(function(){c.parseInputValidationAttributes(e,t)}),n.insertMessages&&c.utils.isValidatable(s)){var u=c.insertValidationMessage(e);n.messageTemplate?f.renderTemplate(n.messageTemplate,{field:s},null,u,"replaceNode"):f.applyBindingsToNode(u,{validationMessage:s})}n.writeInputAttributes&&c.utils.isValidatable(s)&&c.writeInputValidationAttributes(e,t),n.decorateInputElement&&c.utils.isValidatable(s)&&f.applyBindingsToNode(e,{validationElement:s})}},c.makeBindingHandlerValidatable("value"),c.makeBindingHandlerValidatable("checked"),f.bindingHandlers.textInput&&c.makeBindingHandlerValidatable("textInput"),c.makeBindingHandlerValidatable("selectedOptions"),f.bindingHandlers.validationMessage={update:function(e,t){var r,i,a=t(),n=c.utils.getConfigOptions(e);p(a);if(null==a)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+e.getAttribute("data-bind"));r=a.isModified&&a.isModified(),i=a.isValid&&a.isValid();var s=null;n.messagesOnModified&&!r||(s=i?null:a.error);var u=!(n.messagesOnModified&&!r)&&!i,l="none"!==e.style.display;n.allowHtmlMessages?o.setHtml(e,s):f.bindingHandlers.text.update(e,function(){return s}),l&&!u?e.style.display="none":!l&&u&&(e.style.display="")}},f.bindingHandlers.validationElement={update:function(r,e,t){var i,a,n=e(),s=c.utils.getConfigOptions(r);p(n);if(null==n)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+r.getAttribute("data-bind"));i=n.isModified&&n.isModified(),a=n.isValid&&n.isValid();f.bindingHandlers.css.update(r,function(){var e={},t=!(s.decorateElementOnModified&&!i)&&!a;return e[s.errorElementClass]=t,e},t),s.errorsAsTitle&&f.bindingHandlers.attr.update(r,function(){var e=!s.errorsAsTitleOnModified||i,t=c.utils.getOriginalElementTitle(r);return e&&!a?{title:n.error,"data-orig-title":t}:!e||a?{title:t,"data-orig-title":null}:void 0})}},f.bindingHandlers.validationOptions={init:function(e,t,r,i,a){var n=p(t());if(n){var s=u({},c.configuration);u(s,n),c.utils.setDomData(e,s)}}},f.extenders.validation=function(t,e){return n(c.utils.isArray(e)?e:[e],function(e){c.addAnonymousRule(t,e)}),t},f.extenders.validatable=function(i,e){if(c.utils.isObject(e)||(e={enable:e}),"enable"in e||(e.enable=!0),e.enable&&!c.utils.isValidatable(i)){var t=c.configuration.validate||{},r={throttleEvaluation:e.throttle||t.throttle};i.error=f.observable(null),i.rules=f.observableArray(),i.isValidating=f.observable(!1),i.__valid__=f.observable(!0),i.isModified=f.observable(!1),i.isValid=f.computed(i.__valid__),i.setError=function(e){var t=i.error.peek(),r=i.__valid__.peek();i.error(e),i.__valid__(!1),t===e||r||i.isValid.notifySubscribers()},i.clearError=function(){return i.error(null),i.__valid__(!0),i};var a=i.subscribe(function(){i.isModified(!0)}),n=f.computed(u({read:function(){i(),i.rules();return c.validateObservable(i),!0}},r));u(n,r),i._disposeValidation=function(){i.isValid.dispose(),i.rules.removeAll(),a.dispose(),n.dispose(),delete i.rules,delete i.error,delete i.isValid,delete i.isValidating,delete i.__valid__,delete i.isModified,delete i.setError,delete i.clearError,delete i._disposeValidation}}else!1===e.enable&&i._disposeValidation&&i._disposeValidation();return i},c.validateObservable=function(e){for(var t,r,i,a,n,s=0,u=e.rules(),l=u.length;s<l;s++)if(!(r=u[s]).condition||r.condition())if((t=r.rule?c.rules[r.rule]:r).async||r.async)h(e,t,r);else if(i=e,n=r,!(a=t).validator(i(),void 0===n.params||p(n.params))&&(i.setError(c.formatMessage(n.message||a.message,p(n.params),i)),1))return!1;return e.clearError(),!0};var x,E={};c.defineLocale=function(e,t){return e&&t?E[e.toLowerCase()]=t:null},c.locale=function(e){if(e){if(e=e.toLowerCase(),!E.hasOwnProperty(e))throw new Error("Localization "+e+" has not been loaded.");c.localize(E[e]),x=e}return x},c.localize=function(e){var t=c.rules;for(var r in e)t.hasOwnProperty(r)&&(t[r].message=e[r])},function(){var e={},t=c.rules;for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r].message);c.defineLocale("en-us",e)}(),x="en-us",f.applyBindingsWithValidation=function(e,t,r){var i,a=document.body;i=t&&t.nodeType?(a=t,r):t,c.init(),i&&(i=u(u({},c.configuration),i),c.utils.setDomData(a,i)),f.applyBindings(e,a)};var A=f.applyBindings;f.applyBindings=function(){c.init(),A.apply(this,arguments)},f.validatedObservable=function(e,t){if(!t&&!c.utils.isObject(e))return f.observable(e).extend({validatable:!0});var r=f.observable(e);return r.errors=c.group(c.utils.isObject(e)?e:{},t),r.isValid=f.observable(0===r.errors().length),f.isObservable(r.errors)?r.errors.subscribe(function(e){r.isValid(0===e.length)}):f.computed(r.errors).subscribe(function(e){r.isValid(0===e.length)}),r.subscribe(function(e){c.utils.isObject(e)||(e={}),r.errors._updateState(e),r.isValid(0===r.errors().length)}),r}});
//# sourceMappingURL=knockout.validation.min.js.map;
var urlTemplateLoader = {
    loadTemplate: function(name, templateConfig, callback) {
        if (templateConfig.fromUrl) {
            // Uses jQuery's ajax facility to load the markup from a file
            var fullUrl = templateConfig.fromUrl + '?cacheAge=' + templateConfig.maxCacheAge;
            $.get(fullUrl, function(markupString) {
                // We need an array of DOM nodes, not a string.
                // We can use the default loader to convert to the
                // required format.
                ko.components.defaultLoader.loadTemplate(name, markupString, callback);
            });
        } else {
            // Unrecognized config format. Let another loader handle it.
            callback(null);
        }
    } 
};

ko.components.loaders.unshift(urlTemplateLoader);;
(function () {
    //show modal handler
    ko.bindingHandlers.showModal = {
        init: function (element, valueAccessor) {
            var value = valueAccessor();

            //For some reason, this will not work for some observables
            if (ko.isObservable(value) || typeof value === "function") {

                $(element).on('hidden.bs.modal', function () {
                    try {
                        value(undefined);
                    }
                    catch (ex) {
                        //do nothing
                    }
                });

                value.subscribe(function () {
                    if (value()) {
                        $(element).modal('show');
                        // this is to focus input field inside dialog
                        $("input", element).focus();
                    }
                    else {
                        $(element).modal('hide');
                        //$('body').removeClass('modal-open');
                        //$('.modal-backdrop').remove();
                    }
                });
            }
        }
    };
})();;
$(function () {

    //Fix for ie9 not having access to window.location.origin
    if (!window.location.origin) {
        window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
    }

    if ($(".countrySelector").length > 0) {
        countrySelector.ready();
    }

    if ($(".targetPlanQuestionnaire").length > 0) {
        freightDensity.targetPlanQuestionnaire.ready();
    }

    if ($(".packageLevelSelection").length > 0) {
        freightDensity.packageLevelSelection.ready();
    }

    if ($("#shippingLabel_Form").length > 0) {
        shippingLabels.ready();
    }

    // DISPLAY THE OUT OF STOCK MESSAGE (PREVENTING THE USER FROM ORDERING ITEMS)
    if ($("#outOfStock").length > 0) {
        // OUT OF STOCK ITEM DETECTED (SEE IF THE product-add DIV IS RENDERED)
        if ($("#product-add").length > 0)
        {
            // REPLACE THE product-add WITH THE ERROR MESSAGE
            $("#product-add").html("<p class='error'>" + $("#outOfStock").val() + "</p><p><a onclick='ReturnToItemList()' href='#'>" + translations.C302 + "</a></p>");
        }
    }

    $(".validateVatNumber").each(function (index) {
        // WE ARE ONLY USING A HASH HERE BECAUSE WE ALLOW MULTIPLE BOOTHS ON A PAGE WHICH MEANS THERE WILL BE MULTIPLE VAT NUMBER FIELDS
        // ON THE PAGE AND WE NEED TO KEEP THEM SEPARATE SO WE CAN VALIDATE EACH ONE. SINGLE VIEW OF THE BOOTH WILL REALLY SIMPLIFY THIS 
        
        //vatNumberSavedHash DEFINED IN expressoGlobal AND USED IN validateVatNumber ALSO IN expressoGlobal
        var element = document.getElementById(this.id);
        
        // GET THE BOOTH ID
        var bIdArr = element.id.split('_');
        var boothID = bIdArr[bIdArr.length - 1];
        // GET THE COUNTRY TO ADD AN EVENT HANDLER TO THE COUNTRY INPUT
        var countryElement = document.getElementById("billingaddress_countryid_" + boothID);

        // THE VALUE OF THE ELEMENT(vatNumber), ADD THE COUNTRY ID TO VALUE SO WE CAN TELL IF EITHER (countryID OR vatNumber)
        // AND USE THE BOOTH ID AS THE KEY (ONE VAT PER BOOTH)
        vatNumberSavedHash[boothID] = element.value + '_' + countryElement.value;
    });

    if ($("#contactUsComment").length > 0) {
        //counter for text area showing number of characters used/available
        $('#contactUsComment').keyup(function() {
            var cs = $(this).val().length;            
            var text = $(this).val();
            var chars = text.length;
            var limit = parseInt($(this).attr('maxlength'));

            if (chars > limit) {
                var new_text = text.substr(0, limit);
                $(this).val(new_text);
            }
            $('#charactersCount').text(cs + ' of ' + limit);
        });

        $("#SubmitComment").bind('click', function () {            
            var msg = $('#contactUsComment').val();
            var pathName = $(location).attr('pathname');
            var pathNameArr = pathName.split('/');
            var projectCode = pathNameArr[1];

            if (!msg.length > 0) {
                alert('Please enter a comment...');
            } else {
                $.ajax({
                    type: 'post',
                    url: '/Show/SubmitContactUsComment',
                    dataType: 'json',
                    data: { contactComment: msg, projectCode: projectCode },
                    success: function (data2) {
                        $('#contactUsComment').val('');
                        $('#charactersCount').text('0 of ' + limit);
                        alert(data2);
                    },
                    async: false,
                    cache: false,
                    error: function(ajaxresult, status) {
                        console.log(ajaxresult)
                    }
                });
            }
        });
    }

    
    //Get any datepickers on the screen

    var datePickers = $('.date').not('.dateTemplate');
    //Check if there are any datepickers on the screen and confirm that the culture has been set
    if (datePickers.length > 0 && culture) {
        
        $.datepicker.setDefaults($.datepicker.regional['']);

        //Default date format will be the Unites States format
        if (typeof AddAlternateDatePickerValidation !== 'undefined' && $.isFunction(AddAlternateDatePickerValidation)) {
            AddAlternateDatePickerValidation('mm/dd/yy');
        }
        //set all of date time pickers to show dates in the culture's standard form
        datePickers.each(function (index, value) {
            localizeDatePicker($(value));
        });
    }

    if (userContext != null) {
        userContext.ready();
    }
});;
(function (editableCart, $, undefined) {
    editableCart.isInstantiated = false;
    editableCart.isReady = true;
    editableCart.orderItem = null;
    editableCart.isPOI = false;
    var isBusy = false;

    editableCart.Init = function (orderItemUUID) {
        editableCart.isPOI = GetQueryStringParamPOI('POI') == 'true';

        editableCart.isInstantiated = (hasValue(js_data) && hasValue(js_data["editable_cart_items"]) && hasValue(orderItemUUID) && !(ordering_expired || false));
        if (!editableCart.isInstantiated)
            return;

        editableCart.isReady = false;
        populateForm(orderItemUUID);
        update_ctr = 0;

        //only run if on item page and see if we are coming from Previous Order Item or Editable Cart
        if ($('.addToCart').length > 0) {
            CheckIfItemWasSelected();
        }
    }

    editableCart.returnToCart = function () {
        document.location = "/" + projectCode + "/Checkout";
    }

    ReturnToPOI = function () {
        document.location = "/" + projectCode + "/previously_ordered_items";
    }

    function setReady() {
        editableCart.isReady = true;
        if ($("#item_color").length > 0) {
            ColorUpdated();
        }
        $("input,textarea,select").change(onChange);
    }

    function onChange() {
        if (!isBusy) {
            isBusy = true;
            $(".input_box,.recalc").filter(":visible:first").triggerHandler("change");
            $(".show_date:visible:first").triggerHandler("click");
            isBusy = false;
        }
    }

    function populateForm(orderItemUUID) {
        var orderItems = [];
        editableCart.orderItem = js_data["editable_cart_items"].findAll("order_item_uuid", orderItemUUID).findFirst("is_child", "false");

        //If this is an editable cart and not a previously ordered item
        if (!editableCart.isPOI) {
            //Make sure that the booth they will be asked to checkout with is the active one by default
            userContext.switchBooth(editableCart.orderItem.booth_selection);
        }

        orderItems.push(editableCart.orderItem);
        orderItems = orderItems.concat(js_data["editable_cart_items"].findAll("parent_order_item_uuid", orderItemUUID));
        if (orderItems.length > 0) {
            for (var i = 0; i < orderItems.length; i++) {
                var orderItem = orderItems[i];
                fillFormField(orderItem);
                var itemOptions = orderItem.item_options || [];
                if (editableCart.orderItem.item_options != undefined) {
                    var scheduleType = JSON.parse(JSON.stringify(editableCart.orderItem.item_options.findFirst("item_option_selector", "LABOR")));
                }
                if (hasValue(scheduleType)) {
                    $("#schedule_type").text(scheduleType["item_option_value"]);
                }
                for (var o = 0; o < itemOptions.length; o++) {
                    fillFormField(itemOptions[o]);
                }
            }
        }
    }

    function fillFormField(obj) {
        var ctrl;
        for (var p in obj) {
            if (p.indexOf("_selector") > 0) {
                ctrl = $("#0,.0,[name='0'],#item_0,.item_0,[name='item_0']".replace(/0/g, obj[p]));
                p = p.replace("_selector", "_value");
            } else {
                ctrl = $("#0,.0,[name='0']".replace(/0/g, p));
            }
            if (ctrl.length > 0) {
                if (ctrl.is("input:checkbox")) {
                    ctrl.val([obj[p]]);
                } else {
                    //Check if this is a datepicker control
                    if (ctrl.hasClass('hasDatepicker')) {
                        //All dates are saved in US format, to set region to US, clear datepicker region
                        ctrl.datepicker('option', $.datepicker.regional[""]);

                        //Set the date from the database
                        ctrl.val(obj[p]);

                        //Apply any date format changes by setting the region
                        ctrl.datepicker('option', $.datepicker.regional[culture]);
                    }
                    else {
                        ctrl.val(obj[p]);
                    }
                }
                ctrl.change();
            }
        }
    }

    //if an item is selected it will appear in the query string as a parameter.
    function CheckIfItemWasSelected() {
        if (!editableCart.isPOI) {
            //we are coming from Editable Cart and should set the Item Page that way, otherwise leave it as default for previously ordered item
            $(".addToCart").val(translations.C432);
            $("button.addToCart").text(translations.C432);
            $(".col-1.service header:first :first-child").text(translations.C429);
            $(".alt-brand a,.returnToShopping").text(translations.C434).attr("onclick", "editableCart.returnToCart(); return false;");
            $(".input_box,.recalc").filter(":visible:first").triggerHandler("change");
            $(".show_date:visible:first").triggerHandler("click");
            window.setTimeout(setReady, 500);

            //Make sure that the booth they will be asked to checkout with is the active one by default
            userContext.switchBooth(editableCart.orderItem.booth_selection);
        }
        else {
            $(".alt-brand a,.returnToShopping").text(translations.C440).attr("onclick", "ReturnToPOI(); return false;");
            if (typeof (ColorUpdated) == "function") {
                ColorUpdated();
            }
        }
    }

    function GetQueryStringParamPOI(sPoi) {
        var pageUrl = window.location.search.substring(1);
        var urlVars = pageUrl.split('&');
        for (var i = 0; i < urlVars.length; i++) {
            var paramName = urlVars[i].split('=');
            if (paramName[0] == sPoi) {
                return paramName[1];
            }
        }
    }

}(window.editableCart = window.editableCart || {}, jQuery));;
function knockoutFiniteStateMachine(parameters) {
    var self = {};
    self.states = parameters.states || [];
    self.startStateName = parameters.startStateName || parameters.states[0].name || "";
    self.stop = stop;
    self.start = start;
    self.active = false;

    var conditionSubscriptions = [];

    var endState = null;
    var stateChangeSubscribers = [];

    self.subscribeOnChange = function (onChangeCallback) {
        if (typeof (onChangeCallback) === "function") {
            stateChangeSubscribers.push(onChangeCallback);
        }
    }

    //transition to another state
    function changeState (stateName) {
        if (self.currentState) {
            if (self.currentState.transitions.filter(function (transition) { return (typeof(transition.stateName) == "function" ? transition.stateName() : transition.stateName) == stateName }).length == 0) {
                throw "error in finite state machine\r\n[Attempt to transition to state '" + stateName + "' from state '" + self.currentState.name + "', but no such transition was found.]"
            }

            //unsub from all transitions
            conditionSubscriptions.forEach(function (subscription) {
                subscription.dispose();
            });
            conditionSubscriptions = [];

            //deactivate the currentState
            if (typeof (self.currentState.exit) === "function") {
                self.currentState.exit(stateName);
            }

        }

        //set the currentState
        var previousStateName = self.currentState ? self.currentState.stateName : undefined;
        self.currentState = getState(stateName);

        if (self.currentState == null) {
            throw "State '" + stateName + "' does not exist in the state machine";
        }
        stateChangeSubscribers.forEach(function (subscriberCallback) {
            subscriberCallback(stateName);
        });
        
        if (self.currentState.transitions) {
            self.currentState.transitions.forEach(function (transition) {
                if (!ko.isPureComputed(transition.condition)) {
                    conditionSubscriptions.push(
                        ko.pureComputed(transition.condition)
                        .extend({ notify: "always" })
                        .subscribe(function (conditionResult) {
                            if (conditionResult) {
                                changeState((typeof (transition.stateName) == "function" ? transition.stateName() : transition.stateName));
                            }
                        })
                    );
                }
            });
        }

        //activate the currentState
        if (typeof (self.currentState.enter) === "function") {
            self.currentState.enter(previousStateName);
        }
        
    }

    //helper function to get the state from the states array by its name
    function getState(stateName) {
        var states = self.states.filter(function (state) {
            return state.name == stateName;
        });

        if (states.length > 1) {
            throw "error in finite state machine\r\n[Duplicate state names found when searching for " + stateName + "]\r\n";
        }
        return states[0];
    }

    //set current state
    self.currentState = null;

    function start() {
        //validate();
        //initialize states
        self.states.forEach(function (state) {
            if (typeof (state.initialize) === "function") {
                state.initialize();
            }
        });

        changeState(self.startStateName || self.states[0].name);
        self.active = true;
    }

    function stop() {
        if (self.currentState && typeof (self.currentState.exit) === "function") {
            self.currentState.exit();
        }
        self.currentState = null;
        self.active = false;
        conditionSubscriptions = [];
    }

    function validate() {
        //TODO:  validate states (ensure all members are properly defined)
        var errorText = "";

        if (self.states.filter(function (state) { return !state.transitions || state.transitions.length == 0 }).length > 1) {
            errorText += "[More than one state found with no transitions.  States without transitions are considered end states.]\r\n"
        }

        self.states.forEach(function (validatedState) {
            if (self.states.filter(function (state) { return state.name == validatedState.name; }).length > 1) {
                errorText += "[Duplicate state found for state name '" + validatedState.name + "']\r\n"
            }
            if (validatedState.transitions && validatedState.transitions.length > 0) {
                validatedState.transitions.forEach(function (transition) {
                    if (self.states.filter(function (state) { return state.name == (typeof (transition.stateName) == "function" ? transition.stateName() : transition.stateName) }).length == 0) {
                        errorText += "[A transition was found referencing state name '" + (typeof (transition.stateName) == "function" ? transition.stateName() : transition.stateName) + "' in state '" + validatedState.name + "']\r\n"
                    }
                });
            }
        });

        if (errorText.length > 0) {
            throw "error in finite state machine\r\n" + errorText;
        }
    }

    return self;
};
var expressoEvent = function () {
    var self = {};
    self.subscribers = [];

    self.publish = function (message, data) {
        notifySubscribers = self.subscribers.filter(function (subscriber) {
            if (subscriber.message == message) {
                return subscriber;
            }
        });

        notifySubscribers.forEach(function (subscriber) {
            if (typeof (subscriber.callback) == 'function') {
                subscriber.callback(data);
            }
        });
    }

    self.subscribe = function (message, callback) {

        var foundSubscription = self.subscribers.some(function (subscriber) {
            if (subscriber.message == message && subscriber.callback == callback) {
                return true;
            }
        });

        if (!foundSubscription) {
            self.subscribers.push({
                callingFunction: arguments.callee.caller,
                message: message,
                callback: callback
            });
        }
    }

    return self;
}();;
var userService = (function () {
    function getCurrentUser(onSuccess) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1];

        $.ajax({
            url: "/api/userinformation/GetCurrentUser",
            dataType: 'json',
            type: 'get',
            cache: false,
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    function login(username, password, projectCode, onSuccess) {
        $.ajax({
            url: '/api/Accounts/Authenticate',
            dataType: 'json',
            type: 'post',
            data: {
                Username: username,
                Password: password,
                ProjectCode: projectCode
            },
            success: onSuccess,
            error: function (request, status, thrown) {
                window.alert(formatAjaxError(request, status, thrown));
            },
            done: function () {
            }
        });
    }

    function userMustChangePassword(username, onSuccess) {
        $.ajax({
            url: '/api/UserInformation/UserMustChangePassword',
            dataType: 'json',
            type: 'get',
            data: {
                username: username,
                
            },
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(formatAjaxError(request, status, thrown));
            },
            done: function () {
            }
        });
    }

    function verifyCode(username, code, onSuccess) {
        $.ajax({
            url: '/api/Accounts/VerifyCode',
            dataType: 'json',
            type: 'put',
            data: {
                username: username,
                code: code
            },
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(formatAjaxError(request, status, thrown));
            },
            done: function () {
            }
        });
    }

    function sendMultiFactorAuthenticationCode(username, projectCode, onSuccess) {
        $.ajax({
            url: '/api/Accounts/sendMultiFactorAuthenticationCode',
            dataType: 'json',
            type: 'post',
            data: {
                username: username,
                projectCode: projectCode
            },
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(formatAjaxError(request, status, thrown));
            },
            done: function () {
            }
        });
    }

    function getDelegateUserEmail(registrationChecklistTaskId, onSuccess) {
        $.ajax({
            url: '/api/UserInformation/getDelegateUserEmail',
            dataType: 'json',
            type: 'get',
            data: {
                registrationChecklistTaskId: registrationChecklistTaskId
            }
        })
        .done(onSuccess)
    }

    function createAccount(username, password, email, phone, mfaOptIn, onSuccess) {
        $.ajax({
            url: '/api/Accounts/RegisterNewAccount',
            dataType: 'json',
            type: 'post',
            data: {
                UserLogonName: username,
                Password: password,
                EmailAddress: email,
                CompanyPhone: phone,
                ContactPhone: phone,
                MFAOptIn: mfaOptIn
            },
            success: function (data) {
                onSuccess(data);
            },
            error: function (request, status, thrown) {
            }
        });
    }

    function resetPassword(email, onSuccess) {
        $.ajax({
            url: '/api/Accounts/RequestPasswordReset',
            dataType: 'json',
            type: 'get',
            data: {
                EmailAddress: email
            },
            success: function (data) {
                onSuccess(data);
            },
            error: function (request, status, thrown) {
            }
        });
    }

    function sendEmailConfirmationLink(username, email, onSuccess) {
        $.ajax({
            url: '/api/accounts/SendEmailConfirmationLink',
            dataType: 'json',
            type: 'get',
            data: {
                username: username,
                email: email
            },
            success: function (data) {
                onSuccess(data);
            },
            error: function (request, status, thrown) {
            }
        });
    }

    function searchUsers(criteria, onSuccess) {
        $.ajax({
            url: '/Account/SearchForUser',
            dataType: 'json',
            type: 'get',
            data: {
                criteria: criteria
            },
            success: function (data) {
                onSuccess(data);
            },
            error: function (request, status, thrown) {
            }
        });
    }

    function impersonate(username, onSuccess) {
        $.ajax({
            url: '/Account/Impersonate',
            dataType: 'json',
            type: 'post',
            data: {
                ImpersonateUserName: username
            },
            success: function (data) {
                onSuccess(data);
            },
            error: function (request, status, thrown) {
            }
        });
    }


    return {
        login: login,
        getCurrentUser: getCurrentUser,
        userMustChangePassword: userMustChangePassword,
        createAccount: createAccount,
        resetPassword: resetPassword,
        getDelegateUserEmail: getDelegateUserEmail,
        sendEmailConfirmationLink: sendEmailConfirmationLink,
        searchUsers: searchUsers,
        impersonate: impersonate,
        sendMultiFactorAuthenticationCode: sendMultiFactorAuthenticationCode,
        verifyCode: verifyCode
    };
})();;
var contentService = (function () {

    /* parameters:
        content;
        showInstanceId;
        showInstanceAttachmentId;
        itemId;
        orderItemId;
        attachmentTag;
        registrationId;
        pageTag;
    */
    function renderExpTypes(parameters, onSuccess, onFailure) {
        $.ajax({
            url: "/api/content/renderExpTypes",
            data: JSON.stringify(parameters),
            contentType: "application/json",
            dataType: 'json',
            type: 'post',
            cache: false,
            success: onSuccess,
            fail: onFailure,
            error: onFailure
        })
    }

    function getShowInstanceLayout(showInstanceId, onSuccess, onFailure) {
        $.ajax({
            url: "/api/Content/GetShowInstanceLayout",
            data: {
                showInstanceId: showInstanceId
            },
            dataType: 'json',
            type: 'get',
            cache: false,
            success: onSuccess,
            fail: onFailure,
            error: onFailure
        });
    }

    return {
        renderExpTypes: renderExpTypes,
        getShowInstanceLayout: getShowInstanceLayout,
    };
})();
;
ko.observableArray.fn.uninitialized = function () {
    var self = this;
    //Check if we have added the 'valuesInitialized' observable to this array yet
    if (!self.valuesInitialized) {
        //Give this array an observable which detects if it has been initialiezed yet
        //Default the value to 'true' if it already has items in it
        self.valuesInitialized = new ko.observable(self().length > 0);

        //Listen to changes to this array
        self.subscribe(function () {
            //Any change means that it has been initialized, even if that value is to an 'empty' array
            self.valuesInitialized(true);
        }, self, 'beforeChange')
    }

    //Return a computed based on the 'valuesInitialized' property which we added
    return ko.pureComputed(function () {
        return !self.valuesInitialized();
    }, self);

};
var showInstanceService = (function () {

    function getActiveShowInstance(onSuccess) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1];
    
        if (pathNameArr.length >= 4) {
            if (pathNameArr[2] == "thankyou")
                projectCode = pathNameArr[3] == "Error" ? null : pathNameArr[3];
        }

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c') {
            $.ajax({
                url: "/api/showinstances/GetShowInstanceByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }

    function getActiveShowContent(onSuccess) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1];

        $.ajax({
            url: "/api/showinstances/GetContent",
            data: {
                projectCode: projectCode,
                contentType: 1
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    function getShowsByCompany(companyId, includePastShows, onSuccess) {
        $.ajax({
            url: "/api/shows/ShowsByCompany",
            data: {
                companyId: companyId,
                includePast: includePastShows
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    return {
        getActiveShowInstance: getActiveShowInstance,
        getActiveShowContent: getActiveShowContent,
        getShowsByCompany: getShowsByCompany
    };
})();
;
var exhibitorBoothService = (function () {
    function searchBooths(projectCode, criteria, onSuccess, always) {
        $.ajax({
            url: "/api/exhibitorbooths/searchExhibitorBooths",
            data: {
                projectCode: projectCode,
                criteria: criteria
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        })
        .always(always);
    }

    function searchBoothsMinimal(projectCode, criteria, onSuccess, always) {
        $.ajax({
            url: "/api/exhibitorbooths/searchExhibitorBoothsMinimal",
            data: {
                projectCode: projectCode,
                criteria: criteria
            },
            dataType: 'json',
            type: 'get',
        })
            .done(onSuccess)
            .fail(function (request, status, thrown) {
                console.log(thrown);
            })
            .always(always);
    }

    function SendQRMail(base64String, ContactEmailId, onSuccess, always) {
        $.ajax({
            url: "/api/exhibitorbooths/QRSend",
            data: {
                bytes: base64String,
                EmailId: ContactEmailId
            },
            dataType: 'json',
            type: 'get',
        })
            .done(onSuccess)
            .fail(function (request, status, thrown) {
                console.log(thrown);
            })
            .always(always);
    }


    function getUserBooths(userLoginName, showInstanceId, onSuccess) {
        $.ajax({
            url: "/api/exhibitorbooths/getUserBooths",
            data: {
                userLoginName: userLoginName,
                showInstanceId: showInstanceId
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        })
    }

    function getExhibitorBoothCount(projectCode, onSuccess, always) {
        $.ajax({
            url: "/api/exhibitorbooths/GetExhibitorBoothCount",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        })
        .always(always);
    }

    function getExhibitorBoothUom(projectCode, onSuccess, always) {
        $.ajax({
            url: "/api/exhibitorbooths/GetExhibitorBoothUom",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        })
        .always(always);
    }

    function createBooth(projectCode, registrationID, boothExhibitorID, boothNumber, boothWidth, boothLength, boothCompanyName, isExhibitor, externalId, thirdPartyCompanyName, copyExhibitorQuestionnaires, onSuccess) {
        var boothSize = boothWidth + " X " + boothLength;
        // Register the new booth information
        $.ajax({
            url: "/RegisterBooth",
            dataType: 'json',
            data: {
                ProjectCode: projectCode,
                RegistrationID: registrationID,
                ExhibitorBoothID: boothExhibitorID,
                BoothNumber: boothNumber,
                Dimensions: boothSize,
                CompanyName: boothCompanyName,
                IsExhibitor: isExhibitor,
                ExternalId: externalId,
                ThirdPartyCompanyName: thirdPartyCompanyName,
                CopyExhibitorQuestionnaires: copyExhibitorQuestionnaires ? copyExhibitorQuestionnaires : false
            },
            type: 'post',
            async: true,
            success: function (results) {
                if (typeof onSuccess == 'function') {
                    onSuccess(results);
                }
                var pathName = $(location).attr('pathname');
                var pathNameArr = pathName.split('/');
                var projectCode1 = pathNameArr[1];
            },
            error: function (request, status, thrown) {
                ShowMessageBox(formatAjaxError(request, status, thrown), translations.C378, null, 600, 400);
            }

        });

    }

    function getBoothByRegistration(registrationId, onSuccess) {
        $.ajax({
            url: "/api/exhibitorbooths/getBoothByRegistration",
            data: {
                registrationId: registrationId
            },
            dataType: 'json',
            type: 'get',
            cache: false,
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    function getExhibitorDepartureStatus(externalCustomerBoothId, onSuccess) {
        $.ajax({
            url: "/api/exhibitorbooths/getExhibitorDepartureStatus",
            data: {
                externalCustomerBoothId: externalCustomerBoothId
            },
            dataType: 'json',
            type: 'get',
            cache: false,
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    return {
        searchBooths: searchBooths,
        searchBoothsMinimal: searchBoothsMinimal,
        getUserBooths: getUserBooths,
        getExhibitorDepartureStatus: getExhibitorDepartureStatus,
        getExhibitorBoothCount: getExhibitorBoothCount,
        getExhibitorBoothUom: getExhibitorBoothUom,
        createBooth: createBooth,
        getBoothByRegistration: getBoothByRegistration,
        SendQRMail: SendQRMail
    };
})();
;
var singleSignOnProviderService = (function () {
    function getByShowInstance(showInstanceId, onSuccess) {
        $.ajax({
            url: "/api/singlesignonprovider/GetSingleSignOnProviderByShowInstance",
            data: {
                showInstanceId: showInstanceId
            },
            dataType: 'json',
            type: 'get',
            cache: false,
            success: onSuccess,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    return {
        getByShowInstance: getByShowInstance
    };
})();


;
var systemOfRecordService = (function () {

    function getSystemOfRecord(showInstanceId, callback) {
        $.ajax({
            url: "/api/SystemOfRecord/getSystemOfRecord",
            data: {
                showInstanceId: showInstanceId
            },
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'get',
            cache: false,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        })
        .done(callback);
    }

    function getSystemOfRecordByProjectCode(projectCode, callback) {
        $.ajax({
            url: "/api/SystemOfRecord/getSystemOfRecord",
            data: {
                projectCode: projectCode
            },
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'get',
            cache: false,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        })
        .done(callback);
    }


    return {
        getSystemOfRecord: getSystemOfRecord,
        getSystemOfRecordByProjectCode: getSystemOfRecordByProjectCode
    };

})();
;
var thirdPartyService = (function () {
    function getThirdPartyServices(showInstanceId, onSuccess) {
        $.ajax({
            url: "/api/thirdpartyservices/getthirdpartyservices",
            data: {
                showInstanceId: showInstanceId
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    function getThirdPartyServicesByProjectCode(projectCode, onSuccess) {
        $.ajax({
            url: "/api/thirdpartyservices/getthirdpartyservices",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    return {
        getThirdPartyServices: getThirdPartyServices,
        getThirdPartyServicesByProjectCode: getThirdPartyServicesByProjectCode
    };
})();;
var facilityService = (function () {
    var pathName = $(location).attr('pathname');
    var pathNameArr = pathName.split('/');
    var projectCode = pathNameArr[1];

    function getShowOrganizerFacilityByProjectCode(onSuccess) {

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c' && !isNaN(projectCode)) {
            $.ajax({
                url: "/api/facilities/GetShowOrganizerFacilityByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }

    function getVenueFacilityByProjectCode(onSuccess) {

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c' && !isNaN(projectCode)) {
            $.ajax({
                url: "/api/facilities/GetVenueFacilityByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }

    function getAdvanceShipFacilityByProjectCode(onSuccess) {

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c' && !isNaN(projectCode)) {
            $.ajax({
                url: "/api/facilities/GetAdvanceShipFacilityByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }

    function getDirectShipFacilityByProjectCode(onSuccess) {

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c' && !isNaN(projectCode)) {
            $.ajax({
                url: "/api/facilities/GetDirectShipFacilityByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }
    function getMarshalShipFacilityByProjectCode(onSuccess) {

        //No need to call back to the server if on the dashboard or company specific dashboard (ie no project code or the first argument is a 'c', ie c/US, c/UK etc..
        if (projectCode && projectCode != 'c' && !isNaN(projectCode)) {
            $.ajax({
                url: "/api/facilities/GetMarshalShipFacilityByProjectCode",
                data: {
                    projectCode: projectCode
                },
                dataType: 'json',
                type: 'get',
                cache: false,
                success: onSuccess,
                error: function (request, status, thrown) {
                    console.log(thrown);
                }
            });
        } else {
            //No project code deteced from the browser, just report the show instance is undefined
            onSuccess(undefined);
        }
    }

    return {
        getShowOrganizerFacilityByProjectCode: getShowOrganizerFacilityByProjectCode,
        getVenueFacilityByProjectCode: getVenueFacilityByProjectCode,
        getAdvanceShipFacilityByProjectCode: getAdvanceShipFacilityByProjectCode,
        getDirectShipFacilityByProjectCode: getDirectShipFacilityByProjectCode,
        getMarshalShipFacilityByProjectCode: getMarshalShipFacilityByProjectCode
    };
})();;
var checklistService = (function () {

    function checkForceMandatoryForms(projectCode, onCheckout, onSuccess) {
        $.ajax({
            url: "/api/checklist/checkForceMandatoryForms",
            data: {
                projectCode: projectCode,
                onCheckout: onCheckout
            },
            dataType: 'json',
            type: 'get',
            async: true
        })
            .done(onSuccess)
    }

    function checkForceOverdueMandatoryForms(projectCode, onSuccess) {
        $.ajax({
            url: "/api/checklist/checkForceOverdueMandatoryForms",
            data: {
                projectCode: projectCode,
            },
            dataType: 'json',
            type: 'get',
            async: true
        })
            .done(onSuccess);
    }

    function getUndelegatedChecklistTasks(registrationID, onSuccess) {
        $.ajax({
            url: "/api/checklist/getUndelegatedChecklistTasks",
            data: {
                registrationID: registrationID
            },
            dataType: 'json',
            type: 'get',
        })
            .done(onSuccess);
    }

    function undelegateChecklistTask(registrationChecklistTaskID, onSuccess) {
        $.ajax({
            url: "/api/checklist/UndelegateChecklistTask",
            data: JSON.stringify({
                registrationChecklistTaskID: registrationChecklistTaskID,
            }),
            dataType: 'json',
            type: 'put',
            contentType: 'application/json; charset=utf-8',
        })
            .done(onSuccess);
    }

    function getPreviousChecklistDelegateEmails(registrationID, onSuccess) {
        $.ajax({
            url: "/api/checklist/getPreviousChecklistDelegateEmails",
            data: {
                registrationID: registrationID
            },
            dataType: 'json',
            type: 'get',
        })
        .done(onSuccess)
    }


    function getShowInstanceChecklistGroups(projectCode, onSuccess) {
        $.ajax({
            url: "/api/checklist/GetShowInstanceChecklistGroups",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get',
            async: false
        })
        .done(onSuccess)
    }

    function getUserChecklistTasks(registrationId, onSuccess) {
        $.ajax({
            url: "/api/checklist/getUserChecklistTasks",
            data: {
                registrationId: registrationId
            },
            dataType: 'json',
            type: 'get',
            async: false
        })
        .done(onSuccess)
    }

    function getDelegatedChecklistTasks(registrationId, onSuccess) {
        $.ajax({
            url: "/api/checklist/getDelegatedChecklistTasks",
            data: {
                registrationId: registrationId
            },
            dataType: 'json',
            type: 'get',
            async: false
        })
        .done(onSuccess)
    }

    function getDelegatedChecklistTaskByRegistrationAndContent(registrationId, contentTag, onSuccess) {
        $.ajax({
            url: "/api/checklist/GetDelegatedChecklistTaskByRegistrationAndContent",
            data: {
                registrationId: registrationId,
                contentTag: contentTag
            },
            dataType: 'json',
            type: 'get',
            async: false
        })
        .done(onSuccess)
    }

    function getShowInstanceChecklistTasks(projectCode, registrationId, onSuccess) {
        $.ajax({
            url: "/api/checklist/GetShowInstanceChecklistTasks",
            data: {
                projectCode: projectCode,
                registrationId: registrationId
            },
            dataType: 'json',
            type: 'get',
            async: false
        })
        .done(onSuccess)
    }

    function createChecklistStatusHistory(registrationChecklistTaskId, checklistStatusTypeId, notes, onSuccess) {
        $.ajax({
            url: '/api/checkliststatushistory/add',
            dataType: 'json',
            data: {
                RegistrationChecklistTaskId: registrationChecklistTaskId,
                ChecklistStatusTypeId: checklistStatusTypeId,
                Notes: notes
            },
            type: 'post'
        })
        .done(onSuccess);
    }

    function delegateRegistrationChecklistTasks(emailAddress, registrationChecklistTaskIds, onSuccess) {
        $.ajax({
            url: '/api/checklist/DelegateRegistrationChecklistTasks',
            data: JSON.stringify({
                emailAddress: emailAddress,
                registrationChecklistTaskIds: registrationChecklistTaskIds
            }),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'put',
            cache: false
        })
        .done(onSuccess);
    }

    function exportChecklistCalendar(projectCode, showInstanceChecklistIds, onSuccess) {

        var stringifiedShowInstanceChecklistIds = showInstanceChecklistIds.join('&showInstanceChecklistIds[]=');

        window.location = '/api/checklist/ExportChecklistCalendar?projectCode=' + projectCode + '&showInstanceChecklistIds[]=' + stringifiedShowInstanceChecklistIds;

        if (typeof (onSuccess) === "function") {
            onSuccess();
        }
    }

    return {
        checkForceOverdueMandatoryForms: checkForceOverdueMandatoryForms,
        delegateRegistrationChecklistTasks: delegateRegistrationChecklistTasks,
        checkForceMandatoryForms: checkForceMandatoryForms,
        getUndelegatedChecklistTasks: getUndelegatedChecklistTasks,
        undelegateChecklistTask: undelegateChecklistTask,
        getPreviousChecklistDelegateEmails: getPreviousChecklistDelegateEmails,
        createChecklistStatusHistory: createChecklistStatusHistory,
        getUserChecklistTasks: getUserChecklistTasks,
        getDelegatedChecklistTasks: getDelegatedChecklistTasks,
        getDelegatedChecklistTaskByRegistrationAndContent: getDelegatedChecklistTaskByRegistrationAndContent,
        getShowInstanceChecklistTasks: getShowInstanceChecklistTasks,
        getShowInstanceChecklistGroups: getShowInstanceChecklistGroups,
        exportChecklistCalendar: exportChecklistCalendar
    };

})();

;
var fileLibraryService = (function () {

    function uploadUserFile(showInstanceId, boothNumber, description, fileCategoryId, fileTypeId, file, callback) {
        var data = new FormData();
        data.append("file", file);
        data.append("fileName", file.name);
        data.append("showInstanceId", showInstanceId);
        data.append("boothNumber", boothNumber);
        data.append("description", description);
        data.append("categoryId", fileCategoryId);
        data.append("typeId", fileTypeId);

        $.ajax({
            url: "/api/fileLibrary/UploadUserFile",
            type: "POST",
            enctype: 'multipart/form-data',
            data: data,
            processData: false,
            contentType: false,
            cache: false,
            timeout: 600000,
            success: callback,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    function getLookups(projectCode, callback) {
        $.ajax({
            url: "/api/fileLibrary/Lookups",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get',
            cache: false,
            success: callback,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    function saveUserFileHistoryChanges(modifiedUserFiles, callback) {
        $.ajax({
            url: "/api/fileLibrary/SaveUserFileHistoryChanges",
            data: {
                ModifiedUserFiles: modifiedUserFiles
            },
            dataType: 'json',
            type: 'post',
            cache: false,
            success: callback,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    return {
        saveUserFileHistoryChanges: saveUserFileHistoryChanges,
        uploadUserFile: uploadUserFile,
        getLookups: getLookups
    };
})();
;
var registrationService = (function() {
    
    function getActiveRegistration(onSuccess, onFail) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1];

        $.ajax({
            url: "/api/registration/getActiveRegistration",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get'
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
            onFail();
        });
    }

    function getActiveCheckoutRegistration(onSuccess, onFail) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1] == "Error" ? null : pathNameArr[1];
        if (pathNameArr.length >= 4) {
            if (pathNameArr[2] == "thankyou")
                projectCode = pathNameArr[3] == "Error" ? null : pathNameArr[3];
        }

        $.ajax({
            url: "/api/registration/getActiveCheckoutRegistration",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get'
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
            onFail();
        });
    }

    function getRegistration(registrationId, onSuccess) {
        $.ajax({
            url: "/api/registration/getRegistration",
            data: {
                registrationId: registrationId
            },
            dataType: 'json',
            type: 'get'
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    function updateRegistration(updatedRegistration, onSuccess) {
        $.ajax({
            url: "/api/registration/UpdateRegistration",
            data: JSON.stringify(updatedRegistration),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'put',
        })
        .done(onSuccess)
        .fail(function (request, status, thrown) {
            console.log(thrown);
        });
    }

    function updateRegistrationShellScheme(registrationId, shellSchemeId, onSuccess) {
        $.ajax({
            url: "/api/registration/updateRegistrationShellScheme",
            data: JSON.stringify({
                registrationId: registrationId,
                shellSchemeId: shellSchemeId
            }),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'put',
        })
            .done(onSuccess)
            .fail(function (request, status, thrown) {
                console.log(thrown);
            });
    }

    function updateRegistrationEACName(registrationId, eacName, onSuccess) {
        $.ajax({
            url: "/api/registration/UpdateRegistrationEACName",
            data: JSON.stringify({
                registrationId: registrationId,
                eacName: eacName
            }),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            type: 'put',
        })
            .done(onSuccess)
            .fail(function (request, status, thrown) {
                console.log(thrown);
            });
    }

    return {
        getActiveCheckoutRegistration: getActiveCheckoutRegistration,
        getActiveRegistration: getActiveRegistration,
        getRegistration: getRegistration,
        updateRegistration: updateRegistration,
        updateRegistrationShellScheme: updateRegistrationShellScheme,
        updateRegistrationEACName: updateRegistrationEACName
    };

})();

;
var userContext = (function () {

    /*******************Private Variables******************************/
    var _selectedRegistration = null;
    var _onSwitchSubscribers = [];
    var _onInitializedSubscribers = [];
    var _onReadyCallbacks = [];
    var _currentUser = null;
    var unloadingState = false;
    var _suppressRefresh = false;
    var _initialized = false;

    var pathName = $(location).attr('pathname');
    var pathNameArr = pathName.split('/');
    var projectCode = pathNameArr[1] == "Error" ? null : pathNameArr[1];
    if (pathNameArr.length >= 4) {
        if (pathNameArr[2] == "thankyou")
            projectCode = pathNameArr[3] == "Error" ? null : pathNameArr[3];
    }
    function reloadActiveRegistration(callback) {
        $.ajax({
            url: "/api/registration/getActiveRegistration",
            data: {
                projectCode: projectCode
            },
            dataType: 'json',
            type: 'get'
        })
        .done(function (data) {
            _selectedRegistration = data;
            if (typeof (callback) === "function") {
                callback(data);
            }
        })
        .fail(function (request, status, thrown) {
            console.log(thrown);
            _selectedRegistration = null;
        });

    }

    //Get the active registration
    reloadActiveRegistration(function (data) {
        _initialized = true;

        for (var i = 0; i < _onInitializedSubscribers.length; i++) {
            var subscriber = _onInitializedSubscribers[i];
            if ($.isFunction(subscriber)) {
                subscriber(_selectedRegistration ? _selectedRegistration.UUID : null);
            }
        }
        //Make sure any of the 'Your booth is' fields on the screen are populated
        populateBoothDataFields();
    });    

    /****************Private Functions********************************/
    function initializeBoothControl() {
        $("a[data-boothcontrol-role='registrationCheckout']").on('click', onCheckoutClick);
        $("a[data-boothControl-role='registrationSwitch']").on('click', onSwitchBoothClick);
        $("a[data-boothControl-role='registrationSwitchAndCheckout']").on('click', onSwitchAndCheckoutClick);
        $('.boothCallout').on('click', calloutBoothSelector);

        $(window).bind("beforeunload", function () {
            unloadingState = true;
        });

        //Make sure any of the 'Your booth is' fields on
        populateBoothDataFields();
    };

    function setActiveRegistration(newRegistrationUUID) {
        try {
            ShowWaitDialog();

            //Get an updated booth selector
            $.ajax({
                url: "/Show/SetSelectedBooth",
                data: {
                    registrationUUID: newRegistrationUUID
                },
                type: 'post',
                cache: false,
                dataType: 'json',
                //Block until the registration comes back if not refreshing
                async: !_suppressRefresh,
                success: function (result) {
                    if (!_suppressRefresh) {
                        window.location.reload(true);
                    } else {
                        _selectedRegistration = result;
                        HideWaitDialog();
                    }

                },
                error: function (request, status, thrown) {
                    HideWaitDialog();
                    //when navigating away from a page mid-call plus we are sending an empty return back from the show controller (as of jquery 1.9, this is an invalid response).
                    //if we're reloading the page, don't show the empty error getting thrown in an alert.
                    if (!unloadingState) {
                        console.log(thrown);
                    }
                }
            });
        }
        catch (e) {
            console.log(e.message ? e.message : e);
        }
    }

    function checkout() {
        document.location.href = "/" + projectCode + "/Checkout";
    }

    function populateBoothDataFields() {
        if (_selectedRegistration) {
            //Update any data-boothdata attributes on the screen
            $("[data-boothdata='boothnumber']").text(_selectedRegistration.BoothNumber);
        }
    }

    function calloutBoothSelector() {
        //TODO Have Nathan hide this image initially and have it have an id
        var newBoothImage = $("#boothselectorimg");
        if (newBoothImage) {
            //Show the booth selector image and then have it fade away in 8 seconds
            newBoothImage.show();
            newBoothImage.hide(8000);
        }
    }

    /*************Event Handlers************************************/
    function onCheckoutClick() {
        //Since we will do a full postback, show a wait dialog.  When postback completes the dialog will be disposed as a result.
        ShowWaitDialog();

        checkout();
    }

    function onSwitchBoothClick() {
        ShowWaitDialog();
        //Get the registration of the booth that we just clicked on
        var newRegistrationUUID = $(this).data('boothcontrolRegistrationid');
        switchBooth(newRegistrationUUID);
        HideWaitDialog();
    }

    function onSwitchAndCheckoutClick() {
        //Since we will do a full postback, show a wait dialog.  When postback completes the dialog will be disposed as a result.
        ShowWaitDialog();

        //Get the registration of the booth that we just clicked on
        var newRegistrationUUID = $(this).data('boothcontrolRegistrationid');
        setActiveRegistration(newRegistrationUUID);
    }

    /*************Public Functions********************************/
    function ready() {
        //Initialize the booth selector control if it is on the page
        if ($(".boothControl").length > 0) {
            initializeBoothControl();
        }

        reloadCurrentUser();
    }

    function selectedRegistration() {
        return _selectedRegistration;
    }

    function currentUser() {
        if (_currentUser != null) {
            _currentUser.isInRole = function (roleName) {
                var roleFound = false;
                if (_currentUser != null) {
                    _currentUser.Roles.forEach(function (element) {
                        if (element.Name == roleName) {
                            roleFound = true;

                        }

                    });
                }
                return roleFound;
            }
        }

        return _currentUser;

    }

    function reloadCurrentUser(callback) {
        userInformationService.getCurrentUser(function (data) {
            _currentUser = data;
            if (typeof (callback) == 'function') {
                callback(data);
            }
        });
    }

    function selectedRegistrationId() {
        if (_selectedRegistration == null ||
            _selectedRegistration === undefined ||
            _selectedRegistration.UUID.length == 0) {
            return null;
        }

        return _selectedRegistration.UUID;
    }

    function registrationSelected() {
        return selectedRegistrationId() != null;
    }

    function switchBooth(newRegistrationUUID) {
        if (_selectedRegistration == null || _selectedRegistration.UUID.toLowerCase() != newRegistrationUUID.toLowerCase()) {
            setActiveRegistration(newRegistrationUUID);
        }
    }

    function reloadSelectedBooth() {
        setActiveRegistration(_selectedRegistration.UUID);
    }

    function subscribeOnInitialized(onInitialized) {
        if (_initialized) {
            onInitialized();
        }
        else {
            //Ensure that this function is not in the array yet
            for (var i = 0; i < _onInitializedSubscribers.length; i++) {
                if (_onInitializedSubscribers[i] === onInitialized) {
                    //A match was found, return without adding it to the array
                    return;
                }
            }

            //The function passed in is not in the array yet, add it the end
            _onInitializedSubscribers.push(onInitialized);
        }
    }

    function suppressRefresh(suppressRefreshing) {
        _suppressRefresh = suppressRefreshing;
    }

    return {
        ready: ready,
        selectedRegistration: selectedRegistration,
        selectedRegistrationId: selectedRegistrationId,
        registrationSelected: registrationSelected,
        reloadSelectedBooth: reloadSelectedBooth,
        switchBooth: switchBooth,
        subscribeOnInitialized: subscribeOnInitialized,
        currentUser: currentUser,
        reloadCurrentUser: reloadCurrentUser,
        suppressRefresh: suppressRefresh,
        reloadActiveRegistration: reloadActiveRegistration
    };
})();;
var userIdentification = function () {
    var self = {};

    self.ready = ko.observable();
    self.projectCode = ko.observable();
    self.editing = ko.observable();
    self.registration = ko.observable();
    self.userName = ko.observable();
    self.editingSelectedBooth = ko.computed(function () {
        return self.editing() && self.registration() && self.registration().ExternalCustomerBoothID;

    });

    self.logoff = function () {
        showSpinner(true);
        $.ajax({
            url: '/Account/EndSession',
            dataType: 'json',
            type: 'post',
            success: function (data) {
                try {
                    logged_on = false;
                    $('#UserAuth').hide();
                    $('#UserUnauth').show();
                    $('.Checkout').hide();
                    $('.NoCheckout').show();
                    $('.booth_selection').empty();
                    var url = window.location.href.toLowerCase();
                    var redirect = false;
                    var reloadOnLogoff = true;
                    if (typeof (contents) !== 'undefined' && contents !== null) {
                        var redirect_contents = ['shell_schemes'];
                        var contentTags = $.grep(contents, function (content) { return (content.ContentID === currentContentID && $.inArray(content.Tag, redirect_contents) > -1); });
                        if (contentTags.length > 0) {
                            reloadOnLogoff = redirect = true;
                        }
                    }

                    if (reloadOnLogoff) {
                        redirect = redirect || url.indexOf('/logon') !== -1 || url.indexOf('/orders') !== -1;
                        redirect = redirect || url.indexOf('/thankyou') !== -1 || url.indexOf('/revieworder') !== -1;
                        redirect = redirect || url.indexOf('/checkout') !== -1 || url.indexOf('/registerbooth') !== -1;
                        redirect = redirect || url.indexOf('/manage') !== -1;
                        if (redirect)
                            window.location = '/';
                        else
                            window.location.reload();
                    } else {
                        showSpinner(false);
                    }
                } catch (e) {
                    showSpinner(false);
                    window.location = '/';
                    // ShowMessageBox(e.message ? e.message : e);
                }
            },
            error: function (request, status, thrown) {
                showSpinner(false);
                window.location = '/';
                // ShowMessageBox(request.responseText, translations.C357);
            }
        });
    };

    self.passwordChangeRequired = ko.observable();

    //get the show instance
    showInstanceService.getActiveShowInstance(function (data) {
        if (data) {
            expressoEvent.publish("userIdentification.activeShowInstanceRetrieved", data);
        }
    });

    //TODO: figure out how to track projectCode even userContext does not have a booth yet
    var pathName = $(location).attr('pathname');
    var pathNameArr = pathName.split('/');
    if (pathNameArr.length > 0) {
        self.projectCode(pathNameArr[1]);
    }
    self.currentState = ko.observable();

    //create login viewmodel
    self.loginVM = function () {
        var username = ko.observable();
        var password = ko.observable();
        var userFound = ko.observable();
        var emailVerified = ko.observable();
        var createAccountClicked = ko.observable();
        var forgotPasswordClicked = ko.observable();
        var loggingIn = ko.observable();
        var focusUsername = ko.observable(false);
        var linkSent = ko.observable();
        var userNotAuthorized = ko.observable(false);
        var codeVerificationRequired = ko.observable();
        var showAccountNotFoundMessage = ko.observable();

        username.subscribe((value) => {
            self.userName(value);
        });

        function login() {
            loggingIn(true);

            //TODO:  Refactor into login results
            userService.userMustChangePassword(username(), function (changePassword) {
                self.passwordChangeRequired(changePassword);
                if (!self.passwordChangeRequired()) {
                    userService.login(username(), password(), self.projectCode(), function (data) {
                        if (data === 1) { //Success
                            self.forceLogin(undefined);
                            expressoEvent.publish("userIdentification.UserLoggedIn");
                            userContext.reloadCurrentUser(function () {
                                userContext.reloadActiveRegistration(function () {
                                    userFound(true);
                                    codeVerificationRequired(false);
                                });
                            });
                        }
                        else {
                            userFound(true);
                            showAccountNotFoundMessage(false);
                            if (data === 0) { //Not Authorized
                                userNotAuthorized(true);
                            }
                            else if (data === 3) { //Email Verification Required
                                emailVerified(false);
                            }
                            else if (data === 5) { //Code Required
                                //Send the verification code
                                codeVerificationRequired(true);
                                userService.sendMultiFactorAuthenticationCode(username(), self.projectCode());
                            }
                            else {
                                userFound(false);
                                showAccountNotFoundMessage(true);
                            }
                            loggingIn(false);
                        }

                        
                    });
                }
            });
        }

        function resendConfirmationEmail() {
            userService.sendEmailConfirmationLink(username(), null, function (data) {
                linkSent(true);
            });
        }

        var state = {
            name: "login",
            enter: function () {
                username(null);
                password(null);
                userFound(null);
                loggingIn(null);
                codeVerificationRequired(null);
                createAccountClicked(self.startAtCreateAccount);
                setTimeout(function () { focusUsername(true); }, 200); //compensating for visibility change; not ideal, but unfortunately necessary
                self.passwordChangeRequired(false);
            },
            exit: function () {
                focusUsername(false);
            },
            transitions: [{
                stateName: "checkUserStatus",
                condition: function () {
                    return userFound() === true && codeVerificationRequired() == false;
                }
            }, {
                stateName: "createAccount",
                condition: createAccountClicked
            }, {
                stateName: "resetPassword",
                condition: forgotPasswordClicked
            }, {
                stateName: "resetPassword",
                condition: self.passwordChangeRequired
            }, {
                stateName: "verifyCode",
                condition: codeVerificationRequired
            }]

        };

        return {
            login: login,
            username: username,
            password: password,
            focusUsername: focusUsername,
            userFound: userFound,
            emailVerified: emailVerified,
            linkSent: linkSent,
            userNotAuthorized: userNotAuthorized,
            state: state,
            createAccountClicked: createAccountClicked,
            forgotPasswordClicked: forgotPasswordClicked,
            loggingIn: loggingIn,
            resendConfirmationEmail: resendConfirmationEmail,
            showAccountNotFoundMessage: showAccountNotFoundMessage
        };
    }();

    //create new account viewmodel
    self.createAccountVM = function () {
        var backToLoginClicked = ko.observable();
        var creatingAccount = ko.observable();
        var showResendEmail = ko.observable();
        var resendingEmail = ko.observable();

        var createAccountClicked = function () {
            if (newAccount.errors().length > 0) {
                newAccount.errors.showAllMessages(true);
                return false;
            }

            creatingAccount(true);

            userService.createAccount(newAccount().username(), newAccount().password(), newAccount().email(), newAccount().phone(), newAccount().mfaOptIn(), function (data) {
                if (!data.Error) {
                    expressoEvent.publish("userIdentification.UserLoggedIn");
                    userContext.reloadCurrentUser(function () {
                        userContext.reloadActiveRegistration(function () {
                            accountCreated(true);
                            creatingAccount(false);
                            window.location.replace(window.location.origin + "/" + "Account/ConfirmationEmailSent");
                        });
                    });
                }
                else {
                    errorText(data.ErrorMessage);
                    showResendEmail(data.AllowEmailConfirmationResend);
                    creatingAccount(false);
                }
            });
        };

        function resendEmail() {
            resendingEmail(true);
            userService.sendEmailConfirmationLink(null, newAccount().email(), function () {
                resendingEmail(false);
                errorText(translations.VerificationEmailSentMessage);
            });
        }

        var newAccount = ko.validatedObservable({
            username: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C72
                },
                pattern: {
                    message: translations.ValidUserNames,
                    params: /^[a-zA-Z0-9-_]+$/
                },
                minLength: {
                    message: translations.ValidUserNames,
                    params: 6
                },
                maxLength: {
                    message: translations.ValidUserNames,
                    params: 20
                }
            }),
            password: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C72
                },
                pattern: {
                    message: translations.C362a,
                    params: /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])|(?=.*\d)(?=.*[a-zA-Z])(?=.*[\W_])|(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_])){3}.*$/
                },
                minLength: {
                    params: 8,
                    message: translations.C362
                }
            }),
            confirmPassword: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C72
                },
                equal: {
                    params: function () { return newAccount().password() },
                    message: translations.C361
                }
            }),
            email: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C72
                },
                email: {
                    params: true,
                    message: translations.C658
                },

                validation: {
                    validator: function (userVal, paramsVal) {

                        return userVal.toLowerCase() !== paramsVal.toLowerCase();
                    },
                    message: translations.C658,
                    params: 'none@none.com'
                }

            }),
            phone: ko.observable().extend({
                pattern: {
                    message: translations.C13,
                    params: /^(?:\+\d{1,3}|0\d{1,3}|00\d{1,2})?(?:\s?\(\d+\))?(?:[-\/\s.]|\d)+$/
                }
            }),
            mfaOptIn: ko.observable(false)
        }, { deep: true, observable: false });
        var errorText = ko.observable();
        var accountCreated = ko.observable();

        var state = {
            name: "createAccount",
            enter: function () {
                for (var field in newAccount()) {
                    newAccount()[field](null);
                    newAccount()[field].isModified(null);
                }

                showResendEmail(null);
                resendingEmail(null);
                accountCreated(null);
                errorText(null);
                creatingAccount(null);

            },
            transitions: [{
                stateName: "login",
                condition: backToLoginClicked
            }, {
                stateName: "checkUserStatus",
                condition: function () {
                    return accountCreated();
                }
            }]
        };

        return {
            showResendEmail: showResendEmail,
            resendEmail: resendEmail,
            resendingEmail: resendingEmail,
            creatingAccount: creatingAccount,
            newAccount: newAccount,
            errorText: errorText,
            state: state,
            backToLoginClicked: backToLoginClicked,
            createAccountClicked: createAccountClicked
        };
    }();

    //create reset password viewmodel
    self.resetPasswordVM = function () {
        var backToLoginClicked = ko.observable();
        var resetPasswordEmailSent = ko.observable();
        var email = ko.observable();
        var errorText = ko.observable();

        function resetPasswordClicked() {
            userService.resetPassword(email, function (data) {
                resetPasswordEmailSent(true);
                errorText(null)
            });
        }

        var state = {
            name: "resetPassword",
            enter: function () {
                resetPasswordEmailSent(null)
                email(null);
                errorText(null);
            },
            transitions: [{
                stateName: "login",
                condition: backToLoginClicked
            }]

        };

        return {
            state: state,
            email: email,
            errorText: errorText,
            resetPasswordEmailSent: resetPasswordEmailSent,
            passwordChangeRequired: self.passwordChangeRequired,
            resetPasswordClicked: resetPasswordClicked,
            backToLoginClicked: backToLoginClicked,
        };
    }();

    self.verifyCodeVM = function (projectCode) {
        var backToLoginClicked = ko.observable();
        var verificationCode = ko.observable();
        var verifyingCode = ko.observable();
        var codeVerified = ko.observable(null);
        var invalidCode = ko.observable(null);

        function verifyCode() {
            verifyingCode(true);
            userService.verifyCode(self.userName(), verificationCode(), (result) => {
                codeVerified(result);
                invalidCode(!result);
                verifyingCode(false);
                if (result) {
                    expressoEvent.publish("userIdentification.UserLoggedIn");
                }
            });
        }

        var state = {
            name: "verifyCode",
            enter: function () {
                codeVerified(null);
                invalidCode(null);
                verifyingCode(false);
                verificationCode(null);
                backToLoginClicked(null);
            },
            transitions: [
                {
                    stateName: "login",
                    condition: backToLoginClicked
                },
                {
                stateName: "checkUserStatus",
                    condition: codeVerified
                }
            ]

        };
        return {
            verificationCode: verificationCode,
            verifyingCode: verifyingCode,
            verifyCode: verifyCode,
            invalidCode: invalidCode,
            backToLoginClicked: backToLoginClicked,
            state: state
        };
    }(self.projectCode());

    //create booth search viewmodel
    //TODO request the project code from a different module instead of injecting it
    self.searchBoothVM = function (projectCode) {
        var createNewBoothClick = ko.observable(false);
        var editExistingBooth = ko.observable(false);
        var searching = ko.observable();
        var allowCreateBooth = ko.observable();
       
        var search = ko.validatedObservable({
            findBoothCriteria: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C72
                }
            })
        }, { deep: true, observable: true });

        var searchAttempted = ko.observable();

        function editCurrentBoothClick() {
            editExistingBooth(false);
            var selectedBooth = {
                Booth: {
                    BoothNumber: self.registration().BoothNumber,
                    BoothWidth: self.registration().BoothWidth,
                    BoothLength: self.registration().BoothLength
                },
                Exhibitor: {
                    CustomerName:  self.registration().ExhibitorCompanyName
                },
                IsEditMode : true
            }

            expressoEvent.publish("userIdentification.BoothSelected", selectedBooth);
            editExistingBooth(true);
            event.stopPropagation();
            event.preventDefault();
        }

        //get the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowCreateBooth(showInstance.AllowManualBoothAdds);

        });

        function findBoothClick() {
            search.errors.showAllMessages(false);

            if (search.errors().length > 0) {
                search.errors.showAllMessages(true);
                return false;
            }

            searching(true);

            //Show the wait dialog while searching
            ShowWaitDialog();

            //Initiate the search based on the criteria passed in, close the wait dialog when complete
            exhibitorBoothService.searchBooths(
                projectCode, search().findBoothCriteria(), function (data) {
                    if (data) {
                        expressoEvent.publish("userIdentification.BoothSearchResultsFound", { searchCriteria: search().findBoothCriteria(), results: data });
                    }
                    searchAttempted(true);
                    searching(false);
                }, HideWaitDialog);
        }

        var state = {
            name: "searchBooth",
            enter: function () {
                search().findBoothCriteria(null);
                searchAttempted(null);
                search.errors.showAllMessages(false);
                searching(null);
            },
            transitions: [
                {
                    stateName: "chooseBooth",
                    condition: function () { return searchAttempted(); }
                },
                {
                    stateName: "createBooth",
                    condition: createNewBoothClick
                },
                {
                    stateName: "createBooth",
                    condition: editExistingBooth
                }
            ]

        };

        return {
            state: state,
            search: search,
            searching: searching,
            editCurrentBoothClick: editCurrentBoothClick,
            createNewBoothClick: createNewBoothClick,
            registration: self.registration,
            editingSelectedBooth: self.editingSelectedBooth,
            findBoothClick: findBoothClick,
            allowCreateBooth: allowCreateBooth
        };
    }(self.projectCode());

    //create booth search viewmodel
    self.chooseBoothVM = function () {
        var findBoothCriteria = ko.observable();
        var backToSearchClick = ko.observable();
        var createNewBoothClick = ko.observable();
        var boothSearchResults = ko.observable();
        var userSelectedBooth = ko.observable();
        var hasValidDimensions = ko.observable();
        var allowCreateBooth = ko.observable();
        var manualBoothNotFoundMessage = ko.observable();

        //get the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowCreateBooth(showInstance.AllowManualBoothAdds);
             
            if (!allowCreateBooth()) {
                facilityService.getShowOrganizerFacilityByProjectCode(function (data) {
                    if (data) {
                        manualBoothNotFoundMessage(translations.BoothNotFoundNoManualBoothAdds
                            .replace("{0}", data.Name)
                            .replace("{1}", !data.Phone ? "" : data.Phone)
                            .replace(" or ", !data.Phone ? " " : data.Phone) //need to remove the "or" if there is no phone number
                            .replace("{2}", data.Email)
                            .replace("{2}", data.Email));
                    }
                });
            }
        });

        //subscribe to the booth search
        expressoEvent.subscribe("userIdentification.BoothSearchResultsFound", function (data) {
            findBoothCriteria(data.searchCriteria);
            boothSearchResults(data.results);
        });

        //User selected their booth, set it as the selected booth
        var chooseBoothClick = function () {
            expressoEvent.publish("userIdentification.BoothSelected", this);
            userSelectedBooth(true);
        }

        var state = {
            name: "chooseBooth",
            enter: function () {
                userSelectedBooth(null);
            },
            transitions: [
                {
                    stateName: "confirmBooth",
                    condition: function () { return userSelectedBooth(); }
                },
                {
                    stateName: "searchBooth",
                    condition: backToSearchClick
                },
                {
                    stateName: "createBooth",
                    condition: createNewBoothClick
                }
            ]
        };

        return {
            state: state,
            boothSearchResults: boothSearchResults,
            chooseBoothClick: chooseBoothClick,
            createNewBoothClick: createNewBoothClick,
            backToSearchClick: backToSearchClick,
            findBoothCriteria: findBoothCriteria,
            allowCreateBooth: allowCreateBooth,
            manualBoothNotFoundMessage: manualBoothNotFoundMessage
        };
    }();

    //choose locked booth viewmodel
    self.chooseLockedBoothVM = function () {
        //Bound to the responsible party name text box
        var responsiblePartyName = ko.observable().extend({
            required: {
                params: true,
                message: "Required"
            }
        });
        //Bound to list of booths the user can choose from
        var lockedBoothsList = ko.observableArray();

        //Bound to each booth listed for the user to set at this booth
        var chooseBoothClick = function () {
            //Check if there are any required fields not populated
            var errors = ko.validation.group(responsiblePartyName)
            if (errors().length > 0) {
                errors.showAllMessages(true);
                return;
            }

            //The user required fields are supplied, set 3rd party fields and publish that it is ready to be saved
            this.IsExhibitor = false;
            this.Exhibitor.ThirdPartyCompanyName = responsiblePartyName();
            this.CopyExhibitorQuestionnaires = true;
            expressoEvent.publish("userIdentification.BoothSelected", this);

            //Trigger a state change to submitBooth
            userSelectedBooth(true);
        }

        //Internal vm signal to trigger a state transition to submitBooth
        var userSelectedBooth = ko.observable();

        var state = {
            name: "chooseLockedBooth",
            enter: function () {
                userSelectedBooth(null);
                //Load up the exhibitor booths for this user at this show
                exhibitorBoothService.getUserBooths(userContext.selectedRegistration().UserLoginName, userContext.selectedRegistration().ShowInstanceID,
                    function (data) {
                        //Set the data to be listed on the front end
                        lockedBoothsList(data);
                    });
            },
            transitions: [
                {
                    //Go to the submitBooth state in order to save this booth to the server when they make their selection
                    stateName: "submitBooth",
                    condition: function () {
                        return userSelectedBooth();
                    }
                }
            ]
        };

        return {
            state: state,

            //Fields bound to the view
            responsiblePartyName: responsiblePartyName,
            lockedBoothsList: lockedBoothsList,
            chooseBoothClick: chooseBoothClick
        };
    }();

    //create booth viewmodel
    self.createBoothVM = function () {
        var backToBoothSearch = ko.observable();
        var chooseRegistrationType = ko.observable();
        var boothInfoPublish = ko.observable();
        var boothNumber = ko.observable();
        var boothNumberIsChecked = ko.observable(false);
        var boothNumberText = ko.observable("");
        var stateIsStartState = ko.observable();
        var boothUom = ko.observable();
        var allowBoothSelection = ko.observable();

        var projectCode = $(location).attr('pathname').split("/")[1];

        //Check if this is a 'company' home page where the first argument is a 'c', ie c/US, c/UK etc.. 
        if (projectCode === 'c' || projectCode === 'Error') {
            //This is actually not a real project code, just a directed homepage, clear the notion of being within a project
            projectCode = undefined;
        }

        expressoEvent.subscribe('userIdentification.PostLoginStartState', function (data) {
            if (data === "createBooth") {
                stateIsStartState(true);
            }
        });

        //subscribe to retrieving the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowBoothSelection(showInstance.AllowBoothSelection);
        });

        var booth = ko.validatedObservable({
            companyName: ko.observable().extend({
                required: {
                    params: true,
                    message: "This field is required."
                }
            }),
            boothNumber: ko.pureComputed({
                read: boothNumberText,
                write: function (value) {
                    boothNumberText(value);
                }
            }).extend({
                required: {
                    params: true,
                    message: translations.ValidateBoothNumber
                }
            }),
            boothWidth: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C736
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C736
                }
            }),
            boothLength: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C737
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C737
                }
            })
        }, { deep: true, observable: true });

        number: ko.observable();

        var boothNotKnown = ko.pureComputed({
            read: boothNumberIsChecked,
            write: function (value) {
                if (!boothNumberIsChecked() && value) {
                    boothNumberText(translations.C633);
                }
                if (boothNumberIsChecked() && !value) {
                    boothNumberText("");
                    booth.errors.showAllMessages(false);
                }
                boothNumberIsChecked(value);
            }
        });

        function createBooth() {

            booth.errors.showAllMessages(false);

            if (booth.errors().length > 0) {
                booth.errors.showAllMessages(true);
                return false;
            }

            if (boothNotKnown() === true) {
                boothNumber(translations.C633);
            }

            var selectedBooth = {
                Booth: {
                    BoothNumber: booth().boothNumber(),
                    BoothWidth: booth().boothWidth(),
                    BoothLength: booth().boothLength()
                },
                Exhibitor: {
                    ExhibitorName: booth().companyName()
                }
            }
            expressoEvent.publish('userIdentification.BoothSelected', selectedBooth);
            boothInfoPublish(true);
        }

        function backToSearch() {
            backToBoothSearch(true);
        }

        var state = {
            name: "createBooth",
            enter: function () {
                boothInfoPublish(null);
                boothNotKnown(false);
                backToBoothSearch(null);
                boothUom(null);
                booth().boothNumber(self.registration()?.BoothNumber);
                booth().boothWidth(self.registration()?.BoothWidth);
                booth().boothLength(self.registration()?.BoothLength);
                booth().companyName(self.registration()?.ExhibitorCompanyName);
                booth.errors.showAllMessages(false);

                exhibitorBoothService.getExhibitorBoothUom(projectCode, function (data) {
                    if (data) {
                        boothUom("(" + data + ")");
                    }
                });
            },
            transitions: [{
                stateName: "searchBooth",
                condition: backToBoothSearch
            },
            {
                stateName: "validateSelectedBooth",
                condition: function () { return boothInfoPublish() && !self.registration(); }
            },
            {
                stateName: "confirmBooth",
                condition: function () { return boothInfoPublish() && self.registration(); }
            },
            ]
        };

        return {
            createBooth: createBooth,
            backToSearch: backToSearch,
            state: state,
            backToBoothSearch: backToBoothSearch,
            chooseRegistrationType: chooseRegistrationType,
            booth: booth,
            boothNotKnown: boothNotKnown,
            isBackButtonVisible: ko.computed(function () { return !stateIsStartState() && allowBoothSelection(); }),
            boothUom: boothUom,
            registration: self.registration
        };
    }();

    //create booth confirmation viewmodel
    self.confirmBoothVM = function () {
        var selectedBooth = ko.observable();
        var userUpdatedBooth = ko.observable();
        var backToBoothSearch = ko.observable();
        var boothUom = ko.observable();
        var createNewBoothClick = ko.observable();
        var editBoothDimensions = ko.observable();
        var userMustSelectRegistrationType = ko.observable();
        var allowCreateBooth = ko.observable();

        //subscribe to retrieving the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowCreateBooth(showInstance.AllowManualBoothAdds);
        });

        // create validated observable for boothWidth and boothLength
        var boothDimensions = ko.validatedObservable({
            boothWidth: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C736
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C736
                }
            }),
            boothLength: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C737
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C737
                }
            })
        }, { deep: true, observable: true });;

        // create validated observable for boothWidth and boothLength
        var booth = ko.validatedObservable({
            companyName: ko.observable().extend({
                required: {
                    params: true,
                    message: "This field is required."
                }
            }),
            boothNumber: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.ValidateBoothNumber
                }
            }),
            boothWidth: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C736
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C736
                }
            }),
            boothLength: ko.observable().extend({
                required: {
                    params: true,
                    message: translations.C737
                },
                pattern: {
                    params: /^\d+[\.]?\d{0,2}$/g,
                    message: translations.MustBeNumber
                },
                min: {
                    params: 1,
                    message: translations.C737
                }
            })
        }, { deep: true, observable: true });

        //subscribe to booth object
        expressoEvent.subscribe('userIdentification.BoothSelected', function (data) {
            selectedBooth(data);

            //populate boothWidth and boothLength from selectedBooth
            boothDimensions().boothWidth(selectedBooth().Booth.BoothWidth);
            boothDimensions().boothLength(selectedBooth().Booth.BoothLength);

            editBoothDimensions(!(boothDimensions().boothWidth() * boothDimensions().boothLength()));

        });

        function confirmBooth() {

            boothDimensions.errors.showAllMessages(false);

            if (boothDimensions.errors().length > 0) {
                boothDimensions.errors.showAllMessages(true);
                return false;
            }

            boothDimensions.errors.showAllMessages(false);
            //populate Booth objects width and length
            selectedBooth().Booth.BoothWidth = boothDimensions().boothWidth();
            selectedBooth().Booth.BoothLength = boothDimensions().boothLength();

            //publish new booth info
            expressoEvent.publish('userIdentification.BoothSelected', selectedBooth());

            userUpdatedBooth(true);
        };

        function backToSearch() {
            backToBoothSearch(true);
        }

        var state = {
            name: "confirmBooth",
            enter: function () {
                userUpdatedBooth(null);
                backToBoothSearch(null);
                boothUom(null);
                boothDimensions.errors.showAllMessages(false);
                userMustSelectRegistrationType(null);

                exhibitorBoothService.getExhibitorBoothUom(projectCode, function (data) {
                    if (data) {
                        boothUom("(" + data + ")");
                    }
                });

                thirdPartyService.getThirdPartyServicesByProjectCode(projectCode, function (data) {
                    if (data.length > 0) {
                        userMustSelectRegistrationType(true);
                    }
                    else {
                        userMustSelectRegistrationType(false);
                    }
                })
                
            },
            transitions: [
                {
                    stateName: "chooseRegistrationType",
                    condition: function () {
                        return userUpdatedBooth() && userMustSelectRegistrationType() === true
                    }
                },
                {
                    stateName: "submitBooth",
                    condition: function () {
                        return userUpdatedBooth() && userMustSelectRegistrationType() === false
                    }
                },
                {
                    stateName: "searchBooth",
                    condition: backToBoothSearch
                },
                {
                    stateName:"createBooth",
                    condition: createNewBoothClick
                },
            ]
        };

        return {
            state: state,
            selectedBooth: selectedBooth,
            boothDimensions: boothDimensions,
            editBoothDimensions: editBoothDimensions,
            backToSearch: backToSearch,
            boothUom: boothUom,
            confirmBooth: confirmBooth,
            createNewBoothClick: createNewBoothClick,
            booth: booth,
            allowCreateBooth: allowCreateBooth
        };
    }();

    self.chooseRegistrationTypeVM = function () {
        var submitTheBooth = ko.observable();
        var selectedBooth = ko.observable();
        var backToBoothSearch = ko.observable();
        var backToCreateBooth = ko.observable();
        var startedState = ko.observable();
        var allowCreateBooth = ko.observable();
        var allowBoothSelection = ko.observable();
        var radioIsExhibitorValid = ko.validatedObservable({
            radioIsExhibitor: ko.observable().extend({
                required: {
                    params: true,
                    message: "Please Choose An Option"
                }
            })
        });

        //get the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowCreateBooth(showInstance.AllowManualBoothAdds);
            allowBoothSelection(showInstance.AllowBoothSelection);
        });


        expressoEvent.subscribe("userIdentification.BoothSelected", function (data) {
            selectedBooth(data);
        });

        expressoEvent.subscribe('userIdentification.PostLoginStartState', function (data) {
            startedState(data);
        });

        function registerBooth() {
            radioIsExhibitorValid.errors.showAllMessages(false);

            if (radioIsExhibitorValid.errors().length > 0) {
                radioIsExhibitorValid.errors.showAllMessages(true);
                submitTheBooth(false);
                return false;
            }

            selectedBooth()["IsExhibitor"] = radioIsExhibitorValid().radioIsExhibitor();
            expressoEvent.publish('userIdentification.BoothSelected', selectedBooth());
            submitTheBooth(true);
        }

        function backToSearch() {
            if (startedState() === "searchBooth" && allowBoothSelection()) {
                backToBoothSearch(true);
            }

            if (startedState() === "createBooth" || !(allowBoothSelection())) {
                backToCreateBooth(true);
            }
        }

        var state = {
            name: "chooseRegistrationType",
            enter: function () {
                radioIsExhibitorValid().radioIsExhibitor(null);
                backToBoothSearch(null);
                backToCreateBooth(null);
                submitTheBooth(null);
                radioIsExhibitorValid.errors.showAllMessages(false);
            },
            transitions: [
                {
                    stateName: "searchBooth",
                    condition: backToBoothSearch
                }, {
                    stateName: "createBooth",
                    condition: backToCreateBooth
                },
                {
                    stateName: "submitBooth",
                    condition: function () {
                        return submitTheBooth() === true;
                    }
                }]

        };

        return {
            state: state,
            backToSearch: backToSearch,
            registerBooth: registerBooth,
            radioIsExhibitorValid: radioIsExhibitorValid,
            allowCreateBooth: allowCreateBooth
        };
    }();

    //instantiate state machine
    self.stateMachine = knockoutFiniteStateMachine({
        startStateName: "checkUserStatus"
    });

    self.stateMachine.subscribeOnChange(function (newStateName) {
        self.currentState(newStateName);
    });

    //
    //Add states
    //

    //create login status check state
    self.stateMachine.states.push(function () {
        var contextChecked = ko.observable();
        var lockedBoothsChecked = ko.observable();
        var userLoggedIn = ko.observable();
        var userHasRegistration = ko.observable();
        var createNewBooth = ko.observable();
        var boothsLocked = ko.observable();
        var allowCreateBooth = ko.observable();
        var allowBoothSelection = ko.observable();
        var allowBoothDeletion = ko.observable();

        //subscribe to retrieving the show instance
        expressoEvent.subscribe("userIdentification.activeShowInstanceRetrieved", function (showInstance) {
            allowCreateBooth(showInstance.AllowManualBoothAdds);
            allowBoothSelection(showInstance.AllowBoothSelection);
            allowBoothDeletion(showInstance.AllowBoothDeletion);
           
        });

      
        var projectCode = $(location).attr('pathname').split("/")[1];

        //Check if this is a 'company' home page where the first argument is a 'c', ie c/US, c/UK etc.. 
        if (projectCode === 'c' || projectCode === 'Error') {
            //This is actually not a real project code, just a directed homepage, clear the notion of being within a project
            projectCode = undefined;
        }
        return {
            name: "checkUserStatus",
            enter: function () {
                lockedBoothsChecked(false);
                userContext.subscribeOnInitialized(function () {
                    userContext.reloadCurrentUser(() => {
                        if (userContext.currentUser()) {
                            if (userContext.selectedRegistration() && !self.editing()) {
                                userHasRegistration(true);

                                //check the single sign on status of this show
                                singleSignOnProviderService.getByShowInstance(userContext.selectedRegistration().ShowInstanceID, function (data) {
                                    if (data) {
                                        boothsLocked(data.LockBooths);
                                    }
                                    lockedBoothsChecked(true);
                                })

                                expressoEvent.publish("userIdentification.RegistrationConfirmed");

                            } else {
                                //No need to check for locked booths if they do not have a registration
                                lockedBoothsChecked(true);
                            }

                            //GET COUNT OF EXHIBITOR BOOTHS
                            exhibitorBoothService.getExhibitorBoothCount(projectCode, function (data) {
                                if (data === 0) {
                                    expressoEvent.publish("userIdentification.PostLoginStartState", "createBooth");
                                    createNewBooth(true);
                                }
                                else {
                                    expressoEvent.publish("userIdentification.PostLoginStartState", "searchBooth");
                                    createNewBooth(false)
                                }
                            });

                            userLoggedIn(true);
                            contextChecked(true);
                        }
                        else {
                        userLoggedIn(false);
                        contextChecked(true);
                        //No need to check for locked booths if they are not logged in
                        lockedBoothsChecked(true);
                        }
                    });
                });
            },
            exit: function () {
                userLoggedIn(null);
                userHasRegistration(null);
                contextChecked(null);
                createNewBooth(null);
                boothsLocked(null);
                lockedBoothsChecked(null);
            },
            transitions: [
                {
                    stateName: "login",
                    condition: function () {
                        return contextChecked() && (userLoggedIn() !== true || self.forceLogin());
                    }
                },
                {
                    stateName: "searchBooth",
                    condition: function () {
                        return contextChecked() && allowBoothSelection() && userLoggedIn() && projectCode && createNewBooth() === false && lockedBoothsChecked() && !boothsLocked() && (!userHasRegistration() || self.forceSelectNewBooth);
                    }
                },
                {
                    stateName: "createBooth",
                    condition: function () {
                        return allowCreateBooth() && contextChecked() && userLoggedIn() && projectCode && (createNewBooth() === true || !allowBoothSelection()) && lockedBoothsChecked() && !boothsLocked() && (!userHasRegistration() || self.forceSelectNewBooth);
                    }
                },
                {
                    stateName: "chooseLockedBooth",
                    condition: function () {
                        return lockedBoothsChecked() && boothsLocked();
                    }
                },
                {
                    stateName: "end",
                    condition: function () {
                        //for some reason, we need to pile this conditional into a value before returning it, or it won't register in the state machine
                        var value =
                            contextChecked()
                            && userLoggedIn()
                            && (typeof projectCode === "undefined" || projectCode.length < 1 || self.loginOnly || (typeof projectCode !== "undefined" && projectCode.length > 0 && userHasRegistration() && !self.forceSelectNewBooth && typeof (allowCreateBooth()) !== "undefined"))
                            && lockedBoothsChecked()
                            && !boothsLocked();
                        return value;
                    }
                }
            ]
        };
    }());

    //create booth validation check state
    self.stateMachine.states.push(function (projectCode) {
        var userMustSelectRegistrationType = ko.observable();
        var selectedBooth = ko.observable();
        var duplicateBooth = ko.observable();

        expressoEvent.subscribe("userIdentification.BoothSelected", function (data) {
            selectedBooth(data);
        });

        return {
            name: "validateSelectedBooth",
            enter: function () {

                userMustSelectRegistrationType(null);

                if (selectedBooth().Booth.BoothNumber != null) {
                    ShowWaitDialog();
                    $.ajax({
                        url: "/Registration/ValidateBoothNumber",
                        data: {
                            projectCode: projectCode,
                            boothNumber: selectedBooth().Booth.BoothNumber,
                            exbName: selectedBooth().Exhibitor.ExhibitorName
                        },
                        dataType: 'json',
                        type: 'get',
                        success: function (result) {
                            HideWaitDialog();
                            try {
                                if (result === true) {
                                    duplicateBooth(false);
                                }
                                else {
                                    duplicateBooth(true);
                                }
                            } catch (e) {
                                window.location.reload();
                            }
                        },
                        error: function (thrown) {
                            
                            console.log(thrown);
                            window.location.reload();
                            
                        }
                    });
                }
            },
            transitions: [
                {
                    stateName: "createBooth",
                    condition: function () {
                        return duplicateBooth() === true;
                    }
                },
                {
                    stateName: "confirmBooth",
                    condition: function () {
                        return duplicateBooth() === false;
                    }
                },

            ]
        };
    }(self.projectCode()));

    //create submit booth state
    self.stateMachine.states.push(function (projectCode) {
        var selectedBooth = ko.observable();
        var registrationSuccessful = ko.observable();

        expressoEvent.subscribe("userIdentification.BoothSelected", function (data) {
            selectedBooth(data);
        });

        return {
            name: "submitBooth",
            enter: function () {
                exhibitorBoothService.createBooth(
                    projectCode,
                    self.editing() ? self.registration().ID : null,
                    selectedBooth().ID,
                    selectedBooth().Booth.BoothNumber,
                    selectedBooth().Booth.BoothWidth,
                    selectedBooth().Booth.BoothLength,
                    selectedBooth().Exhibitor.ExhibitorName,
                    selectedBooth().IsExhibitor,
                    selectedBooth().ExternalId,
                    selectedBooth().Exhibitor.ThirdPartyCompanyName,
                    selectedBooth().CopyExhibitorQuestionnaires,
                    function (data) {
                        if (data && data.ProjectCode === projectCode) {
                            userContext.reloadCurrentUser(function () {
                                userContext.reloadActiveRegistration(function () {
                                    expressoEvent.publish("userIdentification.RegistrationCreated");
                                    registrationSuccessful(true);
                                    window.location = "/" + data.ProjectCode;
                                });
                            });
                        }
                        else if (data) {
                            window.location = "/" + data.ProjectCode;
                        }
                    });                
            },
            transitions: [
                {
                    stateName: "end",
                    condition: function () {
                        return registrationSuccessful();
                    }
                }]
        }
    }(self.projectCode()));

    self.stateMachine.states.push(function () {
        return {
            name: "end",
            enter: function () {
                expressoEvent.publish("userIdentification.ProcessEnded");
                self.stateMachine.stop();
            }
        };
    }());

    self.stateMachine.states.push(self.loginVM.state);
    self.stateMachine.states.push(self.createAccountVM.state);
    self.stateMachine.states.push(self.resetPasswordVM.state);
    self.stateMachine.states.push(self.verifyCodeVM.state);
    self.stateMachine.states.push(self.searchBoothVM.state);
    self.stateMachine.states.push(self.chooseBoothVM.state);
    self.stateMachine.states.push(self.chooseLockedBoothVM.state);
    self.stateMachine.states.push(self.createBoothVM.state);
    self.stateMachine.states.push(self.confirmBoothVM.state);
    self.stateMachine.states.push(self.chooseRegistrationTypeVM.state);

    var userLoggedIn = false;
    //defined initialization function
    self.show = function (params) {
        userLoggedIn = false;
        if (typeof params.onLogin === "function") {
            self.onLogin = params.onLogin;
        }
        if (typeof params.onCreateRegistration === "function") {
            self.onCreateRegistration = params.onCreateRegistration;
        }
        if (typeof params.onRegistrationConfirmed === "function") {
            self.onRegistrationConfirmed = params.onRegistrationConfirmed;
        }
        if (typeof params.onDismiss === "function") {
            self.onDismiss = params.onDismiss;
        }
        self.editing(false);
        if (params.registrationId) {
            self.editing(true);
            registrationService.getRegistration(params.registrationId, (registration) => {
                self.registration(registration);
            });
        }
        else {
            self.registration(null);
        }
        self.refreshAfterLoginAndDismiss = params.refreshAfterLoginAndDismiss;
        self.forceLogin = ko.observable(params.forceLogin);
        self.startAtCreateAccount = params.startAtCreateAccount;
        self.loginOnly = params.loginOnly;
        self.forceSelectNewBooth = params.forceSelectNewBooth;
        self.projectCode(params.projectCode);
        self.ready(true);
        self.ready.subscribe(function () {
            if (!self.ready()) {
                expressoEvent.publish("userIdentification.ProcessEnded");
            }
        });
        self.stateMachine.start();

    }

    //subscribe to messages so we can execute consumer-provided functions
    expressoEvent.subscribe("userIdentification.UserLoggedIn", function () {
        if (typeof self.onLogin === "function") { self.onLogin(); }
        userLoggedIn = true;
    });

    expressoEvent.subscribe("userIdentification.RegistrationCreated", function () {
        if (typeof self.onCreateRegistration === "function") { self.onCreateRegistration(); }
    });

    expressoEvent.subscribe("userIdentification.RegistrationConfirmed", function () {
        if (typeof self.onRegistrationConfirmed === "function") { self.onRegistrationConfirmed(); }
    });

    expressoEvent.subscribe("userIdentification.ProcessEnded", function () {
        if (typeof self.onDismiss === "function") { self.onDismiss(); }
        self.ready(false);

        if (self.refreshAfterLoginAndDismiss && userLoggedIn) {
            ShowWaitDialog();
            if (self.projectCode()) {
                checklistService.checkForceOverdueMandatoryForms(self.projectCode(), function (overdueFormsFound) {
                    if (overdueFormsFound) {
                        window.location.href = window.location.origin + "/" + self.projectCode() + "/checklist";
                    }
                    else {
                        window.location.reload();
                    }
                });
            }
            else {
                window.location.reload();
            }

        }
    });



    $(document).ready(function () {
        //apply bindings
        var node = document.getElementById("userIdentification");

        if (node && !ko.dataFor(node)) {

            ko.applyBindings(self, node);
            ko.validation.init({ insertMessages: false }); //init validation
            self.ready.subscribe(function () {
                if (!self.ready()) {
                    //report outside-of-process termination
                    if (self.currentState() !== "end") {
                        expressoEvent.publish("userIdentification.ProcessEnded");
                        self.stateMachine.stop();
                    }
                }
            });
        }
    });

    return self;
}();



;
/*      Variables       */
var current_country = null;
var currencySymbol;
var numericMask;
var thousandsSeparator = ",";
var decimalCharacter = ".";
var current_search = null;
var search_busy = false;
var next_search = "";
var keyboard_settle = null;
var toggle_shell_schemes = false;
var vatNumberSavedHash = {};
var creditCardNumberHash = {};
// GUID PATTERN (USED IN expressoGlobal.js AND countrySelector.js)
var pattern = new RegExp(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/);
var vatNumberUserInputRegEx = new RegExp(/^[A-Za-z0-9]+$/);

/*      Event handlers      */
$(document).ready(function () {
    $(window).bind('resize load', UpdateSearchPosition);

    current_country = $("#CountryID").change(OnCountryUpdate).keyup(OnCountryUpdate).val();

    $("#search")
        .bind('keyup mouseup', CheckSettle)
        .toggleClass("empty_search", ($("#search").val() || "").length == 0);

    $("#search_results_dropdown").hover(function () {
        $(this).stop(true, true).show();
    }, function () {
        $(this).stop(true, true).fadeOut('slow');
    });
});


/*      Test functions      */
function hasValue(val) {
    return (typeof val != "undefined") && (val != null) && (val.toString().length > 0);
}
function IsNullOrEmpty(Value) {
    return Value == null ? true : (Value.toString().length == 0);
}

/*      Format functions        */
function FormatWholeNumber(value) {
    var val = typeof (value) == 'object' ? value.val() : value;
    val = parseInt(val) === Number(val) ? parseInt(val) : val;

    if (typeof (value) == 'object') {
        value.val(val);
    } else {
        return val;
    }
}
function FormatDims(w, l, h, parens) {
    var d = null;
    if (w != null && w.toString().length > 0) {
        d = FormatWholeNumber(w);
    }
    if (l != null && l.toString().length > 0) {
        if (d != null) d += " x ";
        d += FormatWholeNumber(l);
    }
    if (h != null && h.toString().length > 0) {
        if (d != null) d += " x ";
        d += FormatWholeNumber(h);
    }
    if (parens && d != null) {
        d = " (" + d + ")";
    }
    return d;
}
function camelCase(val) {
    val = val || "";
    val = val.toLowerCase().replace(/\b[a-z]/g, function (letter) {
        return letter.toUpperCase();
    });
    return val;
}
function JSONtoDate(dt, isUTC) {
    var s = parseInt(dt.replace(/\/Date\((\d+)\)\//gi, "$1"));

    var d = new Date(s);
    if (isUTC) {
        d = new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
    }

    return d;
}

function formatTime(dt) {
    var hours = dt.getUTCHours();
    var minutes = dt.getUTCMinutes();
    var period = (hours >= 12) ? 'PM' : 'AM';

    hours = ((hours + 11) % 12 + 1);

    hours = hours < 10 ? '0' + hours : hours;
    minutes = minutes < 10 ? '0' + minutes : minutes;

    return hours + ':' + minutes + ' ' + period;
}

function formatUSDate(dt) {
    var month = dt.getUTCMonth() + 1;
    var day = dt.getUTCDate();
    var year = dt.getUTCFullYear();

    month = month < 10 ? '0' + month : month;
    day = day < 10 ? '0' + day : day;

    return month + '/' + day + '/' + year;
}

function fmtNbr(num, dec, thou, pnt, curr1, curr2, n1, n2) {
    var x = Math.round(num * Math.pow(10, dec));
    if (x >= 0)
        n1 = n2 = '';
    var y = ('' + Math.abs(x)).split('');
    var z = y.length - dec;
    if (z < 0)
        z--;
    for (var i = z; i < 0; i++)
        y.unshift('0');
    if (z < 0)
        z = 1;
    if (dec > 0) y.splice(z, 0, pnt);
    if (y[0] == pnt)
        y.unshift('0');
    while (z > 3) {
        z -= 3; y.splice(z, 0, thou);
    }
    var r = curr1 + n1 + y.join('') + n2 + curr2;
    return r;
}
function FormatNumber(value, places) {
    return fmtNbr(value, places, thousandsSeparator, decimalCharacter, '', '', '-', '');
}
function FormatCurrency(value, places) {
    if (typeof (places) == "undefined") places = 2;
    return fmtNbr(value, places, thousandsSeparator, decimalCharacter, currencyPrepend, currencyAppend, '-', '');
}
function formatAjaxError(request, status, thrown) {
    if (request != null) {
        if (request.responseText.length > 0) {
            return request.responseText;
        }
    }
    switch (status) {
        case 'timeout':
            //   return "The request timed out.";
            return translations.C316;
        case 'notmodified':
            // return "The request was not modified but was not retrieved from the cache.";
            return translations.C317;
        case 'parseerror':
            //  return "XML/Json format is bad.";
            return translations.C318;
        default:
            //  return "HTTP Error (" + request.status + " " + request.statusText + ").";
            return translations.C319 + "(" + request.status + " " + request.statusText + ").";
    }
}


/*      Misc. functions     */
function ToggleAllImportantDates() {
    var checkBoxes = $("input[type='checkbox'][name='exportEvent']");
    $("#noCalendarEventsSelected").hide();
    checkBoxes.prop("checked", !checkBoxes.prop("checked"));
    $("#toggleAllImportantDatesUnSelect").toggle();
    $("#toggleAllImportantDatesSelect").toggle();
}
function ExportCalendarEvents(ProjectNumber) {
    var checkBoxes = $("input[type='checkbox'][name='exportEvent']:checked");
    if (checkBoxes.length == 0) {
        $("#noCalendarEventsSelected").show();
    }
    else {
        $("#noCalendarEventsSelected").hide();
        var data = $(checkBoxes).serialize();

        // Build a form to post data through. Can not download files via ajax 
        // can not add a form in page renderer because the form would be nested
        // so we need to follow this hack
        $('<form action="/Show/CalendarExport" method="POST">' +
            '<input type="hidden" name="ProjectNumber" value="' + ProjectNumber + '">' +
            '<input type="hidden" name="CalendarEvents" value="' + data + '">' +
            '<input type="submit" value="Submit" id="testBTN" />' +
            '</form>').appendTo('body').submit();
    }
}
function GetTimeOfDayOffset(DateTime) {
    var dt = new Date(DateTime.getFullYear(), DateTime.getMonth(), DateTime.getDate(), 0, 0, 0, 0);
    return DateTime.getTime() - dt.getTime();
}

//Clones an element and takes care of copying over field types which do not clone dynmaically
function cloneElement(originalElement) {
    //first clone the elemnent
    var clonedElement = originalElement.clone();
    //text area fields do not clone well, select those from the orignal
    originalElement.find('textarea').each(function () {
        //find the same element in the cloned element and copy the orignal's value over
        if ($(this)[0].id != '') {
            var clonedVersion = clonedElement.find("#" + $(this)[0].id);
            if (clonedVersion.length > 0) {
                clonedVersion.val($(this).val());
            }
        }
    });
    return clonedElement;
}

/*      search.js      */
function CheckSettle() {
    var isEmpty = ($("#search").val() || '').length == 0;
    if (keyboard_settle != null) {
        clearTimeout(keyboard_settle);
    }
    $("#search").toggleClass("empty_search", isEmpty);
    keyboard_settle = isEmpty ? null : setTimeout("UpdateSearch($.trim($('#search').val()));", 500);
}
function ShowDropdown() {
    UpdateSearchPosition();
    $("#search_results_dropdown").show();
    $("#search").addClass("results_showing");
}
function UpdateSearch(search) {
    keyboard_settle = null;
    if (search == current_search) {
        if (!$("#search_results_dropdown").is(":visible")) {
            ShowDropdown();
        }
    } else {
        if (search_busy) {
            next_search = search;
        } else {
            next_search = "";
            PerformSearch($.trim(search));
        }
    }
}
function UpdateSearchPosition() {
    var box = $("#search-area");
    if (box.length) {
        $("#search_results_dropdown").css("top", box.offset().top + box.height() + 4).css("left", box.offset().left);
    }
}
function SearchSetPage(PageID) {
    $("#search_results_dropdown").hide();
    $("#search").removeClass("results_showing");
    SetPage(PageID);
}
function AttachmentSetPageID(AttachmentID) {
    $("#search_results_dropdown").hide();
    $("#search").removeClass("results_showing");
    document.location = '/' + projectCode + '/attachment/' + AttachmentID;
}
function AttachmentSetPageTag(Tag) {
    $("#search_results_dropdown").hide();
    $("#search").removeClass("results_showing");
    document.location = '/' + projectCode + '/attachment/' + Tag;
}

function PerformSearch(Criteria) {
    current_search = Criteria;
    if (current_search.length < 1) {
        $("#search").removeClass("searching results_showing").addClass("not_searching");
        $("#search_results_dropdown").hide();
        search_busy = false;
        return;
    }

    search_busy = true;
    $("#search").removeClass("not_searching").addClass("searching");

    $.ajax({
        url: "/Show/Search",
        dataType: 'html',
        type: 'post',
        data: {
            ProjectCode: projectCode,
            Criteria: Criteria
        },
        success: function (data) {
            if (next_search.length > 0) {
                var s = next_search;
                next_search = "";
                PerformSearch(s);
            } else {
                $("#search").removeClass("searching").addClass("not_searching");
                $("#search_results_dropdown_content").html(data);
                ShowDropdown();
                $("#search_results_dropdown").scrollTop(0);
                search_busy = false;
            }
        },
        error: function (request, status, thrown) {
            $("#search_results_dropdown").hide();
            $("#search").removeClass("searching").removeClass("results_showing").addClass("not_searching");
            search_busy = false;
            ShowMessageBox(request.responseText, translations.C17, null, 600, 400);
        }
    });
}

/*      country_helpers.js      */
function OnCountryUpdate() {
    var country = $("#CountryID").val();
    if (country != current_country) {
        current_country = country;
        $.ajax({
            url: "/Currency/CurrencyIDFromCountry",
            dataType: 'json',
            type: 'post',
            data: {
                CountryID: current_country
            },
            success: function (ID) {
                $("#CurrencyID").val(ID);
            },
            error: function (request, status, thrown) {
                ShowMessageBox(request.responseText, translations.C17);
            }
        });
    }
}
/*      Migrated from Manage.aspx       */
function UpdateContactSame() {
    var ok = $("#Information_ContactAddressSame").is(":checked");
    ok ? $("#contact_address").hide() : $("#contact_address").show();
}
function UpdateCompanyCountry() {
    if ($("#Information_CompanyCountry").val() == '2' || $("#Information_CompanyCountry").val() == '238')
        $("#Information_CompanyState").removeAttr("disabled");
    else
        $("#Information_CompanyState").attr("disabled", "disabled");
}
$(function () {
    //$("#Information_ContactEmail").filter(function () { return $(this).val().length > 0; }).attr("disabled", "disabled");
    $("#Information_ContactAddressSame").click(UpdateContactSame).change(UpdateContactSame);
    UpdateContactSame();
});
$(function () {
    $("#Information_CompanyCountry").click(UpdateCompanyCountry).change(UpdateCompanyCountry);
});


/*      culture.js      */
function SetCulture(newculture) {
    try {
        $.ajax({
            url: "/Account/SetCulture",
            dataType: 'json',
            type: 'get',
            data: {
                culture: newculture
            },
            success: function (data) {
                DisableScreen();
                location.reload(true);
            },
            error: function (request, status, thrown) {
                ShowMessageBox(request.responseText, translations.C374);
            }
        });
    } catch (e) {
        ShowMessageBox(request.responseText, translations.C375);
    }
}

function validateCreditCard(cardNumber, regUUID, typ) {

    // CHECK TO SEE IF cardNumber HAS CHANGES
    var savedNumber = creditCardNumberHash[regUUID + typ];
    cardNumber = cardNumber.replace(/\D/g, '');

    // Get credit card input box to add/remove validation - not working on form with the rest of the fields for some reason.
    var ccInputbox;
    var ccCardTypeName;
    var ccPlaceholderID;
    if (typ.length > 1) {
        ccInputbox = $("#thirdpartycardnumber_" + regUUID);
        ccCardTypeName = "thirdpartycompanycardtype_" + regUUID;
        ccPlaceholderID = "thirdpartycompanycardtype_ph_" + regUUID
    } else {
        ccInputbox = $("#cardnumber_" + regUUID);
        ccCardTypeName = "companycardtype_" + regUUID;
        ccPlaceholderID = "companycardtype_ph_" + regUUID
    }

    // NUMBER HAS NOT CHANGED, DONT VALIDATE
    if (savedNumber == cardNumber) {
        // Remove error class from input box
        if (ccInputbox) {
            ccInputbox.removeClass('error');
            ccInputbox.removeClass('required');
            ccInputbox.addClass('valid');
        }
        return true;
    }

    // NUMBER HAS CHANGED, VALIDATE
    var valid = false;
    try {
        $.ajax({
            url: "/api/creditcards/validate",
            dataType: 'html',
            type: 'get',
            async: false,
            data: {
                CardNumber: cardNumber,
                ProjectCode: projectCode,
                RegistrationUUID: regUUID,
                CompanyCardTypeName: ccCardTypeName
            },
            success: function (data) {
                // FIND THE PLACE HOLDER FOR THE CompanyCreditCardTypes
                var ph = $("#" + ccPlaceholderID);

                // AN HTML ELEMENT SHOULD BE RETURNED, ADD IT TO THE PLACE HOLDER
                if (data != "") {
                    // PASS THE HTML TO THE PLACEHOLDER
                    ph.html(data);
                    // SAVE THE CARD NUMBER TO THE HAS TABLE
                    creditCardNumberHash[regUUID + typ] = cardNumber;
                    //toastr.info(translations.C627);
                    // Track that the validation is true
                    valid = true;
                }
                else {
                    // CLEAR THE DIV
                    ph.html("");
                    //toastr.error(translations.C628);
                }
            },
            error: function (request, status, thrown) {
                //toastr.error(translations.C628);
                return false;
            }
        });
    }
    catch (e) {
        toastr.error(translations.C628);
        return false;
    }
    return valid;
}

/*      Extension functions        */
jQuery.fn.ExtendChange = function () {
    return this.each(function () {
        $(this).attr("oldvalue", $(this).val()).bind("keyup cut click paste blur", function () {
            var me = $(this);
            var v = $(this).val();
            if (v != me.attr("oldvalue")) {
                me.attr("oldvalue", v);
                $(this).change();
            }
        });
    });
}
Array.prototype.distinct = function (prop) {
    var arr = [];
    var added = [];
    $.map(this, function (e, i) {
        if (added.indexOf(e[prop]) == -1) {
            added.push(e[prop]);
            arr.push(e);
        }
    });
    return arr;
}
Array.prototype.findAll = function (field, value) {
    return $.grep(this, function (item) { return (item[field] != null) && item[field].toString().toUpperCase() == (value || "").toString().toUpperCase(); })
}
Array.prototype.findFirst = function (field, value) {
    return this.findAll(field, value)[0] || [];
}
Array.prototype.indexOf = function (obj) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] == obj) {
            return i;
        }
    }
    return -1;
}
$.prototype.distinct = function (prop) {
    return $.makeArray(this).distinct(prop);
}
$.prototype.findAll = function (field, value) {
    if (hasValue(this) && $.isArray(this)) {
        return $.makeArray(this).findAll(field, value);
    }
    return [];
}
$.prototype.findFirst = function (field, value) {
    return this.findAll(field, value)[0] || [];
}

function createHTMLElement(elementType, type, id, name, classname, innerHTML) {
    var element = null;
    if (elementType == 'input') {
        element = $('<' + elementType + '/>');
        if (innerHTML) {
            element.val(innerHTML);
        }
    }
    else {
        element = $('<' + elementType + '></' + elementType + '>');
        if (innerHTML) {
            $(element).html(innerHTML);
        }
    }

    if (type)
        element.attr('type', type);

    if (id)
        element.attr('id', id);

    if (name)
        element.attr('name', name);

    if (classname)
        element.addClass(classname);

    return element;
}

function appendBreaks(parent, numberOfBreaks, breakClass) {
    if (!breakClass)
        breakClass = ''
    for (var i = 0; i < numberOfBreaks; i++) {
        parent.append($("<br class='" + breakClass + "'>"));
    }
}

function appendElementLabel(parent, labelText, labelClass, inputId, inputElementType,
    inputType, inputClass, inputName, insertBreak, rightAlign) {
    var inputLabel = createHTMLElement('Label', null, null, null, null, labelText);
    inputLabel.attr('for', inputId);
    if (labelClass != null && labelClass != undefined) {
        inputLabel.addClass(labelClass);
    }

    var inputElement =
        createHTMLElement(inputElementType, inputType, inputId, inputName, inputClass);


    if (insertBreak == true) {
        var leftElement = inputLabel;
        var rightElement = inputElement;

        if (rightAlign === true) {
            leftElement = inputElement;
            rightElement = inputLabel;
        }
        parent.append(leftElement);
        parent.append(rightElement);
    } else {
        inputLabel.append(inputElement);
        parent.append(inputLabel);
    }
}


function resetField(e) {
    e.wrap('<form>').parent('form').trigger('reset');
    e.unwrap();
}

function isBrowserIE() {
    return typeof (document.documentMode) != 'undefined';
}

function Impersonate() {
    $("#ImpersonateDialog").modal({
        "backdrop": "static",
        "keyboard": true,
        "show": true
    }).on("shown", function () {
        $("#ImpersonateDialog input:first").focus();
    });
}

function modifyVatNumberUserInput(htmlElementID, e) {
    var vatNumber = $('#' + htmlElementID).val();
    // REMOVE THE NON ALPHA NUMERIC CHARACTERS
    $('#' + htmlElementID).val(vatNumber.replace(/[^a-zA-Z0-9]/g, ""));
}

function validateEmail(email) {
    var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return emailRegex.test(email);
}

function validateVatNumber(htmlElement) {
    // GET THE BILLING ADDRESS COUNTRY NUMBER EXPECTED FORMAT(billingaddress_addressCountryDivision_e2623f9b-8b34-448e-b3bc-ca75fa794530)
    var bIdArr = htmlElement.id.split('_');
    var boothID = bIdArr[bIdArr.length - 1];
    var countryElement = document.getElementById("billingaddress_countryid_" + boothID);
    var countryID = undefined;
    var vatNumber = htmlElement.value;

    if (!countryElement) {
        // NO COUNTRY ELEMENT FOUND, THROW ERROR
        return translations.C622;
    }
    else {
        // GET THE COUNTRY ID
        countryID = countryElement.value;

        // CHECK IF SELECTED COUNTRY IS A VALID GUID (pattern IS DEFINED IN expressoGlobal.js)
        if (!pattern.test(countryID)) {
            // INVALID GUID IN COUNTRY FIELD
            return translations.C623;
        }
    }

    var errorMessage = validateUserInputVatNumber(htmlElement);

    // USE AJAX TO CALL THE VAT CHECK SERVICE (WebAPI SERVICE)
    $.ajax({
        url: "/api/vat/checkvat",
        dataType: 'json',
        data: {
            CountryID: countryID,
            VatNumber: vatNumber
        },
        type: 'get',
        async: false,
        success: function (isValid) {
            if (isValid) {
                // VAT NUMBER WAS SUCCESSFULLY VALIDATED
                errorMessage = "";
            }
            else {
                // THE VAT NUMBER COULD NOT BE VALIDATED
                errorMessage = translations.C625;
            }
        },
        error: function (request, status, thrown) {
            // THERE WAS A PROBLEM CALLING THE CHECK VAT SERVICE
            errorMessage = translations.C625;
        }
    });

    return errorMessage;
}

function validateUserInputVatNumber(htmlElement) {
    // GET THE BILLING ADDRESS COUNTRY NUMBER EXPECTED FORMAT(billingaddress_addressCountryDivision_e2623f9b-8b34-448e-b3bc-ca75fa794530)
    var bIdArr = htmlElement.id.split('_');
    var boothID = bIdArr[bIdArr.length - 1];
    var countryElement = document.getElementById("billingaddress_countryid_" + boothID);
    var countryID = undefined;
    var vatNumber = htmlElement.value;

    // IF THERE IS NOTHING TO VALIDATE RETURN EMPTY STRING TO INDICATE NO ERROR FOUND
    if (vatNumber.length == 0)
        return "";

    // CHECK THE INPUT AGAINST THE REG EX DEFINED IN expressoGlobal.js
    if (!vatNumberUserInputRegEx.test(vatNumber)) {
        return translations.C635;
    }

    // GET THE BILLING ADDRESS COUNTRY ELEMENT
    var countryElement = document.getElementById("billingaddress_countryid_" + boothID);
    var countryID = undefined;

    // GET THE BILLING ADDRESS COUNTRY ID
    if (!countryElement) {
        // NO COUNTRY ELEMENT FOUND RETURN ERROR MESSAGE
        return translations.C622;
    }
    else {
        // GET THE COUNTRY ID
        countryID = countryElement.value;

        // CHECK IF SELECTED COUNTRY IS A VALID GUID (pattern IS DEFINED IN expressoGlobal.js)
        if (!pattern.test(countryID)) {
            // INVALID GUID IN COUNTRY FIELD
            return translations.C623;
        }
    }

    // NO ERRORS FOUND
    return "";
}


function validateAndCorrectLaborDate() {
    //Check to make sure the date being offered is a valid date according to the show schedule
    if (typeof (js_data.show_schedules) != "undefined") {
        var dateCheck = new Date($('.HiddenDatePicker')[1].value);
        var dateToCheck = "";
        if (dateCheck != "Invalid Date")
            dateToCheck = dateCheck.toLocaleDateString(culture);
        var schedulesToCheck = js_data.show_schedules
            .sort(function (a, b) {
                //sort by start date
                return JSONtoDate(b.StartDate) - JSONtoDate(a.StartDate);
            });

        if (schedulesToCheck.length > 0) {

            var validDate = false;
            //check the date for the item against the show schedule dates
            schedulesToCheck.forEach(function (element) {
                var start = new Date(formatUSDate(JSONtoDate(element.StartDate)));
                var startDate = start.toLocaleDateString(culture);
                var end = new Date(formatUSDate(JSONtoDate(element.EndDate)));
                var endDate = end.toLocaleDateString(culture);

                if (startDate <= dateToCheck && endDate >= dateToCheck) {
                    validDate = true;
                }
            });

            //if the date is invalid for the show, change it to a valid date
            if (!validDate) {
                var scheduleDate = new Date(formatUSDate(JSONtoDate(schedulesToCheck[0].StartDate)));
                $('#item_service_date').val(scheduleDate.toLocaleDateString(culture));
            }
        }
    }
}
function localizeDatePicker(datePickerCtrl) {
    datePickerCtrl.datepicker($.datepicker.regional[""]);
    datePickerCtrl.datepicker('option', $.datepicker.regional[culture]);
    validDateFormat = datePickerCtrl.datepicker('option', 'dateFormat')

    //Make an alternate field following the jquery documentation where we will always store the us date format server side
    var dateSelectorUS = $("<input id='" + datePickerCtrl.attr('id') + "_altFormat' class='HiddenDatePicker' type='hidden'>");
    datePickerCtrl.parent().append(dateSelectorUS);

    //Make the datepicker store US dates using the AltField/AltFormat combo
    datePickerCtrl.datepicker('option', 'altField', dateSelectorUS);
    datePickerCtrl.datepicker('option', 'altFormat', 'mm/dd/yy');

    if (typeof AddAlternateDatePickerValidation !== 'undefined' && $.isFunction(AddAlternateDatePickerValidation)) {
        AddAlternateDatePickerValidation(validDateFormat);
    }
}

var globalSpinner = null;
function showSpinner(onOff) {
    if (onOff) {
        if (globalSpinner == null) {
            var options = {
                lines: 13, // The number of lines to draw
                length: 20, // The length of each line
                width: 10, // The line thickness
                radius: 30, // The radius of the inner circle
                corners: 1, // Corner roundness (0..1)
                rotate: 0, // The rotation offset
                direction: 1, // 1: clockwise, -1: counterclockwise
                color: '#000', // #rgb or #rrggbb or array of colors
                speed: 1, // Rounds per second
                trail: 60, // Afterglow percentage
                shadow: false, // Whether to render a shadow
                hwaccel: false, // Whether to use hardware acceleration
                className: 'spinner', // The CSS class to assign to the spinner
                zIndex: 2e9, // The z-index (defaults to 2000000000)
                top: '50%', // Top position relative to parent
                left: '50%' // Left position relative to parent
            };
            globalSpinner = new Spinner(options);
        }
        globalSpinner.spin(document.getElementById('BusySpinner'));
        $('#BusySpinner').show();
    } else if (globalSpinner != null) {
        globalSpinner.stop();
        $('#BusySpinner').hide();
    }
}

// following function searches for an input with the word "postal" in an effort to validate any postal code input from a user. Remove special characters.
$(function () {
    $('*[id*=postal]').each(function () {
        $(this).keyup(function () {
            var postalInput = $(this).val();
            re = /[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/gi;
            var isSplChar = re.test(postalInput);
            if (isSplChar) {
                var no_spl_char = postalInput.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/gi, '');
                $(this).val(no_spl_char);
            }
        });
    });
});

// Only allow numeric and decimal values. Used for booth width/length
ko.bindingHandlers.numeric = {
    init: function (element, valueAccessor) {
        $(element).on("keydown", function (event) {
            // Allow: backspace, delete, tab, escape, and enter
            if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
                // Allow: Ctrl+A
                (event.keyCode == 65 && event.ctrlKey === true) ||
                // Allow: . ,
                (event.keyCode == 188 || event.keyCode == 190 || event.keyCode == 110) ||
                // Allow: home, end, left, right
                (event.keyCode >= 35 && event.keyCode <= 39)) {
                // let it happen, don't do anything
                return;
            }
            else {
                // Ensure that it is a number and stop the keypress
                if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    event.preventDefault();
                }
            }
        });
    }
};
;
var show_timeout = null;
var do_timeout = null;
var reload_on_logoff = true;
var currentItemCode = "";

var SFDC_ID_LOGISTICS = "573400000004CLg";
var chatIsOnlineLogistics = false;

function ResetSessionTimeout() {
    if (show_timeout != null) {
        clearTimeout(show_timeout);
    }
    if (session_timeout > 0) {
        show_timeout = setTimeout("DisplayTimeoutWarning()", session_timeout);
    }
}

function InitializeNavigation() {
    $("#aside-nav .dropdown-submenu")
    .hover(function () {
        $(this).children(".dropdown-menu:first").stop(true, true).hide().delay(300).fadeIn(500);
        }, function () {
            $(this).children(".dropdown-menu:first").delay(500).stop(true, true).fadeOut(500);
        })
    .click(function () {
        $(this).children(".dropdown-menu:first").stop(true, true).show();
    });
}

function Logon() {
    document.location = '/Logon';
}

function Logoff() {
    document.location = '/Logoff';
}

function StartChat(PageName, Location, chatID) {
    chatID = chatID || ChatId();
    if (typeof (PageName) == "undefined") PageName = null;
    if (typeof (Location) == "undefined") Location = null;
    try {
        liveagent.startChat(chatID);
    } catch (e) {
        ShowMessageBox("Chat is unavailable at this time. Please try again later.", "Unable to Launch Chat");
    }
}

function StartLogisticsChat(PageName, Location) {
    StartChat(PageName, Location, SFDC_ID_LOGISTICS);
}

function ChatId() {
    var userDefinedButtonId = $('.salesforce-chat').data("chatid");
    return userDefinedButtonId;
}



function Download(filename) {
    $("#Filename").val(filename);
    $("#OrderUUID").val(orderUUID);
    $("#DownloadForm")[0].submit();
}

function UpdateActiveOrder(OrderUUID, Category) {
    if (typeof (Category) == "undefined") Category = null;
    var url = "/Show/Order/" + OrderUUID;
    window.open(url, '_self', false);
}

function CreateAnotherOrder(OrderUUID, Category) {
    if (typeof (Category) == "undefined") Category = null;
    var url = "/Show/CreateOrder/" + OrderUUID;
    window.open(url, '_self', false);
}

function ManageMyShows(EventName) {
    if (typeof (EventName) == "undefined") EventName = null;
    var url = "/Dashboard";
    window.open(url, '_self', false);
}

function ManageMyAccount(EventName) {
    if (typeof (EventName) == "undefined") EventName = null;
    var url = "/Manage";
    window.open(url, '_self', false);
}

function FindAnotherShow(EventName, Category) {
    if (typeof (EventName) == "undefined") EventName = null;
    if (typeof (Category) == "undefined") Category = null;
    var url = "/Show/Find";
    window.open(url, '_self', false);
}

function RequestResetPassword(EventName, Category) {
    if (typeof (EventName) == "undefined") EventName = null;
    if (typeof (Category) == "undefined") Category = null;
    var url = "/RequestResetPassword";
    window.open(url, '_self', false);
}

function SetPageWelcome(EventName, Category, Location, VarPage) {
    if (typeof (EventName) == "undefined") EventName = null;
    if (typeof (Category) == "undefined") Category = null;
    if (typeof (Location) == "undefined") Location = null;
    SetPage(VarPage);
}

function ReturnToOrdering(OrderUUID) {
    var url = "/Show/Order/" + OrderUUID;
    window.open(url, '_self', false);
}

function TrackSmallPackages() {
    var url = "http://ges.com/spr/index.aspx";
    window.open(url);
}

function TrackShipments() {
    var url = "https://applications.ges.com/PackageStatus/Main/MainPage.aspx";
    window.open(url);
}

function WelcomeClaims() {
    var url = "http://ges.com/Libraries/Docs/Legal_-_How_to_File_a_Claim.sflb.ashx";
    window.open(url, 'Download');
}

function DownloadCalendar(ProjectCode, Category, Location) {
    if (typeof (Category) == "undefined") Category = null;
    if (typeof (Location) == "undefined") Location = null;
    var url = "/Show/Calendar/" + ProjectCode;
    window.open(url, 'Download');
}

function ShowLogisticsTracking(EventName) {
    if (typeof (EventName) == "undefined") EventName = null;
    var url = "http://ges.com/Home/Resources/TrackShipments.aspx";
    window.open(url);
}

function SignUpForShow(Category, Location) {
    if (typeof (Category) == "undefined") Category = null;
    if (typeof (Location) == "undefined") Location = null;
    SignUp();
}

var ordering_expired = true;

$(document).ready(function () {
    var cookieEnabled = (navigator.cookieEnabled) ? true : false
    if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
        document.cookie = "testcookie"
        cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false
    }

    if (!cookieEnabled) {
        $("#barfing-browser").html("<div class='container'><div class='header'><h4>Cookies are required</h4></div><div class='icon_important'></div><div class='contents'>Your current browser settings indicate that cookies are disabled. Cookies are required to properly access our site.</div><div class='contents' style='margin-left: 42px;'><br />How do I allow cookies on my browser?</div><div class='link'><a href='http://www.timeanddate.com/custom/cookiesie.html' target='_blank'>Internet Explorer</a></div><div class='link'><a href='http://www.timeanddate.com/custom/cookiesmozilla.html' target='_blank'>Firefox</a></div><div class='link'><a href='http://www.timeanddate.com/custom/cookieschrome.html' target='_blank'>Chrome</a></div><div class='link'><a href='http://www.timeanddate.com/custom/cookiessafari.html' target='_blank'>Safari</a></div></div>");
    } else {
        $("#content-area").removeClass("hide_content");
        $("#barfing-browser").remove();
    }

    BannerForMessageToUser();
    
    // CheckSize();
    $(".date").datepicker();
    $("input:visible:enabled:first").focus();

    $('.keyword').cluetip({
        width: '200px',
        cluezIndex: 300,
        showTitle: false,
        fx: {
            open: 'fadeIn'
        }
    });

    $('.keywordNotes').cluetip({
        width: '200px',
        cluezIndex: 300,
        ajaxCache: false,
        showTitle: false,
        splitTitle: '|',
        fx: {
            open: 'fadeIn'
        }
    });

    $('a.question').cluetip({
        width: '200px',
        cluezIndex: 300,
        showTitle: false,
        fx: {
            open: 'fadeIn'
        }
    });

    ResetSessionTimeout();

    // Bootstrap initialization
    $(".popover-right").popover({ placement: 'right', trigger: 'hover', html: true });
    $(".popover-left").popover({ placement: 'left', trigger: 'hover', html: true });
    $(".popover-top").popover({ placement: 'top', trigger: 'hover', html: true });
    $(".popover-bottom").popover({ placement: 'bottom', trigger: 'hover', html: true });
    $(".tooltip-right").tooltip({ placement: 'right', html: true });
    $(".tooltip-left").tooltip({ placement: 'left', html: true });
    $(".tooltip-top").tooltip({ placement: 'top', html: true });
    $(".tooltip-bottom").tooltip({ placement: 'bottom', html: true });

    $("#footer").mouseup(function (e) {
        if (e.ctrlKey && e.shiftKey && (e.which & 2 == 2)) {
            e.preventDefault();
            // Call the angular service that displays diagnostic information
            angular.injector(['ng', 'app']).get("ExpressoHackService").showDiagnosticInfo();
            return false;
        }
    }).bind('contextmenu', function (e) {
        // Kill the context menu
        return false;
    });

    $.each($(".GES-accordion"), function () {
        $acc = $(this);
        $acc.find(".panel-heading").click(function (e, ui) {
            var t = $(this).data("target");
            var target = $(t);
            var v = target.hasClass("in");
            if (v) {
                target.removeClass("in");
                $(this).addClass("collapsed");
            } else {
                $.each($(".panel-body:not('" + t + "')"), function () {
                    $(this).removeClass("in");
                    $acc.find("[data-target='#" + $(this).attr("id") + "']").addClass("collapsed");
                });
                target.addClass("in");
                $(this).removeClass("collapsed");
            }
        });
    });
    
    $("*[data-ajax-content-url]").each(function () {
        LoadBootstrapAjaxContent($(this));
    });

    InitializeChat();
    InitializeNavigation();

    if (typeof (PageLoaded) == "function") {
        PageLoaded();
    }
});

function BannerForMessageToUser() {
    $.ajax({
        url: "/Show/GetBannerMessage",
        success: function(returnBannerMsg) {
            if (returnBannerMsg.length > 0) {
                $('.topsection').append($("<div id='browserBanner' style='color: black'>  " + returnBannerMsg + "</div><div id='BannerCloseButton' <span id='close' onclick='CloseBanner();'></span></div>"));
                $("#wrapper").prepend($("#browserBanner"));
            }
        }
    });
}

function CloseBanner() {
    $('#browserBanner').remove();
    $('#BannerCloseButton').remove();
    //we call server side to set cookie since this way of dealing with cookies works in all browsers.
    $.ajax({
        url: "/Show/CloseBannerMessage",
    });
}

// The Bootstrap plugins do not implement ajax content.
// This method uses the custom 'data-ajax-content-url' attribute to populate content via ajax.
function LoadBootstrapAjaxContent(ctrl, url) {
    url = url || ctrl.attr("data-ajax-content-url");
    if (url) {
        $.get(url)
            .success(function (results) {
                ctrl.attr("data-ajax-content-url", url);
                ctrl.attr("data-content", results);
            })
            .error(function () {
                ctrl.data("popover" || "tooltip").destroy();
            });
    }
    return ctrl;
}

function AllFAQs() {
    $.ajax({
        url: '/Question/All',
        dataType: 'html',
        type: 'get',
        success: function (data) {

            ShowDialogBox(
                data,
                translations.C426,
                [{
                    Label: translations.C428,
                    OnClick: function () {
                        if (typeof onOk == "function") onOk();
                    }
                }]);
        },
        error: function (request, status, thrown) {
            ShowMessageBox(request.responseText, "Error Retrieving FAQs", null, 600, 400);
        }
    });
}

function DisplayTimeoutWarning() {
    clearTimeout(show_timeout);
    show_timeout = null;

    if (do_timeout != null) clearTimeout(do_timeout);

    var projectNumber = null;
    if (typeof projectCode !== 'undefined') {
        projectNumber = projectCode;
    }

    //redirect to show, if user is in show instance
    var redirectURL = "document.location = '/Logoff?projectCode=" + projectNumber + "'";
    do_timeout = setTimeout(redirectURL, 30000);

    // Bootstrap modals do not overlay nicely, so close any existing
    $(".modal").modal("hide");

    ShowConfirmBox(translations.C569,
		translations.C570,
		function () {
		    clearTimeout(do_timeout);
		    do_timeout = null;
		    $.ajax({
		        url: "/GetSessionID",
		        success: function (data) {
		            ResetSessionTimeout();
		        }
		    });
		},
		function () {
		    document.location = '/Logoff';
		}
	);
};
//Attach events when ready
$(document).ready(function () {
    WirePreviousOrderEvents();
});

//Attaches all the events of a previous order
function WirePreviousOrderEvents() {
    //only run if on correct page = previously_ordered_items
    if ($('.previousShowDiv').length > 0) {
        AttachDropdown();
        AttachAddPreviousItemToCart();
    }
};

//Attach dropdownlist event to filter shows to display
function AttachDropdown() {
    $('#showddl').change(function () {
        if ($(this).val()) {
            $('.previousShowDiv').hide();
            $('#previousShow_' + $(this).val()).show();
        } else {
            $('.previousShowDiv').show();
        }
    });
};

function AttachAddPreviousItemToCart() {
    $(".addPreviousItemToCart").bind('click', function () {
        try {
            ShowWaitDialog(translations.C439);
            var parent = $(this).parents("tr");
            var poUUID = parent.children("td.poiOrderItemUUID").attr('id').replace('orderItemUUId_', '');
            var itemCodeVal = parent.children("td.poiCodeVal").text();
            var pathName = $(location).attr('pathname');
            var pathNameArr = pathName.split('/');
            var projectCode = pathNameArr[1];
            document.location = "/" + projectCode + "/Item/" + itemCodeVal + "/" + poUUID + "?POI=true";
        } catch (e) {
            HideWaitDialog();
            ShowMessageBox(e.message ? e.message : e, translations.C132);
        }
    });
};;
(function(n){n(["jquery"],function(n){return function(){function l(n,t,f){return u({type:r.error,iconClass:i().iconClasses.error,message:n,optionsOverride:f,title:t})}function a(n,t,f){return u({type:r.info,iconClass:i().iconClasses.info,message:n,optionsOverride:f,title:t})}function v(n){e=n}function y(n,t,f){return u({type:r.success,iconClass:i().iconClasses.success,message:n,optionsOverride:f,title:t})}function p(n,t,f){return u({type:r.warning,iconClass:i().iconClasses.warning,message:n,optionsOverride:f,title:t})}function w(r){var u=i();if(t||f(u),r&&n(":focus",r).length===0){r[u.hideMethod]({duration:u.hideDuration,easing:u.hideEasing,complete:function(){c(r)}});return}t.children().length&&t[u.hideMethod]({duration:u.hideDuration,easing:u.hideEasing,complete:function(){t.remove()}})}function b(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:undefined,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:undefined,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"<button>&times;<\/button>",newestOnTop:!0}}function h(n){e&&e(n)}function u(r){function l(t){if(!n(":focus",e).length||t)return e[u.hideMethod]({duration:u.hideDuration,easing:u.hideEasing,complete:function(){c(e),u.onHidden&&u.onHidden(),s.state="hidden",s.endTime=new Date,h(s)}})}function b(){(u.timeOut>0||u.extendedTimeOut>0)&&(y=setTimeout(l,u.extendedTimeOut))}function k(){clearTimeout(y),e.stop(!0,!0)[u.showMethod]({duration:u.showDuration,easing:u.showEasing})}var u=i(),v=r.iconClass||u.iconClass;typeof r.optionsOverride!="undefined"&&(u=n.extend(u,r.optionsOverride),v=r.optionsOverride.iconClass||v),o++,t=f(u);var y=null,e=n("<div/>"),p=n("<div/>"),w=n("<div/>"),a=n(u.closeHtml),s={toastId:o,state:"visible",startTime:new Date,options:u,map:r};return r.iconClass&&e.addClass(u.toastClass).addClass(v),r.title&&(p.append(r.title).addClass(u.titleClass),e.append(p)),r.message&&(w.append(r.message).addClass(u.messageClass),e.append(w)),u.closeButton&&(a.addClass("toast-close-button"),e.prepend(a)),e.hide(),u.newestOnTop?t.prepend(e):t.append(e),e[u.showMethod]({duration:u.showDuration,easing:u.showEasing,complete:u.onShown}),u.timeOut>0&&(y=setTimeout(l,u.timeOut)),e.hover(k,b),!u.onclick&&u.tapToDismiss&&e.click(l),u.closeButton&&a&&a.click(function(n){n.stopPropagation(),l(!0)}),u.onclick&&e.click(function(){u.onclick(),l()}),h(s),u.debug&&console&&console.log(s),e}function f(r){return(r||(r=i()),t=n("#"+r.containerId),t.length)?t:(t=n("<div/>").attr("id",r.containerId).addClass(r.positionClass),t.appendTo(n(r.target)),t)}function i(){return n.extend({},b(),s.options)}function c(n){(t||(t=f()),n.is(":visible"))||(n.remove(),n=null,t.children().length===0&&t.remove())}var t,e,o=0,r={error:"error",info:"info",success:"success",warning:"warning"},s={clear:w,error:l,getContainer:f,info:a,options:{},subscribe:v,success:y,version:"2.0.1",warning:p};return s}()})})(typeof define=="function"&&define.amd?define:function(n,t){typeof module!="undefined"&&module.exports?module.exports=t(require(n[0])):window.toastr=t(window.jQuery)});
//@ sourceMappingURL=toastr.min.js.map;
var culturesService = (function () {
    function getActiveLanguage(callback) {
        $.ajax({
            url: "/api/cultures/getactivelanguage",
            dataType: 'json',
            type: 'get',
            cache: false,
            success: function (data) {
                callback(data);
            },
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });

    }

    function getActiveCulture(callback) {
        $.ajax({
            url: "/api/cultures/getActiveCulture",
            dataType: 'json',
            type: 'get',
            cache: false,
            success: function (data) {
                callback(data);
            },
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });

    }

    function getActiveCultureDateTimeFormat(callback) {
        $.ajax({
            url: "/api/cultures/GetActiveCultureDateTimeFormat",
            dataType: 'json',
            type: 'get',
            cache: false,
            success: function (data) {
                callback(data);
            },
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });

    }

    function getShowInstanceDateFormat(showInstanceId, callback) {
        $.ajax({
            url: "/api/cultures/getShowInstanceDateFormat",
            dataType: 'json',
            data: {
                showInstanceId: showInstanceId
            },
            type: 'get',
            cache: false,
            success: function (data) {
                callback(data);
            },
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });

    }

    return {
        getActiveLanguage: getActiveLanguage,
        getActiveCulture: getActiveCulture,
        getShowInstanceDateFormat: getShowInstanceDateFormat,
        getActiveCultureDateTimeFormat: getActiveCultureDateTimeFormat
    };
})();
;
var userInformationService = (function () {
    function getCurrentUser(callback) {
        var pathName = $(location).attr('pathname');
        var pathNameArr = pathName.split('/');
        var projectCode = pathNameArr[1];

        $.ajax({
            url: "/api/userinformation/GetCurrentUser",
            dataType: 'json',
            type: 'get',
            cache: false,
            success: callback,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        });
    }

    return {
        getCurrentUser: getCurrentUser
    };
})();
;
var countrySelector = function () {
    function Ready() {
        $(".countrySelector").selectToAutocomplete();
        $('.countrySelector').change(function () {
            initCountryDivisions($(this).attr("countryDivisionTargetID"), $(this).val());
        });

        initCountryDivisions1();
    };
    return {
        ready: Ready
    };
}();

function initCountryDivisions1() {
    $(".countrySelector").each(function (index) {
        var targetID = $(this).attr("countryDivisionTargetID");
        initCountryDivisions(targetID, $(this).val());
    });
}

function initCountryDivisions(targetDivID, countryID) {
    // CHECK IF SELECTED COUNTRY IS A VALID GUID (pattern IS DEFINED IN expressoGlobal.js)
    if (pattern.test(countryID)) {
        $.when(loadCountryDivisionLabel(targetDivID, countryID), loadCountryDivisions(targetDivID, countryID)).then(function (resp1, resp2) {
            // THIS CALLBACK WILL FIRE ONCE ALL AJAX CALLS HAVE FINISHED.
            $('#' + targetDivID).show();
        });
    }
}

function loadCountryDivisions(targetDivID, countryID) {
    
    var countryDivSelector = $("#" + targetDivID).find('.countryDivisionSelector');
    // GET PARENT BEFORE WE CLEAR THE countryDivSelector
    var parent = countryDivSelector.parent();

    // GET THE ID OF THE ELEMENT, NEED TO ADD IT BACK WHEN WE APPEND THE select INPUT
    var id = countryDivSelector.attr("id");
    var name = countryDivSelector.attr("name");
    var classes = countryDivSelector.attr("class");
    var onChange = countryDivSelector.attr("onchange");
    var value = countryDivSelector.val();
    var selected = false;

    // CLEAR CURRENT OPTIONS (NEED TO REMOVE TO MAKE SURE AUTO COMPLETE ELEMENTS ARE CLEAR TOO)
    countryDivSelector.remove();

    // ADD SELECT SO WE HAVE A PLACE TO APPEND THE CountryDivisions (ADD ID TO HELP WITH MODEL BINDING)
    parent.append('<select id=' + id + ' autocomplete="off" autocorrect="off" class="' + classes + '" name="' + name + '" onchange="' + onChange + '"></select>');
    // GET countryDivSelector SINCE THE ORIGINAL ONE IS GONE
    countryDivSelector = $('#' + id);

    // GET THE CountryDivision VALUES
    $.getJSON("/api/countrydivisions", { CountryID: countryID }, function (data) {       
        $.each(data, function (i, obj) {
            countryDivSelector
                .append($('<option></option>')
                .attr( { "value": obj.Code, "data-alternative-spellings": obj.AlternativeSpellings } )
                .text(obj.Name));

            if (obj.Code == value) {
                countryDivSelector.val(value).prop('selected', true);               
                countryDivSelector.attr({ "data-alternative-spellings": obj.AlternativeSpellings });
                selected = true;
            }
        });

        parent.show();

        // SELECT THE FIRST OPTION IF ONE HAS NOT ALREADY BEEN IDENTIFIED
        if (!selected) {
            // SELECT THE FIRST OPTION
            countryDivSelector.find('option:first-child').attr("selected", "selected");
        }

        // MAKE THE DROP DOWN AN AutoComplete CONTROL        
        countryDivSelector.selectToAutocomplete();
    });
}

function loadCountryDivisionLabel(targetDivID, countryID) {
    // GET THE CountryDivision VALUES
    $.getJSON("/api/countries", { ID: countryID }, function (data) {
        if (data.CountryDivisionLabel == null) {
            data.CountryDivisionLabel = "State/Province";
        }
        $("#" + targetDivID).find('.countryDivisionSelectorLabel').text(data.CountryDivisionLabel);
    });
};
/*!
 * Bootstrap v3.4.1 (https://getbootstrap.com/)
 * Copyright 2011-2019 Twitter, Inc.
 * Licensed under the MIT license
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);;
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */

!function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});;
var calculateCartTotals = (function() {

    expressoEvent.subscribe("userIdentification.UserLoggedIn", function () {    
        $.ajax({
            url: "/api/orders/RecalcUserShoppingCarts",
            dataType: 'json',
            type: 'get',
            cache: false,
            error: function (request, status, thrown) {
                console.log(thrown);
            }
        })
      .done();

    })
})();
/* interact.js v1.3.4 | https://raw.github.com/taye/interact.js/master/LICENSE */
!function (t) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else { var e; e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.interact = t() } }(function () {
    return function t(e, n, r) { function i(s, a) { if (!n[s]) { if (!e[s]) { var c = "function" == typeof require && require; if (!a && c) return c(s, !0); if (o) return o(s, !0); var l = new Error("Cannot find module '" + s + "'"); throw l.code = "MODULE_NOT_FOUND", l } var p = n[s] = { exports: {} }; e[s][0].call(p.exports, function (t) { var n = e[s][1][t]; return i(n || t) }, p, p.exports, t, e, n, r) } return n[s].exports } for (var o = "function" == typeof require && require, s = 0; s < r.length; s++)i(r[s]); return i }({
        1: [function (t, e, n) { "use strict"; "undefined" == typeof window ? e.exports = function (e) { return t("./src/utils/window").init(e), t("./src/index") } : e.exports = t("./src/index") }, { "./src/index": 19, "./src/utils/window": 52 }], 2: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } function i(t, e) { for (var n = 0; n < e.length; n++) { var r; r = e[n]; var i = r; if (t.immediatePropagationStopped) break; i(t) } } var o = t("./utils/extend.js"), s = function () { function t(e) { r(this, t), this.options = o({}, e || {}) } return t.prototype.fire = function (t) { var e = void 0, n = "on" + t.type, r = this.global; (e = this[t.type]) && i(t, e), this[n] && this[n](t), !t.propagationStopped && r && (e = r[t.type]) && i(t, e) }, t.prototype.on = function (t, e) { this[t] ? this[t].push(e) : this[t] = [e] }, t.prototype.off = function (t, e) { var n = this[t], r = n ? n.indexOf(e) : -1; -1 !== r && n.splice(r, 1), (n && 0 === n.length || !e) && (this[t] = void 0) }, t }(); e.exports = s }, { "./utils/extend.js": 41 }], 3: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var i = t("./utils/extend"), o = t("./utils/getOriginXY"), s = t("./defaultOptions"), a = t("./utils/Signals").new(), c = function () { function t(e, n, c, l, p, u) { var d = arguments.length > 6 && void 0 !== arguments[6] && arguments[6]; r(this, t); var f = e.target, v = (f && f.options || s).deltaSource, g = o(f, p, c), h = "start" === l, m = "end" === l, y = h ? e.startCoords : e.curCoords, x = e.prevEvent; p = p || e.element; var b = i({}, y.page), w = i({}, y.client); b.x -= g.x, b.y -= g.y, w.x -= g.x, w.y -= g.y, this.ctrlKey = n.ctrlKey, this.altKey = n.altKey, this.shiftKey = n.shiftKey, this.metaKey = n.metaKey, this.button = n.button, this.buttons = n.buttons, this.target = p, this.currentTarget = p, this.relatedTarget = u || null, this.preEnd = d, this.type = c + (l || ""), this.interaction = e, this.interactable = f, this.t0 = h ? e.downTimes[e.downTimes.length - 1] : x.t0; var E = { interaction: e, event: n, action: c, phase: l, element: p, related: u, page: b, client: w, coords: y, starting: h, ending: m, deltaSource: v, iEvent: this }; a.fire("set-xy", E), m ? (this.pageX = x.pageX, this.pageY = x.pageY, this.clientX = x.clientX, this.clientY = x.clientY) : (this.pageX = b.x, this.pageY = b.y, this.clientX = w.x, this.clientY = w.y), this.x0 = e.startCoords.page.x - g.x, this.y0 = e.startCoords.page.y - g.y, this.clientX0 = e.startCoords.client.x - g.x, this.clientY0 = e.startCoords.client.y - g.y, a.fire("set-delta", E), this.timeStamp = y.timeStamp, this.dt = e.pointerDelta.timeStamp, this.duration = this.timeStamp - this.t0, this.speed = e.pointerDelta[v].speed, this.velocityX = e.pointerDelta[v].vx, this.velocityY = e.pointerDelta[v].vy, this.swipe = m || "inertiastart" === l ? this.getSwipe() : null, a.fire("new", E) } return t.prototype.getSwipe = function () { var t = this.interaction; if (t.prevEvent.speed < 600 || this.timeStamp - t.prevEvent.timeStamp > 150) return null; var e = 180 * Math.atan2(t.prevEvent.velocityY, t.prevEvent.velocityX) / Math.PI; e < 0 && (e += 360); var n = 112.5 <= e && e < 247.5, r = 202.5 <= e && e < 337.5, i = !n && (292.5 <= e || e < 67.5); return { up: r, down: !r && 22.5 <= e && e < 157.5, left: n, right: i, angle: e, speed: t.prevEvent.speed, velocity: { x: t.prevEvent.velocityX, y: t.prevEvent.velocityY } } }, t.prototype.preventDefault = function () { }, t.prototype.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }, t.prototype.stopPropagation = function () { this.propagationStopped = !0 }, t }(); a.on("set-delta", function (t) { var e = t.iEvent, n = t.interaction, r = t.starting, i = t.deltaSource, o = r ? e : n.prevEvent; "client" === i ? (e.dx = e.clientX - o.clientX, e.dy = e.clientY - o.clientY) : (e.dx = e.pageX - o.pageX, e.dy = e.pageY - o.pageY) }), c.signals = a, e.exports = c }, { "./defaultOptions": 18, "./utils/Signals": 34, "./utils/extend": 41, "./utils/getOriginXY": 42 }], 4: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var i = t("./utils/clone"), o = t("./utils/is"), s = t("./utils/events"), a = t("./utils/extend"), c = t("./actions/base"), l = t("./scope"), p = t("./Eventable"), u = t("./defaultOptions"), d = t("./utils/Signals").new(), f = t("./utils/domUtils"), v = f.getElementRect, g = f.nodeContains, h = f.trySelector, m = f.matchesSelector, y = t("./utils/window"), x = y.getWindow, b = t("./utils/arr"), w = b.contains, E = t("./utils/browser"), T = E.wheelEvent; l.interactables = []; var S = function () { function t(e, n) { r(this, t), n = n || {}, this.target = e, this.events = new p, this._context = n.context || l.document, this._win = x(h(e) ? this._context : e), this._doc = this._win.document, d.fire("new", { target: e, options: n, interactable: this, win: this._win }), l.addDocument(this._doc, this._win), l.interactables.push(this), this.set(n) } return t.prototype.setOnEvents = function (t, e) { var n = "on" + t; return o.function(e.onstart) && (this.events[n + "start"] = e.onstart), o.function(e.onmove) && (this.events[n + "move"] = e.onmove), o.function(e.onend) && (this.events[n + "end"] = e.onend), o.function(e.oninertiastart) && (this.events[n + "inertiastart"] = e.oninertiastart), this }, t.prototype.setPerAction = function (t, e) { for (var n in e) n in u[t] && (o.object(e[n]) ? (this.options[t][n] = i(this.options[t][n] || {}), a(this.options[t][n], e[n]), o.object(u.perAction[n]) && "enabled" in u.perAction[n] && (this.options[t][n].enabled = !1 !== e[n].enabled)) : o.bool(e[n]) && o.object(u.perAction[n]) ? this.options[t][n].enabled = e[n] : void 0 !== e[n] && (this.options[t][n] = e[n])) }, t.prototype.getRect = function (t) { return t = t || this.target, o.string(this.target) && !o.element(t) && (t = this._context.querySelector(this.target)), v(t) }, t.prototype.rectChecker = function (t) { return o.function(t) ? (this.getRect = t, this) : null === t ? (delete this.options.getRect, this) : this.getRect }, t.prototype._backCompatOption = function (t, e) { if (h(e) || o.object(e)) { this.options[t] = e; for (var n = 0; n < c.names.length; n++) { var r; r = c.names[n]; var i = r; this.options[i][t] = e } return this } return this.options[t] }, t.prototype.origin = function (t) { return this._backCompatOption("origin", t) }, t.prototype.deltaSource = function (t) { return "page" === t || "client" === t ? (this.options.deltaSource = t, this) : this.options.deltaSource }, t.prototype.context = function () { return this._context }, t.prototype.inContext = function (t) { return this._context === t.ownerDocument || g(this._context, t) }, t.prototype.fire = function (t) { return this.events.fire(t), this }, t.prototype._onOffMultiple = function (t, e, n, r) { if (o.string(e) && -1 !== e.search(" ") && (e = e.trim().split(/ +/)), o.array(e)) { for (var i = 0; i < e.length; i++) { var s; s = e[i]; var a = s; this[t](a, n, r) } return !0 } if (o.object(e)) { for (var c in e) this[t](c, e[c], n); return !0 } }, t.prototype.on = function (e, n, r) { return this._onOffMultiple("on", e, n, r) ? this : ("wheel" === e && (e = T), w(t.eventTypes, e) ? this.events.on(e, n) : o.string(this.target) ? s.addDelegate(this.target, this._context, e, n, r) : s.add(this.target, e, n, r), this) }, t.prototype.off = function (e, n, r) { return this._onOffMultiple("off", e, n, r) ? this : ("wheel" === e && (e = T), w(t.eventTypes, e) ? this.events.off(e, n) : o.string(this.target) ? s.removeDelegate(this.target, this._context, e, n, r) : s.remove(this.target, e, n, r), this) }, t.prototype.set = function (e) { o.object(e) || (e = {}), this.options = i(u.base); var n = i(u.perAction); for (var r in c.methodDict) { var s = c.methodDict[r]; this.options[r] = i(u[r]), this.setPerAction(r, n), this[s](e[r]) } for (var a = 0; a < t.settingsMethods.length; a++) { var l; l = t.settingsMethods[a]; var p = l; this.options[p] = u.base[p], p in e && this[p](e[p]) } return d.fire("set", { options: e, interactable: this }), this }, t.prototype.unset = function () { if (s.remove(this.target, "all"), o.string(this.target)) for (var t in s.delegatedEvents) { var e = s.delegatedEvents[t]; e.selectors[0] === this.target && e.contexts[0] === this._context && (e.selectors.splice(0, 1), e.contexts.splice(0, 1), e.listeners.splice(0, 1), e.selectors.length || (e[t] = null)), s.remove(this._context, t, s.delegateListener), s.remove(this._context, t, s.delegateUseCapture, !0) } else s.remove(this, "all"); d.fire("unset", { interactable: this }), l.interactables.splice(l.interactables.indexOf(this), 1); for (var n = 0; n < (l.interactions || []).length; n++) { var r; r = (l.interactions || [])[n]; var i = r; i.target === this && i.interacting() && !i._ending && i.stop() } return l.interact }, t }(); l.interactables.indexOfElement = function (t, e) { e = e || l.document; for (var n = 0; n < this.length; n++) { var r = this[n]; if (r.target === t && r._context === e) return n } return -1 }, l.interactables.get = function (t, e, n) { var r = this[this.indexOfElement(t, e && e.context)]; return r && (o.string(t) || n || r.inContext(t)) ? r : null }, l.interactables.forEachMatch = function (t, e) { for (var n = 0; n < this.length; n++) { var r; r = this[n]; var i = r, s = void 0; if ((o.string(i.target) ? o.element(t) && m(t, i.target) : t === i.target) && i.inContext(t) && (s = e(i)), void 0 !== s) return s } }, S.eventTypes = l.eventTypes = [], S.signals = d, S.settingsMethods = ["deltaSource", "origin", "preventDefault", "rectChecker"], e.exports = S }, { "./Eventable": 2, "./actions/base": 6, "./defaultOptions": 18, "./scope": 33, "./utils/Signals": 34, "./utils/arr": 35, "./utils/browser": 36, "./utils/clone": 37, "./utils/domUtils": 39, "./utils/events": 40, "./utils/extend": 41, "./utils/is": 46, "./utils/window": 52 }], 5: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } function i(t) { return function (e) { var n = c.getPointerType(e), r = c.getEventTargets(e), i = r[0], o = r[1], s = []; if (p.supportsTouch && /touch/.test(e.type)) { h = (new Date).getTime(); for (var l = 0; l < e.changedTouches.length; l++) { var u; u = e.changedTouches[l]; var f = u, v = f, g = d.search(v, e.type, i); s.push([v, g || new m({ pointerType: n })]) } } else { var y = !1; if (!p.supportsPointerEvent && /mouse/.test(e.type)) { for (var x = 0; x < a.interactions.length && !y; x++)y = "mouse" !== a.interactions[x].pointerType && a.interactions[x].pointerIsDown; y = y || (new Date).getTime() - h < 500 || 0 === e.timeStamp } if (!y) { var b = d.search(e, e.type, i); b || (b = new m({ pointerType: n })), s.push([e, b]) } } for (var w = 0; w < s.length; w++) { var E = s[w], T = E[0], S = E[1]; S._updateEventTargets(i, o), S[t](T, e, i, o) } } } function o(t) { for (var e = 0; e < a.interactions.length; e++) { var n; n = a.interactions[e]; var r = n; r.end(t), f.fire("endall", { event: t, interaction: r }) } } function s(t, e) { var n = t.doc, r = 0 === e.indexOf("add") ? l.add : l.remove; for (var i in a.delegatedEvents) r(n, i, l.delegateListener), r(n, i, l.delegateUseCapture, !0); for (var o in b) r(n, o, b[o], p.isIOS ? { passive: !1 } : void 0) } var a = t("./scope"), c = t("./utils"), l = t("./utils/events"), p = t("./utils/browser"), u = t("./utils/domObjects"), d = t("./utils/interactionFinder"), f = t("./utils/Signals").new(), v = {}, g = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer"], h = 0; a.interactions = []; for (var m = function () { function t(e) { var n = e.pointerType; r(this, t), this.target = null, this.element = null, this.prepared = { name: null, axis: null, edges: null }, this.pointers = [], this.pointerIds = [], this.downTargets = [], this.downTimes = [], this.prevCoords = { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, this.curCoords = { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, this.startCoords = { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, this.pointerDelta = { page: { x: 0, y: 0, vx: 0, vy: 0, speed: 0 }, client: { x: 0, y: 0, vx: 0, vy: 0, speed: 0 }, timeStamp: 0 }, this.downEvent = null, this.downPointer = {}, this._eventTarget = null, this._curEventTarget = null, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this.pointerType = n, f.fire("new", this), a.interactions.push(this) } return t.prototype.pointerDown = function (t, e, n) { var r = this.updatePointer(t, e, !0); f.fire("down", { pointer: t, event: e, eventTarget: n, pointerIndex: r, interaction: this }) }, t.prototype.start = function (t, e, n) { this.interacting() || !this.pointerIsDown || this.pointerIds.length < ("gesture" === t.name ? 2 : 1) || (-1 === a.interactions.indexOf(this) && a.interactions.push(this), c.copyAction(this.prepared, t), this.target = e, this.element = n, f.fire("action-start", { interaction: this, event: this.downEvent })) }, t.prototype.pointerMove = function (e, n, r) { this.simulation || (this.updatePointer(e), c.setCoords(this.curCoords, this.pointers)); var i = this.curCoords.page.x === this.prevCoords.page.x && this.curCoords.page.y === this.prevCoords.page.y && this.curCoords.client.x === this.prevCoords.client.x && this.curCoords.client.y === this.prevCoords.client.y, o = void 0, s = void 0; this.pointerIsDown && !this.pointerWasMoved && (o = this.curCoords.client.x - this.startCoords.client.x, s = this.curCoords.client.y - this.startCoords.client.y, this.pointerWasMoved = c.hypot(o, s) > t.pointerMoveTolerance); var a = { pointer: e, pointerIndex: this.getPointerIndex(e), event: n, eventTarget: r, dx: o, dy: s, duplicate: i, interaction: this, interactingBeforeMove: this.interacting() }; i || c.setCoordDeltas(this.pointerDelta, this.prevCoords, this.curCoords), f.fire("move", a), i || (this.interacting() && this.doMove(a), this.pointerWasMoved && c.copyCoords(this.prevCoords, this.curCoords)) }, t.prototype.doMove = function (t) { t = c.extend({ pointer: this.pointers[0], event: this.prevEvent, eventTarget: this._eventTarget, interaction: this }, t || {}), f.fire("before-action-move", t), this._dontFireMove || f.fire("action-move", t), this._dontFireMove = !1 }, t.prototype.pointerUp = function (t, e, n, r) { var i = this.getPointerIndex(t); f.fire(/cancel$/i.test(e.type) ? "cancel" : "up", { pointer: t, pointerIndex: i, event: e, eventTarget: n, curEventTarget: r, interaction: this }), this.simulation || this.end(e), this.pointerIsDown = !1, this.removePointer(t, e) }, t.prototype.end = function (t) { this._ending = !0, t = t || this.prevEvent, this.interacting() && f.fire("action-end", { event: t, interaction: this }), this.stop(), this._ending = !1 }, t.prototype.currentAction = function () { return this._interacting ? this.prepared.name : null }, t.prototype.interacting = function () { return this._interacting }, t.prototype.stop = function () { f.fire("stop", { interaction: this }), this._interacting && (f.fire("stop-active", { interaction: this }), f.fire("stop-" + this.prepared.name, { interaction: this })), this.target = this.element = null, this._interacting = !1, this.prepared.name = this.prevEvent = null }, t.prototype.getPointerIndex = function (t) { return "mouse" === this.pointerType || "pen" === this.pointerType ? 0 : this.pointerIds.indexOf(c.getPointerId(t)) }, t.prototype.updatePointer = function (t, e) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e && /(down|start)$/i.test(e.type), r = c.getPointerId(t), i = this.getPointerIndex(t); return -1 === i && (i = this.pointerIds.length, this.pointerIds[i] = r), n && f.fire("update-pointer-down", { pointer: t, event: e, down: n, pointerId: r, pointerIndex: i, interaction: this }), this.pointers[i] = t, i }, t.prototype.removePointer = function (t, e) { var n = this.getPointerIndex(t); -1 !== n && (f.fire("remove-pointer", { pointer: t, event: e, pointerIndex: n, interaction: this }), this.pointers.splice(n, 1), this.pointerIds.splice(n, 1), this.downTargets.splice(n, 1), this.downTimes.splice(n, 1)) }, t.prototype._updateEventTargets = function (t, e) { this._eventTarget = t, this._curEventTarget = e }, t }(), y = 0; y < g.length; y++) { var x = g[y]; v[x] = i(x) } var b = {}, w = p.pEventTypes; u.PointerEvent ? (b[w.down] = v.pointerDown, b[w.move] = v.pointerMove, b[w.up] = v.pointerUp, b[w.cancel] = v.pointerUp) : (b.mousedown = v.pointerDown, b.mousemove = v.pointerMove, b.mouseup = v.pointerUp, b.touchstart = v.pointerDown, b.touchmove = v.pointerMove, b.touchend = v.pointerUp, b.touchcancel = v.pointerUp), b.blur = o, f.on("update-pointer-down", function (t) { var e = t.interaction, n = t.pointer, r = t.pointerId, i = t.pointerIndex, o = t.event, s = t.eventTarget, a = t.down; e.pointerIds[i] = r, e.pointers[i] = n, a && (e.pointerIsDown = !0), e.interacting() || (c.setCoords(e.startCoords, e.pointers), c.copyCoords(e.curCoords, e.startCoords), c.copyCoords(e.prevCoords, e.startCoords), e.downEvent = o, e.downTimes[i] = e.curCoords.timeStamp, e.downTargets[i] = s || o && c.getEventTargets(o)[0], e.pointerWasMoved = !1, c.pointerExtend(e.downPointer, n)) }), a.signals.on("add-document", s), a.signals.on("remove-document", s), m.pointerMoveTolerance = 1, m.doOnInteractions = i, m.endAll = o, m.signals = f, m.docEvents = b, a.endAllInteractions = o, e.exports = m }, { "./scope": 33, "./utils": 44, "./utils/Signals": 34, "./utils/browser": 36, "./utils/domObjects": 38, "./utils/events": 40, "./utils/interactionFinder": 45 }], 6: [function (t, e, n) { "use strict"; function r(t, e, n, r) { var i = t.prepared.name, s = new o(t, e, i, n, t.element, null, r); t.target.fire(s), t.prevEvent = s } var i = t("../Interaction"), o = t("../InteractEvent"), s = { firePrepared: r, names: [], methodDict: {} }; i.signals.on("action-start", function (t) { var e = t.interaction, n = t.event; e._interacting = !0, r(e, n, "start") }), i.signals.on("action-move", function (t) { var e = t.interaction; if (r(e, t.event, "move", t.preEnd), !e.interacting()) return !1 }), i.signals.on("action-end", function (t) { r(t.interaction, t.event, "end") }), e.exports = s }, { "../InteractEvent": 3, "../Interaction": 5 }], 7: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("../utils"), o = t("../InteractEvent"), s = t("../Interactable"), a = t("../Interaction"), c = t("../defaultOptions"), l = { defaults: { enabled: !1, mouseButtons: null, origin: null, snap: null, restrict: null, inertia: null, autoScroll: null, startAxis: "xy", lockAxis: "xy" }, checker: function (t, e, n) { var r = n.options.drag; return r.enabled ? { name: "drag", axis: "start" === r.lockAxis ? r.startAxis : r.lockAxis } : null }, getCursor: function () { return "move" } }; a.signals.on("before-action-move", function (t) { var e = t.interaction; if ("drag" === e.prepared.name) { var n = e.prepared.axis; "x" === n ? (e.curCoords.page.y = e.startCoords.page.y, e.curCoords.client.y = e.startCoords.client.y, e.pointerDelta.page.speed = Math.abs(e.pointerDelta.page.vx), e.pointerDelta.client.speed = Math.abs(e.pointerDelta.client.vx), e.pointerDelta.client.vy = 0, e.pointerDelta.page.vy = 0) : "y" === n && (e.curCoords.page.x = e.startCoords.page.x, e.curCoords.client.x = e.startCoords.client.x, e.pointerDelta.page.speed = Math.abs(e.pointerDelta.page.vy), e.pointerDelta.client.speed = Math.abs(e.pointerDelta.client.vy), e.pointerDelta.client.vx = 0, e.pointerDelta.page.vx = 0) } }), o.signals.on("new", function (t) { var e = t.iEvent, n = t.interaction; if ("dragmove" === e.type) { var r = n.prepared.axis; "x" === r ? (e.pageY = n.startCoords.page.y, e.clientY = n.startCoords.client.y, e.dy = 0) : "y" === r && (e.pageX = n.startCoords.page.x, e.clientX = n.startCoords.client.x, e.dx = 0) } }), s.prototype.draggable = function (t) { return i.is.object(t) ? (this.options.drag.enabled = !1 !== t.enabled, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : i.is.bool(t) ? (this.options.drag.enabled = t, t || (this.ondragstart = this.ondragstart = this.ondragend = null), this) : this.options.drag }, r.drag = l, r.names.push("drag"), i.merge(s.eventTypes, ["dragstart", "dragmove", "draginertiastart", "draginertiaresume", "dragend"]), r.methodDict.drag = "draggable", c.drag = l.defaults, e.exports = l }, { "../InteractEvent": 3, "../Interactable": 4, "../Interaction": 5, "../defaultOptions": 18, "../utils": 44, "./base": 6 }], 8: [function (t, e, n) { "use strict"; function r(t, e) { for (var n = [], r = [], i = 0; i < u.interactables.length; i++) { var o; o = u.interactables[i]; var s = o; if (s.options.drop.enabled) { var a = s.options.drop.accept; if (!(p.is.element(a) && a !== e || p.is.string(a) && !p.matchesSelector(e, a))) for (var c = p.is.string(s.target) ? s._context.querySelectorAll(s.target) : [s.target], l = 0; l < c.length; l++) { var d; d = c[l]; var f = d; f !== e && (n.push(s), r.push(f)) } } } return { elements: r, dropzones: n } } function i(t, e) { for (var n = void 0, r = 0; r < t.dropzones.length; r++) { var i = t.dropzones[r], o = t.elements[r]; o !== n && (e.target = o, i.fire(e)), n = o } } function o(t, e) { var n = r(t, e); t.dropzones = n.dropzones, t.elements = n.elements, t.rects = []; for (var i = 0; i < t.dropzones.length; i++)t.rects[i] = t.dropzones[i].getRect(t.elements[i]) } function s(t, e, n) { var r = t.interaction, i = []; y && o(r.activeDrops, n); for (var s = 0; s < r.activeDrops.dropzones.length; s++) { var a = r.activeDrops.dropzones[s], c = r.activeDrops.elements[s], l = r.activeDrops.rects[s]; i.push(a.dropCheck(t, e, r.target, n, c, l) ? c : null) } var u = p.indexOfDeepestElement(i); return { dropzone: r.activeDrops.dropzones[u] || null, element: r.activeDrops.elements[u] || null } } function a(t, e, n) { var r = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null }, i = { dragEvent: n, interaction: t, target: t.dropElement, dropzone: t.dropTarget, relatedTarget: n.target, draggable: n.interactable, timeStamp: n.timeStamp }; return t.dropElement !== t.prevDropElement && (t.prevDropTarget && (r.leave = p.extend({ type: "dragleave" }, i), n.dragLeave = r.leave.target = t.prevDropElement, n.prevDropzone = r.leave.dropzone = t.prevDropTarget), t.dropTarget && (r.enter = { dragEvent: n, interaction: t, target: t.dropElement, dropzone: t.dropTarget, relatedTarget: n.target, draggable: n.interactable, timeStamp: n.timeStamp, type: "dragenter" }, n.dragEnter = t.dropElement, n.dropzone = t.dropTarget)), "dragend" === n.type && t.dropTarget && (r.drop = p.extend({ type: "drop" }, i), n.dropzone = t.dropTarget, n.relatedTarget = t.dropElement), "dragstart" === n.type && (r.activate = p.extend({ type: "dropactivate" }, i), r.activate.target = null, r.activate.dropzone = null), "dragend" === n.type && (r.deactivate = p.extend({ type: "dropdeactivate" }, i), r.deactivate.target = null, r.deactivate.dropzone = null), "dragmove" === n.type && t.dropTarget && (r.move = p.extend({ dragmove: n, type: "dropmove" }, i), n.dropzone = t.dropTarget), r } function c(t, e) { var n = t.activeDrops, r = t.prevDropTarget, o = t.dropTarget, s = t.dropElement; e.leave && r.fire(e.leave), e.move && o.fire(e.move), e.enter && o.fire(e.enter), e.drop && o.fire(e.drop), e.deactivate && i(n, e.deactivate), t.prevDropTarget = o, t.prevDropElement = s } var l = t("./base"), p = t("../utils"), u = t("../scope"), d = t("../interact"), f = t("../InteractEvent"), v = t("../Interactable"), g = t("../Interaction"), h = t("../defaultOptions"), m = { defaults: { enabled: !1, accept: null, overlap: "pointer" } }, y = !1; g.signals.on("action-start", function (t) { var e = t.interaction, n = t.event; if ("drag" === e.prepared.name) { e.activeDrops.dropzones = [], e.activeDrops.elements = [], e.activeDrops.rects = [], e.dropEvents = null, e.dynamicDrop || o(e.activeDrops, e.element); var r = e.prevEvent, s = a(e, n, r); s.activate && i(e.activeDrops, s.activate) } }), f.signals.on("new", function (t) { var e = t.interaction, n = t.iEvent, r = t.event; if ("dragmove" === n.type || "dragend" === n.type) { var i = e.element, o = n, c = s(o, r, i); e.dropTarget = c.dropzone, e.dropElement = c.element, e.dropEvents = a(e, r, o) } }), g.signals.on("action-move", function (t) { var e = t.interaction; "drag" === e.prepared.name && c(e, e.dropEvents) }), g.signals.on("action-end", function (t) { var e = t.interaction; "drag" === e.prepared.name && c(e, e.dropEvents) }), g.signals.on("stop-drag", function (t) { var e = t.interaction; e.activeDrops = { dropzones: null, elements: null, rects: null }, e.dropEvents = null }), v.prototype.dropzone = function (t) { return p.is.object(t) ? (this.options.drop.enabled = !1 !== t.enabled, p.is.function(t.ondrop) && (this.events.ondrop = t.ondrop), p.is.function(t.ondropactivate) && (this.events.ondropactivate = t.ondropactivate), p.is.function(t.ondropdeactivate) && (this.events.ondropdeactivate = t.ondropdeactivate), p.is.function(t.ondragenter) && (this.events.ondragenter = t.ondragenter), p.is.function(t.ondragleave) && (this.events.ondragleave = t.ondragleave), p.is.function(t.ondropmove) && (this.events.ondropmove = t.ondropmove), /^(pointer|center)$/.test(t.overlap) ? this.options.drop.overlap = t.overlap : p.is.number(t.overlap) && (this.options.drop.overlap = Math.max(Math.min(1, t.overlap), 0)), "accept" in t && (this.options.drop.accept = t.accept), "checker" in t && (this.options.drop.checker = t.checker), this) : p.is.bool(t) ? (this.options.drop.enabled = t, t || (this.ondragenter = this.ondragleave = this.ondrop = this.ondropactivate = this.ondropdeactivate = null), this) : this.options.drop }, v.prototype.dropCheck = function (t, e, n, r, i, o) { var s = !1; if (!(o = o || this.getRect(i))) return !!this.options.drop.checker && this.options.drop.checker(t, e, s, this, i, n, r); var a = this.options.drop.overlap; if ("pointer" === a) { var c = p.getOriginXY(n, r, "drag"), l = p.getPageXY(t); l.x += c.x, l.y += c.y; var u = l.x > o.left && l.x < o.right, d = l.y > o.top && l.y < o.bottom; s = u && d } var f = n.getRect(r); if (f && "center" === a) { var v = f.left + f.width / 2, g = f.top + f.height / 2; s = v >= o.left && v <= o.right && g >= o.top && g <= o.bottom } if (f && p.is.number(a)) { s = Math.max(0, Math.min(o.right, f.right) - Math.max(o.left, f.left)) * Math.max(0, Math.min(o.bottom, f.bottom) - Math.max(o.top, f.top)) / (f.width * f.height) >= a } return this.options.drop.checker && (s = this.options.drop.checker(t, e, s, this, i, n, r)), s }, v.signals.on("unset", function (t) { t.interactable.dropzone(!1) }), v.settingsMethods.push("dropChecker"), g.signals.on("new", function (t) { t.dropTarget = null, t.dropElement = null, t.prevDropTarget = null, t.prevDropElement = null, t.dropEvents = null, t.activeDrops = { dropzones: [], elements: [], rects: [] } }), g.signals.on("stop", function (t) { var e = t.interaction; e.dropTarget = e.dropElement = e.prevDropTarget = e.prevDropElement = null }), d.dynamicDrop = function (t) { return p.is.bool(t) ? (y = t, d) : y }, p.merge(v.eventTypes, ["dragenter", "dragleave", "dropactivate", "dropdeactivate", "dropmove", "drop"]), l.methodDict.drop = "dropzone", h.drop = m.defaults, e.exports = m }, { "../InteractEvent": 3, "../Interactable": 4, "../Interaction": 5, "../defaultOptions": 18, "../interact": 21, "../scope": 33, "../utils": 44, "./base": 6 }], 9: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("../utils"), o = t("../InteractEvent"), s = t("../Interactable"), a = t("../Interaction"), c = t("../defaultOptions"), l = { defaults: { enabled: !1, origin: null, restrict: null }, checker: function (t, e, n, r, i) { return i.pointerIds.length >= 2 ? { name: "gesture" } : null }, getCursor: function () { return "" } }; o.signals.on("new", function (t) { var e = t.iEvent, n = t.interaction; "gesturestart" === e.type && (e.ds = 0, n.gesture.startDistance = n.gesture.prevDistance = e.distance, n.gesture.startAngle = n.gesture.prevAngle = e.angle, n.gesture.scale = 1) }), o.signals.on("new", function (t) { var e = t.iEvent, n = t.interaction; "gesturemove" === e.type && (e.ds = e.scale - n.gesture.scale, n.target.fire(e), n.gesture.prevAngle = e.angle, n.gesture.prevDistance = e.distance, e.scale === 1 / 0 || null === e.scale || void 0 === e.scale || isNaN(e.scale) || (n.gesture.scale = e.scale)) }), s.prototype.gesturable = function (t) { return i.is.object(t) ? (this.options.gesture.enabled = !1 !== t.enabled, this.setPerAction("gesture", t), this.setOnEvents("gesture", t), this) : i.is.bool(t) ? (this.options.gesture.enabled = t, t || (this.ongesturestart = this.ongesturestart = this.ongestureend = null), this) : this.options.gesture }, o.signals.on("set-delta", function (t) { var e = t.interaction, n = t.iEvent, r = t.action, s = t.event, a = t.starting, c = t.ending, l = t.deltaSource; if ("gesture" === r) { var p = e.pointers; n.touches = [p[0], p[1]], a ? (n.distance = i.touchDistance(p, l), n.box = i.touchBBox(p), n.scale = 1, n.ds = 0, n.angle = i.touchAngle(p, void 0, l), n.da = 0) : c || s instanceof o ? (n.distance = e.prevEvent.distance, n.box = e.prevEvent.box, n.scale = e.prevEvent.scale, n.ds = n.scale - 1, n.angle = e.prevEvent.angle, n.da = n.angle - e.gesture.startAngle) : (n.distance = i.touchDistance(p, l), n.box = i.touchBBox(p), n.scale = n.distance / e.gesture.startDistance, n.angle = i.touchAngle(p, e.gesture.prevAngle, l), n.ds = n.scale - e.gesture.prevScale, n.da = n.angle - e.gesture.prevAngle) } }), a.signals.on("new", function (t) { t.gesture = { start: { x: 0, y: 0 }, startDistance: 0, prevDistance: 0, distance: 0, scale: 1, startAngle: 0, prevAngle: 0 } }), r.gesture = l, r.names.push("gesture"), i.merge(s.eventTypes, ["gesturestart", "gesturemove", "gestureend"]), r.methodDict.gesture = "gesturable", c.gesture = l.defaults, e.exports = l }, { "../InteractEvent": 3, "../Interactable": 4, "../Interaction": 5, "../defaultOptions": 18, "../utils": 44, "./base": 6 }], 10: [function (t, e, n) {
            "use strict"; function r(t, e, n, r, i, s, a) { if (!e) return !1; if (!0 === e) { var c = o.is.number(s.width) ? s.width : s.right - s.left, l = o.is.number(s.height) ? s.height : s.bottom - s.top; if (c < 0 && ("left" === t ? t = "right" : "right" === t && (t = "left")), l < 0 && ("top" === t ? t = "bottom" : "bottom" === t && (t = "top")), "left" === t) return n.x < (c >= 0 ? s.left : s.right) + a; if ("top" === t) return n.y < (l >= 0 ? s.top : s.bottom) + a; if ("right" === t) return n.x > (c >= 0 ? s.right : s.left) - a; if ("bottom" === t) return n.y > (l >= 0 ? s.bottom : s.top) - a } return !!o.is.element(r) && (o.is.element(e) ? e === r : o.matchesUpTo(r, e, i)) } var i = t("./base"), o = t("../utils"), s = t("../utils/browser"), a = t("../InteractEvent"), c = t("../Interactable"), l = t("../Interaction"), p = t("../defaultOptions"), u = s.supportsTouch || s.supportsPointerEvent ? 20 : 10, d = { defaults: { enabled: !1, mouseButtons: null, origin: null, snap: null, restrict: null, inertia: null, autoScroll: null, square: !1, preserveAspectRatio: !1, axis: "xy", margin: NaN, edges: null, invert: "none" }, checker: function (t, e, n, i, s, a) { if (!a) return null; var c = o.extend({}, s.curCoords.page), l = n.options; if (l.resize.enabled) { var p = l.resize, d = { left: !1, right: !1, top: !1, bottom: !1 }; if (o.is.object(p.edges)) { for (var f in d) d[f] = r(f, p.edges[f], c, s._eventTarget, i, a, p.margin || u); if (d.left = d.left && !d.right, d.top = d.top && !d.bottom, d.left || d.right || d.top || d.bottom) return { name: "resize", edges: d } } else { var v = "y" !== l.resize.axis && c.x > a.right - u, g = "x" !== l.resize.axis && c.y > a.bottom - u; if (v || g) return { name: "resize", axes: (v ? "x" : "") + (g ? "y" : "") } } } return null }, cursors: s.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" }, getCursor: function (t) { if (t.axis) return d.cursors[t.name + t.axis]; if (t.edges) { for (var e = "", n = ["top", "bottom", "left", "right"], r = 0; r < 4; r++)t.edges[n[r]] && (e += n[r]); return d.cursors[e] } } }; a.signals.on("new", function (t) { var e = t.iEvent, n = t.interaction; if ("resizestart" === e.type && n.prepared.edges) { var r = n.target.getRect(n.element), i = n.target.options.resize; if (i.square || i.preserveAspectRatio) { var s = o.extend({}, n.prepared.edges); s.top = s.top || s.left && !s.bottom, s.left = s.left || s.top && !s.right, s.bottom = s.bottom || s.right && !s.top, s.right = s.right || s.bottom && !s.left, n.prepared._linkedEdges = s } else n.prepared._linkedEdges = null; i.preserveAspectRatio && (n.resizeStartAspectRatio = r.width / r.height), n.resizeRects = { start: r, current: o.extend({}, r), inverted: o.extend({}, r), previous: o.extend({}, r), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, e.rect = n.resizeRects.inverted, e.deltaRect = n.resizeRects.delta } }), a.signals.on("new", function (t) { var e = t.iEvent, n = t.phase, r = t.interaction; if ("move" === n && r.prepared.edges) { var i = r.target.options.resize, s = i.invert, a = "reposition" === s || "negate" === s, c = r.prepared.edges, l = r.resizeRects.start, p = r.resizeRects.current, u = r.resizeRects.inverted, d = r.resizeRects.delta, f = o.extend(r.resizeRects.previous, u), v = c, g = e.dx, h = e.dy; if (i.preserveAspectRatio || i.square) { var m = i.preserveAspectRatio ? r.resizeStartAspectRatio : 1; c = r.prepared._linkedEdges, v.left && v.bottom || v.right && v.top ? h = -g / m : v.left || v.right ? h = g / m : (v.top || v.bottom) && (g = h * m) } if (c.top && (p.top += h), c.bottom && (p.bottom += h), c.left && (p.left += g), c.right && (p.right += g), a) { if (o.extend(u, p), "reposition" === s) { var y = void 0; u.top > u.bottom && (y = u.top, u.top = u.bottom, u.bottom = y), u.left > u.right && (y = u.left, u.left = u.right, u.right = y) } } else u.top = Math.min(p.top, l.bottom), u.bottom = Math.max(p.bottom, l.top), u.left = Math.min(p.left, l.right), u.right = Math.max(p.right, l.left); u.width = u.right - u.left, u.height = u.bottom - u.top; for (var x in u) d[x] = u[x] - f[x]; e.edges = r.prepared.edges, e.rect = u, e.deltaRect = d } }), c.prototype.resizable = function (t) { return o.is.object(t) ? (this.options.resize.enabled = !1 !== t.enabled, this.setPerAction("resize", t), this.setOnEvents("resize", t), /^x$|^y$|^xy$/.test(t.axis) ? this.options.resize.axis = t.axis : null === t.axis && (this.options.resize.axis = p.resize.axis), o.is.bool(t.preserveAspectRatio) ? this.options.resize.preserveAspectRatio = t.preserveAspectRatio : o.is.bool(t.square) && (this.options.resize.square = t.square), this) : o.is.bool(t) ? (this.options.resize.enabled = t, t || (this.onresizestart = this.onresizestart = this.onresizeend = null), this) : this.options.resize }, l.signals.on("new", function (t) { t.resizeAxes = "xy" }), a.signals.on("set-delta", function (t) { var e = t.interaction, n = t.iEvent; "resize" === t.action && e.resizeAxes && (e.target.options.resize.square ? ("y" === e.resizeAxes ? n.dx = n.dy : n.dy = n.dx, n.axes = "xy") : (n.axes = e.resizeAxes, "x" === e.resizeAxes ? n.dy = 0 : "y" === e.resizeAxes && (n.dx = 0))) }), i.resize = d, i.names.push("resize"),
                o.merge(c.eventTypes, ["resizestart", "resizemove", "resizeinertiastart", "resizeinertiaresume", "resizeend"]), i.methodDict.resize = "resizable", p.resize = d.defaults, e.exports = d
        }, { "../InteractEvent": 3, "../Interactable": 4, "../Interaction": 5, "../defaultOptions": 18, "../utils": 44, "../utils/browser": 36, "./base": 6 }], 11: [function (t, e, n) { "use strict"; var r = t("./utils/raf"), i = t("./utils/window").getWindow, o = t("./utils/is"), s = t("./utils/domUtils"), a = t("./Interaction"), c = t("./defaultOptions"), l = { defaults: { enabled: !1, container: null, margin: 60, speed: 300 }, interaction: null, i: null, x: 0, y: 0, isScrolling: !1, prevTime: 0, start: function (t) { l.isScrolling = !0, r.cancel(l.i), l.interaction = t, l.prevTime = (new Date).getTime(), l.i = r.request(l.scroll) }, stop: function () { l.isScrolling = !1, r.cancel(l.i) }, scroll: function () { var t = l.interaction.target.options[l.interaction.prepared.name].autoScroll, e = t.container || i(l.interaction.element), n = (new Date).getTime(), s = (n - l.prevTime) / 1e3, a = t.speed * s; a >= 1 && (o.window(e) ? e.scrollBy(l.x * a, l.y * a) : e && (e.scrollLeft += l.x * a, e.scrollTop += l.y * a), l.prevTime = n), l.isScrolling && (r.cancel(l.i), l.i = r.request(l.scroll)) }, check: function (t, e) { var n = t.options; return n[e].autoScroll && n[e].autoScroll.enabled }, onInteractionMove: function (t) { var e = t.interaction, n = t.pointer; if (e.interacting() && l.check(e.target, e.prepared.name)) { if (e.simulation) return void (l.x = l.y = 0); var r = void 0, a = void 0, c = void 0, p = void 0, u = e.target.options[e.prepared.name].autoScroll, d = u.container || i(e.element); if (o.window(d)) p = n.clientX < l.margin, r = n.clientY < l.margin, a = n.clientX > d.innerWidth - l.margin, c = n.clientY > d.innerHeight - l.margin; else { var f = s.getElementClientRect(d); p = n.clientX < f.left + l.margin, r = n.clientY < f.top + l.margin, a = n.clientX > f.right - l.margin, c = n.clientY > f.bottom - l.margin } l.x = a ? 1 : p ? -1 : 0, l.y = c ? 1 : r ? -1 : 0, l.isScrolling || (l.margin = u.margin, l.speed = u.speed, l.start(e)) } } }; a.signals.on("stop-active", function () { l.stop() }), a.signals.on("action-move", l.onInteractionMove), c.perAction.autoScroll = l.defaults, e.exports = l }, { "./Interaction": 5, "./defaultOptions": 18, "./utils/domUtils": 39, "./utils/is": 46, "./utils/raf": 50, "./utils/window": 52 }], 12: [function (t, e, n) { "use strict"; var r = t("../Interactable"), i = t("../actions/base"), o = t("../utils/is"), s = t("../utils/domUtils"), a = t("../utils"), c = a.warnOnce; r.prototype.getAction = function (t, e, n, r) { var i = this.defaultActionChecker(t, e, n, r); return this.options.actionChecker ? this.options.actionChecker(t, e, i, this, r, n) : i }, r.prototype.ignoreFrom = c(function (t) { return this._backCompatOption("ignoreFrom", t) }, "Interactable.ignoreForm() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), r.prototype.allowFrom = c(function (t) { return this._backCompatOption("allowFrom", t) }, "Interactable.allowForm() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), r.prototype.testIgnore = function (t, e, n) { return !(!t || !o.element(n)) && (o.string(t) ? s.matchesUpTo(n, t, e) : !!o.element(t) && s.nodeContains(t, n)) }, r.prototype.testAllow = function (t, e, n) { return !t || !!o.element(n) && (o.string(t) ? s.matchesUpTo(n, t, e) : !!o.element(t) && s.nodeContains(t, n)) }, r.prototype.testIgnoreAllow = function (t, e, n) { return !this.testIgnore(t.ignoreFrom, e, n) && this.testAllow(t.allowFrom, e, n) }, r.prototype.actionChecker = function (t) { return o.function(t) ? (this.options.actionChecker = t, this) : null === t ? (delete this.options.actionChecker, this) : this.options.actionChecker }, r.prototype.styleCursor = function (t) { return o.bool(t) ? (this.options.styleCursor = t, this) : null === t ? (delete this.options.styleCursor, this) : this.options.styleCursor }, r.prototype.defaultActionChecker = function (t, e, n, r) { for (var o = this.getRect(r), s = e.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[e.button], a = null, c = 0; c < i.names.length; c++) { var l; l = i.names[c]; var p = l; if ((!n.pointerIsDown || !/mouse|pointer/.test(n.pointerType) || 0 != (s & this.options[p].mouseButtons)) && (a = i[p].checker(t, e, this, r, n, o))) return a } } }, { "../Interactable": 4, "../actions/base": 6, "../utils": 44, "../utils/domUtils": 39, "../utils/is": 46 }], 13: [function (t, e, n) { "use strict"; function r(t, e, n, r) { return v.is.object(t) && e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && a(e, n, t) ? t : null } function i(t, e, n, i, o, s) { for (var a = 0, c = i.length; a < c; a++) { var l = i[a], p = o[a], u = r(l.getAction(e, n, t, p), l, p, s); if (u) return { action: u, target: l, element: p } } return {} } function o(t, e, n, r) { function o(t) { s.push(t), a.push(c) } for (var s = [], a = [], c = r; v.is.element(c);) { s = [], a = [], f.interactables.forEachMatch(c, o); var l = i(t, e, n, s, a, r); if (l.action && !l.target.options[l.action.name].manualStart) return l; c = v.parentNode(c) } return {} } function s(t, e) { var n = e.action, r = e.target, i = e.element; if (n = n || {}, t.target && t.target.options.styleCursor && (t.target._doc.documentElement.style.cursor = ""), t.target = r, t.element = i, v.copyAction(t.prepared, n), r && r.options.styleCursor) { var o = n ? u[n.name].getCursor(n) : ""; t.target._doc.documentElement.style.cursor = o } g.fire("prepared", { interaction: t }) } function a(t, e, n) { var r = t.options, i = r[n.name].max, o = r[n.name].maxPerElement, s = 0, a = 0, c = 0; if (i && o && h.maxInteractions) { for (var l = 0; l < f.interactions.length; l++) { var p; p = f.interactions[l]; var u = p, d = u.prepared.name; if (u.interacting()) { if (++s >= h.maxInteractions) return !1; if (u.target === t) { if ((a += d === n.name | 0) >= i) return !1; if (u.element === e && (c++ , d !== n.name || c >= o)) return !1 } } } return h.maxInteractions > 0 } } var c = t("../interact"), l = t("../Interactable"), p = t("../Interaction"), u = t("../actions/base"), d = t("../defaultOptions"), f = t("../scope"), v = t("../utils"), g = t("../utils/Signals").new(); t("./InteractableMethods"); var h = { signals: g, withinInteractionLimit: a, maxInteractions: 1 / 0, defaults: { perAction: { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 } }, setActionDefaults: function (t) { v.extend(t.defaults, h.defaults.perAction) }, validateAction: r }; p.signals.on("down", function (t) { var e = t.interaction, n = t.pointer, r = t.event, i = t.eventTarget; if (!e.interacting()) { s(e, o(e, n, r, i)) } }), p.signals.on("move", function (t) { var e = t.interaction, n = t.pointer, r = t.event, i = t.eventTarget; if ("mouse" === e.pointerType && !e.pointerIsDown && !e.interacting()) { s(e, o(e, n, r, i)) } }), p.signals.on("move", function (t) { var e = t.interaction, n = t.event; if (e.pointerIsDown && !e.interacting() && e.pointerWasMoved && e.prepared.name) { g.fire("before-start", t); var r = e.target; e.prepared.name && r && (r.options[e.prepared.name].manualStart || !a(r, e.element, e.prepared) ? e.stop(n) : e.start(e.prepared, r, e.element)) } }), p.signals.on("stop", function (t) { var e = t.interaction, n = e.target; n && n.options.styleCursor && (n._doc.documentElement.style.cursor = "") }), c.maxInteractions = function (t) { return v.is.number(t) ? (h.maxInteractions = t, c) : h.maxInteractions }, l.settingsMethods.push("styleCursor"), l.settingsMethods.push("actionChecker"), l.settingsMethods.push("ignoreFrom"), l.settingsMethods.push("allowFrom"), d.base.actionChecker = null, d.base.styleCursor = !0, v.extend(d.perAction, h.defaults.perAction), e.exports = h }, { "../Interactable": 4, "../Interaction": 5, "../actions/base": 6, "../defaultOptions": 18, "../interact": 21, "../scope": 33, "../utils": 44, "../utils/Signals": 34, "./InteractableMethods": 12 }], 14: [function (t, e, n) { "use strict"; function r(t, e) { if (!e) return !1; var n = e.options.drag.startAxis; return "xy" === t || "xy" === n || n === t } var i = t("./base"), o = t("../scope"), s = t("../utils/is"), a = t("../utils/domUtils"), c = a.parentNode; i.setActionDefaults(t("../actions/drag")), i.signals.on("before-start", function (t) { var e = t.interaction, n = t.eventTarget, a = t.dx, l = t.dy; if ("drag" === e.prepared.name) { var p = Math.abs(a), u = Math.abs(l), d = e.target.options.drag, f = d.startAxis, v = p > u ? "x" : p < u ? "y" : "xy"; if (e.prepared.axis = "start" === d.lockAxis ? v[0] : d.lockAxis, "xy" !== v && "xy" !== f && f !== v) { e.prepared.name = null; for (var g = n, h = function (t) { if (t !== e.target) { var o = e.target.options.drag; if (!o.manualStart && t.testIgnoreAllow(o, g, n)) { var s = t.getAction(e.downPointer, e.downEvent, e, g); if (s && "drag" === s.name && r(v, t) && i.validateAction(s, t, g, n)) return t } } }; s.element(g);) { var m = o.interactables.forEachMatch(g, h); if (m) { e.prepared.name = "drag", e.target = m, e.element = g; break } g = c(g) } } } }) }, { "../actions/drag": 7, "../scope": 33, "../utils/domUtils": 39, "../utils/is": 46, "./base": 13 }], 15: [function (t, e, n) { "use strict"; t("./base").setActionDefaults(t("../actions/gesture")) }, { "../actions/gesture": 9, "./base": 13 }], 16: [function (t, e, n) { "use strict"; function r(t) { var e = t.prepared && t.prepared.name; if (!e) return null; var n = t.target.options; return n[e].hold || n[e].delay } var i = t("./base"), o = t("../Interaction"); i.defaults.perAction.hold = 0, i.defaults.perAction.delay = 0, o.signals.on("new", function (t) { t.autoStartHoldTimer = null }), i.signals.on("prepared", function (t) { var e = t.interaction, n = r(e); n > 0 && (e.autoStartHoldTimer = setTimeout(function () { e.start(e.prepared, e.target, e.element) }, n)) }), o.signals.on("move", function (t) { var e = t.interaction, n = t.duplicate; e.pointerWasMoved && !n && clearTimeout(e.autoStartHoldTimer) }), i.signals.on("before-start", function (t) { var e = t.interaction; r(e) > 0 && (e.prepared.name = null) }), e.exports = { getHoldDuration: r } }, { "../Interaction": 5, "./base": 13 }], 17: [function (t, e, n) { "use strict"; t("./base").setActionDefaults(t("../actions/resize")) }, { "../actions/resize": 10, "./base": 13 }], 18: [function (t, e, n) { "use strict"; e.exports = { base: { accept: null, preventDefault: "auto", deltaSource: "page" }, perAction: { origin: { x: 0, y: 0 }, inertia: { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 } } } }, {}], 19: [function (t, e, n) { "use strict"; t("./inertia"), t("./modifiers/snap"), t("./modifiers/restrict"), t("./pointerEvents/base"), t("./pointerEvents/holdRepeat"), t("./pointerEvents/interactableTargets"), t("./autoStart/hold"), t("./actions/gesture"), t("./actions/resize"), t("./actions/drag"), t("./actions/drop"), t("./modifiers/snapSize"), t("./modifiers/restrictEdges"), t("./modifiers/restrictSize"), t("./autoStart/gesture"), t("./autoStart/resize"), t("./autoStart/drag"), t("./interactablePreventDefault.js"), t("./autoScroll"), e.exports = t("./interact") }, { "./actions/drag": 7, "./actions/drop": 8, "./actions/gesture": 9, "./actions/resize": 10, "./autoScroll": 11, "./autoStart/drag": 14, "./autoStart/gesture": 15, "./autoStart/hold": 16, "./autoStart/resize": 17, "./inertia": 20, "./interact": 21, "./interactablePreventDefault.js": 22, "./modifiers/restrict": 24, "./modifiers/restrictEdges": 25, "./modifiers/restrictSize": 26, "./modifiers/snap": 27, "./modifiers/snapSize": 28, "./pointerEvents/base": 30, "./pointerEvents/holdRepeat": 31, "./pointerEvents/interactableTargets": 32 }], 20: [function (t, e, n) { "use strict"; function r(t, e) { var n = t.target.options[t.prepared.name].inertia, r = n.resistance, i = -Math.log(n.endSpeed / e.v0) / r; e.x0 = t.prevEvent.pageX, e.y0 = t.prevEvent.pageY, e.t0 = e.startEvent.timeStamp / 1e3, e.sx = e.sy = 0, e.modifiedXe = e.xe = (e.vx0 - i) / r, e.modifiedYe = e.ye = (e.vy0 - i) / r, e.te = i, e.lambda_v0 = r / e.v0, e.one_ve_v0 = 1 - n.endSpeed / e.v0 } function i() { s(this), p.setCoordDeltas(this.pointerDelta, this.prevCoords, this.curCoords); var t = this.inertiaStatus, e = this.target.options[this.prepared.name].inertia, n = e.resistance, r = (new Date).getTime() / 1e3 - t.t0; if (r < t.te) { var i = 1 - (Math.exp(-n * r) - t.lambda_v0) / t.one_ve_v0; if (t.modifiedXe === t.xe && t.modifiedYe === t.ye) t.sx = t.xe * i, t.sy = t.ye * i; else { var o = p.getQuadraticCurvePoint(0, 0, t.xe, t.ye, t.modifiedXe, t.modifiedYe, i); t.sx = o.x, t.sy = o.y } this.doMove(), t.i = u.request(this.boundInertiaFrame) } else t.sx = t.modifiedXe, t.sy = t.modifiedYe, this.doMove(), this.end(t.startEvent), t.active = !1, this.simulation = null; p.copyCoords(this.prevCoords, this.curCoords) } function o() { s(this); var t = this.inertiaStatus, e = (new Date).getTime() - t.t0, n = this.target.options[this.prepared.name].inertia.smoothEndDuration; e < n ? (t.sx = p.easeOutQuad(e, 0, t.xe, n), t.sy = p.easeOutQuad(e, 0, t.ye, n), this.pointerMove(t.startEvent, t.startEvent), t.i = u.request(this.boundSmoothEndFrame)) : (t.sx = t.xe, t.sy = t.ye, this.pointerMove(t.startEvent, t.startEvent), this.end(t.startEvent), t.smoothEnd = t.active = !1, this.simulation = null) } function s(t) { var e = t.inertiaStatus; if (e.active) { var n = e.upCoords.page, r = e.upCoords.client; p.setCoords(t.curCoords, [{ pageX: n.x + e.sx, pageY: n.y + e.sy, clientX: r.x + e.sx, clientY: r.y + e.sy }]) } } var a = t("./InteractEvent"), c = t("./Interaction"), l = t("./modifiers/base"), p = t("./utils"), u = t("./utils/raf"); c.signals.on("new", function (t) { t.inertiaStatus = { active: !1, smoothEnd: !1, allowResume: !1, startEvent: null, upCoords: {}, xe: 0, ye: 0, sx: 0, sy: 0, t0: 0, vx0: 0, vys: 0, duration: 0, lambda_v0: 0, one_ve_v0: 0, i: null }, t.boundInertiaFrame = function () { return i.apply(t) }, t.boundSmoothEndFrame = function () { return o.apply(t) } }), c.signals.on("down", function (t) { var e = t.interaction, n = t.event, r = t.pointer, i = t.eventTarget, o = e.inertiaStatus; if (o.active) for (var s = i; p.is.element(s);) { if (s === e.element) { u.cancel(o.i), o.active = !1, e.simulation = null, e.updatePointer(r), p.setCoords(e.curCoords, e.pointers); var d = { interaction: e }; c.signals.fire("before-action-move", d), c.signals.fire("action-resume", d); var f = new a(e, n, e.prepared.name, "inertiaresume", e.element); e.target.fire(f), e.prevEvent = f, l.resetStatuses(e.modifierStatuses), p.copyCoords(e.prevCoords, e.curCoords); break } s = p.parentNode(s) } }), c.signals.on("up", function (t) { var e = t.interaction, n = t.event, i = e.inertiaStatus; if (e.interacting() && !i.active) { var o = e.target, s = o && o.options, c = s && e.prepared.name && s[e.prepared.name].inertia, d = (new Date).getTime(), f = {}, v = p.extend({}, e.curCoords.page), g = e.pointerDelta.client.speed, h = !1, m = void 0, y = c && c.enabled && "gesture" !== e.prepared.name && n !== i.startEvent, x = y && d - e.curCoords.timeStamp < 50 && g > c.minSpeed && g > c.endSpeed, b = { interaction: e, pageCoords: v, statuses: f, preEnd: !0, requireEndOnly: !0 }; y && !x && (l.resetStatuses(f), m = l.setAll(b), m.shouldMove && m.locked && (h = !0)), (x || h) && (p.copyCoords(i.upCoords, e.curCoords), e.pointers[0] = i.startEvent = new a(e, n, e.prepared.name, "inertiastart", e.element), i.t0 = d, i.active = !0, i.allowResume = c.allowResume, e.simulation = i, o.fire(i.startEvent), x ? (i.vx0 = e.pointerDelta.client.vx, i.vy0 = e.pointerDelta.client.vy, i.v0 = g, r(e, i), p.extend(v, e.curCoords.page), v.x += i.xe, v.y += i.ye, l.resetStatuses(f), m = l.setAll(b), i.modifiedXe += m.dx, i.modifiedYe += m.dy, i.i = u.request(e.boundInertiaFrame)) : (i.smoothEnd = !0, i.xe = m.dx, i.ye = m.dy, i.sx = i.sy = 0, i.i = u.request(e.boundSmoothEndFrame))) } }), c.signals.on("stop-active", function (t) { var e = t.interaction, n = e.inertiaStatus; n.active && (u.cancel(n.i), n.active = !1, e.simulation = null) }) }, { "./InteractEvent": 3, "./Interaction": 5, "./modifiers/base": 23, "./utils": 44, "./utils/raf": 50 }], 21: [function (t, e, n) { "use strict"; function r(t, e) { var n = a.interactables.get(t, e); return n || (n = new c(t, e), n.events.global = p), n } var i = t("./utils/browser"), o = t("./utils/events"), s = t("./utils"), a = t("./scope"), c = t("./Interactable"), l = t("./Interaction"), p = {}; r.isSet = function (t, e) { return -1 !== a.interactables.indexOfElement(t, e && e.context) }, r.on = function (t, e, n) { if (s.is.string(t) && -1 !== t.search(" ") && (t = t.trim().split(/ +/)), s.is.array(t)) { for (var i = 0; i < t.length; i++) { var l; l = t[i]; var u = l; r.on(u, e, n) } return r } if (s.is.object(t)) { for (var d in t) r.on(d, t[d], e); return r } return s.contains(c.eventTypes, t) ? p[t] ? p[t].push(e) : p[t] = [e] : o.add(a.document, t, e, { options: n }), r }, r.off = function (t, e, n) { if (s.is.string(t) && -1 !== t.search(" ") && (t = t.trim().split(/ +/)), s.is.array(t)) { for (var i = 0; i < t.length; i++) { var l; l = t[i]; var u = l; r.off(u, e, n) } return r } if (s.is.object(t)) { for (var d in t) r.off(d, t[d], e); return r } if (s.contains(c.eventTypes, t)) { var f = void 0; t in p && -1 !== (f = p[t].indexOf(e)) && p[t].splice(f, 1) } else o.remove(a.document, t, e, n); return r }, r.debug = function () { return a }, r.getPointerAverage = s.pointerAverage, r.getTouchBBox = s.touchBBox, r.getTouchDistance = s.touchDistance, r.getTouchAngle = s.touchAngle, r.getElementRect = s.getElementRect, r.getElementClientRect = s.getElementClientRect, r.matchesSelector = s.matchesSelector, r.closest = s.closest, r.supportsTouch = function () { return i.supportsTouch }, r.supportsPointerEvent = function () { return i.supportsPointerEvent }, r.stop = function (t) { for (var e = a.interactions.length - 1; e >= 0; e--)a.interactions[e].stop(t); return r }, r.pointerMoveTolerance = function (t) { return s.is.number(t) ? (l.pointerMoveTolerance = t, r) : l.pointerMoveTolerance }, r.addDocument = a.addDocument, r.removeDocument = a.removeDocument, a.interact = r, e.exports = r }, { "./Interactable": 4, "./Interaction": 5, "./scope": 33, "./utils": 44, "./utils/browser": 36, "./utils/events": 40 }], 22: [function (t, e, n) { "use strict"; function r(t) { var e = t.interaction, n = t.event; e.target && e.target.checkAndPreventDefault(n) } var i = t("./Interactable"), o = t("./Interaction"), s = t("./scope"), a = t("./utils/is"), c = t("./utils/events"), l = t("./utils/browser"), p = t("./utils/domUtils"), u = p.nodeContains, d = p.matchesSelector; i.prototype.preventDefault = function (t) { return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : a.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault }, i.prototype.checkAndPreventDefault = function (t) { var e = this.options.preventDefault; if ("never" !== e) return "always" === e ? void t.preventDefault() : void (c.supportsPassive && /^touch(start|move)$/.test(t.type) && !l.isIOS || /^(mouse|pointer|touch)*(down|start)/i.test(t.type) || a.element(t.target) && d(t.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || t.preventDefault()) }; for (var f = ["down", "move", "up", "cancel"], v = 0; v < f.length; v++) { var g = f[v]; o.signals.on(g, r) } o.docEvents.dragstart = function (t) { for (var e = 0; e < s.interactions.length; e++) { var n; n = s.interactions[e]; var r = n; if (r.element && (r.element === t.target || u(r.element, t.target))) return void r.target.checkAndPreventDefault(t) } } }, { "./Interactable": 4, "./Interaction": 5, "./scope": 33, "./utils/browser": 36, "./utils/domUtils": 39, "./utils/events": 40, "./utils/is": 46 }], 23: [function (t, e, n) { "use strict"; function r(t, e, n) { return t && t.enabled && (e || !t.endOnly) && (!n || t.endOnly) } var i = t("../InteractEvent"), o = t("../Interaction"), s = t("../utils/extend"), a = { names: [], setOffsets: function (t) { var e = t.interaction, n = t.pageCoords, r = e.target, i = e.element, o = e.startOffset, s = r.getRect(i); s ? (o.left = n.x - s.left, o.top = n.y - s.top, o.right = s.right - n.x, o.bottom = s.bottom - n.y, "width" in s || (s.width = s.right - s.left), "height" in s || (s.height = s.bottom - s.top)) : o.left = o.top = o.right = o.bottom = 0, t.rect = s, t.interactable = r, t.element = i; for (var c = 0; c < a.names.length; c++) { var l; l = a.names[c]; var p = l; t.options = r.options[e.prepared.name][p], t.options && (e.modifierOffsets[p] = a[p].setOffset(t)) } }, setAll: function (t) { var e = t.interaction, n = t.statuses, i = t.preEnd, o = t.requireEndOnly, c = { dx: 0, dy: 0, changed: !1, locked: !1, shouldMove: !0 }; t.modifiedCoords = s({}, t.pageCoords); for (var l = 0; l < a.names.length; l++) { var p; p = a.names[l]; var u = p, d = a[u], f = e.target.options[e.prepared.name][u]; r(f, i, o) && (t.status = t.status = n[u], t.options = f, t.offset = t.interaction.modifierOffsets[u], d.set(t), t.status.locked && (t.modifiedCoords.x += t.status.dx, t.modifiedCoords.y += t.status.dy, c.dx += t.status.dx, c.dy += t.status.dy, c.locked = !0)) } return c.shouldMove = !t.status || !c.locked || t.status.changed, c }, resetStatuses: function (t) { for (var e = 0; e < a.names.length; e++) { var n; n = a.names[e]; var r = n, i = t[r] || {}; i.dx = i.dy = 0, i.modifiedX = i.modifiedY = NaN, i.locked = !1, i.changed = !0, t[r] = i } return t }, start: function (t, e) { var n = t.interaction, r = { interaction: n, pageCoords: ("action-resume" === e ? n.curCoords : n.startCoords).page, startOffset: n.startOffset, statuses: n.modifierStatuses, preEnd: !1, requireEndOnly: !1 }; a.setOffsets(r), a.resetStatuses(r.statuses), r.pageCoords = s({}, n.startCoords.page), n.modifierResult = a.setAll(r) }, beforeMove: function (t) { var e = t.interaction, n = t.preEnd, r = t.interactingBeforeMove, i = a.setAll({ interaction: e, preEnd: n, pageCoords: e.curCoords.page, statuses: e.modifierStatuses, requireEndOnly: !1 }); !i.shouldMove && r && (e._dontFireMove = !0), e.modifierResult = i }, end: function (t) { for (var e = t.interaction, n = t.event, i = 0; i < a.names.length; i++) { var o; o = a.names[i]; var s = o; if (r(e.target.options[e.prepared.name][s], !0, !0)) { e.doMove({ event: n, preEnd: !0 }); break } } }, setXY: function (t) { for (var e = t.iEvent, n = t.interaction, r = s({}, t), i = 0; i < a.names.length; i++) { var o = a.names[i]; if (r.options = n.target.options[n.prepared.name][o], r.options) { var c = a[o]; r.status = n.modifierStatuses[o], e[o] = c.modifyCoords(r) } } } }; o.signals.on("new", function (t) { t.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, t.modifierOffsets = {}, t.modifierStatuses = a.resetStatuses({}), t.modifierResult = null }), o.signals.on("action-start", a.start), o.signals.on("action-resume", a.start), o.signals.on("before-action-move", a.beforeMove), o.signals.on("action-end", a.end), i.signals.on("set-xy", a.setXY), e.exports = a }, { "../InteractEvent": 3, "../Interaction": 5, "../utils/extend": 41 }], 24: [function (t, e, n) { "use strict"; function r(t, e, n) { return o.is.function(t) ? o.resolveRectLike(t, e.target, e.element, [n.x, n.y, e]) : o.resolveRectLike(t, e.target, e.element) } var i = t("./base"), o = t("../utils"), s = t("../defaultOptions"), a = { defaults: { enabled: !1, endOnly: !1, restriction: null, elementRect: null }, setOffset: function (t) { var e = t.rect, n = t.startOffset, r = t.options, i = r && r.elementRect, o = {}; return e && i ? (o.left = n.left - e.width * i.left, o.top = n.top - e.height * i.top, o.right = n.right - e.width * (1 - i.right), o.bottom = n.bottom - e.height * (1 - i.bottom)) : o.left = o.top = o.right = o.bottom = 0, o }, set: function (t) { var e = t.modifiedCoords, n = t.interaction, i = t.status, s = t.options; if (!s) return i; var a = i.useStatusXY ? { x: i.x, y: i.y } : o.extend({}, e), c = r(s.restriction, n, a); if (!c) return i; i.dx = 0, i.dy = 0, i.locked = !1; var l = c, p = a.x, u = a.y, d = n.modifierOffsets.restrict; "x" in c && "y" in c ? (p = Math.max(Math.min(l.x + l.width - d.right, a.x), l.x + d.left), u = Math.max(Math.min(l.y + l.height - d.bottom, a.y), l.y + d.top)) : (p = Math.max(Math.min(l.right - d.right, a.x), l.left + d.left), u = Math.max(Math.min(l.bottom - d.bottom, a.y), l.top + d.top)), i.dx = p - a.x, i.dy = u - a.y, i.changed = i.modifiedX !== p || i.modifiedY !== u, i.locked = !(!i.dx && !i.dy), i.modifiedX = p, i.modifiedY = u }, modifyCoords: function (t) { var e = t.page, n = t.client, r = t.status, i = t.phase, o = t.options, s = o && o.elementRect; if (o && o.enabled && ("start" !== i || !s || !r.locked) && r.locked) return e.x += r.dx, e.y += r.dy, n.x += r.dx, n.y += r.dy, { dx: r.dx, dy: r.dy } }, getRestrictionRect: r }; i.restrict = a, i.names.push("restrict"), s.perAction.restrict = a.defaults, e.exports = a }, { "../defaultOptions": 18, "../utils": 44, "./base": 23 }], 25: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("../utils"), o = t("../utils/rect"), s = t("../defaultOptions"), a = t("../actions/resize"), c = t("./restrict"), l = c.getRestrictionRect, p = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, u = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 }, d = { defaults: { enabled: !1, endOnly: !1, min: null, max: null, offset: null }, setOffset: function (t) { var e = t.interaction, n = t.startOffset, r = t.options; if (!r) return i.extend({}, n); var o = l(r.offset, e, e.startCoords.page); return o ? { top: n.top + o.y, left: n.left + o.x, bottom: n.bottom + o.y, right: n.right + o.x } : n }, set: function (t) { var e = t.modifiedCoords, n = t.interaction, r = t.status, s = t.offset, a = t.options, c = n.prepared.linkedEdges || n.prepared.edges; if (n.interacting() && c) { var d = r.useStatusXY ? { x: r.x, y: r.y } : i.extend({}, e), f = o.xywhToTlbr(l(a.inner, n, d)) || p, v = o.xywhToTlbr(l(a.outer, n, d)) || u, g = d.x, h = d.y; r.dx = 0, r.dy = 0, r.locked = !1, c.top ? h = Math.min(Math.max(v.top + s.top, d.y), f.top + s.top) : c.bottom && (h = Math.max(Math.min(v.bottom - s.bottom, d.y), f.bottom - s.bottom)), c.left ? g = Math.min(Math.max(v.left + s.left, d.x), f.left + s.left) : c.right && (g = Math.max(Math.min(v.right - s.right, d.x), f.right - s.right)), r.dx = g - d.x, r.dy = h - d.y, r.changed = r.modifiedX !== g || r.modifiedY !== h, r.locked = !(!r.dx && !r.dy), r.modifiedX = g, r.modifiedY = h } }, modifyCoords: function (t) { var e = t.page, n = t.client, r = t.status, i = t.phase, o = t.options; if (o && o.enabled && ("start" !== i || !r.locked) && r.locked) return e.x += r.dx, e.y += r.dy, n.x += r.dx, n.y += r.dy, { dx: r.dx, dy: r.dy } }, noInner: p, noOuter: u, getRestrictionRect: l }; r.restrictEdges = d, r.names.push("restrictEdges"), s.perAction.restrictEdges = d.defaults, a.defaults.restrictEdges = d.defaults, e.exports = d }, { "../actions/resize": 10, "../defaultOptions": 18, "../utils": 44, "../utils/rect": 51, "./base": 23, "./restrict": 24 }], 26: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("./restrictEdges"), o = t("../utils"), s = t("../utils/rect"), a = t("../defaultOptions"), c = t("../actions/resize"), l = { width: -1 / 0, height: -1 / 0 }, p = { width: 1 / 0, height: 1 / 0 }, u = { defaults: { enabled: !1, endOnly: !1, min: null, max: null }, setOffset: function (t) { return t.interaction.startOffset }, set: function (t) { var e = t.interaction, n = t.options, r = e.prepared.linkedEdges || e.prepared.edges; if (e.interacting() && r) { var a = s.xywhToTlbr(e.resizeRects.inverted), c = s.tlbrToXywh(i.getRestrictionRect(n.min, e)) || l, u = s.tlbrToXywh(i.getRestrictionRect(n.max, e)) || p; t.options = { enabled: n.enabled, endOnly: n.endOnly, inner: o.extend({}, i.noInner), outer: o.extend({}, i.noOuter) }, r.top ? (t.options.inner.top = a.bottom - c.height, t.options.outer.top = a.bottom - u.height) : r.bottom && (t.options.inner.bottom = a.top + c.height, t.options.outer.bottom = a.top + u.height), r.left ? (t.options.inner.left = a.right - c.width, t.options.outer.left = a.right - u.width) : r.right && (t.options.inner.right = a.left + c.width, t.options.outer.right = a.left + u.width), i.set(t) } }, modifyCoords: i.modifyCoords }; r.restrictSize = u, r.names.push("restrictSize"), a.perAction.restrictSize = u.defaults, c.defaults.restrictSize = u.defaults, e.exports = u }, { "../actions/resize": 10, "../defaultOptions": 18, "../utils": 44, "../utils/rect": 51, "./base": 23, "./restrictEdges": 25 }], 27: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("../interact"), o = t("../utils"), s = t("../defaultOptions"), a = { defaults: { enabled: !1, endOnly: !1, range: 1 / 0, targets: null, offsets: null, relativePoints: null }, setOffset: function (t) { var e = t.interaction, n = t.interactable, r = t.element, i = t.rect, s = t.startOffset, a = t.options, c = [], l = o.rectToXY(o.resolveRectLike(a.origin)), p = l || o.getOriginXY(n, r, e.prepared.name); a = a || n.options[e.prepared.name].snap || {}; var u = void 0; if ("startCoords" === a.offset) u = { x: e.startCoords.page.x - p.x, y: e.startCoords.page.y - p.y }; else { var d = o.resolveRectLike(a.offset, n, r, [e]); u = o.rectToXY(d) || { x: 0, y: 0 } } if (i && a.relativePoints && a.relativePoints.length) for (var f = 0; f < a.relativePoints.length; f++) { var v; v = a.relativePoints[f]; var g = v, h = g.x, m = g.y; c.push({ x: s.left - i.width * h + u.x, y: s.top - i.height * m + u.y }) } else c.push(u); return c }, set: function (t) { var e = t.interaction, n = t.modifiedCoords, r = t.status, i = t.options, s = t.offset, a = [], c = void 0, l = void 0, p = void 0; if (r.useStatusXY) l = { x: r.x, y: r.y }; else { var u = o.getOriginXY(e.target, e.element, e.prepared.name); l = o.extend({}, n), l.x -= u.x, l.y -= u.y } r.realX = l.x, r.realY = l.y; for (var d = i.targets ? i.targets.length : 0, f = 0; f < s.length; f++) { var v; v = s[f]; for (var g = v, h = g.x, m = g.y, y = l.x - h, x = l.y - m, b = 0; b < (i.targets || []).length; b++) { var w; w = (i.targets || [])[b]; var E = w; c = o.is.function(E) ? E(y, x, e) : E, c && a.push({ x: o.is.number(c.x) ? c.x + h : y, y: o.is.number(c.y) ? c.y + m : x, range: o.is.number(c.range) ? c.range : i.range }) } } var T = { target: null, inRange: !1, distance: 0, range: 0, dx: 0, dy: 0 }; for (p = 0, d = a.length; p < d; p++) { c = a[p]; var S = c.range, C = c.x - l.x, I = c.y - l.y, D = o.hypot(C, I), O = D <= S; S === 1 / 0 && T.inRange && T.range !== 1 / 0 && (O = !1), T.target && !(O ? T.inRange && S !== 1 / 0 ? D / S < T.distance / T.range : S === 1 / 0 && T.range !== 1 / 0 || D < T.distance : !T.inRange && D < T.distance) || (T.target = c, T.distance = D, T.range = S, T.inRange = O, T.dx = C, T.dy = I, r.range = S) } var M = void 0; T.target ? (M = r.modifiedX !== T.target.x || r.modifiedY !== T.target.y, r.modifiedX = T.target.x, r.modifiedY = T.target.y) : (M = !0, r.modifiedX = NaN, r.modifiedY = NaN), r.dx = T.dx, r.dy = T.dy, r.changed = M || T.inRange && !r.locked, r.locked = T.inRange }, modifyCoords: function (t) { var e = t.page, n = t.client, r = t.status, i = t.phase, o = t.options, s = o && o.relativePoints; if (o && o.enabled && ("start" !== i || !s || !s.length)) return r.locked && (e.x += r.dx, e.y += r.dy, n.x += r.dx, n.y += r.dy), { range: r.range, locked: r.locked, x: r.modifiedX, y: r.modifiedY, realX: r.realX, realY: r.realY, dx: r.dx, dy: r.dy } } }; i.createSnapGrid = function (t) { return function (e, n) { var r = t.limits || { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 }, i = 0, s = 0; o.is.object(t.offset) && (i = t.offset.x, s = t.offset.y); var a = Math.round((e - i) / t.x), c = Math.round((n - s) / t.y); return { x: Math.max(r.left, Math.min(r.right, a * t.x + i)), y: Math.max(r.top, Math.min(r.bottom, c * t.y + s)), range: t.range } } }, r.snap = a, r.names.push("snap"), s.perAction.snap = a.defaults, e.exports = a }, { "../defaultOptions": 18, "../interact": 21, "../utils": 44, "./base": 23 }], 28: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("./snap"), o = t("../defaultOptions"), s = t("../actions/resize"), a = t("../utils/"), c = { defaults: { enabled: !1, endOnly: !1, range: 1 / 0, targets: null, offsets: null }, setOffset: function (t) { var e = t.interaction, n = t.options, r = e.prepared.edges; if (r) { t.options = { relativePoints: [{ x: r.left ? 0 : 1, y: r.top ? 0 : 1 }], origin: { x: 0, y: 0 }, offset: "self", range: n.range }; var o = i.setOffset(t); return t.options = n, o } }, set: function (t) { var e = t.interaction, n = t.options, r = t.offset, o = t.modifiedCoords, s = a.extend({}, o), c = s.x - r[0].x, l = s.y - r[0].y; t.options = a.extend({}, n), t.options.targets = []; for (var p = 0; p < (n.targets || []).length; p++) { var u; u = (n.targets || [])[p]; var d = u, f = void 0; f = a.is.function(d) ? d(c, l, e) : d, f && ("width" in f && "height" in f && (f.x = f.width, f.y = f.height), t.options.targets.push(f)) } i.set(t) }, modifyCoords: function (t) { var e = t.options; t.options = a.extend({}, e), t.options.enabled = e.enabled, t.options.relativePoints = [null], i.modifyCoords(t) } }; r.snapSize = c, r.names.push("snapSize"), o.perAction.snapSize = c.defaults, s.defaults.snapSize = c.defaults, e.exports = c }, { "../actions/resize": 10, "../defaultOptions": 18, "../utils/": 44, "./base": 23, "./snap": 27 }], 29: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var i = t("../utils/pointerUtils"); e.exports = function () { function t(e, n, o, s, a) { if (r(this, t), i.pointerExtend(this, o), o !== n && i.pointerExtend(this, n), this.interaction = a, this.timeStamp = (new Date).getTime(), this.originalEvent = o, this.type = e, this.pointerId = i.getPointerId(n), this.pointerType = i.getPointerType(n), this.target = s, this.currentTarget = null, "tap" === e) { var c = a.getPointerIndex(n); this.dt = this.timeStamp - a.downTimes[c]; var l = this.timeStamp - a.tapTime; this.double = !!(a.prevTap && "doubletap" !== a.prevTap.type && a.prevTap.target === this.target && l < 500) } else "doubletap" === e && (this.dt = n.timeStamp - a.tapTime) } return t.prototype.subtractOrigin = function (t) { var e = t.x, n = t.y; return this.pageX -= e, this.pageY -= n, this.clientX -= e, this.clientY -= n, this }, t.prototype.addOrigin = function (t) { var e = t.x, n = t.y; return this.pageX += e, this.pageY += n, this.clientX += e, this.clientY += n, this }, t.prototype.preventDefault = function () { this.originalEvent.preventDefault() }, t.prototype.stopPropagation = function () { this.propagationStopped = !0 }, t.prototype.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }, t }() }, { "../utils/pointerUtils": 49 }], 30: [function (t, e, n) {
            "use strict"; function r(t) { for (var e = t.interaction, n = t.pointer, s = t.event, c = t.eventTarget, p = t.type, u = void 0 === p ? t.pointerEvent.type : p, d = t.targets, f = void 0 === d ? i(t) : d, v = t.pointerEvent, g = void 0 === v ? new o(u, n, s, c, e) : v, h = { interaction: e, pointer: n, event: s, eventTarget: c, targets: f, type: u, pointerEvent: g }, m = 0; m < f.length; m++) { var y = f[m]; for (var x in y.props || {}) g[x] = y.props[x]; var b = a.getOriginXY(y.eventable, y.element); if (g.subtractOrigin(b), g.eventable = y.eventable, g.currentTarget = y.element, y.eventable.fire(g), g.addOrigin(b), g.immediatePropagationStopped || g.propagationStopped && m + 1 < f.length && f[m + 1].element !== g.currentTarget) break } if (l.fire("fired", h), "tap" === u) { var w = g.double ? r({ interaction: e, pointer: n, event: s, eventTarget: c, type: "doubletap" }) : g; e.prevTap = w, e.tapTime = w.timeStamp } return g } function i(t) { var e = t.interaction, n = t.pointer, r = t.event, i = t.eventTarget, o = t.type, s = e.getPointerIndex(n); if ("tap" === o && (e.pointerWasMoved || !e.downTargets[s] || e.downTargets[s] !== i)) return []; for (var c = a.getPath(i), p = { interaction: e, pointer: n, event: r, eventTarget: i, type: o, path: c, targets: [], element: null }, u = 0; u < c.length; u++) { var d; d = c[u]; var f = d; p.element = f, l.fire("collect-targets", p) } return "hold" === o && (p.targets = p.targets.filter(function (t) { return t.eventable.options.holdDuration === e.holdTimers[s].duration })), p.targets } var o = t("./PointerEvent"), s = t("../Interaction"), a = t("../utils"), c = t("../defaultOptions"), l = t("../utils/Signals").new(), p = ["down", "up", "cancel"], u = ["down", "up", "cancel"], d = { PointerEvent: o, fire: r, collectEventTargets: i, signals: l, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: ["down", "move", "up", "cancel", "tap", "doubletap", "hold"] }; s.signals.on("update-pointer-down", function (t) { var e = t.interaction, n = t.pointerIndex; e.holdTimers[n] = { duration: 1 / 0, timeout: null } }), s.signals.on("remove-pointer", function (t) { var e = t.interaction, n = t.pointerIndex; e.holdTimers.splice(n, 1) }),
                s.signals.on("move", function (t) { var e = t.interaction, n = t.pointer, i = t.event, o = t.eventTarget, s = t.duplicateMove, a = e.getPointerIndex(n); s || e.pointerIsDown && !e.pointerWasMoved || (e.pointerIsDown && clearTimeout(e.holdTimers[a].timeout), r({ interaction: e, pointer: n, event: i, eventTarget: o, type: "move" })) }), s.signals.on("down", function (t) { for (var e = t.interaction, n = t.pointer, i = t.event, o = t.eventTarget, s = t.pointerIndex, c = e.holdTimers[s], p = a.getPath(o), u = { interaction: e, pointer: n, event: i, eventTarget: o, type: "hold", targets: [], path: p, element: null }, d = 0; d < p.length; d++) { var f; f = p[d]; var v = f; u.element = v, l.fire("collect-targets", u) } if (u.targets.length) { for (var g = 1 / 0, h = 0; h < u.targets.length; h++) { var m; m = u.targets[h]; var y = m, x = y.eventable.options.holdDuration; x < g && (g = x) } c.duration = g, c.timeout = setTimeout(function () { r({ interaction: e, eventTarget: o, pointer: n, event: i, type: "hold" }) }, g) } }), s.signals.on("up", function (t) { var e = t.interaction, n = t.pointer, i = t.event, o = t.eventTarget; e.pointerWasMoved || r({ interaction: e, eventTarget: o, pointer: n, event: i, type: "tap" }) }); for (var f = ["up", "cancel"], v = 0; v < f.length; v++) { var g = f[v]; s.signals.on(g, function (t) { var e = t.interaction, n = t.pointerIndex; e.holdTimers[n] && clearTimeout(e.holdTimers[n].timeout) }) } for (var h = 0; h < p.length; h++)s.signals.on(p[h], function (t) { return function (e) { var n = e.interaction, i = e.pointer, o = e.event; r({ interaction: n, eventTarget: e.eventTarget, pointer: i, event: o, type: t }) } }(u[h])); s.signals.on("new", function (t) { t.prevTap = null, t.tapTime = 0, t.holdTimers = [] }), c.pointerEvents = d.defaults, e.exports = d
        }, { "../Interaction": 5, "../defaultOptions": 18, "../utils": 44, "../utils/Signals": 34, "./PointerEvent": 29 }], 31: [function (t, e, n) { "use strict"; function r(t) { var e = t.pointerEvent; "hold" === e.type && (e.count = (e.count || 0) + 1) } function i(t) { var e = t.interaction, n = t.pointerEvent, r = t.eventTarget, i = t.targets; if ("hold" === n.type && i.length) { var o = i[0].eventable.options.holdRepeatInterval; o <= 0 || (e.holdIntervalHandle = setTimeout(function () { s.fire({ interaction: e, eventTarget: r, type: "hold", pointer: n, event: n }) }, o)) } } function o(t) { var e = t.interaction; e.holdIntervalHandle && (clearInterval(e.holdIntervalHandle), e.holdIntervalHandle = null) } var s = t("./base"), a = t("../Interaction"); s.signals.on("new", r), s.signals.on("fired", i); for (var c = ["move", "up", "cancel", "endall"], l = 0; l < c.length; l++) { var p = c[l]; a.signals.on(p, o) } s.defaults.holdRepeatInterval = 0, s.types.push("holdrepeat"), e.exports = { onNew: r, onFired: i, endHoldRepeat: o } }, { "../Interaction": 5, "./base": 30 }], 32: [function (t, e, n) { "use strict"; var r = t("./base"), i = t("../Interactable"), o = t("../utils/is"), s = t("../scope"), a = t("../utils/extend"), c = t("../utils/arr"), l = c.merge; r.signals.on("collect-targets", function (t) { var e = t.targets, n = t.element, r = t.type, i = t.eventTarget; s.interactables.forEachMatch(n, function (t) { var s = t.events, a = s.options; s[r] && o.element(n) && t.testIgnoreAllow(a, n, i) && e.push({ element: n, eventable: s, props: { interactable: t } }) }) }), i.signals.on("new", function (t) { var e = t.interactable; e.events.getRect = function (t) { return e.getRect(t) } }), i.signals.on("set", function (t) { var e = t.interactable, n = t.options; a(e.events.options, r.defaults), a(e.events.options, n) }), l(i.eventTypes, r.types), i.prototype.pointerEvents = function (t) { return a(this.events.options, t), this }; var p = i.prototype._backCompatOption; i.prototype._backCompatOption = function (t, e) { var n = p.call(this, t, e); return n === this && (this.events.options[t] = e), n }, i.settingsMethods.push("pointerEvents") }, { "../Interactable": 4, "../scope": 33, "../utils/arr": 35, "../utils/extend": 41, "../utils/is": 46, "./base": 30 }], 33: [function (t, e, n) { "use strict"; var r = t("./utils"), i = t("./utils/events"), o = t("./utils/Signals").new(), s = t("./utils/window"), a = s.getWindow, c = { signals: o, events: i, utils: r, document: t("./utils/domObjects").document, documents: [], addDocument: function (t, e) { if (r.contains(c.documents, t)) return !1; e = e || a(t), c.documents.push(t), i.documents.push(t), t !== c.document && i.add(e, "unload", c.onWindowUnload), o.fire("add-document", { doc: t, win: e }) }, removeDocument: function (t, e) { var n = c.documents.indexOf(t); e = e || a(t), i.remove(e, "unload", c.onWindowUnload), c.documents.splice(n, 1), i.documents.splice(n, 1), o.fire("remove-document", { win: e, doc: t }) }, onWindowUnload: function () { c.removeDocument(this.document, this) } }; e.exports = c }, { "./utils": 44, "./utils/Signals": 34, "./utils/domObjects": 38, "./utils/events": 40, "./utils/window": 52 }], 34: [function (t, e, n) { "use strict"; function r(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var i = function () { function t() { r(this, t), this.listeners = {} } return t.prototype.on = function (t, e) { if (!this.listeners[t]) return void (this.listeners[t] = [e]); this.listeners[t].push(e) }, t.prototype.off = function (t, e) { if (this.listeners[t]) { var n = this.listeners[t].indexOf(e); -1 !== n && this.listeners[t].splice(n, 1) } }, t.prototype.fire = function (t, e) { var n = this.listeners[t]; if (n) for (var r = 0; r < n.length; r++) { var i; i = n[r]; var o = i; if (!1 === o(e, t)) return } }, t }(); i.new = function () { return new i }, e.exports = i }, {}], 35: [function (t, e, n) { "use strict"; function r(t, e) { return -1 !== t.indexOf(e) } function i(t, e) { for (var n = 0; n < e.length; n++) { var r; r = e[n]; var i = r; t.push(i) } return t } e.exports = { contains: r, merge: i } }, {}], 36: [function (t, e, n) { "use strict"; var r = t("./window"), i = r.window, o = t("./is"), s = t("./domObjects"), a = s.Element, c = i.navigator, l = { supportsTouch: !!("ontouchstart" in i || o.function(i.DocumentTouch) && s.document instanceof i.DocumentTouch), supportsPointerEvent: !!s.PointerEvent, isIOS: /iP(hone|od|ad)/.test(c.platform), isIOS7: /iP(hone|od|ad)/.test(c.platform) && /OS 7[^\d]/.test(c.appVersion), isIe9: /MSIE 9/.test(c.userAgent), prefixedMatchesSelector: "matches" in a.prototype ? "matches" : "webkitMatchesSelector" in a.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in a.prototype ? "mozMatchesSelector" : "oMatchesSelector" in a.prototype ? "oMatchesSelector" : "msMatchesSelector", pEventTypes: s.PointerEvent ? s.PointerEvent === i.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, wheelEvent: "onmousewheel" in s.document ? "mousewheel" : "wheel" }; l.isOperaMobile = "Opera" === c.appName && l.supportsTouch && c.userAgent.match("Presto"), e.exports = l }, { "./domObjects": 38, "./is": 46, "./window": 52 }], 37: [function (t, e, n) { "use strict"; var r = t("./is"); e.exports = function t(e) { var n = {}; for (var i in e) r.plainObject(e[i]) ? n[i] = t(e[i]) : n[i] = e[i]; return n } }, { "./is": 46 }], 38: [function (t, e, n) { "use strict"; function r() { } var i = {}, o = t("./window").window; i.document = o.document, i.DocumentFragment = o.DocumentFragment || r, i.SVGElement = o.SVGElement || r, i.SVGSVGElement = o.SVGSVGElement || r, i.SVGElementInstance = o.SVGElementInstance || r, i.Element = o.Element || r, i.HTMLElement = o.HTMLElement || i.Element, i.Event = o.Event, i.Touch = o.Touch || r, i.PointerEvent = o.PointerEvent || o.MSPointerEvent, e.exports = i }, { "./window": 52 }], 39: [function (t, e, n) { "use strict"; var r = t("./window"), i = t("./browser"), o = t("./is"), s = t("./domObjects"), a = { nodeContains: function (t, e) { for (; e;) { if (e === t) return !0; e = e.parentNode } return !1 }, closest: function (t, e) { for (; o.element(t);) { if (a.matchesSelector(t, e)) return t; t = a.parentNode(t) } return null }, parentNode: function (t) { var e = t.parentNode; if (o.docFrag(e)) { for (; (e = e.host) && o.docFrag(e);); return e } return e }, matchesSelector: function (t, e) { return r.window !== r.realWindow && (e = e.replace(/\/deep\//g, " ")), t[i.prefixedMatchesSelector](e) }, indexOfDeepestElement: function (t) { var e = [], n = [], r = void 0, i = t[0], o = i ? 0 : -1, a = void 0, c = void 0, l = void 0, p = void 0; for (l = 1; l < t.length; l++)if ((r = t[l]) && r !== i) if (i) { if (r.parentNode !== r.ownerDocument) if (i.parentNode !== r.ownerDocument) { if (!e.length) for (a = i; a.parentNode && a.parentNode !== a.ownerDocument;)e.unshift(a), a = a.parentNode; if (i instanceof s.HTMLElement && r instanceof s.SVGElement && !(r instanceof s.SVGSVGElement)) { if (r === i.parentNode) continue; a = r.ownerSVGElement } else a = r; for (n = []; a.parentNode !== a.ownerDocument;)n.unshift(a), a = a.parentNode; for (p = 0; n[p] && n[p] === e[p];)p++; var u = [n[p - 1], n[p], e[p]]; for (c = u[0].lastChild; c;) { if (c === u[1]) { i = r, o = l, e = []; break } if (c === u[2]) break; c = c.previousSibling } } else i = r, o = l } else i = r, o = l; return o }, matchesUpTo: function (t, e, n) { for (; o.element(t);) { if (a.matchesSelector(t, e)) return !0; if ((t = a.parentNode(t)) === n) return a.matchesSelector(t, e) } return !1 }, getActualElement: function (t) { return t instanceof s.SVGElementInstance ? t.correspondingUseElement : t }, getScrollXY: function (t) { return t = t || r.window, { x: t.scrollX || t.document.documentElement.scrollLeft, y: t.scrollY || t.document.documentElement.scrollTop } }, getElementClientRect: function (t) { var e = t instanceof s.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0]; return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top } }, getElementRect: function (t) { var e = a.getElementClientRect(t); if (!i.isIOS7 && e) { var n = a.getScrollXY(r.getWindow(t)); e.left += n.x, e.right += n.x, e.top += n.y, e.bottom += n.y } return e }, getPath: function (t) { for (var e = []; t;)e.push(t), t = a.parentNode(t); return e }, trySelector: function (t) { return !!o.string(t) && (s.document.querySelector(t), !0) } }; e.exports = a }, { "./browser": 36, "./domObjects": 38, "./is": 46, "./window": 52 }], 40: [function (t, e, n) { "use strict"; function r(t, e, n, r) { var i = p(r), o = x.indexOf(t), s = b[o]; s || (s = { events: {}, typeCount: 0 }, o = x.push(t) - 1, b.push(s)), s.events[e] || (s.events[e] = [], s.typeCount++), y(s.events[e], n) || (t.addEventListener(e, n, T ? i : !!i.capture), s.events[e].push(n)) } function i(t, e, n, r) { var o = p(r), s = x.indexOf(t), a = b[s]; if (a && a.events) if ("all" !== e) { if (a.events[e]) { var c = a.events[e].length; if ("all" === n) { for (var l = 0; l < c; l++)i(t, e, a.events[e][l], o); return } for (var u = 0; u < c; u++)if (a.events[e][u] === n) { t.removeEventListener("on" + e, n, T ? o : !!o.capture), a.events[e].splice(u, 1); break } a.events[e] && 0 === a.events[e].length && (a.events[e] = null, a.typeCount--) } a.typeCount || (b.splice(s, 1), x.splice(s, 1)) } else for (e in a.events) a.events.hasOwnProperty(e) && i(t, e, "all") } function o(t, e, n, i, o) { var s = p(o); if (!w[n]) { w[n] = { selectors: [], contexts: [], listeners: [] }; for (var l = 0; l < E.length; l++) { var u = E[l]; r(u, n, a), r(u, n, c, !0) } } var d = w[n], f = void 0; for (f = d.selectors.length - 1; f >= 0 && (d.selectors[f] !== t || d.contexts[f] !== e); f--); -1 === f && (f = d.selectors.length, d.selectors.push(t), d.contexts.push(e), d.listeners.push([])), d.listeners[f].push([i, !!s.capture, s.passive]) } function s(t, e, n, r, o) { var s = p(o), l = w[n], u = !1, d = void 0; if (l) for (d = l.selectors.length - 1; d >= 0; d--)if (l.selectors[d] === t && l.contexts[d] === e) { for (var f = l.listeners[d], v = f.length - 1; v >= 0; v--) { var g = f[v], h = g[0], m = g[1], y = g[2]; if (h === r && m === !!s.capture && y === s.passive) { f.splice(v, 1), f.length || (l.selectors.splice(d, 1), l.contexts.splice(d, 1), l.listeners.splice(d, 1), i(e, n, a), i(e, n, c, !0), l.selectors.length || (w[n] = null)), u = !0; break } } if (u) break } } function a(t, e) { var n = p(e), r = {}, i = w[t.type], o = f.getEventTargets(t), s = o[0], a = s; for (v(r, t), r.originalEvent = t, r.preventDefault = l; u.element(a);) { for (var c = 0; c < i.selectors.length; c++) { var g = i.selectors[c], h = i.contexts[c]; if (d.matchesSelector(a, g) && d.nodeContains(h, s) && d.nodeContains(h, a)) { var m = i.listeners[c]; r.currentTarget = a; for (var y = 0; y < m.length; y++) { var x = m[y], b = x[0], E = x[1], T = x[2]; E === !!n.capture && T === n.passive && b(r) } } } a = d.parentNode(a) } } function c(t) { return a.call(this, t, !0) } function l() { this.originalEvent.preventDefault() } function p(t) { return u.object(t) ? t : { capture: t } } var u = t("./is"), d = t("./domUtils"), f = t("./pointerUtils"), v = t("./pointerExtend"), g = t("./window"), h = g.window, m = t("./arr"), y = m.contains, x = [], b = [], w = {}, E = [], T = function () { var t = !1; return h.document.createElement("div").addEventListener("test", null, { get capture() { t = !0 } }), t }(); e.exports = { add: r, remove: i, addDelegate: o, removeDelegate: s, delegateListener: a, delegateUseCapture: c, delegatedEvents: w, documents: E, supportsOptions: T, _elements: x, _targets: b } }, { "./arr": 35, "./domUtils": 39, "./is": 46, "./pointerExtend": 48, "./pointerUtils": 49, "./window": 52 }], 41: [function (t, e, n) { "use strict"; e.exports = function (t, e) { for (var n in e) t[n] = e[n]; return t } }, {}], 42: [function (t, e, n) { "use strict"; var r = t("./rect"), i = r.resolveRectLike, o = r.rectToXY; e.exports = function (t, e, n) { var r = t.options[n], s = r && r.origin, a = s || t.options.origin, c = i(a, t, e, [t && e]); return o(c) || { x: 0, y: 0 } } }, { "./rect": 51 }], 43: [function (t, e, n) { "use strict"; e.exports = function (t, e) { return Math.sqrt(t * t + e * e) } }, {}], 44: [function (t, e, n) { "use strict"; var r = t("./extend"), i = t("./window"), o = { warnOnce: function (t, e) { var n = !1; return function () { return n || (i.window.console.warn(e), n = !0), t.apply(this, arguments) } }, _getQBezierValue: function (t, e, n, r) { var i = 1 - t; return i * i * e + 2 * i * t * n + t * t * r }, getQuadraticCurvePoint: function (t, e, n, r, i, s, a) { return { x: o._getQBezierValue(a, t, n, i), y: o._getQBezierValue(a, e, r, s) } }, easeOutQuad: function (t, e, n, r) { return t /= r, -n * t * (t - 2) + e }, copyAction: function (t, e) { return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t }, is: t("./is"), extend: r, hypot: t("./hypot"), getOriginXY: t("./getOriginXY") }; r(o, t("./arr")), r(o, t("./domUtils")), r(o, t("./pointerUtils")), r(o, t("./rect")), e.exports = o }, { "./arr": 35, "./domUtils": 39, "./extend": 41, "./getOriginXY": 42, "./hypot": 43, "./is": 46, "./pointerUtils": 49, "./rect": 51, "./window": 52 }], 45: [function (t, e, n) { "use strict"; var r = t("../scope"), i = t("./index"), o = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function (t, e, n) { for (var r = i.getPointerType(t), s = i.getPointerId(t), a = { pointer: t, pointerId: s, pointerType: r, eventType: e, eventTarget: n }, c = 0; c < o.methodOrder.length; c++) { var l; l = o.methodOrder[c]; var p = l, u = o[p](a); if (u) return u } }, simulationResume: function (t) { var e = t.pointerType, n = t.eventType, o = t.eventTarget; if (!/down|start/i.test(n)) return null; for (var s = 0; s < r.interactions.length; s++) { var a; a = r.interactions[s]; var c = a, l = o; if (c.simulation && c.simulation.allowResume && c.pointerType === e) for (; l;) { if (l === c.element) return c; l = i.parentNode(l) } } return null }, mouseOrPen: function (t) { var e = t.pointerId, n = t.pointerType, o = t.eventType; if ("mouse" !== n && "pen" !== n) return null; for (var s = void 0, a = 0; a < r.interactions.length; a++) { var c; c = r.interactions[a]; var l = c; if (l.pointerType === n) { if (l.simulation && !i.contains(l.pointerIds, e)) continue; if (l.interacting()) return l; s || (s = l) } } if (s) return s; for (var p = 0; p < r.interactions.length; p++) { var u; u = r.interactions[p]; var d = u; if (!(d.pointerType !== n || /down/i.test(o) && d.simulation)) return d } return null }, hasPointer: function (t) { for (var e = t.pointerId, n = 0; n < r.interactions.length; n++) { var o; o = r.interactions[n]; var s = o; if (i.contains(s.pointerIds, e)) return s } }, idle: function (t) { for (var e = t.pointerType, n = 0; n < r.interactions.length; n++) { var i; i = r.interactions[n]; var o = i; if (1 === o.pointerIds.length) { var s = o.target; if (s && !s.options.gesture.enabled) continue } else if (o.pointerIds.length >= 2) continue; if (!o.interacting() && e === o.pointerType) return o } return null } }; e.exports = o }, { "../scope": 33, "./index": 44 }], 46: [function (t, e, n) { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, i = t("./window"), o = t("./isWindow"), s = { array: function () { }, window: function (t) { return t === i.window || o(t) }, docFrag: function (t) { return s.object(t) && 11 === t.nodeType }, object: function (t) { return !!t && "object" === (void 0 === t ? "undefined" : r(t)) }, function: function (t) { return "function" == typeof t }, number: function (t) { return "number" == typeof t }, bool: function (t) { return "boolean" == typeof t }, string: function (t) { return "string" == typeof t }, element: function (t) { if (!t || "object" !== (void 0 === t ? "undefined" : r(t))) return !1; var e = i.getWindow(t) || i.window; return /object|function/.test(r(e.Element)) ? t instanceof e.Element : 1 === t.nodeType && "string" == typeof t.nodeName }, plainObject: function (t) { return s.object(t) && "Object" === t.constructor.name } }; s.array = function (t) { return s.object(t) && void 0 !== t.length && s.function(t.splice) }, e.exports = s }, { "./isWindow": 47, "./window": 52 }], 47: [function (t, e, n) { "use strict"; e.exports = function (t) { return !(!t || !t.Window) && t instanceof t.Window } }, {}], 48: [function (t, e, n) { "use strict"; function r(t, n) { for (var r in n) { var i = e.exports.prefixedPropREs, o = !1; for (var s in i) if (0 === r.indexOf(s) && i[s].test(r)) { o = !0; break } o || "function" == typeof n[r] || (t[r] = n[r]) } return t } r.prefixedPropREs = { webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/ }, e.exports = r }, {}], 49: [function (t, e, n) { "use strict"; var r = t("./hypot"), i = t("./browser"), o = t("./domObjects"), s = t("./domUtils"), a = t("./domObjects"), c = t("./is"), l = t("./pointerExtend"), p = { copyCoords: function (t, e) { t.page = t.page || {}, t.page.x = e.page.x, t.page.y = e.page.y, t.client = t.client || {}, t.client.x = e.client.x, t.client.y = e.client.y, t.timeStamp = e.timeStamp }, setCoordDeltas: function (t, e, n) { t.page.x = n.page.x - e.page.x, t.page.y = n.page.y - e.page.y, t.client.x = n.client.x - e.client.x, t.client.y = n.client.y - e.client.y, t.timeStamp = n.timeStamp - e.timeStamp; var i = Math.max(t.timeStamp / 1e3, .001); t.page.speed = r(t.page.x, t.page.y) / i, t.page.vx = t.page.x / i, t.page.vy = t.page.y / i, t.client.speed = r(t.client.x, t.page.y) / i, t.client.vx = t.client.x / i, t.client.vy = t.client.y / i }, isNativePointer: function (t) { return t instanceof o.Event || t instanceof o.Touch }, getXY: function (t, e, n) { return n = n || {}, t = t || "page", n.x = e[t + "X"], n.y = e[t + "Y"], n }, getPageXY: function (t, e) { return e = e || {}, i.isOperaMobile && p.isNativePointer(t) ? (p.getXY("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : p.getXY("page", t, e), e }, getClientXY: function (t, e) { return e = e || {}, i.isOperaMobile && p.isNativePointer(t) ? p.getXY("screen", t, e) : p.getXY("client", t, e), e }, getPointerId: function (t) { return c.number(t.pointerId) ? t.pointerId : t.identifier }, setCoords: function (t, e, n) { var r = e.length > 1 ? p.pointerAverage(e) : e[0], i = {}; p.getPageXY(r, i), t.page.x = i.x, t.page.y = i.y, p.getClientXY(r, i), t.client.x = i.x, t.client.y = i.y, t.timeStamp = c.number(n) ? n : (new Date).getTime() }, pointerExtend: l, getTouchPair: function (t) { var e = []; return c.array(t) ? (e[0] = t[0], e[1] = t[1]) : "touchend" === t.type ? 1 === t.touches.length ? (e[0] = t.touches[0], e[1] = t.changedTouches[0]) : 0 === t.touches.length && (e[0] = t.changedTouches[0], e[1] = t.changedTouches[1]) : (e[0] = t.touches[0], e[1] = t.touches[1]), e }, pointerAverage: function (t) { for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) { var r; r = t[n]; var i = r; for (var o in e) e[o] += i[o] } for (var s in e) e[s] /= t.length; return e }, touchBBox: function (t) { if (t.length || t.touches && t.touches.length > 1) { var e = p.getTouchPair(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY); return { x: n, y: r, left: n, top: r, width: Math.max(e[0].pageX, e[1].pageX) - n, height: Math.max(e[0].pageY, e[1].pageY) - r } } }, touchDistance: function (t, e) { var n = e + "X", i = e + "Y", o = p.getTouchPair(t), s = o[0][n] - o[1][n], a = o[0][i] - o[1][i]; return r(s, a) }, touchAngle: function (t, e, n) { var r = n + "X", i = n + "Y", o = p.getTouchPair(t), s = o[1][r] - o[0][r], a = o[1][i] - o[0][i]; return 180 * Math.atan2(a, s) / Math.PI }, getPointerType: function (t) { return c.string(t.pointerType) ? t.pointerType : c.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type) || t instanceof a.Touch ? "touch" : "mouse" }, getEventTargets: function (t) { var e = c.function(t.composedPath) ? t.composedPath() : t.path; return [s.getActualElement(e ? e[0] : t.target), s.getActualElement(t.currentTarget)] } }; e.exports = p }, { "./browser": 36, "./domObjects": 38, "./domUtils": 39, "./hypot": 43, "./is": 46, "./pointerExtend": 48 }], 50: [function (t, e, n) { "use strict"; for (var r = t("./window"), i = r.window, o = ["ms", "moz", "webkit", "o"], s = 0, a = void 0, c = void 0, l = 0; l < o.length && !i.requestAnimationFrame; l++)a = i[o[l] + "RequestAnimationFrame"], c = i[o[l] + "CancelAnimationFrame"] || i[o[l] + "CancelRequestAnimationFrame"]; a || (a = function (t) { var e = (new Date).getTime(), n = Math.max(0, 16 - (e - s)), r = setTimeout(function () { t(e + n) }, n); return s = e + n, r }), c || (c = function (t) { clearTimeout(t) }), e.exports = { request: a, cancel: c } }, { "./window": 52 }], 51: [function (t, e, n) { "use strict"; var r = t("./extend"), i = t("./is"), o = t("./domUtils"), s = o.closest, a = o.parentNode, c = o.getElementRect, l = { getStringOptionResult: function (t, e, n) { return i.string(t) ? t = "parent" === t ? a(n) : "self" === t ? e.getRect(n) : s(n, t) : null }, resolveRectLike: function (t, e, n, r) { return t = l.getStringOptionResult(t, e, n) || t, i.function(t) && (t = t.apply(null, r)), i.element(t) && (t = c(t)), t }, rectToXY: function (t) { return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top } }, xywhToTlbr: function (t) { return !t || "left" in t && "top" in t || (t = r({}, t), t.left = t.x || 0, t.top = t.y || 0, t.right = t.right || t.left + t.width, t.bottom = t.bottom || t.top + t.height), t }, tlbrToXywh: function (t) { return !t || "x" in t && "y" in t || (t = r({}, t), t.x = t.left || 0, t.top = t.top || 0, t.width = t.width || t.right - t.x, t.height = t.height || t.bottom - t.y), t } }; e.exports = l }, { "./domUtils": 39, "./extend": 41, "./is": 46 }], 52: [function (t, e, n) { "use strict"; function r(t) { i.realWindow = t; var e = t.document.createTextNode(""); e.ownerDocument !== t.document && "function" == typeof t.wrap && t.wrap(e) === e && (t = t.wrap(t)), i.window = t } var i = e.exports, o = t("./isWindow"); "undefined" == typeof window ? (i.window = void 0, i.realWindow = void 0) : r(window), i.getWindow = function (t) { if (o(t)) return t; var e = t.ownerDocument || t; return e.defaultView || e.parentWindow || i.window }, i.init = r }, { "./isWindow": 47 }]
    }, {}, [1])(1)
});

//# sourceMappingURL=interact.min.js.map;
ko.wrapObservable = function (object, wrapParent, wrapChildren) {
    if (typeof wrapParent === "undefined") wrapParent = true;
    if (typeof wrapChildren === "undefined") wrapChildren = true;    

    var makeChildrenObservables = function (object, isParent) {

        if (!isParent && !ko.isObservable(object)) return;

        var unwrappedObject = typeof (object) === "function" ? object() : object;

        // Loop through its children
        for (var child in unwrappedObject) {
            if (unwrappedObject.hasOwnProperty(child) && !ko.isObservable(unwrappedObject[child])) {
                unwrappedObject[child] = ko.observable(unwrappedObject[child]);
            }
            makeChildrenObservables(unwrappedObject[child], false);
        }

        return object;
    };

    var observable = object;

    if (wrapChildren) {
        observable = makeChildrenObservables(object, true);
    }

    if (wrapParent && !ko.isObservable(observable)) {
        observable = ko.observable(observable);
    }


	return observable;
};
(function(w,d,s,r,k,h,m){
if(w.performance && w.performance.timing && w.performance.navigation) {
            w[r] = w[r] || function () { (w[r].q = w[r].q || []).push(arguments) }
;
        h=d.createElement('script');h.async=true;h.setAttribute('src',s+k);
        d.getElementsByTagName('head')[0].appendChild(h);
        (m = window.onerror),(window.onerror = function (b, c, d, f, g)

        {m && m(b, c, d, f, g), g || (g = new Error(b)), (w[r].q = w[r].q || []).push(["captureException", g]);}
        )
}
})(window,document,'//static.site24x7rum.com/beacon/site24x7rum-min.js?appKey=','s247r','7eb31aeb6026456d77428b25b5693ff4');
;
