!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(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)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&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(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k});"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],i=1;i<=3;i++){if(+n[i]>+o[i])return 1;if(+n[i]<+o[i])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.1.0",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var r={};function u(e){var t=n.console;r[e]||(r[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n),r},set:function(e){u(n),r=e}})}function o(e,t,r,n){e[t]=function(){return u(n),r.apply(this,arguments)}}s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){r={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("jQuery is not compatible with Quirks Mode");var i,a=s.fn.init,c=s.isNumeric,d=s.find,l=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,p=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g;for(i in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(u("jQuery( '#' ) is not a valid selector"),t[0]=[]),a.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&l.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(p,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("Attribute selector with '#' was not fixed: "+r[0])}}return d.apply(this,r)},d)Object.prototype.hasOwnProperty.call(d,i)&&(s.find[i]=d[i]);s.fn.size=function(){return u("jQuery.fn.size() is deprecated and removed; use the .length property"),this.length},s.parseJSON=function(){return u("jQuery.parseJSON is deprecated; use JSON.parse"),JSON.parse.apply(null,arguments)},s.isNumeric=function(e){var t,r,n=c(e),o=(r=(t=e)&&t.toString(),!s.isArray(t)&&0<=r-parseFloat(r)+1);return n!==o&&u("jQuery.isNumeric() should not be called on constructed objects"),o},e("3.3.0")&&o(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated"),o(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),o(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.2.0")&&o(s,"nodeName",s.nodeName,"jQuery.nodeName is deprecated");var f=s.ajax;s.ajax=function(){var e=f.apply(this,arguments);return e.promise&&(o(e,"success",e.done,"jQXHR.success is deprecated and removed"),o(e,"error",e.fail,"jQXHR.error is deprecated and removed"),o(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e};var y=s.fn.removeAttr,m=s.fn.toggleClass,h=/\S+/g;s.fn.removeAttr=function(e){var r=this;return s.each(e.match(h),function(e,t){s.expr.match.bool.test(t)&&(u("jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),y.apply(this,arguments)};var g=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?m.apply(this,arguments):(u("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":s.data(this,"__className__")||"")}))});s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return g=!0,e=r.apply(this,arguments),g=!1,e})}),s.swap=function(e,t,r,n){var o,i,a={};for(i in g||u("jQuery.swap() is undocumented and deprecated"),t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=r.apply(e,n||[]),t)e.style[i]=a[i];return o};var v=s.data;s.data=function(e,t,r){var n;if(t&&"object"==typeof t&&2===arguments.length){n=s.hasData(e)&&v.call(this,e);var o={};for(var i in t)i!==s.camelCase(i)?(u("jQuery.data() always sets/gets camelCased names: "+i),n[i]=t[i]):o[i]=t[i];return v.call(this,e,o),t}return t&&"string"==typeof t&&t!==s.camelCase(t)&&(n=s.hasData(e)&&v.call(this,e))&&t in n?(u("jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):v.apply(this,arguments)};function j(e){return e}var Q=s.Tween.prototype.run;s.Tween.prototype.run=function(){1<s.easing[this.easing].length&&(u("'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=j),Q.apply(this,arguments)};var w=s.fx.interval||13,b="jQuery.fx.interval is deprecated";n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u(b),w},set:function(e){u(b),w=e}});var x=s.fn.load,k=s.event.add,A=s.event.fix;s.event.props=[],s.event.fixHooks={},t(s.event.props,"concat",s.event.props.concat,"jQuery.event.props.concat() is deprecated and removed"),s.event.fix=function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=A.call(this,e),n&&n.filter?n.filter(t,e):t},s.event.add=function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("jQuery(window).on('load'...) called after load event occurred"),k.apply(this,arguments)},s.each(["load","unload","error"],function(e,t){s.fn[t]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?x.apply(this,e):(u("jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),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,r){s.fn[r]=function(e,t){return u("jQuery.fn."+r+"() event shorthand is deprecated"),0<arguments.length?this.on(r,null,e,t):this.trigger(r)}}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("'ready' event is deprecated")}},s.fn.extend({bind:function(e,t,r){return u("jQuery.fn.bind() is deprecated"),this.on(e,null,t,r)},unbind:function(e,t){return u("jQuery.fn.unbind() is deprecated"),this.off(e,null,t)},delegate:function(e,t,r,n){return u("jQuery.fn.delegate() is deprecated"),this.on(t,e,r,n)},undelegate:function(e,t,r){return u("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},hover:function(e,t){return u("jQuery.fn.hover() is deprecated"),this.on("mouseenter",e).on("mouseleave",t||e)}});var S=s.fn.offset;s.fn.offset=function(){var e,t=this[0],r={top:0,left:0};return t&&t.nodeType?(e=(t.ownerDocument||n.document).documentElement,s.contains(e,t)?S.apply(this,arguments):(u("jQuery.fn.offset() requires an element connected to a document"),r)):(u("jQuery.fn.offset() requires a valid DOM element"),r)};var q=s.param;s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),q.call(this,e,t)};var C=s.fn.andSelf||s.fn.addBack;s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),C.apply(this,arguments)};var M=s.Deferred,R=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]];return s.Deferred=function(e){var i=M(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(R,function(e,t){var r=s.isFunction(o[e])&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&s.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=M.exceptionHook,s});Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,p=function(s,l){if(!l){l=2;}
return("000"+s).slice(l*-1);};$P.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};$P.setTimeToNow=function(){var n=new Date();this.setHours(n.getHours());this.setMinutes(n.getMinutes());this.setSeconds(n.getSeconds());this.setMilliseconds(n.getMilliseconds());return this;};$D.today=function(){return new Date().clearTime();};$D.compare=function(date1,date2){if(isNaN(date1)||isNaN(date2)){throw new Error(date1+" - "+date2);}else if(date1 instanceof Date&&date2 instanceof Date){return(date1<date2)?-1:(date1>date2)?1:0;}else{throw new TypeError(date1+" - "+date2);}};$D.equals=function(date1,date2){return(date1.compareTo(date2)===0);};$D.getDayNumberFromName=function(name){var n=$C.dayNames,m=$C.abbreviatedDayNames,o=$C.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s||o[i].toLowerCase()==s){return i;}}
return-1;};$D.getMonthNumberFromName=function(name){var n=$C.monthNames,m=$C.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};$D.isLeapYear=function(year){return((year%4===0&&year%100!==0)||year%400===0);};$D.getDaysInMonth=function(year,month){return[31,($D.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};$D.getTimezoneAbbreviation=function(offset){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].offset===offset){return z[i].name;}}
return null;};$D.getTimezoneOffset=function(name){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].name===name.toUpperCase()){return z[i].offset;}}
return null;};$P.clone=function(){return new Date(this.getTime());};$P.compareTo=function(date){return Date.compare(this,date);};$P.equals=function(date){return Date.equals(this,date||new Date());};$P.between=function(start,end){return this.getTime()>=start.getTime()&&this.getTime()<=end.getTime();};$P.isAfter=function(date){return this.compareTo(date||new Date())===1;};$P.isBefore=function(date){return(this.compareTo(date||new Date())===-1);};$P.isToday=function(){return this.isSameDay(new Date());};$P.isSameDay=function(date){return this.clone().clearTime().equals(date.clone().clearTime());};$P.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};$P.addSeconds=function(value){return this.addMilliseconds(value*1000);};$P.addMinutes=function(value){return this.addMilliseconds(value*60000);};$P.addHours=function(value){return this.addMilliseconds(value*3600000);};$P.addDays=function(value){this.setDate(this.getDate()+value);return this;};$P.addWeeks=function(value){return this.addDays(value*7);};$P.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,$D.getDaysInMonth(this.getFullYear(),this.getMonth())));return this;};$P.addYears=function(value){return this.addMonths(value*12);};$P.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
var x=config;if(x.milliseconds){this.addMilliseconds(x.milliseconds);}
if(x.seconds){this.addSeconds(x.seconds);}
if(x.minutes){this.addMinutes(x.minutes);}
if(x.hours){this.addHours(x.hours);}
if(x.weeks){this.addWeeks(x.weeks);}
if(x.months){this.addMonths(x.months);}
if(x.years){this.addYears(x.years);}
if(x.days){this.addDays(x.days);}
return this;};var $y,$m,$d;$P.getWeek=function(){var a,b,c,d,e,f,g,n,s,w;$y=(!$y)?this.getFullYear():$y;$m=(!$m)?this.getMonth()+1:$m;$d=(!$d)?this.getDate():$d;if($m<=2){a=$y-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=0;f=$d-1+(31*($m-1));}else{a=$y;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=s+1;f=$d+((153*($m-3)+2)/5)+58+s;}
g=(a+b)%7;d=(f+g-e)%7;n=(f+3-d)|0;if(n<0){w=53-((g-s)/5|0);}else if(n>364+s){w=1;}else{w=(n/7|0)+1;}
$y=$m=$d=null;return w;};$P.getISOWeek=function(){$y=this.getUTCFullYear();$m=this.getUTCMonth()+1;$d=this.getUTCDate();return p(this.getWeek());};$P.setWeek=function(n){return this.moveToDayOfWeek(1).addWeeks(n-this.getWeek());};$D._validate=function(n,min,max,name){if(typeof n=="undefined"){return false;}else if(typeof n!="number"){throw new TypeError(n+" is not a Number.");}else if(n<min||n>max){throw new RangeError(n+" is not a valid value for "+name+".");}
return true;};$D.validateMillisecond=function(value){return $D._validate(value,0,999,"millisecond");};$D.validateSecond=function(value){return $D._validate(value,0,59,"second");};$D.validateMinute=function(value){return $D._validate(value,0,59,"minute");};$D.validateHour=function(value){return $D._validate(value,0,23,"hour");};$D.validateDay=function(value,year,month){return $D._validate(value,1,$D.getDaysInMonth(year,month),"day");};$D.validateMonth=function(value){return $D._validate(value,0,11,"month");};$D.validateYear=function(value){return $D._validate(value,0,9999,"year");};$P.set=function(config){if($D.validateMillisecond(config.millisecond)){this.addMilliseconds(config.millisecond-this.getMilliseconds());}
if($D.validateSecond(config.second)){this.addSeconds(config.second-this.getSeconds());}
if($D.validateMinute(config.minute)){this.addMinutes(config.minute-this.getMinutes());}
if($D.validateHour(config.hour)){this.addHours(config.hour-this.getHours());}
if($D.validateMonth(config.month)){this.addMonths(config.month-this.getMonth());}
if($D.validateYear(config.year)){this.addYears(config.year-this.getFullYear());}
if($D.validateDay(config.day,this.getFullYear(),this.getMonth())){this.addDays(config.day-this.getDate());}
if(config.timezone){this.setTimezone(config.timezone);}
if(config.timezoneOffset){this.setTimezoneOffset(config.timezoneOffset);}
if(config.week&&$D._validate(config.week,0,53,"week")){this.setWeek(config.week);}
return this;};$P.moveToFirstDayOfMonth=function(){return this.set({day:1});};$P.moveToLastDayOfMonth=function(){return this.set({day:$D.getDaysInMonth(this.getFullYear(),this.getMonth())});};$P.moveToNthOccurrence=function(dayOfWeek,occurrence){var shift=0;if(occurrence>0){shift=occurrence-1;}
else if(occurrence===-1){this.moveToLastDayOfMonth();if(this.getDay()!==dayOfWeek){this.moveToDayOfWeek(dayOfWeek,-1);}
return this;}
return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek,+1).addWeeks(shift);};$P.moveToDayOfWeek=function(dayOfWeek,orient){var diff=(dayOfWeek-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};$P.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};$P.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1;};$P.getTimezone=function(){return $D.getTimezoneAbbreviation(this.getUTCOffset());};$P.setTimezoneOffset=function(offset){var here=this.getTimezoneOffset(),there=Number(offset)*-6/10;return this.addMinutes(there-here);};$P.setTimezone=function(offset){return this.setTimezoneOffset($D.getTimezoneOffset(offset));};$P.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.isDaylightSavingTime=function(){return(this.hasDaylightSavingTime()&&new Date().getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r.charAt(0)+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};$P.getElapsed=function(date){return(date||new Date())-this;};if(!$P.toISOString){$P.toISOString=function(){function f(n){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"';};}
$P._toString=$P.toString;$P.toString=function(format){var x=this;if(format&&format.length==1){var c=$C.formatPatterns;x.t=x.toString;switch(format){case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth);}}
var ord=function(n){switch(n*1){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};return format?format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(m){if(m.charAt(0)==="\\"){return m.replace("\\","");}
x.h=x.getHours;switch(m){case"hh":return p(x.h()<13?(x.h()===0?12:x.h()):(x.h()-12));case"h":return x.h()<13?(x.h()===0?12:x.h()):(x.h()-12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(),4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth()+1));case"M":return x.getMonth()+1;case"t":return x.h()<12?$C.amDesignator.substring(0,1):$C.pmDesignator.substring(0,1);case"tt":return x.h()<12?$C.amDesignator:$C.pmDesignator;case"S":return ord(x.getDate());default:return m;}}):this._toString();};}());(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$N=Number.prototype;$P._orient=+1;$P._nth=null;$P._is=false;$P._same=false;$P._isSecond=false;$N._dateElement="day";$P.next=function(){this._orient=+1;return this;};$D.next=function(){return $D.today().next();};$P.last=$P.prev=$P.previous=function(){this._orient=-1;return this;};$D.last=$D.prev=$D.previous=function(){return $D.today().last();};$P.is=function(){this._is=true;return this;};$P.same=function(){this._same=true;this._isSecond=false;return this;};$P.today=function(){return this.same().day();};$P.weekday=function(){if(this._is){this._is=false;return(!this.is().sat()&&!this.is().sun());}
return false;};$P.at=function(time){return(typeof time==="string")?$D.parse(this.toString("d")+" "+time):this.set(time);};$N.fromNow=$N.after=function(date){var c={};c[this._dateElement]=this;return((!date)?new Date():date.clone()).add(c);};$N.ago=$N.before=function(date){var c={};c[this._dateElement]=this*-1;return((!date)?new Date():date.clone()).add(c);};var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),pxf=("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),nth=("final first second third fourth fifth").split(/\s/),de;$P.toObject=function(){var o={};for(var i=0;i<px.length;i++){o[px[i].toLowerCase()]=this["get"+pxf[i]]();}
return o;};$D.fromObject=function(config){config.week=null;return Date.today().set(config);};var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1);}
this._isSecond=false;var ntemp=this._nth;this._nth=null;var temp=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(n,ntemp);if(this>temp){throw new RangeError($D.getDayName(n)+" does not occur "+ntemp+" times in the month of "+$D.getMonthName(temp.getMonth())+" "+temp.getFullYear()+".");}
return this;}
return this.moveToDayOfWeek(n,this._orient);};};var sdf=function(n){return function(){var t=$D.today(),shift=n-t.getDay();if(n===0&&$C.firstDayOfWeek===1&&t.getDay()!==0){shift=shift+7;}
return t.addDays(shift);};};for(var i=0;i<dx.length;i++){$D[dx[i].toUpperCase()]=$D[dx[i].toUpperCase().substring(0,3)]=i;$D[dx[i]]=$D[dx[i].substring(0,3)]=sdf(i);$P[dx[i]]=$P[dx[i].substring(0,3)]=df(i);}
var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
return this.moveToMonth(n,this._orient);};};var smf=function(n){return function(){return $D.today().set({month:n,day:1});};};for(var j=0;j<mx.length;j++){$D[mx[j].toUpperCase()]=$D[mx[j].toUpperCase().substring(0,3)]=j;$D[mx[j]]=$D[mx[j].substring(0,3)]=smf(j);$P[mx[j]]=$P[mx[j].substring(0,3)]=mf(j);}
var ef=function(j){return function(){if(this._isSecond){this._isSecond=false;return this;}
if(this._same){this._same=this._is=false;var o1=this.toObject(),o2=(arguments[0]||new Date()).toObject(),v="",k=j.toLowerCase();for(var m=(px.length-1);m>-1;m--){v=px[m].toLowerCase();if(o1[v]!=o2[v]){return false;}
if(k==v){break;}}
return true;}
if(j.substring(j.length-1)!="s"){j+="s";}
return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$P[de]=$P[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}
$P._ss=ef("Second");var nthfn=function(n){return function(dayOfWeek){if(this._same){return this._ss(arguments[0]);}
if(dayOfWeek||dayOfWeek===0){return this.moveToNthOccurrence(dayOfWeek,n);}
this._nth=n;if(n===2&&(dayOfWeek===undefined||dayOfWeek===null)){this._isSecond=true;return this.addSeconds(this._orient);}
return this;};};for(var l=0;l<nth.length;l++){$P[nth[l]]=(l===0)?nthfn(-1):nthfn(l);}}());(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
break;}
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
rx.push(r[0]);s=r[1];}
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){r=null;}
if(r){return r;}}
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
rx.push(r[0]);s=r[1];}
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
s=q[1];}
if(!r){throw new $P.Exception(s);}
if(q){throw new $P.Exception(q[1]);}
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
if(!last&&q[1].length===0){last=true;}
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
if(rx[1].length<best[1].length){best=rx;}
if(best[1].length===0){break;}}
if(best[0].length===0){return best;}
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
best[1]=q[1];}
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo;var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
return rx;};$D.Grammar={};$D.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=(s.length==3)?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s)/4:Number(s)-1;};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<$C.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
var now=new Date();if((this.hour||this.minute)&&(!this.month&&!this.year&&!this.day)){this.day=now.getDate();}
if(!this.year){this.year=now.getFullYear();}
if(!this.month&&this.month!==0){this.month=now.getMonth();}
if(!this.day){this.day=1;}
if(!this.hour){this.hour=0;}
if(!this.minute){this.minute=0;}
if(!this.second){this.second=0;}
if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
if(this.day>$D.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
var today=$D.today();if(this.now&&!this.unit&&!this.operator){return new Date();}else if(this.now){today=new Date();}
var expression=!!(this.days&&this.days!==null||this.orient||this.operator);var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(!this.now&&"hour minute second".indexOf(this.unit)!=-1){today.setTimeToNow();}
if(this.month||this.month===0){if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;expression=true;}}
if(!expression&&this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(!this.month){this.month=temp.getMonth();}
this.year=temp.getFullYear();}
if(expression&&this.weekday&&this.unit!="month"){this.unit="day";gap=($D.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
if(this.month&&this.unit=="day"&&this.operator){this.value=(this.month+1);this.month=null;}
if(this.value!=null&&this.month!=null&&this.year!=null){this.day=this.value*1;}
if(this.month&&!this.day&&this.value){today.set({day:this.value*1});if(!expression){this.day=this.value*1;}}
if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;expression=true;}
if(expression&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
if(!this.unit){this.unit="day";}
if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+((this.operator=="add")?1:-1)+(this.value||0)*orient;}else if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
this[this.unit+"s"]=this.value*orient;}
if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
if(this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(temp.getMonth()!==today.getMonth()){this.month=temp.getMonth();}}
if((this.month||this.month===0)&&!this.day){this.day=1;}
if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month){return Date.today().setWeek(this.value);}
if(expression&&this.timezone&&this.day&&this.days){this.day=this.days;}
return(expression)?today.add(this):today.set(this);}};var _=$D.Parsing.Operators,g=$D.Grammar,t=$D.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|@|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=$C.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
fn=_C[keys]=_.any.apply(null,px);}
return fn;};g.ctoken2=function(key){return _.rtoken($C.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.m,g.s],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("second minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[$C.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw $D.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"","yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
return g._start.call({},s);};$D._parse=$D.parse;$D.parse=function(s){var r=null;if(!s){return null;}
if(s instanceof Date){return s;}
try{r=$D.Grammar.start.call({},s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"));}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};$D.getParseFunction=function(fx){var fn=$D.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};};$D.parseExact=function(s,fx){return $D.getParseFunction(fx)(s);};}());var TimeSpan=function(days,hours,minutes,seconds,milliseconds){var attrs="days hours minutes seconds milliseconds".split(/\s+/);var gFn=function(attr){return function(){return this[attr];};};var sFn=function(attr){return function(val){this[attr]=val;return this;};};for(var i=0;i<attrs.length;i++){var $a=attrs[i],$b=$a.slice(0,1).toUpperCase()+$a.slice(1);TimeSpan.prototype[$a]=0;TimeSpan.prototype["get"+$b]=gFn($a);TimeSpan.prototype["set"+$b]=sFn($a);}
if(arguments.length==4){this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds);}else if(arguments.length==5){this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds);this.setMilliseconds(milliseconds);}else if(arguments.length==1&&typeof days=="number"){var orient=(days<0)?-1:+1;this.setMilliseconds(Math.abs(days));this.setDays(Math.floor(this.getMilliseconds()/86400000)*orient);this.setMilliseconds(this.getMilliseconds()%86400000);this.setHours(Math.floor(this.getMilliseconds()/3600000)*orient);this.setMilliseconds(this.getMilliseconds()%3600000);this.setMinutes(Math.floor(this.getMilliseconds()/60000)*orient);this.setMilliseconds(this.getMilliseconds()%60000);this.setSeconds(Math.floor(this.getMilliseconds()/1000)*orient);this.setMilliseconds(this.getMilliseconds()%1000);this.setMilliseconds(this.getMilliseconds()*orient);}
this.getTotalMilliseconds=function(){return(this.getDays()*86400000)+(this.getHours()*3600000)+(this.getMinutes()*60000)+(this.getSeconds()*1000);};this.compareTo=function(time){var t1=new Date(1970,1,1,this.getHours(),this.getMinutes(),this.getSeconds()),t2;if(time===null){t2=new Date(1970,1,1,0,0,0);}
else{t2=new Date(1970,1,1,time.getHours(),time.getMinutes(),time.getSeconds());}
return(t1<t2)?-1:(t1>t2)?1:0;};this.equals=function(time){return(this.compareTo(time)===0);};this.add=function(time){return(time===null)?this:this.addSeconds(time.getTotalMilliseconds()/1000);};this.subtract=function(time){return(time===null)?this:this.addSeconds(-time.getTotalMilliseconds()/1000);};this.addDays=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*86400000));};this.addHours=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*3600000));};this.addMinutes=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*60000));};this.addSeconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*1000));};this.addMilliseconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+n);};this.get12HourHour=function(){return(this.getHours()>12)?this.getHours()-12:(this.getHours()===0)?12:this.getHours();};this.getDesignator=function(){return(this.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;};this.toString=function(format){this._toString=function(){if(this.getDays()!==null&&this.getDays()>0){return this.getDays()+"."+this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds());}
else{return this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds());}};this.p=function(s){return(s.toString().length<2)?"0"+s:s;};var me=this;return format?format.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(format){switch(format){case"d":return me.getDays();case"dd":return me.p(me.getDays());case"H":return me.getHours();case"HH":return me.p(me.getHours());case"h":return me.get12HourHour();case"hh":return me.p(me.get12HourHour());case"m":return me.getMinutes();case"mm":return me.p(me.getMinutes());case"s":return me.getSeconds();case"ss":return me.p(me.getSeconds());case"t":return((me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;}}):this._toString();};return this;};Date.prototype.getTimeOfDay=function(){return new TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());};var TimePeriod=function(years,months,days,hours,minutes,seconds,milliseconds){var attrs="years months days hours minutes seconds milliseconds".split(/\s+/);var gFn=function(attr){return function(){return this[attr];};};var sFn=function(attr){return function(val){this[attr]=val;return this;};};for(var i=0;i<attrs.length;i++){var $a=attrs[i],$b=$a.slice(0,1).toUpperCase()+$a.slice(1);TimePeriod.prototype[$a]=0;TimePeriod.prototype["get"+$b]=gFn($a);TimePeriod.prototype["set"+$b]=sFn($a);}
if(arguments.length==7){this.years=years;this.months=months;this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds);this.setMilliseconds(milliseconds);}else if(arguments.length==2&&arguments[0]instanceof Date&&arguments[1]instanceof Date){var d1=years.clone();var d2=months.clone();var temp=d1.clone();var orient=(d1>d2)?-1:+1;this.years=d2.getFullYear()-d1.getFullYear();temp.addYears(this.years);if(orient==+1){if(temp>d2){if(this.years!==0){this.years--;}}}else{if(temp<d2){if(this.years!==0){this.years++;}}}
d1.addYears(this.years);if(orient==+1){while(d1<d2&&d1.clone().addDays(Date.getDaysInMonth(d1.getYear(),d1.getMonth()))<d2){d1.addMonths(1);this.months++;}}
else{while(d1>d2&&d1.clone().addDays(-d1.getDaysInMonth())>d2){d1.addMonths(-1);this.months--;}}
var diff=d2-d1;if(diff!==0){var ts=new TimeSpan(diff);this.setDays(ts.getDays());this.setHours(ts.getHours());this.setMinutes(ts.getMinutes());this.setSeconds(ts.getSeconds());this.setMilliseconds(ts.getMilliseconds());}}
return this;};var response_commands={};var commands={};var parser_prototype={_initializeOn:'mouseover',command:null,nodeElement:null,element:null,nodeId:null,_initBase:function(){this.messages={};this.urls={};},setMsg:function(key,msg){this.messages[key]=msg;},setUrl:function(key,url){this.urls[key]=url;},init:function(){return;},isAttrBased:function(){var attr=this.element.attr('data-status');return typeof attr!=='undefined'&&attr!==false;},getStatus:function(){if(this.isAttrBased()){return this.element.attr("data-status");}
return this.element.hasClass('on')?'on':'off';},setStatus:function(status){if(this.isAttrBased()){this.element.attr("data-status",status);return;}
status=='on'?this.element.addClass('on'):this.element.removeClass('on');},switchStatus:function(){this.setStatus(this.getStatus()=="on"?'off':'on');},getUrlSkeleton:function(name){return this.urls[name]!=undefined?this.urls[name]:false;},getParsedUrl:function(name){var urlSkeleton=this.getUrlSkeleton(name);if(urlSkeleton){return urlSkeleton.replace(new RegExp('%25ID%25','g'),this.nodeId);}
return null;},getUrl:function(){var url=this.getParsedUrl('click.'+this.getStatus());if(!url){url=this.getParsedUrl('click');}
if(!url){url=this.getParsedUrl('click.off');}
if(url){return url;}
url=this.element.attr('href');return url?url:false;},getMessage:function(name){return this.messages[name]!=undefined?this.messages[name]:null;},getTitle:function(){var title=this.getMessage('title.'+this.getStatus());if(title==null){title=this.getMessage('title');}
return title;},getLinkText:function(){var text=this.getMessage('linkText.'+this.getStatus());if(text==null){text=this.getMessage('linkText');}
return text;},updateTitle:function(){var title=this.getTitle();if(title!=null){this.element.attr('title',title);}},updateLinkText:function(){var text=this.getLinkText();if(text!=null){this.element.html(text);}},executeRequest:function(data,evt){var thiz=this;try{var rUrl=this.getUrl();if(thiz.element.attr('data-process')=='process')return;if(rUrl){var parser=this;var response_type=this.getResponseType().toLowerCase();var opts={url:rUrl,cache:false,beforeSend:function(){thiz.element.attr('data-process','process');},success:function(data){thiz.element.attr('data-process','no');parser.onSuccess(data,evt);parser.onCompleted(true,evt);},error:function(request,status,error){thiz.element.attr('data-process','no');var data=request.responseText;if(response_type=='json'){try{data=$.parseJSON(data);}catch(e){console.log(e);}}
parser.onFailure(data,request.status,status,evt);parser.onCompleted(false,evt);},type:this.getRequestMethod().toUpperCase(),dataType:response_type,traditional:true};if(data){opts.data=data;}
$.ajax(opts);}}catch(e){console.error(e);}},execute:function(evt){this.executeRequest(this.getRequestData(),evt);},onSuccess:function(data,evt){return;},onCompleted:function(success,evt){if(success){this.switchStatus();this.updateTitle();this.updateLinkText();}},onFailure:function(data,status,error,evt){if(data.errors!=undefined&&data.errors.message!=undefined){this.alert(evt,data.errors.message);}},getRequestMethod:function(){return'POST';},getResponseType:function(){return'json';},getRequestData:function(){return this.element.dataAttributes();},confirm:function(evt,title,msg){var parser=this;commandUtils.showConfirmation(evt,title,msg,function(){parser.executeRequest(parser.getRequestData(),evt);})},alert:function(evt,msg){var parser=this;commandUtils.showMessage(evt,msg);},dialog:function(evt,dialogId,context,title){var parser=this;commandUtils.showPrompt(evt,dialogId,context?context:this.messages,{title:title,onOk:function(data){parser.executeRequest(data);}});}};function create_object(o){function F(){}
F.prototype=o;return new F();}
function register_command(command,parser){var base=create_object(parser_prototype);base.command=command;if(parser){$.extend(base,parser);}
base._initBase();commands[command]=base;}
var commandUtils={getInputFile:function(input){var file;if(!window.FileReader){return null;}
if(!input.files){return null;}
if(!input.files[0]){return null;}
file=input.files[0];return file;},getHumanReadableSize:function(size,decimal){if(typeof decimal==="undefined"||decimal!==true){var bytes=1024;}else{var bytes=1000;}
var SizePrefixes=' KMGT';if(size<=0)return'0';var t2=Math.min(Math.floor(Math.log(size)/Math.log(bytes)),12);return(Math.round(size*10/Math.pow(bytes,t2))/10)+
SizePrefixes.charAt(t2).replace(' ','')+'B';},reloadPage:function(){window.location.href=window.location.href.replace(/#[^#]*$/,'');},getScript:function(url,success){if(url.constructor==Array){function run(i){if(i<url.length){commandUtils.getScript(url[i],function(){run(++i);});}else{if(success){success();}}}
run(0);}
var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;if(success){success();}
script.onload=script.onreadystatechange=null;head.removeChild(script);}};head.appendChild(script);},getStyle:function(url){if(url.constructor==Array){for(var i=0;i<url.length;i++){commandUtils.getStyle(url[i]);}}
var style=document.createElement('link');style.type='text/css';style.rel='stylesheet';style.href=url;style.media='screen';document.getElementsByTagName('head')[0].appendChild(style);},loadExtraScript:function(extra,callback){if(extra.css){commandUtils.getStyle(extra.css);}
if(extra.js){commandUtils.getScript(extra.js,callback);}},preloadImage:function(src,success){var img=document.createElement('img');img.src=src;$(img).hide();var body=document.getElementsByTagName('body')[0],done=false;img.onload=img.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;if(success){success();}
img.onload=img.onreadystatechange=null;body.removeChild(img);}};body.appendChild(img);},findNodeElement:function($el){var nodeId=$($el.parents("*[nodeId]").get(0)).attr("nodeId");var $with_nodeId=$el.parents("*[nodeId="+nodeId+"]");if($with_nodeId.length>0){return $($with_nodeId.get($with_nodeId.length-1));}
return null;},findCommand:function(nodeId,commandName){return $('*[nodeId='+nodeId+'] *[command='+commandName+']');},extractCommand:function($el){var parser=$el.data('command_parser');if(!parser){var command=$el.attr('command');if(commands[command]!=undefined){parser=create_object(commands[command]);parser.element=$el;var $node_el=this.findNodeElement($el);if($node_el!=null){parser.nodeElement=$node_el;parser.nodeId=$node_el.attr('nodeId');}
parser.init();$el.data('command_parser',parser);}}
return parser;},findAndExtractCommand:function(nodeId,commandName){return this.extractCommand(this.findCommand(nodeId,commandName));},_initializeLablesOnCommands:function($commnads){$commnads.each(function(){var parser=commandUtils.extractCommand($(this));if(parser){parser.updateTitle();parser.updateLinkText();}});},initializeLabels:function(){this._initializeLablesOnCommands($("*[command]"));},initializeLabelsOnElement:function($element){this._initializeLablesOnCommands($element.find("*[command]"));},updatePostScore:function(id,newScore,hideOnZero){var $score_box=$('#post-'+id+'-score');var $score_box_wrapper=$('#post-'+id+'-score-wrapper');$score_box.html(newScore);if($score_box_wrapper.length===1){if(newScore===1&&!$score_box_wrapper.hasClass("votes")){$score_box.parent().html($score_box).prepend("<i class='icon-thumbs-up'></i> ");}
if(newScore===0){$score_box.removeClass("positive");$score_box.removeClass("negative");$score_box_wrapper.removeClass("positive");$score_box_wrapper.removeClass("negative");}else if(newScore>0){$score_box.removeClass("negative");$score_box.addClass("positive");$score_box_wrapper.removeClass("negative");$score_box_wrapper.addClass("positive");}else{$score_box.removeClass("positive");$score_box.addClass("negative");$score_box_wrapper.removeClass("positive");$score_box_wrapper.addClass("negative");}}},startCommand:function(){$('body').append($('<div id="command-loader"></div>'));running=true;},endCommand:function(success){if(success){$('#command-loader').addClass('success');$('#command-loader').fadeOut("slow",function(){$('#command-loader').remove();running=false;});}else{$('#command-loader').remove();running=false;}},renderTemplate:function(id,context){$.extend(context,pageContext);return $('#'+id).tmpl(context);},renderTemplateSource:function(src,context){$.extend(context,pageContext);return $.tmpl(src,context);},closeDialogFunction:function($diag){return function(){$diag.dialog("close");}},dialogSkeleton:function(options){return{type:'src',value:'<div class="${extraClass}" style="display: none;"><div>${content}</div></div>'}},renderDialog:function($dialog,options){var ui_options={draggable:false,modal:true,width:options.dim.w>200?'auto':200,height:'auto',position:'center'};if(options.ui_options){$.extend(true,ui_options,options.ui_options);}
if(!ui_options.buttons){ui_options.buttons={};}
if(options.title!=undefined){ui_options.title=options.title;}
var closeFunction=this.closeDialogFunction($dialog);if(options.show_yes){ui_options.buttons[options.yes_text]=function(){options.yes_callback($dialog,closeFunction);}}
if(options.show_no){ui_options.buttons[options.no_text]=closeFunction;}
ui_options.closeText="X";return{element:$dialog,display:function(){$dialog.css('visibility','visible');$dialog.dialog(ui_options);}};},closeDialogFunction:function($diag){return function(){$diag.modal("hide");};},getModalBody:function(){var $body=$(document.createElement('DIV'));$body.addClass('modal-body');return $body;},getModalNode:function(extra_class){var $modal=$(document.createElement('DIV'));$modal.addClass('modal');if(extra_class){$modal.addClass(extra_class);}
return $modal;},getModalHeader:function(titleText){var $header=$(document.createElement('DIV'));$header.addClass('modal-header');var $close=$(document.createElement('BUTTON'));$close.addClass('close');$close.attr({'type':'button','data-dismiss':'modal','aria-hidden':'true','aria-label':'Close'});$close.html('&times;');$header.append($close);$title=$(document.createElement('H3'));if(titleText){$title.text(titleText);}
$header.append($title);return $header;},getModalFooter:function(yesText,noText,yesCallback,$modal,noCallback){var $footer=$(document.createElement('DIV'));$footer.addClass('modal-footer');if(noText){var $noButton=$(document.createElement('A'));$noButton.attr('href','#');$noButton.attr('data-dismiss','modal');$noButton.attr('aria-hidden','true');$noButton.addClass('btn');$noButton.text(noText);$footer.append($noButton);if(typeof noCallback==='function'){$noButton.on('click',function(event){event.preventDefault();noCallback($modal,commandUtils.closeDialogFunction($modal));});$modal.modal('hide');}}
if(yesText){var $yesButton=$(document.createElement('A'));$yesButton.attr('href','#');$yesButton.addClass('btn btn-primary');$yesButton.text(yesText);if(typeof yesCallback==='function'){$yesButton.on('click',function(event){event.preventDefault();yesCallback($modal,commandUtils.closeDialogFunction($modal));});$modal.modal('hide');}
$footer.append($yesButton);}
return $footer;},showDialog:function(extern){var options={title:'',extra_class:'',yes_text:pageContext.i18n.ok,show_yes:true,yes_callback:function(){},no_text:pageContext.i18n.cancel,show_no:false};$.extend(true,options,extern);$.extend(options,pageContext);var $modal=this.getModalNode(options.extra_class);$modal.close=this.closeDialogFunction($modal);if(options.title){$modal.append(this.getModalHeader(options.title));}
var $dialog=this.getModalBody();$dialog.append(options.nodes);$modal.append($dialog);if(options.show_no||options.show_yes){if(!options.show_yes)options.yes_text=false;if(!options.show_no)options.no_text=false;$modal.append(this.getModalFooter(options.yes_text,options.no_text,options.yes_callback,$modal,options.no_callback));}
if(options.beforeShow&&typeof options.beforeShow==='function'){options.beforeShow($modal);}
$modal.modal('show');if(options.onAfterShow&&typeof options.onAfterShow==='function'){options.onAfterShow($modal);}
return $modal;},getDialogNodes:function(options,defFunc,baseContext){if(options.tpl){var context=options.context?options.context:(options.dialogContext?options.dialogContext:{});if(options.context){context=options.context;}
$.extend(context,baseContext);return commandUtils.renderTemplate(options.tpl,context);}else if(options.nodes){return options.nodes;}else{if(options.autorizeContext){return defFunc(options.authorizeContext.image);}else{return defFunc(false);}}},uploadTrackers:0,createUploadTracker:function(authorizeUrl,authorizeContext,callbacks){this.uploadTrackers+=1;var tracker=$(document.createElement('div')),bar=$(document.createElement('div'));tracker.addClass('progress');bar.addClass('bar');tracker.append(bar);var trackerId="uploadTracker"+this.uploadTrackers;bar.attr("id",trackerId);var errors=0;function track(trackingId){$.ajax({type:'POST',url:pageContext.url.uploadProgress,data:{'trackingId':trackingId},success:function(data){if(data.success){var bar=$('#'+trackerId);bar.html(data.result.progress+'%');bar.css("width",data.result.progress+'%');if(!data.result.complete){track(trackingId);}else{if(callbacks.onSuccess){callbacks.onSuccess(data);}}}else{errors++;if(errors>3&&callbacks.onError){callbacks.onError(data);}else{track(trackingId);}}},dataType:'json',traditional:true});}
$.ajax({type:'POST',url:authorizeUrl,data:authorizeContext,success:function(data){if(data.success){callbacks.onAuthorize(true,data.result.trackingId);track(data.result.trackingId);}else{callbacks.onAuthorize(false,(data.errors&&data.errors.error)?data.errors.error:"unauthorized");}},dataType:'json',traditional:true});return tracker;},createUploadDialogNodes:function(isImage){var NON_MATCHED_TYPES=["application/octet-stream","text/plain"];var getAcceptTypesForExtension=function(extension){var mimeTypes=$.grep(jsmime.getMimesByExt(extension),function(value){return NON_MATCHED_TYPES.indexOf(value)==-1;});if(mimeTypes.length!=0){return mimeTypes;}
return['.'+extension];};var $nodes=$('<div></div>');var $urlInput=$('<span><h3></h3></span>');$nodes.append($urlInput);var $form=$('<form enctype="multipart/form-data" method="POST" target="uploaderFrame"></form>');var authorizedTypes=isImage?authorizedImageTypes:authorizedFileTypes;var authorizedMimeTypes=[];for(var i=0;i<authorizedTypes.length;i++){var acceptTypes=getAcceptTypesForExtension(authorizedTypes[i]);authorizedMimeTypes=authorizedMimeTypes.concat(acceptTypes);}
$form.append($('<input type="file" name="file"/>'));$nodes.append($form);var $progressContainer=$('<span id="uploadProgressContainer"></span>');$nodes.append($progressContainer);return $nodes;},showUploadDialog:function(evt,options){var doptions={nodes:commandUtils.getDialogNodes(options,commandUtils.createUploadDialogNodes,pageContext.i18n.uploadDialog),title:pageContext.i18n.uploadDialog.uploadFile,yes_text:pageContext.i18n.uploadDialog.doUpload,show_no:true};var $progressContainer=doptions.nodes.find(options.progressContainer?options.progressContainer:"#uploadProgressContainer");var $form=doptions.nodes.find('form');var isUploading=false;var $input=$form.find("input[type=file]");var fileIsOk=false;var fileInProgress=false;var cancelUpload=function(){console.log("cancelable");if(isUploading){try{window.stop();}catch(e){document.execCommand('Stop');}}};$input.change(function(){var file=commandUtils.getInputFile($input[0]);if(file!=null){$uploadButton=$('.modal.in .modal-footer .btn-primary');$('.modal.in .modal-header .close').on('click',cancelUpload);$uploadButton.removeClass('disabled');fileIsOk=true;$form.find(".alert").remove();if(file.size>pageContext.attachments.maxSizeBytes){$uploadButton.addClass('disabled');fileIsOk=false;$input.after("<div class='alert alert-warning'>"+pageContext.i18n.uploadDialog.fileTooBig.replace("$size",commandUtils.getHumanReadableSize(pageContext.attachments.maxSizeBytes,true))+"</div>");}
var extension=file.name.toLowerCase().split('.').pop();if(extension=="gz"){var fileParts=file.name.toLowerCase().split('.');if(fileParts.length>2&&fileParts[fileParts.length-2]=="tar"){extension="tar.gz";}}
if(((options.authorizeContext&&options.authorizeContext.image)?authorizedImageTypes:authorizedFileTypes).indexOf(extension)===-1){$uploadButton.addClass('disabled');fileIsOk=false;$input.after("<div class='alert alert-warning'>"+(options.authorizeContext.image?pageContext.i18n.uploadDialog.invalidImageType:pageContext.i18n.uploadDialog.invalidAttachmentType)+"</div>");}}});var actions={dialog:null,close:null,authorizeAndStart:function(){var trackingId=null;var $tracker=commandUtils.createUploadTracker(options.authorizeUrl,options.authorizeContext,{onAuthorize:function(authorized,msg){if(authorized){trackingId=msg;$form.attr('action',pageContext.url.uploadFile+'?trackingId='+msg);var $frame=$('<iframe name="uploaderFrame" style="display: none;"></iframe>');$progressContainer.after($frame);$form.submit();}else{actions.close();commandUtils.showMessage(evt,msg);}},onSuccess:function(data){function done(){if(options.onSuccess){options.onSuccess(trackingId,data.result);actions.close();}}
if(data.result.isImage&&(options.disableCrop==undefined||!options.disableCrop)){var previewOptions=options.previewDialogOptions?options.previewDialogOptions:{};previewOptions.fileData=data.result;if(previewOptions.beforeShow){var oldBeforeShow=options.beforeShow;previewOptions.beforeShow=function($dialog){actions.close();oldBeforeShow($dialog);}}else{previewOptions.beforeShow=function(){actions.close();}}
previewOptions.onSuccess=function(){done();}
commandUtils.showPreviewAndCropDialog(evt,previewOptions);}else{done();}},onError:function(data){if(options.onError){options.onError();}
if(data.errors&&data.errors.error){actions.close();commandUtils.showMessage(evt,data.errors.error);}}});if(!isUploading){$progressContainer.append($tracker);isUploading=true;}}};if(options.override_yes_callback){doptions.yes_callback=function($dialog,close){options.override_yes_callback($dialog,close,actions);};}else{doptions.yes_callback=function($dialog,close){if(!fileIsOk||isUploading)return;actions.close=close;actions.dialog=$dialog;$uploadButton=$('.modal.in .modal-footer .btn-primary');$uploadButton.addClass('disabled');if(options.yes_callback){options.yes_callback($dialog,close,actions);}else{actions.authorizeAndStart();}};}
doptions.no_callback=function($dialog,close){cancelUpload();actions.close=close;actions.dialog=$dialog;};if(options.dialogContext){$.extend(doptions,options.dialogContext);}
this.showDialog(doptions);},createPreviewAndCropDialogNodes:function(){var $nodes=$('<div></div>');var $table=$('<table>'+'<tr><td style="padding: 5px; border: 1px solid black;">'+'<img class="previewEditor" style="max-width: 500px; max-height: 500px;" src="" />'+'</td>'+'</tr></table>');$nodes.append($table);return $nodes;},jcropLoaded:false,showPreviewAndCropDialog:function(evt,options){var doptions={nodes:commandUtils.getDialogNodes(options,commandUtils.createPreviewAndCropDialogNodes,pageContext.i18n.previewAndCropDialog),title:pageContext.i18n.previewAndCropDialog.previewAndResize,yes_text:pageContext.i18n.previewAndCropDialog.accept,show_no:true};var $imageEditor=doptions.nodes.find(options.editor?options.editor:'.previewEditor');var $imagePreview=doptions.nodes.find(options.preview?options.preview:'.finalPreview');var data={'file':options.fileData.fileId,x:0,y:0,w:0,h:0};function showPreview(coords){var rx=100/coords.w;var ry=100/coords.h;$imagePreview.css({width:Math.round(rx*500)+'px',height:Math.round(ry*500)+'px',marginLeft:'-'+Math.round(rx*coords.x)+'px',marginTop:'-'+Math.round(ry*coords.y)+'px'});data.x=coords.x;data.y=coords.y;data.w=coords.w;data.h=coords.h;}
doptions.yes_callback=function($dialog,close){data.refWidth=$imageEditor.width();data.refHeight=$imageEditor.height();$.ajax({type:'POST',url:pageContext.url.cropUpload,data:data,success:function(data){if(data.success){close();if(data.result.newSize){options.fileData.size=data.result.newSize;}
if(options.onSuccess){options.onSuccess();}}else{if(data.errors&&data.errors.image){close();commandUtils.showMessage(evt,data.errors.image);}}},dataType:'json'});};if(options){$.extend(options,doptions);doptions=options;}
var noCacheImageUrl=options.fileData.url+"?noCache="+(new Date().getTime()+""+Math.floor(Math.random()*1001));commandUtils.preloadImage(noCacheImageUrl,function(){$imageEditor.attr('src',noCacheImageUrl);$imagePreview.attr('src',noCacheImageUrl);commandUtils.showDialog(doptions);function setupEditor(){commandUtils.jcropLoaded=true;var jcropOptions={onChange:showPreview,onSelect:showPreview};if(options.forceSquare){jcropOptions.aspectRatio=1;}
$imageEditor.Jcrop(jcropOptions);}
if(!commandUtils.jcropLoaded){commandUtils.loadExtraScript(pageContext.extraScripts.jcrop,setupEditor);}else{setupEditor();}});},showMessage:function(evt,msg,callback,title){msg=msg.replace("\n","<br />");msg=msg.replace(new RegExp(pageContext.i18n.login,"ig"),'<a href="'+pageContext.url.login+'">'+pageContext.i18n.login+'</a>');msg=msg.replace(new RegExp(pageContext.i18n.register,"ig"),'<a href="'+pageContext.url.register+'">'+pageContext.i18n.register+'</a>');return this.showDialog({nodes:$('<span>'+msg+'</span>'),extra_class:'warning',event:evt,title:title,yes_callback:function($dialog,close){close();if(callback){callback();}},close_on_clickoutside:true});},showConfirmation:function(evt,title,msg,callback){return this.showDialog({event:evt,title:title?title:'',nodes:$('<center>'+(msg?msg:pageContext.i18n.confirm)+'</center>'),extra_class:'prompt',show_no:true,no_test:pageContext.i18n.no,yes_text:pageContext.i18n.yes,yes_callback:function($dialog,close){if(callback){callback();}
close();}});},showPrompt:function(evt,tpl,context,options){var doptions={nodes:commandUtils.renderTemplate(tpl,context),extra_class:'prompt',yes_callback:function($dialog,close){var data=commandUtils.extractFormData($dialog);var result=true;if(options.onOk!=undefined){result=options.onOk(data);}
if(result!==false){close();}},show_no:true};if(options){$.extend(options,doptions);}else{options=doptions;}
if(options.centered==undefined||!options.centered){options.event=evt;}
return this.showDialog(options);},extractFormData:function($el){var ret={};var data=null;if($el.is('form')){data=$el.serializeArray();}else{data=$el.find('form').serializeArray();}
for(var i=0;i<data.length;i++){if(ret[data[i].name]){var old=ret[data[i].name];if(old.constructor==Array){old.push(data[i].value);}else{var a=new Array();a.push(old);a.push(data[i].value);ret[data[i].name]=a;}}else{ret[data[i].name]=data[i].value;}}
return ret;},fillFormData:function($form,values){$form.find(':text, :password, :file, textarea').each(function(){var $input=$(this);$input.val(values[$input.attr('name')?$input.attr('name'):'']);});$form.find('input[type=radio], input[type=checkbox], option').each(function(){var $input=$(this);var name=this.tagName.toUpperCase()=='OPTION'?$input.parents('select').attr('name'):$input.attr('name');var value=values[name];if(value&&((value.constructor==Array&&$.inArray($input.val(),value)>=0)||(value==$input.val()))||(value===true)){$input.attr('checked','checked').attr('selected','selected');}else{$input.removeAttr('checked').removeAttr('selected');}});},friendlyDate:function(toParse,def){var dif=null;var date=null;var parsed=null;var now=Date.today().setTimeToNow();if(toParse.constructor==Date){date=toParse;}else{var negateServerOffset=false;var serverOffset=0;var splitted=toParse.split("+");if(splitted.length!=2){splitted=toParse.split("-");negateServerOffset=true;}
if(splitted.length==2){serverOffset=parseInt(splitted[1],10)/100;toParse=splitted[0];}
var viewerOffset=parseInt(new Date().getUTCOffset(),10)/100;if(negateServerOffset)serverOffset=(0-serverOffset);date=Date.parse(toParse).addHours(viewerOffset-serverOffset);}
dif=new TimeSpan(now-date);if(dif.getDays()>10||pageContext.useRelativeTime!=true){if(def){parsed=def;}else{if(dif.getDays()>=365){parsed=date.toString("MMM dd 'yy");}else{parsed=date.toString("MMM dd")}
parsed=parsed+" "+pageContext.i18n.timeAt+" "+date.toString("h:mm tt");}}else{if(dif.getDays()>1){parsed=dif.getDays()+' '+pageContext.i18n.days;}else if(dif.getDays()==1){parsed='1 '+pageContext.i18n.day;}else if(dif.getHours()>1){parsed=dif.getHours()+' '+pageContext.i18n.hours;}else if(dif.getHours()==1){parsed='1 '+pageContext.i18n.hour;}else if(dif.getMinutes()>1){parsed=dif.getMinutes()+' '+pageContext.i18n.minutes;}else if(dif.getMinutes()==1){parsed='1 '+pageContext.i18n.minute;}else if(dif.getSeconds()>1){parsed=dif.getSeconds()+' '+pageContext.i18n.seconds;}else if(dif.getSeconds()==1){parsed='1 '+pageContext.i18n.second;}else{parsed='0 '+pageContext.i18n.seconds;}
parsed=pageContext.i18n.timeAgo.replace('{0}',parsed);}
return parsed;},generateUploadTrackingCode:function(){return new Date().getTime()+""+Math.floor(Math.random()*1001)},decode:function(s){return decodeURIComponent(s.replace(/\+/g,' '));},decodeAndParse:function(s){var pluses=/\+/g;if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}
s=this.decode(s);return s;},getCookie:function(key){var cookies=document.cookie.split('; ');var result=key?undefined:{};for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=this.decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=this.decodeAndParse(cookie);break;}
if(!key){result[name]=this.decodeAndParse(cookie);}}
return result;},setCookie:function(key,value,options){if(!options){options={};}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
value=""+value;return(document.cookie=[encodeURIComponent(key),'=',encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'; expires=-1',options.path?'; path='+options.path:': path=/',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));},escapeHtml:function(value){return $("<div>").text(value).html();}};$(function($){commandUtils.initializeLabels();$(document).on('click',"*[command]",function(evt){var parser=commandUtils.extractCommand($(this));if(parser){$('.context-menu-dropdown').slideUp('fast');parser.execute(evt);}
return false;});function checkFormsForCSRFToken(){$('form').each(function(){var $form=$(this);if($form.attr('method')&&$form.attr('method').toUpperCase()=='POST'&&$form.find('input[name=TH_CSRF]').length==0){$form.prepend('<input type="hidden" name="TH_CSRF" value="'+pageContext.additional.TH_CSRF+'" />');}});}
function startFormCheckTimeout(){window.setTimeout(function(){checkFormsForCSRFToken();startFormCheckTimeout();},1000);}
checkFormsForCSRFToken();startFormCheckTimeout();$(document).ajaxSend(function(elm,xhr,s){if(s.type&&s.type.toUpperCase()=="POST"){xhr.setRequestHeader('X-TH-CSRF',pageContext.additional.TH_CSRF);}});try{var jsSupportCookie=commandUtils.getCookie("TH_JS_SUPPORT");if(!jsSupportCookie){$.get(pageContext.url.trackJs);}}catch(e){console.log(e);}});(function($){$.fn.dataAttributes=function(){var attributes={};if(!this.length)
return this;$.each(this[0].attributes,function(index,attr){if(/^data\-/.test(attr.nodeName)){attributes[attr.nodeName.substr(5)]=attr.nodeValue;}});return attributes;}})(jQuery);if(typeof String.prototype.trim!=='function'){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');}}
(function($){$(document).on('autocompleteopen',".ui-autocomplete-input",function(){var autocomplete=$(this).data("uiAutocomplete"),menu=autocomplete.menu;if(!autocomplete.options.autoFocus){return;}
if(autocomplete.term!=$(this).val()){return;}
menu.options.blur=function(event,ui){return}
menu.activate($.Event({type:"mouseenter"}),menu.element.children().first());});}(jQuery));register_command('resendEmailValidation',{execute:function(evt){this.confirm(evt,pageContext.i18n.emailValidationPrompt,pageContext.i18n.emailValidationPromptBody);},onSuccess:function(data){commandUtils.showMessage(null,data.result.success);}});register_command('follow',{execute:function(evt){var parser=this;var follownodeid=this.element.attr("nodeId");if(follownodeid.indexOf("#")>-1){follownodeid=follownodeid.replace("#","%23");}
$.ajax({url:(this.element.hasClass("on")?pageContext.url.unfollow:pageContext.url.follow).replace("%7BobjId%7D",follownodeid).replace("%7Btype%7D",this.element.attr("data-node-type")),cache:false,success:function(data){parser.onSuccess(data,evt);},error:function(data){if(data.status==401){window.location=pageContext.url.login;}}})},onSuccess:function(data,evt){$this=$(evt.target);if($this.hasClass("on")){$this.removeClass("on");}else{$this.addClass("on");}
this.updateLinkText();},updateLinkText:function(){$("[command='follow']").each(function(){var $btn=$(this);if($btn.hasClass("on")){if($btn.hasClass("btn")){$btn.addClass("btn-info");$btn.mouseenter(function(){$btn.addClass("btn-danger");$btn.removeClass("btn-info");$btn.html(pageContext.i18n.unfollow);}).mouseleave(function(){$btn.removeClass("btn-danger");$btn.addClass("btn-info");$btn.html(pageContext.i18n.following);});$btn.html(pageContext.i18n.following);}else{$btn.html(pageContext.i18n.unfollow);}}else{if($btn.hasClass("btn")){$btn.removeClass("btn-info");$btn.removeClass("btn-danger");$btn.unbind("mouseenter");$btn.unbind("mouseleave");}
$btn.html("<i class='icon-plus'></i> "+pageContext.i18n.follow);}});}});register_command('deleteAllPosts',{execute:function(evt){this.confirm(evt,null);},onSuccess:function(data){commandUtils.showMessage(null,data.result.success);}});window['rangy']=(function(){var OBJECT="object",FUNCTION="function",UNDEFINED="undefined";var domRangeProperties=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"];var domRangeMethods=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"];var textRangeProperties=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"];var textRangeMethods=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"];function isHostMethod(o,p){var t=typeof o[p];return t==FUNCTION||(!!(t==OBJECT&&o[p]))||t=="unknown";}
function isHostObject(o,p){return!!(typeof o[p]==OBJECT&&o[p]);}
function isHostProperty(o,p){return typeof o[p]!=UNDEFINED;}
function createMultiplePropertyTest(testFunc){return function(o,props){var i=props.length;while(i--){if(!testFunc(o,props[i])){return false;}}
return true;};}
var areHostMethods=createMultiplePropertyTest(isHostMethod);var areHostObjects=createMultiplePropertyTest(isHostObject);var areHostProperties=createMultiplePropertyTest(isHostProperty);function isTextRange(range){return range&&areHostMethods(range,textRangeMethods)&&areHostProperties(range,textRangeProperties);}
var api={version:"1.2.3",initialized:false,supported:true,util:{isHostMethod:isHostMethod,isHostObject:isHostObject,isHostProperty:isHostProperty,areHostMethods:areHostMethods,areHostObjects:areHostObjects,areHostProperties:areHostProperties,isTextRange:isTextRange},features:{},modules:{},config:{alertOnWarn:false,preferTextRange:false}};function fail(reason){window.alert("Rangy not supported in your browser. Reason: "+reason);api.initialized=true;api.supported=false;}
api.fail=fail;function warn(msg){var warningMessage="Rangy warning: "+msg;if(api.config.alertOnWarn){window.alert(warningMessage);}else if(typeof window.console!=UNDEFINED&&typeof window.console.log!=UNDEFINED){window.console.log(warningMessage);}}
api.warn=warn;if({}.hasOwnProperty){api.util.extend=function(o,props){for(var i in props){if(props.hasOwnProperty(i)){o[i]=props[i];}}};}else{fail("hasOwnProperty not supported");}
var initListeners=[];var moduleInitializers=[];function init(){if(api.initialized){return;}
var testRange;var implementsDomRange=false,implementsTextRange=false;if(isHostMethod(document,"createRange")){testRange=document.createRange();if(areHostMethods(testRange,domRangeMethods)&&areHostProperties(testRange,domRangeProperties)){implementsDomRange=true;}
testRange.detach();}
var body=isHostObject(document,"body")?document.body:document.getElementsByTagName("body")[0];if(body&&isHostMethod(body,"createTextRange")){testRange=body.createTextRange();if(isTextRange(testRange)){implementsTextRange=true;}}
if(!implementsDomRange&&!implementsTextRange){fail("Neither Range nor TextRange are implemented");}
api.initialized=true;api.features={implementsDomRange:implementsDomRange,implementsTextRange:implementsTextRange};var allListeners=moduleInitializers.concat(initListeners);for(var i=0,len=allListeners.length;i<len;++i){try{allListeners[i](api);}catch(ex){if(isHostObject(window,"console")&&isHostMethod(window.console,"log")){window.console.log("Init listener threw an exception. Continuing.",ex);}}}}
api.init=init;api.addInitListener=function(listener){if(api.initialized){listener(api);}else{initListeners.push(listener);}};var createMissingNativeApiListeners=[];api.addCreateMissingNativeApiListener=function(listener){createMissingNativeApiListeners.push(listener);};function createMissingNativeApi(win){win=win||window;init();for(var i=0,len=createMissingNativeApiListeners.length;i<len;++i){createMissingNativeApiListeners[i](win);}}
api.createMissingNativeApi=createMissingNativeApi;function Module(name){this.name=name;this.initialized=false;this.supported=false;}
Module.prototype.fail=function(reason){this.initialized=true;this.supported=false;throw new Error("Module '"+this.name+"' failed to load: "+reason);};Module.prototype.warn=function(msg){api.warn("Module "+this.name+": "+msg);};Module.prototype.createError=function(msg){return new Error("Error in Rangy "+this.name+" module: "+msg);};api.createModule=function(name,initFunc){var module=new Module(name);api.modules[name]=module;moduleInitializers.push(function(api){initFunc(api,module);module.initialized=true;module.supported=true;});};api.requireModules=function(modules){for(var i=0,len=modules.length,module,moduleName;i<len;++i){moduleName=modules[i];module=api.modules[moduleName];if(!module||!(module instanceof Module)){throw new Error("Module '"+moduleName+"' not found");}
if(!module.supported){throw new Error("Module '"+moduleName+"' not supported");}}};var docReady=false;var loadHandler=function(e){if(!docReady){docReady=true;if(!api.initialized){init();}}};if(typeof window==UNDEFINED){fail("No window found");return;}
if(typeof document==UNDEFINED){fail("No document found");return;}
if(isHostMethod(document,"addEventListener")){document.addEventListener("DOMContentLoaded",loadHandler,false);}
if(isHostMethod(window,"addEventListener")){window.addEventListener("load",loadHandler,false);}else if(isHostMethod(window,"attachEvent")){window.attachEvent("onload",loadHandler);}else{fail("Window does not have required addEventListener or attachEvent method");}
return api;})();rangy.createModule("DomUtil",function(api,module){var UNDEF="undefined";var util=api.util;if(!util.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])){module.fail("document missing a Node creation method");}
if(!util.isHostMethod(document,"getElementsByTagName")){module.fail("document missing getElementsByTagName method");}
var el=document.createElement("div");if(!util.areHostMethods(el,["insertBefore","appendChild","cloneNode"]||!util.areHostObjects(el,["previousSibling","nextSibling","childNodes","parentNode"]))){module.fail("Incomplete Element implementation");}
if(!util.isHostProperty(el,"innerHTML")){module.fail("Element is missing innerHTML property");}
var textNode=document.createTextNode("test");if(!util.areHostMethods(textNode,["splitText","deleteData","insertData","appendData","cloneNode"]||!util.areHostObjects(el,["previousSibling","nextSibling","childNodes","parentNode"])||!util.areHostProperties(textNode,["data"]))){module.fail("Incomplete Text Node implementation");}
var arrayContains=function(arr,val){var i=arr.length;while(i--){if(arr[i]===val){return true;}}
return false;};function isHtmlNamespace(node){var ns;return typeof node.namespaceURI==UNDEF||((ns=node.namespaceURI)===null||ns=="http://www.w3.org/1999/xhtml");}
function parentElement(node){var parent=node.parentNode;return(parent.nodeType==1)?parent:null;}
function getNodeIndex(node){var i=0;while((node=node.previousSibling)){i++;}
return i;}
function getNodeLength(node){var childNodes;return isCharacterDataNode(node)?node.length:((childNodes=node.childNodes)?childNodes.length:0);}
function getCommonAncestor(node1,node2){var ancestors=[],n;for(n=node1;n;n=n.parentNode){ancestors.push(n);}
for(n=node2;n;n=n.parentNode){if(arrayContains(ancestors,n)){return n;}}
return null;}
function isAncestorOf(ancestor,descendant,selfIsAncestor){var n=selfIsAncestor?descendant:descendant.parentNode;while(n){if(n===ancestor){return true;}else{n=n.parentNode;}}
return false;}
function getClosestAncestorIn(node,ancestor,selfIsAncestor){var p,n=selfIsAncestor?node:node.parentNode;while(n){p=n.parentNode;if(p===ancestor){return n;}
n=p;}
return null;}
function isCharacterDataNode(node){var t=node.nodeType;return t==3||t==4||t==8;}
function insertAfter(node,precedingNode){var nextNode=precedingNode.nextSibling,parent=precedingNode.parentNode;if(nextNode){parent.insertBefore(node,nextNode);}else{parent.appendChild(node);}
return node;}
function splitDataNode(node,index){var newNode=node.cloneNode(false);newNode.deleteData(0,index);node.deleteData(index,node.length-index);insertAfter(newNode,node);return newNode;}
function getDocument(node){if(node.nodeType==9){return node;}else if(typeof node.ownerDocument!=UNDEF){return node.ownerDocument;}else if(typeof node.document!=UNDEF){return node.document;}else if(node.parentNode){return getDocument(node.parentNode);}else{throw new Error("getDocument: no document found for node");}}
function getWindow(node){var doc=getDocument(node);if(typeof doc.defaultView!=UNDEF){return doc.defaultView;}else if(typeof doc.parentWindow!=UNDEF){return doc.parentWindow;}else{throw new Error("Cannot get a window object for node");}}
function getIframeDocument(iframeEl){if(typeof iframeEl.contentDocument!=UNDEF){return iframeEl.contentDocument;}else if(typeof iframeEl.contentWindow!=UNDEF){return iframeEl.contentWindow.document;}else{throw new Error("getIframeWindow: No Document object found for iframe element");}}
function getIframeWindow(iframeEl){if(typeof iframeEl.contentWindow!=UNDEF){return iframeEl.contentWindow;}else if(typeof iframeEl.contentDocument!=UNDEF){return iframeEl.contentDocument.defaultView;}else{throw new Error("getIframeWindow: No Window object found for iframe element");}}
function getBody(doc){return util.isHostObject(doc,"body")?doc.body:doc.getElementsByTagName("body")[0];}
function getRootContainer(node){var parent;while((parent=node.parentNode)){node=parent;}
return node;}
function comparePoints(nodeA,offsetA,nodeB,offsetB){var nodeC,root,childA,childB,n;if(nodeA==nodeB){return offsetA===offsetB?0:(offsetA<offsetB)?-1:1;}else if((nodeC=getClosestAncestorIn(nodeB,nodeA,true))){return offsetA<=getNodeIndex(nodeC)?-1:1;}else if((nodeC=getClosestAncestorIn(nodeA,nodeB,true))){return getNodeIndex(nodeC)<offsetB?-1:1;}else{root=getCommonAncestor(nodeA,nodeB);childA=(nodeA===root)?root:getClosestAncestorIn(nodeA,root,true);childB=(nodeB===root)?root:getClosestAncestorIn(nodeB,root,true);if(childA===childB){throw new Error("comparePoints got to case 4 and childA and childB are the same!");}else{n=root.firstChild;while(n){if(n===childA){return-1;}else if(n===childB){return 1;}
n=n.nextSibling;}
throw new Error("Should not be here!");}}}
function fragmentFromNodeChildren(node){var fragment=getDocument(node).createDocumentFragment(),child;while((child=node.firstChild)){fragment.appendChild(child);}
return fragment;}
function inspectNode(node){if(!node){return"[No node]";}
if(isCharacterDataNode(node)){return'"'+node.data+'"';}else if(node.nodeType==1){var idAttr=node.id?' id="'+node.id+'"':"";return"<"+node.nodeName+idAttr+">["+node.childNodes.length+"]";}else{return node.nodeName;}}
function NodeIterator(root){this.root=root;this._next=root;}
NodeIterator.prototype={_current:null,hasNext:function(){return!!this._next;},next:function(){var n=this._current=this._next;var child,next;if(this._current){child=n.firstChild;if(child){this._next=child;}else{next=null;while((n!==this.root)&&!(next=n.nextSibling)){n=n.parentNode;}
this._next=next;}}
return this._current;},detach:function(){this._current=this._next=this.root=null;}};function createIterator(root){return new NodeIterator(root);}
function DomPosition(node,offset){this.node=node;this.offset=offset;}
DomPosition.prototype={equals:function(pos){return this.node===pos.node&this.offset==pos.offset;},inspect:function(){return"[DomPosition("+inspectNode(this.node)+":"+this.offset+")]";}};function DOMException(codeName){this.code=this[codeName];this.codeName=codeName;this.message="DOMException: "+this.codeName;}
DOMException.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};DOMException.prototype.toString=function(){return this.message;};api.dom={arrayContains:arrayContains,isHtmlNamespace:isHtmlNamespace,parentElement:parentElement,getNodeIndex:getNodeIndex,getNodeLength:getNodeLength,getCommonAncestor:getCommonAncestor,isAncestorOf:isAncestorOf,getClosestAncestorIn:getClosestAncestorIn,isCharacterDataNode:isCharacterDataNode,insertAfter:insertAfter,splitDataNode:splitDataNode,getDocument:getDocument,getWindow:getWindow,getIframeWindow:getIframeWindow,getIframeDocument:getIframeDocument,getBody:getBody,getRootContainer:getRootContainer,comparePoints:comparePoints,inspectNode:inspectNode,fragmentFromNodeChildren:fragmentFromNodeChildren,createIterator:createIterator,DomPosition:DomPosition};api.DOMException=DOMException;});rangy.createModule("DomRange",function(api,module){api.requireModules(["DomUtil"]);var dom=api.dom;var DomPosition=dom.DomPosition;var DOMException=api.DOMException;function isNonTextPartiallySelected(node,range){return(node.nodeType!=3)&&(dom.isAncestorOf(node,range.startContainer,true)||dom.isAncestorOf(node,range.endContainer,true));}
function getRangeDocument(range){return dom.getDocument(range.startContainer);}
function dispatchEvent(range,type,args){var listeners=range._listeners[type];if(listeners){for(var i=0,len=listeners.length;i<len;++i){listeners[i].call(range,{target:range,args:args});}}}
function getBoundaryBeforeNode(node){return new DomPosition(node.parentNode,dom.getNodeIndex(node));}
function getBoundaryAfterNode(node){return new DomPosition(node.parentNode,dom.getNodeIndex(node)+1);}
function insertNodeAtPosition(node,n,o){var firstNodeInserted=node.nodeType==11?node.firstChild:node;if(dom.isCharacterDataNode(n)){if(o==n.length){dom.insertAfter(node,n);}else{n.parentNode.insertBefore(node,o==0?n:dom.splitDataNode(n,o));}}else if(o>=n.childNodes.length){n.appendChild(node);}else{n.insertBefore(node,n.childNodes[o]);}
return firstNodeInserted;}
function cloneSubtree(iterator){var partiallySelected;for(var node,frag=getRangeDocument(iterator.range).createDocumentFragment(),subIterator;node=iterator.next();){partiallySelected=iterator.isPartiallySelectedSubtree();node=node.cloneNode(!partiallySelected);if(partiallySelected){subIterator=iterator.getSubtreeIterator();node.appendChild(cloneSubtree(subIterator));subIterator.detach(true);}
if(node.nodeType==10){throw new DOMException("HIERARCHY_REQUEST_ERR");}
frag.appendChild(node);}
return frag;}
function iterateSubtree(rangeIterator,func,iteratorState){var it,n;iteratorState=iteratorState||{stop:false};for(var node,subRangeIterator;node=rangeIterator.next();){if(rangeIterator.isPartiallySelectedSubtree()){if(func(node)===false){iteratorState.stop=true;return;}else{subRangeIterator=rangeIterator.getSubtreeIterator();iterateSubtree(subRangeIterator,func,iteratorState);subRangeIterator.detach(true);if(iteratorState.stop){return;}}}else{it=dom.createIterator(node);while((n=it.next())){if(func(n)===false){iteratorState.stop=true;return;}}}}}
function deleteSubtree(iterator){var subIterator;while(iterator.next()){if(iterator.isPartiallySelectedSubtree()){subIterator=iterator.getSubtreeIterator();deleteSubtree(subIterator);subIterator.detach(true);}else{iterator.remove();}}}
function extractSubtree(iterator){for(var node,frag=getRangeDocument(iterator.range).createDocumentFragment(),subIterator;node=iterator.next();){if(iterator.isPartiallySelectedSubtree()){node=node.cloneNode(false);subIterator=iterator.getSubtreeIterator();node.appendChild(extractSubtree(subIterator));subIterator.detach(true);}else{iterator.remove();}
if(node.nodeType==10){throw new DOMException("HIERARCHY_REQUEST_ERR");}
frag.appendChild(node);}
return frag;}
function getNodesInRange(range,nodeTypes,filter){var filterNodeTypes=!!(nodeTypes&&nodeTypes.length),regex;var filterExists=!!filter;if(filterNodeTypes){regex=new RegExp("^("+nodeTypes.join("|")+")$");}
var nodes=[];iterateSubtree(new RangeIterator(range,false),function(node){if((!filterNodeTypes||regex.test(node.nodeType))&&(!filterExists||filter(node))){nodes.push(node);}});return nodes;}
function inspect(range){var name=(typeof range.getName=="undefined")?"Range":range.getName();return"["+name+"("+dom.inspectNode(range.startContainer)+":"+range.startOffset+", "+
dom.inspectNode(range.endContainer)+":"+range.endOffset+")]";}
function RangeIterator(range,clonePartiallySelectedTextNodes){this.range=range;this.clonePartiallySelectedTextNodes=clonePartiallySelectedTextNodes;if(!range.collapsed){this.sc=range.startContainer;this.so=range.startOffset;this.ec=range.endContainer;this.eo=range.endOffset;var root=range.commonAncestorContainer;if(this.sc===this.ec&&dom.isCharacterDataNode(this.sc)){this.isSingleCharacterDataNode=true;this._first=this._last=this._next=this.sc;}else{this._first=this._next=(this.sc===root&&!dom.isCharacterDataNode(this.sc))?this.sc.childNodes[this.so]:dom.getClosestAncestorIn(this.sc,root,true);this._last=(this.ec===root&&!dom.isCharacterDataNode(this.ec))?this.ec.childNodes[this.eo-1]:dom.getClosestAncestorIn(this.ec,root,true);}}}
RangeIterator.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:false,reset:function(){this._current=null;this._next=this._first;},hasNext:function(){return!!this._next;},next:function(){var current=this._current=this._next;if(current){this._next=(current!==this._last)?current.nextSibling:null;if(dom.isCharacterDataNode(current)&&this.clonePartiallySelectedTextNodes){if(current===this.ec){(current=current.cloneNode(true)).deleteData(this.eo,current.length-this.eo);}
if(this._current===this.sc){(current=current.cloneNode(true)).deleteData(0,this.so);}}}
return current;},remove:function(){var current=this._current,start,end;if(dom.isCharacterDataNode(current)&&(current===this.sc||current===this.ec)){start=(current===this.sc)?this.so:0;end=(current===this.ec)?this.eo:current.length;if(start!=end){current.deleteData(start,end-start);}}else{if(current.parentNode){current.parentNode.removeChild(current);}else{}}},isPartiallySelectedSubtree:function(){var current=this._current;return isNonTextPartiallySelected(current,this.range);},getSubtreeIterator:function(){var subRange;if(this.isSingleCharacterDataNode){subRange=this.range.cloneRange();subRange.collapse();}else{subRange=new Range(getRangeDocument(this.range));var current=this._current;var startContainer=current,startOffset=0,endContainer=current,endOffset=dom.getNodeLength(current);if(dom.isAncestorOf(current,this.sc,true)){startContainer=this.sc;startOffset=this.so;}
if(dom.isAncestorOf(current,this.ec,true)){endContainer=this.ec;endOffset=this.eo;}
updateBoundaries(subRange,startContainer,startOffset,endContainer,endOffset);}
return new RangeIterator(subRange,this.clonePartiallySelectedTextNodes);},detach:function(detachRange){if(detachRange){this.range.detach();}
this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null;}};function RangeException(codeName){this.code=this[codeName];this.codeName=codeName;this.message="RangeException: "+this.codeName;}
RangeException.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};RangeException.prototype.toString=function(){return this.message;};function RangeNodeIterator(range,nodeTypes,filter){this.nodes=getNodesInRange(range,nodeTypes,filter);this._next=this.nodes[0];this._position=0;}
RangeNodeIterator.prototype={_current:null,hasNext:function(){return!!this._next;},next:function(){this._current=this._next;this._next=this.nodes[++this._position];return this._current;},detach:function(){this._current=this._next=this.nodes=null;}};var beforeAfterNodeTypes=[1,3,4,5,7,8,10];var rootContainerNodeTypes=[2,9,11];var readonlyNodeTypes=[5,6,10,12];var insertableNodeTypes=[1,3,4,5,7,8,10,11];var surroundNodeTypes=[1,3,4,5,7,8];function createAncestorFinder(nodeTypes){return function(node,selfIsAncestor){var t,n=selfIsAncestor?node:node.parentNode;while(n){t=n.nodeType;if(dom.arrayContains(nodeTypes,t)){return n;}
n=n.parentNode;}
return null;};}
var getRootContainer=dom.getRootContainer;var getDocumentOrFragmentContainer=createAncestorFinder([9,11]);var getReadonlyAncestor=createAncestorFinder(readonlyNodeTypes);var getDocTypeNotationEntityAncestor=createAncestorFinder([6,10,12]);function assertNoDocTypeNotationEntityAncestor(node,allowSelf){if(getDocTypeNotationEntityAncestor(node,allowSelf)){throw new RangeException("INVALID_NODE_TYPE_ERR");}}
function assertNotDetached(range){if(!range.startContainer){throw new DOMException("INVALID_STATE_ERR");}}
function assertValidNodeType(node,invalidTypes){if(!dom.arrayContains(invalidTypes,node.nodeType)){throw new RangeException("INVALID_NODE_TYPE_ERR");}}
function assertValidOffset(node,offset){if(offset<0||offset>(dom.isCharacterDataNode(node)?node.length:node.childNodes.length)){throw new DOMException("INDEX_SIZE_ERR");}}
function assertSameDocumentOrFragment(node1,node2){if(getDocumentOrFragmentContainer(node1,true)!==getDocumentOrFragmentContainer(node2,true)){throw new DOMException("WRONG_DOCUMENT_ERR");}}
function assertNodeNotReadOnly(node){if(getReadonlyAncestor(node,true)){throw new DOMException("NO_MODIFICATION_ALLOWED_ERR");}}
function assertNode(node,codeName){if(!node){throw new DOMException(codeName);}}
function isOrphan(node){return!dom.arrayContains(rootContainerNodeTypes,node.nodeType)&&!getDocumentOrFragmentContainer(node,true);}
function isValidOffset(node,offset){return offset<=(dom.isCharacterDataNode(node)?node.length:node.childNodes.length);}
function isRangeValid(range){return(!!range.startContainer&&!!range.endContainer&&!isOrphan(range.startContainer)&&!isOrphan(range.endContainer)&&isValidOffset(range.startContainer,range.startOffset)&&isValidOffset(range.endContainer,range.endOffset));}
function assertRangeValid(range){assertNotDetached(range);if(!isRangeValid(range)){throw new Error("Range error: Range is no longer valid after DOM mutation ("+range.inspect()+")");}}
var styleEl=document.createElement("style");var htmlParsingConforms=false;try{styleEl.innerHTML="<b>x</b>";htmlParsingConforms=(styleEl.firstChild.nodeType==3);}catch(e){}
api.features.htmlParsingConforms=htmlParsingConforms;var createContextualFragment=htmlParsingConforms?function(fragmentStr){var node=this.startContainer;var doc=dom.getDocument(node);if(!node){throw new DOMException("INVALID_STATE_ERR");}
var el=null;if(node.nodeType==1){el=node;}else if(dom.isCharacterDataNode(node)){el=dom.parentElement(node);}
if(el===null||(el.nodeName=="HTML"&&dom.isHtmlNamespace(dom.getDocument(el).documentElement)&&dom.isHtmlNamespace(el))){el=doc.createElement("body");}else{el=el.cloneNode(false);}
el.innerHTML=fragmentStr;return dom.fragmentFromNodeChildren(el);}:function(fragmentStr){assertNotDetached(this);var doc=getRangeDocument(this);var el=doc.createElement("body");el.innerHTML=fragmentStr;return dom.fragmentFromNodeChildren(el);};var rangeProperties=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"];var s2s=0,s2e=1,e2e=2,e2s=3;var n_b=0,n_a=1,n_b_a=2,n_i=3;function RangePrototype(){}
RangePrototype.prototype={attachListener:function(type,listener){this._listeners[type].push(listener);},compareBoundaryPoints:function(how,range){assertRangeValid(this);assertSameDocumentOrFragment(this.startContainer,range.startContainer);var nodeA,offsetA,nodeB,offsetB;var prefixA=(how==e2s||how==s2s)?"start":"end";var prefixB=(how==s2e||how==s2s)?"start":"end";nodeA=this[prefixA+"Container"];offsetA=this[prefixA+"Offset"];nodeB=range[prefixB+"Container"];offsetB=range[prefixB+"Offset"];return dom.comparePoints(nodeA,offsetA,nodeB,offsetB);},insertNode:function(node){assertRangeValid(this);assertValidNodeType(node,insertableNodeTypes);assertNodeNotReadOnly(this.startContainer);if(dom.isAncestorOf(node,this.startContainer,true)){throw new DOMException("HIERARCHY_REQUEST_ERR");}
var firstNodeInserted=insertNodeAtPosition(node,this.startContainer,this.startOffset);this.setStartBefore(firstNodeInserted);},cloneContents:function(){assertRangeValid(this);var clone,frag;if(this.collapsed){return getRangeDocument(this).createDocumentFragment();}else{if(this.startContainer===this.endContainer&&dom.isCharacterDataNode(this.startContainer)){clone=this.startContainer.cloneNode(true);clone.data=clone.data.slice(this.startOffset,this.endOffset);frag=getRangeDocument(this).createDocumentFragment();frag.appendChild(clone);return frag;}else{var iterator=new RangeIterator(this,true);clone=cloneSubtree(iterator);iterator.detach();}
return clone;}},canSurroundContents:function(){assertRangeValid(this);assertNodeNotReadOnly(this.startContainer);assertNodeNotReadOnly(this.endContainer);var iterator=new RangeIterator(this,true);var boundariesInvalid=(iterator._first&&(isNonTextPartiallySelected(iterator._first,this))||(iterator._last&&isNonTextPartiallySelected(iterator._last,this)));iterator.detach();return!boundariesInvalid;},surroundContents:function(node){assertValidNodeType(node,surroundNodeTypes);if(!this.canSurroundContents()){throw new RangeException("BAD_BOUNDARYPOINTS_ERR");}
var content=this.extractContents();if(node.hasChildNodes()){while(node.lastChild){node.removeChild(node.lastChild);}}
insertNodeAtPosition(node,this.startContainer,this.startOffset);node.appendChild(content);this.selectNode(node);},cloneRange:function(){assertRangeValid(this);var range=new Range(getRangeDocument(this));var i=rangeProperties.length,prop;while(i--){prop=rangeProperties[i];range[prop]=this[prop];}
return range;},toString:function(){assertRangeValid(this);var sc=this.startContainer;if(sc===this.endContainer&&dom.isCharacterDataNode(sc)){return(sc.nodeType==3||sc.nodeType==4)?sc.data.slice(this.startOffset,this.endOffset):"";}else{var textBits=[],iterator=new RangeIterator(this,true);iterateSubtree(iterator,function(node){if(node.nodeType==3||node.nodeType==4){textBits.push(node.data);}});iterator.detach();return textBits.join("");}},compareNode:function(node){assertRangeValid(this);var parent=node.parentNode;var nodeIndex=dom.getNodeIndex(node);if(!parent){throw new DOMException("NOT_FOUND_ERR");}
var startComparison=this.comparePoint(parent,nodeIndex),endComparison=this.comparePoint(parent,nodeIndex+1);if(startComparison<0){return(endComparison>0)?n_b_a:n_b;}else{return(endComparison>0)?n_a:n_i;}},comparePoint:function(node,offset){assertRangeValid(this);assertNode(node,"HIERARCHY_REQUEST_ERR");assertSameDocumentOrFragment(node,this.startContainer);if(dom.comparePoints(node,offset,this.startContainer,this.startOffset)<0){return-1;}else if(dom.comparePoints(node,offset,this.endContainer,this.endOffset)>0){return 1;}
return 0;},createContextualFragment:createContextualFragment,toHtml:function(){assertRangeValid(this);var container=getRangeDocument(this).createElement("div");container.appendChild(this.cloneContents());return container.innerHTML;},intersectsNode:function(node,touchingIsIntersecting){assertRangeValid(this);assertNode(node,"NOT_FOUND_ERR");if(dom.getDocument(node)!==getRangeDocument(this)){return false;}
var parent=node.parentNode,offset=dom.getNodeIndex(node);assertNode(parent,"NOT_FOUND_ERR");var startComparison=dom.comparePoints(parent,offset,this.endContainer,this.endOffset),endComparison=dom.comparePoints(parent,offset+1,this.startContainer,this.startOffset);return touchingIsIntersecting?startComparison<=0&&endComparison>=0:startComparison<0&&endComparison>0;},isPointInRange:function(node,offset){assertRangeValid(this);assertNode(node,"HIERARCHY_REQUEST_ERR");assertSameDocumentOrFragment(node,this.startContainer);return(dom.comparePoints(node,offset,this.startContainer,this.startOffset)>=0)&&(dom.comparePoints(node,offset,this.endContainer,this.endOffset)<=0);},intersectsRange:function(range,touchingIsIntersecting){assertRangeValid(this);if(getRangeDocument(range)!=getRangeDocument(this)){throw new DOMException("WRONG_DOCUMENT_ERR");}
var startComparison=dom.comparePoints(this.startContainer,this.startOffset,range.endContainer,range.endOffset),endComparison=dom.comparePoints(this.endContainer,this.endOffset,range.startContainer,range.startOffset);return touchingIsIntersecting?startComparison<=0&&endComparison>=0:startComparison<0&&endComparison>0;},intersection:function(range){if(this.intersectsRange(range)){var startComparison=dom.comparePoints(this.startContainer,this.startOffset,range.startContainer,range.startOffset),endComparison=dom.comparePoints(this.endContainer,this.endOffset,range.endContainer,range.endOffset);var intersectionRange=this.cloneRange();if(startComparison==-1){intersectionRange.setStart(range.startContainer,range.startOffset);}
if(endComparison==1){intersectionRange.setEnd(range.endContainer,range.endOffset);}
return intersectionRange;}
return null;},union:function(range){if(this.intersectsRange(range,true)){var unionRange=this.cloneRange();if(dom.comparePoints(range.startContainer,range.startOffset,this.startContainer,this.startOffset)==-1){unionRange.setStart(range.startContainer,range.startOffset);}
if(dom.comparePoints(range.endContainer,range.endOffset,this.endContainer,this.endOffset)==1){unionRange.setEnd(range.endContainer,range.endOffset);}
return unionRange;}else{throw new RangeException("Ranges do not intersect");}},containsNode:function(node,allowPartial){if(allowPartial){return this.intersectsNode(node,false);}else{return this.compareNode(node)==n_i;}},containsNodeContents:function(node){return this.comparePoint(node,0)>=0&&this.comparePoint(node,dom.getNodeLength(node))<=0;},containsRange:function(range){return this.intersection(range).equals(range);},containsNodeText:function(node){var nodeRange=this.cloneRange();nodeRange.selectNode(node);var textNodes=nodeRange.getNodes([3]);if(textNodes.length>0){nodeRange.setStart(textNodes[0],0);var lastTextNode=textNodes.pop();nodeRange.setEnd(lastTextNode,lastTextNode.length);var contains=this.containsRange(nodeRange);nodeRange.detach();return contains;}else{return this.containsNodeContents(node);}},createNodeIterator:function(nodeTypes,filter){assertRangeValid(this);return new RangeNodeIterator(this,nodeTypes,filter);},getNodes:function(nodeTypes,filter){assertRangeValid(this);return getNodesInRange(this,nodeTypes,filter);},getDocument:function(){return getRangeDocument(this);},collapseBefore:function(node){assertNotDetached(this);this.setEndBefore(node);this.collapse(false);},collapseAfter:function(node){assertNotDetached(this);this.setStartAfter(node);this.collapse(true);},getName:function(){return"DomRange";},equals:function(range){return Range.rangesEqual(this,range);},isValid:function(){return isRangeValid(this);},inspect:function(){return inspect(this);}};function copyComparisonConstantsToObject(obj){obj.START_TO_START=s2s;obj.START_TO_END=s2e;obj.END_TO_END=e2e;obj.END_TO_START=e2s;obj.NODE_BEFORE=n_b;obj.NODE_AFTER=n_a;obj.NODE_BEFORE_AND_AFTER=n_b_a;obj.NODE_INSIDE=n_i;}
function copyComparisonConstants(constructor){copyComparisonConstantsToObject(constructor);copyComparisonConstantsToObject(constructor.prototype);}
function createRangeContentRemover(remover,boundaryUpdater){return function(){assertRangeValid(this);var sc=this.startContainer,so=this.startOffset,root=this.commonAncestorContainer;var iterator=new RangeIterator(this,true);var node,boundary;if(sc!==root){node=dom.getClosestAncestorIn(sc,root,true);boundary=getBoundaryAfterNode(node);sc=boundary.node;so=boundary.offset;}
iterateSubtree(iterator,assertNodeNotReadOnly);iterator.reset();var returnValue=remover(iterator);iterator.detach();boundaryUpdater(this,sc,so,sc,so);return returnValue;};}
function createPrototypeRange(constructor,boundaryUpdater,detacher){function createBeforeAfterNodeSetter(isBefore,isStart){return function(node){assertNotDetached(this);assertValidNodeType(node,beforeAfterNodeTypes);assertValidNodeType(getRootContainer(node),rootContainerNodeTypes);var boundary=(isBefore?getBoundaryBeforeNode:getBoundaryAfterNode)(node);(isStart?setRangeStart:setRangeEnd)(this,boundary.node,boundary.offset);};}
function setRangeStart(range,node,offset){var ec=range.endContainer,eo=range.endOffset;if(node!==range.startContainer||offset!==range.startOffset){if(getRootContainer(node)!=getRootContainer(ec)||dom.comparePoints(node,offset,ec,eo)==1){ec=node;eo=offset;}
boundaryUpdater(range,node,offset,ec,eo);}}
function setRangeEnd(range,node,offset){var sc=range.startContainer,so=range.startOffset;if(node!==range.endContainer||offset!==range.endOffset){if(getRootContainer(node)!=getRootContainer(sc)||dom.comparePoints(node,offset,sc,so)==-1){sc=node;so=offset;}
boundaryUpdater(range,sc,so,node,offset);}}
function setRangeStartAndEnd(range,node,offset){if(node!==range.startContainer||offset!==range.startOffset||node!==range.endContainer||offset!==range.endOffset){boundaryUpdater(range,node,offset,node,offset);}}
constructor.prototype=new RangePrototype();api.util.extend(constructor.prototype,{setStart:function(node,offset){assertNotDetached(this);assertNoDocTypeNotationEntityAncestor(node,true);assertValidOffset(node,offset);setRangeStart(this,node,offset);},setEnd:function(node,offset){assertNotDetached(this);assertNoDocTypeNotationEntityAncestor(node,true);assertValidOffset(node,offset);setRangeEnd(this,node,offset);},setStartBefore:createBeforeAfterNodeSetter(true,true),setStartAfter:createBeforeAfterNodeSetter(false,true),setEndBefore:createBeforeAfterNodeSetter(true,false),setEndAfter:createBeforeAfterNodeSetter(false,false),collapse:function(isStart){assertRangeValid(this);if(isStart){boundaryUpdater(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset);}else{boundaryUpdater(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset);}},selectNodeContents:function(node){assertNotDetached(this);assertNoDocTypeNotationEntityAncestor(node,true);boundaryUpdater(this,node,0,node,dom.getNodeLength(node));},selectNode:function(node){assertNotDetached(this);assertNoDocTypeNotationEntityAncestor(node,false);assertValidNodeType(node,beforeAfterNodeTypes);var start=getBoundaryBeforeNode(node),end=getBoundaryAfterNode(node);boundaryUpdater(this,start.node,start.offset,end.node,end.offset);},extractContents:createRangeContentRemover(extractSubtree,boundaryUpdater),deleteContents:createRangeContentRemover(deleteSubtree,boundaryUpdater),canSurroundContents:function(){assertRangeValid(this);assertNodeNotReadOnly(this.startContainer);assertNodeNotReadOnly(this.endContainer);var iterator=new RangeIterator(this,true);var boundariesInvalid=(iterator._first&&(isNonTextPartiallySelected(iterator._first,this))||(iterator._last&&isNonTextPartiallySelected(iterator._last,this)));iterator.detach();return!boundariesInvalid;},detach:function(){detacher(this);},splitBoundaries:function(){assertRangeValid(this);var sc=this.startContainer,so=this.startOffset,ec=this.endContainer,eo=this.endOffset;var startEndSame=(sc===ec);if(dom.isCharacterDataNode(ec)&&eo>0&&eo<ec.length){dom.splitDataNode(ec,eo);}
if(dom.isCharacterDataNode(sc)&&so>0&&so<sc.length){sc=dom.splitDataNode(sc,so);if(startEndSame){eo-=so;ec=sc;}else if(ec==sc.parentNode&&eo>=dom.getNodeIndex(sc)){eo++;}
so=0;}
boundaryUpdater(this,sc,so,ec,eo);},normalizeBoundaries:function(){assertRangeValid(this);var sc=this.startContainer,so=this.startOffset,ec=this.endContainer,eo=this.endOffset;var mergeForward=function(node){var sibling=node.nextSibling;if(sibling&&sibling.nodeType==node.nodeType){ec=node;eo=node.length;node.appendData(sibling.data);sibling.parentNode.removeChild(sibling);}};var mergeBackward=function(node){var sibling=node.previousSibling;if(sibling&&sibling.nodeType==node.nodeType){sc=node;var nodeLength=node.length;so=sibling.length;node.insertData(0,sibling.data);sibling.parentNode.removeChild(sibling);if(sc==ec){eo+=so;ec=sc;}else if(ec==node.parentNode){var nodeIndex=dom.getNodeIndex(node);if(eo==nodeIndex){ec=node;eo=nodeLength;}else if(eo>nodeIndex){eo--;}}}};var normalizeStart=true;if(dom.isCharacterDataNode(ec)){if(ec.length==eo){mergeForward(ec);}}else{if(eo>0){var endNode=ec.childNodes[eo-1];if(endNode&&dom.isCharacterDataNode(endNode)){mergeForward(endNode);}}
normalizeStart=!this.collapsed;}
if(normalizeStart){if(dom.isCharacterDataNode(sc)){if(so==0){mergeBackward(sc);}}else{if(so<sc.childNodes.length){var startNode=sc.childNodes[so];if(startNode&&dom.isCharacterDataNode(startNode)){mergeBackward(startNode);}}}}else{sc=ec;so=eo;}
boundaryUpdater(this,sc,so,ec,eo);},collapseToPoint:function(node,offset){assertNotDetached(this);assertNoDocTypeNotationEntityAncestor(node,true);assertValidOffset(node,offset);setRangeStartAndEnd(this,node,offset);}});copyComparisonConstants(constructor);}
function updateCollapsedAndCommonAncestor(range){range.collapsed=(range.startContainer===range.endContainer&&range.startOffset===range.endOffset);range.commonAncestorContainer=range.collapsed?range.startContainer:dom.getCommonAncestor(range.startContainer,range.endContainer);}
function updateBoundaries(range,startContainer,startOffset,endContainer,endOffset){var startMoved=(range.startContainer!==startContainer||range.startOffset!==startOffset);var endMoved=(range.endContainer!==endContainer||range.endOffset!==endOffset);range.startContainer=startContainer;range.startOffset=startOffset;range.endContainer=endContainer;range.endOffset=endOffset;updateCollapsedAndCommonAncestor(range);dispatchEvent(range,"boundarychange",{startMoved:startMoved,endMoved:endMoved});}
function detach(range){assertNotDetached(range);range.startContainer=range.startOffset=range.endContainer=range.endOffset=null;range.collapsed=range.commonAncestorContainer=null;dispatchEvent(range,"detach",null);range._listeners=null;}
function Range(doc){this.startContainer=doc;this.startOffset=0;this.endContainer=doc;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};updateCollapsedAndCommonAncestor(this);}
createPrototypeRange(Range,updateBoundaries,detach);api.rangePrototype=RangePrototype.prototype;Range.rangeProperties=rangeProperties;Range.RangeIterator=RangeIterator;Range.copyComparisonConstants=copyComparisonConstants;Range.createPrototypeRange=createPrototypeRange;Range.inspect=inspect;Range.getRangeDocument=getRangeDocument;Range.rangesEqual=function(r1,r2){return r1.startContainer===r2.startContainer&&r1.startOffset===r2.startOffset&&r1.endContainer===r2.endContainer&&r1.endOffset===r2.endOffset;};api.DomRange=Range;api.RangeException=RangeException;});rangy.createModule("WrappedRange",function(api,module){api.requireModules(["DomUtil","DomRange"]);var WrappedRange;var dom=api.dom;var DomPosition=dom.DomPosition;var DomRange=api.DomRange;function getTextRangeContainerElement(textRange){var parentEl=textRange.parentElement();var range=textRange.duplicate();range.collapse(true);var startEl=range.parentElement();range=textRange.duplicate();range.collapse(false);var endEl=range.parentElement();var startEndContainer=(startEl==endEl)?startEl:dom.getCommonAncestor(startEl,endEl);return startEndContainer==parentEl?startEndContainer:dom.getCommonAncestor(parentEl,startEndContainer);}
function textRangeIsCollapsed(textRange){return textRange.compareEndPoints("StartToEnd",textRange)==0;}
function getTextRangeBoundaryPosition(textRange,wholeRangeContainerElement,isStart,isCollapsed){var workingRange=textRange.duplicate();workingRange.collapse(isStart);var containerElement=workingRange.parentElement();if(!dom.isAncestorOf(wholeRangeContainerElement,containerElement,true)){containerElement=wholeRangeContainerElement;}
if(!containerElement.canHaveHTML){return new DomPosition(containerElement.parentNode,dom.getNodeIndex(containerElement));}
var workingNode=dom.getDocument(containerElement).createElement("span");var comparison,workingComparisonType=isStart?"StartToStart":"StartToEnd";var previousNode,nextNode,boundaryPosition,boundaryNode;do{containerElement.insertBefore(workingNode,workingNode.previousSibling);workingRange.moveToElementText(workingNode);}while((comparison=workingRange.compareEndPoints(workingComparisonType,textRange))>0&&workingNode.previousSibling);boundaryNode=workingNode.nextSibling;if(comparison==-1&&boundaryNode&&dom.isCharacterDataNode(boundaryNode)){workingRange.setEndPoint(isStart?"EndToStart":"EndToEnd",textRange);var offset;if(/[\r\n]/.test(boundaryNode.data)){var tempRange=workingRange.duplicate();var rangeLength=tempRange.text.replace(/\r\n/g,"\r").length;offset=tempRange.moveStart("character",rangeLength);while((comparison=tempRange.compareEndPoints("StartToEnd",tempRange))==-1){offset++;tempRange.moveStart("character",1);}}else{offset=workingRange.text.length;}
boundaryPosition=new DomPosition(boundaryNode,offset);}else{previousNode=(isCollapsed||!isStart)&&workingNode.previousSibling;nextNode=(isCollapsed||isStart)&&workingNode.nextSibling;if(nextNode&&dom.isCharacterDataNode(nextNode)){boundaryPosition=new DomPosition(nextNode,0);}else if(previousNode&&dom.isCharacterDataNode(previousNode)){boundaryPosition=new DomPosition(previousNode,previousNode.length);}else{boundaryPosition=new DomPosition(containerElement,dom.getNodeIndex(workingNode));}}
workingNode.parentNode.removeChild(workingNode);return boundaryPosition;}
function createBoundaryTextRange(boundaryPosition,isStart){var boundaryNode,boundaryParent,boundaryOffset=boundaryPosition.offset;var doc=dom.getDocument(boundaryPosition.node);var workingNode,childNodes,workingRange=doc.body.createTextRange();var nodeIsDataNode=dom.isCharacterDataNode(boundaryPosition.node);if(nodeIsDataNode){boundaryNode=boundaryPosition.node;boundaryParent=boundaryNode.parentNode;}else{childNodes=boundaryPosition.node.childNodes;boundaryNode=(boundaryOffset<childNodes.length)?childNodes[boundaryOffset]:null;boundaryParent=boundaryPosition.node;}
workingNode=doc.createElement("span");workingNode.innerHTML="&#feff;";if(boundaryNode){boundaryParent.insertBefore(workingNode,boundaryNode);}else{boundaryParent.appendChild(workingNode);}
workingRange.moveToElementText(workingNode);workingRange.collapse(!isStart);boundaryParent.removeChild(workingNode);if(nodeIsDataNode){workingRange[isStart?"moveStart":"moveEnd"]("character",boundaryOffset);}
return workingRange;}
if(api.features.implementsDomRange&&(!api.features.implementsTextRange||!api.config.preferTextRange)){(function(){var rangeProto;var rangeProperties=DomRange.rangeProperties;var canSetRangeStartAfterEnd;function updateRangeProperties(range){var i=rangeProperties.length,prop;while(i--){prop=rangeProperties[i];range[prop]=range.nativeRange[prop];}}
function updateNativeRange(range,startContainer,startOffset,endContainer,endOffset){var startMoved=(range.startContainer!==startContainer||range.startOffset!=startOffset);var endMoved=(range.endContainer!==endContainer||range.endOffset!=endOffset);if(startMoved||endMoved){range.setEnd(endContainer,endOffset);range.setStart(startContainer,startOffset);}}
function detach(range){range.nativeRange.detach();range.detached=true;var i=rangeProperties.length,prop;while(i--){prop=rangeProperties[i];range[prop]=null;}}
var createBeforeAfterNodeSetter;WrappedRange=function(range){if(!range){throw new Error("Range must be specified");}
this.nativeRange=range;updateRangeProperties(this);};DomRange.createPrototypeRange(WrappedRange,updateNativeRange,detach);rangeProto=WrappedRange.prototype;rangeProto.selectNode=function(node){this.nativeRange.selectNode(node);updateRangeProperties(this);};rangeProto.deleteContents=function(){this.nativeRange.deleteContents();updateRangeProperties(this);};rangeProto.extractContents=function(){var frag=this.nativeRange.extractContents();updateRangeProperties(this);return frag;};rangeProto.cloneContents=function(){return this.nativeRange.cloneContents();};rangeProto.surroundContents=function(node){this.nativeRange.surroundContents(node);updateRangeProperties(this);};rangeProto.collapse=function(isStart){this.nativeRange.collapse(isStart);updateRangeProperties(this);};rangeProto.cloneRange=function(){return new WrappedRange(this.nativeRange.cloneRange());};rangeProto.refresh=function(){updateRangeProperties(this);};rangeProto.toString=function(){return this.nativeRange.toString();};var testTextNode=document.createTextNode("test");dom.getBody(document).appendChild(testTextNode);var range=document.createRange();range.setStart(testTextNode,0);range.setEnd(testTextNode,0);try{range.setStart(testTextNode,1);canSetRangeStartAfterEnd=true;rangeProto.setStart=function(node,offset){this.nativeRange.setStart(node,offset);updateRangeProperties(this);};rangeProto.setEnd=function(node,offset){this.nativeRange.setEnd(node,offset);updateRangeProperties(this);};createBeforeAfterNodeSetter=function(name){return function(node){this.nativeRange[name](node);updateRangeProperties(this);};};}catch(ex){canSetRangeStartAfterEnd=false;rangeProto.setStart=function(node,offset){try{this.nativeRange.setStart(node,offset);}catch(ex){this.nativeRange.setEnd(node,offset);this.nativeRange.setStart(node,offset);}
updateRangeProperties(this);};rangeProto.setEnd=function(node,offset){try{this.nativeRange.setEnd(node,offset);}catch(ex){this.nativeRange.setStart(node,offset);this.nativeRange.setEnd(node,offset);}
updateRangeProperties(this);};createBeforeAfterNodeSetter=function(name,oppositeName){return function(node){try{this.nativeRange[name](node);}catch(ex){this.nativeRange[oppositeName](node);this.nativeRange[name](node);}
updateRangeProperties(this);};};}
rangeProto.setStartBefore=createBeforeAfterNodeSetter("setStartBefore","setEndBefore");rangeProto.setStartAfter=createBeforeAfterNodeSetter("setStartAfter","setEndAfter");rangeProto.setEndBefore=createBeforeAfterNodeSetter("setEndBefore","setStartBefore");rangeProto.setEndAfter=createBeforeAfterNodeSetter("setEndAfter","setStartAfter");range.selectNodeContents(testTextNode);if(range.startContainer==testTextNode&&range.endContainer==testTextNode&&range.startOffset==0&&range.endOffset==testTextNode.length){rangeProto.selectNodeContents=function(node){this.nativeRange.selectNodeContents(node);updateRangeProperties(this);};}else{rangeProto.selectNodeContents=function(node){this.setStart(node,0);this.setEnd(node,DomRange.getEndOffset(node));};}
range.selectNodeContents(testTextNode);range.setEnd(testTextNode,3);var range2=document.createRange();range2.selectNodeContents(testTextNode);range2.setEnd(testTextNode,4);range2.setStart(testTextNode,2);if(range.compareBoundaryPoints(range.START_TO_END,range2)==-1&range.compareBoundaryPoints(range.END_TO_START,range2)==1){rangeProto.compareBoundaryPoints=function(type,range){range=range.nativeRange||range;if(type==range.START_TO_END){type=range.END_TO_START;}else if(type==range.END_TO_START){type=range.START_TO_END;}
return this.nativeRange.compareBoundaryPoints(type,range);};}else{rangeProto.compareBoundaryPoints=function(type,range){return this.nativeRange.compareBoundaryPoints(type,range.nativeRange||range);};}
if(api.util.isHostMethod(range,"createContextualFragment")){rangeProto.createContextualFragment=function(fragmentStr){return this.nativeRange.createContextualFragment(fragmentStr);};}
dom.getBody(document).removeChild(testTextNode);range.detach();range2.detach();})();api.createNativeRange=function(doc){doc=doc||document;return doc.createRange();};}else if(api.features.implementsTextRange){WrappedRange=function(textRange){this.textRange=textRange;this.refresh();};WrappedRange.prototype=new DomRange(document);WrappedRange.prototype.refresh=function(){var start,end;var rangeContainerElement=getTextRangeContainerElement(this.textRange);if(textRangeIsCollapsed(this.textRange)){end=start=getTextRangeBoundaryPosition(this.textRange,rangeContainerElement,true,true);}else{start=getTextRangeBoundaryPosition(this.textRange,rangeContainerElement,true,false);end=getTextRangeBoundaryPosition(this.textRange,rangeContainerElement,false,false);}
this.setStart(start.node,start.offset);this.setEnd(end.node,end.offset);};DomRange.copyComparisonConstants(WrappedRange);var globalObj=(function(){return this;})();if(typeof globalObj.Range=="undefined"){globalObj.Range=WrappedRange;}
api.createNativeRange=function(doc){doc=doc||document;return doc.body.createTextRange();};}
if(api.features.implementsTextRange){WrappedRange.rangeToTextRange=function(range){if(range.collapsed){var tr=createBoundaryTextRange(new DomPosition(range.startContainer,range.startOffset),true);return tr;}else{var startRange=createBoundaryTextRange(new DomPosition(range.startContainer,range.startOffset),true);var endRange=createBoundaryTextRange(new DomPosition(range.endContainer,range.endOffset),false);var textRange=dom.getDocument(range.startContainer).body.createTextRange();textRange.setEndPoint("StartToStart",startRange);textRange.setEndPoint("EndToEnd",endRange);return textRange;}};}
WrappedRange.prototype.getName=function(){return"WrappedRange";};api.WrappedRange=WrappedRange;api.createRange=function(doc){doc=doc||document;return new WrappedRange(api.createNativeRange(doc));};api.createRangyRange=function(doc){doc=doc||document;return new DomRange(doc);};api.createIframeRange=function(iframeEl){return api.createRange(dom.getIframeDocument(iframeEl));};api.createIframeRangyRange=function(iframeEl){return api.createRangyRange(dom.getIframeDocument(iframeEl));};api.addCreateMissingNativeApiListener(function(win){var doc=win.document;if(typeof doc.createRange=="undefined"){doc.createRange=function(){return api.createRange(this);};}
doc=win=null;});});rangy.createModule("WrappedSelection",function(api,module){api.requireModules(["DomUtil","DomRange","WrappedRange"]);api.config.checkSelectionRanges=true;var BOOLEAN="boolean",windowPropertyName="_rangySelection",dom=api.dom,util=api.util,DomRange=api.DomRange,WrappedRange=api.WrappedRange,DOMException=api.DOMException,DomPosition=dom.DomPosition,getSelection,selectionIsCollapsed,CONTROL="Control";function getWinSelection(winParam){return(winParam||window).getSelection();}
function getDocSelection(winParam){return(winParam||window).document.selection;}
var implementsWinGetSelection=api.util.isHostMethod(window,"getSelection"),implementsDocSelection=api.util.isHostObject(document,"selection");var useDocumentSelection=implementsDocSelection&&(!implementsWinGetSelection||api.config.preferTextRange);if(useDocumentSelection){getSelection=getDocSelection;api.isSelectionValid=function(winParam){var doc=(winParam||window).document,nativeSel=doc.selection;return(nativeSel.type!="None"||dom.getDocument(nativeSel.createRange().parentElement())==doc);};}else if(implementsWinGetSelection){getSelection=getWinSelection;api.isSelectionValid=function(){return true;};}else{module.fail("Neither document.selection or window.getSelection() detected.");}
api.getNativeSelection=getSelection;var testSelection=getSelection();var testRange=api.createNativeRange(document);var body=dom.getBody(document);var selectionHasAnchorAndFocus=util.areHostObjects(testSelection,["anchorNode","focusNode"]&&util.areHostProperties(testSelection,["anchorOffset","focusOffset"]));api.features.selectionHasAnchorAndFocus=selectionHasAnchorAndFocus;var selectionHasExtend=util.isHostMethod(testSelection,"extend");api.features.selectionHasExtend=selectionHasExtend;var selectionHasRangeCount=(typeof testSelection.rangeCount=="number");api.features.selectionHasRangeCount=selectionHasRangeCount;var selectionSupportsMultipleRanges=false;var collapsedNonEditableSelectionsSupported=true;if(util.areHostMethods(testSelection,["addRange","getRangeAt","removeAllRanges"])&&typeof testSelection.rangeCount=="number"&&api.features.implementsDomRange){(function(){var iframe=document.createElement("iframe");iframe.frameBorder=0;iframe.style.position="absolute";iframe.style.left="-10000px";body.appendChild(iframe);var iframeDoc=dom.getIframeDocument(iframe);iframeDoc.open();iframeDoc.write("<html><head></head><body>12</body></html>");iframeDoc.close();var sel=dom.getIframeWindow(iframe).getSelection();var docEl=iframeDoc.documentElement;var iframeBody=docEl.lastChild,textNode=iframeBody.firstChild;var r1=iframeDoc.createRange();r1.setStart(textNode,1);r1.collapse(true);sel.addRange(r1);collapsedNonEditableSelectionsSupported=(sel.rangeCount==1);sel.removeAllRanges();var r2=r1.cloneRange();r1.setStart(textNode,0);r2.setEnd(textNode,2);sel.addRange(r1);sel.addRange(r2);selectionSupportsMultipleRanges=(sel.rangeCount==2);r1.detach();r2.detach();body.removeChild(iframe);})();}
api.features.selectionSupportsMultipleRanges=selectionSupportsMultipleRanges;api.features.collapsedNonEditableSelectionsSupported=collapsedNonEditableSelectionsSupported;var implementsControlRange=false,testControlRange;if(body&&util.isHostMethod(body,"createControlRange")){testControlRange=body.createControlRange();if(util.areHostProperties(testControlRange,["item","add"])){implementsControlRange=true;}}
api.features.implementsControlRange=implementsControlRange;if(selectionHasAnchorAndFocus){selectionIsCollapsed=function(sel){return sel.anchorNode===sel.focusNode&&sel.anchorOffset===sel.focusOffset;};}else{selectionIsCollapsed=function(sel){return sel.rangeCount?sel.getRangeAt(sel.rangeCount-1).collapsed:false;};}
function updateAnchorAndFocusFromRange(sel,range,backwards){var anchorPrefix=backwards?"end":"start",focusPrefix=backwards?"start":"end";sel.anchorNode=range[anchorPrefix+"Container"];sel.anchorOffset=range[anchorPrefix+"Offset"];sel.focusNode=range[focusPrefix+"Container"];sel.focusOffset=range[focusPrefix+"Offset"];}
function updateAnchorAndFocusFromNativeSelection(sel){var nativeSel=sel.nativeSelection;sel.anchorNode=nativeSel.anchorNode;sel.anchorOffset=nativeSel.anchorOffset;sel.focusNode=nativeSel.focusNode;sel.focusOffset=nativeSel.focusOffset;}
function updateEmptySelection(sel){sel.anchorNode=sel.focusNode=null;sel.anchorOffset=sel.focusOffset=0;sel.rangeCount=0;sel.isCollapsed=true;sel._ranges.length=0;}
function getNativeRange(range){var nativeRange;if(range instanceof DomRange){nativeRange=range._selectionNativeRange;if(!nativeRange){nativeRange=api.createNativeRange(dom.getDocument(range.startContainer));nativeRange.setEnd(range.endContainer,range.endOffset);nativeRange.setStart(range.startContainer,range.startOffset);range._selectionNativeRange=nativeRange;range.attachListener("detach",function(){this._selectionNativeRange=null;});}}else if(range instanceof WrappedRange){nativeRange=range.nativeRange;}else if(api.features.implementsDomRange&&(range instanceof dom.getWindow(range.startContainer).Range)){nativeRange=range;}
return nativeRange;}
function rangeContainsSingleElement(rangeNodes){if(!rangeNodes.length||rangeNodes[0].nodeType!=1){return false;}
for(var i=1,len=rangeNodes.length;i<len;++i){if(!dom.isAncestorOf(rangeNodes[0],rangeNodes[i])){return false;}}
return true;}
function getSingleElementFromRange(range){var nodes=range.getNodes();if(!rangeContainsSingleElement(nodes)){throw new Error("getSingleElementFromRange: range "+range.inspect()+" did not consist of a single element");}
return nodes[0];}
function isTextRange(range){return!!range&&typeof range.text!="undefined";}
function updateFromTextRange(sel,range){var wrappedRange=new WrappedRange(range);sel._ranges=[wrappedRange];updateAnchorAndFocusFromRange(sel,wrappedRange,false);sel.rangeCount=1;sel.isCollapsed=wrappedRange.collapsed;}
function updateControlSelection(sel){sel._ranges.length=0;if(sel.docSelection.type=="None"){updateEmptySelection(sel);}else{var controlRange=sel.docSelection.createRange();if(isTextRange(controlRange)){updateFromTextRange(sel,controlRange);}else{sel.rangeCount=controlRange.length;var range,doc=dom.getDocument(controlRange.item(0));for(var i=0;i<sel.rangeCount;++i){range=api.createRange(doc);range.selectNode(controlRange.item(i));sel._ranges.push(range);}
sel.isCollapsed=sel.rangeCount==1&&sel._ranges[0].collapsed;updateAnchorAndFocusFromRange(sel,sel._ranges[sel.rangeCount-1],false);}}}
function addRangeToControlSelection(sel,range){var controlRange=sel.docSelection.createRange();var rangeElement=getSingleElementFromRange(range);var doc=dom.getDocument(controlRange.item(0));var newControlRange=dom.getBody(doc).createControlRange();for(var i=0,len=controlRange.length;i<len;++i){newControlRange.add(controlRange.item(i));}
try{newControlRange.add(rangeElement);}catch(ex){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}
newControlRange.select();updateControlSelection(sel);}
var getSelectionRangeAt;if(util.isHostMethod(testSelection,"getRangeAt")){getSelectionRangeAt=function(sel,index){try{return sel.getRangeAt(index);}catch(ex){return null;}};}else if(selectionHasAnchorAndFocus){getSelectionRangeAt=function(sel){var doc=dom.getDocument(sel.anchorNode);var range=api.createRange(doc);range.setStart(sel.anchorNode,sel.anchorOffset);range.setEnd(sel.focusNode,sel.focusOffset);if(range.collapsed!==this.isCollapsed){range.setStart(sel.focusNode,sel.focusOffset);range.setEnd(sel.anchorNode,sel.anchorOffset);}
return range;};}
function WrappedSelection(selection,docSelection,win){this.nativeSelection=selection;this.docSelection=docSelection;this._ranges=[];this.win=win;this.refresh();}
api.getSelection=function(win){win=win||window;var sel=win[windowPropertyName];var nativeSel=getSelection(win),docSel=implementsDocSelection?getDocSelection(win):null;if(sel){sel.nativeSelection=nativeSel;sel.docSelection=docSel;sel.refresh(win);}else{sel=new WrappedSelection(nativeSel,docSel,win);win[windowPropertyName]=sel;}
return sel;};api.getIframeSelection=function(iframeEl){return api.getSelection(dom.getIframeWindow(iframeEl));};var selProto=WrappedSelection.prototype;function createControlSelection(sel,ranges){var doc=dom.getDocument(ranges[0].startContainer);var controlRange=dom.getBody(doc).createControlRange();for(var i=0,el;i<rangeCount;++i){el=getSingleElementFromRange(ranges[i]);try{controlRange.add(el);}catch(ex){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}
controlRange.select();updateControlSelection(sel);}
if(!useDocumentSelection&&selectionHasAnchorAndFocus&&util.areHostMethods(testSelection,["removeAllRanges","addRange"])){selProto.removeAllRanges=function(){this.nativeSelection.removeAllRanges();updateEmptySelection(this);};var addRangeBackwards=function(sel,range){var doc=DomRange.getRangeDocument(range);var endRange=api.createRange(doc);endRange.collapseToPoint(range.endContainer,range.endOffset);sel.nativeSelection.addRange(getNativeRange(endRange));sel.nativeSelection.extend(range.startContainer,range.startOffset);sel.refresh();};if(selectionHasRangeCount){selProto.addRange=function(range,backwards){if(implementsControlRange&&implementsDocSelection&&this.docSelection.type==CONTROL){addRangeToControlSelection(this,range);}else{if(backwards&&selectionHasExtend){addRangeBackwards(this,range);}else{var previousRangeCount;if(selectionSupportsMultipleRanges){previousRangeCount=this.rangeCount;}else{this.removeAllRanges();previousRangeCount=0;}
this.nativeSelection.addRange(getNativeRange(range));this.rangeCount=this.nativeSelection.rangeCount;if(this.rangeCount==previousRangeCount+1){if(api.config.checkSelectionRanges){var nativeRange=getSelectionRangeAt(this.nativeSelection,this.rangeCount-1);if(nativeRange&&!DomRange.rangesEqual(nativeRange,range)){range=new WrappedRange(nativeRange);}}
this._ranges[this.rangeCount-1]=range;updateAnchorAndFocusFromRange(this,range,selectionIsBackwards(this.nativeSelection));this.isCollapsed=selectionIsCollapsed(this);}else{this.refresh();}}}};}else{selProto.addRange=function(range,backwards){if(backwards&&selectionHasExtend){addRangeBackwards(this,range);}else{this.nativeSelection.addRange(getNativeRange(range));this.refresh();}};}
selProto.setRanges=function(ranges){if(implementsControlRange&&ranges.length>1){createControlSelection(this,ranges);}else{this.removeAllRanges();for(var i=0,len=ranges.length;i<len;++i){this.addRange(ranges[i]);}}};}else if(util.isHostMethod(testSelection,"empty")&&util.isHostMethod(testRange,"select")&&implementsControlRange&&useDocumentSelection){selProto.removeAllRanges=function(){try{this.docSelection.empty();if(this.docSelection.type!="None"){var doc;if(this.anchorNode){doc=dom.getDocument(this.anchorNode);}else if(this.docSelection.type==CONTROL){var controlRange=this.docSelection.createRange();if(controlRange.length){doc=dom.getDocument(controlRange.item(0)).body.createTextRange();}}
if(doc){var textRange=doc.body.createTextRange();textRange.select();this.docSelection.empty();}}}catch(ex){}
updateEmptySelection(this);};selProto.addRange=function(range){if(this.docSelection.type==CONTROL){addRangeToControlSelection(this,range);}else{WrappedRange.rangeToTextRange(range).select();this._ranges[0]=range;this.rangeCount=1;this.isCollapsed=this._ranges[0].collapsed;updateAnchorAndFocusFromRange(this,range,false);}};selProto.setRanges=function(ranges){this.removeAllRanges();var rangeCount=ranges.length;if(rangeCount>1){createControlSelection(this,ranges);}else if(rangeCount){this.addRange(ranges[0]);}};}else{module.fail("No means of selecting a Range or TextRange was found");return false;}
selProto.getRangeAt=function(index){if(index<0||index>=this.rangeCount){throw new DOMException("INDEX_SIZE_ERR");}else{return this._ranges[index];}};var refreshSelection;if(useDocumentSelection){refreshSelection=function(sel){var range;if(api.isSelectionValid(sel.win)){range=sel.docSelection.createRange();}else{range=dom.getBody(sel.win.document).createTextRange();range.collapse(true);}
if(sel.docSelection.type==CONTROL){updateControlSelection(sel);}else if(isTextRange(range)){updateFromTextRange(sel,range);}else{updateEmptySelection(sel);}};}else if(util.isHostMethod(testSelection,"getRangeAt")&&typeof testSelection.rangeCount=="number"){refreshSelection=function(sel){if(implementsControlRange&&implementsDocSelection&&sel.docSelection.type==CONTROL){updateControlSelection(sel);}else{sel._ranges.length=sel.rangeCount=sel.nativeSelection.rangeCount;if(sel.rangeCount){for(var i=0,len=sel.rangeCount;i<len;++i){sel._ranges[i]=new api.WrappedRange(sel.nativeSelection.getRangeAt(i));}
updateAnchorAndFocusFromRange(sel,sel._ranges[sel.rangeCount-1],selectionIsBackwards(sel.nativeSelection));sel.isCollapsed=selectionIsCollapsed(sel);}else{updateEmptySelection(sel);}}};}else if(selectionHasAnchorAndFocus&&typeof testSelection.isCollapsed==BOOLEAN&&typeof testRange.collapsed==BOOLEAN&&api.features.implementsDomRange){refreshSelection=function(sel){var range,nativeSel=sel.nativeSelection;if(nativeSel.anchorNode){range=getSelectionRangeAt(nativeSel,0);sel._ranges=[range];sel.rangeCount=1;updateAnchorAndFocusFromNativeSelection(sel);sel.isCollapsed=selectionIsCollapsed(sel);}else{updateEmptySelection(sel);}};}else{module.fail("No means of obtaining a Range or TextRange from the user's selection was found");return false;}
selProto.refresh=function(checkForChanges){var oldRanges=checkForChanges?this._ranges.slice(0):null;refreshSelection(this);if(checkForChanges){var i=oldRanges.length;if(i!=this._ranges.length){return false;}
while(i--){if(!DomRange.rangesEqual(oldRanges[i],this._ranges[i])){return false;}}
return true;}};var removeRangeManually=function(sel,range){var ranges=sel.getAllRanges(),removed=false;sel.removeAllRanges();for(var i=0,len=ranges.length;i<len;++i){if(removed||range!==ranges[i]){sel.addRange(ranges[i]);}else{removed=true;}}
if(!sel.rangeCount){updateEmptySelection(sel);}};if(implementsControlRange){selProto.removeRange=function(range){if(this.docSelection.type==CONTROL){var controlRange=this.docSelection.createRange();var rangeElement=getSingleElementFromRange(range);var doc=dom.getDocument(controlRange.item(0));var newControlRange=dom.getBody(doc).createControlRange();var el,removed=false;for(var i=0,len=controlRange.length;i<len;++i){el=controlRange.item(i);if(el!==rangeElement||removed){newControlRange.add(controlRange.item(i));}else{removed=true;}}
newControlRange.select();updateControlSelection(this);}else{removeRangeManually(this,range);}};}else{selProto.removeRange=function(range){removeRangeManually(this,range);};}
var selectionIsBackwards;if(!useDocumentSelection&&selectionHasAnchorAndFocus&&api.features.implementsDomRange){selectionIsBackwards=function(sel){var backwards=false;if(sel.anchorNode){backwards=(dom.comparePoints(sel.anchorNode,sel.anchorOffset,sel.focusNode,sel.focusOffset)==1);}
return backwards;};selProto.isBackwards=function(){return selectionIsBackwards(this);};}else{selectionIsBackwards=selProto.isBackwards=function(){return false;};}
selProto.toString=function(){var rangeTexts=[];for(var i=0,len=this.rangeCount;i<len;++i){rangeTexts[i]=""+this._ranges[i];}
return rangeTexts.join("");};function assertNodeInSameDocument(sel,node){if(sel.anchorNode&&(dom.getDocument(sel.anchorNode)!==dom.getDocument(node))){throw new DOMException("WRONG_DOCUMENT_ERR");}}
selProto.collapse=function(node,offset){assertNodeInSameDocument(this,node);var range=api.createRange(dom.getDocument(node));range.collapseToPoint(node,offset);this.removeAllRanges();this.addRange(range);this.isCollapsed=true;};selProto.collapseToStart=function(){if(this.rangeCount){var range=this._ranges[0];this.collapse(range.startContainer,range.startOffset);}else{throw new DOMException("INVALID_STATE_ERR");}};selProto.collapseToEnd=function(){if(this.rangeCount){var range=this._ranges[this.rangeCount-1];this.collapse(range.endContainer,range.endOffset);}else{throw new DOMException("INVALID_STATE_ERR");}};selProto.selectAllChildren=function(node){assertNodeInSameDocument(this,node);var range=api.createRange(dom.getDocument(node));range.selectNodeContents(node);this.removeAllRanges();this.addRange(range);};selProto.deleteFromDocument=function(){if(implementsControlRange&&implementsDocSelection&&this.docSelection.type==CONTROL){var controlRange=this.docSelection.createRange();var element;while(controlRange.length){element=controlRange.item(0);controlRange.remove(element);element.parentNode.removeChild(element);}
this.refresh();}else if(this.rangeCount){var ranges=this.getAllRanges();this.removeAllRanges();for(var i=0,len=ranges.length;i<len;++i){ranges[i].deleteContents();}
this.addRange(ranges[len-1]);}};selProto.getAllRanges=function(){return this._ranges.slice(0);};selProto.setSingleRange=function(range){this.setRanges([range]);};selProto.containsNode=function(node,allowPartial){for(var i=0,len=this._ranges.length;i<len;++i){if(this._ranges[i].containsNode(node,allowPartial)){return true;}}
return false;};selProto.toHtml=function(){var html="";if(this.rangeCount){var container=DomRange.getRangeDocument(this._ranges[0]).createElement("div");for(var i=0,len=this._ranges.length;i<len;++i){container.appendChild(this._ranges[i].cloneContents());}
html=container.innerHTML;}
return html;};function inspect(sel){var rangeInspects=[];var anchor=new DomPosition(sel.anchorNode,sel.anchorOffset);var focus=new DomPosition(sel.focusNode,sel.focusOffset);var name=(typeof sel.getName=="function")?sel.getName():"Selection";if(typeof sel.rangeCount!="undefined"){for(var i=0,len=sel.rangeCount;i<len;++i){rangeInspects[i]=DomRange.inspect(sel.getRangeAt(i));}}
return"["+name+"(Ranges: "+rangeInspects.join(", ")+")(anchor: "+anchor.inspect()+", focus: "+focus.inspect()+"]";}
selProto.getName=function(){return"WrappedSelection";};selProto.inspect=function(){return inspect(this);};selProto.detach=function(){this.win[windowPropertyName]=null;this.win=this.anchorNode=this.focusNode=null;};WrappedSelection.inspect=inspect;api.Selection=WrappedSelection;api.selectionPrototype=selProto;api.addCreateMissingNativeApiListener(function(win){if(typeof win.getSelection=="undefined"){win.getSelection=function(){return api.getSelection(this);};}
win=null;});});function getCharacterOffsetWithin(range,node){var treeWalker=document.createTreeWalker(node,NodeFilter.SHOW_TEXT,function(node){var nodeRange=document.createRange();nodeRange.selectNode(node);return nodeRange.compareBoundaryPoints(Range.END_TO_END,range)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;},false);var charCount=0;while(treeWalker.nextNode()){charCount+=treeWalker.currentNode.length;}
if(range.startContainer.nodeType==3){charCount+=range.startOffset;}
return charCount;}
function getCaretPosition(containerEl){var range=window.getSelection().getRangeAt(0);return getCharacterOffsetWithin(range,containerEl)}
function setCaretPosition(containerEl,index){var charIndex=0,stop={};function traverseNodes(node){if(node.nodeType==3){var nextCharIndex=charIndex+node.length;if(index>=charIndex&&index<=nextCharIndex){rangy.getSelection().collapse(node,index-charIndex);throw stop;}
charIndex=nextCharIndex;}
else if(node.nodeType==1&&/^(input|br|img|col|area|link|meta|link|param|base)$/i.test(node.nodeName)){charIndex+=1;}else{var child=node.firstChild;while(child){traverseNodes(child);child=child.nextSibling;}}}
try{traverseNodes(containerEl);}catch(ex){if(ex!=stop){throw ex;}}}
(function($)
{var uuid=0;"use strict";var Range=function(range)
{this[0]=range.startOffset;this[1]=range.endOffset;this.range=range;return this;};Range.prototype.equals=function()
{return this[0]===this[1];};$.fn.redactor=function(options)
{var val=[];var args=Array.prototype.slice.call(arguments,1);if(typeof options==='string')
{this.each(function()
{var instance=$.data(this,'redactor');if(typeof instance!=='undefined'&&$.isFunction(instance[options]))
{var methodVal=instance[options].apply(instance,args);if(methodVal!==undefined&&methodVal!==instance)val.push(methodVal);}
else return $.error('No such method "'+options+'" for Redactor');});}
else
{this.each(function()
{if(!$.data(this,'redactor'))$.data(this,'redactor',Redactor(this,options));});}
if(val.length===0)return this;else if(val.length===1)return val[0];else return val;};function Redactor(el,options)
{return new Redactor.prototype.init(el,options);}
$.Redactor=Redactor;$.Redactor.VERSION='9.1.9';$.Redactor.opts={rangy:false,iframe:false,fullpage:false,css:false,lang:'en',direction:'ltr',placeholder:false,wym:false,mobile:true,cleanup:true,tidyHtml:true,pastePlainText:false,removeEmptyTags:true,templateVars:false,xhtml:false,visual:true,focus:false,tabindex:false,autoresize:true,minHeight:false,maxHeight:false,shortcuts:true,autosave:false,autosaveInterval:60,plugins:false,linkAnchor:true,linkEmail:true,linkProtocol:'http://',linkNofollow:false,linkSize:50,imageFloatMargin:'10px',imageGetJson:false,imageUpload:false,imageUploadParam:'file',fileUpload:false,fileUploadParam:'file',clipboardUpload:true,clipboardUploadUrl:false,dragUpload:true,dnbImageTypes:['image/png','image/jpeg','image/gif'],s3:false,uploadFields:false,observeImages:true,observeLinks:true,modalOverlay:true,tabSpaces:false,tabFocus:true,air:false,airButtons:['formatting','|','bold','italic','deleted','|','unorderedlist','orderedlist','outdent','indent'],toolbar:true,toolbarFixed:false,toolbarFixedTarget:document,toolbarFixedTopOffset:0,toolbarFixedBox:false,toolbarExternal:false,buttonSource:true,buttonSeparator:'<li class="redactor_separator"></li>',buttonsCustom:{},buttonsAdd:[],buttons:['html','|','formatting','|','bold','italic','deleted','|','unorderedlist','orderedlist','outdent','indent','|','image','video','file','table','link','|','alignment','|','horizontalrule'],activeButtons:['deleted','italic','bold','underline','unorderedlist','orderedlist','alignleft','aligncenter','alignright','justify','table'],activeButtonsStates:{b:'bold',strong:'bold',i:'italic',em:'italic',del:'deleted',strike:'deleted',ul:'unorderedlist',ol:'orderedlist',u:'underline',tr:'table',td:'table',table:'table'},activeButtonsAdd:false,buttonsIcons:{bold:'Bold',italic:'Italic',unorderedlist:'BulletedList',orderedlist:'NumberedList',image:'Picture',link:'Link',file:'Attach',code:'Code'},formattingTags:['p','blockquote','pre','h1','h2','h3','h4','h5','h6'],linebreaks:false,paragraphy:true,convertDivs:true,convertLinks:true,convertImageLinks:false,convertVideoLinks:false,formattingPre:false,phpTags:false,allowedTags:false,deniedTags:['html','head','link','body','meta','script','style','applet'],boldTag:'strong',italicTag:'em',indentValue:20,buffer:[],rebuffer:[],textareamode:false,emptyHtml:'<p>&#x200b;</p>',invisibleSpace:'&#x200b;',rBlockTest:/^(P|H[1-6]|LI|ADDRESS|SECTION|HEADER|FOOTER|ASIDE|ARTICLE)$/i,alignmentTags:['P','H1','H2','H3','H4','H5','H6','DD','DL','DT','DIV','TD','BLOCKQUOTE','OUTPUT','FIGCAPTION','ADDRESS','SECTION','HEADER','FOOTER','ASIDE','ARTICLE'],ownLine:['area','body','head','hr','i?frame','link','meta','noscript','style','script','table','tbody','thead','tfoot'],contOwnLine:['li','dt','dt','h[1-6]','option','script'],newLevel:['blockquote','div','dl','fieldset','form','frameset','map','ol','p','pre','select','td','th','tr','ul'],blockLevelElements:['P','H1','H2','H3','H4','H5','H6','DD','DL','DT','DIV','LI','BLOCKQUOTE','OUTPUT','FIGCAPTION','PRE','ADDRESS','SECTION','HEADER','FOOTER','ASIDE','ARTICLE','TD'],langs:{en:{html:'HTML',video:pageContext.i18n.toolTipsInsertVideo,image:pageContext.i18n.inputImageForm,table:pageContext.i18n.toolTipsInsertTable,link:pageContext.i18n.toolTipLink,link_insert:pageContext.i18n.linkMenuInsertLink,link_edit:pageContext.i18n.linkMenuEditLink,unlink:pageContext.i18n.linkMenuUnlink,formatting:pageContext.i18n.formattingLabel,paragraph:pageContext.i18n.formattingParagraph,quote:pageContext.i18n.formattingQuote,code:pageContext.i18n.formattingCode,header:pageContext.i18n.formattingHeader,header1:'Header 1',header2:'Header 2',header3:'Header 3',header4:'Header 4',header5:'Header 5',bold:pageContext.i18n.formattingBold,italic:pageContext.i18n.formattingItalic,fontcolor:pageContext.i18n.formattingFontColor,backcolor:pageContext.i18n.formattingBackColor,unorderedlist:pageContext.i18n.toolTipsunorderedList,orderedlist:pageContext.i18n.toolTipsorderedList,outdent:pageContext.i18n.formattingOutdent,indent:pageContext.i18n.formattingIndent,cancel:pageContext.i18n.cancel,insert:pageContext.i18n.insert,save:pageContext.i18n.save,_delete:pageContext.i18n["delete"],insert_table:pageContext.i18n.tableInsert,insert_row_above:pageContext.i18n.tableInsertRowAbove,insert_row_below:pageContext.i18n.tableInsertRowBelow,insert_column_left:pageContext.i18n.tableInsertColumnLeft,insert_column_right:pageContext.i18n.tableInsertColumnRight,delete_column:pageContext.i18n.tableDeleteColumn,delete_row:pageContext.i18n.tableDeleteRow,delete_table:pageContext.i18n.tableDelete,rows:pageContext.i18n.tableRows,columns:pageContext.i18n.tableColumns,add_head:pageContext.i18n.tableAddHead,delete_head:pageContext.i18n.tableDeleteHead,title:pageContext.i18n.inputImageTitle,image_position:pageContext.i18n.inputImagePosition,none:pageContext.i18n.inputImagePositionNone,left:pageContext.i18n.inputImagePositionLeft,right:pageContext.i18n.inputImagePositionRight,image_web_link:'Image Web Link',text:pageContext.i18n.inputTextPrompt,mailto:pageContext.i18n.linkMenuMailto,web:pageContext.i18n.inputWebPrompt,video_html_code:'Video Embed Code',file:pageContext.i18n.toolTipsInsertFile,upload:pageContext.i18n.upload,download:pageContext.i18n.download,choose:pageContext.i18n.choose,or_choose:pageContext.i18n.uploadOrChoose,drop_file_here:pageContext.i18n.uploadDropFileHere,align_left:pageContext.i18n.formattingAlignLeft,align_center:pageContext.i18n.formattingAlignCenter,align_right:pageContext.i18n.formattingAlignRight,align_justify:pageContext.i18n.formattingAlignJustify,horizontalrule:pageContext.i18n.formattingHorizontalRule,deleted:pageContext.i18n.deleted,anchor:pageContext.i18n.linkMenuAnchor,link_new_tab:pageContext.i18n.inputLinkNewTab,underline:pageContext.i18n.formattingUnderline,alignment:pageContext.i18n.formattingAlignment,filename:pageContext.i18n.uploadFilenameOptional,edit:pageContext.i18n.edit}}};Redactor.fn=$.Redactor.prototype={keyCode:{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,TAB:9,CTRL:17,META:91,LEFT:37,LEFT_WIN:91},init:function(el,options)
{this.rtePaste=false;this.$element=this.$source=$(el);this.uuid=uuid++;var opts=$.extend(true,{},$.Redactor.opts);this.opts=$.extend({},opts,this.$element.data(),options);this.opts.title=el.placeholder||this.opts.title||"Text Editor";this.start=true;this.dropdowns=[];this.sourceHeight=this.$source.css('height');this.sourceWidth=this.$source.css('width');if(this.opts.fullpage)this.opts.iframe=true;if(this.opts.linebreaks)this.opts.paragraphy=false;if(this.opts.paragraphy)this.opts.linebreaks=false;if(this.opts.toolbarFixedBox)this.opts.toolbarFixed=true;this.document=document;this.window=window;this.savedSel=false;this.cleanlineBefore=new RegExp('^<(/?'+this.opts.ownLine.join('|/?')+'|'+this.opts.contOwnLine.join('|')+')[ >]');this.cleanlineAfter=new RegExp('^<(br|/?'+this.opts.ownLine.join('|/?')+'|/'+this.opts.contOwnLine.join('|/')+')[ >]');this.cleannewLevel=new RegExp('^</?('+this.opts.newLevel.join('|')+')[ >]');this.rTestBlock=new RegExp('^('+this.opts.blockLevelElements.join('|')+')$','i');if(this.opts.linebreaks===false)
{if(this.opts.allowedTags!==false)
{var arrSearch=['strong','em','del'];var arrAdd=['b','i','strike'];if($.inArray('p',this.opts.allowedTags)==='-1')this.opts.allowedTags.push('p');for(i in arrSearch)
{if($.inArray(arrSearch[i],this.opts.allowedTags)!='-1')this.opts.allowedTags.push(arrAdd[i]);}}
if(this.opts.deniedTags!==false)
{var pos=$.inArray('p',this.opts.deniedTags);if(pos!=='-1')this.opts.deniedTags.splice(pos,pos);}}
if(this.browser('msie')||this.browser('opera'))
{this.opts.buttons=this.removeFromArrayByValue(this.opts.buttons,'horizontalrule');}
this.opts.curLang=this.opts.langs[this.opts.lang];this.buildStart();},toolbarInit:function(lang)
{return{html:{title:lang.html,func:'toggle'},formatting:{title:lang.formatting,func:'show',dropdown:{p:{title:lang.paragraph,func:'formatBlocks'},blockquote:{title:lang.quote,func:'formatQuote',className:'redactor_format_blockquote'},pre:{title:lang.code,func:'formatBlocks',className:'redactor_format_pre'},h1:{title:lang.header+' 1',func:'formatBlocks',className:'redactor_format_h1'},h2:{title:lang.header+' 2',func:'formatBlocks',className:'redactor_format_h2'},h3:{title:lang.header+' 3',func:'formatBlocks',className:'redactor_format_h3'},h4:{title:lang.header+' 4',func:'formatBlocks',className:'redactor_format_h4'},h5:{title:lang.header+' 5',func:'formatBlocks',className:'redactor_format_h5'}}},bold:{title:lang.bold,exec:'bold'},italic:{title:lang.italic,exec:'italic'},deleted:{title:lang.deleted,exec:'strikethrough'},underline:{title:lang.underline,exec:'underline'},unorderedlist:{title:'&bull; '+lang.unorderedlist,exec:'insertunorderedlist'},orderedlist:{title:'1. '+lang.orderedlist,exec:'insertorderedlist'},outdent:{title:'< '+lang.outdent,func:'indentingOutdent'},indent:{title:'> '+lang.indent,func:'indentingIndent'},image:{title:lang.image,func:'imageShow'},video:{title:lang.video,func:'videoShow'},file:{title:lang.file,func:'fileShow'},table:{title:lang.table,func:'show',dropdown:{insert_table:{title:lang.insert_table,func:'tableShow'},separator_drop1:{name:'separator'},insert_row_above:{title:lang.insert_row_above,func:'tableAddRowAbove'},insert_row_below:{title:lang.insert_row_below,func:'tableAddRowBelow'},insert_column_left:{title:lang.insert_column_left,func:'tableAddColumnLeft'},insert_column_right:{title:lang.insert_column_right,func:'tableAddColumnRight'},separator_drop2:{name:'separator'},add_head:{title:lang.add_head,func:'tableAddHead'},delete_head:{title:lang.delete_head,func:'tableDeleteHead'},separator_drop3:{name:'separator'},delete_column:{title:lang.delete_column,func:'tableDeleteColumn'},delete_row:{title:lang.delete_row,func:'tableDeleteRow'},delete_table:{title:lang.delete_table,func:'tableDeleteTable'}}},link:{title:lang.link,func:'show',dropdown:{link:{title:lang.link_insert,func:'linkShow'},unlink:{title:lang.unlink,exec:'unlink'}}},fontcolor:{title:lang.fontcolor,func:'show'},backcolor:{title:lang.backcolor,func:'show'},alignment:{title:lang.alignment,func:'show',dropdown:{alignleft:{title:lang.align_left,func:'alignmentLeft'},aligncenter:{title:lang.align_center,func:'alignmentCenter'},alignright:{title:lang.align_right,func:'alignmentRight'},justify:{title:lang.align_justify,func:'alignmentJustify'}}},alignleft:{title:lang.align_left,func:'alignmentLeft'},aligncenter:{title:lang.align_center,func:'alignmentCenter'},alignright:{title:lang.align_right,func:'alignmentRight'},justify:{title:lang.align_justify,func:'alignmentJustify'},horizontalrule:{exec:'inserthorizontalrule',title:lang.horizontalrule}}},callback:function(type,event,data)
{var callback=this.opts[type+'Callback'];if($.isFunction(callback))
{if(event===false)return callback.call(this,data);else return callback.call(this,event,data);}
else return data;},destroy:function()
{clearInterval(this.autosaveInterval);$(window).off('.redactor');this.$source.off('redactor-textarea');this.$element.off('.redactor').removeData('redactor');var html=this.get();if(this.opts.textareamode)
{this.$box.after(this.$source);this.$box.remove();this.$source.val(html).show();}
else
{var $elem=this.$editor;if(this.opts.iframe)$elem=this.$element;this.$box.after($elem);this.$box.remove();$elem.removeClass('redactor_editor').removeClass('redactor_editor_wym').removeAttr('contenteditable').html(html).show();}
if(this.opts.air)
{$('#redactor_air_'+this.uuid).remove();}},getObject:function()
{return $.extend({},this);},getEditor:function()
{return this.$editor;},getBox:function()
{return this.$box;},getIframe:function()
{return(this.opts.iframe)?this.$frame:false;},getToolbar:function()
{return(this.$toolbar)?this.$toolbar:false;},get:function()
{return this.$source.val();},getCodeIframe:function()
{this.$editor.removeAttr('contenteditable').removeAttr('dir');var html=this.outerHtml(this.$frame.contents().children());this.$editor.attr({'contenteditable':true,'dir':this.opts.direction});return html;},set:function(html,strip,placeholderRemove)
{if(hasMarkdownSignature(html)){html=htmlFromMarkdown(html);html=html.replace(/<pre><code>/g,"<pre>");html=html.replace(/<\/pre><\/code>/g,"</pre>");strip=false;}
html=html.toString();html=html.replace(/\$/g,'&#36;');if(this.opts.fullpage)this.setCodeIframe(html);else this.setEditor(html,strip);if(html=='')placeholderRemove=false;if(placeholderRemove!==false)this.placeholderRemove();},setEditor:function(html,strip)
{if(strip!==false)
{html=this.cleanSavePreCode(html);html=this.cleanStripTags(html);html=this.cleanConvertProtected(html);html=this.cleanConvertInlineTags(html,true);if(this.opts.linebreaks===false)html=this.cleanConverters(html);else html=html.replace(/<p(.*?)>([\w\W]*?)<\/p>/gi,'$2<br>');}
html=html.replace(/&amp;#36;/g,'$');html=this.cleanEmpty(html);this.$editor.html(html);this.setNonEditable();this.setSpansVerified();this.sync();},setCodeIframe:function(html)
{var doc=this.iframePage();this.$frame[0].src="about:blank";html=this.cleanConvertProtected(html);html=this.cleanConvertInlineTags(html);html=this.cleanRemoveSpaces(html);doc.open();doc.write(html);doc.close();if(this.opts.fullpage)
{this.$editor=this.$frame.contents().find('body').attr({'contenteditable':true,'dir':this.opts.direction});}
this.setNonEditable();this.setSpansVerified();this.sync();},setFullpageOnInit:function(html)
{html=this.cleanSavePreCode(html,true);html=this.cleanConverters(html);html=this.cleanEmpty(html);this.$editor.html(html);this.setNonEditable();this.setSpansVerified();this.sync();},setSpansVerified:function()
{var spans=this.$editor.find('span');var replacementTag='inline';$.each(spans,function(){var outer=this.outerHTML;var regex=new RegExp('<'+this.tagName,'gi');var newTag=outer.replace(regex,'<'+replacementTag);regex=new RegExp('</'+this.tagName,'gi');newTag=newTag.replace(regex,'</'+replacementTag);$(this).replaceWith(newTag);});},setSpansVerifiedHtml:function(html)
{html=html.replace(/<span(.*?)>/,'<inline$1>');return html.replace(/<\/span>/,'</inline>');},setNonEditable:function()
{this.$editor.find('.noneditable').attr('contenteditable',false);},sync:function()
{var html='';this.cleanUnverified();if(this.opts.fullpage)html=this.getCodeIframe();else html=this.$editor.html();html=this.syncClean(html);html=this.cleanRemoveEmptyTags(html);html=html.replace(/<\/li><(ul|ol)>([\w\W]*?)<\/(ul|ol)>/gi,'<$1>$2</$1></li>');if($.trim(html)==='<br>')html='';if(this.opts.xhtml)
{var xhtmlTags=['br','hr','img','link','input','meta'];$.each(xhtmlTags,function(i,s)
{html=html.replace(new RegExp('<'+s+'(.*?[^\/$]?)>','gi'),'<'+s+'$1 />');});}
html=this.callback('syncBefore',false,html);this.$source.val(html);this.callback('syncAfter',false,html);if(this.start===false)
{this.callback('change',false,html);}},syncClean:function(html)
{if(!this.opts.fullpage)html=this.cleanStripTags(html);html=$.trim(html);html=this.placeholderRemoveFromCode(html);html=html.replace(/&#x200b;/gi,'');html=html.replace(/&#8203;/gi,'');html=html.replace(/<\/a>&nbsp;/gi,'<\/a> ');if(this.opts.linkNofollow)
{html=html.replace(/<a(.*?)rel="nofollow"(.*?)>/gi,'<a$1$2>');html=html.replace(/<a(.*?)>/gi,'<a$1 rel="nofollow">');}
html=html.replace('<!--?php','<?php');html=html.replace('?-->','?>');html=html.replace(/<(.*?)class="noeditable"(.*?) contenteditable="false"(.*?)>/gi,'<$1class="noeditable"$2$3>');html=html.replace(/ data-tagblock=""/gi,'');html=html.replace(/<br\s?\/?>\n?<\/(P|H[1-6]|LI|ADDRESS|SECTION|HEADER|FOOTER|ASIDE|ARTICLE)>/gi,'</$1>');html=html.replace(/<span(.*?)id="redactor-image-box"(.*?)>([\w\W]*?)<img(.*?)><\/span>/i,'$3<img$4>');html=html.replace(/<span(.*?)id="redactor-image-resizer"(.*?)>(.*?)<\/span>/i,'');html=html.replace(/<span(.*?)id="redactor-image-editter"(.*?)>(.*?)<\/span>/i,'');html=html.replace(/<font(.*?)>([\w\W]*?)<\/font>/gi,'$2');html=html.replace(/<span(.*?)>([\w\W]*?)<\/span>/gi,'$2');html=html.replace(/<inline>/gi,'<span>');html=html.replace(/<inline /gi,'<span ');html=html.replace(/<\/inline>/gi,'</span>');html=html.replace(/<span(.*?)class="redactor_placeholder"(.*?)>([\w\W]*?)<\/span>/gi,'');html=html.replace(/<span>([\w\W]*?)<\/span>/gi,'$1');html=html.replace(/&amp;/gi,'&');html=html.replace(/™/gi,'&trade;');html=html.replace(/©/gi,'&copy;');html=this.cleanReConvertProtected(html);return html;},buildStart:function()
{this.content='';this.$box=$('<div class="redactor_box" />');if(this.$source[0].tagName==='TEXTAREA')this.opts.textareamode=true;if(this.opts.mobile===false&&this.isMobile())
{this.buildMobile();}
else
{this.buildContent();if(this.opts.iframe)
{this.opts.autoresize=false;this.iframeStart();}
else if(this.opts.textareamode)this.buildFromTextarea();else this.buildFromElement();if(!this.opts.iframe)
{this.buildOptions();this.buildAfter();}}},buildMobile:function()
{if(!this.opts.textareamode)
{this.$editor=this.$source;this.$editor.hide();this.$source=this.buildCodearea(this.$editor);this.$source.val(this.content);}
this.$box.insertAfter(this.$source).append(this.$source);},buildContent:function()
{if(this.opts.textareamode)this.content=$.trim(this.$source.val());else this.content=$.trim(this.$source.html());},buildFromTextarea:function()
{this.$editor=$('<div />');this.$box.insertAfter(this.$source).append(this.$editor).append(this.$source);this.buildAddClasses(this.$editor);this.buildEnable();},buildFromElement:function()
{this.$editor=this.$source;this.$source=this.buildCodearea(this.$editor);this.$box.insertAfter(this.$editor).append(this.$editor).append(this.$source);this.buildEnable();},buildCodearea:function($source)
{return $('<textarea />').attr('name',$source.attr('id')).css('height',this.sourceHeight);},buildAddClasses:function(el)
{$.each(this.$source.get(0).className.split(/\s+/),function(i,s)
{el.addClass('redactor_'+s);});},buildEnable:function()
{this.$editor.addClass('redactor_editor').attr({'contenteditable':true,'dir':this.opts.direction,'aria-label':this.opts.title||'Text Editor','role':'textbox'});this.$source.attr('dir',this.opts.direction).hide();this.set(this.content,true,false);},buildOptions:function()
{var $source=this.$editor;if(this.opts.iframe)$source=this.$frame;if(this.opts.tabindex)$source.attr('tabindex',this.opts.tabindex);if(this.opts.minHeight)$source.css('min-height',this.opts.minHeight+'px');if(this.opts.maxHeight)
{this.opts.autoresize=false;this.sourceHeight=this.opts.maxHeight;}
if(this.opts.wym)this.$editor.addClass('redactor_editor_wym');if(!this.opts.autoresize)$source.css('height',this.sourceHeight);},buildAfter:function()
{this.start=false;if(this.opts.toolbar)
{this.opts.toolbar=this.toolbarInit(this.opts.curLang);this.toolbarBuild();}
this.modalTemplatesInit();this.buildPlugins();this.buildBindKeyboard();if(this.opts.autosave)this.autosave();setTimeout($.proxy(this.observeStart,this),4);if(this.browser('mozilla'))
{try{this.document.execCommand('enableObjectResizing',false,false);this.document.execCommand('enableInlineTableEditing',false,false);}catch(e){}}
if(this.opts.focus)setTimeout($.proxy(this.focus,this),100);if(!this.opts.visual)
{setTimeout($.proxy(function()
{this.opts.visual=true;this.toggle(false);},this),200);}
this.callback('init');},buildBindKeyboard:function()
{this.dblEnter=0;if(this.opts.dragUpload&&this.opts.imageUpload!==false)
{this.$editor.on('drop.redactor',$.proxy(this.buildEventDrop,this));}
this.$editor.on('paste.redactor',$.proxy(this.buildEventPaste,this));this.$editor.on('keydown.redactor',$.proxy(this.buildEventKeydown,this));this.$editor.on('keyup.redactor',$.proxy(this.buildEventKeyup,this));if($.isFunction(this.opts.textareaKeydownCallback))
{this.$source.on('keydown.redactor-textarea',$.proxy(this.opts.textareaKeydownCallback,this));}
if($.isFunction(this.opts.focusCallback))
{this.$editor.on('focus.redactor',$.proxy(this.opts.focusCallback,this));}
var clickedElement;$(document).mousedown(function(e){clickedElement=$(e.target);});this.$editor.on('blur.redactor',$.proxy(function(e)
{if(!$(clickedElement).hasClass('redactor_toolbar')&&$(clickedElement).parents('.redactor_toolbar').size()==0)
{this.selectall=false;if($.isFunction(this.opts.blurCallback))this.callback('blur',e);}},this));},buildEventDrop:function(e)
{e=e.originalEvent||e;if(window.FormData===undefined||!e.dataTransfer)return true;var length=e.dataTransfer.files.length;if(length==0)return true;e.preventDefault();var file=e.dataTransfer.files[0];if(this.opts.dnbImageTypes!==false&&this.opts.dnbImageTypes.indexOf(file.type)==-1)
{return true;}
this.bufferSet();var progress=$('<div id="redactor-progress-drag" class="redactor-progress redactor-progress-striped"><div id="redactor-progress-bar" class="redactor-progress-bar" style="width: 100%;"></div></div>');$(document.body).append(progress);if(this.opts.s3===false)
{this.dragUploadAjax(this.opts.imageUpload,file,true,progress,e,this.opts.imageUploadParam);}
else
{this.s3uploadFile(file);}},buildEventPaste:function(e)
{var oldsafari=false;if(this.browser('webkit')&&navigator.userAgent.indexOf('Chrome')===-1)
{var arr=this.browser('version').split('.');if(arr[0]<536)oldsafari=true;}
if(oldsafari)return true;if(this.browser('opera'))return true;if(this.opts.clipboardUpload&&this.buildEventClipboardUpload(e))return true;if(this.opts.cleanup)
{this.rtePaste=true;this.selectionSave();if(!this.selectall)
{if(this.opts.autoresize===true&&this.fullscreen!==true)
{this.$editor.height(this.$editor.height());this.saveScroll=this.document.body.scrollTop;}
else
{this.saveScroll=this.$editor.scrollTop();}}
var frag=this.extractContent();setTimeout($.proxy(function()
{var pastedFrag=this.extractContent();this.$editor.append(frag);this.selectionRestore();var html=this.getFragmentHtml(pastedFrag);this.pasteClean(html);if(this.opts.autoresize===true&&this.fullscreen!==true)this.$editor.css('height','auto');},this),1);}},buildEventClipboardUpload:function(e)
{var event=e.originalEvent||e;this.clipboardFilePaste=false;if(typeof(event.clipboardData)==='undefined')return false;if(event.clipboardData.items)
{var file=event.clipboardData.items[0].getAsFile();if(file!==null)
{this.bufferSet();this.clipboardFilePaste=true;var reader=new FileReader();reader.onload=$.proxy(this.pasteClipboardUpload,this);reader.readAsDataURL(file);return true;}}
return false;},buildEventKeydown:function(e)
{if(this.rtePaste)return false;var key=e.which;var ctrl=e.ctrlKey||e.metaKey;var parent=this.getParent();var current=this.getCurrent();var block=this.getBlock();var pre=false;this.callback('keydown',e);this.imageResizeHide(false);if((parent&&$(parent).get(0).tagName==='PRE')||(current&&$(current).get(0).tagName==='PRE'))
{pre=true;if(key===this.keyCode.DOWN)this.insertAfterLastElement(block);}
if(key===this.keyCode.DOWN)
{if(parent&&$(parent)[0].tagName==='BLOCKQUOTE')this.insertAfterLastElement(parent);if(current&&$(current)[0].tagName==='BLOCKQUOTE')this.insertAfterLastElement(current);if(parent&&$(parent)[0].tagName==='P'&&$(parent).parent()[0].tagName=='BLOCKQUOTE')
{this.insertAfterLastElement(parent,$(parent).parent()[0]);}
if(current&&$(current)[0].tagName==='P'&&parent&&$(parent)[0].tagName=='BLOCKQUOTE')
{this.insertAfterLastElement(current,parent);}}
if(ctrl&&!e.shiftKey)this.shortcuts(e,key);if(ctrl&&key===90&&!e.shiftKey&&!e.altKey)
{e.preventDefault();if(this.opts.buffer.length)this.bufferUndo();else this.document.execCommand('undo',false,false);return;}
else if(ctrl&&key===90&&e.shiftKey&&!e.altKey)
{e.preventDefault();if(this.opts.rebuffer.length!=0)this.bufferRedo();else this.document.execCommand('redo',false,false);return;}
if(ctrl&&key===65)this.selectall=true;else if(key!=this.keyCode.LEFT_WIN&&!ctrl)this.selectall=false;if(key==this.keyCode.ENTER&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)
{if(this.browser('msie')&&(parent.nodeType==1&&(parent.tagName=='TD'||parent.tagName=='TH')))
{e.preventDefault();this.bufferSet();this.insertNode(document.createElement('br'));this.callback('enter',e);return false;}
if(block&&(block.tagName=='BLOCKQUOTE'||$(block).parent()[0].tagName=='BLOCKQUOTE'))
{if(this.isEndOfElement())
{if(this.dblEnter==1)
{var element;var last;if(block.tagName=='BLOCKQUOTE')
{last='br';element=block;}
else
{last='p';element=$(block).parent()[0];}
e.preventDefault();this.insertingAfterLastElement(element);this.dblEnter=0;if(last=='p')
{$(block).parent().find('p').last().remove();}
else
{var tmp=$.trim($(block).html());$(block).html(tmp.replace(/<br\s?\/?>$/i,''));}
return;}
else this.dblEnter++;}
else this.dblEnter++;}
if(pre===true)return this.buildEventKeydownPre(e,current);else
{if(!this.opts.linebreaks)
{if(block&&this.opts.rBlockTest.test(block.tagName))
{this.bufferSet();setTimeout($.proxy(function()
{var blockElem=this.getBlock();if(blockElem.tagName==='DIV'&&!$(blockElem).hasClass('redactor_editor'))
{var node=$('<p>'+this.opts.invisibleSpace+'</p>');$(blockElem).replaceWith(node);this.selectionStart(node);}},this),1);}
else if(block===false)
{this.bufferSet();var node=$('<p>'+this.opts.invisibleSpace+'</p>');this.insertNode(node[0]);this.selectionStart(node);this.callback('enter',e);return false;}}
if(this.opts.linebreaks)
{if(block&&this.opts.rBlockTest.test(block.tagName))
{this.bufferSet();setTimeout($.proxy(function()
{var blockElem=this.getBlock();if((blockElem.tagName==='DIV'||blockElem.tagName==='P')&&!$(blockElem).hasClass('redactor_editor'))
{this.replaceLineBreak(blockElem);}},this),1);}
else
{return this.buildEventKeydownInsertLineBreak(e);}}
if(block.tagName=='BLOCKQUOTE'||block.tagName=='FIGCAPTION')
{return this.buildEventKeydownInsertLineBreak(e);}}
this.callback('enter',e);}
else if(key===this.keyCode.ENTER&&(e.ctrlKey||e.shiftKey))
{this.bufferSet();e.preventDefault();this.insertLineBreak();}
if(key===this.keyCode.BACKSPACE)this.buildEventKeydownBackspace(current);},buildEventKeydownPre:function(e,current)
{e.preventDefault();this.bufferSet();var html=$(current).parent().text();this.insertNode(document.createTextNode('\n'));this.sync();this.callback('enter',e);return false;},buildEventKeydownTab:function(e,pre)
{if(!this.opts.tabFocus)return true;if(this.isEmpty(this.get())&&this.opts.tabSpaces===false)return true;e.preventDefault();if(pre===true&&!e.shiftKey)
{this.bufferSet();this.insertNode(document.createTextNode('\t'));this.sync();return false;}
else if(this.opts.tabSpaces!==false)
{this.bufferSet();this.insertNode(document.createTextNode(Array(this.opts.tabSpaces+1).join('\u00a0')));this.sync();return false;}
else
{if(!e.shiftKey)this.indentingIndent();else this.indentingOutdent();}
return false;},buildEventKeydownBackspace:function(current)
{if(typeof current.tagName!=='undefined'&&/^(H[1-6])$/i.test(current.tagName))
{var node;if(this.opts.linebreaks===false)node=$('<p>'+this.opts.invisibleSpace+'</p>');else node=$('<br>'+this.opts.invisibleSpace);$(current).replaceWith(node);this.selectionStart(node);}
if(typeof current.nodeValue!=='undefined'&&current.nodeValue!==null)
{if(current.remove&&current.nodeType===3&&current.nodeValue.match(/[^/\u200B]/g)==null)
{current.remove();}}},buildEventKeydownInsertLineBreak:function(e)
{this.bufferSet();e.preventDefault();this.insertLineBreak();this.callback('enter',e);return;},buildEventKeyup:function(e)
{if(this.rtePaste)return false;var key=e.which;var parent=this.getParent();var current=this.getCurrent();if(!this.opts.linebreaks&&current.nodeType==3&&(parent==false||parent.tagName=='BODY'))
{var node=$('<p>').append($(current).clone());$(current).replaceWith(node);var next=$(node).next();if(typeof(next[0])!=='undefined'&&next[0].tagName=='BR')
{next.remove();}
this.selectionEnd(node);}
if((this.opts.convertLinks||this.opts.convertImageLinks||this.opts.convertVideoLinks)&&key===this.keyCode.ENTER)
{this.buildEventKeyupConverters();}
if(key===this.keyCode.DELETE||key===this.keyCode.BACKSPACE)
{return this.formatEmpty(e);}
this.callback('keyup',e);this.sync();},buildEventKeyupConverters:function()
{this.formatLinkify(this.opts.linkProtocol,this.opts.convertLinks,this.opts.convertImageLinks,this.opts.convertVideoLinks,this.opts.linkSize);setTimeout($.proxy(function()
{if(this.opts.convertImageLinks)this.observeImages();if(this.opts.observeLinks)this.observeLinks();},this),5);},buildPlugins:function()
{if(!this.opts.plugins)return;$.each(this.opts.plugins,$.proxy(function(i,s)
{if(RedactorPlugins[s])
{$.extend(this,RedactorPlugins[s]);if($.isFunction(RedactorPlugins[s].init))this.init();}},this));},iframeStart:function()
{this.iframeCreate();if(this.opts.textareamode)this.iframeAppend(this.$source);else
{this.$sourceOld=this.$source.hide();this.$source=this.buildCodearea(this.$sourceOld);this.iframeAppend(this.$sourceOld);}},iframeAppend:function(el)
{this.$source.attr('dir',this.opts.direction).hide();this.$box.insertAfter(el).append(this.$frame).append(this.$source);},iframeCreate:function()
{this.$frame=$('<iframe style="width: 100%;" frameborder="0" />').one('load',$.proxy(function()
{if(this.opts.fullpage)
{this.iframePage();if(this.content==='')this.content=this.opts.invisibleSpace;this.$frame.contents()[0].write(this.content);this.$frame.contents()[0].close();var timer=setInterval($.proxy(function()
{if(this.$frame.contents().find('body').html())
{clearInterval(timer);this.iframeLoad();}},this),0);}
else this.iframeLoad();},this));},iframeDoc:function()
{return this.$frame[0].contentWindow.document;},iframePage:function()
{var doc=this.iframeDoc();if(doc.documentElement)doc.removeChild(doc.documentElement);return doc;},iframeAddCss:function(css)
{css=css||this.opts.css;if(this.isString(css))
{this.$frame.contents().find('head').append('<link rel="stylesheet" href="'+css+'" />');}
if($.isArray(css))
{$.each(css,$.proxy(function(i,url)
{this.iframeAddCss(url);},this));}},iframeLoad:function()
{this.$editor=this.$frame.contents().find('body').attr({'contenteditable':true,'dir':this.opts.direction});if(this.$editor[0])
{this.document=this.$editor[0].ownerDocument;this.window=this.document.defaultView||window;}
this.iframeAddCss();if(this.opts.fullpage)this.setFullpageOnInit(this.$editor.html());else this.set(this.content,true,false);this.buildOptions();this.buildAfter();},placeholderStart:function(html)
{if(this.isEmpty(html))
{if(this.$element.attr('placeholder'))this.opts.placeholder=this.$element.attr('placeholder');if(this.opts.placeholder==='')this.opts.placeholder=false;if(this.opts.placeholder!==false)
{this.opts.focus=false;this.$editor.one('focus',$.proxy(this.placeholderFocus,this));return $('<span class="redactor_placeholder" data-redactor="verified">').attr('contenteditable',false).text(this.opts.placeholder);}}
else{this.$editor.off('focus');}
return false;},placeholderFocus:function()
{this.$editor.find('span.redactor_placeholder').remove();var html='';if(this.opts.linebreaks===false)html=this.opts.emptyHtml;this.$editor.off('focus.redactor_placeholder');this.$editor.html(html);if(this.opts.linebreaks===false)
{this.selectionStart(this.$editor.children()[0]);}
else
{this.focus();}
this.sync();},placeholderRemove:function()
{this.opts.placeholder=false;this.$editor.find('span.redactor_placeholder').remove();this.$editor.off('focus.redactor_placeholder');},placeholderRemoveFromCode:function(html)
{return html.replace(/<span class="redactor_placeholder"(.*?)>(.*?)<\/span>/i,'');},shortcuts:function(e,key)
{if(!this.opts.shortcuts)return;if(!e.altKey)
{if(key===77)this.shortcutsLoad(e,'removeFormat');else if(key===66)this.shortcutsLoad(e,'bold');else if(key===73)this.shortcutsLoad(e,'italic');else if(key===74)this.shortcutsLoad(e,'insertunorderedlist');else if(key===75)this.shortcutsLoad(e,'insertorderedlist');else if(key===72)this.shortcutsLoad(e,'superscript');else if(key===76)this.shortcutsLoad(e,'subscript');}},shortcutsLoad:function(e,cmd)
{e.preventDefault();this.execCommand(cmd,false);},shortcutsLoadFormat:function(e,cmd)
{e.preventDefault();this.formatBlocks(cmd);},focus:function()
{if(!this.browser('opera'))this.window.setTimeout($.proxy(this.focusSet,this,true),1);else this.$editor.focus();},focusEnd:function()
{this.focusSet();},focusSet:function(collapse)
{this.$editor.focus();var range=this.getRange();range.selectNodeContents(this.$editor[0]);range.collapse(collapse||false);var sel=this.getSelection();sel.removeAllRanges();sel.addRange(range);},toggle:function(direct)
{if(this.opts.visual)this.toggleCode(direct);else this.toggleVisual();},toggleVisual:function()
{var html=this.$source.hide().val();if(typeof this.modified!=='undefined')
{this.modified=this.cleanRemoveSpaces(this.modified,false)!==this.cleanRemoveSpaces(html,false);}
if(this.modified)
{if(this.opts.fullpage&&html==='')this.setFullpageOnInit(html);else
{this.set(html);if(this.opts.fullpage)this.buildBindKeyboard();}}
if(this.opts.iframe)this.$frame.show();else this.$editor.show();if(this.opts.fullpage)this.$editor.attr('contenteditable',true);this.$source.off('keydown.redactor-textarea-indenting');this.$editor.focus();this.selectionRestore();this.observeStart();this.buttonActiveVisual();this.buttonInactive('html');this.opts.visual=true;},toggleCode:function(direct)
{if(direct!==false)this.selectionSave();var height=null;if(this.opts.iframe)
{height=this.$frame.height();if(this.opts.fullpage)this.$editor.removeAttr('contenteditable');this.$frame.hide();}
else
{height=this.$editor.innerHeight();this.$editor.hide();}
var html=this.$source.val();if(html!==''&&this.opts.tidyHtml)
{this.$source.val(this.cleanHtml(html));}
this.modified=html;this.$source.height(height).show().focus();this.$source.on('keydown.redactor-textarea-indenting',this.textareaIndenting);this.buttonInactiveVisual();this.buttonActive('html');this.opts.visual=false;},textareaIndenting:function(e)
{if(e.keyCode===9)
{var $el=$(this);var start=$el.get(0).selectionStart;$el.val($el.val().substring(0,start)+"\t"+$el.val().substring($el.get(0).selectionEnd));$el.get(0).selectionStart=$el.get(0).selectionEnd=start+1;return false;}},autosave:function()
{var savedHtml=false;this.autosaveInterval=setInterval($.proxy(function()
{var html=this.get();if(savedHtml!==html)
{$.ajax({url:this.opts.autosave,type:'post',data:this.$source.attr('name')+'='+escape(encodeURIComponent(html)),success:$.proxy(function(data)
{this.callback('autosave',false,data);savedHtml=html;},this)});}},this),this.opts.autosaveInterval*1000);},toolbarBuild:function()
{if(this.opts.air)
{this.opts.buttons=this.opts.airButtons;}
else
{if(!this.opts.buttonSource)
{var index=this.opts.buttons.indexOf('html'),next=this.opts.buttons[index+1];this.opts.buttons.splice(index,1);if(next==='|')this.opts.buttons.splice(index,1);}}
$.extend(this.opts.toolbar,this.opts.buttonsCustom);$.each(this.opts.buttonsAdd,$.proxy(function(i,s)
{this.opts.buttons.push(s);},this));if(this.opts.toolbar)
{$.each(this.opts.toolbar.formatting.dropdown,$.proxy(function(i,s)
{if($.inArray(i,this.opts.formattingTags)=='-1')delete this.opts.toolbar.formatting.dropdown[i];},this));}
if(this.opts.buttons.length===0)return false;this.airEnable();this.$toolbar=$('<ul>').addClass('redactor_toolbar').attr('id','redactor_toolbar_'+this.uuid);if(this.opts.air)
{this.$air=$('<div class="redactor_air">').attr('id','redactor_air_'+this.uuid).hide();this.$air.append(this.$toolbar);$('body').append(this.$air);}
else
{if(this.opts.toolbarExternal)$(this.opts.toolbarExternal).html(this.$toolbar);else this.$box.append(this.$toolbar);}
$.each(this.opts.buttons,$.proxy(function(i,btnName)
{if(btnName==='|')this.$toolbar.append($(this.opts.buttonSeparator));else if(this.opts.toolbar[btnName])
{var btnObject=this.opts.toolbar[btnName];if(this.opts.fileUpload===false&&btnName==='file')return true;this.$toolbar.append($('<li>').append(this.buttonBuild(btnName,btnObject)));}},this));this.$toolbar.find('a').attr('tabindex','-1');if(this.opts.toolbarFixed)
{this.toolbarObserveScroll();$(this.opts.toolbarFixedTarget).on('scroll.redactor',$.proxy(this.toolbarObserveScroll,this));}
if(this.opts.activeButtons)
{var buttonActiveObserver=$.proxy(this.buttonActiveObserver,this);this.$editor.on('mouseup.redactor keyup.redactor',buttonActiveObserver);}},toolbarObserveScroll:function()
{var scrollTop=$(this.opts.toolbarFixedTarget).scrollTop();var boxTop=this.$box.offset().top;var left=0;var end=boxTop+this.$box.height()+40;if(scrollTop>boxTop)
{var width='100%';if(this.opts.toolbarFixedBox)
{left=this.$box.offset().left;width=this.$box.innerWidth();this.$toolbar.addClass('toolbar_fixed_box');}
this.toolbarFixed=true;this.$toolbar.css({position:'fixed',width:width,zIndex:1005,top:this.opts.toolbarFixedTopOffset+'px',left:left});if(scrollTop<end)this.$toolbar.css('visibility','visible');else this.$toolbar.css('visibility','hidden');}
else
{this.toolbarFixed=false;this.$toolbar.css({position:'relative',width:'auto',top:0,left:left});if(this.opts.toolbarFixedBox)this.$toolbar.removeClass('toolbar_fixed_box');}},airEnable:function()
{if(!this.opts.air)return;this.$editor.on('mouseup.redactor keyup.redactor',this,$.proxy(function(e)
{var text=this.getSelectionText();if(e.type==='mouseup'&&text!='')this.airShow(e);if(e.type==='keyup'&&e.shiftKey&&text!='')
{var $focusElem=$(this.getElement(this.getSelection().focusNode)),offset=$focusElem.offset();offset.height=$focusElem.height();this.airShow(offset,true);}},this));},airShow:function(e,keyboard)
{if(!this.opts.air)return;var left,top;$('.redactor_air').hide();if(keyboard)
{left=e.left;top=e.top+e.height+14;if(this.opts.iframe)
{top+=this.$box.position().top-$(this.document).scrollTop();left+=this.$box.position().left;}}
else
{var width=this.$air.innerWidth();left=e.clientX;if($(this.document).width()<(left+width))left-=width;top=e.clientY+14;if(this.opts.iframe)
{top+=this.$box.position().top;left+=this.$box.position().left;}
else top+=$(this.document).scrollTop();}
this.$air.css({left:left+'px',top:top+'px'}).show();this.airBindHide();},airBindHide:function()
{if(!this.opts.air)return;var hideHandler=$.proxy(function(doc)
{$(doc).on('mousedown.redactor',$.proxy(function(e)
{if($(e.target).closest(this.$toolbar).length===0)
{this.$air.fadeOut(100);this.selectionRemove();$(doc).off(e);}},this)).on('keydown.redactor',$.proxy(function(e)
{if(e.which===this.keyCode.ESC)
{this.getSelection().collapseToStart();}
this.$air.fadeOut(100);$(doc).off(e);},this));},this);hideHandler(document);if(this.opts.iframe)hideHandler(this.document);},airBindMousemoveHide:function()
{if(!this.opts.air)return;var hideHandler=$.proxy(function(doc)
{$(doc).on('mousemove.redactor',$.proxy(function(e)
{if($(e.target).closest(this.$toolbar).length===0)
{this.$air.fadeOut(100);$(doc).off(e);}},this));},this);hideHandler(document);if(this.opts.iframe)hideHandler(this.document);},dropdownBuild:function($dropdown,dropdownObject)
{$.each(dropdownObject,$.proxy(function(btnName,btnObject)
{if(!btnObject.className)btnObject.className='';var $item;if(btnObject.name==='separator')$item=$('<a class="redactor_separator_drop">');else
{$item=$('<a href="#" class="'+btnObject.className+' redactor_dropdown_'+btnName+'">'+btnObject.title+'</a>');$item.on('click',$.proxy(function(e)
{if(e.preventDefault)e.preventDefault();if(this.browser('msie'))e.returnValue=false;if(btnObject.callback)btnObject.callback.call(this,btnName,$item,btnObject,e);if(btnObject.exec)this.execCommand(btnObject.exec,btnName);if(btnObject.func)this[btnObject.func](btnName);this.buttonActiveObserver();if(this.opts.air)this.$air.fadeOut(100);},this));}
$dropdown.append($item);},this));},dropdownShow:function(e,key)
{if(!this.opts.visual)
{e.preventDefault();return false;}
var $dropdown=this.$toolbar.find('.redactor_dropdown_box_'+key);var $button=this.buttonGet(key);if($button.hasClass('dropact'))this.dropdownHideAll();else
{this.dropdownHideAll();this.buttonActive(key);$button.addClass('dropact');var keyPosition=$button.position();if(this.toolbarFixed)
{keyPosition=$button.offset();}
var dropdownWidth=$dropdown.width();if((keyPosition.left+dropdownWidth)>$(document).width())
{keyPosition.left-=dropdownWidth;}
var left=keyPosition.left+'px';var btnHeight=29;var position='absolute';var top=btnHeight+'px';if(this.opts.toolbarFixed&&this.toolbarFixed)position='fixed';else if(!this.opts.air)top=keyPosition.top+btnHeight+'px';$dropdown.css({position:position,left:left,top:top}).show();}
var hdlHideDropDown=$.proxy(function(e)
{this.dropdownHide(e,$dropdown);},this);$(document).one('click',hdlHideDropDown);this.$editor.one('click',hdlHideDropDown);e.stopPropagation();this.$editor.focus();},dropdownHideAll:function()
{this.$toolbar.find('button.dropact').removeClass('redactor_act').removeClass('dropact');$('.redactor_dropdown').hide();},dropdownHide:function(e,$dropdown)
{if(!$(e.target).hasClass('dropact'))
{$dropdown.removeClass('dropact');this.dropdownHideAll();}},buttonBuild:function(btnName,btnObject)
{var $button=$('<button title="'+btnObject.title+'" tabindex="0" class="redactor_btn redactor_btn_'+btnName+'"><i class="ms-Icon ms-Icon--'+this.opts.buttonsIcons[btnName]+'" aria-hidden="true"></i></button>');$button.on('click',$.proxy(function(e)
{if(e.preventDefault)e.preventDefault();if(this.browser('msie'))e.returnValue=false;if($button.hasClass('redactor_button_disabled'))return false;if(this.isFocused()===false&&!btnObject.exec)
{this.$editor.focus();}
if(btnObject.exec)
{this.$editor.focus();this.execCommand(btnObject.exec,btnName);this.airBindMousemoveHide();}
else if(btnObject.func&&btnObject.func!=='show')
{this[btnObject.func](btnName);this.airBindMousemoveHide();}
else if(btnObject.callback)
{btnObject.callback.call(this,btnName,$button,btnObject,e);this.airBindMousemoveHide();}
else if(btnObject.dropdown)
{this.dropdownShow(e,btnName);}
this.buttonActiveObserver(false,btnName);},this));if(btnObject.dropdown)
{var $dropdown=$('<div class="redactor_dropdown redactor_dropdown_box_'+btnName+'" style="display: none;">');$dropdown.appendTo(this.$toolbar);this.dropdownBuild($dropdown,btnObject.dropdown);}
return $button;},buttonGet:function(key)
{if(!this.opts.toolbar)return false;return $(this.$toolbar.find('button.redactor_btn_'+key));},buttonActiveToggle:function(key)
{var btn=this.buttonGet(key);if(btn.hasClass('redactor_act'))btn.removeClass('redactor_act');else btn.addClass('redactor_act');},buttonActive:function(key)
{this.buttonGet(key).addClass('redactor_act');},buttonInactive:function(key)
{this.buttonGet(key).removeClass('redactor_act');},buttonInactiveAll:function(btnName)
{$.each(this.opts.toolbar,$.proxy(function(k)
{if(k!=btnName)this.buttonInactive(k);},this));},buttonActiveVisual:function()
{this.$toolbar.find('button.redactor_btn').not('button.redactor_btn_html').removeClass('redactor_button_disabled');},buttonInactiveVisual:function()
{this.$toolbar.find('button.redactor_btn').not('button.redactor_btn_html').addClass('redactor_button_disabled');},buttonChangeIcon:function(key,classname)
{this.buttonGet(key).addClass('redactor_btn_'+classname);},buttonRemoveIcon:function(key,classname)
{this.buttonGet(key).removeClass('redactor_btn_'+classname);},buttonAddSeparator:function()
{this.$toolbar.append($(this.opts.buttonSeparator));},buttonAddSeparatorAfter:function(key)
{this.buttonGet(key).parent().after($(this.opts.buttonSeparator));},buttonAddSeparatorBefore:function(key)
{this.buttonGet(key).parent().before($(this.opts.buttonSeparator));},buttonRemoveSeparatorAfter:function(key)
{this.buttonGet(key).parent().next().remove();},buttonRemoveSeparatorBefore:function(key)
{this.buttonGet(key).parent().prev().remove();},buttonSetRight:function(key)
{if(!this.opts.toolbar)return;this.buttonGet(key).parent().addClass('redactor_btn_right');},buttonSetLeft:function(key)
{if(!this.opts.toolbar)return;this.buttonGet(key).parent().removeClass('redactor_btn_right');},buttonAdd:function(key,title,callback,dropdown)
{if(!this.opts.toolbar)return;var btn=this.buttonBuild(key,{title:title,callback:callback,dropdown:dropdown});this.$toolbar.append($('<li>').append(btn));},buttonAddFirst:function(key,title,callback,dropdown)
{if(!this.opts.toolbar)return;var btn=this.buttonBuild(key,{title:title,callback:callback,dropdown:dropdown});this.$toolbar.prepend($('<li>').append(btn));},buttonAddAfter:function(afterkey,key,title,callback,dropdown)
{if(!this.opts.toolbar)return;var btn=this.buttonBuild(key,{title:title,callback:callback,dropdown:dropdown});var $btn=this.buttonGet(afterkey);if($btn.size()!==0)$btn.parent().after($('<li>').append(btn));else this.$toolbar.append($('<li>').append(btn));},buttonAddBefore:function(beforekey,key,title,callback,dropdown)
{if(!this.opts.toolbar)return;var btn=this.buttonBuild(key,{title:title,callback:callback,dropdown:dropdown});var $btn=this.buttonGet(beforekey);if($btn.size()!==0)$btn.parent().before($('<li>').append(btn));else this.$toolbar.append($('<li>').append(btn));},buttonRemove:function(key,separator)
{var $btn=this.buttonGet(key);if(separator)$btn.parent().next().remove();$btn.parent().removeClass('redactor_btn_right');$btn.remove();},buttonActiveObserver:function(e,btnName)
{var parent=this.getParent();this.buttonInactiveAll(btnName);if(e===false&&btnName!=='html')
{if($.inArray(btnName,this.opts.activeButtons)!=-1)
{this.buttonActiveToggle(btnName);}
return;}
if(parent&&parent.tagName==='A')this.$toolbar.find('button.redactor_dropdown_link').text(this.opts.curLang.link_edit);else this.$toolbar.find('button.redactor_dropdown_link').text(this.opts.curLang.link_insert);if(this.opts.activeButtonsAdd)
{$.each(this.opts.activeButtonsAdd,$.proxy(function(i,s)
{this.opts.activeButtons.push(s);},this));$.extend(this.opts.activeButtonsStates,this.opts.activeButtonsAdd);}
$.each(this.opts.activeButtonsStates,$.proxy(function(key,value)
{if($(parent).closest(key,this.$editor.get()[0]).length!=0)
{this.buttonActive(value);}},this));var $parent=$(parent).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0]);if($parent.length)
{var align=$parent.css('text-align');switch(align)
{case'right':this.buttonActive('alignright');break;case'center':this.buttonActive('aligncenter');break;case'justify':this.buttonActive('justify');break;default:this.buttonActive('alignleft');break;}}},execPasteFrag:function(html)
{var sel=this.getSelection();if(sel.getRangeAt&&sel.rangeCount)
{range=sel.getRangeAt(0);range.deleteContents();var el=document.createElement("div");el.innerHTML=html;var frag=document.createDocumentFragment(),node,lastNode;while((node=el.firstChild))
{lastNode=frag.appendChild(node);}
var firstNode=frag.firstChild;range.insertNode(frag);if(lastNode)
{range=range.cloneRange();range.setStartAfter(lastNode);range.collapse(true);sel.removeAllRanges();sel.addRange(range);}}},exec:function(cmd,param,sync)
{if(cmd==='formatblock'&&this.browser('msie'))param='<'+param+'>';if(cmd==='inserthtml'&&this.browser('msie'))
{if(!this.isIe11())
{this.$editor.focus();this.document.selection.createRange().pasteHTML(param);}
else this.execPasteFrag(param);}
else
{this.document.execCommand(cmd,false,param);}
if(sync!==false)this.sync();this.callback('execCommand',cmd,param);},execCommand:function(cmd,param,sync)
{if(!this.opts.visual)
{this.$source.focus();return false;}
if(cmd==='inserthtml')
{this.insertHtml(param,sync);this.callback('execCommand',cmd,param);return;}
if(this.currentOrParentIs('PRE')&&!this.opts.formattingPre)return false;if(cmd==='insertunorderedlist'||cmd==='insertorderedlist')return this.execLists(cmd,param);if(cmd==='unlink')return this.execUnlink(cmd,param);this.exec(cmd,param,sync);if(cmd==='inserthorizontalrule')this.$editor.find('hr').removeAttr('id');},execUnlink:function(cmd,param)
{this.bufferSet();var link=this.currentOrParentIs('A');if(link)
{$(link).replaceWith($("<div>").text($(link).text()).html());this.sync();this.callback('execCommand',cmd,param);return;}},execLists:function(cmd,param)
{this.bufferSet();var parent=this.getParent();var $list=$(parent).closest('ol, ul');var remove=false;if($list.length)
{remove=true;var listTag=$list[0].tagName;if((cmd==='insertunorderedlist'&&listTag==='OL')||(cmd==='insertorderedlist'&&listTag==='UL'))
{remove=false;}}
this.selectionSave();if(remove)
{var nodes=this.getNodes();var elems=this.getBlocks(nodes);if(typeof nodes[0]!='undefined'&&nodes.length>1&&nodes[0].nodeType==3)
{elems.unshift(this.getBlock());}
var data='',replaced='';$.each(elems,$.proxy(function(i,s)
{if(s.tagName=='LI')
{var $s=$(s);var cloned=$s.clone();cloned.find('ul','ol').remove();if(this.opts.linebreaks===false)data+=this.outerHtml($('<p>').append(cloned.contents()));else data+=cloned.html()+'<br>';if(i==0)
{$s.addClass('redactor-replaced').empty();replaced=this.outerHtml($s);}
else $s.remove();}},this));html=this.$editor.html().replace(replaced,'</'+listTag+'>'+data+'<'+listTag+'>');this.$editor.html(html);this.$editor.find(listTag+':empty').remove();}
else
{var firstParent=this.getParent();this.document.execCommand(cmd);var parent=this.getParent();var $list=$(parent).closest('ol, ul');if(firstParent&&firstParent.tagName=='TD')
{$list.wrapAll('<td>');}
if($list.length)
{var li=$list.children().first();if($.trim($(li).text())=='')
{var marker=$('<span id="selection-marker-1"></span>');$(li).prepend(marker);}
if((this.browser('msie')||this.browser('mozilla'))&&parent.tagName!=='LI')
{$(parent).replaceWith($(parent).html());}
var $listParent=$list.parent();if(this.isParentRedactor($listParent)&&this.nodeTestBlocks($listParent[0]))
{$listParent.replaceWith($listParent.contents());}}
if(this.browser('mozilla'))this.$editor.focus();}
this.selectionRestore();$(marker).remove();this.sync();this.callback('execCommand',cmd,param);return;},indentingIndent:function()
{this.indentingStart('indent');},indentingOutdent:function()
{this.indentingStart('outdent');},indentingStart:function(cmd)
{this.bufferSet();if(cmd==='indent')
{var block=this.getBlock();this.selectionSave();if(block&&block.tagName=='LI')
{var parent=this.getParent();var $list=$(parent).closest('ol, ul');var listTag=$list[0].tagName;var elems=this.getBlocks();$.each(elems,function(i,s)
{if(s.tagName=='LI')
{var $prev=$(s).prev();if($prev.size()!=0&&$prev[0].tagName=='LI')
{var $childList=$prev.children('ul, ol');if($childList.size()==0)
{$prev.append($('<'+listTag+'>').append(s));}
else $childList.append(s);}}});}
else if(block===false&&this.opts.linebreaks===true)
{this.exec('formatBlock','blockquote');var newblock=this.getBlock();var block=$('<div data-tagblock="">').html($(newblock).html());$(newblock).replaceWith(block);var left=this.normalize($(block).css('margin-left'))+this.opts.indentValue;$(block).css('margin-left',left+'px');}
else
{var elements=this.getBlocks();$.each(elements,$.proxy(function(i,elem)
{var $el=false;if(elem.tagName==='TD')return;if($.inArray(elem.tagName,this.opts.alignmentTags)!==-1)
{$el=$(elem);}
else
{$el=$(elem).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0]);}
var left=this.normalize($el.css('margin-left'))+this.opts.indentValue;$el.css('margin-left',left+'px');},this));}
this.selectionRestore();}
else
{this.selectionSave();var block=this.getBlock();if(block&&block.tagName=='LI')
{var elems=this.getBlocks();var index=0;this.insideOutdent(block,index,elems);}
else
{var elements=this.getBlocks();$.each(elements,$.proxy(function(i,elem)
{var $el=false;if($.inArray(elem.tagName,this.opts.alignmentTags)!==-1)
{$el=$(elem);}
else
{$el=$(elem).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0]);}
var left=this.normalize($el.css('margin-left'))-this.opts.indentValue;if(left<=0)
{if(this.opts.linebreaks===true&&typeof($el.data('tagblock'))!=='undefined')
{$el.replaceWith($el.html());}
else
{$el.css('margin-left','');this.removeEmptyAttr($el,'style');}}
else
{$el.css('margin-left',left+'px');}},this));}
this.selectionRestore();}
this.sync();},insideOutdent:function(li,index,elems)
{if(li&&li.tagName=='LI')
{var $parent=$(li).parent().parent();if($parent.size()!=0&&$parent[0].tagName=='LI')
{$parent.after(li);}
else
{if(typeof elems[index]!='undefined')
{li=elems[index];index++;this.insideOutdent(li,index,elems);}
else
{this.execCommand('insertunorderedlist');}}}},alignmentLeft:function()
{this.alignmentSet('','JustifyLeft');},alignmentRight:function()
{this.alignmentSet('right','JustifyRight');},alignmentCenter:function()
{this.alignmentSet('center','JustifyCenter');},alignmentJustify:function()
{this.alignmentSet('justify','JustifyFull');},alignmentSet:function(type,cmd)
{this.bufferSet();if(this.oldIE())
{this.document.execCommand(cmd,false,false);return true;}
this.selectionSave();var block=this.getBlock();if(!block&&this.opts.linebreaks)
{this.exec('formatBlock','blockquote');var newblock=this.getBlock();var block=$('<div data-tagblock="">').html($(newblock).html());$(newblock).replaceWith(block);$(block).css('text-align',type);this.removeEmptyAttr(block,'style');if(type==''&&typeof($(block).data('tagblock'))!=='undefined')
{$(block).replaceWith($(block).html());}}
else
{var elements=this.getBlocks();$.each(elements,$.proxy(function(i,elem)
{var $el=false;if($.inArray(elem.tagName,this.opts.alignmentTags)!==-1)
{$el=$(elem);}
else
{$el=$(elem).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0]);}
if($el)
{$el.css('text-align',type);this.removeEmptyAttr($el,'style');}},this));}
this.selectionRestore();this.sync();},cleanEmpty:function(html)
{var ph=this.placeholderStart(html);if(ph!==false)return ph;if(this.opts.linebreaks===false)
{if(html==='')html=this.opts.emptyHtml;else if(html.search(/^<hr\s?\/?>$/gi)!==-1)html='<hr>'+this.opts.emptyHtml;}
return html;},cleanConverters:function(html)
{if(this.opts.convertDivs)html=html.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,'<p$1>$2</p>');if(this.opts.paragraphy)html=this.cleanParagraphy(html);return html;},cleanConvertProtected:function(html)
{if(this.opts.templateVars)
{html=html.replace(/\{\{(.*?)\}\}/gi,'<!-- template double $1 -->');html=html.replace(/\{(.*?)\}/gi,'<!-- template $1 -->');}
html=html.replace(/<script(.*?)>([\w\W]*?)<\/script>/gi,'<title type="text/javascript" style="display: none;" class="redactor-script-tag"$1>$2</title>');html=html.replace(/<style(.*?)>([\w\W]*?)<\/style>/gi,'<section$1 style="display: none;" rel="redactor-style-tag">$2</section>');html=html.replace(/<form(.*?)>([\w\W]*?)<\/form>/gi,'<section$1 rel="redactor-form-tag">$2</section>');if(this.opts.phpTags)html=html.replace(/<\?php([\w\W]*?)\?>/gi,'<section style="display: none;" rel="redactor-php-tag">$1</section>');else html=html.replace(/<\?php([\w\W]*?)\?>/gi,'');return html;},cleanReConvertProtected:function(html)
{if(this.opts.templateVars)
{html=html.replace(/<!-- template double (.*?) -->/gi,'{{$1}}');html=html.replace(/<!-- template (.*?) -->/gi,'{$1}');}
html=html.replace(/<title type="text\/javascript" style="display: none;" class="redactor-script-tag"(.*?)>([\w\W]*?)<\/title>/gi,'<script$1 type="text/javascript">$2</script>');html=html.replace(/<section(.*?) style="display: none;" rel="redactor-style-tag">([\w\W]*?)<\/section>/gi,'<style$1>$2</style>');html=html.replace(/<section(.*?)rel="redactor-form-tag"(.*?)>([\w\W]*?)<\/section>/gi,'<form$1$2>$3</form>');if(this.opts.phpTags)html=html.replace(/<section style="display: none;" rel="redactor-php-tag">([\w\W]*?)<\/section>/gi,'<?php\r\n$1\r\n?>');return html;},cleanRemoveSpaces:function(html,buffer)
{if(buffer!==false)
{var buffer=[]
var matches=html.match(/<(pre|style|script|title)(.*?)>([\w\W]*?)<\/(pre|style|script|title)>/gi);if(matches===null)matches=[];if(this.opts.phpTags)
{var phpMatches=html.match(/<\?php([\w\W]*?)\?>/gi);if(phpMatches)matches=$.merge(matches,phpMatches);}
if(matches)
{$.each(matches,function(i,s)
{html=html.replace(s,'buffer_'+i);buffer.push(s);});}}
html=html.replace(/\n/g,' ');html=html.replace(/[\t]*/g,'');html=html.replace(/\n\s*\n/g,"\n");html=html.replace(/^[\s\n]*/g,' ');html=html.replace(/[\s\n]*$/g,' ');html=html.replace(/>\s{2,}</g,'> <');html=this.cleanReplacer(html,buffer);html=html.replace(/\n\n/g,"\n");return html;},cleanReplacer:function(html,buffer)
{if(buffer===false)return html;$.each(buffer,function(i,s)
{html=html.replace('buffer_'+i,s);});return html;},cleanRemoveEmptyTags:function(html)
{html=html.replace(/<span>([\w\W]*?)<\/span>/gi,'$1');html=html.replace(/[\u200B-\u200D\uFEFF]/g,'');var etagsInline=["<b>\\s*</b>","<b>&nbsp;</b>","<em>\\s*</em>"]
var etags=["<pre></pre>","<blockquote>\\s*</blockquote>","<dd></dd>","<dt></dt>","<ul></ul>","<ol></ol>","<li></li>","<table></table>","<tr></tr>","<span>\\s*<span>","<span>&nbsp;<span>","<p>\\s*</p>","<p></p>","<p>&nbsp;</p>","<p>\\s*<br>\\s*</p>","<div>\\s*</div>","<div>\\s*<br>\\s*</div>"];if(this.opts.removeEmptyTags)
{etags=etags.concat(etagsInline);}
else etags=etagsInline;var len=etags.length;for(var i=0;i<len;++i)
{html=html.replace(new RegExp(etags[i],'gi'),"");}
return html;},cleanParagraphy:function(html)
{html=$.trim(html);if(this.opts.linebreaks===true)return html;if(html===''||html==='<p></p>')return this.opts.emptyHtml;html=html+"\n";var safes=[];var matches=html.match(/<(table|div|pre|object)(.*?)>([\w\W]*?)<\/(table|div|pre|object)>/gi);if(!matches)matches=[];var commentsMatches=html.match(/<!--([\w\W]*?)-->/gi);if(commentsMatches)matches=$.merge(matches,commentsMatches);if(this.opts.phpTags)
{var phpMatches=html.match(/<section(.*?)rel="redactor-php-tag">([\w\W]*?)<\/section>/gi);if(phpMatches)matches=$.merge(matches,phpMatches);}
if(matches)
{$.each(matches,function(i,s)
{safes[i]=s;html=html.replace(s,'{replace'+i+'}\n');});}
html=html.replace(/<br \/>\s*<br \/>/gi,"\n\n");function R(str,mod,r)
{return html.replace(new RegExp(str,mod),r);}
var blocks='(comment|html|body|head|title|meta|style|script|link|iframe|table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';html=R('(<'+blocks+'[^>]*>)','gi',"\n$1");html=R('(</'+blocks+'>)','gi',"$1\n\n");html=R("\r\n",'g',"\n");html=R("\r",'g',"\n");html=R("/\n\n+/",'g',"\n\n");var htmls=html.split(new RegExp('\n\s*\n','g'),-1);html='';for(var i in htmls)
{if(htmls.hasOwnProperty(i))
{if(htmls[i].search('{replace')==-1)
{htmls[i]=htmls[i].replace(/<p>\n\t<\/p>/gi,'');htmls[i]=htmls[i].replace(/<p><\/p>/gi,'');if(htmls[i]!='')
{html+='<p>'+htmls[i].replace(/^\n+|\n+$/g,"")+"</p>";}}
else html+=htmls[i];}}
html=R('<p>\s*</p>','gi','');html=R('<p>([^<]+)</(div|address|form)>','gi',"<p>$1</p></$2>");html=R('<p>\s*(</?'+blocks+'[^>]*>)\s*</p>','gi',"$1");html=R("<p>(<li.+?)</p>",'gi',"$1");html=R('<p>\s*(</?'+blocks+'[^>]*>)','gi',"$1");html=R('(</?'+blocks+'[^>]*>)\s*</p>','gi',"$1");html=R('(</?'+blocks+'[^>]*>)\s*<br />','gi',"$1");html=R('<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)','gi','$1');html=R("\n</p>",'gi','</p>');html=R('<li><p>','gi','<li>');html=R('</p></li>','gi','</li>');html=R('</li><p>','gi','</li>');html=R('<p>\t?\n?<p>','gi','<p>');html=R('</dt><p>','gi','</dt>');html=R('</dd><p>','gi','</dd>');html=R('<br></p></blockquote>','gi','</blockquote>');html=R('<p>\t*</p>','gi','');$.each(safes,function(i,s)
{html=html.replace('{replace'+i+'}',s);});return $.trim(html);},cleanConvertInlineTags:function(html,set)
{var boldTag='strong';if(this.opts.boldTag==='b')boldTag='b';var italicTag='em';if(this.opts.italicTag==='i')italicTag='i';html=html.replace(/<span style="font-style: italic;">([\w\W]*?)<\/span>/gi,'<'+italicTag+'>$1</'+italicTag+'>');html=html.replace(/<span style="font-weight: bold;">([\w\W]*?)<\/span>/gi,'<'+boldTag+'>$1</'+boldTag+'>');if(this.opts.boldTag==='strong')html=html.replace(/<b>([\w\W]*?)<\/b>/gi,'<strong>$1</strong>');else html=html.replace(/<strong>([\w\W]*?)<\/strong>/gi,'<b>$1</b>');if(this.opts.italicTag==='em')html=html.replace(/<i>([\w\W]*?)<\/i>/gi,'<em>$1</em>');else html=html.replace(/<em>([\w\W]*?)<\/em>/gi,'<i>$1</i>');if(set!==true)
{html=html.replace(/<strike>([\w\W]*?)<\/strike>/gi,'<del>$1</del>');}
else
{html=html.replace(/<del>([\w\W]*?)<\/del>/gi,'<strike>$1</strike>');}
return html;},cleanStripTags:function(html)
{if(html==''||typeof html=='undefined')return html;var allowed=false;if(this.opts.allowedTags!==false)allowed=true;var arr=allowed===true?this.opts.allowedTags:this.opts.deniedTags;var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;html=html.replace(tags,function($0,$1)
{if(allowed===true)return $.inArray($1.toLowerCase(),arr)>'-1'?$0:'';else return $.inArray($1.toLowerCase(),arr)>'-1'?'':$0;});html=this.cleanConvertInlineTags(html);return html;},cleanSavePreCode:function(html,encode)
{var pre=html.match(/<(pre|code)(.*?)>([\w\W]*?)<\/(pre|code)>/gi);if(pre!==null)
{$.each(pre,$.proxy(function(i,s)
{var arr=s.match(/<(pre|code)(.*?)>([\w\W]*?)<\/(pre|code)>/i);arr[3]=arr[3].replace(/&nbsp;/g,' ');if(encode!==false)arr[3]=this.cleanEncodeEntities(arr[3]);arr[3]=arr[3].replace(/\$/g,'&#36;');html=html.replace(s,'<'+arr[1]+arr[2]+'>'+arr[3]+'</'+arr[1]+'>');},this));}
return html;},cleanEncodeEntities:function(str)
{str=String(str).replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'"');return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');},cleanUnverified:function()
{var $elem=this.$editor.find('li, img, a, b, strong, sub, sup, i, em, u, small, strike, del, span, cite');$elem.filter('[style*="background-color: transparent;"][style*="line-height"]').css('background-color','').css('line-height','');$elem.filter('[style*="background-color: transparent;"]').css('background-color','');$elem.css('line-height','');$.each($elem,$.proxy(function(i,s)
{this.removeEmptyAttr(s,'style');},this));this.$editor.find('div[style="text-align: -webkit-auto;"]').contents().unwrap();},cleanHtml:function(code)
{var i=0,codeLength=code.length,point=0,start=null,end=null,tag='',out='',cont='';this.cleanlevel=0;for(;i<codeLength;i++)
{point=i;if(-1==code.substr(i).indexOf('<'))
{out+=code.substr(i);return this.cleanFinish(out);}
while(point<codeLength&&code.charAt(point)!='<')
{point++;}
if(i!=point)
{cont=code.substr(i,point-i);if(!cont.match(/^\s{2,}$/g))
{if('\n'==out.charAt(out.length-1))out+=this.cleanGetTabs();else if('\n'==cont.charAt(0))
{out+='\n'+this.cleanGetTabs();cont=cont.replace(/^\s+/,'');}
out+=cont;}
if(cont.match(/\n/))out+='\n'+this.cleanGetTabs();}
start=point;while(point<codeLength&&'>'!=code.charAt(point))
{point++;}
tag=code.substr(start,point-start);i=point;var t;if('!--'==tag.substr(1,3))
{if(!tag.match(/--$/))
{while('-->'!=code.substr(point,3))
{point++;}
point+=2;tag=code.substr(start,point-start);i=point;}
if('\n'!=out.charAt(out.length-1))out+='\n';out+=this.cleanGetTabs();out+=tag+'>\n';}
else if('!'==tag[1])
{out=this.placeTag(tag+'>',out);}
else if('?'==tag[1])
{out+=tag+'>\n';}
else if(t=tag.match(/^<(script|style|pre)/i))
{t[1]=t[1].toLowerCase();tag=this.cleanTag(tag);out=this.placeTag(tag,out);end=String(code.substr(i+1)).toLowerCase().indexOf('</'+t[1]);if(end)
{cont=code.substr(i+1,end);i+=end;out+=cont;}}
else
{tag=this.cleanTag(tag);out=this.placeTag(tag,out);}}
return this.cleanFinish(out);},cleanGetTabs:function()
{var s='';for(var j=0;j<this.cleanlevel;j++)
{s+='\t';}
return s;},cleanFinish:function(code)
{code=code.replace(/\n\s*\n/g,'\n');code=code.replace(/^[\s\n]*/,'');code=code.replace(/[\s\n]*$/,'');code=code.replace(/<script(.*?)>\n<\/script>/gi,'<script$1></script>');this.cleanlevel=0;return code;},cleanTag:function(tag)
{var tagout='';tag=tag.replace(/\n/g,' ');tag=tag.replace(/\s{2,}/g,' ');tag=tag.replace(/^\s+|\s+$/g,' ');var suffix='';if(tag.match(/\/$/))
{suffix='/';tag=tag.replace(/\/+$/,'');}
var m;while(m=/\s*([^= ]+)(?:=((['"']).*?\3|[^ ]+))?/.exec(tag))
{if(m[2])tagout+=m[1].toLowerCase()+'='+m[2];else if(m[1])tagout+=m[1].toLowerCase();tagout+=' ';tag=tag.substr(m[0].length);}
return tagout.replace(/\s*$/,'')+suffix+'>';},placeTag:function(tag,out)
{var nl=tag.match(this.cleannewLevel);if(tag.match(this.cleanlineBefore)||nl)
{out=out.replace(/\s*$/,'');out+='\n';}
if(nl&&'/'==tag.charAt(1))this.cleanlevel--;if('\n'==out.charAt(out.length-1))out+=this.cleanGetTabs();if(nl&&'/'!=tag.charAt(1))this.cleanlevel++;out+=tag;if(tag.match(this.cleanlineAfter)||tag.match(this.cleannewLevel))
{out=out.replace(/ *$/,'');out+='\n';}
return out;},formatEmpty:function(e)
{var html=$.trim(this.$editor.html());if(this.opts.linebreaks)
{if(html=='')
{e.preventDefault();this.$editor.html('');this.focus();}}
else
{html=html.replace(/<br\s?\/?>/i,'');var thtml=html.replace(/<p>\s?<\/p>/gi,'');if(html===''||thtml==='')
{e.preventDefault();var node=$(this.opts.emptyHtml).get(0);this.$editor.html(node);this.focus();}}
this.sync();},formatBlocks:function(tag)
{this.bufferSet();var nodes=this.getBlocks();this.selectionSave();$.each(nodes,$.proxy(function(i,node)
{if(node.tagName!=='LI')
{var parent=$(node).parent();if(tag==='p')
{if((node.tagName==='P'&&parent.size()!=0&&parent[0].tagName==='BLOCKQUOTE')||node.tagName==='BLOCKQUOTE')
{this.formatQuote();return;}
else if(this.opts.linebreaks)return;else
{this.formatBlock(tag,node);}}
else
{this.formatBlock(tag,node);}}},this));this.selectionRestore();this.sync();},formatBlock:function(tag,block)
{if(block===false)block=this.getBlock();if(block===false)
{if(this.opts.linebreaks===true)this.execCommand('formatblock',tag);return true;}
var contents='';if(tag!=='pre')
{contents=$(block).contents();}
else
{contents=$(block).html();if($.trim(contents)==='')
{contents='<span id="selection-marker-1"></span>';}}
if(block.tagName==='PRE')tag='p';if(this.opts.linebreaks===true&&tag==='p')
{$(block).replaceWith($('<div>').append(contents).html()+'<br>');}
else
{var parent=this.getParent();var node=$('<'+tag+'>').append(contents);$(block).replaceWith(node);if(parent&&parent.tagName=='TD')
{$(node).wrapAll('<td>');}}},formatChangeTag:function(fromElement,toTagName,save)
{if(save!==false)this.selectionSave();var newElement=$('<'+toTagName+'/>');$(fromElement).replaceWith(function(){return newElement.append($(this).contents());});if(save!==false)this.selectionRestore();return newElement;},formatQuote:function()
{this.bufferSet();if(this.opts.linebreaks===false)
{this.selectionSave();var blocks=this.getBlocks();var blockquote=false;var blocksLen=blocks.length;if(blocks)
{var data='';var replaced='';var replace=false;var paragraphsOnly=true;$.each(blocks,function(i,s)
{if(s.tagName!=='P')paragraphsOnly=false;});$.each(blocks,$.proxy(function(i,s)
{if(s.tagName==='BLOCKQUOTE')
{this.formatBlock('p',s,false);}
else if(s.tagName==='P')
{blockquote=$(s).parent();if(blockquote[0].tagName=='BLOCKQUOTE')
{var count=$(blockquote).children('p').size();if(count==1)
{$(blockquote).replaceWith(s);}
else if(count==blocksLen)
{replace='blockquote';data+=this.outerHtml(s);}
else
{replace='html';data+=this.outerHtml(s);if(i==0)
{$(s).addClass('redactor-replaced').empty();replaced=this.outerHtml(s);}
else $(s).remove();}}
else
{if(paragraphsOnly===false||blocks.length==1)
{this.formatBlock('blockquote',s,false);}
else
{replace='paragraphs';data+=this.outerHtml(s);}}}
else if(s.tagName!=='LI')
{this.formatBlock('blockquote',s,false);}},this));if(replace)
{if(replace=='paragraphs')
{$(blocks[0]).replaceWith('<blockquote>'+data+'</blockquote>');$(blocks).remove();}
else if(replace=='blockquote')
{$(blockquote).replaceWith(data);}
else if(replace=='html')
{var html=this.$editor.html().replace(replaced,'</blockquote>'+data+'<blockquote>');this.$editor.html(html);this.$editor.find('blockquote').each(function()
{if($.trim($(this).html())=='')$(this).remove();})}}}
this.selectionRestore();}
else
{var block=this.getBlock();if(block.tagName==='BLOCKQUOTE')
{this.selectionSave();var html=$.trim($(block).html());var selection=$.trim(this.getSelectionHtml());html=html.replace(/<span(.*?)id="selection-marker(.*?)<\/span>/gi,'');if(html==selection)
{$(block).replaceWith($(block).html()+'<br>');}
else
{this.inlineFormat('tmp');var tmp=this.$editor.find('tmp');tmp.empty();var newhtml=this.$editor.html().replace('<tmp></tmp>','</blockquote><span id="selection-marker-1">'+this.opts.invisibleSpace+'</span>'+selection+'<blockquote>');this.$editor.html(newhtml);tmp.remove();this.$editor.find('blockquote').each(function()
{if($.trim($(this).html())=='')$(this).remove();})}
this.selectionRestore();this.$editor.find('span#selection-marker-1').attr('id',false);}
else
{var wrapper=this.selectionWrap('blockquote');var html=$(wrapper).html();var blocksElemsRemove=['ul','ol','table','tr','tbody','thead','tfoot','dl'];$.each(blocksElemsRemove,function(i,s)
{html=html.replace(new RegExp('<'+s+'(.*?)>','gi'),'');html=html.replace(new RegExp('</'+s+'>','gi'),'');});var blocksElems=this.opts.blockLevelElements;blocksElems.push('td');$.each(blocksElems,function(i,s)
{html=html.replace(new RegExp('<'+s+'(.*?)>','gi'),'');html=html.replace(new RegExp('</'+s+'>','gi'),'<br>');});$(wrapper).html(html);this.selectionElement(wrapper);var next=$(wrapper).next();if(next.size()!=0&&next[0].tagName==='BR')
{next.remove();}}}
this.sync();},blockRemoveAttr:function(attr,value)
{var nodes=this.getBlocks();$(nodes).removeAttr(attr);this.sync();},blockSetAttr:function(attr,value)
{var nodes=this.getBlocks();$(nodes).attr(attr,value);this.sync();},blockRemoveStyle:function(rule)
{var nodes=this.getBlocks();$(nodes).css(rule,'');this.removeEmptyAttr(nodes,'style');this.sync();},blockSetStyle:function(rule,value)
{var nodes=this.getBlocks();$(nodes).css(rule,value);this.sync();},blockRemoveClass:function(className)
{var nodes=this.getBlocks();$(nodes).removeClass(className);this.removeEmptyAttr(nodes,'class');this.sync();},blockSetClass:function(className)
{var nodes=this.getBlocks();$(nodes).addClass(className);this.sync();},inlineRemoveClass:function(className)
{this.selectionSave();this.inlineEachNodes(function(node)
{$(node).removeClass(className);this.removeEmptyAttr(node,'class');});this.selectionRestore();this.sync();},inlineSetClass:function(className)
{var current=this.getCurrent();if(!$(current).hasClass(className))this.inlineMethods('addClass',className);},inlineRemoveStyle:function(rule)
{this.selectionSave();this.inlineEachNodes(function(node)
{$(node).css(rule,'');this.removeEmptyAttr(node,'style');});this.selectionRestore();this.sync();},inlineSetStyle:function(rule,value)
{this.inlineMethods('css',rule,value);},inlineRemoveAttr:function(attr)
{this.selectionSave();var range=this.getRange(),node=this.getElement(),nodes=this.getNodes();if(range.collapsed||range.startContainer===range.endContainer&&node)
{nodes=$(node);}
$(nodes).removeAttr(attr);this.inlineUnwrapSpan();this.selectionRestore();this.sync();},inlineSetAttr:function(attr,value)
{this.inlineMethods('attr',attr,value);},inlineMethods:function(type,attr,value)
{this.bufferSet();this.selectionSave();var range=this.getRange()
var el=this.getElement();if((range.collapsed||range.startContainer===range.endContainer)&&el&&!this.nodeTestBlocks(el))
{$(el)[type](attr,value);}
else
{this.document.execCommand('fontSize',false,4);var fonts=this.$editor.find('font');$.each(fonts,$.proxy(function(i,s)
{this.inlineSetMethods(type,s,attr,value);},this));}
this.selectionRestore();this.sync();},inlineSetMethods:function(type,s,attr,value)
{var parent=$(s).parent(),el;var selectionHtml=this.getSelectionText();var parentHtml=$(parent).text();var selected=selectionHtml==parentHtml;if(selected&&parent&&parent[0].tagName==='INLINE'&&parent[0].attributes.length!=0)
{el=parent;$(s).replaceWith($(s).html());}
else
{el=$('<inline>').append($(s).contents());$(s).replaceWith(el);}
$(el)[type](attr,value);return el;},inlineEachNodes:function(callback)
{var range=this.getRange(),node=this.getElement(),nodes=this.getNodes(),collapsed;if(range.collapsed||range.startContainer===range.endContainer&&node)
{nodes=$(node);collapsed=true;}
$.each(nodes,$.proxy(function(i,node)
{if(!collapsed&&node.tagName!=='INLINE')
{var selectionHtml=this.getSelectionText();var parentHtml=$(node).parent().text();var selected=selectionHtml==parentHtml;if(selected&&node.parentNode.tagName==='INLINE'&&!$(node.parentNode).hasClass('redactor_editor'))
{node=node.parentNode;}
else return;}
callback.call(this,node);},this));},inlineUnwrapSpan:function()
{var $spans=this.$editor.find('inline');$.each($spans,$.proxy(function(i,span)
{var $span=$(span);if($span.attr('class')===undefined&&$span.attr('style')===undefined)
{$span.contents().unwrap();}},this));},inlineFormat:function(tag)
{this.selectionSave();this.document.execCommand('fontSize',false,4);var fonts=this.$editor.find('font');var last;$.each(fonts,function(i,s)
{var el=$('<'+tag+'/>').append($(s).contents());$(s).replaceWith(el);last=el;});this.selectionRestore();this.sync();},inlineRemoveFormat:function(tag)
{this.selectionSave();var utag=tag.toUpperCase();var nodes=this.getNodes();var parent=$(this.getParent()).parent();$.each(nodes,function(i,s)
{if(s.tagName===utag)this.inlineRemoveFormatReplace(s);});if(parent&&parent[0].tagName===utag)this.inlineRemoveFormatReplace(parent);this.selectionRestore();this.sync();},inlineRemoveFormatReplace:function(el)
{$(el).replaceWith($(el).contents());},insertHtml:function(html,sync)
{var current=this.getCurrent();var parent=current.parentNode;this.$editor.focus();this.bufferSet();var $html=$('<div>').append($.parseHTML(html));html=$html.html();html=this.cleanRemoveEmptyTags(html);$html=$('<div>').append($.parseHTML(html));var currBlock=this.getBlock();if($html.contents().length==1)
{var htmlTagName=$html.contents()[0].tagName;if(htmlTagName!='P'&&htmlTagName==currBlock.tagName||htmlTagName=='PRE')
{$html=$('<div>').append(html);}}
if(!this.opts.linebreaks&&$html.contents().length==1&&$html.contents()[0].nodeType==3&&(this.getRangeSelectedNodes().length>2||(!current||current.tagName=='BODY'&&!parent||parent.tagName=='HTML')))
{html='<p>'+html+'</p>';}
html=this.setSpansVerifiedHtml(html);if($html.contents().length>1&&currBlock||$html.contents().is('p, :header, ul, ol, li, div, table, td, blockquote, pre, address, section, header, footer, aside, article'))
{if(this.browser('msie'))
{if(!this.isIe11())
{this.document.selection.createRange().pasteHTML(html);}
else
{this.execPasteFrag(html);}}
else this.document.execCommand('inserthtml',false,html);}
else this.insertHtmlAdvanced(html,false);if(this.selectall)
{this.window.setTimeout($.proxy(function()
{if(!this.opts.linebreaks)this.selectionEnd(this.$editor.contents().last());else this.focusEnd();},this),1);}
this.observeStart();this.setNonEditable();if(sync!==false)this.sync();},insertHtmlAdvanced:function(html,sync)
{html=this.setSpansVerifiedHtml(html);var sel=this.getSelection();if(sel.getRangeAt&&sel.rangeCount)
{var range=sel.getRangeAt(0);range.deleteContents();var el=this.document.createElement('div');el.innerHTML=html;var frag=this.document.createDocumentFragment(),node,lastNode;while((node=el.firstChild))
{lastNode=frag.appendChild(node);}
range.insertNode(frag);if(lastNode)
{range=range.cloneRange();range.setStartAfter(lastNode);range.collapse(true);sel.removeAllRanges();sel.addRange(range);}}
if(sync!==false)
{this.sync();}},insertBeforeCursor:function(html)
{html=this.setSpansVerifiedHtml(html);var node=$(html);var space=document.createElement("span");space.innerHTML="\u200B";var range=this.getRange();range.insertNode(space);range.insertNode(node[0]);range.collapse(false);var sel=this.getSelection();sel.removeAllRanges();sel.addRange(range);this.sync();},insertText:function(html)
{var $html=$($.parseHTML(html));if($html.length)html=$html.text();this.$editor.focus();if(this.browser('msie')&&!this.isIe11())this.document.selection.createRange().pasteHTML(html);else this.document.execCommand('inserthtml',false,html);this.sync();},insertNode:function(node)
{node=node[0]||node;if(node.tagName=='SPAN')
{var replacementTag='inline';var outer=node.outerHTML;var regex=new RegExp('<'+node.tagName,'i');var newTag=outer.replace(regex,'<'+replacementTag);regex=new RegExp('</'+node.tagName,'i');newTag=newTag.replace(regex,'</'+replacementTag);node=$(newTag)[0];}
var sel=this.getSelection();if(sel.getRangeAt&&sel.rangeCount)
{range=sel.getRangeAt(0);range.deleteContents();range.insertNode(node);range.setEndAfter(node);range.setStartAfter(node);sel.removeAllRanges();sel.addRange(range);}},insertNodeToCaretPositionFromPoint:function(e,node)
{var range;var x=e.clientX,y=e.clientY;if(this.document.caretPositionFromPoint)
{var pos=this.document.caretPositionFromPoint(x,y);range=this.getRange();range.setStart(pos.offsetNode,pos.offset);range.collapse(true);range.insertNode(node);}
else if(this.document.caretRangeFromPoint)
{range=this.document.caretRangeFromPoint(x,y);range.insertNode(node);}
else if(typeof document.body.createTextRange!="undefined")
{range=this.document.body.createTextRange();range.moveToPoint(x,y);var endRange=range.duplicate();endRange.moveToPoint(x,y);range.setEndPoint("EndToEnd",endRange);range.select();}},insertAfterLastElement:function(element,parent)
{if(typeof(parent)!='undefined')element=parent;if(this.isEndOfElement())
{if(this.opts.linebreaks)
{var contents=$('<div>').append($.trim(this.$editor.html())).contents();if(this.outerHtml(contents.last()[0])!=this.outerHtml(element))
{return false;}}
else
{if(this.$editor.contents().last()[0]!==element)
{return false;}}
this.insertingAfterLastElement(element);}},insertingAfterLastElement:function(element)
{this.bufferSet();if(this.opts.linebreaks===false)
{var node=$(this.opts.emptyHtml);$(element).after(node);this.selectionStart(node);}
else
{var node=$('<span id="selection-marker-1">'+this.opts.invisibleSpace+'</span>',this.document)[0];$(element).after(node);$(node).after(this.opts.invisibleSpace);this.selectionRestore();this.$editor.find('span#selection-marker-1').removeAttr('id');}},insertLineBreak:function()
{this.selectionSave();this.$editor.find('#selection-marker-1').before('<br>'+(this.browser('webkit')?this.opts.invisibleSpace:''));this.selectionRestore();},insertDoubleLineBreak:function()
{this.selectionSave();this.$editor.find('#selection-marker-1').before('<br><br>'+(this.browser('webkit')?this.opts.invisibleSpace:''));this.selectionRestore();},replaceLineBreak:function(element)
{var node=$('<br>'+this.opts.invisibleSpace);$(element).replaceWith(node);this.selectionStart(node);},pasteClean:function(html)
{html=this.callback('pasteBefore',false,html);if(this.browser('msie'))
{var tmp=$.trim(html);if(tmp.search(/^<a(.*?)>(.*?)<\/a>$/i)==0)
{html=html.replace(/^<a(.*?)>(.*?)<\/a>$/i,"$2");}}
if(this.opts.pastePlainText)
{var tmp=this.document.createElement('div');html=html.replace(/<br>|<\/H[1-6]>|<\/p>|<\/div>/gi,'\n');tmp.innerHTML=html;html=tmp.textContent||tmp.innerText;html=$.trim(html);html=html.replace('\n','<br>');html=this.cleanParagraphy(html);this.pasteInsert(html);return false;}
if(this.currentOrParentIs('PRE'))
{html=this.pastePre(html);this.pasteInsert(html);return true;}
html=html.replace(/\s/g,"&nbsp;")
html=html.replace(/<p(.*?)class="MsoListParagraphCxSpFirst"([\w\W]*?)<\/p>/gi,'<ul><li$2</li>');html=html.replace(/<p(.*?)class="MsoListParagraphCxSpMiddle"([\w\W]*?)<\/p>/gi,'<li$2</li>');html=html.replace(/<p(.*?)class="MsoListParagraphCxSpLast"([\w\W]*?)<\/p>/gi,'<li$2</li></ul>');html=html.replace(/<p(.*?)class="MsoListParagraph"([\w\W]*?)<\/p>/gi,'<ul><li$2</li></ul>');html=html.replace(/·/g,'');html=html.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,'');html=html.replace(/<b\sid="internal-source-marker(.*?)">([\w\W]*?)<\/b>/gi,"$2");html=html.replace(/<b(.*?)id="docs-internal-guid(.*?)">([\w\W]*?)<\/b>/gi,"$3");html=this.cleanStripTags(html);html=html.replace(/<td><\/td>/gi,'[td]');html=html.replace(/<td>&nbsp;<\/td>/gi,'[td]');html=html.replace(/<td><br><\/td>/gi,'[td]');html=html.replace(/<td(.*?)colspan="(.*?)"(.*?)>([\w\W]*?)<\/td>/gi,'[td colspan="$2"]$4[/td]');html=html.replace(/<td(.*?)rowspan="(.*?)"(.*?)>([\w\W]*?)<\/td>/gi,'[td rowspan="$2"]$4[/td]');html=html.replace(/<a(.*?)href="(.*?)"(.*?)>([\w\W]*?)<\/a>/gi,'[a href="$2"]$4[/a]');html=html.replace(/<iframe(.*?)>([\w\W]*?)<\/iframe>/gi,'[iframe$1]$2[/iframe]');html=html.replace(/<video(.*?)>([\w\W]*?)<\/video>/gi,'[video$1]$2[/video]');html=html.replace(/<audio(.*?)>([\w\W]*?)<\/audio>/gi,'[audio$1]$2[/audio]');html=html.replace(/<embed(.*?)>([\w\W]*?)<\/embed>/gi,'[embed$1]$2[/embed]');html=html.replace(/<object(.*?)>([\w\W]*?)<\/object>/gi,'[object$1]$2[/object]');html=html.replace(/<param(.*?)>/gi,'[param$1]');html=html.replace(/<img(.*?)>/gi,'[img$1]');html=html.replace(/ class="(.*?)"/gi,'');html=html.replace(/<(\w+)([\w\W]*?)>/gi,'<$1>');html=html.replace(/<[^\/>][^>]*>(\s*|\t*|\n*|&nbsp;|<br>)<\/[^>]+>/gi,'');html=html.replace(/<div>\s*?\t*?\n*?(<ul>|<ol>|<p>)/gi,'$1');html=html.replace(/\[td colspan="(.*?)"\]([\w\W]*?)\[\/td\]/gi,'<td colspan="$1">$2</td>');html=html.replace(/\[td rowspan="(.*?)"\]([\w\W]*?)\[\/td\]/gi,'<td rowspan="$1">$2</td>');html=html.replace(/\[td\]/gi,'<td>&nbsp;</td>');html=html.replace(/\[a href="(.*?)"\]([\w\W]*?)\[\/a\]/gi,'<a href="$1">$2</a>');html=html.replace(/\[iframe(.*?)\]([\w\W]*?)\[\/iframe\]/gi,'<iframe$1>$2</iframe>');html=html.replace(/\[video(.*?)\]([\w\W]*?)\[\/video\]/gi,'<video$1>$2</video>');html=html.replace(/\[audio(.*?)\]([\w\W]*?)\[\/audio\]/gi,'<audio$1>$2</audio>');html=html.replace(/\[embed(.*?)\]([\w\W]*?)\[\/embed\]/gi,'<embed$1>$2</embed>');html=html.replace(/\[object(.*?)\]([\w\W]*?)\[\/object\]/gi,'<object$1>$2</object>');html=html.replace(/\[param(.*?)\]/gi,'<param$1>');html=html.replace(/\[img(.*?)\]/gi,'<img$1>');if(this.opts.convertDivs)
{html=html.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,'<p>$2</p>');html=html.replace(/<\/div><p>/gi,'<p>');html=html.replace(/<\/p><\/div>/gi,'</p>');}
if(this.currentOrParentIs('LI'))
{html=html.replace(/<p>([\w\W]*?)<\/p>/gi,'$1<br>');}
else
{html=this.cleanParagraphy(html);}
html=html.replace(/<span(.*?)>([\w\W]*?)<\/span>/gi,'$2');html=html.replace(/<img>/gi,'');html=html.replace(/<[^\/>][^>][^img|param|source]*>(\s*|\t*|\n*|&nbsp;|<br>)<\/[^>]+>/gi,'');html=html.replace(/\n{3,}/gi,'\n');html=html.replace(/<p><p>/gi,'<p>');html=html.replace(/<\/p><\/p>/gi,'</p>');html=html.replace(/<li>(\s*|\t*|\n*)<p>/gi,'<li>');html=html.replace(/<\/p>(\s*|\t*|\n*)<\/li>/gi,'</li>');if(this.opts.linebreaks===true)
{html=html.replace(/<p(.*?)>([\w\W]*?)<\/p>/gi,'$2<br>');}
html=html.replace(/<[^\/>][^>][^img|param|source]*>(\s*|\t*|\n*|&nbsp;|<br>)<\/[^>]+>/gi,'');html=html.replace(/<img src="webkit-fake-url\:\/\/(.*?)"(.*?)>/gi,'');html=html.replace(/<td(.*?)>(\s*|\t*|\n*)<p>([\w\W]*?)<\/p>(\s*|\t*|\n*)<\/td>/gi,'<td$1>$3</td>');html=html.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,'$2');html=html.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,'$2');this.pasteClipboardMozilla=false;if(this.browser('mozilla'))
{if(this.opts.clipboardUpload)
{var matches=html.match(/<img src="data:image(.*?)"(.*?)>/gi);if(matches!==null)
{this.pasteClipboardMozilla=matches;for(k in matches)
{var img=matches[k].replace('<img','<img data-mozilla-paste-image="'+k+'" ');html=html.replace(matches[k],img);}}}
while(/<br>$/gi.test(html))
{html=html.replace(/<br>$/gi,'');}}
html=html.replace(/<p>•([\w\W]*?)<\/p>/gi,'<li>$1</li>');while(/<font>([\w\W]*?)<\/font>/gi.test(html))
{html=html.replace(/<font>([\w\W]*?)<\/font>/gi,'$1');}
html=html.replace(/<p>\n?<li>/gi,'<li>');if(this.browser('msie')&&!this.isIe11())
{html=html.replace(/\n/g,'');}
this.pasteInsert(html);},pastePre:function(s)
{s=s.replace(/<br>|<\/H[1-6]>|<\/p>|<\/div>/gi,'\n');var tmp=this.document.createElement('div');tmp.innerHTML=s;return this.cleanEncodeEntities(tmp.textContent||tmp.innerText);},pasteInsert:function(html)
{if(this.selectall)
{if(!this.opts.linebreaks)this.$editor.html(this.opts.emptyHtml);else this.$editor.html('');this.$editor.focus();}
html=this.callback('pasteAfter',false,html);this.insertHtml(html);this.selectall=false;setTimeout($.proxy(function()
{this.rtePaste=false;if(this.browser('mozilla'))
{this.$editor.find('p:empty').remove()}
if(this.pasteClipboardMozilla!==false)
{this.pasteClipboardUploadMozilla();}},this),100);if(this.opts.autoresize&&this.fullscreen!==true)$(this.document.body).scrollTop(this.saveScroll);else this.$editor.scrollTop(this.saveScroll);},pasteClipboardUploadMozilla:function()
{var imgs=this.$editor.find('img[data-mozilla-paste-image]');$.each(imgs,$.proxy(function(i,s)
{var $s=$(s);var arr=s.src.split(",");var data=arr[1];var contentType=arr[0].split(";")[0].split(":")[1];$.post(this.opts.clipboardUploadUrl,{contentType:contentType,data:data},$.proxy(function(data)
{var json=(typeof data==='string'?$.parseJSON(data):data);$s.attr('src',json.filelink);$s.removeAttr('data-mozilla-paste-image');this.sync();this.callback('imageUpload',$s,json);},this));},this));},pasteClipboardUpload:function(e)
{var result=e.target.result;var arr=result.split(",");var data=arr[1];var contentType=arr[0].split(";")[0].split(":")[1];if(this.opts.clipboardUpload)
{$.post(this.opts.clipboardUploadUrl,{contentType:contentType,data:data},$.proxy(function(data)
{var json=(typeof data==='string'?$.parseJSON(data):data);var html='<img src="'+json.filelink+'" id="clipboard-image-marker" />';this.execCommand('inserthtml',html,false);var image=$(this.$editor.find('img#clipboard-image-marker'));if(image.length)image.removeAttr('id');else image=false;this.sync();if(image)
{this.callback('imageUpload',image,json);}},this));}
else
{this.insertHtml('<img src="'+result+'" />');}},bufferSet:function(html)
{if(html!==undefined)this.opts.buffer.push(html);else
{this.selectionSave();this.opts.buffer.push(this.$editor.html());this.selectionRemoveMarkers('buffer');}},bufferUndo:function()
{if(this.opts.buffer.length===0)
{this.$editor.focus();return;}
this.selectionSave();this.opts.rebuffer.push(this.$editor.html());this.selectionRestore(false,true);this.$editor.html(this.opts.buffer.pop());this.selectionRestore();setTimeout($.proxy(this.observeStart,this),100);},bufferRedo:function()
{if(this.opts.rebuffer.length===0)
{this.$editor.focus();return false;}
this.selectionSave();this.opts.buffer.push(this.$editor.html());this.selectionRestore(false,true);this.$editor.html(this.opts.rebuffer.pop());this.selectionRestore(true);setTimeout($.proxy(this.observeStart,this),4);},observeStart:function()
{this.observeImages();if(this.opts.observeLinks)this.observeLinks();},observeLinks:function()
{this.$editor.find('a').on('click',$.proxy(this.linkObserver,this));this.$editor.on('click.redactor',$.proxy(function(e)
{this.linkObserverTooltipClose(e);},this));$(document).on('click.redactor',$.proxy(function(e)
{this.linkObserverTooltipClose(e);},this));},observeImages:function()
{if(this.opts.observeImages===false)return false;this.$editor.find('img').each($.proxy(function(i,elem)
{if(this.browser('msie'))$(elem).attr('unselectable','on');this.imageResize(elem);},this));},linkObserver:function(e)
{var $link=$(e.target);var pos=$link.offset();if(this.opts.iframe)
{var posFrame=this.$frame.offset();pos.top=posFrame.top+(pos.top-$(this.document).scrollTop());pos.left+=posFrame.left;}
var tooltip=$('<span class="redactor-link-tooltip"></span>');var href=$link.attr('href');if(href.length>24)href=href.substring(0,24)+'...';var aLink=$('<a href="'+$link.attr('href')+'" target="_blank">'+href+'</a>').on('click',$.proxy(function(e)
{this.linkObserverTooltipClose(false);},this));var aEdit=$('<a href="#">'+this.opts.curLang.edit+'</a>').on('click',$.proxy(function(e)
{e.preventDefault();this.linkShow();this.linkObserverTooltipClose(false);},this));var aUnlink=$('<a href="#">'+this.opts.curLang.unlink+'</a>').on('click',$.proxy(function(e)
{e.preventDefault();this.execCommand('unlink');this.linkObserverTooltipClose(false);},this));tooltip.append(aLink);tooltip.append(' | ');tooltip.append(aEdit);tooltip.append(' | ');tooltip.append(aUnlink);tooltip.css({top:(pos.top+20)+'px',left:pos.left+'px'});$('.redactor-link-tooltip').remove();$('body').append(tooltip);},linkObserverTooltipClose:function(e)
{if(e!==false&&e.target.tagName=='A')return false;$('.redactor-link-tooltip').remove();},getSelection:function()
{if(!this.opts.rangy)return this.document.getSelection();else
{if(!this.opts.iframe)return rangy.getSelection();else return rangy.getSelection(this.$frame[0]);}},getRange:function()
{if(!this.opts.rangy)
{if(this.document.getSelection)
{var sel=this.getSelection();if(sel.getRangeAt&&sel.rangeCount)return sel.getRangeAt(0);}
return this.document.createRange();}
else
{if(!this.opts.iframe)return rangy.createRange();else return rangy.createRange(this.iframeDoc());}},selectionElement:function(node)
{this.setCaret(node);},selectionStart:function(node)
{this.selectionSet(node[0]||node,0,null,0);},selectionEnd:function(node)
{this.selectionSet(node[0]||node,1,null,1);},selectionSet:function(orgn,orgo,focn,foco)
{if(focn==null)focn=orgn;if(foco==null)foco=orgo;var sel=this.getSelection();if(!sel)return;var range=this.getRange();range.setStart(orgn,orgo);range.setEnd(focn,foco);try{sel.removeAllRanges();}catch(e){}
sel.addRange(range);},selectionWrap:function(tag)
{tag=tag.toLowerCase();var block=this.getBlock();if(block)
{var wrapper=this.formatChangeTag(block,tag);this.sync();return wrapper;}
var sel=this.getSelection();var range=sel.getRangeAt(0);var wrapper=document.createElement(tag);wrapper.appendChild(range.extractContents());range.insertNode(wrapper);this.selectionElement(wrapper);return wrapper;},selectionAll:function()
{var range=this.getRange();range.selectNodeContents(this.$editor[0]);var sel=this.getSelection();sel.removeAllRanges();sel.addRange(range);},selectionRemove:function()
{this.getSelection().removeAllRanges();},getCaretOffset:function(element)
{var caretOffset=0;var range=this.getRange();var preCaretRange=range.cloneRange();preCaretRange.selectNodeContents(element);preCaretRange.setEnd(range.endContainer,range.endOffset);caretOffset=$.trim(preCaretRange.toString()).length;return caretOffset;},getCaretOffsetRange:function()
{return new Range(this.getSelection().getRangeAt(0));},setCaret:function(el,start,end)
{if(typeof end==='undefined')end=start;el=el[0]||el;var range=this.getRange();range.selectNodeContents(el);var textNodes=this.getTextNodesIn(el);var foundStart=false;var charCount=0,endCharCount;if(textNodes.length==1&&start)
{range.setStart(textNodes[0],start);range.setEnd(textNodes[0],end);}
else
{for(var i=0,textNode;textNode=textNodes[i++];)
{endCharCount=charCount+textNode.length;if(!foundStart&&start>=charCount&&(start<endCharCount||(start==endCharCount&&i<textNodes.length)))
{range.setStart(textNode,start-charCount);foundStart=true;}
if(foundStart&&end<=endCharCount)
{range.setEnd(textNode,end-charCount);break;}
charCount=endCharCount;}}
var sel=this.getSelection();sel.removeAllRanges();sel.addRange(range);},getTextNodesIn:function(node)
{var textNodes=[];if(node.nodeType==3)textNodes.push(node);else
{var children=node.childNodes;for(var i=0,len=children.length;i<len;++i)
{textNodes.push.apply(textNodes,this.getTextNodesIn(children[i]));}}
return textNodes;},getCurrent:function()
{var el=false;var sel=this.getSelection();if(sel&&sel.rangeCount>0)el=sel.getRangeAt(0).startContainer;return this.isParentRedactor(el);},getParent:function(elem)
{elem=elem||this.getCurrent();if(elem)return this.isParentRedactor($(elem).parent()[0]);else return false;},getBlock:function(node)
{if(typeof node==='undefined')node=this.getCurrent();while(node)
{if(this.nodeTestBlocks(node))
{if($(node).hasClass('redactor_editor'))return false;return node;}
node=node.parentNode;}
return false;},getBlocks:function(nodes)
{var newnodes=[];if(typeof nodes=='undefined')
{var range=this.getRange();if(range&&range.collapsed===true)return[this.getBlock()];var nodes=this.getNodes(range);}
$.each(nodes,$.proxy(function(i,node)
{if(this.opts.iframe===false&&$(node).parents('div.redactor_editor').size()==0)return false;if(this.nodeTestBlocks(node))newnodes.push(node);},this));if(newnodes.length===0)newnodes=[this.getBlock()];return newnodes;},nodeTestBlocks:function(node)
{return node.nodeType==1&&this.rTestBlock.test(node.nodeName);},tagTestBlock:function(tag)
{return this.rTestBlock.test(tag);},getNodes:function(range,tag)
{if(typeof range=='undefined'||range==false)var range=this.getRange();if(range&&range.collapsed===true)
{if(typeof tag==='undefined'&&this.tagTestBlock(tag))
{var block=this.getBlock();if(block.tagName==tag)return[block];else return[];}
else
{return[this.getCurrent()];}}
var nodes=[],finalnodes=[];var sel=this.document.getSelection();if(!sel.isCollapsed)nodes=this.getRangeSelectedNodes(sel.getRangeAt(0));$.each(nodes,$.proxy(function(i,node)
{if(this.opts.iframe===false&&$(node).parents('div.redactor_editor').size()==0)return false;if(typeof tag==='undefined')
{if($.trim(node.textContent)!='')
{finalnodes.push(node);}}
else if(node.tagName==tag)
{finalnodes.push(node);}},this));if(finalnodes.length==0)
{if(typeof tag==='undefined'&&this.tagTestBlock(tag))
{var block=this.getBlock();if(block.tagName==tag)return finalnodes.push(block);else return[];}
else
{finalnodes.push(this.getCurrent());}}
var last=finalnodes[finalnodes.length-1];if(this.nodeTestBlocks(last))
{finalnodes=finalnodes.slice(0,-1);}
return finalnodes;},getElement:function(node)
{if(!node)node=this.getCurrent();while(node)
{if(node.nodeType==1)
{if($(node).hasClass('redactor_editor'))return false;return node;}
node=node.parentNode;}
return false;},getRangeSelectedNodes:function(range)
{range=range||this.getRange();var node=range.startContainer;var endNode=range.endContainer;if(node==endNode)return[node];var rangeNodes=[];while(node&&node!=endNode)
{rangeNodes.push(node=this.nextNode(node));}
node=range.startContainer;while(node&&node!=range.commonAncestorContainer)
{rangeNodes.unshift(node);node=node.parentNode;}
return rangeNodes;},nextNode:function(node)
{if(node.hasChildNodes())return node.firstChild;else
{while(node&&!node.nextSibling)
{node=node.parentNode;}
if(!node)return null;return node.nextSibling;}},getSelectionText:function()
{return this.getSelection().toString();},getSelectionHtml:function()
{var html='';var sel=this.getSelection();if(sel.rangeCount)
{var container=this.document.createElement("div");var len=sel.rangeCount;for(var i=0;i<len;++i)
{container.appendChild(sel.getRangeAt(i).cloneContents());}
html=container.innerHTML;}
return this.syncClean(html);},selectionSave:function()
{if(!this.isFocused())this.$editor.focus();if(!this.opts.rangy)
{this.selectionCreateMarker(this.getRange());}
else
{this.savedSel=rangy.saveSelection();}},selectionCreateMarker:function(range,remove)
{if(!range)return;var node1=$('<span id="selection-marker-1" class="redactor-selection-marker">'+this.opts.invisibleSpace+'</span>',this.document)[0];var node2=$('<span id="selection-marker-2" class="redactor-selection-marker">'+this.opts.invisibleSpace+'</span>',this.document)[0];if(range.collapsed===true)
{this.selectionSetMarker(range,node1,true);}
else
{this.selectionSetMarker(range,node1,true);this.selectionSetMarker(range,node2,false);}
this.savedSel=this.$editor.html();this.selectionRestore(false,false);},selectionSetMarker:function(range,node,type)
{var boundaryRange=range.cloneRange();boundaryRange.collapse(type);boundaryRange.insertNode(node);boundaryRange.detach();},selectionRestore:function(replace,remove)
{if(!this.opts.rangy)
{if(replace===true&&this.savedSel)
{this.$editor.html(this.savedSel);}
var node1=this.$editor.find('span#selection-marker-1');var node2=this.$editor.find('span#selection-marker-2');if(this.browser('mozilla'))
{this.$editor.focus();}
else if(!this.isFocused())
{this.$editor.focus();}
if(node1.length!=0&&node2.length!=0)
{this.selectionSet(node1[0],0,node2[0],0);}
else if(node1.length!=0)
{this.selectionSet(node1[0],0,null,0);}
if(remove!==false)
{this.selectionRemoveMarkers();this.savedSel=false;}}
else
{rangy.restoreSelection(this.savedSel);}},selectionRemoveMarkers:function(type)
{if(!this.opts.rangy)
{$.each(this.$editor.find('span.redactor-selection-marker'),function()
{var html=$.trim($(this).html().replace(/[^\u0000-\u1C7F]/g,''));if(html=='')
{$(this).remove();}
else
{$(this).removeAttr('class').removeAttr('id');}});}
else
{rangy.removeMarkers(this.savedSel);}},tableShow:function()
{this.selectionSave();this.modalInit(this.opts.curLang.table,this.opts.modal_table,300,$.proxy(function()
{$('#redactor_insert_table_btn').click($.proxy(this.tableInsert,this));setTimeout(function()
{$('#redactor_table_rows').focus();},200);},this));},tableInsert:function()
{var rows=$('#redactor_table_rows').val(),columns=$('#redactor_table_columns').val(),$table_box=$('<div></div>'),tableId=Math.floor(Math.random()*99999),$table=$('<table id="table'+tableId+'"><tbody></tbody></table>'),i,$row,z,$column;for(i=0;i<rows;i++)
{$row=$('<tr></tr>');for(z=0;z<columns;z++)
{$column=$('<td>'+this.opts.invisibleSpace+'</td>');if(i===0&&z===0)$column.append('<span id="selection-marker-1">'+this.opts.invisibleSpace+'</span>');$($row).append($column);}
$table.append($row);}
$table_box.append($table);var html=$table_box.html();this.modalClose();this.selectionRestore();var current=this.getBlock()||this.getCurrent();if(current&&current.tagName!='BODY')$(current).after(html)
else this.insertHtmlAdvanced(html,false);this.selectionRestore();var table=this.$editor.find('#table'+tableId);this.buttonActiveObserver();table.find('span#selection-marker-1').remove();table.removeAttr('id');this.sync();},tableDeleteTable:function()
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();$table.remove();this.sync();},tableDeleteRow:function()
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();var $current_tr=$(this.getParent()).closest('tr');var $focus_tr=$current_tr.prev().length?$current_tr.prev():$current_tr.next();if($focus_tr.length)
{var $focus_td=$focus_tr.children('td').first();if($focus_td.length)
{$focus_td.prepend('<span id="selection-marker-1">'+this.opts.invisibleSpace+'</span>');}}
$current_tr.remove();this.selectionRestore();this.sync();},tableDeleteColumn:function()
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();var $current_td=$(this.getParent()).closest('td');var index=$current_td.get(0).cellIndex;$table.find('tr').each($.proxy(function(i,elem)
{var focusIndex=index-1<0?index+1:index-1;if(i===0)
{$(elem).find('td').eq(focusIndex).prepend('<span id="selection-marker-1">'+this.opts.invisibleSpace+'</span>');}
$(elem).find('td').eq(index).remove();},this));this.selectionRestore();this.sync();},tableAddHead:function()
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();if($table.find('thead').size()!==0)this.tableDeleteHead();else
{var tr=$table.find('tr').first().clone();tr.find('td').html(this.opts.invisibleSpace);$thead=$('<thead></thead>');$thead.append(tr);$table.prepend($thead);this.sync();}},tableDeleteHead:function()
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;var $thead=$table.find('thead');if($thead.size()==0)return false;this.bufferSet();$thead.remove();this.sync();},tableAddRowAbove:function()
{this.tableAddRow('before');},tableAddRowBelow:function()
{this.tableAddRow('after');},tableAddColumnLeft:function()
{this.tableAddColumn('before');},tableAddColumnRight:function()
{this.tableAddColumn('after');},tableAddRow:function(type)
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();var $current_tr=$(this.getParent()).closest('tr');var new_tr=$current_tr.clone();new_tr.find('td').html(this.opts.invisibleSpace);if(type==='after')$current_tr.after(new_tr);else $current_tr.before(new_tr);this.sync();},tableAddColumn:function(type)
{var $table=$(this.getParent()).closest('table');if(!this.isParentRedactor($table))return false;if($table.size()==0)return false;this.bufferSet();var index=0;var $current_tr=$(this.getParent()).closest('tr');var $current_td=$(this.getCurrent()).closest('td');$current_tr.find('td').each($.proxy(function(i,elem)
{if($(elem)[0]===$current_td[0])index=i;},this));$table.find('tr').each($.proxy(function(i,elem)
{var $current=$(elem).find('td').eq(index);var td=$current.clone();td.html(this.opts.invisibleSpace);type==='after'?$current.after(td):$current.before(td);},this));this.sync();},videoShow:function()
{this.selectionSave();this.modalInit(this.opts.curLang.video,this.opts.modal_video,600,$.proxy(function()
{$('#redactor_insert_video_btn').click($.proxy(this.videoInsert,this));setTimeout(function()
{$('#redactor_insert_video_area').focus();},200);},this));},videoInsert:function()
{var data=$('#redactor_insert_video_area').val();data=this.cleanVideoHtml(data);data=this.cleanStripTags(data);this.selectionRestore();var current=this.getBlock()||this.getCurrent();if(current)$(current).after(data)
else this.insertHtmlAdvanced(data,false);this.sync();this.modalClose();},cleanVideoHtml:function(html){if(!(filterXSS!=null&&typeof filterXSS=='function')){return html;}
var options={whiteList:{iframe:['width','height','src','frameborder','allowfullscreen']}};return filterXSS(html,options);},linkShow:function()
{this.selectionSave();var callback=$.proxy(function()
{this.insert_link_node=false;var sel=this.getSelection();var url='',text='',target='';var elem=this.getParent();var par=$(elem).parent().get(0);if(par&&par.tagName==='A')
{elem=par;}
if(elem&&elem.tagName==='A')
{url=elem.href;text=$(elem).text();target=elem.target;this.insert_link_node=elem;}
else text=sel.toString();$('.redactor_link_text').val(text);var thref=self.location.href.replace(/\/$/i,'');var turl=url.replace(thref,'');if(this.opts.linkProtocol===false)
{var re=new RegExp('^(http|ftp|https)://'+self.location.host,'i');turl=turl.replace(re,'');}
var tabs=$('#redactor_tabs').find('a');if(this.opts.linkEmail===false)tabs.eq(1).remove();if(this.opts.linkAnchor===false)tabs.eq(2).remove();if(this.opts.linkEmail===false&&this.opts.linkAnchor===false)
{$('#redactor_tabs').remove();$('#redactor_link_url').val(turl);}
else
{if(url.search('mailto:')===0)
{this.modalSetTab.call(this,2);$('#redactor_tab_selected').val(2);$('#redactor_link_mailto').val(url.replace('mailto:',''));}
else if(turl.search(/^#/gi)===0)
{this.modalSetTab.call(this,3);$('#redactor_tab_selected').val(3);$('#redactor_link_anchor').attr('name',turl.replace(/^#/gi,''));}
else
{$('#redactor_link_url').val(turl);}}
if(target==='_blank')$('#redactor_link_blank').prop('checked',true);$('#redactor_insert_link_btn').click($.proxy(this.linkProcess,this));setTimeout(function()
{$('#redactor_link_url').focus();},200);},this);this.modalInit(this.opts.curLang.link,this.opts.modal_link,460,callback);},linkProcess:function()
{var tab_selected=$('#redactor_tab_selected').val();var link='',text='',target='',targetBlank='';if(tab_selected==='1')
{link=$('#redactor_link_url').val();text=$('#redactor_link_url_text').val();if($('#redactor_link_blank').prop('checked'))
{target='_blank';targetBlank='_blank';}
var pattern='((xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z0-9]{2,}';var re=new RegExp('^(http|ftp|https)://'+pattern,'i');var re2=new RegExp('^'+pattern,'i');if(link.search(re)==-1&&link.search(re2)==0&&this.opts.linkProtocol)
{link=this.opts.linkProtocol+link;}}
else if(tab_selected==='2')
{link='mailto:'+$('#redactor_link_mailto').val();text=$('#redactor_link_mailto_text').val();}
else if(tab_selected==='3')
{var anchor=true;link=$('#redactor_link_anchor').val();text=$('#redactor_link_anchor_text').val();}
link=link.replace(/(<([^>]+)>)/ig,"");link=link.replace(/\"/ig,"");text=text.replace(/<|>/g,'');link=$("<div />").html(link).text();link=link.replace(/(<([^>]+)>)/ig,"");link=link.replace(/\"/ig,"");var $a=$("<a>");if(anchor){$a.attr("name",link);}else{$a.attr("href",link);$a.text(text);}
if(target){$a.attr("target",target);}
this.linkInsert($a,(anchor?$.trim("null"):$.trim(text)),link,targetBlank);},linkInsert:function($a,text,link,target)
{this.selectionRestore();if(text!=='')
{if(this.insert_link_node)
{this.bufferSet();$(this.insert_link_node).text(text).attr('href',link);if(target!=='')$(this.insert_link_node).attr('target',target);else $(this.insert_link_node).removeAttr('target');this.sync();}
else
{$a.addClass('redactor-added-link');this.exec('inserthtml',this.outerHtml($a),false);this.$editor.find('button.redactor-added-link').removeAttr('style').removeClass('redactor-added-link').each(function()
{if(this.className=='')$(this).removeAttr('class');});this.sync();}}
setTimeout($.proxy(function()
{if(this.opts.observeLinks)this.observeLinks();},this),5);this.modalClose();},fileShow:function()
{this.selectionSave();var callback=$.proxy(function()
{var sel=this.getSelection();var text='';if(this.oldIE())text=sel.text;else text=sel.toString();$('#redactor_filename').val(text);if(!this.isMobile())
{this.draguploadInit('#redactor_file',{url:this.opts.fileUpload,uploadFields:this.opts.uploadFields,success:$.proxy(this.fileCallback,this),error:$.proxy(function(obj,json)
{this.callback('fileUploadError',json);},this),uploadParam:this.opts.fileUploadParam});}
this.uploadInit('redactor_file',{auto:true,url:this.opts.fileUpload,success:$.proxy(this.fileCallback,this),error:$.proxy(function(obj,json)
{this.callback('fileUploadError',json);},this)});},this);this.modalInit(this.opts.curLang.file,this.opts.modal_file,500,callback);},fileCallback:function(json)
{this.selectionRestore();if(json!==false)
{var text=$('#redactor_filename').val();if(text==='')text=json.filename;var link='<a href="'+json.filelink+'" id="filelink-marker">'+text+'</a>';if(this.browser('webkit')&&!!this.window.chrome)
{link=link+'&nbsp;';}
this.execCommand('inserthtml',link,false);var linkmarker=$(this.$editor.find('a#filelink-marker'));if(linkmarker.size()!=0)linkmarker.removeAttr('id');else linkmarker=false;this.sync();this.callback('fileUpload',linkmarker,json);}
this.modalClose();},imageShow:function()
{this.selectionSave();var callback=$.proxy(function()
{if(this.opts.imageGetJson)
{$.getJSON(this.opts.imageGetJson,$.proxy(function(data)
{var folders={},count=0;$.each(data,$.proxy(function(key,val)
{if(typeof val.folder!=='undefined')
{count++;folders[val.folder]=count;}},this));var folderclass=false;$.each(data,$.proxy(function(key,val)
{var thumbtitle='';if(typeof val.title!=='undefined')thumbtitle=val.title;var folderkey=0;if(!$.isEmptyObject(folders)&&typeof val.folder!=='undefined')
{folderkey=folders[val.folder];if(folderclass===false)folderclass='.redactorfolder'+folderkey;}
var img=$('<img src="'+val.thumb+'" class="redactorfolder redactorfolder'+folderkey+'" rel="'+val.image+'" title="'+thumbtitle+'" />');$('#redactor_image_box').append(img);$(img).click($.proxy(this.imageThumbClick,this));},this));if(!$.isEmptyObject(folders))
{$('.redactorfolder').hide();$(folderclass).show();var onchangeFunc=function(e)
{$('.redactorfolder').hide();$('.redactorfolder'+$(e.target).val()).show();};var select=$('<select id="redactor_image_box_select">');$.each(folders,function(k,v)
{select.append($('<option value="'+v+'">'+k+'</option>'));});$('#redactor_image_box').before(select);select.change(onchangeFunc);}},this));}
else
{$('#redactor_tabs').find('a').eq(1).remove();}
if(this.opts.imageUpload||this.opts.s3)
{if(!this.isMobile()&&this.opts.s3===false)
{if($('#redactor_file').length)
{this.draguploadInit('#redactor_file',{url:this.opts.imageUpload,uploadFields:this.opts.uploadFields,success:$.proxy(this.imageCallback,this),error:$.proxy(function(obj,json)
{this.callback('imageUploadError',json);},this),uploadParam:this.opts.imageUploadParam});}}
if(this.opts.s3===false)
{this.uploadInit('redactor_file',{auto:true,url:this.opts.imageUpload,success:$.proxy(this.imageCallback,this),error:$.proxy(function(obj,json)
{this.callback('imageUploadError',json);},this)});}
else
{$('#redactor_file').on('change.redactor',$.proxy(this.s3handleFileSelect,this));}}
else
{$('.redactor_tab').hide();if(!this.opts.imageGetJson)
{$('#redactor_tabs').remove();$('#redactor_tab3').show();}
else
{var tabs=$('#redactor_tabs').find('a');tabs.eq(0).remove();tabs.eq(1).addClass('redactor_tabs_act');$('#redactor_tab2').show();}}
$('#redactor_upload_btn').click($.proxy(this.imageCallbackLink,this));if(!this.opts.imageUpload&&!this.opts.imageGetJson)
{setTimeout(function()
{$('#redactor_file_link').focus();},200);}},this);this.modalInit(this.opts.curLang.image,this.opts.modal_image,610,callback);},imageEdit:function(image)
{var $el=image;var parent=$el.parent().parent();var callback=$.proxy(function()
{$('#redactor_file_alt').val($el.attr('alt'));$('#redactor_image_edit_src').attr('href',$el.attr('src'));$('#redactor_form_image_align').val($el.css('float'));if($(parent).get(0).tagName==='A')
{$('#redactor_file_link').val($(parent).attr('href'));if($(parent).attr('target')=='_blank')
{$('#redactor_link_blank').prop('checked',true);}}
$('#redactor_image_delete_btn').click($.proxy(function()
{this.imageRemove($el);},this));$('#redactorSaveBtn').click($.proxy(function()
{this.imageSave($el);},this));},this);this.modalInit(this.opts.curLang.edit,this.opts.modal_image_edit,380,callback);},imageRemove:function(el)
{var parent=$(el).parent();$(el).remove();if(parent.length&&parent[0].tagName==='P')
{this.$editor.focus();this.selectionStart(parent);}
this.callback('imageDelete',el);this.modalClose();this.sync();},imageSave:function(el)
{var $el=$(el);var parent=$el.parent();$el.attr('alt',$('#redactor_file_alt').val());var floating=$('#redactor_form_image_align').val();if(floating==='left')
{this.imageMargin='0 '+this.opts.imageFloatMargin+' '+this.opts.imageFloatMargin+' 0';$el.css({'float':'left','margin':this.imageMargin});}
else if(floating==='right')
{this.imageMargin='0 0 '+this.opts.imageFloatMargin+' '+this.opts.imageFloatMargin+'';$el.css({'float':'right','margin':this.imageMargin});}
else
{this.imageMargin='0px';var imageBox=$el.closest('#redactor-image-box');if(imageBox.size()!=0)imageBox.css({'float':'','margin':''});$el.css({'float':'','margin':''});}
var link=$.trim($('#redactor_file_link').val());if(link!=='')
{var target=false;if($('#redactor_link_blank').prop('checked'))
{target=true;}
if(parent.get(0).tagName!=='A')
{var a=$('<a>'+this.outerHtml(el)+'</a>');a.attr('href',link);if(target)
{a.attr('target','_blank');}
$el.replaceWith(a);}
else
{parent.attr('href',link);if(target)
{parent.attr('target','_blank');}
else
{parent.removeAttr('target');}}}
else
{if(parent.get(0).tagName==='A')
{parent.replaceWith(this.outerHtml(el));}}
this.modalClose();this.observeImages();this.sync();},imageResizeHide:function(e)
{if(e!==false&&$(e.target).parent().size()!=0&&$(e.target).parent()[0].id==='redactor-image-box')
{return false;}
var imageBox=this.$editor.find('#redactor-image-box');if(imageBox.size()==0)
{return false;}
this.$editor.find('#redactor-image-editter, #redactor-image-resizer').remove();if(this.imageMargin!='0px')
{imageBox.find('img').css('margin',this.imageMargin);imageBox.css('margin','');this.imageMargin='0px';}
imageBox.find('img').css('opacity','');imageBox.replaceWith(function()
{return $(this).contents();});$(document).off('click.redactor-image-resize-hide');this.$editor.off('click.redactor-image-resize-hide');this.$editor.off('keydown.redactor-image-delete');this.sync()},imageResize:function(image)
{var $image=$(image);$image.on('mousedown',$.proxy(function()
{this.imageResizeHide(false);},this));$image.on('dragstart',$.proxy(function()
{this.$editor.on('drop.redactor-image-inside-drop',$.proxy(function()
{setTimeout($.proxy(function()
{this.observeImages();this.$editor.off('drop.redactor-image-inside-drop');this.sync();},this),1);},this));},this));$image.on('click',$.proxy(function(e)
{if(this.$editor.find('#redactor-image-box').size()!=0)
{return false;}
var clicked=false,start_x,start_y,ratio=$image.width()/$image.height(),min_w=20,min_h=10;var imageResizer=this.imageResizeControls($image);var isResizing=false;imageResizer.on('mousedown',function(e)
{isResizing=true;e.preventDefault();ratio=$image.width()/$image.height();start_x=Math.round(e.pageX-$image.eq(0).offset().left);start_y=Math.round(e.pageY-$image.eq(0).offset().top);});$(this.document.body).on('mousemove',$.proxy(function(e)
{if(isResizing)
{var mouse_x=Math.round(e.pageX-$image.eq(0).offset().left)-start_x;var mouse_y=Math.round(e.pageY-$image.eq(0).offset().top)-start_y;var div_h=$image.height();var new_h=parseInt(div_h,10)+mouse_y;var new_w=Math.round(new_h*ratio);if(new_w>min_w)
{$image.width(new_w);if(new_w<100)
{this.imageEditter.css({marginTop:'-7px',marginLeft:'-13px',fontSize:'9px',padding:'3px 5px'});}
else
{this.imageEditter.css({marginTop:'-11px',marginLeft:'-18px',fontSize:'11px',padding:'7px 10px'});}}
start_x=Math.round(e.pageX-$image.eq(0).offset().left);start_y=Math.round(e.pageY-$image.eq(0).offset().top);this.sync()}},this)).on('mouseup',function()
{isResizing=false;});this.$editor.on('keydown.redactor-image-delete',$.proxy(function(e)
{var key=e.which;if(this.keyCode.BACKSPACE==key||this.keyCode.DELETE==key)
{this.bufferSet();this.imageResizeHide(false);this.imageRemove($image);}},this));$(document).on('click.redactor-image-resize-hide',$.proxy(this.imageResizeHide,this));this.$editor.on('click.redactor-image-resize-hide',$.proxy(this.imageResizeHide,this));},this));},imageResizeControls:function($image)
{var imageBox=$('<span id="redactor-image-box" data-redactor="verified">');imageBox.css({position:'relative',display:'inline-block',lineHeight:0,outline:'1px dashed rgba(0, 0, 0, .6)','float':$image.css('float')});imageBox.attr('contenteditable',false);this.imageMargin=$image[0].style.margin;if(this.imageMargin!='0px')
{imageBox.css('margin',this.imageMargin);$image.css('margin','');}
$image.css('opacity',.5).after(imageBox);this.imageEditter=$('<span id="redactor-image-editter" data-redactor="verified">'+this.opts.curLang.edit+'</span>');this.imageEditter.css({position:'absolute',zIndex:2,top:'50%',left:'50%',marginTop:'-11px',marginLeft:'-18px',lineHeight:1,backgroundColor:'#000',color:'#fff',fontSize:'11px',padding:'7px 10px',cursor:'pointer'});this.imageEditter.attr('contenteditable',false);this.imageEditter.on('click',$.proxy(function()
{this.imageEdit($image);},this));imageBox.append(this.imageEditter);var imageResizer=$('<span id="redactor-image-resizer" data-redactor="verified"></span>');imageResizer.css({position:'absolute',zIndex:2,lineHeight:1,cursor:'nw-resize',bottom:'-4px',right:'-5px',border:'1px solid #fff',backgroundColor:'#000',width:'8px',height:'8px'});imageResizer.attr('contenteditable',false);imageBox.append(imageResizer);imageBox.append($image);return imageResizer;},imageThumbClick:function(e)
{var img='<img id="image-marker" src="'+$(e.target).attr('rel')+'" alt="'+$(e.target).attr('title')+'" />';var parent=this.getParent();if(this.opts.paragraphy&&$(parent).closest('li').size()==0)img='<p>'+img+'</p>';this.imageInsert(img,true);},imageCallbackLink:function()
{var val=$('#redactor_file_link').val();if(val!=='')
{var data='<img id="image-marker" src="'+val+'" />';if(this.opts.linebreaks===false)data='<p>'+data+'</p>';this.imageInsert(data,true);}
else this.modalClose();},imageCallback:function(data)
{this.imageInsert(data);},imageInsert:function(json,link)
{this.selectionRestore();if(json!==false)
{var html='';if(link!==true)
{html='<img id="image-marker" src="'+json.filelink+'" />';var parent=this.getParent();if(this.opts.paragraphy&&$(parent).closest('li').size()==0)
{html='<p>'+html+'</p>';}}
else
{html=json;}
this.execCommand('inserthtml',html,false);var image=$(this.$editor.find('img#image-marker'));if(image.length)image.removeAttr('id');else image=false;this.sync();link!==true&&this.callback('imageUpload',image,json);}
this.modalClose();this.observeImages();},modalTemplatesInit:function()
{$.extend(this.opts,{modal_file:String()
+'<section>'
+'<div id="redactor-progress" class="redactor-progress redactor-progress-striped" style="display: none;">'
+'<div id="redactor-progress-bar" class="redactor-progress-bar" style="width: 100%;"></div>'
+'</div>'
+'<form id="redactorUploadFileForm" method="post" action="" enctype="multipart/form-data">'
+'<label>'+this.opts.curLang.filename+'</label>'
+'<input type="text" id="redactor_filename" class="redactor_input" />'
+'<div style="margin-top: 7px;">'
+'<input type="file" id="redactor_file" name="'+this.opts.fileUploadParam+'" />'
+'</div>'
+'</form>'
+'</section>',modal_image_edit:String()
+'<section>'
+'<label>'+this.opts.curLang.title+'</label>'
+'<input id="redactor_file_alt" class="redactor_input" />'
+'<label>'+this.opts.curLang.link+'</label>'
+'<input id="redactor_file_link" class="redactor_input" />'
+'<label><input type="checkbox" id="redactor_link_blank"> '+this.opts.curLang.link_new_tab+'</label>'
+'<label>'+this.opts.curLang.image_position+'</label>'
+'<select id="redactor_form_image_align">'
+'<option value="none">'+this.opts.curLang.none+'</option>'
+'<option value="left">'+this.opts.curLang.left+'</option>'
+'<option value="right">'+this.opts.curLang.right+'</option>'
+'</select>'
+'</section>'
+'<footer>'
+'<button id="redactor_image_delete_btn" class="redactor_modal_btn redactor_modal_delete_btn">'+this.opts.curLang._delete+'</button>&nbsp;&nbsp;&nbsp;'
+'<button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button>'
+'<input type="button" name="save" class="redactor_modal_btn redactor_modal_action_btn" id="redactorSaveBtn" value="'+this.opts.curLang.save+'" />'
+'</footer>',modal_image:String()
+'<section>'
+'<div id="redactor_tabs">'
+'<a href="#" class="redactor_tabs_act">'+this.opts.curLang.upload+'</a>'
+'<a href="#">'+this.opts.curLang.choose+'</a>'
+'<a href="#">'+this.opts.curLang.link+'</a>'
+'</div>'
+'<div id="redactor-progress" class="redactor-progress redactor-progress-striped" style="display: none;">'
+'<div id="redactor-progress-bar" class="redactor-progress-bar" style="width: 100%;"></div>'
+'</div>'
+'<form id="redactorInsertImageForm" method="post" action="" enctype="multipart/form-data">'
+'<div id="redactor_tab1" class="redactor_tab">'
+'<input type="file" id="redactor_file" name="'+this.opts.imageUploadParam+'" />'
+'</div>'
+'<div id="redactor_tab2" class="redactor_tab" style="display: none;">'
+'<div id="redactor_image_box"></div>'
+'</div>'
+'</form>'
+'<div id="redactor_tab3" class="redactor_tab" style="display: none;">'
+'<label>'+this.opts.curLang.image_web_link+'</label>'
+'<input type="text" name="redactor_file_link" id="redactor_file_link" class="redactor_input"  />'
+'</div>'
+'</section>'
+'<footer>'
+'<a href="#" class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</a>'
+'<input type="button" name="upload" class="redactor_modal_btn" id="redactor_upload_btn" value="'+this.opts.curLang.upload+'" />'
+'</footer>',modal_link:String()
+'<section>'
+'<form id="redactorInsertLinkForm" method="post" action="">'
+'<div id="redactor_tabs">'
+'<a href="#" class="redactor_tabs_act">'+this.opts.curLang.web+'</a>'
+'<a href="#">'+this.opts.curLang.mailto+'</a>'
+'<a href="#">'+this.opts.curLang.anchor+'</a>'
+'</div>'
+'<input type="hidden" id="redactor_tab_selected" value="1" />'
+'<div class="redactor_tab" id="redactor_tab1">'
+'<label>'+this.opts.curLang.web+'</label>'
+'<input type="text" id="redactor_link_url" class="redactor_input"  />'
+'<label>'+this.opts.curLang.text+'</label>'
+'<input type="text" class="redactor_input redactor_link_text" id="redactor_link_url_text" />'
+'<label><input type="checkbox" id="redactor_link_blank" checked> '+this.opts.curLang.link_new_tab+'</label>'
+'</div>'
+'<div class="redactor_tab" id="redactor_tab2" style="display: none;">'
+'<label>'+this.opts.curLang.mailto+'</label>'
+'<input type="text" id="redactor_link_mailto" class="redactor_input" />'
+'<label>'+this.opts.curLang.text+'</label>'
+'<input type="text" class="redactor_input redactor_link_text" id="redactor_link_mailto_text" />'
+'</div>'
+'<div class="redactor_tab" id="redactor_tab3" style="display: none;">'
+'<label>'+this.opts.curLang.anchor+'</label>'
+'<input type="text" class="redactor_input" id="redactor_link_anchor"  />'
+'<input type="text" class="redactor_input redactor_link_text" id="redactor_link_anchor_text" value="null" style="display:none" disabled="true"/>'
+'</div>'
+'</form>'
+'</section>'
+'<footer>'
+'<button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button>'
+'<input type="button" class="redactor_modal_btn redactor_modal_action_btn" id="redactor_insert_link_btn" value="'+this.opts.curLang.insert+'" />'
+'</footer>',modal_table:String()
+'<section>'
+'<label>'+this.opts.curLang.rows+'</label>'
+'<input type="text" size="5" value="2" id="redactor_table_rows" />'
+'<label>'+this.opts.curLang.columns+'</label>'
+'<input type="text" size="5" value="3" id="redactor_table_columns" />'
+'</section>'
+'<footer>'
+'<button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button>'
+'<input type="button" name="upload" class="redactor_modal_btn redactor_modal_action_btn" id="redactor_insert_table_btn" value="'+this.opts.curLang.insert+'" />'
+'</footer>',modal_video:String()
+'<section>'
+'<form id="redactorInsertVideoForm">'
+'<label>'+this.opts.curLang.video_html_code+'</label>'
+'<textarea id="redactor_insert_video_area" style="width: 99%; height: 160px;"></textarea>'
+'</form>'
+'</section>'
+'<footer>'
+'<button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button>'
+'<input type="button" class="redactor_modal_btn redactor_modal_action_btn" id="redactor_insert_video_btn" value="'+this.opts.curLang.insert+'" />'
+'</footer>'});},modalInit:function(title,content,width,callback)
{var $redactorModalOverlay=$('#redactor_modal_overlay');if(!$redactorModalOverlay.length)
{this.$overlay=$redactorModalOverlay=$('<div id="redactor_modal_overlay" style="display: none;"></div>');$('body').prepend(this.$overlay);}
if(this.opts.modalOverlay)
{$redactorModalOverlay.show().on('click',$.proxy(this.modalClose,this));}
var $redactorModal=$('#redactor_modal');if(!$redactorModal.length)
{this.$modal=$redactorModal=$('<div id="redactor_modal" style="display: none;"><div id="redactor_modal_close">&times;</div><header id="redactor_modal_header"></header><div id="redactor_modal_inner"></div></div>');$('body').append(this.$modal);}
$('#redactor_modal_close').on('click',$.proxy(this.modalClose,this));this.hdlModalClose=$.proxy(function(e)
{if(e.keyCode===this.keyCode.ESC)
{this.modalClose();return false;}},this);$(document).keyup(this.hdlModalClose);this.$editor.keyup(this.hdlModalClose);this.modalcontent=false;if(content.indexOf('#')==0)
{this.modalcontent=$(content);$('#redactor_modal_inner').empty().append(this.modalcontent.html());this.modalcontent.html('');}
else
{$('#redactor_modal_inner').empty().append(content);}
$redactorModal.find('#redactor_modal_header').html(title);if(typeof $.fn.draggable!=='undefined')
{$redactorModal.draggable({handle:'#redactor_modal_header'});$redactorModal.find('#redactor_modal_header').css('cursor','move');}
var $redactor_tabs=$('#redactor_tabs');if($redactor_tabs.length)
{var that=this;$redactor_tabs.find('a').each(function(i,s)
{i++;$(s).on('click',function(e)
{e.preventDefault();$redactor_tabs.find('a').removeClass('redactor_tabs_act');$(this).addClass('redactor_tabs_act');$('.redactor_tab').hide();$('#redactor_tab'+i).show();$('#redactor_tab_selected').val(i);if(that.isMobile()===false)
{var height=$redactorModal.outerHeight();$redactorModal.css('margin-top','-'+(height+10)/2+'px');}});});}
$redactorModal.find('.redactor_btn_modal_close').on('click',$.proxy(this.modalClose,this));if(this.opts.autoresize===true)
{this.saveModalScroll=this.document.body.scrollTop;}
else
{this.saveModalScroll=this.$editor.scrollTop();}
if(this.isMobile()===false)
{$redactorModal.css({position:'fixed',top:'-2000px',left:'50%',width:width+'px',marginLeft:'-'+(width+60)/2+'px'}).show();this.modalSaveBodyOveflow=$(document.body).css('overflow');$(document.body).css('overflow','hidden');}
else
{$redactorModal.css({position:'fixed',width:'100%',height:'100%',top:'0',left:'0',margin:'0',minHeight:'300px'}).show();}
if(typeof callback==='function')callback();if(this.isMobile()===false)
{setTimeout(function()
{var height=$redactorModal.outerHeight();$redactorModal.css({top:'50%',height:'auto',minHeight:'auto',marginTop:'-'+(height+10)/2+'px'});},10);}},modalClose:function()
{$('#redactor_modal_close').off('click',this.modalClose);$('#redactor_modal').fadeOut('fast',$.proxy(function()
{var redactorModalInner=$('#redactor_modal_inner');if(this.modalcontent!==false)
{this.modalcontent.html(redactorModalInner.html());this.modalcontent=false;}
redactorModalInner.html('');if(this.opts.modalOverlay)
{$('#redactor_modal_overlay').hide().off('click',this.modalClose);}
$(document).unbind('keyup',this.hdlModalClose);this.$editor.unbind('keyup',this.hdlModalClose);this.selectionRestore();if(this.opts.autoresize&&this.saveModalScroll)
{$(this.document.body).scrollTop(this.saveModalScroll);}
else if(this.opts.autoresize===false&&this.saveModalScroll)
{this.$editor.scrollTop(this.saveModalScroll);}},this));if(this.isMobile()===false)
{$(document.body).css('overflow',this.modalSaveBodyOveflow?this.modalSaveBodyOveflow:'visible');}
return false;},modalSetTab:function(num)
{$('.redactor_tab').hide();$('#redactor_tabs').find('a').removeClass('redactor_tabs_act').eq(num-1).addClass('redactor_tabs_act');$('#redactor_tab'+num).show();},s3handleFileSelect:function(e)
{var files=e.target.files;for(var i=0,f;f=files[i];i++)
{this.s3uploadFile(f);}},s3uploadFile:function(file)
{this.s3executeOnSignedUrl(file,$.proxy(function(signedURL)
{this.s3uploadToS3(file,signedURL);},this));},s3executeOnSignedUrl:function(file,callback)
{var xhr=new XMLHttpRequest();var mark='?';if(this.opts.s3.search(/\?/)!='-1')mark='&';xhr.open('GET',this.opts.s3+mark+'name='+file.name+'&type='+file.type,true);if(xhr.overrideMimeType)xhr.overrideMimeType('text/plain; charset=x-user-defined');xhr.onreadystatechange=function(e)
{if(this.readyState==4&&this.status==200)
{$('#redactor-progress').fadeIn();callback(decodeURIComponent(this.responseText));}
else if(this.readyState==4&&this.status!=200)
{}};xhr.send();},s3createCORSRequest:function(method,url)
{var xhr=new XMLHttpRequest();if("withCredentials"in xhr)
{xhr.open(method,url,true);}
else if(typeof XDomainRequest!="undefined")
{xhr=new XDomainRequest();xhr.open(method,url);}
else
{xhr=null;}
return xhr;},s3uploadToS3:function(file,url)
{var xhr=this.s3createCORSRequest('PUT',url);if(!xhr)
{}
else
{xhr.onload=$.proxy(function()
{if(xhr.status==200)
{$('#redactor-progress, #redactor-progress-drag').hide();var s3image=url.split('?');if(!s3image[0])
{return false;}
this.selectionRestore();var html='';html='<img id="image-marker" src="'+s3image[0]+'" />';if(this.opts.paragraphy)html='<p>'+html+'</p>';this.execCommand('inserthtml',html,false);var image=$(this.$editor.find('img#image-marker'));if(image.length)image.removeAttr('id');else image=false;this.sync();this.callback('imageUpload',image,false);this.modalClose();this.observeImages();}
else
{}},this);xhr.onerror=function()
{};xhr.upload.onprogress=function(e)
{};xhr.setRequestHeader('Content-Type',file.type);xhr.setRequestHeader('x-amz-acl','public-read');xhr.send(file);}},uploadInit:function(el,options)
{this.uploadOptions={url:false,success:false,error:false,start:false,trigger:false,auto:false,input:false};$.extend(this.uploadOptions,options);var $el=$('#'+el);if($el.length&&$el[0].tagName==='INPUT')
{this.uploadOptions.input=$el;this.el=$($el[0].form);}
else this.el=$el;this.element_action=this.el.attr('action');if(this.uploadOptions.auto)
{$(this.uploadOptions.input).change($.proxy(function(e)
{this.el.submit(function(e)
{return false;});this.uploadSubmit(e);},this));}
else if(this.uploadOptions.trigger)
{$('#'+this.uploadOptions.trigger).click($.proxy(this.uploadSubmit,this));}},uploadSubmit:function(e)
{$('#redactor-progress').fadeIn();this.uploadForm(this.element,this.uploadFrame());},uploadFrame:function()
{this.id='f'+Math.floor(Math.random()*99999);var d=this.document.createElement('div');var iframe='<iframe style="display:none" id="'+this.id+'" name="'+this.id+'"></iframe>';d.innerHTML=iframe;$(d).appendTo("body");if(this.uploadOptions.start)this.uploadOptions.start();$('#'+this.id).load($.proxy(this.uploadLoaded,this));return this.id;},uploadForm:function(f,name)
{if(this.uploadOptions.input)
{var formId='redactorUploadForm'+this.id,fileId='redactorUploadFile'+this.id;this.form=$('<form  action="'+this.uploadOptions.url+'" method="POST" target="'+name+'" name="'+formId+'" id="'+formId+'" enctype="multipart/form-data" />');if(this.opts.uploadFields!==false&&typeof this.opts.uploadFields==='object')
{$.each(this.opts.uploadFields,$.proxy(function(k,v)
{if(v!=null&&v.toString().indexOf('#')===0)v=$(v).val();var hidden=$('<input/>',{'type':"hidden",'name':k,'value':v});$(this.form).append(hidden);},this));}
var oldElement=this.uploadOptions.input;var newElement=$(oldElement).clone();$(oldElement).attr('id',fileId).before(newElement).appendTo(this.form);$(this.form).css('position','absolute').css('top','-2000px').css('left','-2000px').appendTo('body');this.form.submit();}
else
{f.attr('target',name).attr('method','POST').attr('enctype','multipart/form-data').attr('action',this.uploadOptions.url);this.element.submit();}},uploadLoaded:function()
{var i=$('#'+this.id)[0],d;if(i.contentDocument)d=i.contentDocument;else if(i.contentWindow)d=i.contentWindow.document;else d=window.frames[this.id].document;if(this.uploadOptions.success)
{$('#redactor-progress').hide();if(typeof d!=='undefined')
{var rawString=d.body.innerHTML;var jsonString=rawString.match(/\{(.|\n)*\}/)[0];jsonString=jsonString.replace(/^\[/,'');jsonString=jsonString.replace(/\]$/,'');var json=$.parseJSON(jsonString);if(typeof json.error=='undefined')this.uploadOptions.success(json);else
{this.uploadOptions.error(this,json);this.modalClose();}}
else
{this.modalClose();alert('Upload failed!');}}
this.el.attr('action',this.element_action);this.el.attr('target','');},draguploadInit:function(el,options)
{this.draguploadOptions=$.extend({url:false,success:false,error:false,preview:false,uploadFields:false,text:this.opts.curLang.drop_file_here,atext:this.opts.curLang.or_choose,uploadParam:false},options);if(window.FormData===undefined)return false;this.droparea=$('<div class="redactor_droparea"></div>');this.dropareabox=$('<div class="redactor_dropareabox">'+this.draguploadOptions.text+'</div>');this.dropalternative=$('<div class="redactor_dropalternative">'+this.draguploadOptions.atext+'</div>');this.droparea.append(this.dropareabox);$(el).before(this.droparea);$(el).before(this.dropalternative);this.dropareabox.on('dragover',$.proxy(function()
{return this.draguploadOndrag();},this));this.dropareabox.on('dragleave',$.proxy(function()
{return this.draguploadOndragleave();},this));this.dropareabox.get(0).ondrop=$.proxy(function(e)
{e.preventDefault();this.dropareabox.removeClass('hover').addClass('drop');this.dragUploadAjax(this.draguploadOptions.url,e.dataTransfer.files[0],false,false,false,this.draguploadOptions.uploadParam);},this);},dragUploadAjax:function(url,file,directupload,progress,e,uploadParam)
{if(!directupload)
{var xhr=$.ajaxSettings.xhr();if(xhr.upload)
{xhr.upload.addEventListener('progress',$.proxy(this.uploadProgress,this),false);}
$.ajaxSetup({xhr:function(){return xhr;}});}
var fd=new FormData();if(uploadParam!==false)
{fd.append(uploadParam,file);}
else
{fd.append('file',file);}
if(this.opts.uploadFields!==false&&typeof this.opts.uploadFields==='object')
{$.each(this.opts.uploadFields,$.proxy(function(k,v)
{if(v!=null&&v.toString().indexOf('#')===0)v=$(v).val();fd.append(k,v);},this));}
$.ajax({url:url,dataType:'html',data:fd,cache:false,contentType:false,processData:false,type:'POST',success:$.proxy(function(data)
{data=data.replace(/^\[/,'');data=data.replace(/\]$/,'');var json=(typeof data==='string'?$.parseJSON(data):data);if(directupload)
{progress.fadeOut('slow',function()
{$(this).remove();});var $img=$('<img>');$img.attr('src',json.filelink).attr('id','drag-image-marker');this.insertNodeToCaretPositionFromPoint(e,$img[0]);var image=$(this.$editor.find('img#drag-image-marker'));if(image.length)image.removeAttr('id');else image=false;this.sync();this.observeImages();if(image)this.callback('imageUpload',image,json);if(typeof json.error!=='undefined')this.callback('imageUploadError',json);}
else
{if(typeof json.error=='undefined')
{this.draguploadOptions.success(json);}
else
{this.draguploadOptions.error(this,json);this.draguploadOptions.success(false);}}},this)});},draguploadOndrag:function()
{this.dropareabox.addClass('hover');return false;},draguploadOndragleave:function()
{this.dropareabox.removeClass('hover');return false;},uploadProgress:function(e,text)
{var percent=e.loaded?parseInt(e.loaded/e.total*100,10):e;this.dropareabox.text('Loading '+percent+'% '+(text||''));},isMobile:function()
{return/(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent);},normalize:function(str)
{if(typeof(str)==='undefined')return 0;return parseInt(str.replace('px',''),10);},outerHtml:function(el)
{return $('<div>').append($(el).eq(0).clone()).html();},isString:function(obj)
{return Object.prototype.toString.call(obj)=='[object String]';},isEmpty:function(html)
{html=html.replace(/&#x200b;|<br>|<br\/>|&nbsp;/gi,'');html=html.replace(/\s/g,'');html=html.replace(/^<p>[^\W\w\D\d]*?<\/p>$/i,'');return html=='';},isIe11:function()
{return!!navigator.userAgent.match(/Trident\/7\./);},browser:function(browser)
{var ua=navigator.userAgent.toLowerCase();var match=/(opr)[\/]([\w.]+)/.exec(ua)||/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];if(browser=='version')return match[2];if(browser=='webkit')return(match[1]=='chrome'||match[1]=='webkit');if(match[1]=='rv')return browser=='msie';if(match[1]=='opr')return browser=='webkit';return browser==match[1];},oldIE:function()
{if(this.browser('msie')&&parseInt(this.browser('version'),10)<9)return true;return false;},getFragmentHtml:function(fragment)
{var cloned=fragment.cloneNode(true);var div=this.document.createElement('div');div.appendChild(cloned);return div.innerHTML;},extractContent:function()
{var node=this.$editor[0];var strHTML=node.innerHTML;var frag=this.document.createDocumentFragment();var child;while((child=node.firstChild))
{frag.appendChild(child);}
return document.createRange().createContextualFragment(strHTML);},isParentRedactor:function(el)
{if(!el)return false;if(this.opts.iframe)return el;if($(el).parents('div.redactor_editor').length==0||$(el).hasClass('redactor_editor'))return false;else return el;},currentOrParentIs:function(tagName)
{var parent=this.getParent(),current=this.getCurrent();return parent&&parent.tagName===tagName?parent:current&&current.tagName===tagName?current:false;},isEndOfElement:function()
{var current=this.getBlock();var offset=this.getCaretOffset(current);var text=$.trim($(current).text()).replace(/\n\r\n/g,'');var len=text.length;if(offset==len)return true;else return false;},isFocused:function()
{var el,sel=this.getSelection();if(sel&&sel.rangeCount&&sel.rangeCount>0)el=sel.getRangeAt(0).startContainer;if(!el)return false;if(this.opts.iframe)
{if(this.getCaretOffsetRange().equals())return!this.$editor.is(el);else return true;}
return $(el).closest('div.redactor_editor').length!=0;},removeEmptyAttr:function(el,attr)
{if($(el).attr(attr)=='')$(el).removeAttr(attr);},removeFromArrayByValue:function(array,value)
{var index=null;while((index=array.indexOf(value))!==-1)
{array.splice(index,1);}
return array;}};Redactor.prototype.init.prototype=Redactor.prototype;$.Redactor.fn.formatLinkify=function(protocol,convertLinks,convertImageLinks,convertVideoLinks,linkSize)
{var url1=/(^|&lt;|\s)(www\..+?\..+?)(\s|&gt;|$)/g,url2=/(^|&lt;|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|&gt;|$)/g,urlImage=/(https?:\/\/.*\.(?:png|jpg|jpeg|gif))/gi,urlYoutube=/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig,urlVimeo=/https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/;var childNodes=(this.$editor?this.$editor.get(0):this).childNodes,i=childNodes.length;while(i--)
{var n=childNodes[i];if(n.nodeType===3)
{var html=n.nodeValue;if(convertVideoLinks&&html)
{var iframeStart='<iframe width="500" height="281" src="',iframeEnd='" frameborder="0" allowfullscreen></iframe>';if(html.match(urlYoutube))
{html=html.replace(urlYoutube,iframeStart+'//www.youtube.com/embed/$1'+iframeEnd);$(n).after(html).remove();}
else if(html.match(urlVimeo))
{html=html.replace(urlVimeo,iframeStart+'//player.vimeo.com/video/$2'+iframeEnd);$(n).after(html).remove();}}
if(convertImageLinks&&html&&html.match(urlImage))
{html=html.replace(urlImage,'<img src="$1">');$(n).after(html).remove();}
if(convertLinks&&html&&(html.match(url1)||html.match(url2)))
{var href=(html.match(url1)||html.match(url2));href=href[0];if(href.length>linkSize)href=href.substring(0,linkSize)+'...';html=html.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(url1,'$1<a href="'+protocol+'$2">'+$.trim(href)+'</a>$3').replace(url2,'$1<a href="$2">'+$.trim(href)+'</a>$5');$(n).after(html).remove();}}
else if(n.nodeType===1&&!/^(a|button|textarea)$/i.test(n.tagName))
{$.Redactor.fn.formatLinkify.call(n,protocol,convertLinks,convertImageLinks,convertVideoLinks,linkSize);}}};})(jQuery);if(typeof RedactorPlugins==='undefined')var RedactorPlugins={};RedactorPlugins.upload={init:function(){var plugin=this;var timeout;var attachments=null;if(typeof window.getAuthorizeContext!='undefined'){if(this.opts.attachments===undefined){attachments={authorize:getAuthorizeContext,toForm:addAttachmentToForm};}else{attachments=this.opts.attachments;}}
this.opts.pasteAfterCallback=function(text){clearTimeout(timeout);timeout=setTimeout(function(){plugin.parseImages(plugin,attachments);},500);return text;};this.doImageBtn(attachments);this.doFileBtn(attachments);},parseImages:function(plugin,attachments){var uploadFileToTheServer=function(uploadFile,img){var trackingId=null;var $tracker=commandUtils.createUploadTracker(pageContext.url.authorizeAttachmentsUrl,attachments.authorize(true),{onAuthorize:function(authorized,msg){if(authorized){trackingId=msg;var formData=new FormData();var request=new XMLHttpRequest();formData.append("file",uploadFile,uploadFile.name);request.open("POST",pageContext.url.uploadFile+'?trackingId='+msg);request.send(formData);}else{commandUtils.showMessage(evt,msg);}},onSuccess:function(data){img.setAttribute('src',data.result.url);addAttachmentToForm(data.result);plugin.insertHtml('',true);},onError:function(data){}});};function base64toBlob(b64Data,contentType,sliceSize){contentType=contentType||'';sliceSize=sliceSize||512;var byteCharacters=atob(b64Data);var byteArrays=[];for(var offset=0;offset<byteCharacters.length;offset+=sliceSize){var slice=byteCharacters.slice(offset,offset+sliceSize);var byteNumbers=new Array(slice.length);for(var i=0;i<slice.length;i++){byteNumbers[i]=slice.charCodeAt(i);}
byteArrays.push(new Uint8Array(byteNumbers));}
return new Blob(byteArrays,{type:contentType});}
function getMimeType(header){var type='';switch(header){case"89504e47":type="image/png";break;case"47494638":type="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":type="image/jpeg";break;default:type=blob.type;break;}
return type;}
function parseImgAttr(src){var arr=src.split(",");var data=arr[1];var contentType=arr[0].split(";")[0].split(":")[1];if(contentType.indexOf('image')!==0)return null;var extension=contentType.split('/')[1];var blob=base64toBlob(data,contentType,512);blob.name=getName()+'.'+extension;return blob;}
function getName(){var text="";var possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var i=0;i<5;i++){text+=possible.charAt(Math.floor(Math.random()*possible.length));}
return text;}
function verifyBlobMimeType(blob,img){var fileReader=new FileReader();fileReader.onloadend=function(e){var arr=(new Uint8Array(e.target.result)).subarray(0,4);var header="";for(var i=0;i<arr.length;i++){header+=arr[i].toString(16);}
var realMimeType=getMimeType(header);if(realMimeType!==blob.type){blob=blob.slice(0,blob.size,realMimeType);var extension=realMimeType.split('/')[1];blob.name=getName()+'.'+extension;}
uploadFileToTheServer(blob,img);};fileReader.readAsArrayBuffer(blob);}
var imgs=plugin.$editor.find('img');for(var i=0,len=imgs.length;i<len;i+=1){var img=imgs[i];var src=img.src;if(src.split(':')[0]!=='data')continue;var blob=parseImgAttr(src);if(blob!==null){verifyBlobMimeType(blob,img);}}},doImageBtn:function(attachments){this.buttonRemove('image');var thiz=this;this.buttonAdd('image',pageContext.i18n.toolTipsInsertImage,function(event,button_key){thiz.selectionSave();commandUtils.showUploadDialog(null,{authorizeUrl:pageContext.url.authorizeAttachmentsUrl,authorizeContext:attachments.authorize(true),onSuccess:function(tid,data){attachments.toForm(data);thiz.selectionRestore();thiz.imageInsert("<p><img id='"+data.fileId+"' src='"+data.url+"' /></p>",true);}});});},doFileBtn:function(attachments){this.buttonRemove('file');var thiz=this;this.buttonAdd('file',pageContext.i18n.toolTipsInsertFile,function(event,button_key){thiz.selectionSave();commandUtils.showUploadDialog(null,{authorizeUrl:pageContext.url.authorizeAttachmentsUrl,authorizeContext:attachments.authorize(false),onSuccess:function(tid,data){attachments.toForm(data);thiz.selectionRestore();thiz.insertHtml("<a id='"+data.fileId+"' href='"+data.url+"'>"+data.fileName+"</a>");}});});}};(function($){$.event.special.destroyed={remove:function(o){if(o.handler){o.handler()}}}})(jQuery);var autoCompleteDefaultUsers={};function addAutoCompleteUser(data){data.value=data.id;data.object.id=data.id;if(autoCompleteDefaultUsers[data.id]){return;}
autoCompleteDefaultUsers[data.id]=data;}
RedactorPlugins.autotaguser={init:function(){var redactor=this;window.rdt=redactor;var nodeId;var checkPre=true;var oldChangeCallback=null;if($.isFunction(this.opts.changeCallback)){oldChangeCallback=this.opts.changeCallback;}
this.opts.changeCallback=function(e){if(checkPre){var $parentNode=$(redactor.getParent());$('div.redactor_redactor').find('pre').each(function(){this.innerHTML=this.innerHTML.replace(/<br>/gi,"\r\n");});}
checkPre=true;if($.isFunction(oldChangeCallback)){oldChangeCallback(e);}}
if($('.question-container').length){nodeId=$('.question-container').find('.control-bar').attr('nodeid');}else if($('#answer-form').length&&$('#question').length){nodeId=$('#question').val();}
this.$editor.keypress(function(e){checkPre=false;var $parentNode=$(redactor.getParent());var pre=$('div.redactor_redactor').find('pre');if('PRE'==redactor.getBlock().nodeName)
{return true;}
if(checkAutoComplete(e)){e.preventDefault();return false;}
return checkAutoCompleteTyping(e,true);});var oldKeyUpCallBack=function(e){};if(typeof this.opts.keyupCallback==="function"){oldKeyUpCallBack=this.opts.keyupCallback;}
this.opts.keyupCallback=function(e){checkPre=false;var $parentNode=$(redactor.getParent());if($parentNode.context!=null&&$parentNode.context.parentNode&&'PRE'==$parentNode.context.parentNode.nodeName)
{return false;}
if(!$parentNode.hasClass('autotaguser-autocomplete-box')){oldKeyUpCallBack(e);return;}
oldKeyUpCallBack(e);return checkAutoCompleteTyping(e,false);}
var oldKeyDownCallBack=function(e){};if(typeof this.opts.keydownCallback==="function"){oldKeyDownCallBack=this.opts.keydownCallback;}
this.opts.keydownCallback=function(e){checkPre=false;var $parentNode=$(redactor.getParent());if($parentNode.context!=null&&$parentNode.context.parentNode&&'PRE'==$parentNode.context.parentNode.nodeName)
{return true;}
oldKeyDownCallBack(e);if(!$parentNode.hasClass('autotaguser-autocomplete-box')){return;}
oldKeyDownCallBack(e);var key=e.keyCode||e.which;if(key==8){return checkAutoCompleteTyping(e,false);}}
function checkAutoComplete(e){var $parentNode=$(redactor.getParent());if($parentNode.context!=null&&$parentNode.context.nodeName=='PRE'){return false;}
var key=e.keyCode||e.which;var char=e.charCode;var prevCharTrimmed=$.trim(getCharacterPrecedingCaret(redactor));if(prevCharTrimmed.charCodeAt(0)==8203){prevCharTrimmed='';}
if(key!=8&&char==64&&prevCharTrimmed==''){createAutoComplete();return true;}
return false;}
function checkAutoCompleteTyping(e,keypress){var $parentNode=$(redactor.getParent());if(!$parentNode.hasClass('autotaguser-autocomplete-box')&&!$parentNode.find('.autotaguser-autocomplete-box').length){return;}
var key=e.keyCode||e.which;var checkNavigation=redactor.browser('mozilla')?keypress:!keypress;var checkText=redactor.browser('mozilla')?!keypress||key==8:!keypress;if(checkNavigation&&(key==38||key==40||key==27||key==13||key==9)){e.preventDefault();var e=jQuery.Event("keydown");e.which=key;e.keyCode=key;$parentNode.find('input').trigger(e);return false;}else if(checkText){var text=$parentNode.text();if(text&&key==8){if($parentNode.context!=null&&$parentNode.context.nodeName=='PRE'){return false;}
text=text.substring(0,text.length-1);}
if(!$.trim(text)){$parentNode.data('breakOut')();return true;}
text=$.trim(text).substring(1);var oldValue=$parentNode.data('oldValue');if(oldValue!=text){var singleResult=$parentNode.data('single-result');if(singleResult&&text==singleResult.label){$parentNode.data('saveValue')(singleResult);}else{var noResultSearches=$parentNode.data('no-result-searches');if(noResultSearches&&noResultSearches>2){$parentNode.data('breakOut')();}else{$parentNode.find('input').autocomplete('search',text);$parentNode.data('oldValue',text);}}}}
return true;}
function getCharacterPrecedingCaret(redactor){var containerEl=redactor.$editor[0];var precedingChar="",sel,range,precedingRange;var re=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g;if(window.getSelection){sel=window.getSelection();if(sel.rangeCount>0){range=sel.getRangeAt(0).cloneRange();range.collapse(true);range.setStart(containerEl,0);precedingChar=range.toString().replace("\\p{C}","").slice(-1);}}else if((sel=document.selection)&&sel.type!="Control"){range=sel.createRange();precedingRange=range.duplicate();precedingRange.moveToElementText(containerEl);precedingRange.setEndPoint("EndToStart",range);precedingChar=precedingRange.text.replace("\\p{C}","").slice(-1);}
return precedingChar;}
function moveCaretToEndOfElement(element){var range,selection;if(document.createRange){range=document.createRange();range.selectNodeContents(element);range.collapse(false);selection=window.getSelection();selection.removeAllRanges();selection.addRange(range);}else if(document.selection){range=document.body.createTextRange();range.moveToElementText(element);range.collapse(false);range.select();}}
function destroyAutoComplete($el){}
function createAutoComplete(){var $autocomplete=$('<inline class="autotaguser-autocomplete-box">@<input type="text" /></inline>');$autocomplete.bind('destroyed',function(){destroyAutoComplete($autocomplete);});function clearTopNode($node){var $children=$node.children();if($children.length&&$children[$children.length-1].tagName.toUpperCase()=='BR'){$($children[$children.length-1]).remove();$node.html($node.html()+' ');}}
function breakOut(){var value=$autocomplete.text();var $topNode=$autocomplete.parent();$autocomplete.after(value);destroyAutoComplete($autocomplete);$autocomplete.remove();clearTopNode($topNode);moveCaretToEndOfElement($topNode[0]);}
$autocomplete.data('breakOut',breakOut);function saveValue(item){var object=item.object;var $nodeToInsert=$('<a nodeid="'+object.id+'" rel="user" href="#">@'+item.label+'</a>');var $topNode=$autocomplete.parent();$autocomplete.after($nodeToInsert);destroyAutoComplete($autocomplete);$autocomplete.remove();clearTopNode($topNode);moveCaretToEndOfElement($topNode[0]);}
$autocomplete.data('saveValue',saveValue);var autoCompleteCache={};$autocomplete.find('input').autocomplete({source:function(request,response){var term=request.term;if(autoCompleteCache[term]!==undefined){response(autoCompleteCache[term]);return;}
var localResults=[];var termLower=term.toLowerCase();for(var key in autoCompleteDefaultUsers){var item=autoCompleteDefaultUsers[key];if(item.label.toLowerCase().indexOf(termLower)>=0){localResults.push(item);}};if(localResults.length>0){response(localResults);}
var url;var data;if(nodeId){url=pageContext.url.mentionsSearch;data={'q':term,'node':nodeId}}else{url=pageContext.url.usersSearch;data={'q':term,'page':1,'pageSize':10}}
$.ajax({'url':url,'dataType':'json','data':data,success:function(data){var results=$.map(data.result,function(item,index){var label;if(pageContext.userRealName&&item.realname){label=item.realname;}else{label=item.username;}
return{'label':label,'value':item.id,'object':item};});var localMap={};for(var index in localResults){localMap[localResults[index].value]=true;}
for(var index in results){var item=results[index];if(localMap[item.value]===true){continue;}
localResults.push(item);}
results=localResults;if(results.length==1){$autocomplete.data('single-result',results[0]);}else{$autocomplete.data('single-result',null);if(results.length==0){var noResultSearches=$autocomplete.data('no-result-searches');if(!noResultSearches){noResultSearches=0;}
$autocomplete.data('no-result-searches',noResultSearches+1);}else{$autocomplete.data('no-result-searches',0);}}
autoCompleteCache[term]=results;response(results);}});},minLength:1,select:function(event,ui){saveValue(ui.item);if(event.pageX){redactor.sync();}
return false;},messages:{noResults:'',results:function(){}}});$autocomplete.find('input').data('uiAutocomplete')._renderItem=function(ul,item){return $("<li class='autotaguser-item'></li>").data("item.autocomplete",item).append($('<a>'+'<img class="gravatar" height="24" width="24" style="float: left; margin-right: 6px" src="'+item.object.avatar+'" />'+'<span>'+item.label+'</span>'+'</a>')).appendTo(ul);};redactor.insertNode($autocomplete);redactor.setCaret($autocomplete.get(0),1);$autocomplete.focus();}}};RedactorPlugins.code={init:function(){this.doCodeBtn();},doCodeBtn:function(){this.buttonRemove('code');var redactor_object=this;this.buttonAdd('code',pageContext.i18n.toolTipsInsertCode,function(event,button_key){redactor_object.execCommand('formatblock','pre');});}};!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=M.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function c(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function u(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:"start"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return" "+e.nodeName+'="'+n(e.value).replace('"',"&quot;")+'"'}l+="<"+t(e)+E.map.call(e.attributes,r).join("")+">"}function c(e){l+="</"+t(e)+">"}function u(e){("start"===e.event?o:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function s(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function l(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):B(a.k).forEach(function(e){c(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.endSameAsBegin&&(a.e=a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return s("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var u=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=u.length?t(u.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e){return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t].endSameAsBegin&&(n.c[t].eR=o(n.c[t].bR.exec(e)[0])),n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function s(e,n){return!a&&r(n.iR,e)}function p(e,n){var t=R.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function d(e,n,t,r){var a=r?"":j.classPrefix,i='<span class="'+a,o=t?"":I;return i+=e+'">',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=p(E,r),e?(M+=e[1],a+=d(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function b(){var e="string"==typeof E.sL;if(e&&!L[E.sL])return n(k);var t=e?f(E.sL,k,!0,B[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(B[E.sL]=t.top),d(t.language,t.value,!1,!0)}function v(){y+=null!=E.sL?b():h(),k=""}function m(e){y+=e.cN?d(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function N(e,n){if(k+=e,null==n)return v(),0;var t=c(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),v(),t.rB||t.eB||(k=n)),m(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),v(),a.eE&&(k=n));do E.cN&&(y+=I),E.skip||E.sL||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.eR=r.eR),m(r.starts,"")),a.rE?0:n.length}if(s(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"<unnamed>")+'"');return k+=n,n.length||1}var R=w(e);if(!R)throw new Error('Unknown language: "'+e+'"');l(R);var x,E=i||R,B={},y="";for(x=E;x!==R;x=x.parent)x.cN&&(y=d(x.cN,"",!0)+y);var k="",M=0;try{for(var C,A,S=0;;){if(E.t.lastIndex=S,C=E.t.exec(t),!C)break;A=N(t.substring(S,C.index),C[0]),S=C.index+A}for(N(t.substr(S)),x=E;x.parent;x=x.parent)x.cN&&(y+=I);return{r:M,value:y,language:e,top:E}}catch(O){if(O.message&&-1!==O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function g(e,t){t=t||j.languages||B(L);var r={r:0,value:n(e)},a=r;return t.filter(w).filter(x).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return j.tabReplace||j.useBR?e.replace(C,function(e,n){return j.useBR&&"\n"===e?"<br>":j.tabReplace?n.replace(/\t/g,j.tabReplace):""}):e}function d(e,n,t){var r=n?y[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function h(e){var n,t,r,o,s,l=i(e);a(l)||(j.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):n=e,s=n.textContent,r=l?f(l,s,!0):g(s),t=c(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=u(t,c(o),s)),r.value=p(r.value),e.innerHTML=r.value,e.className=d(e.className,l,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){j=o(j,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,h)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=L[n]=t(e);r.aliases&&r.aliases.forEach(function(e){y[e]=n})}function R(){return B(L)}function w(e){return e=(e||"").toLowerCase(),L[e]||L[y[e]]}function x(e){var n=w(e);return n&&!n.disableAutodetect}var E=[],B=Object.keys,L={},y={},k=/^(no-?highlight|plain|text)$/i,M=/\blang(?:uage)?-([\w-]+)\b/i,C=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,I="</span>",j={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=h,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.autoDetection=x,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U|L)?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U|L)?R"\\(',e:'\\)"'},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"</",c:n.concat([i,{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e,{b:/\(/,e:/\)/,k:c,r:0,c:["self",t.CLCM,t.CBCM,r,s,e]}]},t.CLCM,t.CBCM,i]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b:/</,e:/>/,c:["self"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage("java",function(e){var a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t=a+"(<"+a+"(\\s*,\\s*"+a+")*>)?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",c={cN:"number",b:s,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/</,r:0,c:[{cN:"attr",b:e,r:0},{b:/=\s*/,r:0,c:[{cN:"string",endsParent:!0,v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("<!--","-->",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"meta",b:/<\?xml/,e:/\?>/,r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0},{b:'b"',e:'"',skip:!0},{b:"b'",e:"'",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{name:"style"},c:[t],starts:{e:"</style>",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{name:"script"},c:[t],starts:{e:"</script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("properties",function(r){var t="[ \\t\\f]*",e="[ \\t\\f]+",s="("+t+"[:=]"+t+"|"+e+")",n="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",c={e:s,r:0,starts:{cN:"string",e:/$/,r:0,c:[{b:"\\\\\\n"}]}};return{cI:!0,i:/\S/,c:[r.C("^\\s*[!#]","$"),{b:n+s,rB:!0,c:[{cN:"attr",b:n,endsParent:!0,r:0}],starts:c},{b:a+s,rB:!0,r:0,c:[{cN:"meta",b:a,endsParent:!0,r:0}],starts:c},{cN:"attr",r:0,b:a+t+"$"}]}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("python",function(e){var r={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},b={cN:"meta",b:/^(>>>|\.\.\.) /},c={cN:"subst",b:/\{/,e:/\}/,k:r,i:/#/},a={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[e.BE,b],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[e.BE,b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[e.BE,b,c]},{b:/(fr|rf|f)"""/,e:/"""/,c:[e.BE,b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[e.BE,c]},{b:/(fr|rf|f)"/,e:/"/,c:[e.BE,c]},e.ASM,e.QSM]},s={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},i={cN:"params",b:/\(/,e:/\)/,c:["self",b,s,a]};return c.c=[a,s,b],{aliases:["py","gyp"],k:r,i:/(<\/|->|\?)|=>/,c:[b,s,a,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,i,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("makefile",function(e){var i={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%<?\^\+\*]/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,i]},a={cN:"variable",b:/\$\([\w-]+\s/,e:/\)/,k:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},c:[i]},n={b:"^"+e.UIR+"\\s*[:+?]?=",i:"\\n",rB:!0,c:[{b:"^"+e.UIR,e:"[:+?]?=",eE:!0}]},t={cN:"meta",b:/^\.PHONY:/,e:/$/,k:{"meta-keyword":".PHONY"},l:/[\.\w]+/},l={cN:"section",b:/^[^\s]+:/,e:/$/,c:[i]};return{aliases:["mk","mak"],k:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath",l:/[\w-]+/,c:[e.HCM,i,r,a,n,t,l]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment with",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t,e.HCM]},e.CBCM,t,e.HCM]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},r={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},t={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a=e.inherit(t,{i:/\n/}),c={cN:"subst",b:"{",e:"}",k:i},n=e.inherit(c,{i:/\n/}),s={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,n]},b={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},c]},l=e.inherit(b,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},n]});c.c=[b,s,t,e.ASM,e.QSM,r,e.CBCM],n.c=[l,s,a,e.ASM,e.QSM,r,e.inherit(e.CBCM,{i:/\n/})];var o={v:[b,s,t,e.ASM,e.QSM]},d=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},o,r,{bK:"class interface",e:/[{;=]/,i:/[^\s:,]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+d+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/\s*[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[o,r,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\/\w+|\w+\/)>/,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});!function(e){("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).markdownit=e()}(function(){return function o(i,a,c){function l(t,e){if(!a[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var s=a[t]={exports:{}};i[t][0].call(s.exports,function(e){var r=i[t][1][e];return l(r||e)},s,s.exports,o,i,a,c)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(e,r,t){"use strict";r.exports=e("entities/maps/entities.json")},{"entities/maps/entities.json":52}],2:[function(e,r,t){"use strict";r.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},{}],3:[function(e,r,t){"use strict";var n="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",s="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",o=new RegExp("^(?:"+n+"|"+s+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),i=new RegExp("^(?:"+n+"|"+s+")");r.exports.HTML_TAG_RE=o,r.exports.HTML_OPEN_CLOSE_TAG_RE=i},{}],4:[function(e,r,t){"use strict";var n=Object.prototype.hasOwnProperty;function i(e,r){return n.call(e,r)}function a(e){return!(55296<=e&&e<=57343)&&(!(64976<=e&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(0<=e&&e<=8)&&(11!==e&&(!(14<=e&&e<=31)&&(!(127<=e&&e<=159)&&!(1114111<e)))))))}function c(e){if(65535<e){var r=55296+((e-=65536)>>10),t=56320+(1023&e);return String.fromCharCode(r,t)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,o=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=e("./entities");var p=/[&<>"]/,h=/[&<>"]/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function d(e){return f[e]}var m=/[.?*+^$[\]\\(){}|-]/g;var _=e("uc.micro/categories/P/regex");t.lib={},t.lib.mdurl=e("mdurl"),t.lib.ucmicro=e("uc.micro"),t.assign=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if("object"!=typeof r)throw new TypeError(r+"must be object");Object.keys(r).forEach(function(e){t[e]=r[e]})}}),t},t.isString=function(e){return"[object String]"===(r=e,Object.prototype.toString.call(r));var r},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(o,function(e,r,t){return r||(n=e,o=0,i(u,s=t)?u[s]:35===s.charCodeAt(0)&&l.test(s)&&a(o="x"===s[1].toLowerCase()?parseInt(s.slice(2),16):parseInt(s.slice(1),10))?c(o):n);var n,s,o})},t.isValidEntityCode=a,t.fromCodePoint=c,t.escapeHtml=function(e){return p.test(e)?e.replace(h,d):e},t.arrayReplaceAt=function(e,r,t){return[].concat(e.slice(0,r),t,e.slice(r+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(8192<=e&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return _.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},{"./entities":1,mdurl:58,"uc.micro":65,"uc.micro/categories/P/regex":63}],5:[function(e,r,t){"use strict";t.parseLinkLabel=e("./parse_link_label"),t.parseLinkDestination=e("./parse_link_destination"),t.parseLinkTitle=e("./parse_link_title")},{"./parse_link_destination":6,"./parse_link_label":7,"./parse_link_title":8}],6:[function(e,r,t){"use strict";var a=e("../common/utils").isSpace,c=e("../common/utils").unescapeAll;r.exports=function(e,r,t){var n,s,o=r,i={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(r)){for(r++;r<t;){if(10===(n=e.charCodeAt(r))||a(n))return i;if(62===n)return i.pos=r+1,i.str=c(e.slice(o+1,r)),i.ok=!0,i;92===n&&r+1<t?r+=2:r++}return i}for(s=0;r<t&&32!==(n=e.charCodeAt(r))&&!(n<32||127===n);)if(92===n&&r+1<t)r+=2;else{if(40===n&&s++,41===n){if(0===s)break;s--}r++}return o===r||0!==s||(i.str=c(e.slice(o,r)),i.lines=0,i.pos=r,i.ok=!0),i}},{"../common/utils":4}],7:[function(e,r,t){"use strict";r.exports=function(e,r,t){var n,s,o,i,a=-1,c=e.posMax,l=e.pos;for(e.pos=r+1,n=1;e.pos<c;){if(93===(o=e.src.charCodeAt(e.pos))&&0===--n){s=!0;break}if(i=e.pos,e.md.inline.skipToken(e),91===o)if(i===e.pos-1)n++;else if(t)return e.pos=l,-1}return s&&(a=e.pos),e.pos=l,a}},{}],8:[function(e,r,t){"use strict";var c=e("../common/utils").unescapeAll;r.exports=function(e,r,t){var n,s,o=0,i=r,a={ok:!1,pos:0,lines:0,str:""};if(t<=r)return a;if(34!==(s=e.charCodeAt(r))&&39!==s&&40!==s)return a;for(r++,40===s&&(s=41);r<t;){if((n=e.charCodeAt(r))===s)return a.pos=r+1,a.lines=o,a.str=c(e.slice(i+1,r)),a.ok=!0,a;10===n?o++:92===n&&r+1<t&&(r++,10===e.charCodeAt(r)&&o++),r++}return a}},{"../common/utils":4}],9:[function(e,r,t){"use strict";var n=e("./common/utils"),s=e("./helpers"),o=e("./renderer"),i=e("./parser_core"),a=e("./parser_block"),c=e("./parser_inline"),l=e("linkify-it"),u=e("mdurl"),p=e("punycode"),h={default:e("./presets/default"),zero:e("./presets/zero"),commonmark:e("./presets/commonmark")},f=/^(vbscript|javascript|file|data):/,d=/^data:image\/(gif|png|jpeg|webp);/;function m(e){var r=e.trim().toLowerCase();return!f.test(r)||!!d.test(r)}var _=["http:","https:","mailto:"];function g(e){var r=u.parse(e,!0);if(r.hostname&&(!r.protocol||0<=_.indexOf(r.protocol)))try{r.hostname=p.toASCII(r.hostname)}catch(e){}return u.encode(u.format(r))}function b(e){var r=u.parse(e,!0);if(r.hostname&&(!r.protocol||0<=_.indexOf(r.protocol)))try{r.hostname=p.toUnicode(r.hostname)}catch(e){}return u.decode(u.format(r))}function k(e,r){if(!(this instanceof k))return new k(e,r);r||n.isString(e)||(r=e||{},e="default"),this.inline=new c,this.block=new a,this.core=new i,this.renderer=new o,this.linkify=new l,this.validateLink=m,this.normalizeLink=g,this.normalizeLinkText=b,this.utils=n,this.helpers=n.assign({},s),this.options={},this.configure(e),r&&this.set(r)}k.prototype.set=function(e){return n.assign(this.options,e),this},k.prototype.configure=function(r){var e,t=this;if(n.isString(r)&&!(r=h[e=r]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!r)throw new Error("Wrong `markdown-it` preset, can't be empty");return r.options&&t.set(r.options),r.components&&Object.keys(r.components).forEach(function(e){r.components[e].rules&&t[e].ruler.enableOnly(r.components[e].rules),r.components[e].rules2&&t[e].ruler2.enableOnly(r.components[e].rules2)}),this},k.prototype.enable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(e){t=t.concat(this[e].ruler.enable(r,!0))},this),t=t.concat(this.inline.ruler2.enable(r,!0));var n=r.filter(function(e){return t.indexOf(e)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},k.prototype.disable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(e){t=t.concat(this[e].ruler.disable(r,!0))},this),t=t.concat(this.inline.ruler2.disable(r,!0));var n=r.filter(function(e){return t.indexOf(e)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},k.prototype.use=function(e){var r=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,r),this},k.prototype.parse=function(e,r){if("string"!=typeof e)throw new Error("Input data should be a String");var t=new this.core.State(e,this,r);return this.core.process(t),t.tokens},k.prototype.render=function(e,r){return r=r||{},this.renderer.render(this.parse(e,r),this.options,r)},k.prototype.parseInline=function(e,r){var t=new this.core.State(e,this,r);return t.inlineMode=!0,this.core.process(t),t.tokens},k.prototype.renderInline=function(e,r){return r=r||{},this.renderer.render(this.parseInline(e,r),this.options,r)},r.exports=k},{"./common/utils":4,"./helpers":5,"./parser_block":10,"./parser_core":11,"./parser_inline":12,"./presets/commonmark":13,"./presets/default":14,"./presets/zero":15,"./renderer":16,"linkify-it":53,mdurl:58,punycode:60}],10:[function(e,r,t){"use strict";var n=e("./ruler"),s=[["table",e("./rules_block/table"),["paragraph","reference"]],["code",e("./rules_block/code")],["fence",e("./rules_block/fence"),["paragraph","reference","blockquote","list"]],["blockquote",e("./rules_block/blockquote"),["paragraph","reference","blockquote","list"]],["hr",e("./rules_block/hr"),["paragraph","reference","blockquote","list"]],["list",e("./rules_block/list"),["paragraph","reference","blockquote"]],["reference",e("./rules_block/reference")],["heading",e("./rules_block/heading"),["paragraph","reference","blockquote"]],["lheading",e("./rules_block/lheading")],["html_block",e("./rules_block/html_block"),["paragraph","reference","blockquote"]],["paragraph",e("./rules_block/paragraph")]];function o(){this.ruler=new n;for(var e=0;e<s.length;e++)this.ruler.push(s[e][0],s[e][1],{alt:(s[e][2]||[]).slice()})}o.prototype.tokenize=function(e,r,t){for(var n,s=this.ruler.getRules(""),o=s.length,i=r,a=!1,c=e.md.options.maxNesting;i<t&&(e.line=i=e.skipEmptyLines(i),!(t<=i))&&!(e.sCount[i]<e.blkIndent);){if(e.level>=c){e.line=t;break}for(n=0;n<o&&!s[n](e,i,t,!1);n++);e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),(i=e.line)<t&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}},o.prototype.parse=function(e,r,t,n){var s;e&&(s=new this.State(e,r,t,n),this.tokenize(s,s.line,s.lineMax))},o.prototype.State=e("./rules_block/state_block"),r.exports=o},{"./ruler":17,"./rules_block/blockquote":18,"./rules_block/code":19,"./rules_block/fence":20,"./rules_block/heading":21,"./rules_block/hr":22,"./rules_block/html_block":23,"./rules_block/lheading":24,"./rules_block/list":25,"./rules_block/paragraph":26,"./rules_block/reference":27,"./rules_block/state_block":28,"./rules_block/table":29}],11:[function(e,r,t){"use strict";var n=e("./ruler"),s=[["normalize",e("./rules_core/normalize")],["block",e("./rules_core/block")],["inline",e("./rules_core/inline")],["linkify",e("./rules_core/linkify")],["replacements",e("./rules_core/replacements")],["smartquotes",e("./rules_core/smartquotes")]];function o(){this.ruler=new n;for(var e=0;e<s.length;e++)this.ruler.push(s[e][0],s[e][1])}o.prototype.process=function(e){var r,t,n;for(r=0,t=(n=this.ruler.getRules("")).length;r<t;r++)n[r](e)},o.prototype.State=e("./rules_core/state_core"),r.exports=o},{"./ruler":17,"./rules_core/block":30,"./rules_core/inline":31,"./rules_core/linkify":32,"./rules_core/normalize":33,"./rules_core/replacements":34,"./rules_core/smartquotes":35,"./rules_core/state_core":36}],12:[function(e,r,t){"use strict";var n=e("./ruler"),s=[["text",e("./rules_inline/text")],["newline",e("./rules_inline/newline")],["escape",e("./rules_inline/escape")],["backticks",e("./rules_inline/backticks")],["strikethrough",e("./rules_inline/strikethrough").tokenize],["emphasis",e("./rules_inline/emphasis").tokenize],["link",e("./rules_inline/link")],["image",e("./rules_inline/image")],["autolink",e("./rules_inline/autolink")],["html_inline",e("./rules_inline/html_inline")],["entity",e("./rules_inline/entity")]],o=[["balance_pairs",e("./rules_inline/balance_pairs")],["strikethrough",e("./rules_inline/strikethrough").postProcess],["emphasis",e("./rules_inline/emphasis").postProcess],["text_collapse",e("./rules_inline/text_collapse")]];function i(){var e;for(this.ruler=new n,e=0;e<s.length;e++)this.ruler.push(s[e][0],s[e][1]);for(this.ruler2=new n,e=0;e<o.length;e++)this.ruler2.push(o[e][0],o[e][1])}i.prototype.skipToken=function(e){var r,t,n=e.pos,s=this.ruler.getRules(""),o=s.length,i=e.md.options.maxNesting,a=e.cache;if(void 0===a[n]){if(e.level<i)for(t=0;t<o&&(e.level++,r=s[t](e,!0),e.level--,!r);t++);else e.pos=e.posMax;r||e.pos++,a[n]=e.pos}else e.pos=a[n]},i.prototype.tokenize=function(e){for(var r,t,n=this.ruler.getRules(""),s=n.length,o=e.posMax,i=e.md.options.maxNesting;e.pos<o;){if(e.level<i)for(t=0;t<s&&!(r=n[t](e,!1));t++);if(r){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},i.prototype.parse=function(e,r,t,n){var s,o,i,a=new this.State(e,r,t,n);for(this.tokenize(a),i=(o=this.ruler2.getRules("")).length,s=0;s<i;s++)o[s](a)},i.prototype.State=e("./rules_inline/state_inline"),r.exports=i},{"./ruler":17,"./rules_inline/autolink":37,"./rules_inline/backticks":38,"./rules_inline/balance_pairs":39,"./rules_inline/emphasis":40,"./rules_inline/entity":41,"./rules_inline/escape":42,"./rules_inline/html_inline":43,"./rules_inline/image":44,"./rules_inline/link":45,"./rules_inline/newline":46,"./rules_inline/state_inline":47,"./rules_inline/strikethrough":48,"./rules_inline/text":49,"./rules_inline/text_collapse":50}],13:[function(e,r,t){"use strict";r.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},{}],14:[function(e,r,t){"use strict";r.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},{}],15:[function(e,r,t){"use strict";r.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},{}],16:[function(e,r,t){"use strict";var n=e("./common/utils").assign,h=e("./common/utils").unescapeAll,f=e("./common/utils").escapeHtml,s={};function o(){this.rules=n({},s)}s.code_inline=function(e,r,t,n,s){var o=e[r];return"<code"+s.renderAttrs(o)+">"+f(e[r].content)+"</code>"},s.code_block=function(e,r,t,n,s){var o=e[r];return"<pre"+s.renderAttrs(o)+"><code>"+f(e[r].content)+"</code></pre>\n"},s.fence=function(e,r,t,n,s){var o,i,a,c,l=e[r],u=l.info?h(l.info).trim():"",p="";return u&&(p=u.split(/\s+/g)[0]),0===(o=t.highlight&&t.highlight(l.content,p)||f(l.content)).indexOf("<pre")?o+"\n":u?(i=l.attrIndex("class"),a=l.attrs?l.attrs.slice():[],i<0?a.push(["class",t.langPrefix+p]):a[i][1]+=" "+t.langPrefix+p,c={attrs:a},"<pre><code"+s.renderAttrs(c)+">"+o+"</code></pre>\n"):"<pre><code"+s.renderAttrs(l)+">"+o+"</code></pre>\n"},s.image=function(e,r,t,n,s){var o=e[r];return o.attrs[o.attrIndex("alt")][1]=s.renderInlineAsText(o.children,t,n),s.renderToken(e,r,t)},s.hardbreak=function(e,r,t){return t.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(e,r,t){return t.breaks?t.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(e,r){return f(e[r].content)},s.html_block=function(e,r){return e[r].content},s.html_inline=function(e,r){return e[r].content},o.prototype.renderAttrs=function(e){var r,t,n;if(!e.attrs)return"";for(n="",r=0,t=e.attrs.length;r<t;r++)n+=" "+f(e.attrs[r][0])+'="'+f(e.attrs[r][1])+'"';return n},o.prototype.renderToken=function(e,r,t){var n,s="",o=!1,i=e[r];return i.hidden?"":(i.block&&-1!==i.nesting&&r&&e[r-1].hidden&&(s+="\n"),s+=(-1===i.nesting?"</":"<")+i.tag,s+=this.renderAttrs(i),0===i.nesting&&t.xhtmlOut&&(s+=" /"),i.block&&(o=!0,1===i.nesting&&r+1<e.length&&("inline"===(n=e[r+1]).type||n.hidden?o=!1:-1===n.nesting&&n.tag===i.tag&&(o=!1))),s+=o?">\n":">")},o.prototype.renderInline=function(e,r,t){for(var n,s="",o=this.rules,i=0,a=e.length;i<a;i++)void 0!==o[n=e[i].type]?s+=o[n](e,i,r,t,this):s+=this.renderToken(e,i,r);return s},o.prototype.renderInlineAsText=function(e,r,t){for(var n="",s=0,o=e.length;s<o;s++)"text"===e[s].type?n+=e[s].content:"image"===e[s].type&&(n+=this.renderInlineAsText(e[s].children,r,t));return n},o.prototype.render=function(e,r,t){var n,s,o,i="",a=this.rules;for(n=0,s=e.length;n<s;n++)"inline"===(o=e[n].type)?i+=this.renderInline(e[n].children,r,t):void 0!==a[o]?i+=a[e[n].type](e,n,r,t,this):i+=this.renderToken(e,n,r,t);return i},r.exports=o},{"./common/utils":4}],17:[function(e,r,t){"use strict";function n(){this.__rules__=[],this.__cache__=null}n.prototype.__find__=function(e){for(var r=0;r<this.__rules__.length;r++)if(this.__rules__[r].name===e)return r;return-1},n.prototype.__compile__=function(){var t=this,r=[""];t.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){r.indexOf(e)<0&&r.push(e)})}),t.__cache__={},r.forEach(function(r){t.__cache__[r]=[],t.__rules__.forEach(function(e){e.enabled&&(r&&e.alt.indexOf(r)<0||t.__cache__[r].push(e.fn))})})},n.prototype.at=function(e,r,t){var n=this.__find__(e),s=t||{};if(-1===n)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=r,this.__rules__[n].alt=s.alt||[],this.__cache__=null},n.prototype.before=function(e,r,t,n){var s=this.__find__(e),o=n||{};if(-1===s)throw new Error("Parser rule not found: "+e);this.__rules__.splice(s,0,{name:r,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},n.prototype.after=function(e,r,t,n){var s=this.__find__(e),o=n||{};if(-1===s)throw new Error("Parser rule not found: "+e);this.__rules__.splice(s+1,0,{name:r,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},n.prototype.push=function(e,r,t){var n=t||{};this.__rules__.push({name:e,enabled:!0,fn:r,alt:n.alt||[]}),this.__cache__=null},n.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},n.prototype.enableOnly=function(e,r){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,r)},n.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},n.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},r.exports=n},{}],18:[function(e,r,t){"use strict";var E=e("../common/utils").isSpace;r.exports=function(e,r,t,n){var s,o,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v,x,y,C,A=e.lineMax,w=e.bMarks[r]+e.tShift[r],D=e.eMarks[r];if(4<=e.sCount[r]-e.blkIndent)return!1;if(62!==e.src.charCodeAt(w++))return!1;if(n)return!0;for(a=h=e.sCount[r]+w-(e.bMarks[r]+e.tShift[r]),32===e.src.charCodeAt(w)?(w++,a++,h++,k=!(s=!1)):9===e.src.charCodeAt(w)?(k=!0,(e.bsCount[r]+h)%4==3?(w++,a++,h++,s=!1):s=!0):k=!1,f=[e.bMarks[r]],e.bMarks[r]=w;w<D&&(o=e.src.charCodeAt(w),E(o));)9===o?h+=4-(h+e.bsCount[r]+(s?1:0))%4:h++,w++;for(d=[e.bsCount[r]],e.bsCount[r]=e.sCount[r]+1+(k?1:0),l=D<=w,g=[e.sCount[r]],e.sCount[r]=h-a,b=[e.tShift[r]],e.tShift[r]=w-e.bMarks[r],x=e.md.block.ruler.getRules("blockquote"),_=e.parentType,C=!(e.parentType="blockquote"),p=r+1;p<t&&(e.sCount[p]<e.blkIndent&&(C=!0),w=e.bMarks[p]+e.tShift[p],!((D=e.eMarks[p])<=w));p++)if(62!==e.src.charCodeAt(w++)||C){if(l)break;for(v=!1,i=0,c=x.length;i<c;i++)if(x[i](e,p,t,!0)){v=!0;break}if(v){e.lineMax=p,0!==e.blkIndent&&(f.push(e.bMarks[p]),d.push(e.bsCount[p]),b.push(e.tShift[p]),g.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}f.push(e.bMarks[p]),d.push(e.bsCount[p]),b.push(e.tShift[p]),g.push(e.sCount[p]),e.sCount[p]=-1}else{for(a=h=e.sCount[p]+w-(e.bMarks[p]+e.tShift[p]),32===e.src.charCodeAt(w)?(w++,a++,h++,k=!(s=!1)):9===e.src.charCodeAt(w)?(k=!0,(e.bsCount[p]+h)%4==3?(w++,a++,h++,s=!1):s=!0):k=!1,f.push(e.bMarks[p]),e.bMarks[p]=w;w<D&&(o=e.src.charCodeAt(w),E(o));)9===o?h+=4-(h+e.bsCount[p]+(s?1:0))%4:h++,w++;l=D<=w,d.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(k?1:0),g.push(e.sCount[p]),e.sCount[p]=h-a,b.push(e.tShift[p]),e.tShift[p]=w-e.bMarks[p]}for(m=e.blkIndent,e.blkIndent=0,(y=e.push("blockquote_open","blockquote",1)).markup=">",y.map=u=[r,0],e.md.block.tokenize(e,r,p),(y=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=A,e.parentType=_,u[1]=e.line,i=0;i<b.length;i++)e.bMarks[i+r]=f[i],e.tShift[i+r]=b[i],e.sCount[i+r]=g[i],e.bsCount[i+r]=d[i];return e.blkIndent=m,!0}},{"../common/utils":4}],19:[function(e,r,t){"use strict";r.exports=function(e,r,t){var n,s,o;if(e.sCount[r]-e.blkIndent<4)return!1;for(s=n=r+1;n<t;)if(e.isEmpty(n))n++;else{if(!(4<=e.sCount[n]-e.blkIndent))break;s=++n}return e.line=s,(o=e.push("code_block","code",0)).content=e.getLines(r,s,4+e.blkIndent,!0),o.map=[r,e.line],!0}},{}],20:[function(e,r,t){"use strict";r.exports=function(e,r,t,n){var s,o,i,a,c,l,u,p=!1,h=e.bMarks[r]+e.tShift[r],f=e.eMarks[r];if(4<=e.sCount[r]-e.blkIndent)return!1;if(f<h+3)return!1;if(126!==(s=e.src.charCodeAt(h))&&96!==s)return!1;if(c=h,(o=(h=e.skipChars(h,s))-c)<3)return!1;if(u=e.src.slice(c,h),0<=(i=e.src.slice(h,f)).indexOf(String.fromCharCode(s)))return!1;if(n)return!0;for(a=r;!(t<=++a)&&!((h=c=e.bMarks[a]+e.tShift[a])<(f=e.eMarks[a])&&e.sCount[a]<e.blkIndent);)if(e.src.charCodeAt(h)===s&&!(4<=e.sCount[a]-e.blkIndent||(h=e.skipChars(h,s))-c<o||(h=e.skipSpaces(h))<f)){p=!0;break}return o=e.sCount[r],e.line=a+(p?1:0),(l=e.push("fence","code",0)).info=i,l.content=e.getLines(r+1,a,o,!0),l.markup=u,l.map=[r,e.line],!0}},{}],21:[function(e,r,t){"use strict";var u=e("../common/utils").isSpace;r.exports=function(e,r,t,n){var s,o,i,a,c=e.bMarks[r]+e.tShift[r],l=e.eMarks[r];if(4<=e.sCount[r]-e.blkIndent)return!1;if(35!==(s=e.src.charCodeAt(c))||l<=c)return!1;for(o=1,s=e.src.charCodeAt(++c);35===s&&c<l&&o<=6;)o++,s=e.src.charCodeAt(++c);return!(6<o||c<l&&!u(s))&&(n||(l=e.skipSpacesBack(l,c),c<(i=e.skipCharsBack(l,35,c))&&u(e.src.charCodeAt(i-1))&&(l=i),e.line=r+1,(a=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),a.map=[r,e.line],(a=e.push("inline","",0)).content=e.src.slice(c,l).trim(),a.map=[r,e.line],a.children=[],(a=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),!0)}},{"../common/utils":4}],22:[function(e,r,t){"use strict";var u=e("../common/utils").isSpace;r.exports=function(e,r,t,n){var s,o,i,a,c=e.bMarks[r]+e.tShift[r],l=e.eMarks[r];if(4<=e.sCount[r]-e.blkIndent)return!1;if(42!==(s=e.src.charCodeAt(c++))&&45!==s&&95!==s)return!1;for(o=1;c<l;){if((i=e.src.charCodeAt(c++))!==s&&!u(i))return!1;i===s&&o++}return!(o<3)&&(n||(e.line=r+1,(a=e.push("hr","hr",0)).map=[r,e.line],a.markup=Array(o+1).join(String.fromCharCode(s))),!0)}},{"../common/utils":4}],23:[function(e,r,t){"use strict";var n=e("../common/html_blocks"),s=e("../common/html_re").HTML_OPEN_CLOSE_TAG_RE,u=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+n.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(s.source+"\\s*$"),/^$/,!1]];r.exports=function(e,r,t,n){var s,o,i,a,c=e.bMarks[r]+e.tShift[r],l=e.eMarks[r];if(4<=e.sCount[r]-e.blkIndent)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(a=e.src.slice(c,l),s=0;s<u.length&&!u[s][0].test(a);s++);if(s===u.length)return!1;if(n)return u[s][2];if(o=r+1,!u[s][1].test(a))for(;o<t&&!(e.sCount[o]<e.blkIndent);o++)if(c=e.bMarks[o]+e.tShift[o],l=e.eMarks[o],a=e.src.slice(c,l),u[s][1].test(a)){0!==a.length&&o++;break}return e.line=o,(i=e.push("html_block","",0)).map=[r,o],i.content=e.getLines(r,o,e.blkIndent,!0),!0}},{"../common/html_blocks":2,"../common/html_re":3}],24:[function(e,r,t){"use strict";r.exports=function(e,r,t){var n,s,o,i,a,c,l,u,p,h,f=r+1,d=e.md.block.ruler.getRules("paragraph");if(4<=e.sCount[r]-e.blkIndent)return!1;for(h=e.parentType,e.parentType="paragraph";f<t&&!e.isEmpty(f);f++)if(!(3<e.sCount[f]-e.blkIndent)){if(e.sCount[f]>=e.blkIndent&&(c=e.bMarks[f]+e.tShift[f])<(l=e.eMarks[f])&&(45===(p=e.src.charCodeAt(c))||61===p)&&(c=e.skipChars(c,p),l<=(c=e.skipSpaces(c)))){u=61===p?1:2;break}if(!(e.sCount[f]<0)){for(s=!1,o=0,i=d.length;o<i;o++)if(d[o](e,f,t,!0)){s=!0;break}if(s)break}}return!!u&&(n=e.getLines(r,f,e.blkIndent,!1).trim(),e.line=f+1,(a=e.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(p),a.map=[r,e.line],(a=e.push("inline","",0)).content=n,a.map=[r,e.line-1],a.children=[],(a=e.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(p),e.parentType=h,!0)}},{}],25:[function(e,r,t){"use strict";var i=e("../common/utils").isSpace;function I(e,r){var t,n,s,o;return n=e.bMarks[r]+e.tShift[r],s=e.eMarks[r],42!==(t=e.src.charCodeAt(n++))&&45!==t&&43!==t?-1:n<s&&(o=e.src.charCodeAt(n),!i(o))?-1:n}function R(e,r){var t,n=e.bMarks[r]+e.tShift[r],s=n,o=e.eMarks[r];if(o<=s+1)return-1;if((t=e.src.charCodeAt(s++))<48||57<t)return-1;for(;;){if(o<=s)return-1;if(!(48<=(t=e.src.charCodeAt(s++))&&t<=57)){if(41===t||46===t)break;return-1}if(10<=s-n)return-1}return s<o&&(t=e.src.charCodeAt(s),!i(t))?-1:s}r.exports=function(e,r,t,n){var s,o,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v,x,y,C,A,w,D,E,q,S,F,L,z=!1,T=!0;if(4<=e.sCount[r]-e.blkIndent)return!1;if(n&&"paragraph"===e.parentType&&e.tShift[r]>=e.blkIndent&&(z=!0),0<=(D=R(e,r))){if(u=!0,q=e.bMarks[r]+e.tShift[r],_=Number(e.src.substr(q,D-q-1)),z&&1!==_)return!1}else{if(!(0<=(D=I(e,r))))return!1;u=!1}if(z&&e.skipSpaces(D)>=e.eMarks[r])return!1;if(m=e.src.charCodeAt(D-1),n)return!0;for(d=e.tokens.length,u?(L=e.push("ordered_list_open","ol",1),1!==_&&(L.attrs=[["start",_]])):L=e.push("bullet_list_open","ul",1),L.map=f=[r,0],L.markup=String.fromCharCode(m),b=r,E=!1,F=e.md.block.ruler.getRules("list"),y=e.parentType,e.parentType="list";b<t;){for(w=D,g=e.eMarks[b],l=k=e.sCount[b]+D-(e.bMarks[r]+e.tShift[r]);w<g;){if(9===(s=e.src.charCodeAt(w)))k+=4-(k+e.bsCount[b])%4;else{if(32!==s)break;k++}w++}if(4<(c=g<=(o=w)?1:k-l)&&(c=1),a=l+c,(L=e.push("list_item_open","li",1)).markup=String.fromCharCode(m),L.map=p=[r,0],v=e.blkIndent,A=e.tight,C=e.tShift[r],x=e.sCount[r],e.blkIndent=a,e.tight=!0,e.tShift[r]=o-e.bMarks[r],e.sCount[r]=k,g<=o&&e.isEmpty(r+1)?e.line=Math.min(e.line+2,t):e.md.block.tokenize(e,r,t,!0),e.tight&&!E||(T=!1),E=1<e.line-r&&e.isEmpty(e.line-1),e.blkIndent=v,e.tShift[r]=C,e.sCount[r]=x,e.tight=A,(L=e.push("list_item_close","li",-1)).markup=String.fromCharCode(m),b=r=e.line,p[1]=b,o=e.bMarks[r],t<=b)break;if(e.sCount[b]<e.blkIndent)break;for(S=!1,i=0,h=F.length;i<h;i++)if(F[i](e,b,t,!0)){S=!0;break}if(S)break;if(u){if((D=R(e,b))<0)break}else if((D=I(e,b))<0)break;if(m!==e.src.charCodeAt(D-1))break}return(L=u?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(m),f[1]=b,e.line=b,e.parentType=y,T&&function(e,r){var t,n,s=e.level+2;for(t=r+2,n=e.tokens.length-2;t<n;t++)e.tokens[t].level===s&&"paragraph_open"===e.tokens[t].type&&(e.tokens[t+2].hidden=!0,e.tokens[t].hidden=!0,t+=2)}(e,d),!0}},{"../common/utils":4}],26:[function(e,r,t){"use strict";r.exports=function(e,r){var t,n,s,o,i,a,c=r+1,l=e.md.block.ruler.getRules("paragraph"),u=e.lineMax;for(a=e.parentType,e.parentType="paragraph";c<u&&!e.isEmpty(c);c++)if(!(3<e.sCount[c]-e.blkIndent||e.sCount[c]<0)){for(n=!1,s=0,o=l.length;s<o;s++)if(l[s](e,c,u,!0)){n=!0;break}if(n)break}return t=e.getLines(r,c,e.blkIndent,!1).trim(),e.line=c,(i=e.push("paragraph_open","p",1)).map=[r,e.line],(i=e.push("inline","",0)).content=t,i.map=[r,e.line],i.children=[],i=e.push("paragraph_close","p",-1),e.parentType=a,!0}},{}],27:[function(e,r,t){"use strict";var A=e("../common/utils").normalizeReference,w=e("../common/utils").isSpace;r.exports=function(e,r,t,n){var s,o,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v=0,x=e.bMarks[r]+e.tShift[r],y=e.eMarks[r],C=r+1;if(4<=e.sCount[r]-e.blkIndent)return!1;if(91!==e.src.charCodeAt(x))return!1;for(;++x<y;)if(93===e.src.charCodeAt(x)&&92!==e.src.charCodeAt(x-1)){if(x+1===y)return!1;if(58!==e.src.charCodeAt(x+1))return!1;break}for(a=e.lineMax,b=e.md.block.ruler.getRules("reference"),f=e.parentType,e.parentType="reference";C<a&&!e.isEmpty(C);C++)if(!(3<e.sCount[C]-e.blkIndent||e.sCount[C]<0)){for(g=!1,l=0,u=b.length;l<u;l++)if(b[l](e,C,a,!0)){g=!0;break}if(g)break}for(y=(_=e.getLines(r,C,e.blkIndent,!1).trim()).length,x=1;x<y;x++){if(91===(s=_.charCodeAt(x)))return!1;if(93===s){h=x;break}10===s?v++:92===s&&++x<y&&10===_.charCodeAt(x)&&v++}if(h<0||58!==_.charCodeAt(h+1))return!1;for(x=h+2;x<y;x++)if(10===(s=_.charCodeAt(x)))v++;else if(!w(s))break;if(!(d=e.md.helpers.parseLinkDestination(_,x,y)).ok)return!1;if(c=e.md.normalizeLink(d.str),!e.md.validateLink(c))return!1;for(x=d.pos,i=v+=d.lines,m=o=x;x<y;x++)if(10===(s=_.charCodeAt(x)))v++;else if(!w(s))break;for(d=e.md.helpers.parseLinkTitle(_,x,y),x<y&&m!==x&&d.ok?(k=d.str,x=d.pos,v+=d.lines):(k="",x=o,v=i);x<y&&(s=_.charCodeAt(x),w(s));)x++;if(x<y&&10!==_.charCodeAt(x)&&k)for(k="",x=o,v=i;x<y&&(s=_.charCodeAt(x),w(s));)x++;return!(x<y&&10!==_.charCodeAt(x))&&(!!(p=A(_.slice(1,h)))&&(n||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[p]&&(e.env.references[p]={title:k,href:c}),e.parentType=f,e.line=r+v+1),!0))}},{"../common/utils":4}],28:[function(e,r,t){"use strict";var s=e("../token"),h=e("../common/utils").isSpace;function n(e,r,t,n){var s,o,i,a,c,l,u,p;for(this.src=e,this.md=r,this.env=t,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.parentType="root",this.level=0,this.result="",p=!1,i=a=l=u=0,c=(o=this.src).length;a<c;a++){if(s=o.charCodeAt(a),!p){if(h(s)){l++,9===s?u+=4-u%4:u++;continue}p=!0}10!==s&&a!==c-1||(10!==s&&a++,this.bMarks.push(i),this.eMarks.push(a),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),p=!1,u=l=0,i=a+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}n.prototype.push=function(e,r,t){var n=new s(e,r,t);return n.block=!0,t<0&&this.level--,n.level=this.level,0<t&&this.level++,this.tokens.push(n),n},n.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},n.prototype.skipEmptyLines=function(e){for(var r=this.lineMax;e<r&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},n.prototype.skipSpaces=function(e){for(var r,t=this.src.length;e<t&&(r=this.src.charCodeAt(e),h(r));e++);return e},n.prototype.skipSpacesBack=function(e,r){if(e<=r)return e;for(;r<e;)if(!h(this.src.charCodeAt(--e)))return e+1;return e},n.prototype.skipChars=function(e,r){for(var t=this.src.length;e<t&&this.src.charCodeAt(e)===r;e++);return e},n.prototype.skipCharsBack=function(e,r,t){if(e<=t)return e;for(;t<e;)if(r!==this.src.charCodeAt(--e))return e+1;return e},n.prototype.getLines=function(e,r,t,n){var s,o,i,a,c,l,u,p=e;if(r<=e)return"";for(l=new Array(r-e),s=0;p<r;p++,s++){for(o=0,u=a=this.bMarks[p],c=p+1<r||n?this.eMarks[p]+1:this.eMarks[p];a<c&&o<t;){if(i=this.src.charCodeAt(a),h(i))9===i?o+=4-(o+this.bsCount[p])%4:o++;else{if(!(a-u<this.tShift[p]))break;o++}a++}l[s]=t<o?new Array(o-t+1).join(" ")+this.src.slice(a,c):this.src.slice(a,c)}return l.join("")},n.prototype.Token=s,r.exports=n},{"../common/utils":4,"../token":51}],29:[function(e,r,t){"use strict";var _=e("../common/utils").isSpace;function g(e,r){var t=e.bMarks[r]+e.blkIndent,n=e.eMarks[r];return e.src.substr(t,n-t)}function b(e){var r,t=[],n=0,s=e.length,o=0,i=0,a=!1,c=0;for(r=e.charCodeAt(n);n<s;)96===r?a?(a=!1,c=n):o%2==0&&(a=!0,c=n):124!==r||o%2!=0||a||(t.push(e.substring(i,n)),i=n+1),92===r?o++:o=0,++n===s&&a&&(a=!1,n=c+1),r=e.charCodeAt(n);return t.push(e.substring(i)),t}r.exports=function(e,r,t,n){var s,o,i,a,c,l,u,p,h,f,d,m;if(t<r+2)return!1;if(c=r+1,e.sCount[c]<e.blkIndent)return!1;if(4<=e.sCount[c]-e.blkIndent)return!1;if((i=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(s=e.src.charCodeAt(i++))&&45!==s&&58!==s)return!1;for(;i<e.eMarks[c];){if(124!==(s=e.src.charCodeAt(i))&&45!==s&&58!==s&&!_(s))return!1;i++}for(l=(o=g(e,r+1)).split("|"),h=[],a=0;a<l.length;a++){if(!(f=l[a].trim())){if(0===a||a===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(f))return!1;58===f.charCodeAt(f.length-1)?h.push(58===f.charCodeAt(0)?"center":"right"):58===f.charCodeAt(0)?h.push("left"):h.push("")}if(-1===(o=g(e,r).trim()).indexOf("|"))return!1;if(4<=e.sCount[r]-e.blkIndent)return!1;if((u=(l=b(o.replace(/^\||\|$/g,""))).length)>h.length)return!1;if(n)return!0;for((p=e.push("table_open","table",1)).map=d=[r,0],(p=e.push("thead_open","thead",1)).map=[r,r+1],(p=e.push("tr_open","tr",1)).map=[r,r+1],a=0;a<l.length;a++)(p=e.push("th_open","th",1)).map=[r,r+1],h[a]&&(p.attrs=[["style","text-align:"+h[a]]]),(p=e.push("inline","",0)).content=l[a].trim(),p.map=[r,r+1],p.children=[],p=e.push("th_close","th",-1);for(p=e.push("tr_close","tr",-1),p=e.push("thead_close","thead",-1),(p=e.push("tbody_open","tbody",1)).map=m=[r+2,0],c=r+2;c<t&&!(e.sCount[c]<e.blkIndent)&&-1!==(o=g(e,c).trim()).indexOf("|")&&!(4<=e.sCount[c]-e.blkIndent);c++){for(l=b(o.replace(/^\||\|$/g,"")),p=e.push("tr_open","tr",1),a=0;a<u;a++)p=e.push("td_open","td",1),h[a]&&(p.attrs=[["style","text-align:"+h[a]]]),(p=e.push("inline","",0)).content=l[a]?l[a].trim():"",p.children=[],p=e.push("td_close","td",-1);p=e.push("tr_close","tr",-1)}return p=e.push("tbody_close","tbody",-1),p=e.push("table_close","table",-1),d[1]=m[1]=c,e.line=c,!0}},{"../common/utils":4}],30:[function(e,r,t){"use strict";r.exports=function(e){var r;e.inlineMode?((r=new e.Token("inline","",0)).content=e.src,r.map=[0,1],r.children=[],e.tokens.push(r)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},{}],31:[function(e,r,t){"use strict";r.exports=function(e){var r,t,n,s=e.tokens;for(t=0,n=s.length;t<n;t++)"inline"===(r=s[t]).type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}},{}],32:[function(e,r,t){"use strict";var x=e("../common/utils").arrayReplaceAt;r.exports=function(e){var r,t,n,s,o,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v=e.tokens;if(e.md.options.linkify)for(t=0,n=v.length;t<n;t++)if("inline"===v[t].type&&e.md.linkify.pretest(v[t].content))for(f=0,r=(s=v[t].children).length-1;0<=r;r--)if("link_close"!==(i=s[r]).type){if("html_inline"===i.type&&(k=i.content,/^<a[>\s]/i.test(k)&&0<f&&f--,b=i.content,/^<\/a\s*>/i.test(b)&&f++),!(0<f)&&"text"===i.type&&e.md.linkify.test(i.content)){for(l=i.content,g=e.md.linkify.match(l),a=[],h=i.level,c=p=0;c<g.length;c++)d=g[c].url,m=e.md.normalizeLink(d),e.md.validateLink(m)&&(_=g[c].text,_=g[c].schema?"mailto:"!==g[c].schema||/^mailto:/i.test(_)?e.md.normalizeLinkText(_):e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,""),p<(u=g[c].index)&&((o=new e.Token("text","",0)).content=l.slice(p,u),o.level=h,a.push(o)),(o=new e.Token("link_open","a",1)).attrs=[["href",m]],o.level=h++,o.markup="linkify",o.info="auto",a.push(o),(o=new e.Token("text","",0)).content=_,o.level=h,a.push(o),(o=new e.Token("link_close","a",-1)).level=--h,o.markup="linkify",o.info="auto",a.push(o),p=g[c].lastIndex);p<l.length&&((o=new e.Token("text","",0)).content=l.slice(p),o.level=h,a.push(o)),v[t].children=s=x(s,r,a)}}else for(r--;s[r].level!==i.level&&"link_open"!==s[r].type;)r--}},{"../common/utils":4}],33:[function(e,r,t){"use strict";var n=/\r[\n\u0085]?|[\u2424\u2028\u0085]/g,s=/\u0000/g;r.exports=function(e){var r;r=(r=e.src.replace(n,"\n")).replace(s,"\ufffd"),e.src=r}},{}],34:[function(e,r,t){"use strict";var s=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,o=/\((c|tm|r|p)\)/gi,i={c:"\xa9",r:"\xae",p:"\xa7",tm:"\u2122"};function a(e,r){return i[r.toLowerCase()]}function c(e){var r,t,n=0;for(r=e.length-1;0<=r;r--)"text"!==(t=e[r]).type||n||(t.content=t.content.replace(o,a)),"link_open"===t.type&&"auto"===t.info&&n--,"link_close"===t.type&&"auto"===t.info&&n++}function l(e){var r,t,n=0;for(r=e.length-1;0<=r;r--)"text"!==(t=e[r]).type||n||s.test(t.content)&&(t.content=t.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"\u2026").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1\u2014$2").replace(/(^|\s)--(\s|$)/gm,"$1\u2013$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1\u2013$2")),"link_open"===t.type&&"auto"===t.info&&n--,"link_close"===t.type&&"auto"===t.info&&n++}r.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;0<=r;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&c(e.tokens[r].children),s.test(e.tokens[r].content)&&l(e.tokens[r].children))}},{}],35:[function(e,r,t){"use strict";var C=e("../common/utils").isWhiteSpace,A=e("../common/utils").isPunctChar,w=e("../common/utils").isMdAsciiPunct,n=/['"]/,D=/['"]/g,E="\u2019";function q(e,r,t){return e.substr(0,r)+t+e.substr(r+1)}function s(e,r){var t,n,s,o,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v,x,y;for(v=[],t=0;t<e.length;t++){for(n=e[t],c=e[t].level,b=v.length-1;0<=b&&!(v[b].level<=c);b--);if(v.length=b+1,"text"===n.type){i=0,a=(s=n.content).length;e:for(;i<a&&(D.lastIndex=i,o=D.exec(s));){if(_=g=!0,i=o.index+1,k="'"===o[0],u=32,0<=o.index-1)u=s.charCodeAt(o.index-1);else for(b=t-1;0<=b&&("softbreak"!==e[b].type&&"hardbreak"!==e[b].type);b--)if("text"===e[b].type){u=e[b].content.charCodeAt(e[b].content.length-1);break}if(p=32,i<a)p=s.charCodeAt(i);else for(b=t+1;b<e.length&&("softbreak"!==e[b].type&&"hardbreak"!==e[b].type);b++)if("text"===e[b].type){p=e[b].content.charCodeAt(0);break}if(h=w(u)||A(String.fromCharCode(u)),f=w(p)||A(String.fromCharCode(p)),d=C(u),(m=C(p))?_=!1:f&&(d||h||(_=!1)),d?g=!1:h&&(m||f||(g=!1)),34===p&&'"'===o[0]&&48<=u&&u<=57&&(g=_=!1),_&&g&&(_=!1,g=f),_||g){if(g)for(b=v.length-1;0<=b&&(l=v[b],!(v[b].level<c));b--)if(l.single===k&&v[b].level===c){l=v[b],k?(x=r.md.options.quotes[2],y=r.md.options.quotes[3]):(x=r.md.options.quotes[0],y=r.md.options.quotes[1]),n.content=q(n.content,o.index,y),e[l.token].content=q(e[l.token].content,l.pos,x),i+=y.length-1,l.token===t&&(i+=x.length-1),a=(s=n.content).length,v.length=b;continue e}_?v.push({token:t,pos:o.index,single:k,level:c}):g&&k&&(n.content=q(n.content,o.index,E))}else k&&(n.content=q(n.content,o.index,E))}}}}r.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;0<=r;r--)"inline"===e.tokens[r].type&&n.test(e.tokens[r].content)&&s(e.tokens[r].children,e)}},{"../common/utils":4}],36:[function(e,r,t){"use strict";var n=e("../token");function s(e,r,t){this.src=e,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=r}s.prototype.Token=n,r.exports=s},{"../token":51}],37:[function(e,r,t){"use strict";var l=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,u=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;r.exports=function(e,r){var t,n,s,o,i,a,c=e.pos;return 60===e.src.charCodeAt(c)&&(!((t=e.src.slice(c)).indexOf(">")<0)&&(u.test(t)?(o=(n=t.match(u))[0].slice(1,-1),i=e.md.normalizeLink(o),!!e.md.validateLink(i)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",i]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(o),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=n[0].length,!0)):!!l.test(t)&&(o=(s=t.match(l))[0].slice(1,-1),i=e.md.normalizeLink("mailto:"+o),!!e.md.validateLink(i)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",i]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(o),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=s[0].length,!0))))}},{}],38:[function(e,r,t){"use strict";r.exports=function(e,r){var t,n,s,o,i,a,c=e.pos;if(96!==e.src.charCodeAt(c))return!1;for(t=c,c++,n=e.posMax;c<n&&96===e.src.charCodeAt(c);)c++;for(s=e.src.slice(t,c),o=i=c;-1!==(o=e.src.indexOf("`",i));){for(i=o+1;i<n&&96===e.src.charCodeAt(i);)i++;if(i-o===s.length)return r||((a=e.push("code_inline","code",0)).markup=s,a.content=e.src.slice(c,o).replace(/[ \n]+/g," ").trim()),e.pos=i,!0}return r||(e.pending+=s),e.pos+=s.length,!0}},{}],39:[function(e,r,t){"use strict";r.exports=function(e){var r,t,n,s,o=e.delimiters,i=e.delimiters.length;for(r=0;r<i;r++)if((n=o[r]).close)for(t=r-n.jump-1;0<=t;){if((s=o[t]).open&&s.marker===n.marker&&s.end<0&&s.level===n.level)if(!((s.close||n.open)&&void 0!==s.length&&void 0!==n.length&&(s.length+n.length)%3==0)){n.jump=r-t,n.open=!1,s.end=r,s.jump=0;break}t-=s.jump+1}}},{}],40:[function(e,r,t){"use strict";r.exports.tokenize=function(e,r){var t,n,s=e.pos,o=e.src.charCodeAt(s);if(r)return!1;if(95!==o&&42!==o)return!1;for(n=e.scanDelims(e.pos,42===o),t=0;t<n.length;t++)e.push("text","",0).content=String.fromCharCode(o),e.delimiters.push({marker:o,length:n.length,jump:t,token:e.tokens.length-1,level:e.level,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0},r.exports.postProcess=function(e){var r,t,n,s,o,i,a=e.delimiters;for(r=e.delimiters.length-1;0<=r;r--)95!==(t=a[r]).marker&&42!==t.marker||-1!==t.end&&(n=a[t.end],i=0<r&&a[r-1].end===t.end+1&&a[r-1].token===t.token-1&&a[t.end+1].token===n.token+1&&a[r-1].marker===t.marker,o=String.fromCharCode(t.marker),(s=e.tokens[t.token]).type=i?"strong_open":"em_open",s.tag=i?"strong":"em",s.nesting=1,s.markup=i?o+o:o,s.content="",(s=e.tokens[n.token]).type=i?"strong_close":"em_close",s.tag=i?"strong":"em",s.nesting=-1,s.markup=i?o+o:o,s.content="",i&&(e.tokens[a[r-1].token].content="",e.tokens[a[t.end+1].token].content="",r--))}},{}],41:[function(e,r,t){"use strict";var i=e("../common/entities"),a=e("../common/utils").has,c=e("../common/utils").isValidEntityCode,l=e("../common/utils").fromCodePoint,u=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,p=/^&([a-z][a-z0-9]{1,31});/i;r.exports=function(e,r){var t,n,s=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(s))return!1;if(s+1<o)if(35===e.src.charCodeAt(s+1)){if(n=e.src.slice(s).match(u))return r||(t="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),e.pending+=c(t)?l(t):l(65533)),e.pos+=n[0].length,!0}else if((n=e.src.slice(s).match(p))&&a(i,n[1]))return r||(e.pending+=i[n[1]]),e.pos+=n[0].length,!0;return r||(e.pending+="&"),e.pos++,!0}},{"../common/entities":1,"../common/utils":4}],42:[function(e,r,t){"use strict";for(var o=e("../common/utils").isSpace,i=[],n=0;n<256;n++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){i[e.charCodeAt(0)]=1}),r.exports=function(e,r){var t,n=e.pos,s=e.posMax;if(92!==e.src.charCodeAt(n))return!1;if(++n<s){if((t=e.src.charCodeAt(n))<256&&0!==i[t])return r||(e.pending+=e.src[n]),e.pos+=2,!0;if(10===t){for(r||e.push("hardbreak","br",0),n++;n<s&&(t=e.src.charCodeAt(n),o(t));)n++;return e.pos=n,!0}}return r||(e.pending+="\\"),e.pos++,!0}},{"../common/utils":4}],43:[function(e,r,t){"use strict";var a=e("../common/html_re").HTML_TAG_RE;r.exports=function(e,r){var t,n,s,o,i=e.pos;return!!e.md.options.html&&(s=e.posMax,!(60!==e.src.charCodeAt(i)||s<=i+2)&&((33===(t=e.src.charCodeAt(i+1))||63===t||47===t||97<=(o=32|t)&&o<=122)&&(!!(n=e.src.slice(i).match(a))&&(r||(e.push("html_inline","",0).content=e.src.slice(i,i+n[0].length)),e.pos+=n[0].length,!0))))}},{"../common/html_re":3}],44:[function(e,r,t){"use strict";var b=e("../common/utils").normalizeReference,k=e("../common/utils").isSpace;r.exports=function(e,r){var t,n,s,o,i,a,c,l,u,p,h,f,d,m="",_=e.pos,g=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(a=e.pos+2,(i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((c=i+1)<g&&40===e.src.charCodeAt(c)){for(c++;c<g&&(n=e.src.charCodeAt(c),k(n)||10===n);c++);if(g<=c)return!1;for(d=c,(u=e.md.helpers.parseLinkDestination(e.src,c,e.posMax)).ok&&(m=e.md.normalizeLink(u.str),e.md.validateLink(m)?c=u.pos:m=""),d=c;c<g&&(n=e.src.charCodeAt(c),k(n)||10===n);c++);if(u=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<g&&d!==c&&u.ok)for(p=u.str,c=u.pos;c<g&&(n=e.src.charCodeAt(c),k(n)||10===n);c++);else p="";if(g<=c||41!==e.src.charCodeAt(c))return e.pos=_,!1;c++}else{if(void 0===e.env.references)return!1;if(c<g&&91===e.src.charCodeAt(c)?(d=c+1,0<=(c=e.md.helpers.parseLinkLabel(e,c))?o=e.src.slice(d,c++):c=i+1):c=i+1,o||(o=e.src.slice(a,i)),!(l=e.env.references[b(o)]))return e.pos=_,!1;m=l.href,p=l.title}return r||(s=e.src.slice(a,i),e.md.inline.parse(s,e.md,e.env,f=[]),(h=e.push("image","img",0)).attrs=t=[["src",m],["alt",""]],h.children=f,h.content=s,p&&t.push(["title",p])),e.pos=c,e.posMax=g,!0}},{"../common/utils":4}],45:[function(e,r,t){"use strict";var _=e("../common/utils").normalizeReference,g=e("../common/utils").isSpace;r.exports=function(e,r){var t,n,s,o,i,a,c,l,u,p="",h=e.pos,f=e.posMax,d=e.pos,m=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(i=e.pos+1,(o=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((a=o+1)<f&&40===e.src.charCodeAt(a)){for(m=!1,a++;a<f&&(n=e.src.charCodeAt(a),g(n)||10===n);a++);if(f<=a)return!1;for(d=a,(c=e.md.helpers.parseLinkDestination(e.src,a,e.posMax)).ok&&(p=e.md.normalizeLink(c.str),e.md.validateLink(p)?a=c.pos:p=""),d=a;a<f&&(n=e.src.charCodeAt(a),g(n)||10===n);a++);if(c=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&d!==a&&c.ok)for(u=c.str,a=c.pos;a<f&&(n=e.src.charCodeAt(a),g(n)||10===n);a++);else u="";(f<=a||41!==e.src.charCodeAt(a))&&(m=!0),a++}if(m){if(void 0===e.env.references)return!1;if(a<f&&91===e.src.charCodeAt(a)?(d=a+1,0<=(a=e.md.helpers.parseLinkLabel(e,a))?s=e.src.slice(d,a++):a=o+1):a=o+1,s||(s=e.src.slice(i,o)),!(l=e.env.references[_(s)]))return e.pos=h,!1;p=l.href,u=l.title}return r||(e.pos=i,e.posMax=o,e.push("link_open","a",1).attrs=t=[["href",p]],u&&t.push(["title",u]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=a,e.posMax=f,!0}},{"../common/utils":4}],46:[function(e,r,t){"use strict";var o=e("../common/utils").isSpace;r.exports=function(e,r){var t,n,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;for(t=e.pending.length-1,n=e.posMax,r||(0<=t&&32===e.pending.charCodeAt(t)?1<=t&&32===e.pending.charCodeAt(t-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),s++;s<n&&o(e.src.charCodeAt(s));)s++;return e.pos=s,!0}},{"../common/utils":4}],47:[function(e,r,t){"use strict";var s=e("../token"),_=e("../common/utils").isWhiteSpace,g=e("../common/utils").isPunctChar,b=e("../common/utils").isMdAsciiPunct;function n(e,r,t,n){this.src=e,this.env=t,this.md=r,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}n.prototype.pushPending=function(){var e=new s("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},n.prototype.push=function(e,r,t){this.pending&&this.pushPending();var n=new s(e,r,t);return t<0&&this.level--,n.level=this.level,0<t&&this.level++,this.pendingLevel=this.level,this.tokens.push(n),n},n.prototype.scanDelims=function(e,r){var t,n,s,o,i,a,c,l,u,p=e,h=!0,f=!0,d=this.posMax,m=this.src.charCodeAt(e);for(t=0<e?this.src.charCodeAt(e-1):32;p<d&&this.src.charCodeAt(p)===m;)p++;return s=p-e,n=p<d?this.src.charCodeAt(p):32,c=b(t)||g(String.fromCharCode(t)),u=b(n)||g(String.fromCharCode(n)),a=_(t),(l=_(n))?h=!1:u&&(a||c||(h=!1)),a?f=!1:c&&(l||u||(f=!1)),r?(o=h,i=f):(o=h&&(!f||c),i=f&&(!h||u)),{can_open:o,can_close:i,length:s}},n.prototype.Token=s,r.exports=n},{"../common/utils":4,"../token":51}],48:[function(e,r,t){"use strict";r.exports.tokenize=function(e,r){var t,n,s,o,i=e.pos,a=e.src.charCodeAt(i);if(r)return!1;if(126!==a)return!1;if(s=(n=e.scanDelims(e.pos,!0)).length,o=String.fromCharCode(a),s<2)return!1;for(s%2&&(e.push("text","",0).content=o,s--),t=0;t<s;t+=2)e.push("text","",0).content=o+o,e.delimiters.push({marker:a,jump:t,token:e.tokens.length-1,level:e.level,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0},r.exports.postProcess=function(e){var r,t,n,s,o,i=[],a=e.delimiters,c=e.delimiters.length;for(r=0;r<c;r++)126===(n=a[r]).marker&&-1!==n.end&&(s=a[n.end],(o=e.tokens[n.token]).type="s_open",o.tag="s",o.nesting=1,o.markup="~~",o.content="",(o=e.tokens[s.token]).type="s_close",o.tag="s",o.nesting=-1,o.markup="~~",o.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&i.push(s.token-1));for(;i.length;){for(t=(r=i.pop())+1;t<e.tokens.length&&"s_close"===e.tokens[t].type;)t++;r!==--t&&(o=e.tokens[t],e.tokens[t]=e.tokens[r],e.tokens[r]=o)}}},{}],49:[function(e,r,t){"use strict";function n(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}r.exports=function(e,r){for(var t=e.pos;t<e.posMax&&!n(e.src.charCodeAt(t));)t++;return t!==e.pos&&(r||(e.pending+=e.src.slice(e.pos,t)),e.pos=t,!0)}},{}],50:[function(e,r,t){"use strict";r.exports=function(e){var r,t,n=0,s=e.tokens,o=e.tokens.length;for(r=t=0;r<o;r++)n+=s[r].nesting,s[r].level=n,"text"===s[r].type&&r+1<o&&"text"===s[r+1].type?s[r+1].content=s[r].content+s[r+1].content:(r!==t&&(s[t]=s[r]),t++);r!==t&&(s.length=t)}},{}],51:[function(e,r,t){"use strict";function n(e,r,t){this.type=e,this.tag=r,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}n.prototype.attrIndex=function(e){var r,t,n;if(!this.attrs)return-1;for(t=0,n=(r=this.attrs).length;t<n;t++)if(r[t][0]===e)return t;return-1},n.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},n.prototype.attrSet=function(e,r){var t=this.attrIndex(e),n=[e,r];t<0?this.attrPush(n):this.attrs[t]=n},n.prototype.attrGet=function(e){var r=this.attrIndex(e),t=null;return 0<=r&&(t=this.attrs[r][1]),t},n.prototype.attrJoin=function(e,r){var t=this.attrIndex(e);t<0?this.attrPush([e,r]):this.attrs[t][1]=this.attrs[t][1]+" "+r},r.exports=n},{}],52:[function(e,r,t){r.exports={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105",in:"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba",int:"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minus:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280",npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"}},{}],53:[function(c,e,r){"use strict";function n(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(e){t[e]=r[e]})}),t}function l(e){return Object.prototype.toString.call(e)}function u(e){return"[object Function]"===l(e)}function p(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var s={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var o={"http:":{validate:function(e,r,t){var n=e.slice(r);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,r,t){var n=e.slice(r);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?3<=r&&":"===e[r-3]?0:3<=r&&"/"===e[r-3]?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(e,r,t){var n=e.slice(r);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},h="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",i="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function a(s){var r=s.re=c("./lib/re")(s.__opts__),e=s.__tlds__.slice();function t(e){return e.replace("%TLDS%",r.src_tlds)}s.onCompile(),s.__tlds_replaced__||e.push(h),e.push(r.src_xn),r.src_tlds=e.join("|"),r.email_fuzzy=RegExp(t(r.tpl_email_fuzzy),"i"),r.link_fuzzy=RegExp(t(r.tpl_link_fuzzy),"i"),r.link_no_ip_fuzzy=RegExp(t(r.tpl_link_no_ip_fuzzy),"i"),r.host_fuzzy_test=RegExp(t(r.tpl_host_fuzzy_test),"i");var o=[];function i(e,r){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+r)}s.__compiled__={},Object.keys(s.__schemas__).forEach(function(e){var r=s.__schemas__[e];if(null!==r){var n,t={validate:null,link:null};if(s.__compiled__[e]=t,"[object Object]"===l(r))return"[object RegExp]"===l(r.validate)?t.validate=(n=r.validate,function(e,r){var t=e.slice(r);return n.test(t)?t.match(n)[0].length:0}):u(r.validate)?t.validate=r.validate:i(e,r),void(u(r.normalize)?t.normalize=r.normalize:r.normalize?i(e,r):t.normalize=function(e,r){r.normalize(e)});if("[object String]"!==l(r))i(e,r);else o.push(e)}}),o.forEach(function(e){s.__compiled__[s.__schemas__[e]]&&(s.__compiled__[e].validate=s.__compiled__[s.__schemas__[e]].validate,s.__compiled__[e].normalize=s.__compiled__[s.__schemas__[e]].normalize)}),s.__compiled__[""]={validate:null,normalize:function(e,r){r.normalize(e)}};var n,a=Object.keys(s.__compiled__).filter(function(e){return 0<e.length&&s.__compiled__[e]}).map(p).join("|");s.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+r.src_ZPCc+"))("+a+")","i"),s.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+r.src_ZPCc+"))("+a+")","ig"),s.re.pretest=RegExp("("+s.re.schema_test.source+")|("+s.re.host_fuzzy_test.source+")|@","i"),(n=s).__index__=-1,n.__text_cache__=""}function f(e,r){var t=new function(e,r){var t=e.__index__,n=e.__last_index__,s=e.__text_cache__.slice(t,n);this.schema=e.__schema__.toLowerCase(),this.index=t+r,this.lastIndex=n+r,this.raw=s,this.text=s,this.url=s}(e,r);return e.__compiled__[t.schema].normalize(t,e),t}function d(e,r){if(!(this instanceof d))return new d(e,r);var t;r||(t=e,Object.keys(t||{}).reduce(function(e,r){return e||s.hasOwnProperty(r)},!1)&&(r=e,e={})),this.__opts__=n({},s,r),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},o,e),this.__compiled__={},this.__tlds__=i,this.__tlds_replaced__=!1,this.re={},a(this)}d.prototype.add=function(e,r){return this.__schemas__[e]=r,a(this),this},d.prototype.set=function(e){return this.__opts__=n(this.__opts__,e),this},d.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var r,t,n,s,o,i,a,c;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(r=a.exec(e));)if(s=this.testSchemaAt(e,r[2],a.lastIndex)){this.__schema__=r[2],this.__index__=r.index+r[1].length,this.__last_index__=r.index+r[0].length+s;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&0<=(c=e.search(this.re.host_fuzzy_test))&&(this.__index__<0||c<this.__index__)&&null!==(t=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=t.index+t[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=t.index+t[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&0<=e.indexOf("@")&&null!==(n=e.match(this.re.email_fuzzy))&&(o=n.index+n[1].length,i=n.index+n[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=i)),0<=this.__index__},d.prototype.pretest=function(e){return this.re.pretest.test(e)},d.prototype.testSchemaAt=function(e,r,t){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,t,this):0},d.prototype.match=function(e){var r=0,t=[];0<=this.__index__&&this.__text_cache__===e&&(t.push(f(this,r)),r=this.__last_index__);for(var n=r?e.slice(r):e;this.test(n);)t.push(f(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null},d.prototype.tlds=function(e,r){return e=Array.isArray(e)?e:[e],r?this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,r,t){return e!==t[r-1]}).reverse():(this.__tlds__=e.slice(),this.__tlds_replaced__=!0),a(this),this},d.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},d.prototype.onCompile=function(){},e.exports=d},{"./lib/re":54}],54:[function(n,e,r){"use strict";e.exports=function(e){var r={};r.src_Any=n("uc.micro/properties/Any/regex").source,r.src_Cc=n("uc.micro/categories/Cc/regex").source,r.src_Z=n("uc.micro/categories/Z/regex").source,r.src_P=n("uc.micro/categories/P/regex").source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var t="[><\uff5c]";return r.src_pseudo_letter="(?:(?![><\uff5c]|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|[><\uff5c]|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+t+"|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+r.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-(?!-)|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|[><\uff5c]|\\(|"+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+r.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+r.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}},{"uc.micro/categories/Cc/regex":61,"uc.micro/categories/P/regex":63,"uc.micro/categories/Z/regex":64,"uc.micro/properties/Any/regex":66}],55:[function(e,r,t){"use strict";var s={};function n(e,r){var l;return"string"!=typeof r&&(r=n.defaultChars),l=function(e){var r,t,n=s[e];if(n)return n;for(n=s[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),n.push(t);for(r=0;r<e.length;r++)n[t=e.charCodeAt(r)]="%"+("0"+t.toString(16).toUpperCase()).slice(-2);return n}(r),e.replace(/(%[a-f0-9]{2})+/gi,function(e){var r,t,n,s,o,i,a,c="";for(r=0,t=e.length;r<t;r+=3)(n=parseInt(e.slice(r+1,r+3),16))<128?c+=l[n]:192==(224&n)&&r+3<t&&128==(192&(s=parseInt(e.slice(r+4,r+6),16)))?(c+=(a=n<<6&1984|63&s)<128?"\ufffd\ufffd":String.fromCharCode(a),r+=3):224==(240&n)&&r+6<t&&(s=parseInt(e.slice(r+4,r+6),16),o=parseInt(e.slice(r+7,r+9),16),128==(192&s)&&128==(192&o))?(c+=(a=n<<12&61440|s<<6&4032|63&o)<2048||55296<=a&&a<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(a),r+=6):240==(248&n)&&r+9<t&&(s=parseInt(e.slice(r+4,r+6),16),o=parseInt(e.slice(r+7,r+9),16),i=parseInt(e.slice(r+10,r+12),16),128==(192&s)&&128==(192&o)&&128==(192&i))?((a=n<<18&1835008|s<<12&258048|o<<6&4032|63&i)<65536||1114111<a?c+="\ufffd\ufffd\ufffd\ufffd":(a-=65536,c+=String.fromCharCode(55296+(a>>10),56320+(1023&a))),r+=9):c+="\ufffd";return c})}n.defaultChars=";/?:@&=+$,#",n.componentChars="",r.exports=n},{}],56:[function(e,r,t){"use strict";var l={};function u(e,r,t){var n,s,o,i,a,c="";for("string"!=typeof r&&(t=r,r=u.defaultChars),void 0===t&&(t=!0),a=function(e){var r,t,n=l[e];if(n)return n;for(n=l[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),/^[0-9a-z]$/i.test(t)?n.push(t):n.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2));for(r=0;r<e.length;r++)n[e.charCodeAt(r)]=e[r];return n}(r),n=0,s=e.length;n<s;n++)if(o=e.charCodeAt(n),t&&37===o&&n+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(n+1,n+3)))c+=e.slice(n,n+3),n+=2;else if(o<128)c+=a[o];else if(55296<=o&&o<=57343){if(55296<=o&&o<=56319&&n+1<s&&56320<=(i=e.charCodeAt(n+1))&&i<=57343){c+=encodeURIComponent(e[n]+e[n+1]),n++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[n]);return c}u.defaultChars=";/?:@&=+$,-_.!~*'()#",u.componentChars="-_.!~*'()",r.exports=u},{}],57:[function(e,r,t){"use strict";r.exports=function(e){var r="";return r+=e.protocol||"",r+=e.slashes?"//":"",r+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?r+="["+e.hostname+"]":r+=e.hostname||"",r+=e.port?":"+e.port:"",r+=e.pathname||"",r+=e.search||"",r+=e.hash||""}},{}],58:[function(e,r,t){"use strict";r.exports.encode=e("./encode"),r.exports.decode=e("./decode"),r.exports.format=e("./format"),r.exports.parse=e("./parse")},{"./decode":55,"./encode":56,"./format":57,"./parse":59}],59:[function(e,r,t){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var w=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,D=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),i=["'"].concat(o),E=["%","/","?",";","#"].concat(i),q=["/","?","#"],S=/^[+a-z0-9A-Z_-]{0,63}$/,F=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,L={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};n.prototype.parse=function(e,r){var t,n,s,o,i,a=e;if(a=a.trim(),!r&&1===e.split("#").length){var c=D.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}var l=w.exec(a);if(l&&(s=(l=l[0]).toLowerCase(),this.protocol=l,a=a.substr(l.length)),(r||l||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(i="//"===a.substr(0,2))||l&&L[l]||(a=a.substr(2),this.slashes=!0)),!L[l]&&(i||l&&!z[l])){var u,p,h=-1;for(t=0;t<q.length;t++)-1!==(o=a.indexOf(q[t]))&&(-1===h||o<h)&&(h=o);for(-1!==(p=-1===h?a.lastIndexOf("@"):a.lastIndexOf("@",h))&&(u=a.slice(0,p),a=a.slice(p+1),this.auth=u),h=-1,t=0;t<E.length;t++)-1!==(o=a.indexOf(E[t]))&&(-1===h||o<h)&&(h=o);-1===h&&(h=a.length),":"===a[h-1]&&h--;var f=a.slice(0,h);a=a.slice(h),this.parseHost(f),this.hostname=this.hostname||"";var d="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!d){var m=this.hostname.split(/\./);for(t=0,n=m.length;t<n;t++){var _=m[t];if(_&&!_.match(S)){for(var g="",b=0,k=_.length;b<k;b++)127<_.charCodeAt(b)?g+="x":g+=_[b];if(!g.match(S)){var v=m.slice(0,t),x=m.slice(t+1),y=_.match(F);y&&(v.push(y[1]),x.unshift(y[2])),x.length&&(a=x.join(".")+a),this.hostname=v.join(".");break}}}}255<this.hostname.length&&(this.hostname=""),d&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var C=a.indexOf("#");-1!==C&&(this.hash=a.substr(C),a=a.slice(0,C));var A=a.indexOf("?");return-1!==A&&(this.search=a.substr(A),a=a.slice(0,A)),a&&(this.pathname=a),z[s]&&this.hostname&&!this.pathname&&(this.pathname=""),this},n.prototype.parseHost=function(e){var r=s.exec(e);r&&(":"!==(r=r[0])&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)},r.exports=function(e,r){if(e&&e instanceof n)return e;var t=new n;return t.parse(e,r),t}},{}],60:[function(e,z,T){(function(L){!function(e){var r="object"==typeof T&&T&&!T.nodeType&&T,t="object"==typeof z&&z&&!z.nodeType&&z,n="object"==typeof L&&L;n.global!==n&&n.window!==n&&n.self!==n||(e=n);var s,o,g=2147483647,b=36,k=1,v=26,i=38,a=700,x=72,y=128,C="-",c=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-k,A=Math.floor,w=String.fromCharCode;function D(e){throw new RangeError(p[e])}function f(e,r){for(var t=e.length,n=[];t--;)n[t]=r(e[t]);return n}function d(e,r){var t=e.split("@"),n="";return 1<t.length&&(n=t[0]+"@",e=t[1]),n+f((e=e.replace(u,".")).split("."),r).join(".")}function E(e){for(var r,t,n=[],s=0,o=e.length;s<o;)55296<=(r=e.charCodeAt(s++))&&r<=56319&&s<o?56320==(64512&(t=e.charCodeAt(s++)))?n.push(((1023&r)<<10)+(1023&t)+65536):(n.push(r),s--):n.push(r);return n}function q(e){return f(e,function(e){var r="";return 65535<e&&(r+=w((e-=65536)>>>10&1023|55296),e=56320|1023&e),r+=w(e)}).join("")}function S(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function F(e,r,t){var n=0;for(e=t?A(e/a):e>>1,e+=A(e/r);h*v>>1<e;n+=b)e=A(e/h);return A(n+(h+1)*e/(e+i))}function m(e){var r,t,n,s,o,i,a,c,l,u,p,h=[],f=e.length,d=0,m=y,_=x;for((t=e.lastIndexOf(C))<0&&(t=0),n=0;n<t;++n)128<=e.charCodeAt(n)&&D("not-basic"),h.push(e.charCodeAt(n));for(s=0<t?t+1:0;s<f;){for(o=d,i=1,a=b;f<=s&&D("invalid-input"),p=e.charCodeAt(s++),(b<=(c=p-48<10?p-22:p-65<26?p-65:p-97<26?p-97:b)||c>A((g-d)/i))&&D("overflow"),d+=c*i,!(c<(l=a<=_?k:_+v<=a?v:a-_));a+=b)i>A(g/(u=b-l))&&D("overflow"),i*=u;_=F(d-o,r=h.length+1,0==o),A(d/r)>g-m&&D("overflow"),m+=A(d/r),d%=r,h.splice(d++,0,m)}return q(h)}function _(e){var r,t,n,s,o,i,a,c,l,u,p,h,f,d,m,_=[];for(h=(e=E(e)).length,r=y,o=x,i=t=0;i<h;++i)(p=e[i])<128&&_.push(w(p));for(n=s=_.length,s&&_.push(C);n<h;){for(a=g,i=0;i<h;++i)r<=(p=e[i])&&p<a&&(a=p);for(a-r>A((g-t)/(f=n+1))&&D("overflow"),t+=(a-r)*f,r=a,i=0;i<h;++i)if((p=e[i])<r&&++t>g&&D("overflow"),p==r){for(c=t,l=b;!(c<(u=l<=o?k:o+v<=l?v:l-o));l+=b)m=c-u,d=b-u,_.push(w(S(u+m%d,0))),c=A(m/d);_.push(w(S(c,0))),o=F(t,f,n==s),t=0,++n}++t,++r}return _.join("")}if(s={version:"1.4.1",ucs2:{decode:E,encode:q},decode:m,encode:_,toASCII:function(e){return d(e,function(e){return l.test(e)?"xn--"+_(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},r&&t)if(z.exports==r)t.exports=s;else for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);else e.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],61:[function(e,r,t){r.exports=/[\0-\x1F\x7F-\x9F]/},{}],62:[function(e,r,t){r.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},{}],63:[function(e,r,t){r.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E49\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},{}],64:[function(e,r,t){r.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/},{}],65:[function(e,r,t){"use strict";t.Any=e("./properties/Any/regex"),t.Cc=e("./categories/Cc/regex"),t.Cf=e("./categories/Cf/regex"),t.P=e("./categories/P/regex"),t.Z=e("./categories/Z/regex")},{"./categories/Cc/regex":61,"./categories/Cf/regex":62,"./categories/P/regex":63,"./categories/Z/regex":64,"./properties/Any/regex":66}],66:[function(e,r,t){r.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},{}],67:[function(e,r,t){"use strict";r.exports=e("./lib/")},{"./lib/":9}]},{},[67])(67)});!function(a){{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.markdownitEmoji=a()}}(function(){return function a(e,n,o){function i(_,t){if(!n[_]){if(!e[_]){var s="function"==typeof require&&require;if(!t&&s)return s(_,!0);if(r)return r(_,!0);var l=new Error("Cannot find module '"+_+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[_]={exports:{}};e[_][0].call(c.exports,function(a){var n=e[_][1][a];return i(n?n:a)},c,c.exports,a,e,n,o)}return n[_].exports}for(var r="function"==typeof require&&require,_=0;_<o.length;_++)i(o[_]);return i}({1:[function(a,e,n){e.exports={100:"\ud83d\udcaf",1234:"\ud83d\udd22",grinning:"\ud83d\ude00",smiley:"\ud83d\ude03",smile:"\ud83d\ude04",grin:"\ud83d\ude01",laughing:"\ud83d\ude06",satisfied:"\ud83d\ude06",sweat_smile:"\ud83d\ude05",joy:"\ud83d\ude02",rofl:"\ud83e\udd23",relaxed:"\u263a\ufe0f",blush:"\ud83d\ude0a",innocent:"\ud83d\ude07",slightly_smiling_face:"\ud83d\ude42",upside_down_face:"\ud83d\ude43",wink:"\ud83d\ude09",relieved:"\ud83d\ude0c",heart_eyes:"\ud83d\ude0d",kissing_heart:"\ud83d\ude18",kissing:"\ud83d\ude17",kissing_smiling_eyes:"\ud83d\ude19",kissing_closed_eyes:"\ud83d\ude1a",yum:"\ud83d\ude0b",stuck_out_tongue_winking_eye:"\ud83d\ude1c",stuck_out_tongue_closed_eyes:"\ud83d\ude1d",stuck_out_tongue:"\ud83d\ude1b",money_mouth_face:"\ud83e\udd11",hugs:"\ud83e\udd17",nerd_face:"\ud83e\udd13",sunglasses:"\ud83d\ude0e",clown_face:"\ud83e\udd21",cowboy_hat_face:"\ud83e\udd20",smirk:"\ud83d\ude0f",unamused:"\ud83d\ude12",disappointed:"\ud83d\ude1e",pensive:"\ud83d\ude14",worried:"\ud83d\ude1f",confused:"\ud83d\ude15",slightly_frowning_face:"\ud83d\ude41",frowning_face:"\u2639\ufe0f",persevere:"\ud83d\ude23",confounded:"\ud83d\ude16",tired_face:"\ud83d\ude2b",weary:"\ud83d\ude29",triumph:"\ud83d\ude24",angry:"\ud83d\ude20",rage:"\ud83d\ude21",pout:"\ud83d\ude21",no_mouth:"\ud83d\ude36",neutral_face:"\ud83d\ude10",expressionless:"\ud83d\ude11",hushed:"\ud83d\ude2f",frowning:"\ud83d\ude26",anguished:"\ud83d\ude27",open_mouth:"\ud83d\ude2e",astonished:"\ud83d\ude32",dizzy_face:"\ud83d\ude35",flushed:"\ud83d\ude33",scream:"\ud83d\ude31",fearful:"\ud83d\ude28",cold_sweat:"\ud83d\ude30",cry:"\ud83d\ude22",disappointed_relieved:"\ud83d\ude25",drooling_face:"\ud83e\udd24",sob:"\ud83d\ude2d",sweat:"\ud83d\ude13",sleepy:"\ud83d\ude2a",sleeping:"\ud83d\ude34",roll_eyes:"\ud83d\ude44",thinking:"\ud83e\udd14",lying_face:"\ud83e\udd25",grimacing:"\ud83d\ude2c",zipper_mouth_face:"\ud83e\udd10",nauseated_face:"\ud83e\udd22",sneezing_face:"\ud83e\udd27",mask:"\ud83d\ude37",face_with_thermometer:"\ud83e\udd12",face_with_head_bandage:"\ud83e\udd15",smiling_imp:"\ud83d\ude08",imp:"\ud83d\udc7f",japanese_ogre:"\ud83d\udc79",japanese_goblin:"\ud83d\udc7a",hankey:"\ud83d\udca9",poop:"\ud83d\udca9",shit:"\ud83d\udca9",ghost:"\ud83d\udc7b",skull:"\ud83d\udc80",skull_and_crossbones:"\u2620\ufe0f",alien:"\ud83d\udc7d",space_invader:"\ud83d\udc7e",robot:"\ud83e\udd16",jack_o_lantern:"\ud83c\udf83",smiley_cat:"\ud83d\ude3a",smile_cat:"\ud83d\ude38",joy_cat:"\ud83d\ude39",heart_eyes_cat:"\ud83d\ude3b",smirk_cat:"\ud83d\ude3c",kissing_cat:"\ud83d\ude3d",scream_cat:"\ud83d\ude40",crying_cat_face:"\ud83d\ude3f",pouting_cat:"\ud83d\ude3e",open_hands:"\ud83d\udc50",raised_hands:"\ud83d\ude4c",clap:"\ud83d\udc4f",pray:"\ud83d\ude4f",handshake:"\ud83e\udd1d","+1":"\ud83d\udc4d",thumbsup:"\ud83d\udc4d","-1":"\ud83d\udc4e",thumbsdown:"\ud83d\udc4e",fist_oncoming:"\ud83d\udc4a",facepunch:"\ud83d\udc4a",punch:"\ud83d\udc4a",fist_raised:"\u270a",fist:"\u270a",fist_left:"\ud83e\udd1b",fist_right:"\ud83e\udd1c",crossed_fingers:"\ud83e\udd1e",v:"\u270c\ufe0f",metal:"\ud83e\udd18",ok_hand:"\ud83d\udc4c",point_left:"\ud83d\udc48",point_right:"\ud83d\udc49",point_up_2:"\ud83d\udc46",point_down:"\ud83d\udc47",point_up:"\u261d\ufe0f",hand:"\u270b",raised_hand:"\u270b",raised_back_of_hand:"\ud83e\udd1a",raised_hand_with_fingers_splayed:"\ud83d\udd90",vulcan_salute:"\ud83d\udd96",wave:"\ud83d\udc4b",call_me_hand:"\ud83e\udd19",muscle:"\ud83d\udcaa",middle_finger:"\ud83d\udd95",fu:"\ud83d\udd95",writing_hand:"\u270d\ufe0f",selfie:"\ud83e\udd33",nail_care:"\ud83d\udc85",ring:"\ud83d\udc8d",lipstick:"\ud83d\udc84",kiss:"\ud83d\udc8b",lips:"\ud83d\udc44",tongue:"\ud83d\udc45",ear:"\ud83d\udc42",nose:"\ud83d\udc43",footprints:"\ud83d\udc63",eye:"\ud83d\udc41",eyes:"\ud83d\udc40",speaking_head:"\ud83d\udde3",bust_in_silhouette:"\ud83d\udc64",busts_in_silhouette:"\ud83d\udc65",baby:"\ud83d\udc76",boy:"\ud83d\udc66",girl:"\ud83d\udc67",man:"\ud83d\udc68",woman:"\ud83d\udc69",blonde_woman:"\ud83d\udc71\u200d\u2640",blonde_man:"\ud83d\udc71",person_with_blond_hair:"\ud83d\udc71",older_man:"\ud83d\udc74",older_woman:"\ud83d\udc75",man_with_gua_pi_mao:"\ud83d\udc72",woman_with_turban:"\ud83d\udc73\u200d\u2640",man_with_turban:"\ud83d\udc73",policewoman:"\ud83d\udc6e\u200d\u2640",policeman:"\ud83d\udc6e",cop:"\ud83d\udc6e",construction_worker_woman:"\ud83d\udc77\u200d\u2640",construction_worker_man:"\ud83d\udc77",construction_worker:"\ud83d\udc77",guardswoman:"\ud83d\udc82\u200d\u2640",guardsman:"\ud83d\udc82",female_detective:"\ud83d\udd75\ufe0f\u200d\u2640\ufe0f",male_detective:"\ud83d\udd75",detective:"\ud83d\udd75",woman_health_worker:"\ud83d\udc69\u200d\u2695",man_health_worker:"\ud83d\udc68\u200d\u2695",woman_farmer:"\ud83d\udc69\u200d\ud83c\udf3e",man_farmer:"\ud83d\udc68\u200d\ud83c\udf3e",woman_cook:"\ud83d\udc69\u200d\ud83c\udf73",man_cook:"\ud83d\udc68\u200d\ud83c\udf73",woman_student:"\ud83d\udc69\u200d\ud83c\udf93",man_student:"\ud83d\udc68\u200d\ud83c\udf93",woman_singer:"\ud83d\udc69\u200d\ud83c\udfa4",man_singer:"\ud83d\udc68\u200d\ud83c\udfa4",woman_teacher:"\ud83d\udc69\u200d\ud83c\udfeb",man_teacher:"\ud83d\udc68\u200d\ud83c\udfeb",woman_factory_worker:"\ud83d\udc69\u200d\ud83c\udfed",man_factory_worker:"\ud83d\udc68\u200d\ud83c\udfed",woman_technologist:"\ud83d\udc69\u200d\ud83d\udcbb",man_technologist:"\ud83d\udc68\u200d\ud83d\udcbb",woman_office_worker:"\ud83d\udc69\u200d\ud83d\udcbc",man_office_worker:"\ud83d\udc68\u200d\ud83d\udcbc",woman_mechanic:"\ud83d\udc69\u200d\ud83d\udd27",man_mechanic:"\ud83d\udc68\u200d\ud83d\udd27",woman_scientist:"\ud83d\udc69\u200d\ud83d\udd2c",man_scientist:"\ud83d\udc68\u200d\ud83d\udd2c",woman_artist:"\ud83d\udc69\u200d\ud83c\udfa8",man_artist:"\ud83d\udc68\u200d\ud83c\udfa8",woman_firefighter:"\ud83d\udc69\u200d\ud83d\ude92",man_firefighter:"\ud83d\udc68\u200d\ud83d\ude92",woman_pilot:"\ud83d\udc69\u200d\u2708",man_pilot:"\ud83d\udc68\u200d\u2708",woman_astronaut:"\ud83d\udc69\u200d\ud83d\ude80",man_astronaut:"\ud83d\udc68\u200d\ud83d\ude80",woman_judge:"\ud83d\udc69\u200d\u2696",man_judge:"\ud83d\udc68\u200d\u2696",mrs_claus:"\ud83e\udd36",santa:"\ud83c\udf85",princess:"\ud83d\udc78",prince:"\ud83e\udd34",bride_with_veil:"\ud83d\udc70",man_in_tuxedo:"\ud83e\udd35",angel:"\ud83d\udc7c",pregnant_woman:"\ud83e\udd30",bowing_woman:"\ud83d\ude47\u200d\u2640",bowing_man:"\ud83d\ude47",bow:"\ud83d\ude47",tipping_hand_woman:"\ud83d\udc81",information_desk_person:"\ud83d\udc81",sassy_woman:"\ud83d\udc81",tipping_hand_man:"\ud83d\udc81\u200d\u2642",sassy_man:"\ud83d\udc81\u200d\u2642",no_good_woman:"\ud83d\ude45",no_good:"\ud83d\ude45",ng_woman:"\ud83d\ude45",no_good_man:"\ud83d\ude45\u200d\u2642",ng_man:"\ud83d\ude45\u200d\u2642",ok_woman:"\ud83d\ude46",ok_man:"\ud83d\ude46\u200d\u2642",raising_hand_woman:"\ud83d\ude4b",raising_hand:"\ud83d\ude4b",raising_hand_man:"\ud83d\ude4b\u200d\u2642",woman_facepalming:"\ud83e\udd26\u200d\u2640",man_facepalming:"\ud83e\udd26\u200d\u2642",woman_shrugging:"\ud83e\udd37\u200d\u2640",man_shrugging:"\ud83e\udd37\u200d\u2642",pouting_woman:"\ud83d\ude4e",person_with_pouting_face:"\ud83d\ude4e",pouting_man:"\ud83d\ude4e\u200d\u2642",frowning_woman:"\ud83d\ude4d",person_frowning:"\ud83d\ude4d",frowning_man:"\ud83d\ude4d\u200d\u2642",haircut_woman:"\ud83d\udc87",haircut:"\ud83d\udc87",haircut_man:"\ud83d\udc87\u200d\u2642",massage_woman:"\ud83d\udc86",massage:"\ud83d\udc86",massage_man:"\ud83d\udc86\u200d\u2642",business_suit_levitating:"\ud83d\udd74",dancer:"\ud83d\udc83",man_dancing:"\ud83d\udd7a",dancing_women:"\ud83d\udc6f",dancers:"\ud83d\udc6f",dancing_men:"\ud83d\udc6f\u200d\u2642",walking_woman:"\ud83d\udeb6\u200d\u2640",walking_man:"\ud83d\udeb6",walking:"\ud83d\udeb6",running_woman:"\ud83c\udfc3\u200d\u2640",running_man:"\ud83c\udfc3",runner:"\ud83c\udfc3",running:"\ud83c\udfc3",couple:"\ud83d\udc6b",two_women_holding_hands:"\ud83d\udc6d",two_men_holding_hands:"\ud83d\udc6c",couple_with_heart_woman_man:"\ud83d\udc91",couple_with_heart:"\ud83d\udc91",couple_with_heart_woman_woman:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69",couple_with_heart_man_man:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68",couplekiss_man_woman:"\ud83d\udc8f",couplekiss_woman_woman:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69",couplekiss_man_man:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68",family_man_woman_boy:"\ud83d\udc6a",family:"\ud83d\udc6a",family_man_woman_girl:"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67",family_man_woman_girl_boy:"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66",family_man_woman_boy_boy:"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66",family_man_woman_girl_girl:"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67",family_woman_woman_boy:"\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66",family_woman_woman_girl:"\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67",family_woman_woman_girl_boy:"\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66",family_woman_woman_boy_boy:"\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66",family_woman_woman_girl_girl:"\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67",family_man_man_boy:"\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66",family_man_man_girl:"\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67",family_man_man_girl_boy:"\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66",family_man_man_boy_boy:"\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66",family_man_man_girl_girl:"\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67",family_woman_boy:"\ud83d\udc69\u200d\ud83d\udc66",family_woman_girl:"\ud83d\udc69\u200d\ud83d\udc67",family_woman_girl_boy:"\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66",family_woman_boy_boy:"\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66",family_woman_girl_girl:"\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67",family_man_boy:"\ud83d\udc68\u200d\ud83d\udc66",family_man_girl:"\ud83d\udc68\u200d\ud83d\udc67",family_man_girl_boy:"\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66",family_man_boy_boy:"\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66",family_man_girl_girl:"\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67",womans_clothes:"\ud83d\udc5a",shirt:"\ud83d\udc55",tshirt:"\ud83d\udc55",jeans:"\ud83d\udc56",necktie:"\ud83d\udc54",dress:"\ud83d\udc57",bikini:"\ud83d\udc59",kimono:"\ud83d\udc58",high_heel:"\ud83d\udc60",sandal:"\ud83d\udc61",boot:"\ud83d\udc62",mans_shoe:"\ud83d\udc5e",shoe:"\ud83d\udc5e",athletic_shoe:"\ud83d\udc5f",womans_hat:"\ud83d\udc52",tophat:"\ud83c\udfa9",mortar_board:"\ud83c\udf93",crown:"\ud83d\udc51",rescue_worker_helmet:"\u26d1",school_satchel:"\ud83c\udf92",pouch:"\ud83d\udc5d",purse:"\ud83d\udc5b",handbag:"\ud83d\udc5c",briefcase:"\ud83d\udcbc",eyeglasses:"\ud83d\udc53",dark_sunglasses:"\ud83d\udd76",closed_umbrella:"\ud83c\udf02",open_umbrella:"\u2602\ufe0f",dog:"\ud83d\udc36",cat:"\ud83d\udc31",mouse:"\ud83d\udc2d",hamster:"\ud83d\udc39",rabbit:"\ud83d\udc30",fox_face:"\ud83e\udd8a",bear:"\ud83d\udc3b",panda_face:"\ud83d\udc3c",koala:"\ud83d\udc28",tiger:"\ud83d\udc2f",lion:"\ud83e\udd81",cow:"\ud83d\udc2e",pig:"\ud83d\udc37",pig_nose:"\ud83d\udc3d",frog:"\ud83d\udc38",monkey_face:"\ud83d\udc35",see_no_evil:"\ud83d\ude48",hear_no_evil:"\ud83d\ude49",speak_no_evil:"\ud83d\ude4a",monkey:"\ud83d\udc12",chicken:"\ud83d\udc14",penguin:"\ud83d\udc27",bird:"\ud83d\udc26",baby_chick:"\ud83d\udc24",hatching_chick:"\ud83d\udc23",hatched_chick:"\ud83d\udc25",duck:"\ud83e\udd86",eagle:"\ud83e\udd85",owl:"\ud83e\udd89",bat:"\ud83e\udd87",wolf:"\ud83d\udc3a",boar:"\ud83d\udc17",horse:"\ud83d\udc34",unicorn:"\ud83e\udd84",bee:"\ud83d\udc1d",honeybee:"\ud83d\udc1d",bug:"\ud83d\udc1b",butterfly:"\ud83e\udd8b",snail:"\ud83d\udc0c",shell:"\ud83d\udc1a",beetle:"\ud83d\udc1e",ant:"\ud83d\udc1c",spider:"\ud83d\udd77",spider_web:"\ud83d\udd78",turtle:"\ud83d\udc22",snake:"\ud83d\udc0d",lizard:"\ud83e\udd8e",scorpion:"\ud83e\udd82",crab:"\ud83e\udd80",squid:"\ud83e\udd91",octopus:"\ud83d\udc19",shrimp:"\ud83e\udd90",tropical_fish:"\ud83d\udc20",fish:"\ud83d\udc1f",blowfish:"\ud83d\udc21",dolphin:"\ud83d\udc2c",flipper:"\ud83d\udc2c",shark:"\ud83e\udd88",whale:"\ud83d\udc33",whale2:"\ud83d\udc0b",crocodile:"\ud83d\udc0a",leopard:"\ud83d\udc06",tiger2:"\ud83d\udc05",water_buffalo:"\ud83d\udc03",ox:"\ud83d\udc02",cow2:"\ud83d\udc04",deer:"\ud83e\udd8c",dromedary_camel:"\ud83d\udc2a",camel:"\ud83d\udc2b",elephant:"\ud83d\udc18",rhinoceros:"\ud83e\udd8f",gorilla:"\ud83e\udd8d",racehorse:"\ud83d\udc0e",pig2:"\ud83d\udc16",goat:"\ud83d\udc10",ram:"\ud83d\udc0f",sheep:"\ud83d\udc11",dog2:"\ud83d\udc15",poodle:"\ud83d\udc29",cat2:"\ud83d\udc08",rooster:"\ud83d\udc13",turkey:"\ud83e\udd83",dove:"\ud83d\udd4a",rabbit2:"\ud83d\udc07",mouse2:"\ud83d\udc01",rat:"\ud83d\udc00",chipmunk:"\ud83d\udc3f",feet:"\ud83d\udc3e",paw_prints:"\ud83d\udc3e",dragon:"\ud83d\udc09",dragon_face:"\ud83d\udc32",cactus:"\ud83c\udf35",christmas_tree:"\ud83c\udf84",evergreen_tree:"\ud83c\udf32",deciduous_tree:"\ud83c\udf33",palm_tree:"\ud83c\udf34",seedling:"\ud83c\udf31",herb:"\ud83c\udf3f",shamrock:"\u2618\ufe0f",four_leaf_clover:"\ud83c\udf40",bamboo:"\ud83c\udf8d",tanabata_tree:"\ud83c\udf8b",leaves:"\ud83c\udf43",fallen_leaf:"\ud83c\udf42",maple_leaf:"\ud83c\udf41",mushroom:"\ud83c\udf44",ear_of_rice:"\ud83c\udf3e",bouquet:"\ud83d\udc90",tulip:"\ud83c\udf37",rose:"\ud83c\udf39",wilted_flower:"\ud83e\udd40",sunflower:"\ud83c\udf3b",blossom:"\ud83c\udf3c",cherry_blossom:"\ud83c\udf38",hibiscus:"\ud83c\udf3a",earth_americas:"\ud83c\udf0e",earth_africa:"\ud83c\udf0d",earth_asia:"\ud83c\udf0f",full_moon:"\ud83c\udf15",waning_gibbous_moon:"\ud83c\udf16",last_quarter_moon:"\ud83c\udf17",waning_crescent_moon:"\ud83c\udf18",new_moon:"\ud83c\udf11",waxing_crescent_moon:"\ud83c\udf12",first_quarter_moon:"\ud83c\udf13",moon:"\ud83c\udf14",waxing_gibbous_moon:"\ud83c\udf14",new_moon_with_face:"\ud83c\udf1a",full_moon_with_face:"\ud83c\udf1d",sun_with_face:"\ud83c\udf1e",first_quarter_moon_with_face:"\ud83c\udf1b",last_quarter_moon_with_face:"\ud83c\udf1c",crescent_moon:"\ud83c\udf19",dizzy:"\ud83d\udcab",star:"\u2b50\ufe0f",star2:"\ud83c\udf1f",sparkles:"\u2728",zap:"\u26a1\ufe0f",fire:"\ud83d\udd25",boom:"\ud83d\udca5",collision:"\ud83d\udca5",comet:"\u2604",sunny:"\u2600\ufe0f",sun_behind_small_cloud:"\ud83c\udf24",partly_sunny:"\u26c5\ufe0f",sun_behind_large_cloud:"\ud83c\udf25",sun_behind_rain_cloud:"\ud83c\udf26",rainbow:"\ud83c\udf08",cloud:"\u2601\ufe0f",cloud_with_rain:"\ud83c\udf27",cloud_with_lightning_and_rain:"\u26c8",cloud_with_lightning:"\ud83c\udf29",cloud_with_snow:"\ud83c\udf28",snowman_with_snow:"\u2603\ufe0f",snowman:"\u26c4\ufe0f",snowflake:"\u2744\ufe0f",wind_face:"\ud83c\udf2c",dash:"\ud83d\udca8",tornado:"\ud83c\udf2a",fog:"\ud83c\udf2b",ocean:"\ud83c\udf0a",droplet:"\ud83d\udca7",sweat_drops:"\ud83d\udca6",umbrella:"\u2614\ufe0f",green_apple:"\ud83c\udf4f",apple:"\ud83c\udf4e",pear:"\ud83c\udf50",tangerine:"\ud83c\udf4a",orange:"\ud83c\udf4a",mandarin:"\ud83c\udf4a",lemon:"\ud83c\udf4b",banana:"\ud83c\udf4c",watermelon:"\ud83c\udf49",grapes:"\ud83c\udf47",strawberry:"\ud83c\udf53",melon:"\ud83c\udf48",cherries:"\ud83c\udf52",peach:"\ud83c\udf51",pineapple:"\ud83c\udf4d",kiwi_fruit:"\ud83e\udd5d",avocado:"\ud83e\udd51",tomato:"\ud83c\udf45",eggplant:"\ud83c\udf46",cucumber:"\ud83e\udd52",carrot:"\ud83e\udd55",corn:"\ud83c\udf3d",hot_pepper:"\ud83c\udf36",potato:"\ud83e\udd54",sweet_potato:"\ud83c\udf60",chestnut:"\ud83c\udf30",peanuts:"\ud83e\udd5c",honey_pot:"\ud83c\udf6f",croissant:"\ud83e\udd50",bread:"\ud83c\udf5e",baguette_bread:"\ud83e\udd56",cheese:"\ud83e\uddc0",egg:"\ud83e\udd5a",fried_egg:"\ud83c\udf73",bacon:"\ud83e\udd53",pancakes:"\ud83e\udd5e",fried_shrimp:"\ud83c\udf64",poultry_leg:"\ud83c\udf57",meat_on_bone:"\ud83c\udf56",pizza:"\ud83c\udf55",hotdog:"\ud83c\udf2d",hamburger:"\ud83c\udf54",fries:"\ud83c\udf5f",stuffed_flatbread:"\ud83e\udd59",taco:"\ud83c\udf2e",burrito:"\ud83c\udf2f",green_salad:"\ud83e\udd57",shallow_pan_of_food:"\ud83e\udd58",spaghetti:"\ud83c\udf5d",ramen:"\ud83c\udf5c",stew:"\ud83c\udf72",fish_cake:"\ud83c\udf65",sushi:"\ud83c\udf63",bento:"\ud83c\udf71",curry:"\ud83c\udf5b",rice:"\ud83c\udf5a",rice_ball:"\ud83c\udf59",rice_cracker:"\ud83c\udf58",oden:"\ud83c\udf62",dango:"\ud83c\udf61",shaved_ice:"\ud83c\udf67",ice_cream:"\ud83c\udf68",icecream:"\ud83c\udf66",cake:"\ud83c\udf70",birthday:"\ud83c\udf82",custard:"\ud83c\udf6e",lollipop:"\ud83c\udf6d",candy:"\ud83c\udf6c",chocolate_bar:"\ud83c\udf6b",popcorn:"\ud83c\udf7f",doughnut:"\ud83c\udf69",cookie:"\ud83c\udf6a",milk_glass:"\ud83e\udd5b",baby_bottle:"\ud83c\udf7c",coffee:"\u2615\ufe0f",tea:"\ud83c\udf75",sake:"\ud83c\udf76",beer:"\ud83c\udf7a",beers:"\ud83c\udf7b",clinking_glasses:"\ud83e\udd42",wine_glass:"\ud83c\udf77",tumbler_glass:"\ud83e\udd43",cocktail:"\ud83c\udf78",tropical_drink:"\ud83c\udf79",champagne:"\ud83c\udf7e",spoon:"\ud83e\udd44",fork_and_knife:"\ud83c\udf74",plate_with_cutlery:"\ud83c\udf7d",soccer:"\u26bd\ufe0f",basketball:"\ud83c\udfc0",football:"\ud83c\udfc8",baseball:"\u26be\ufe0f",tennis:"\ud83c\udfbe",volleyball:"\ud83c\udfd0",rugby_football:"\ud83c\udfc9","8ball":"\ud83c\udfb1",ping_pong:"\ud83c\udfd3",badminton:"\ud83c\udff8",goal_net:"\ud83e\udd45",ice_hockey:"\ud83c\udfd2",field_hockey:"\ud83c\udfd1",cricket:"\ud83c\udfcf",golf:"\u26f3\ufe0f",bow_and_arrow:"\ud83c\udff9",fishing_pole_and_fish:"\ud83c\udfa3",boxing_glove:"\ud83e\udd4a",martial_arts_uniform:"\ud83e\udd4b",ice_skate:"\u26f8",ski:"\ud83c\udfbf",skier:"\u26f7",snowboarder:"\ud83c\udfc2",weight_lifting_woman:"\ud83c\udfcb\ufe0f\u200d\u2640\ufe0f",weight_lifting_man:"\ud83c\udfcb",person_fencing:"\ud83e\udd3a",women_wrestling:"\ud83e\udd3c\u200d\u2640",men_wrestling:"\ud83e\udd3c\u200d\u2642",woman_cartwheeling:"\ud83e\udd38\u200d\u2640",man_cartwheeling:"\ud83e\udd38\u200d\u2642",basketball_woman:"\u26f9\ufe0f\u200d\u2640\ufe0f",basketball_man:"\u26f9",woman_playing_handball:"\ud83e\udd3e\u200d\u2640",man_playing_handball:"\ud83e\udd3e\u200d\u2642",golfing_woman:"\ud83c\udfcc\ufe0f\u200d\u2640\ufe0f",golfing_man:"\ud83c\udfcc",surfing_woman:"\ud83c\udfc4\u200d\u2640",surfing_man:"\ud83c\udfc4",surfer:"\ud83c\udfc4",swimming_woman:"\ud83c\udfca\u200d\u2640",swimming_man:"\ud83c\udfca",swimmer:"\ud83c\udfca",woman_playing_water_polo:"\ud83e\udd3d\u200d\u2640",man_playing_water_polo:"\ud83e\udd3d\u200d\u2642",rowing_woman:"\ud83d\udea3\u200d\u2640",rowing_man:"\ud83d\udea3",rowboat:"\ud83d\udea3",horse_racing:"\ud83c\udfc7",biking_woman:"\ud83d\udeb4\u200d\u2640",biking_man:"\ud83d\udeb4",bicyclist:"\ud83d\udeb4",mountain_biking_woman:"\ud83d\udeb5\u200d\u2640",mountain_biking_man:"\ud83d\udeb5",mountain_bicyclist:"\ud83d\udeb5",running_shirt_with_sash:"\ud83c\udfbd",medal_sports:"\ud83c\udfc5",medal_military:"\ud83c\udf96","1st_place_medal":"\ud83e\udd47","2nd_place_medal":"\ud83e\udd48","3rd_place_medal":"\ud83e\udd49",trophy:"\ud83c\udfc6",rosette:"\ud83c\udff5",reminder_ribbon:"\ud83c\udf97",ticket:"\ud83c\udfab",tickets:"\ud83c\udf9f",circus_tent:"\ud83c\udfaa",woman_juggling:"\ud83e\udd39\u200d\u2640",man_juggling:"\ud83e\udd39\u200d\u2642",performing_arts:"\ud83c\udfad",art:"\ud83c\udfa8",clapper:"\ud83c\udfac",microphone:"\ud83c\udfa4",headphones:"\ud83c\udfa7",musical_score:"\ud83c\udfbc",musical_keyboard:"\ud83c\udfb9",drum:"\ud83e\udd41",saxophone:"\ud83c\udfb7",trumpet:"\ud83c\udfba",guitar:"\ud83c\udfb8",violin:"\ud83c\udfbb",game_die:"\ud83c\udfb2",dart:"\ud83c\udfaf",bowling:"\ud83c\udfb3",video_game:"\ud83c\udfae",slot_machine:"\ud83c\udfb0",car:"\ud83d\ude97",red_car:"\ud83d\ude97",taxi:"\ud83d\ude95",blue_car:"\ud83d\ude99",bus:"\ud83d\ude8c",trolleybus:"\ud83d\ude8e",racing_car:"\ud83c\udfce",police_car:"\ud83d\ude93",ambulance:"\ud83d\ude91",fire_engine:"\ud83d\ude92",minibus:"\ud83d\ude90",truck:"\ud83d\ude9a",articulated_lorry:"\ud83d\ude9b",tractor:"\ud83d\ude9c",kick_scooter:"\ud83d\udef4",bike:"\ud83d\udeb2",motor_scooter:"\ud83d\udef5",motorcycle:"\ud83c\udfcd",rotating_light:"\ud83d\udea8",oncoming_police_car:"\ud83d\ude94",oncoming_bus:"\ud83d\ude8d",oncoming_automobile:"\ud83d\ude98",oncoming_taxi:"\ud83d\ude96",aerial_tramway:"\ud83d\udea1",mountain_cableway:"\ud83d\udea0",suspension_railway:"\ud83d\ude9f",railway_car:"\ud83d\ude83",train:"\ud83d\ude8b",mountain_railway:"\ud83d\ude9e",monorail:"\ud83d\ude9d",bullettrain_side:"\ud83d\ude84",bullettrain_front:"\ud83d\ude85",light_rail:"\ud83d\ude88",steam_locomotive:"\ud83d\ude82",train2:"\ud83d\ude86",metro:"\ud83d\ude87",tram:"\ud83d\ude8a",station:"\ud83d\ude89",helicopter:"\ud83d\ude81",small_airplane:"\ud83d\udee9",airplane:"\u2708\ufe0f",flight_departure:"\ud83d\udeeb",flight_arrival:"\ud83d\udeec",rocket:"\ud83d\ude80",artificial_satellite:"\ud83d\udef0",seat:"\ud83d\udcba",canoe:"\ud83d\udef6",boat:"\u26f5\ufe0f",sailboat:"\u26f5\ufe0f",motor_boat:"\ud83d\udee5",speedboat:"\ud83d\udea4",passenger_ship:"\ud83d\udef3",ferry:"\u26f4",ship:"\ud83d\udea2",anchor:"\u2693\ufe0f",construction:"\ud83d\udea7",fuelpump:"\u26fd\ufe0f",busstop:"\ud83d\ude8f",vertical_traffic_light:"\ud83d\udea6",traffic_light:"\ud83d\udea5",world_map:"\ud83d\uddfa",moyai:"\ud83d\uddff",statue_of_liberty:"\ud83d\uddfd",fountain:"\u26f2\ufe0f",tokyo_tower:"\ud83d\uddfc",european_castle:"\ud83c\udff0",japanese_castle:"\ud83c\udfef",stadium:"\ud83c\udfdf",ferris_wheel:"\ud83c\udfa1",roller_coaster:"\ud83c\udfa2",carousel_horse:"\ud83c\udfa0",parasol_on_ground:"\u26f1",beach_umbrella:"\ud83c\udfd6",desert_island:"\ud83c\udfdd",mountain:"\u26f0",mountain_snow:"\ud83c\udfd4",mount_fuji:"\ud83d\uddfb",volcano:"\ud83c\udf0b",desert:"\ud83c\udfdc",camping:"\ud83c\udfd5",tent:"\u26fa\ufe0f",railway_track:"\ud83d\udee4",motorway:"\ud83d\udee3",building_construction:"\ud83c\udfd7",factory:"\ud83c\udfed",house:"\ud83c\udfe0",house_with_garden:"\ud83c\udfe1",houses:"\ud83c\udfd8",derelict_house:"\ud83c\udfda",office:"\ud83c\udfe2",department_store:"\ud83c\udfec",post_office:"\ud83c\udfe3",european_post_office:"\ud83c\udfe4",hospital:"\ud83c\udfe5",bank:"\ud83c\udfe6",hotel:"\ud83c\udfe8",convenience_store:"\ud83c\udfea",school:"\ud83c\udfeb",love_hotel:"\ud83c\udfe9",wedding:"\ud83d\udc92",classical_building:"\ud83c\udfdb",church:"\u26ea\ufe0f",mosque:"\ud83d\udd4c",synagogue:"\ud83d\udd4d",kaaba:"\ud83d\udd4b",shinto_shrine:"\u26e9",japan:"\ud83d\uddfe",rice_scene:"\ud83c\udf91",national_park:"\ud83c\udfde",sunrise:"\ud83c\udf05",sunrise_over_mountains:"\ud83c\udf04",stars:"\ud83c\udf20",sparkler:"\ud83c\udf87",fireworks:"\ud83c\udf86",city_sunrise:"\ud83c\udf07",city_sunset:"\ud83c\udf06",cityscape:"\ud83c\udfd9",night_with_stars:"\ud83c\udf03",milky_way:"\ud83c\udf0c",bridge_at_night:"\ud83c\udf09",foggy:"\ud83c\udf01",watch:"\u231a\ufe0f",iphone:"\ud83d\udcf1",calling:"\ud83d\udcf2",computer:"\ud83d\udcbb",keyboard:"\u2328\ufe0f",desktop_computer:"\ud83d\udda5",printer:"\ud83d\udda8",computer_mouse:"\ud83d\uddb1",trackball:"\ud83d\uddb2",joystick:"\ud83d\udd79",clamp:"\ud83d\udddc",minidisc:"\ud83d\udcbd",floppy_disk:"\ud83d\udcbe",cd:"\ud83d\udcbf",dvd:"\ud83d\udcc0",vhs:"\ud83d\udcfc",camera:"\ud83d\udcf7",camera_flash:"\ud83d\udcf8",video_camera:"\ud83d\udcf9",movie_camera:"\ud83c\udfa5",film_projector:"\ud83d\udcfd",film_strip:"\ud83c\udf9e",telephone_receiver:"\ud83d\udcde",phone:"\u260e\ufe0f",telephone:"\u260e\ufe0f",pager:"\ud83d\udcdf",fax:"\ud83d\udce0",tv:"\ud83d\udcfa",radio:"\ud83d\udcfb",studio_microphone:"\ud83c\udf99",level_slider:"\ud83c\udf9a",control_knobs:"\ud83c\udf9b",stopwatch:"\u23f1",timer_clock:"\u23f2",alarm_clock:"\u23f0",mantelpiece_clock:"\ud83d\udd70",hourglass:"\u231b\ufe0f",hourglass_flowing_sand:"\u23f3",satellite:"\ud83d\udce1",battery:"\ud83d\udd0b",electric_plug:"\ud83d\udd0c",bulb:"\ud83d\udca1",flashlight:"\ud83d\udd26",candle:"\ud83d\udd6f",wastebasket:"\ud83d\uddd1",oil_drum:"\ud83d\udee2",money_with_wings:"\ud83d\udcb8",dollar:"\ud83d\udcb5",yen:"\ud83d\udcb4",euro:"\ud83d\udcb6",pound:"\ud83d\udcb7",moneybag:"\ud83d\udcb0",credit_card:"\ud83d\udcb3",gem:"\ud83d\udc8e",balance_scale:"\u2696\ufe0f",wrench:"\ud83d\udd27",hammer:"\ud83d\udd28",hammer_and_pick:"\u2692",hammer_and_wrench:"\ud83d\udee0",pick:"\u26cf",nut_and_bolt:"\ud83d\udd29",gear:"\u2699\ufe0f",chains:"\u26d3",gun:"\ud83d\udd2b",bomb:"\ud83d\udca3",hocho:"\ud83d\udd2a",knife:"\ud83d\udd2a",dagger:"\ud83d\udde1",crossed_swords:"\u2694\ufe0f",shield:"\ud83d\udee1",smoking:"\ud83d\udeac",coffin:"\u26b0\ufe0f",funeral_urn:"\u26b1\ufe0f",amphora:"\ud83c\udffa",crystal_ball:"\ud83d\udd2e",prayer_beads:"\ud83d\udcff",barber:"\ud83d\udc88",alembic:"\u2697\ufe0f",telescope:"\ud83d\udd2d",microscope:"\ud83d\udd2c",hole:"\ud83d\udd73",pill:"\ud83d\udc8a",syringe:"\ud83d\udc89",thermometer:"\ud83c\udf21",toilet:"\ud83d\udebd",potable_water:"\ud83d\udeb0",shower:"\ud83d\udebf",bathtub:"\ud83d\udec1",bath:"\ud83d\udec0",bellhop_bell:"\ud83d\udece",key:"\ud83d\udd11",old_key:"\ud83d\udddd",door:"\ud83d\udeaa",couch_and_lamp:"\ud83d\udecb",bed:"\ud83d\udecf",sleeping_bed:"\ud83d\udecc",framed_picture:"\ud83d\uddbc",shopping:"\ud83d\udecd",shopping_cart:"\ud83d\uded2",gift:"\ud83c\udf81",balloon:"\ud83c\udf88",flags:"\ud83c\udf8f",ribbon:"\ud83c\udf80",confetti_ball:"\ud83c\udf8a",tada:"\ud83c\udf89",dolls:"\ud83c\udf8e",izakaya_lantern:"\ud83c\udfee",lantern:"\ud83c\udfee",wind_chime:"\ud83c\udf90",email:"\u2709\ufe0f",envelope:"\u2709\ufe0f",envelope_with_arrow:"\ud83d\udce9",incoming_envelope:"\ud83d\udce8","e-mail":"\ud83d\udce7",love_letter:"\ud83d\udc8c",inbox_tray:"\ud83d\udce5",outbox_tray:"\ud83d\udce4",package:"\ud83d\udce6",label:"\ud83c\udff7",mailbox_closed:"\ud83d\udcea",mailbox:"\ud83d\udceb",mailbox_with_mail:"\ud83d\udcec",mailbox_with_no_mail:"\ud83d\udced",postbox:"\ud83d\udcee",postal_horn:"\ud83d\udcef",scroll:"\ud83d\udcdc",page_with_curl:"\ud83d\udcc3",page_facing_up:"\ud83d\udcc4",bookmark_tabs:"\ud83d\udcd1",bar_chart:"\ud83d\udcca",chart_with_upwards_trend:"\ud83d\udcc8",chart_with_downwards_trend:"\ud83d\udcc9",spiral_notepad:"\ud83d\uddd2",spiral_calendar:"\ud83d\uddd3",calendar:"\ud83d\udcc6",date:"\ud83d\udcc5",card_index:"\ud83d\udcc7",card_file_box:"\ud83d\uddc3",ballot_box:"\ud83d\uddf3",file_cabinet:"\ud83d\uddc4",clipboard:"\ud83d\udccb",file_folder:"\ud83d\udcc1",open_file_folder:"\ud83d\udcc2",card_index_dividers:"\ud83d\uddc2",newspaper_roll:"\ud83d\uddde",newspaper:"\ud83d\udcf0",notebook:"\ud83d\udcd3",notebook_with_decorative_cover:"\ud83d\udcd4",ledger:"\ud83d\udcd2",closed_book:"\ud83d\udcd5",green_book:"\ud83d\udcd7",blue_book:"\ud83d\udcd8",orange_book:"\ud83d\udcd9",books:"\ud83d\udcda",book:"\ud83d\udcd6",open_book:"\ud83d\udcd6",bookmark:"\ud83d\udd16",link:"\ud83d\udd17",paperclip:"\ud83d\udcce",paperclips:"\ud83d\udd87",triangular_ruler:"\ud83d\udcd0",straight_ruler:"\ud83d\udccf",pushpin:"\ud83d\udccc",round_pushpin:"\ud83d\udccd",scissors:"\u2702\ufe0f",pen:"\ud83d\udd8a",fountain_pen:"\ud83d\udd8b",black_nib:"\u2712\ufe0f",paintbrush:"\ud83d\udd8c",crayon:"\ud83d\udd8d",memo:"\ud83d\udcdd",pencil:"\ud83d\udcdd",pencil2:"\u270f\ufe0f",mag:"\ud83d\udd0d",mag_right:"\ud83d\udd0e",lock_with_ink_pen:"\ud83d\udd0f",closed_lock_with_key:"\ud83d\udd10",lock:"\ud83d\udd12",unlock:"\ud83d\udd13",heart:"\u2764\ufe0f",yellow_heart:"\ud83d\udc9b",green_heart:"\ud83d\udc9a",blue_heart:"\ud83d\udc99",purple_heart:"\ud83d\udc9c",black_heart:"\ud83d\udda4",broken_heart:"\ud83d\udc94",heavy_heart_exclamation:"\u2763\ufe0f",two_hearts:"\ud83d\udc95",revolving_hearts:"\ud83d\udc9e",heartbeat:"\ud83d\udc93",heartpulse:"\ud83d\udc97",sparkling_heart:"\ud83d\udc96",cupid:"\ud83d\udc98",gift_heart:"\ud83d\udc9d",heart_decoration:"\ud83d\udc9f",peace_symbol:"\u262e\ufe0f",latin_cross:"\u271d\ufe0f",star_and_crescent:"\u262a\ufe0f",om:"\ud83d\udd49",wheel_of_dharma:"\u2638\ufe0f",star_of_david:"\u2721\ufe0f",six_pointed_star:"\ud83d\udd2f",menorah:"\ud83d\udd4e",yin_yang:"\u262f\ufe0f",orthodox_cross:"\u2626\ufe0f",place_of_worship:"\ud83d\uded0",ophiuchus:"\u26ce",aries:"\u2648\ufe0f",taurus:"\u2649\ufe0f",gemini:"\u264a\ufe0f",cancer:"\u264b\ufe0f",leo:"\u264c\ufe0f",virgo:"\u264d\ufe0f",libra:"\u264e\ufe0f",scorpius:"\u264f\ufe0f",sagittarius:"\u2650\ufe0f",capricorn:"\u2651\ufe0f",aquarius:"\u2652\ufe0f",pisces:"\u2653\ufe0f",id:"\ud83c\udd94",atom_symbol:"\u269b\ufe0f",accept:"\ud83c\ude51",radioactive:"\u2622\ufe0f",biohazard:"\u2623\ufe0f",mobile_phone_off:"\ud83d\udcf4",vibration_mode:"\ud83d\udcf3",eight_pointed_black_star:"\u2734\ufe0f",vs:"\ud83c\udd9a",white_flower:"\ud83d\udcae",ideograph_advantage:"\ud83c\ude50",secret:"\u3299\ufe0f",congratulations:"\u3297\ufe0f",u6e80:"\ud83c\ude35",a:"\ud83c\udd70\ufe0f",b:"\ud83c\udd71\ufe0f",ab:"\ud83c\udd8e",cl:"\ud83c\udd91",o2:"\ud83c\udd7e\ufe0f",sos:"\ud83c\udd98",x:"\u274c",o:"\u2b55\ufe0f",stop_sign:"\ud83d\uded1",no_entry:"\u26d4\ufe0f",name_badge:"\ud83d\udcdb",no_entry_sign:"\ud83d\udeab",anger:"\ud83d\udca2",hotsprings:"\u2668\ufe0f",no_pedestrians:"\ud83d\udeb7",do_not_litter:"\ud83d\udeaf",no_bicycles:"\ud83d\udeb3","non-potable_water":"\ud83d\udeb1",underage:"\ud83d\udd1e",no_mobile_phones:"\ud83d\udcf5",no_smoking:"\ud83d\udead",exclamation:"\u2757\ufe0f",heavy_exclamation_mark:"\u2757\ufe0f",grey_exclamation:"\u2755",question:"\u2753",grey_question:"\u2754",bangbang:"\u203c\ufe0f",interrobang:"\u2049\ufe0f",low_brightness:"\ud83d\udd05",high_brightness:"\ud83d\udd06",part_alternation_mark:"\u303d\ufe0f",warning:"\u26a0\ufe0f",children_crossing:"\ud83d\udeb8",trident:"\ud83d\udd31",fleur_de_lis:"\u269c\ufe0f",beginner:"\ud83d\udd30",recycle:"\u267b\ufe0f",white_check_mark:"\u2705",chart:"\ud83d\udcb9",sparkle:"\u2747\ufe0f",eight_spoked_asterisk:"\u2733\ufe0f",negative_squared_cross_mark:"\u274e",globe_with_meridians:"\ud83c\udf10",diamond_shape_with_a_dot_inside:"\ud83d\udca0",m:"\u24c2\ufe0f",cyclone:"\ud83c\udf00",zzz:"\ud83d\udca4",atm:"\ud83c\udfe7",wc:"\ud83d\udebe",wheelchair:"\u267f\ufe0f",parking:"\ud83c\udd7f\ufe0f",sa:"\ud83c\ude02\ufe0f",passport_control:"\ud83d\udec2",customs:"\ud83d\udec3",baggage_claim:"\ud83d\udec4",left_luggage:"\ud83d\udec5",mens:"\ud83d\udeb9",womens:"\ud83d\udeba",baby_symbol:"\ud83d\udebc",restroom:"\ud83d\udebb",put_litter_in_its_place:"\ud83d\udeae",cinema:"\ud83c\udfa6",signal_strength:"\ud83d\udcf6",koko:"\ud83c\ude01",symbols:"\ud83d\udd23",information_source:"\u2139\ufe0f",abc:"\ud83d\udd24",abcd:"\ud83d\udd21",capital_abcd:"\ud83d\udd20",ng:"\ud83c\udd96",ok:"\ud83c\udd97",up:"\ud83c\udd99",cool:"\ud83c\udd92",new:"\ud83c\udd95",free:"\ud83c\udd93",zero:"0\ufe0f\u20e3",one:"1\ufe0f\u20e3",two:"2\ufe0f\u20e3",three:"3\ufe0f\u20e3",four:"4\ufe0f\u20e3",five:"5\ufe0f\u20e3",six:"6\ufe0f\u20e3",seven:"7\ufe0f\u20e3",eight:"8\ufe0f\u20e3",nine:"9\ufe0f\u20e3",keycap_ten:"\ud83d\udd1f",hash:"#\ufe0f\u20e3",asterisk:"*\ufe0f\u20e3",arrow_forward:"\u25b6\ufe0f",pause_button:"\u23f8",play_or_pause_button:"\u23ef",stop_button:"\u23f9",record_button:"\u23fa",next_track_button:"\u23ed",previous_track_button:"\u23ee",fast_forward:"\u23e9",rewind:"\u23ea",arrow_double_up:"\u23eb",arrow_double_down:"\u23ec",arrow_backward:"\u25c0\ufe0f",arrow_up_small:"\ud83d\udd3c",arrow_down_small:"\ud83d\udd3d",arrow_right:"\u27a1\ufe0f",arrow_left:"\u2b05\ufe0f",arrow_up:"\u2b06\ufe0f",arrow_down:"\u2b07\ufe0f",arrow_upper_right:"\u2197\ufe0f",arrow_lower_right:"\u2198\ufe0f",arrow_lower_left:"\u2199\ufe0f",arrow_upper_left:"\u2196\ufe0f",arrow_up_down:"\u2195\ufe0f",left_right_arrow:"\u2194\ufe0f",arrow_right_hook:"\u21aa\ufe0f",leftwards_arrow_with_hook:"\u21a9\ufe0f",arrow_heading_up:"\u2934\ufe0f",arrow_heading_down:"\u2935\ufe0f",twisted_rightwards_arrows:"\ud83d\udd00",repeat:"\ud83d\udd01",repeat_one:"\ud83d\udd02",arrows_counterclockwise:"\ud83d\udd04",arrows_clockwise:"\ud83d\udd03",musical_note:"\ud83c\udfb5",notes:"\ud83c\udfb6",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",heavy_division_sign:"\u2797",heavy_multiplication_x:"\u2716\ufe0f",heavy_dollar_sign:"\ud83d\udcb2",currency_exchange:"\ud83d\udcb1",tm:"\u2122\ufe0f",copyright:"\xa9\ufe0f",registered:"\xae\ufe0f",wavy_dash:"\u3030\ufe0f",curly_loop:"\u27b0",loop:"\u27bf",end:"\ud83d\udd1a",back:"\ud83d\udd19",on:"\ud83d\udd1b",top:"\ud83d\udd1d",soon:"\ud83d\udd1c",heavy_check_mark:"\u2714\ufe0f",ballot_box_with_check:"\u2611\ufe0f",radio_button:"\ud83d\udd18",white_circle:"\u26aa\ufe0f",black_circle:"\u26ab\ufe0f",red_circle:"\ud83d\udd34",large_blue_circle:"\ud83d\udd35",small_red_triangle:"\ud83d\udd3a",small_red_triangle_down:"\ud83d\udd3b",small_orange_diamond:"\ud83d\udd38",small_blue_diamond:"\ud83d\udd39",large_orange_diamond:"\ud83d\udd36",large_blue_diamond:"\ud83d\udd37",white_square_button:"\ud83d\udd33",black_square_button:"\ud83d\udd32",black_small_square:"\u25aa\ufe0f",white_small_square:"\u25ab\ufe0f",black_medium_small_square:"\u25fe\ufe0f",white_medium_small_square:"\u25fd\ufe0f",black_medium_square:"\u25fc\ufe0f",white_medium_square:"\u25fb\ufe0f",black_large_square:"\u2b1b\ufe0f",white_large_square:"\u2b1c\ufe0f",speaker:"\ud83d\udd08",mute:"\ud83d\udd07",sound:"\ud83d\udd09",loud_sound:"\ud83d\udd0a",bell:"\ud83d\udd14",no_bell:"\ud83d\udd15",mega:"\ud83d\udce3",loudspeaker:"\ud83d\udce2",eye_speech_bubble:"\ud83d\udc41\u200d\ud83d\udde8",speech_balloon:"\ud83d\udcac",thought_balloon:"\ud83d\udcad",right_anger_bubble:"\ud83d\uddef",spades:"\u2660\ufe0f",clubs:"\u2663\ufe0f",hearts:"\u2665\ufe0f",diamonds:"\u2666\ufe0f",black_joker:"\ud83c\udccf",flower_playing_cards:"\ud83c\udfb4",mahjong:"\ud83c\udc04\ufe0f",clock1:"\ud83d\udd50",clock2:"\ud83d\udd51",clock3:"\ud83d\udd52",clock4:"\ud83d\udd53",clock5:"\ud83d\udd54",clock6:"\ud83d\udd55",clock7:"\ud83d\udd56",clock8:"\ud83d\udd57",clock9:"\ud83d\udd58",clock10:"\ud83d\udd59",clock11:"\ud83d\udd5a",clock12:"\ud83d\udd5b",clock130:"\ud83d\udd5c",clock230:"\ud83d\udd5d",clock330:"\ud83d\udd5e",clock430:"\ud83d\udd5f",clock530:"\ud83d\udd60",clock630:"\ud83d\udd61",clock730:"\ud83d\udd62",clock830:"\ud83d\udd63",clock930:"\ud83d\udd64",clock1030:"\ud83d\udd65",clock1130:"\ud83d\udd66",clock1230:"\ud83d\udd67",white_flag:"\ud83c\udff3\ufe0f",black_flag:"\ud83c\udff4",checkered_flag:"\ud83c\udfc1",triangular_flag_on_post:"\ud83d\udea9",rainbow_flag:"\ud83c\udff3\ufe0f\u200d\ud83c\udf08",afghanistan:"\ud83c\udde6\ud83c\uddeb",aland_islands:"\ud83c\udde6\ud83c\uddfd",albania:"\ud83c\udde6\ud83c\uddf1",algeria:"\ud83c\udde9\ud83c\uddff",american_samoa:"\ud83c\udde6\ud83c\uddf8",andorra:"\ud83c\udde6\ud83c\udde9",angola:"\ud83c\udde6\ud83c\uddf4",anguilla:"\ud83c\udde6\ud83c\uddee",antarctica:"\ud83c\udde6\ud83c\uddf6",antigua_barbuda:"\ud83c\udde6\ud83c\uddec",argentina:"\ud83c\udde6\ud83c\uddf7",armenia:"\ud83c\udde6\ud83c\uddf2",aruba:"\ud83c\udde6\ud83c\uddfc",australia:"\ud83c\udde6\ud83c\uddfa",austria:"\ud83c\udde6\ud83c\uddf9",azerbaijan:"\ud83c\udde6\ud83c\uddff",bahamas:"\ud83c\udde7\ud83c\uddf8",bahrain:"\ud83c\udde7\ud83c\udded",bangladesh:"\ud83c\udde7\ud83c\udde9",barbados:"\ud83c\udde7\ud83c\udde7",belarus:"\ud83c\udde7\ud83c\uddfe",belgium:"\ud83c\udde7\ud83c\uddea",belize:"\ud83c\udde7\ud83c\uddff",benin:"\ud83c\udde7\ud83c\uddef",bermuda:"\ud83c\udde7\ud83c\uddf2",bhutan:"\ud83c\udde7\ud83c\uddf9",bolivia:"\ud83c\udde7\ud83c\uddf4",caribbean_netherlands:"\ud83c\udde7\ud83c\uddf6",bosnia_herzegovina:"\ud83c\udde7\ud83c\udde6",botswana:"\ud83c\udde7\ud83c\uddfc",brazil:"\ud83c\udde7\ud83c\uddf7",british_indian_ocean_territory:"\ud83c\uddee\ud83c\uddf4",british_virgin_islands:"\ud83c\uddfb\ud83c\uddec",brunei:"\ud83c\udde7\ud83c\uddf3",bulgaria:"\ud83c\udde7\ud83c\uddec",burkina_faso:"\ud83c\udde7\ud83c\uddeb",burundi:"\ud83c\udde7\ud83c\uddee",cape_verde:"\ud83c\udde8\ud83c\uddfb",cambodia:"\ud83c\uddf0\ud83c\udded",cameroon:"\ud83c\udde8\ud83c\uddf2",canada:"\ud83c\udde8\ud83c\udde6",canary_islands:"\ud83c\uddee\ud83c\udde8",cayman_islands:"\ud83c\uddf0\ud83c\uddfe",central_african_republic:"\ud83c\udde8\ud83c\uddeb",chad:"\ud83c\uddf9\ud83c\udde9",chile:"\ud83c\udde8\ud83c\uddf1",cn:"\ud83c\udde8\ud83c\uddf3",christmas_island:"\ud83c\udde8\ud83c\uddfd",cocos_islands:"\ud83c\udde8\ud83c\udde8",colombia:"\ud83c\udde8\ud83c\uddf4",comoros:"\ud83c\uddf0\ud83c\uddf2",congo_brazzaville:"\ud83c\udde8\ud83c\uddec",congo_kinshasa:"\ud83c\udde8\ud83c\udde9",cook_islands:"\ud83c\udde8\ud83c\uddf0",costa_rica:"\ud83c\udde8\ud83c\uddf7",cote_divoire:"\ud83c\udde8\ud83c\uddee",croatia:"\ud83c\udded\ud83c\uddf7",cuba:"\ud83c\udde8\ud83c\uddfa",curacao:"\ud83c\udde8\ud83c\uddfc",cyprus:"\ud83c\udde8\ud83c\uddfe",czech_republic:"\ud83c\udde8\ud83c\uddff",denmark:"\ud83c\udde9\ud83c\uddf0",djibouti:"\ud83c\udde9\ud83c\uddef",dominica:"\ud83c\udde9\ud83c\uddf2",dominican_republic:"\ud83c\udde9\ud83c\uddf4",ecuador:"\ud83c\uddea\ud83c\udde8",egypt:"\ud83c\uddea\ud83c\uddec",el_salvador:"\ud83c\uddf8\ud83c\uddfb",equatorial_guinea:"\ud83c\uddec\ud83c\uddf6",eritrea:"\ud83c\uddea\ud83c\uddf7",estonia:"\ud83c\uddea\ud83c\uddea",ethiopia:"\ud83c\uddea\ud83c\uddf9",eu:"\ud83c\uddea\ud83c\uddfa",european_union:"\ud83c\uddea\ud83c\uddfa",falkland_islands:"\ud83c\uddeb\ud83c\uddf0",faroe_islands:"\ud83c\uddeb\ud83c\uddf4",fiji:"\ud83c\uddeb\ud83c\uddef",finland:"\ud83c\uddeb\ud83c\uddee",fr:"\ud83c\uddeb\ud83c\uddf7",french_guiana:"\ud83c\uddec\ud83c\uddeb",french_polynesia:"\ud83c\uddf5\ud83c\uddeb",french_southern_territories:"\ud83c\uddf9\ud83c\uddeb",gabon:"\ud83c\uddec\ud83c\udde6",gambia:"\ud83c\uddec\ud83c\uddf2",georgia:"\ud83c\uddec\ud83c\uddea",de:"\ud83c\udde9\ud83c\uddea",ghana:"\ud83c\uddec\ud83c\udded",gibraltar:"\ud83c\uddec\ud83c\uddee",greece:"\ud83c\uddec\ud83c\uddf7",greenland:"\ud83c\uddec\ud83c\uddf1",grenada:"\ud83c\uddec\ud83c\udde9",guadeloupe:"\ud83c\uddec\ud83c\uddf5",guam:"\ud83c\uddec\ud83c\uddfa",guatemala:"\ud83c\uddec\ud83c\uddf9",guernsey:"\ud83c\uddec\ud83c\uddec",guinea:"\ud83c\uddec\ud83c\uddf3",guinea_bissau:"\ud83c\uddec\ud83c\uddfc",guyana:"\ud83c\uddec\ud83c\uddfe",haiti:"\ud83c\udded\ud83c\uddf9",honduras:"\ud83c\udded\ud83c\uddf3",hong_kong:"\ud83c\udded\ud83c\uddf0",hungary:"\ud83c\udded\ud83c\uddfa",iceland:"\ud83c\uddee\ud83c\uddf8",india:"\ud83c\uddee\ud83c\uddf3",indonesia:"\ud83c\uddee\ud83c\udde9",iran:"\ud83c\uddee\ud83c\uddf7",iraq:"\ud83c\uddee\ud83c\uddf6",ireland:"\ud83c\uddee\ud83c\uddea",isle_of_man:"\ud83c\uddee\ud83c\uddf2",israel:"\ud83c\uddee\ud83c\uddf1",it:"\ud83c\uddee\ud83c\uddf9",jamaica:"\ud83c\uddef\ud83c\uddf2",jp:"\ud83c\uddef\ud83c\uddf5",crossed_flags:"\ud83c\udf8c",jersey:"\ud83c\uddef\ud83c\uddea",jordan:"\ud83c\uddef\ud83c\uddf4",kazakhstan:"\ud83c\uddf0\ud83c\uddff",kenya:"\ud83c\uddf0\ud83c\uddea",kiribati:"\ud83c\uddf0\ud83c\uddee",kosovo:"\ud83c\uddfd\ud83c\uddf0",kuwait:"\ud83c\uddf0\ud83c\uddfc",kyrgyzstan:"\ud83c\uddf0\ud83c\uddec",laos:"\ud83c\uddf1\ud83c\udde6",latvia:"\ud83c\uddf1\ud83c\uddfb",lebanon:"\ud83c\uddf1\ud83c\udde7",lesotho:"\ud83c\uddf1\ud83c\uddf8",liberia:"\ud83c\uddf1\ud83c\uddf7",libya:"\ud83c\uddf1\ud83c\uddfe",liechtenstein:"\ud83c\uddf1\ud83c\uddee",lithuania:"\ud83c\uddf1\ud83c\uddf9",luxembourg:"\ud83c\uddf1\ud83c\uddfa",macau:"\ud83c\uddf2\ud83c\uddf4",macedonia:"\ud83c\uddf2\ud83c\uddf0",madagascar:"\ud83c\uddf2\ud83c\uddec",malawi:"\ud83c\uddf2\ud83c\uddfc",malaysia:"\ud83c\uddf2\ud83c\uddfe",maldives:"\ud83c\uddf2\ud83c\uddfb",mali:"\ud83c\uddf2\ud83c\uddf1",malta:"\ud83c\uddf2\ud83c\uddf9",marshall_islands:"\ud83c\uddf2\ud83c\udded",martinique:"\ud83c\uddf2\ud83c\uddf6",mauritania:"\ud83c\uddf2\ud83c\uddf7",mauritius:"\ud83c\uddf2\ud83c\uddfa",mayotte:"\ud83c\uddfe\ud83c\uddf9",mexico:"\ud83c\uddf2\ud83c\uddfd",micronesia:"\ud83c\uddeb\ud83c\uddf2",moldova:"\ud83c\uddf2\ud83c\udde9",monaco:"\ud83c\uddf2\ud83c\udde8",mongolia:"\ud83c\uddf2\ud83c\uddf3",montenegro:"\ud83c\uddf2\ud83c\uddea",montserrat:"\ud83c\uddf2\ud83c\uddf8",morocco:"\ud83c\uddf2\ud83c\udde6",mozambique:"\ud83c\uddf2\ud83c\uddff",myanmar:"\ud83c\uddf2\ud83c\uddf2",namibia:"\ud83c\uddf3\ud83c\udde6",nauru:"\ud83c\uddf3\ud83c\uddf7",nepal:"\ud83c\uddf3\ud83c\uddf5",netherlands:"\ud83c\uddf3\ud83c\uddf1",new_caledonia:"\ud83c\uddf3\ud83c\udde8",new_zealand:"\ud83c\uddf3\ud83c\uddff",nicaragua:"\ud83c\uddf3\ud83c\uddee",niger:"\ud83c\uddf3\ud83c\uddea",nigeria:"\ud83c\uddf3\ud83c\uddec",niue:"\ud83c\uddf3\ud83c\uddfa",norfolk_island:"\ud83c\uddf3\ud83c\uddeb",northern_mariana_islands:"\ud83c\uddf2\ud83c\uddf5",north_korea:"\ud83c\uddf0\ud83c\uddf5",norway:"\ud83c\uddf3\ud83c\uddf4",oman:"\ud83c\uddf4\ud83c\uddf2",pakistan:"\ud83c\uddf5\ud83c\uddf0",palau:"\ud83c\uddf5\ud83c\uddfc",palestinian_territories:"\ud83c\uddf5\ud83c\uddf8",panama:"\ud83c\uddf5\ud83c\udde6",papua_new_guinea:"\ud83c\uddf5\ud83c\uddec",paraguay:"\ud83c\uddf5\ud83c\uddfe",peru:"\ud83c\uddf5\ud83c\uddea",philippines:"\ud83c\uddf5\ud83c\udded",pitcairn_islands:"\ud83c\uddf5\ud83c\uddf3",poland:"\ud83c\uddf5\ud83c\uddf1",portugal:"\ud83c\uddf5\ud83c\uddf9",puerto_rico:"\ud83c\uddf5\ud83c\uddf7",qatar:"\ud83c\uddf6\ud83c\udde6",reunion:"\ud83c\uddf7\ud83c\uddea",romania:"\ud83c\uddf7\ud83c\uddf4",ru:"\ud83c\uddf7\ud83c\uddfa",rwanda:"\ud83c\uddf7\ud83c\uddfc",st_barthelemy:"\ud83c\udde7\ud83c\uddf1",st_helena:"\ud83c\uddf8\ud83c\udded",st_kitts_nevis:"\ud83c\uddf0\ud83c\uddf3",st_lucia:"\ud83c\uddf1\ud83c\udde8",st_pierre_miquelon:"\ud83c\uddf5\ud83c\uddf2",st_vincent_grenadines:"\ud83c\uddfb\ud83c\udde8",samoa:"\ud83c\uddfc\ud83c\uddf8",san_marino:"\ud83c\uddf8\ud83c\uddf2",sao_tome_principe:"\ud83c\uddf8\ud83c\uddf9",saudi_arabia:"\ud83c\uddf8\ud83c\udde6",senegal:"\ud83c\uddf8\ud83c\uddf3",serbia:"\ud83c\uddf7\ud83c\uddf8",seychelles:"\ud83c\uddf8\ud83c\udde8",sierra_leone:"\ud83c\uddf8\ud83c\uddf1",singapore:"\ud83c\uddf8\ud83c\uddec",sint_maarten:"\ud83c\uddf8\ud83c\uddfd",slovakia:"\ud83c\uddf8\ud83c\uddf0",slovenia:"\ud83c\uddf8\ud83c\uddee",solomon_islands:"\ud83c\uddf8\ud83c\udde7",somalia:"\ud83c\uddf8\ud83c\uddf4",south_africa:"\ud83c\uddff\ud83c\udde6",south_georgia_south_sandwich_islands:"\ud83c\uddec\ud83c\uddf8",kr:"\ud83c\uddf0\ud83c\uddf7",south_sudan:"\ud83c\uddf8\ud83c\uddf8",es:"\ud83c\uddea\ud83c\uddf8",sri_lanka:"\ud83c\uddf1\ud83c\uddf0",sudan:"\ud83c\uddf8\ud83c\udde9",suriname:"\ud83c\uddf8\ud83c\uddf7",swaziland:"\ud83c\uddf8\ud83c\uddff",sweden:"\ud83c\uddf8\ud83c\uddea",switzerland:"\ud83c\udde8\ud83c\udded",syria:"\ud83c\uddf8\ud83c\uddfe",taiwan:"\ud83c\uddf9\ud83c\uddfc",tajikistan:"\ud83c\uddf9\ud83c\uddef",tanzania:"\ud83c\uddf9\ud83c\uddff",thailand:"\ud83c\uddf9\ud83c\udded",timor_leste:"\ud83c\uddf9\ud83c\uddf1",togo:"\ud83c\uddf9\ud83c\uddec",tokelau:"\ud83c\uddf9\ud83c\uddf0",tonga:"\ud83c\uddf9\ud83c\uddf4",trinidad_tobago:"\ud83c\uddf9\ud83c\uddf9",tunisia:"\ud83c\uddf9\ud83c\uddf3",tr:"\ud83c\uddf9\ud83c\uddf7",turkmenistan:"\ud83c\uddf9\ud83c\uddf2",turks_caicos_islands:"\ud83c\uddf9\ud83c\udde8",tuvalu:"\ud83c\uddf9\ud83c\uddfb",uganda:"\ud83c\uddfa\ud83c\uddec",ukraine:"\ud83c\uddfa\ud83c\udde6",united_arab_emirates:"\ud83c\udde6\ud83c\uddea",gb:"\ud83c\uddec\ud83c\udde7",uk:"\ud83c\uddec\ud83c\udde7",us:"\ud83c\uddfa\ud83c\uddf8",us_virgin_islands:"\ud83c\uddfb\ud83c\uddee",uruguay:"\ud83c\uddfa\ud83c\uddfe",uzbekistan:"\ud83c\uddfa\ud83c\uddff",vanuatu:"\ud83c\uddfb\ud83c\uddfa",vatican_city:"\ud83c\uddfb\ud83c\udde6",venezuela:"\ud83c\uddfb\ud83c\uddea",vietnam:"\ud83c\uddfb\ud83c\uddf3",wallis_futuna:"\ud83c\uddfc\ud83c\uddeb",western_sahara:"\ud83c\uddea\ud83c\udded",yemen:"\ud83c\uddfe\ud83c\uddea",zambia:"\ud83c\uddff\ud83c\uddf2",zimbabwe:"\ud83c\uddff\ud83c\uddfc"}},{}],2:[function(a,e,n){"use strict";e.exports={angry:[">:(",">:-("],blush:[':")',':-")'],broken_heart:["</3","<\\3"],confused:[":/",":-/"],cry:[":'(",":'-(",":,(",":,-("],frowning:[":(",":-("],heart:["<3"],imp:["]:(","]:-("],innocent:["o:)","O:)","o:-)","O:-)","0:)","0:-)"],joy:[":')",":'-)",":,)",":,-)",":'D",":'-D",":,D",":,-D"],kissing:[":*",":-*"],laughing:["x-)","X-)"],neutral_face:[":|",":-|"],open_mouth:[":o",":-o",":O",":-O"],rage:[":@",":-@"],smile:[":D",":-D"],smiley:[":)",":-)"],smiling_imp:["]:)","]:-)"],sob:[":,'(",":,'-(",";(",";-("],stuck_out_tongue:[":P",":-P"],sunglasses:["8-)","B-)"],sweat:[",:(",",:-("],sweat_smile:[",:)",",:-)"],unamused:[":s",":-S",":z",":-Z",":$",":-$"],wink:[";)",";-)"]}},{}],3:[function(a,e,n){"use strict";function o(a){return a.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}e.exports=function(a){var e,n=a.defs;a.enabled.length&&(n=Object.keys(n).reduce(function(e,o){return a.enabled.indexOf(o)>=0&&(e[o]=n[o]),e},{})),e=Object.keys(a.shortcuts).reduce(function(e,o){return n[o]?Array.isArray(a.shortcuts[o])?(a.shortcuts[o].forEach(function(a){e[a]=o}),e):(e[a.shortcuts[o]]=o,e):e},{});var i=Object.keys(n).map(function(a){return":"+a+":"}).concat(Object.keys(e)).sort().reverse().map(function(a){return o(a)}).join("|"),r=RegExp(i),_=RegExp(i,"g");return{defs:n,shortcuts:e,scanRE:r,replaceRE:_}}},{}],4:[function(a,e,n){"use strict";e.exports=function(a,e){return a[e].content}},{}],5:[function(a,e,n){"use strict";e.exports=function(a,e,n,o,i){function r(a,o,r){var _,t=0,l=[];return a.replace(i,function(o,i,c){var m;if(n.hasOwnProperty(o)){if(m=n[o],i>0&&!s.test(c[i-1]))return;if(i+o.length<c.length&&!s.test(c[i+o.length]))return}else m=o.slice(1,-1);i>t&&(_=new r("text","",0),_.content=a.slice(t,i),l.push(_)),_=new r("emoji","",0),_.markup=m,_.content=e[m],l.push(_),t=i+o.length}),t<a.length&&(_=new r("text","",0),_.content=a.slice(t),l.push(_)),l}var _=a.utils.arrayReplaceAt,t=a.utils.lib.ucmicro,s=new RegExp([t.Z.source,t.P.source,t.Cc.source].join("|"));return function(a){var e,n,i,t,s,l=a.tokens,c=0;for(n=0,i=l.length;n<i;n++)if("inline"===l[n].type)for(t=l[n].children,e=t.length-1;e>=0;e--)s=t[e],"link_open"!==s.type&&"link_close"!==s.type||"auto"===s.info&&(c-=s.nesting),"text"===s.type&&0===c&&o.test(s.content)&&(l[n].children=t=_(t,e,r(s.content,s.level,a.Token)))}}},{}],6:[function(a,e,n){"use strict";var o=a("./lib/data/full.json"),i=a("./lib/data/shortcuts"),r=a("./lib/render"),_=a("./lib/replace"),t=a("./lib/normalize_opts");e.exports=function(a,e){var n={defs:o,shortcuts:i,enabled:[]},s=t(a.utils.assign({},n,e||{}));a.renderer.rules.emoji=r,a.core.ruler.push("emoji",_(a,s.defs,s.shortcuts,s.scanRE,s.replaceRE))}},{"./lib/data/full.json":1,"./lib/data/shortcuts":2,"./lib/normalize_opts":3,"./lib/render":4,"./lib/replace":5}]},{},[6])(6)});function sanitizeHtml(html){return html.replace(/<[^>]*>?/gi,sanitizeTag);}
var basic_tag_whitelist=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|h4|h5|h6|i|kbd|li|ol(?: start="\d+")?|p|pre|s|span|sup|sub|strong|strike|table|thead|tbody|td|th|tr|ul)>|<(br|hr)\s?\/?>)$/i;var a_white=/^(<a\shref="((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)*[\]$]+"(\stitle="[^"<>]+")?\s?>|<\/a>)$/i;var img_white=/^(<img\ssrc="(https?:\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)*[\]$]+"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"<>]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i;var tdth_align=/^<(td|th)(\sstyle="text-align:(left|right|center)?")?>$/i;var span_highlight=/^<span\sclass="hljs-(\w|-)+">$/i;var code_highlight=/^<code\sclass="language-(\w|-)+">$/i;function sanitizeTag(tag){if(tag.match(basic_tag_whitelist)||tag.match(a_white)||tag.match(img_white)||tag.match(tdth_align)||tag.match(span_highlight)||tag.match(code_highlight)){return tag;}
return"";}
function balanceTags(html){if(html==""){return"";}
var re=/<\/?\w+[^>]*(\s|$|>)/g;var tags=html.toLowerCase().match(re);var tagcount=(tags||[]).length;if(tagcount===0){return html;}
var tagname;var tag;var ignoredtags="<p><img><br><li><hr>";var match;var tagpaired=[];var tagremove=[];var needsRemoval=false;if(tags!=null){for(var ctag=0;ctag<tagcount;ctag++){tagname=tags[ctag].replace(/<\/?(\w+).*/,"$1");if(tagpaired[ctag]||ignoredtags.search("<"+tagname+">")>-1){continue;}
tag=tags[ctag];match=-1;if(!/^<\//.test(tag)){for(var ntag=ctag+1;ntag<tagcount;ntag++){if(!tagpaired[ntag]&&tags[ntag]==="</"+tagname+">"){match=ntag;break;}}}
if(match===-1){needsRemoval=tagremove[ctag]=true;}
else{tagpaired[match]=true;}}}
if(!needsRemoval){return html;}
var tagIndex=0;html=html.replace(re,function(matchStr){var res=tagremove[tagIndex]?"":matchStr;tagIndex++;return res;});return html;}
(function(arr){arr.forEach(function(item){if(item.hasOwnProperty('after')){return;}
Object.defineProperty(item,'after',{configurable:true,enumerable:true,writable:true,value:function after(){var argArr=Array.prototype.slice.call(arguments),docFrag=document.createDocumentFragment();argArr.forEach(function(argItem){var isNode=argItem instanceof Node;docFrag.appendChild(isNode?argItem:document.createTextNode(String(argItem)));});this.parentNode.insertBefore(docFrag,this.nextSibling);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]);hljs.defaults={auto:true,};Minimarkmd=window.markdownit({html:false,breaks:true,linkify:true,typographer:true,highlight:function(str,lang){if(lang&&hljs.getLanguage(lang)){try{return hljs.highlight(lang,str,true).value;}catch(__){}}
else{try{return hljs.highlightAuto(str).value;}catch(__){}}
return'';},});Minimarkmd.use(window.markdownitEmoji);function removeMarkdown(md,options){options=options||{};options.listUnicodeChar=options.hasOwnProperty('listUnicodeChar')?options.listUnicodeChar:false;options.stripListLeaders=options.hasOwnProperty('stripListLeaders')?options.stripListLeaders:true;options.gfm=options.hasOwnProperty('gfm')?options.gfm:true;options.useImgAltText=options.hasOwnProperty('useImgAltText')?options.useImgAltText:true;var output=md||'';output=output.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,'');try{if(options.stripListLeaders){if(options.listUnicodeChar)
output=output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,options.listUnicodeChar+' $1');else
output=output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,'$1');}
if(options.gfm){output=output.replace(/\n={2,}/g,'\n').replace(/~{3}.*\n/g,'').replace(/~~/g,'').replace(/`{3}.*\n/g,'');}
output=output.replace(/<[^>]*>/g,'').replace(/^[=\-]{2,}\s*$/g,'').replace(/\[\^.+?\](\: .*?$)?/g,'').replace(/\s{0,2}\[.*?\]: .*?$/g,'').replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,options.useImgAltText?'$1':'').replace(/\[(.*?)\][\[\(].*?[\]\)]/g,'$1').replace(/^\s{0,3}>\s?/g,'').replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,'').replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,'$1$2$3').replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,'$2').replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,'$2').replace(/(`{3,})(.*?)\1/gm,'$2').replace(/`(.+?)`/g,'$1').replace(/\n{2,}/g,'\n\n');}catch(e){console.error(e);return md;}
return output;}
var MARKDOWN_SIGNATURE="VSF_TYPE_MARKDOWN";function hasMarkdownSignature(htmlOrMarkdown){return htmlOrMarkdown.indexOf(MARKDOWN_SIGNATURE)==0;}
function removeSystemHeaders(markdownWithSignature){markdownWithSignature=markdownWithSignature.substr(MARKDOWN_SIGNATURE.length);markdownWithSignature=markdownWithSignature.replace(/```VSF_WORKAROUND_IGNORE(.|\r|\n|\x2028|\x2029)*```/g,"");return markdownWithSignature;}
function htmlFromMarkdown(htmlOrMarkdown){if(hasMarkdownSignature(htmlOrMarkdown)){htmlOrMarkdown=removeSystemHeaders(htmlOrMarkdown);htmlOrMarkdown=decodeHtmlEntity(htmlOrMarkdown);return balanceTags(sanitizeHtml(Minimarkmd.render(htmlOrMarkdown)));}
htmlOrMarkdown=replaceLinksWithAElement(htmlOrMarkdown);return htmlOrMarkdown;}
function insertAfterCurrentScript(html){var script=document.currentScript||(function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1];})();var newNode=document.createElement("div");newNode.innerHTML=html;script.after(newNode)}
function parseMarkdownAndInsertAfterCurrentScript(htmlOrMarkdown){var html=htmlFromMarkdown(htmlOrMarkdown);insertAfterCurrentScript(html);}
function parseMarkdownAndInsertAfter_AsPlainText(nodeId,htmlOrMarkdown,fallbackHtml){var result;if(hasMarkdownSignature(htmlOrMarkdown)){htmlOrMarkdown=removeSystemHeaders(htmlOrMarkdown);htmlOrMarkdown=decodeHtmlEntity(htmlOrMarkdown);result=balanceTags(sanitizeHtml(removeMarkdown(htmlOrMarkdown)));}
else{result=fallbackHtml;}
var node=document.getElementById(nodeId);var newNode=document.createElement("div");newNode.innerHTML=result;node.after(newNode)}
function decodeHtmlEntity(str){return str.replace(/&#(\d+);/g,function(match,dec){return String.fromCharCode(dec);}).replace(/&gt;/gi,">").replace(/&lt;/gi,"<").replace(/&amp;/gi,"&").replace(/&quot;/gi,"\"").replace(/&apos;/gi,"'");};function findSkipElements(html){if(html==""||html==null){return[];}
var openAElementsRE=/<a[^>]*[\s$]*>/g;var CLOSING_A="</a>";var CLOSING_A_LEN=CLOSING_A.length;var result=new Array(html.length);var aElem;while((aElem=openAElementsRE.exec(html))!==null){var match=aElem[0];var index=aElem.index;var indexAfterMatch=index+match.length;var indexOfClosingA=html.indexOf(CLOSING_A,indexAfterMatch);if(indexOfClosingA<0){indexOfClosingA=html.length;}
var indexAfterClosingA=indexOfClosingA+CLOSING_A_LEN;if(indexAfterClosingA>html.length){indexAfterClosingA=html.length;}
openAElementsRE.lastIndex=indexAfterClosingA;for(var i=index;i<indexAfterClosingA;i++){result[i]=true;}
if(indexAfterClosingA===html.length){break;}}
var imgElementsRE=/<img[^>]*[\s$]*>/g;var imgElem;while((imgElem=imgElementsRE.exec(html))!==null){var match=imgElem[0];var index=imgElem.index;var indexAfterMatch=index+match.length;for(var i=index;i<indexAfterMatch;i++){result[i]=true;}}
return result;}
function replaceLinksWithAElement(html){if(html==""||html==null){return html;}
var urlAndExtraRegex=/https?:\/\/\S+/g;var skipChars="'\"";var stoppingChars=",;:!";var stoppingIfSpaceAfterChars="?.-";var stoppingIfNotRepeatedInFrontChars_Closing=")]}";var stoppingIfNotRepeatedInFrontChars_Opening="([{";var whitespaceOrHtml=/[\s<]/;var insideSkipElement=findSkipElements(html);var singleItem;var newHtml="";var indexToIncludeAfter=0;while((singleItem=urlAndExtraRegex.exec(html))!==null){var match=singleItem[0];var index=singleItem.index;var indexOfOpenAngleBracket=match.indexOf("<");if(indexOfOpenAngleBracket>=0){match=match.substr(0,indexOfOpenAngleBracket);}
newHtml+=html.substring(indexToIncludeAfter,index);var indexAfterMatch=index+match.length;indexToIncludeAfter=indexAfterMatch;urlAndExtraRegex.lastIndex=indexToIncludeAfter;var lastChar=match[match.length-1];var nextChar="";if(indexAfterMatch<html.length){nextChar=html[indexAfterMatch];}
if(skipChars.indexOf(lastChar)>=0){newHtml+=match;continue;}
if(insideSkipElement[index]===true){newHtml+=match;continue;}
var shouldExcludeLastChar=false;if(stoppingChars.indexOf(lastChar)>=0){shouldExcludeLastChar=true;}
else if(stoppingIfSpaceAfterChars.indexOf(lastChar)>=0&&(nextChar===""||nextChar.match(whitespaceOrHtml))){shouldExcludeLastChar=true;}else{var indexOfStoppingChar=stoppingIfNotRepeatedInFrontChars_Closing.indexOf(lastChar);if(indexOfStoppingChar>=0){var openingChar=stoppingIfNotRepeatedInFrontChars_Opening[indexOfStoppingChar];if(index>0&&html[index-1]===openingChar){shouldExcludeLastChar=true;}}}
var extraCharsToInclude="";if(shouldExcludeLastChar){match=match.substr(0,match.length-1);extraCharsToInclude=lastChar;}
newHtml+="<a target='_blank' href='"+match+"'>"+match+"</a>"+extraCharsToInclude;}
newHtml+=html.substr(indexToIncludeAfter);return newHtml;}
(function(a){a.fn.each2===void 0&&a.fn.extend({each2:function(b){for(var c=a([0]),d=-1,e=this.length;e>++d&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})})(jQuery),function(a,b){"use strict";function m(a,b){for(var c=0,d=b.length;d>c;c+=1)if(o(a,b[c]))return c;return-1}function n(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function o(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function p(b,c){var d,e,f;if(null===b||1>b.length)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function q(a){return a.outerWidth(!1)-a.width()}function r(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function s(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function t(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function u(a){var c,b=!1;return function(){return b===!1&&(c=a(),b=!0),c}}function v(a,b){var c=t(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){m(a.target,b.get())>=0&&c(a)})}function w(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus(),a.is(":visible")&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function x(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function y(a){a.preventDefault(),a.stopPropagation()}function z(a){a.preventDefault(),a.stopImmediatePropagation()}function A(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function B(b,c,d){var e,g,f=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(this))})),b.attr("class",f.join(" "))}function C(a,c,d,e){var f=a.toUpperCase().indexOf(c.toUpperCase()),g=c.length;return 0>f?(d.push(e(a)),b):(d.push(e(a.substring(0,f))),d.push("<span class='select2-match'>"),d.push(e(a.substring(f,f+g))),d.push("</span>"),d.push(e(a.substring(f+g,a.length))),b)}function D(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return(a+"").replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function E(c){var d,e=0,f=null,g=c.quietMillis||100,h=c.url,i=this;return function(j){window.clearTimeout(d),d=window.setTimeout(function(){e+=1;var d=e,g=c.data,k=h,l=c.transport||a.fn.select2.ajaxDefaults.transport,m={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},n=a.extend({},a.fn.select2.ajaxDefaults.params,m);g=g?g.call(i,j.term,j.page,j.context):null,k="function"==typeof k?k.call(i,j.term,j.page,j.context):k,f&&f.abort(),c.params&&(a.isFunction(c.params)?a.extend(n,c.params.call(i)):a.extend(n,c.params)),a.extend(n,{url:k,dataType:c.dataType,data:g,success:function(a){if(!(e>d)){var b=c.results(a,j.page);j.callback(b)}}}),f=l.call(i,n)},g)}}function F(c){var e,f,d=c,g=function(a){return""+a.text};a.isArray(d)&&(f=d,d={results:f}),a.isFunction(d)===!1&&(f=d,d=function(){return f});var h=d();return h.text&&(g=h.text,a.isFunction(g)||(e=h.text,g=function(a){return a[e]})),function(c){var h,e=c.term,f={results:[]};return""===e?(c.callback(d()),b):(h=function(b,d){var f,i;if(b=b[0],b.children){f={};for(i in b)b.hasOwnProperty(i)&&(f[i]=b[i]);f.children=[],a(b.children).each2(function(a,b){h(b,f.children)}),(f.children.length||c.matcher(e,g(f),b))&&d.push(f)}else c.matcher(e,g(b),b)&&d.push(b)},a(d().results).each2(function(a,b){h(b,f.results)}),c.callback(f),b)}}function G(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]};a(d?c():c).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g)}}function H(b,c){if(a.isFunction(b))return!0;if(!b)return!1;throw Error(c+" must be a function or a falsy value")}function I(b){return a.isFunction(b)?b():b}function J(b){var c=0;return a.each(b,function(a,b){b.children?c+=J(b.children):c++}),c}function K(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||1>e.tokenSeparators.length)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(o(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:b}function L(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>";j=a(document),g=function(){var a=1;return function(){return a++}}(),j.on("mousemove",function(a){i.x=a.pageX,i.y=a.pageY}),d=L(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,h,i,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=u(function(){return c.element.closest("body")}),B(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(I(c.containerCss)),this.container.addClass(I(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(I(c.dropdownCssClass)),this.dropdown.data("select2",this),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.resultsPage=0,this.context=null,this.initContainer(),s(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",f,this.bind(this.highlightUnderEvent)),v(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),y(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),y(a))}),r(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()}),a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||n(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus()},destroy:function(){var a=this.opts.element,c=a.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),c!==b&&(c.container.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:o(a.attr("locked"),"locked")||o(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:b},prepareOpts:function(c){var d,e,f,g,h=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,f){var g,l=this.opts.id;g=function(d,e,i){var j,k,m,n,o,p,q,r,s,t;for(d=c.sortResults(d,e,f),j=0,k=d.length;k>j;j+=1)m=d[j],o=m.disabled===!0,n=!o&&l(m)!==b,p=m.children&&m.children.length>0,q=a("<li></li>"),q.addClass("select2-results-dept-"+i),q.addClass("select2-result"),q.addClass(n?"select2-result-selectable":"select2-result-unselectable"),o&&q.addClass("select2-disabled"),p&&q.addClass("select2-result-with-children"),q.addClass(h.opts.formatResultCssClass(m)),r=a(document.createElement("div")),r.addClass("select2-result-label"),t=c.formatResult(m,r,f,h.opts.escapeMarkup),t!==b&&r.html(t),q.append(r),p&&(s=a("<ul></ul>"),s.addClass("select2-result-sub"),g(m.children,s,i+1),q.append(s)),q.data("select2-data",m),e.append(q)},g(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(f=c.id,c.id=function(a){return a[f]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,i,c={results:[],more:!1},e=a.term;i=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(h.optionToData(b)):b.is("optgroup")&&(d=h.optionToData(b),b.children().each2(function(a,b){i(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){i(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id},c.formatResultCssClass=function(a){return a.css}):"query"in c||("ajax"in c?(g=c.element.data("ajax-url"),g&&g.length>0&&(c.ajax.url=g),c.query=E.call(c.element,c.ajax)):"data"in c?c.query=F(c.data):"tags"in c&&(c.query=G(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(a){return{id:a,text:a}}),c.initSelection===b&&(c.initSelection=function(d,e){var f=[];a(p(d.val(),c.separator)).each(function(){var d=this,e=this,g=c.tags;a.isFunction(g)&&(g=g()),a(g).each(function(){return o(this.id,d)?(e=this.text,!1):b}),f.push({id:d,text:e})}),e(f)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");return c},monitorSource:function(){var c,a=this.opts.element;a.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),c=this.bind(function(){var d,f=a.prop("disabled");f===b&&(f=!1),this.enable(!f);var d=a.prop("readonly");d===b&&(d=!1),this.readonly(d),B(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(I(this.opts.containerCssClass)),B(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(I(this.opts.dropdownCssClass))}),a.on("propertychange.select2 DOMAttrModified.select2",c),this.mutationCallback===b&&(this.mutationCallback=function(a){a.forEach(c)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(a.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){return a===b&&(a=!0),this._enabled===a?!1:(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface(),!0)},readonly:function(a){return a===b&&(a=!1),this._readonly===a?!1:(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var q,r,s,t,b=this.dropdown,c=this.container.offset(),d=this.container.outerHeight(!1),e=this.container.outerWidth(!1),f=b.outerHeight(!1),g=a(window).scrollLeft()+a(window).width(),h=a(window).scrollTop()+a(window).height(),i=c.top+d,j=c.left,l=h>=i+f,m=c.top-f>=this.body().scrollTop(),n=b.outerWidth(!1),o=g>=j+n,p=b.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(t=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),n=b.outerWidth(!1)+(t.scrollHeight===t.clientHeight?0:k.width),n>e?e=n:n=e,o=g>=j+n):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(q=this.body().offset(),i-=q.top,j-=q.left),p?(r=!0,!m&&l&&(r=!1)):(r=!1,!l&&m&&(r=!0)),o||(j=c.left+e-n),r?(i=c.top-f,this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),s=a.extend({top:i,left:j,width:e},I(this.opts.dropdownCss)),b.css(s)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){function i(){return{width:Math.max(document.documentElement.scrollWidth,a(window).width()),height:Math.max(document.documentElement.scrollHeight,a(window).height())}}var f,g,b=this.containerId,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),f=a("#select2-drop-mask"),0==f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body()),f.on("mousedown touchstart click",function(b){var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close(),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),g=i(),f.css(g).show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var h=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){var c=i();a("#select2-drop-mask").css(c),h.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerId,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return I(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var d,e,f,g,h,i,j,c=this.results;if(e=this.highlight(),!(0>e)){if(0==e)return c.scrollTop(0),b;d=this.findHighlightableChoices().find(".select2-result-label"),f=a(d[e]),g=f.offset().top+f.outerHeight(!0),e===d.length-1&&(j=c.find("li.select2-more-results"),j.length>0&&(g=j.offset().top+j.outerHeight(!0))),h=c.offset().top+c.outerHeight(!0),g>h&&c.scrollTop(c.scrollTop()+(g-h)),i=f.offset().top-c.offset().top,0>i&&"none"!=f.css("display")&&c.scrollTop(c.scrollTop()+i)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&c.length>d;){d+=b;var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(c){var e,f,d=this.findHighlightableChoices();return 0===arguments.length?m(d.filter(".select2-highlighted")[0],d.get()):(c>=d.length&&(c=d.length-1),0>c&&(c=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),e=a(d[c]),e.addClass("select2-highlighted"),this.ensureHighlightVisible(),f=e.data("select2-data"),f&&this.opts.element.trigger({type:"select2-highlight",val:this.id(f),choice:f}),b)},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),e=this.resultsPage+1,f=this,g=this.search.val(),h=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),this.opts.loadMorePadding>=c&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:g,page:e,context:h,matcher:this.opts.matcher,callback:this.bind(function(c){f.opened()&&(f.opts.populateResults.call(this,a,c.results,{term:g,page:e,context:h}),f.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).text(f.opts.formatLoadMore(e+1)),window.setTimeout(function(){f.loadMoreIfNeeded()},10)):b.remove(),f.positionDropdown(),f.resultsPage=e,f.context=c.context)})})))},tokenize:function(){},updateResults:function(c){function l(){d.removeClass("select2-active"),h.positionDropdown()}function m(a){e.html(a),l()}var g,i,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!o(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){var n=this.getMaximumSelectionSize();if(n>=1&&(g=this.data(),a.isArray(g)&&g.length>=n&&H(f.formatSelectionTooBig,"formatSelectionTooBig")))return m("<li class='select2-selection-limit'>"+f.formatSelectionTooBig(n)+"</li>"),b;if(d.val().length<f.minimumInputLength)return H(f.formatInputTooShort,"formatInputTooShort")?m("<li class='select2-no-results'>"+f.formatInputTooShort(d.val(),f.minimumInputLength)+"</li>"):m(""),c&&this.showSearch&&this.showSearch(!0),b;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return H(f.formatInputTooLong,"formatInputTooLong")?m("<li class='select2-no-results'>"+f.formatInputTooLong(d.val(),f.maximumInputLength)+"</li>"):m(""),b;f.formatSearching&&0===this.findHighlightableChoices().length&&m("<li class='select2-searching'>"+f.formatSearching()+"</li>"),d.addClass("select2-active"),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;return this.opened()?(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return o(h.id(this),h.id(i))}).length&&g.results.unshift(i)),0===g.results.length&&H(f.formatNoMatches,"formatNoMatches")?(m("<li class='select2-no-results'>"+f.formatNoMatches(d.val())+"</li>"),b):(e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&H(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+h.opts.escapeMarkup(f.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),l(),this.opts.element.trigger({type:"select2-loaded",items:g}),b)):(this.search.removeClass("select2-active"),b)})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){w(this.search)},selectHighlighted:function(a){var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var a=this.select.children().first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&a||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.text()&&""===a.val())return a}},initContainerWidth:function(){function c(){var c,d,e,f,g;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(e=d[f].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),e=L(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow'><b></b></span>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' aria-label='Type a topic'/>","   </div>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var b,c,d;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),b=this.search.get(0),b.createTextRange?(c=b.createTextRange(),c.collapse(!1),c.select()):b.setSelectionRange&&(d=this.search.val().length,b.setSelectionRange(d,d)),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var d,e=this.container,f=this.dropdown;0>this.opts.minimumResultsForSearch?this.showSearch(!1):this.showSearch(!0),this.selection=d=e.find(".select2-choice"),this.focusser=e.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+g()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){if(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)return y(a),b;switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),y(a),b;case c.ENTER:return this.selectHighlighted(),y(a),b;case c.TAB:return this.selectHighlighted({noFocus:!0}),b;case c.ESC:return this.cancel(a),y(a),b}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.ESC){if(this.opts.openOnEnter===!1&&a.which===c.ENTER)return y(a),b;if(a.which==c.DOWN||a.which==c.UP||a.which==c.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),y(a),b}return a.which==c.DELETE||a.which==c.BACKSPACE?(this.opts.allowClear&&this.clear(),y(a),b):b}})),r(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),d.on("mousedown","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),z(a),this.close(),this.selection.focus())})),d.on("mousedown",this.bind(function(b){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),y(b)})),f.on("mousedown",this.bind(function(){this.search.focus()})),d.on("focus",this.bind(function(a){y(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(a){var b=this.selection.data("select2-data");if(b){var c=this.getPlaceholderOption();this.opts.element.val(c?c.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),a!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(b),choice:b}),this.triggerChange({removed:b}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection([]),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var a;return(a=this.getPlaceholderOption())!==b&&a.is(":selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find(":selected");b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=o(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,c,d){var e=0,f=this;if(this.findHighlightableChoices().each2(function(a,c){return o(f.id(c.data("select2-data")),f.opts.element.val())?(e=a,!1):b}),d!==!1&&(c===!0&&e>=0?this.highlight(e):this.highlight(0)),c===!0){var h=this.opts.minimumResultsForSearch;h>=0&&this.showSearch(J(a.results)>=h)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.close(),b&&b.noFocus||this.selection.focus(),o(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),d=this.opts.formatSelection(a,c,this.opts.escapeMarkup),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find(":selected").each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),b;if(this.opts.initSelection===b)throw Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a,c){var d;return 0===arguments.length?(d=this.selection.data("select2-data"),d==b&&(d=null),d):(a&&""!==a?(d=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),c&&this.triggerChange({added:a,removed:d})):this.clear(c),b)}}),f=L(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <input type='text' autocomplete='off' autocorrect='off' autocapitilize='off' spellcheck='false' class='select2-input' aria-label='Type a topic'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find(":selected").each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=p(c.val(),b.separator),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return o(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;e.length>c;c++)for(var g=e[c],h=0;f.length>h;h++){var i=f[h];if(o(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},initContainer:function(){var e,d=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=e=this.container.find(d);var f=this;this.selection.on("mousedown",".select2-search-choice",function(){f.search[0].focus(),f.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+g()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var d=e.find(".select2-search-choice-focus"),f=d.prev(".select2-search-choice:not(.select2-locked)"),g=d.next(".select2-search-choice:not(.select2-locked)"),h=x(this.search);if(d.length&&(a.which==c.LEFT||a.which==c.RIGHT||a.which==c.BACKSPACE||a.which==c.DELETE||a.which==c.ENTER)){var i=d;return a.which==c.LEFT&&f.length?i=f:a.which==c.RIGHT?i=g.length?g:null:a.which===c.BACKSPACE?(this.unselect(d.first()),this.search.width(10),i=f.length?f:g):a.which==c.DELETE?(this.unselect(d.first()),this.search.width(10),i=g.length?g:null):a.which==c.ENTER&&(i=null),this.selectChoice(i),y(a),i&&i.length||this.open(),b}if((a.which===c.BACKSPACE&&1==this.keydowns||a.which==c.LEFT)&&0==h.offset&&!h.length)return this.selectChoice(e.find(".select2-search-choice:not(.select2-locked)").last()),y(a),b;if(this.selectChoice(null),this.opened())switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),y(a),b;case c.ENTER:return this.selectHighlighted(),y(a),b;case c.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),b;case c.ESC:return this.cancel(a),y(a),b}if(a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.BACKSPACE&&a.which!==c.ESC){if(a.which===c.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)&&y(a),a.which===c.ENTER&&y(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",d,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",d,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){0>m(e.id(this),c)&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,b){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),b&&b.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice' tabindex='0'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith("<div>"+j+"</div>"),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",y).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),y(b))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(a){var c,d,b=this.getVal();if(a=a.closest(".select2-search-choice"),0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";c=a.data("select2-data"),c&&(d=m(this.id(c),b),d>=0&&(b.splice(d,1),this.setVal(b),this.select&&this.postprocessResults()),a.remove(),this.opts.element.trigger({type:"removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));m(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&H(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+g.opts.formatNoMatches(g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-q(this.search)},resizeSearch:function(){var a,b,c,d,e,f=q(this.search);a=A(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(e)},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),p(a,this.opts.separator))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){0>m(this,c)&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;b.length>c;c++)for(var d=0;a.length>d;d++)o(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),b;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(this.buildChangeDetails(e,this.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(c,d){var f,g,e=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(g=this.data(),c||(c=[]),f=a.map(c,function(a){return e.opts.id(a)}),this.setVal(f),this.updateSelection(c),this.clearSearch(),d&&this.triggerChange(this.buildChangeDetails(g,this.data())),b)}}),a.fn.select2=function(){var d,g,h,i,j,c=Array.prototype.slice.call(arguments,0),k=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","readonly","positionDropdown","data","search"],l=["val","opened","isFocused","container","data"],n={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?j=d.element.prop("multiple"):(j=d.multiple||!1,"tags"in d&&(d.multiple=j=!0)),g=j?new f:new e,g.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(0>m(c[0],k))throw"Unknown method: "+c[0];if(i=b,g=a(this).data("select2"),g===b)return;if(h=c[0],"container"===h?i=g.container:"dropdown"===h?i=g.dropdown:(n[h]&&(h=n[h]),i=g[h].apply(g,c.slice(1))),m(c[0],l)>=0)return!1}}),i===b?this:i},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return C(a.text,c.term,e,d),e.join("")},formatSelection:function(a,c,d){return a?d(a.text):b},sortResults:function(a){return a},formatResultCssClass:function(){return b},formatSelectionCssClass:function(){return b},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return(""+b).toUpperCase().indexOf((""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:K,escapeMarkup:D,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null}},a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:E,local:F,tags:G},util:{debounce:t,markMatch:C,escapeMarkup:D},"class":{"abstract":d,single:e,multi:f}}}}(jQuery);(function($){$.expander={version:'1.4.5',defaults:{slicePoint:100,preserveWords:true,widow:4,expandText:'read more',expandPrefix:'&hellip; ',expandAfterSummary:false,summaryClass:'summary',detailClass:'details',moreClass:'read-more',lessClass:'read-less',collapseTimer:0,expandEffect:'slideDown',expandSpeed:250,collapseEffect:'slideUp',collapseSpeed:200,userCollapse:true,userCollapseText:'read less',userCollapsePrefix:' ',onSlice:null,beforeExpand:null,afterExpand:null,onCollapse:null,afterCollapse:null}};$.fn.expander=function(options){var meth='init';if(typeof options=='string'){meth=options;options={};}
var opts=$.extend({},$.expander.defaults,options),rSelfClose=/^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i,rAmpWordEnd=opts.wordEnd||/(&(?:[^;]+;)?|[a-zA-Z\u00C0-\u0100]+)$/,rOpenCloseTag=/<\/?(\w+)[^>]*>/g,rOpenTag=/<(\w+)[^>]*>/g,rCloseTag=/<\/(\w+)>/g,rLastCloseTag=/(<\/[^>]+>)\s*$/,rTagPlus=/^(<[^>]+>)+.?/,delayedCollapse;var methods={init:function(){this.each(function(){var i,l,tmp,newChar,summTagless,summOpens,summCloses,lastCloseTag,detailText,detailTagless,html,expand,$thisDetails,$readMore,openTagsForDetails=[],closeTagsForsummaryText=[],defined={},thisEl=this,$this=$(this),$summEl=$([]),o=$.extend({},opts,$this.data('expander')||$.meta&&$this.data()||{}),hasDetails=!!$this.find('.'+o.detailClass).length,hasBlocks=!!$this.find('*').filter(function(){var display=$(this).css('display');return(/^block|table|list/).test(display);}).length,el=hasBlocks?'div':'span',detailSelector=el+'.'+o.detailClass,moreClass=o.moreClass+'',lessClass=o.lessClass+'',expandSpeed=o.expandSpeed||0,allHtml=$.trim($this.html()),allText=$.trim($this.text()),summaryText=allHtml.slice(0,o.slicePoint);o.moreSelector='span.'+moreClass.split(' ').join('.');o.lessSelector='span.'+lessClass.split(' ').join('.');if($.data(this,'expanderInit')){return;}
$.data(this,'expanderInit',true);$.data(this,'expander',o);$.each(['onSlice','beforeExpand','afterExpand','onCollapse','afterCollapse'],function(index,val){defined[val]=$.isFunction(o[val]);});summaryText=backup(summaryText);summTagless=summaryText.replace(rOpenCloseTag,'').length;while(summTagless<o.slicePoint){newChar=allHtml.charAt(summaryText.length);if(newChar=='<'){newChar=allHtml.slice(summaryText.length).match(rTagPlus)[0];}
summaryText+=newChar;summTagless++;}
summaryText=backup(summaryText,o.preserveWords);summOpens=summaryText.match(rOpenTag)||[];summCloses=summaryText.match(rCloseTag)||[];tmp=[];$.each(summOpens,function(index,val){if(!rSelfClose.test(val)){tmp.push(val);}});summOpens=tmp;l=summCloses.length;for(i=0;i<l;i++){summCloses[i]=summCloses[i].replace(rCloseTag,'$1');}
$.each(summOpens,function(index,val){var thisTagName=val.replace(rOpenTag,'$1');var closePosition=$.inArray(thisTagName,summCloses);if(closePosition===-1){openTagsForDetails.push(val);closeTagsForsummaryText.push('</'+thisTagName+'>');}else{summCloses.splice(closePosition,1);}});closeTagsForsummaryText.reverse();if(!hasDetails){detailText=allHtml.slice(summaryText.length);detailTagless=$.trim(detailText.replace(rOpenCloseTag,''));if(detailTagless===''||detailTagless.split(/\s+/).length<o.widow){return;}
lastCloseTag=closeTagsForsummaryText.pop()||'';summaryText+=closeTagsForsummaryText.join('');detailText=openTagsForDetails.join('')+detailText;}else{detailText=$this.find(detailSelector).remove().html();summaryText=$this.html();allHtml=summaryText+detailText;lastCloseTag='';}
o.moreLabel=$this.find(o.moreSelector).length?'':buildMoreLabel(o);if(hasBlocks){detailText=allHtml;}
summaryText+=lastCloseTag;o.summary=summaryText;o.details=detailText;o.lastCloseTag=lastCloseTag;if(defined.onSlice){tmp=o.onSlice.call(thisEl,o);o=tmp&&tmp.details?tmp:o;}
html=buildHTML(o,hasBlocks);$this.html(html);$thisDetails=$this.find(detailSelector);$readMore=$this.find(o.moreSelector);if(o.collapseEffect==='slideUp'&&o.expandEffect!=='slideDown'||$this.is(':hidden')){$thisDetails.css({display:'none'});}else{$thisDetails[o.collapseEffect](0);}
$summEl=$this.find('div.'+o.summaryClass);expand=function(event){event.preventDefault();$readMore.hide();$summEl.hide();if(defined.beforeExpand){o.beforeExpand.call(thisEl);}
$thisDetails.stop(false,true)[o.expandEffect](expandSpeed,function(){$thisDetails.css({zoom:''});if(defined.afterExpand){o.afterExpand.call(thisEl);}
delayCollapse(o,$thisDetails,thisEl);});};$readMore.find('a').unbind('click.expander').bind('click.expander',expand);if(o.userCollapse&&!$this.find(o.lessSelector).length){$this.find(detailSelector).append('<span class="'+o.lessClass+'">'+o.userCollapsePrefix+'<a href="#">'+o.userCollapseText+'</a></span>');}
$this.find(o.lessSelector+' a').unbind('click.expander').bind('click.expander',function(event){event.preventDefault();clearTimeout(delayedCollapse);var $detailsCollapsed=$(this).closest(detailSelector);reCollapse(o,$detailsCollapsed);if(defined.onCollapse){o.onCollapse.call(thisEl,true);}});});},destroy:function(){this.each(function(){var o,details,$this=$(this);if(!$this.data('expanderInit')){return;}
o=$.extend({},$this.data('expander')||{},opts),details=$this.find('.'+o.detailClass).contents();$this.removeData('expanderInit');$this.removeData('expander');$this.find(o.moreSelector).remove();$this.find('.'+o.summaryClass).remove();$this.find('.'+o.detailClass).after(details).remove();$this.find(o.lessSelector).remove();});}};if(methods[meth]){methods[meth].call(this);}
function buildHTML(o,blocks){var el='span',summary=o.summary;if(blocks){el='div';if(rLastCloseTag.test(summary)&&!o.expandAfterSummary){summary=summary.replace(rLastCloseTag,o.moreLabel+'$1');}else{summary+=o.moreLabel;}
summary='<div class="'+o.summaryClass+'">'+summary+'</div>';}else{summary+=o.moreLabel;}
return[summary,'<',el+' class="'+o.detailClass+'"','>',o.details,'</'+el+'>'].join('');}
function buildMoreLabel(o){var ret='<span class="'+o.moreClass+'">'+o.expandPrefix;ret+='<a href="#">'+o.expandText+'</a></span>';return ret;}
function backup(txt,preserveWords){if(txt.lastIndexOf('<')>txt.lastIndexOf('>')){txt=txt.slice(0,txt.lastIndexOf('<'));}
if(preserveWords){txt=txt.replace(rAmpWordEnd,'');}
return $.trim(txt);}
function reCollapse(o,el){el.stop(true,true)[o.collapseEffect](o.collapseSpeed,function(){var prevMore=el.prev('span.'+o.moreClass).show();if(!prevMore.length){el.parent().children('div.'+o.summaryClass).show().find('span.'+o.moreClass).show();}
if(o.afterCollapse){o.afterCollapse.call(el);}});}
function delayCollapse(option,$collapseEl,thisEl){if(option.collapseTimer){delayedCollapse=setTimeout(function(){reCollapse(option,$collapseEl);if($.isFunction(option.onCollapse)){option.onCollapse.call(thisEl,false);}},option.collapseTimer);}}
return this;};$.fn.expander.defaults=$.expander.defaults;})(jQuery);function createTopicPopOver(el){var $cur=$(el);$(el).qtip({style:{classes:'qtip-bootstrap topic'},content:{text:'<i class="icon-spinner icon-spin icon-2x"></i>',ajax:{url:pageContext.url.viewTopicJSON.replace("%7Btopic%7D",$(el).attr("nodeId")),cache:false,type:'GET',dataType:'json',success:function(data){data.result.topic.icon=pageContext.url.topicIcon.replace("%7Btopic%7D",data.result.topic.id);data.result.topic.url=pageContext.url.topic.replace("%7Btopic%7D",data.result.topic.name);this.set('content.text',commandUtils.renderTemplate("topic-popover",data.result));commandUtils.initializeLabels();$cur.removeAttr("title");$cur.find("img").removeAttr("title");}}},hide:{delay:200,fixed:true},position:{viewport:$(window),adjust:{method:'shift flip'},corner:{target:'center'}},show:{delay:500,event:"mouseenter focusin"}});}
function createAwardPopOver(el){var $cur=$(el);$(el).qtip({style:{classes:'qtip-bootstrap award'},content:{text:'<i class="icon-spinner icon-spin icon-2x"></i>',ajax:{url:pageContext.url.awardListUrl.replace("%7BawardType%7D",$(el).attr("awardType")).replace("%7Bdesc%7D",$(el).attr("desc")).concat("?pageSize=5"),cache:false,type:'GET',dataType:'json',success:function(data){data.awardType.awardIconSrc=$cur.attr("awardIconSrc");data.awardType.awardUrl=pageContext.url.awardListUrl.replace("%7BawardType%7D",$cur.attr("awardType")).replace("%7Bdesc%7D",$(el).attr("desc")).replace("json","html")
for(i in data.awardPager.list){data.awardPager.list[i].user={};data.awardPager.list[i].user.profileUrl=pageContext.url.profile.replace("{id}",data.awardPager.list[i].userid).replace("{plug}",data.awardPager.list[i].userplug);data.awardPager.list[i].user.username=data.awardPager.list[i].username;data.awardPager.list[i].user.avatar=pageContext.url.userAvatar.replace("%7BuserId%7D",data.awardPager.list[i].userid);_data=data;}
this.set('content.text',commandUtils.renderTemplate("badge-popover",data));}}},hide:{delay:200,fixed:true},position:{viewport:$(window),adjust:{method:'flip flip'},corner:{target:'center'}},show:{delay:500,event:"mouseenter focusin"}});}
function createUserPopOver(el){var $cur=$(el);$(el).qtip({style:{classes:'qtip-bootstrap user'},content:{text:'<i class="icon-spinner icon-spin icon-2x"></i>',ajax:{url:pageContext.url.condensedProfileUrl.replace("%7Buser%7D",$(el).attr("nodeId")),cache:false,type:'GET',dataType:'json',success:function(data){data.profileUser.displayName=(pageContext.userRealName&&data.profileUser.realname)?data.profileUser.realname:data.profileUser.username;data.profileUser.profileUrl=pageContext.url.profile.replace('{id}',data.profileUser.id).replace('{plug}',data.profileUser.plug);data.profileUser.creationDateObj=new Date(data.profileUser.creationDate);this.set('content.text',commandUtils.renderTemplate("user-popover",data));commandUtils.initializeLabels();$cur.removeAttr("title");$cur.find("img").removeAttr("title");}}},hide:{delay:200,fixed:true},position:{viewport:$(window),adjust:{method:'shift flip'},corner:{target:'center'}},show:{delay:500,event:"mouseenter focusin"}});}
$(function(){$(document).ready(function(){$("[rel=user]").each(function(){createUserPopOver($(this));});$("[rel=award]").each(function(){createAwardPopOver($(this));});$("[rel=topic]").each(function(){createTopicPopOver($(this));});});});(function(d,f,g,b){var e="tooltipster",c={animation:"fade",arrow:true,arrowColor:"",content:"",delay:200,fixedWidth:0,functionBefore:function(k,l){l()},functionAfter:function(k){},icon:"(?)",iconTheme:".tooltipster-icon",iconDesktop:false,iconTouch:false,interactive:false,interactiveTolerance:350,offsetX:0,offsetY:0,onlyOne:true,position:"top",speed:350,timer:0,theme:".tooltipster-default",touchDevices:true,trigger:"hover"};function h(l,k){this.element=l;this.options=d.extend({},c,k);this._defaults=c;this._name=e;this.init()}function i(){return!!("ontouchstart"in f)}function a(){var k=g.body||g.documentElement;var m=k.style;var n="transition";if(typeof m[n]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],n=n.charAt(0).toUpperCase()+n.substr(1);for(var l=0;l<v.length;l++){if(typeof m[v[l]+n]=="string"){return true}}return false}var j=true;if(!a()){j=false}h.prototype={init:function(){var p=d(this.element);var l=this;var o=true;if((l.options.touchDevices==false)&&(i())){o=false}if(g.all&&!g.querySelector){o=false}if(o==true){if((this.options.iconDesktop==true)&&(!i())||((this.options.iconTouch==true)&&(i()))){var k=p.attr("title");p.removeAttr("title");var n=l.options.iconTheme;var m=d('<span class="'+n.replace(".","")+'" title="'+k+'">'+this.options.icon+"</span>");m.insertAfter(p);p.data("tooltipsterIcon",m);p=m}var q=p.attr("title");p.data("tooltipsterContent",q);p.removeAttr("title");if((this.options.touchDevices==true)&&(i())){p.bind("touchstart",function(s,r){l.showTooltip()})}else{if(this.options.trigger=="hover"){p.mouseenter(function(){l.showTooltip()});if(this.options.interactive==true){p.mouseleave(function(){var s=p.data("tooltipster");var t=false;if((s!==b)&&(s!=="")){s.mouseenter(function(){t=true});s.mouseleave(function(){t=false});var r=setTimeout(function(){if(t==true){s.mouseleave(function(){l.hideTooltip()})}else{l.hideTooltip()}},l.options.interactiveTolerance)}else{l.hideTooltip()}})}else{p.mouseleave(function(){l.hideTooltip()})}}if(this.options.trigger=="click"){p.click(function(){if((p.data("tooltipster")=="")||(p.data("tooltipster")==b)){l.showTooltip()}else{l.hideTooltip()}})}}}},showTooltip:function(l){var m=d(this.element);var k=this;if(m.data("tooltipsterIcon")!==b){m=m.data("tooltipsterIcon")}if((d(".tooltipster-base").not(".tooltipster-dying").length>0)&&(k.options.onlyOne==true)){d(".tooltipster-base").not(".tooltipster-dying").each(function(){if(m.data("tooltipster")!==d(this)){d(this).addClass("tooltipster-kill");var n=d(this).data("origin");n.data("plugin_tooltipster").hideTooltip()}})}m.clearQueue().delay(k.options.delay).queue(function(){k.options.functionBefore(m,function(){if((m.data("tooltipster")!==b)&&(m.data("tooltipster")!=="")){var E=m.data("tooltipster");if(!E.hasClass("tooltipster-kill")){var O="tooltipster-"+k.options.animation;E.removeClass("tooltipster-dying");if(j==true){E.clearQueue().addClass(O+"-show")}if(k.options.timer>0){var z=E.data("tooltipsterTimer");clearTimeout(z);z=setTimeout(function(){E.data("tooltipsterTimer",b);k.hideTooltip()},k.options.timer);E.data("tooltipsterTimer",z)}if((k.options.touchDevices==true)&&(i())){d("body").bind("touchstart",function(X){if(k.options.interactive==true){var Z=d(X.target);var Y=true;Z.parents().each(function(){if(d(this).hasClass("tooltipster-base")){Y=false}});if(Y==true){k.hideTooltip();d("body").unbind("touchstart")}}else{k.hideTooltip();d("body").unbind("touchstart")}})}}}else{d("body").css("overflow-x","hidden");var I=m.data("tooltipsterContent");if(d.trim(k.options.content).length>0){I=k.options.content}var Q=k.options.theme;var W=Q.replace(".","");var O="tooltipster-"+k.options.animation;var S="-webkit-transition-duration: "+k.options.speed+"ms; -webkit-animation-duration: "+k.options.speed+"ms; -moz-transition-duration: "+k.options.speed+"ms; -moz-animation-duration: "+k.options.speed+"ms; -o-transition-duration: "+k.options.speed+"ms; -o-animation-duration: "+k.options.speed+"ms; -ms-transition-duration: "+k.options.speed+"ms; -ms-animation-duration: "+k.options.speed+"ms; transition-duration: "+k.options.speed+"ms; animation-duration: "+k.options.speed+"ms;";var L=k.options.fixedWidth>0?"width:"+k.options.fixedWidth+"px;":"";var A=k.options.interactive==true?"pointer-events: auto;":"";var E=d('<div class="tooltipster-base '+W+" "+O+'" style="'+L+" "+A+" "+S+'"><div class="tooltipster-content">'+I+"</div></div>");E.appendTo("body");m.data("tooltipster",E);E.data("origin",m);var U=d(f).width();var y=m.outerWidth(false);var B=m.outerHeight(false);var M=E.outerWidth(false);var T=E.innerWidth();var D=E.outerHeight(false);var s=m.offset();var r=b;if(k.options.fixedWidth==0){E.css({width:(T+1)+"px","padding-left":"0px","padding-right":"0px"})}function H(){var Y=d(f).scrollLeft();if((x-Y)<0){var X=x-Y;x=Y;E.data("arrow-reposition",X)}if(((x+M)-Y)>U){var X=x-((U+Y)-M);x=(U+Y)-M;E.data("arrow-reposition",X)}}function t(Y,X){if((s.top-d(f).scrollTop()-D-k.options.offsetY-11)<0){k.options.position=Y;r=X}}if(k.options.position=="top"){var G=(s.left+M)-(s.left+m.outerWidth(false));var x=(s.left+k.options.offsetX)-(G/2);var p=(s.top-D)-k.options.offsetY-12;H();t("bottom","top")}if(k.options.position=="top-left"){var x=s.left+k.options.offsetX;var p=(s.top-D)-k.options.offsetY-12;H();t("bottom-left","top-left")}if(k.options.position=="top-right"){var x=(s.left+y+k.options.offsetX)-M;var p=(s.top-D)-k.options.offsetY-12;H();t("bottom-right","top-right")}if(k.options.position=="bottom"){var G=(s.left+M)-(s.left+m.outerWidth(false));var x=s.left-(G/2)+k.options.offsetX;var p=(s.top+B)+k.options.offsetY+12;H()}if(k.options.position=="bottom-left"){var x=s.left+k.options.offsetX;var p=(s.top+B)+k.options.offsetY+12;H()}if(k.options.position=="bottom-right"){var x=(s.left+y+k.options.offsetX)-M;var p=(s.top+B)+k.options.offsetY+12;H()}if(k.options.position=="left"){var x=s.left-k.options.offsetX-M-12;var R=s.left+k.options.offsetX+y+12;var u=(s.top+D)-(s.top+m.outerHeight(false));var p=s.top-(u/2)-k.options.offsetY;if((x<0)&&((R+M)>U)){var V=parseFloat(E.css("border-width"))*2;var w=(M+x)-V;E.css("width",w+"px");D=E.outerHeight(false);x=s.left-k.options.offsetX-w-12-V;u=(s.top+D)-(s.top+m.outerHeight(false));p=s.top-(u/2)-k.options.offsetY}else{if(x<0){var x=s.left+k.options.offsetX+y+12;E.data("arrow-reposition","left")}}}if(k.options.position=="right"){var x=s.left+k.options.offsetX+y+12;var R=s.left-k.options.offsetX-M-12;var u=(s.top+D)-(s.top+m.outerHeight(false));var p=s.top-(u/2)-k.options.offsetY;if(((x+M)>U)&&(R<0)){var V=parseFloat(E.css("border-width"))*2;var w=(U-x)-V;E.css("width",w+"px");D=E.outerHeight(false);u=(s.top+D)-(s.top+m.outerHeight(false));p=s.top-(u/2)-k.options.offsetY}else{if((x+M)>U){x=s.left-k.options.offsetX-M-12;E.data("arrow-reposition","right")}}}if(k.options.arrow==true){var F="tooltipster-arrow-"+k.options.position;if(k.options.arrowColor.length<1){var P=E.css("background-color")}else{var P=k.options.arrowColor}var n=E.data("arrow-reposition");if(!n){n=""}else{if(n=="left"){F="tooltipster-arrow-right";n=""}else{if(n=="right"){F="tooltipster-arrow-left";n=""}else{n="left:"+n+"px;"}}}if((k.options.position=="top")||(k.options.position=="top-left")||(k.options.position=="top-right")){var J=parseFloat(E.css("border-bottom-width"));var N=E.css("border-bottom-color")}else{if((k.options.position=="bottom")||(k.options.position=="bottom-left")||(k.options.position=="bottom-right")){var J=parseFloat(E.css("border-top-width"));var N=E.css("border-top-color")}else{if(k.options.position=="left"){var J=parseFloat(E.css("border-right-width"));var N=E.css("border-right-color")}else{if(k.options.position=="right"){var J=parseFloat(E.css("border-left-width"));var N=E.css("border-left-color")}else{var J=parseFloat(E.css("border-bottom-width"));var N=E.css("border-bottom-color")}}}}if(J>1){J++}var o="";if(J!==0){var K="";var q="border-color: "+N+";";if(F.indexOf("bottom")!==-1){K="margin-top: -"+J+"px;"}else{if(F.indexOf("top")!==-1){K="margin-bottom: -"+J+"px;"}else{if(F.indexOf("left")!==-1){K="margin-right: -"+J+"px;"}else{if(F.indexOf("right")!==-1){K="margin-left: -"+J+"px;"}}}}o='<span class="tooltipster-arrow-border" style="'+K+" "+q+';"></span>'}var C='<div class="'+F+' tooltipster-arrow" style="'+n+'">'+o+'<span style="border-color:'+P+';"></span></div>'}else{var C=""}E.css({top:p+"px",left:x+"px"}).append(C);if(j==true){E.addClass(O+"-show")}else{E.css("display","none").removeClass(O).fadeIn(k.options.speed)}if(k.options.timer>0){var z=setTimeout(function(){E.data("tooltipsterTimer",b);k.hideTooltip()},k.options.timer+k.options.speed);E.data("tooltipsterTimer",z)}if((k.options.touchDevices==true)&&(i())){d("body").bind("touchstart",function(X){if(k.options.interactive==true){var Z=d(X.target);var Y=true;Z.parents().each(function(){if(d(this).hasClass("tooltipster-base")){Y=false}});if(Y==true){k.hideTooltip();d("body").unbind("touchstart")}}else{k.hideTooltip();d("body").unbind("touchstart")}})}E.mouseleave(function(){k.hideTooltip()})}});m.dequeue()})},hideTooltip:function(l){var o=d(this.element);var k=this;if(o.data("tooltipsterIcon")!==b){o=o.data("tooltipsterIcon")}var n=o.data("tooltipster");o.clearQueue();if((n!==b)&&(n!=="")){var p=n.data("tooltipsterTimer");if(p!==b){clearTimeout(p)}var m="tooltipster-"+k.options.animation;if(j==true){n.clearQueue().removeClass(m+"-show").addClass("tooltipster-dying").delay(k.options.speed).queue(function(){n.remove();o.data("tooltipster","");d("body").css("verflow-x","");k.options.functionAfter(o)})}else{n.clearQueue().addClass("tooltipster-dying").fadeOut(k.options.speed,function(){n.remove();o.data("tooltipster","");d("body").css("verflow-x","");k.options.functionAfter(o)})}}}};d.fn[e]=function(k){return this.each(function(){if(!d.data(this,"plugin_"+e)){d.data(this,"plugin_"+e,new h(this,k))}var l=d(this).data("plugin_tooltipster").options;if((l.iconDesktop==true)&&(!i())||((l.iconTouch==true)&&(i()))){var m=d(this).data("plugin_tooltipster");d(this).next().data("plugin_tooltipster",m)}})}})(jQuery,window,document);!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=F,this.elements={target:a},this._id=S+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:E,attr:e,onTooltip:E,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=E}function f(a){return a===F||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?E:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?(c=g(b)?E:b,b=a.content={text:c}):c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==E,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,F,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||E)&&(b.title=E))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===D?{ready:D}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(R,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)if(this.checks.hasOwnProperty(c))for(d in this.checks[c])this.checks[c].hasOwnProperty(d)&&(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return V.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(aa)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(D,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(aa)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(W)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(E,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(aa)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+S+" "))+"."+S,function(){var a=y.api[d.attr(this,U)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):F,p="html5"===f.metadata.type&&o?o[f.metadata.name]:F,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(D,{},y.defaults,f,"object"==typeof q?h(q):F,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===E||!j)return E;k.content.text=j}if(i.container.length||(i.container=m),i.target===E&&(i.target=n),k.show.target===E&&(k.show.target=n),k.show.solo===D&&(k.show.solo=i.container.closest("body")),k.hide.target===E&&(k.hide.target=n),k.position.viewport===D&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new A(i.at,D),i.my=new A(i.my),a.data(S))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===E)return E;return a.attr(T,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(ca,l).attr("title",""),g=new e(a,k,c,!!j),a.data(S,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+va.join(f+" ")+f).split(" "),h=0;if(ua[b])return a.css(ua[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return ua[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.qtip=a,this.init(a)}function w(a,b){this.options=b,this._ns="-modal",this.qtip=a,this.init(a)}function x(a){this._ns="ie6",this.qtip=a,this.init(a)}var y,z,A,B,C,D=!0,E=!1,F=null,G="x",H="y",I="width",J="height",K="top",L="left",M="bottom",N="right",O="center",P="flipinvert",Q="shift",R={},S="qtip",T="data-hasqtip",U="data-qtip-id",V=["ui-widget","ui-tooltip"],W="."+S,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Y=S+"-fixed",Z=S+"-default",$=S+"-focus",_=S+"-hover",aa=S+"-disabled",ba="_replacedByqTip",ca="oldtitle",da={ie:function(){var a,c;for(a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||E};z=e.prototype,z._when=function(a){return d.when.apply(d,a)},z.render=function(a){if(this.rendered||this.destroyed)return this;var b=this,c=this.options,e=this.cache,f=this.elements,g=c.content.text,h=c.content.title,i=c.content.button,j=c.position,k=[];return d.attr(this.target[0],"aria-describedby",this._id),e.posClass=this._createPosClass((this.position={my:j.my,at:j.at}).my),this.tooltip=f.tooltip=d("<div/>",{id:this._id,"class":[S,Z,c.style.classes,e.posClass].join(" "),width:c.style.width||"",height:c.style.height||"",tracking:"mouse"===j.target&&j.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":E,"aria-describedby":this._id+"-content","aria-hidden":D}).toggleClass(aa,this.disabled).attr(U,this.id).data(S,this).appendTo(j.container).append(f.content=d("<div />",{"class":S+"-content",id:this._id+"-content","aria-atomic":D})),this.rendered=-1,this.positioning=D,h&&(this._createTitle(),d.isFunction(h)||k.push(this._updateTitle(h,E))),i&&this._createButton(),d.isFunction(g)||k.push(this._updateContent(g,E)),this.rendered=D,this._setWidget(),d.each(R,function(a){var c;"render"===this.initialize&&(c=this(b))&&(b.plugins[a]=c)}),this._unassignEvents(),this._assignEvents(),this._when(k).then(function(){b._trigger("render"),b.positioning=E,b.hiddenDuringWait||!c.show.ready&&!a||b.toggle(D,e.event,E),b.hiddenDuringWait=E}),y.api[this.id]=this,this},z.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=D;var a,b=this.target,c=b.attr(ca);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)this.timers.hasOwnProperty(a)&&clearTimeout(this.timers[a]);b.removeData(S).removeAttr(U).removeAttr(T).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(ca),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=F,delete y.api[this.id]}}return this.destroyed?this.target:(a===D&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},B=z.checks={builtin:{"^id$":function(a,b,c,e){var f=c===D?y.nextid:c,g=S+"-"+f;f!==E&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new A(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(D)||this.toggle(D))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Z,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},z.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var ea=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,fa=/^prerender|show\.ready/i;z.set=function(a,b){if(this.destroyed)return this;var c,e=this.rendered,f=E,g=this.options;return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&fa.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=ea.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=D,d.each(a,d.proxy(j,this)),this.positioning=E,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?F:this.cache.event),this},z._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=D,a.then(function(a){return e.waiting=E,c._update(a,b)},F,function(a){return c._update(a,b)})):a===E||!a&&""!==a?E:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):E},z._waitForContent=function(a){var b=this.cache;return b.waiting=D,(d.fn.imagesLoaded?a.imagesLoaded():(new d.Deferred).resolve([])).done(function(){b.waiting=E}).promise()},z._updateContent=function(a,b){this._update(a,this.elements.content,b)},z._updateTitle=function(a,b){this._update(a,this.elements.title,b)===E&&this._removeTitle(E)},z._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":S+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":S+"-title","aria-atomic":D})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},z._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=F,a!==E&&this.reposition())},z._createPosClass=function(a){return S+"-pos-"+(a||this.options.position.my).abbrev()},z.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=D;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(E),u=k.outerHeight(E),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:L,y:K},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:L,y:K},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=da.iOS?a.innerWidth:m.width(),w=da.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):R.imagemap&&m.is("area")?f=R.imagemap(this,m,o,R.viewport?s:E):R.svg&&m&&m[0].ownerSVGElement?f=R.svg(this,m,o,R.viewport?s:E):(v=m.outerWidth(E),w=m.outerHeight(E),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(da.iOS>3.1&&da.iOS<4.1||da.iOS>=4.3&&da.iOS<4.33||!da.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==E)&&(y.left+=o.x===N?v:o.x===O?v/2:0,y.top+=o.y===M?w:o.y===O?w/2:0)}return y.left+=r.x+(n.x===N?-t:n.x===O?-t/2:0),y.top+=r.y+(n.y===M?-u:n.y===O?-u/2:0),R.viewport?(h=y.adjusted=R.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&(j.posClass=i,k.removeClass(j.posClass).addClass(i)),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===E||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),da.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=E,this):this},z.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!da.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var ga=(A=z.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?H:G}).prototype;ga.invert=function(a,b){this[a]=this[a]===L?N:this[a]===N?L:b||this[a]},ga.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===H||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},ga.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},ga.clone=function(){return new A(this.string(),this.forceY)},z.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=D),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=this.options.position,n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?F:!!this._trigger(k,[90]),this.destroyed?this:(i!==E&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,E),d.isFunction(n.title)&&this._updateTitle(n.title,E),!C&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+S,this._storeMouse),C=D),o||g.css("width",g.outerWidth(E)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(W,l.solo)).not(g).not(l.target).qtip("hide",new d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,C&&!d(W+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+S),C=E),this.blur(c)),j=d.proxy(function(){a?(da.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===E||q===E?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},z.show=function(a){return this.toggle(D,a)},z.hide=function(a){return this.toggle(E,a)},z.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(W),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=y.zindex+b.length;return c.hasClass($)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+$).qtip("blur",a)),c.addClass($)[0].style.zIndex=f),this},z.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass($),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},z.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(aa):this.disabled):"boolean"!=typeof a&&(a=D),this.rendered&&this.tooltip.toggleClass(aa,a).attr("aria-disabled",a),this.disabled=!!a,this)},z.enable=function(){return this.disable(E)},z._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),e.jquery?b.button=e:b.button=d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":S+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(aa)||a.hide(b),E})},z._updateButton=function(a){if(!this.rendered)return E;var b=this.elements.button;a?this._createButton():b.remove()},z._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(aa);c.removeClass(aa),aa=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(aa,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Z,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(S+"-icon",!a)},z._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},z._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},z._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},z._trigger=function(a,b,c){var e=new d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||F,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=E,!e.isDefaultPrevented()},z._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},z._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?E:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=D}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):E}),(c.show.ready||c.prerender)&&b.call(this,a)},z._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=d(a),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Y)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0,e=b.parents(W).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),y.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):E}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},z._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(W,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Y)&&!c.hasClass(aa)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(_,b)}),q("["+U+"]",X,o)}),y=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=F,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],S):F;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,S);if(!a)return D;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),E;a.set(b,e)}}),g!==F?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(D,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===E||c.length<1||y.api[c]?y.nextid++:c,b=r(d(this),c,k),b===E?D:(y.api[c]=b,d.each(R,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,y.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&f.options&&"object"==typeof f&&"object"==typeof f.options&&f.options.suppress)return arguments.length<2?d.attr(c,ca):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(ca,b))}return d.fn["attr"+ba].apply(this,arguments)},clone:function(a){var b=d.fn["clone"+ba].apply(this,arguments);return a||b.filter("["+ca+"]").attr("title",function(){return d.attr(this,ca)}).removeAttr(ca),b}},function(a,b){if(!b||d.fn[a+ba])return D;var c=d.fn[a+ba]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ba]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(T))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ba].apply(this,arguments)}),y.version="3.0.3",y.nextid=0,y.inactiveEvents=X,y.zindex=15e3,y.defaults={prerender:E,id:E,overwrite:D,suppress:D,content:{text:D,attr:"title",title:E,button:E},position:{my:"top left",at:"bottom right",target:E,container:E,viewport:E,adjust:{x:0,y:0,mouse:D,scroll:D,resize:D,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:E})}},show:{target:E,event:"mouseenter",effect:D,delay:90,solo:E,ready:E,autofocus:E},hide:{target:E,event:"mouseleave",effect:D,delay:0,fixed:E,inactive:E,leave:"window",distance:E},style:{classes:"",widget:E,width:E,height:E,def:D},events:{render:F,move:F,show:F,hide:F,toggle:F,visible:F,hidden:F,focus:F,blur:F}};var ha,ia,ja,ka,la,ma="margin",na="border",oa="color",pa="background-color",qa="transparent",ra=" !important",sa=!!b.createElement("canvas").getContext,ta=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ua={},va=["Webkit","O","Moz","ms"];sa?(ka=a.devicePixelRatio||1,la=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ja=ka/la):ia=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'},d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":S+"-tip"}).prependTo(a.tooltip),sa?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ia("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===K||a.y===O&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(D))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===E||b===E?a=E:a===D?a=new A(b.string()):a.string||(a=new A(a),a.fixed=D),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=na+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=na+s(a.y)+s(a.x)+"Radius";return da.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ta.test(d)?E:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=na+s(a[a.precedance])+s(oa),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,pa)||g(f,pa)||g(b.content,pa)||g(b.tooltip,pa)||c.css(pa),h[1]=g(c,e,oa)||g(f,e,oa)||g(b.content,e,oa)||g(b.tooltip,e,oa)||b.tooltip.css(e),d("*",c).add(c).css("cssText",pa+":"+qa+ra+";"+na+":0"+ra+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===H,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(sa||da.ie)&&this._parseCorner(this.options.corner);return this.enabled=!!this.corner&&"c"!==this.corner.abbrev(),this.enabled&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===E?r=b:(r=new A(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===G?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==qa?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ta.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==D?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===H?[s(r.x===L?l:r.x===N?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===K?k[1]-q[1]:0)]:[s(r.x===L?k[0]-q[0]:0),s(r.y===K?l:r.y===M?k[1]-q[1]-l:(k[1]-q[1])/2)],sa?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ja),i=this._calculateTip(r,this.size,ja),o.attr(I,k[0]*ja).attr(J,k[1]*ja),o.css(I,k[0]).css(J,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ja,j[1]*ja),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===da.ie?2:1:0,o.css({coordsize:k[0]+l+" "+k[1]+l,antialias:""+(r.string().indexOf(O)>-1),left:j[0]-j[2]*Number(f===G),top:j[1]-j[2]*Number(f===H),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+k[1]+l,path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ia("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==E&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return E;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j={};return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===G&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===O?(h=c===H?L:K,j[h]="50%",j[ma+"-"+h]=-Math.round(b[c===H?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===G?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===Q&&j.precedance===b&&k[d]&&j[c]!==O?j.precedance=j.precedance===G?H:G:a!==Q&&k[d]&&(j[b]=j[b]===O?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===O?p[ma+"-"+b]=o[a]=g[ma+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=E),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:E,top:E,x:0,y:0},p={};this.corner.fixed!==D&&(e(m,G,H,L,N),e(n,H,G,K,M),j.string()===i.corner.string()&&i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,E)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,o.left=m===Q&&!!k.left,o.left&&f(G,L,N),o.top=n===Q&&!!k.top,o.top&&f(H,K,M),this.element.css(p).toggle(!(o.x&&o.y||j.x===O&&o.y||j.y===O&&o.x)),d.left-=g.left.charAt?g.user:m!==Q||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==Q||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),ha=R.tip=function(a){return new v(a,a.options.style.tip)},ha.initialize="render",ha.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=D)}},B.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(D,y.defaults,{style:{tip:{corner:D,mimic:E,width:6,height:6,border:D,offset:0}}});var wa,xa,ya="qtip-modal",za="."+ya;xa=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){j.length<1&&a.length?a.not("body").blur():j.first().focus()}function e(a){if(h.is(":visible")){var b,e=d(a.target),g=f.tooltip,i=e.closest(W);b=i.length<1?E:parseInt(i[0].style.zIndex,10)>parseInt(g[0].style.zIndex,10),b||e.closest(W)[0]===g[0]||c(e)}}var f,g,h,i=this,j={};d.extend(i,{init:function(){return h=i.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return E}}).hide(),d(b.body).bind("focusin"+za,e),d(b).bind("keydown"+za,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),h.bind("click"+za,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),i},update:function(b){f=b,j=b.options.show.modal.stealfocus!==E?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,j){var k=a.tooltip,l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=h.is(":visible"),p=d(za).filter(":visible:not(:animated)").not(k);return i.update(a),e&&l.stealfocus!==E&&c(d(":focus")),h.toggleClass("blurs",l.blur),e&&h.appendTo(b.body),h.is(":animated")&&o===e&&g!==E||!e&&p.length?i:(h.stop(D,E),d.isFunction(m)?m.call(h,e):m===E?h[n]():h.fadeTo(parseInt(j,10)||90,e?1:0,function(){e||h.hide()}),e||h.queue(function(a){h.css({left:"",top:""}),d(za).length||h.detach(),a()}),g=e,f.destroyed&&(f=F),i)}}),i.init()},xa=new xa,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=xa.elem,b.addClass(ya).css("z-index",y.modal_zindex+d(za).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(xa.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(za),f=y.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);xa.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+$).qtip("blur",a.originalEvent),b.addClass($)[0].style.zIndex=f,xa.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(za).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void xa.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(ya),this.qtip._unbind(this.qtip.tooltip,this._ns),xa.toggle(this.qtip,E),delete this.qtip.elements.overlay}}),wa=R.modal=function(a){return new w(a,a.options.show.modal)},wa.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=D))},y.modal_zindex=y.zindex-200,wa.initialize="render",B.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(D,y.defaults,{show:{modal:{on:E,effect:D,blur:D,stealfocus:D,escape:D}}}),R.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===Q,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===I?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===O?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===I?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===P?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===O?-C:C)+e,l.invert(a,g)),d[f]<q[f]&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C={left:0,top:0};return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(E),p=A[0]===a?A.height():A.outerHeight(E),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,"shift"===y&&"shift"===z||(l=u.clone()),C={left:"none"!==y?j(G,H,y,w.x,L,N,I,f,h):0,top:"none"!==z?j(H,G,z,w.y,K,M,J,g,i):0,my:l}):C},R.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:E},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===L?i=d:b.x===N?i=f.width-d:i+=Math.floor(d/2),b.y===K?j=e:b.y===M?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===L&&k>=i||b.x===N&&i>=k||b.x===O&&(i>k||k>f.width-i)||b.y===K&&l>=j||b.y===M&&j>=l||b.y===O&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=R.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:E}},circle:function(a,b,c,d){return R.polys.ellipse(a,b,c,c,d)}},R.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o=c[0],p=d(o.ownerSVGElement),q=o.ownerDocument,r=(parseInt(c.css("stroke-width"),10)||0)/2;!o.getBBox;)o=o.parentNode;if(!o.getBBox||!o.parentNode)return E;switch(o.nodeName){case"ellipse":case"circle":m=R.polys.ellipse(o.cx.baseVal.value,o.cy.baseVal.value,(o.rx||o.r).baseVal.value+r,(o.ry||o.r).baseVal.value+r,e);break;case"line":case"polygon":case"polyline":for(l=o.points||[{x:o.x1.baseVal.value,y:o.y1.baseVal.value},{x:o.x2.baseVal.value,y:o.y2.baseVal.value}],m=[],k=-1,i=l.numberOfItems||l.length;++k<i;)j=l.getItem?l.getItem(k):l[k],m.push.apply(m,[j.x,j.y]);m=R.polys.polygon(m,e);break;default:m=o.getBBox(),m={width:m.width,height:m.height,position:{left:m.x,top:m.y}}}return n=m.position,p=p[0],p.createSVGPoint&&(g=o.getScreenCTM(),l=p.createSVGPoint(),l.x=n.left,l.y=n.top,h=l.matrixTransform(g),n.left=h.x,n.top=h.y),q!==b&&"mouse"!==a.position.target&&(f=d((q.defaultView||q.parentWindow).frameElement).offset(),f&&(n.left+=f.left,n.top+=f.top)),q=d(q),n.left+=q.scrollLeft(),n.top+=q.scrollTop(),m},R.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=(b.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return E;if("polygon"===j)h=R.polys.polygon(m,c);else{if(!R.polys[j])return E;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=R.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(E)-k.width())/2),e.top+=Math.ceil((k.outerHeight(E)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Aa,Ba='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(x.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Ba).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:S+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(E),width:c.outerWidth(E)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[I,L]:[J,K],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(J,f.height),f.width?e.css(I,f.width):(e.css(I,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1*parseInt(c,10))||b,d=(d.indexOf("%")>-1?a:1*parseInt(d,10))||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(I,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Aa=R.ie6=function(a){return 6===da.ie?new x(a):E},Aa.initialize="render",B.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);jsmime={};(function(){"use strict";var mimes={"sco":["audio/csound"],"sci":["application/x-scilab"],"sce":["application/x-scilab"],"alc":["chemical/x-alchemy"],"gf":["application/x-tex-gf"],"mp4":["video/mp4"],"mp2":["audio/mpeg"],"mp3":["audio/mpeg"],"nwc":["application/x-nwc"],"sct":["text/scriptlet"],"ros":["chemical/x-rosdal"],"scr":["application/x-silverlight"],"wmz":["application/x-ms-wmz"],"xlsb":["application/vnd.ms-excel.sheet.binary.macroEnabled.12"],"gcd":["text/x-pcs-gcd"],"tr":["application/x-troff"],"ts":["video/MP2T"],"tm":["text/texmacs"],"tk":["text/x-tcl"],"wml":["text/vnd.wap.wml"],"wma":["audio/x-ms-wma"],"fchk":["chemical/x-gaussian-checkpoint"],"wmd":["application/x-ms-wmd"],"mpg":["video/mpeg"],"cascii":["chemical/x-cactvs-binary"],"mpe":["video/mpeg"],"smi":["application/smil","chemical/x-daylight-smiles"],"mph":["application/x-comsol"],"mpv":["video/x-matroska"],"wsc":["text/scriptlet"],"cml":["chemical/x-cml"],"dif":["video/dv"],"thmx":["application/vnd.ms-officetheme"],"p":["text/x-pascal"],"pbm":["image/x-portable-bitmap"],"dir":["application/x-director"],"htc":["text/x-component"],"hta":["application/hta"],"odp":["application/vnd.oasis.opendocument.presentation"],"htm":["text/html"],"nbp":["application/mathematica"],"odt":["application/vnd.oasis.opendocument.text"],"tex":["text/x-tex"],"odi":["application/vnd.oasis.opendocument.image"],"odm":["application/vnd.oasis.opendocument.text-master"],"oda":["application/oda"],"odb":["application/vnd.oasis.opendocument.database"],"odc":["application/vnd.oasis.opendocument.chart"],"odf":["application/vnd.oasis.opendocument.formula"],"odg":["application/vnd.oasis.opendocument.graphics"],"gl":["video/gl"],"nef":["image/x-nikon-nef"],"rtx":["text/richtext"],"abw":["application/x-abiword"],"mng":["video/x-mng"],"cr2":["image/x-canon-cr2"],"oza":["application/x-oz-application"],"wmx":["video/x-ms-wmx"],"asc":["text/plain"],"onepkg":["application/onenote"],"rdp":["application/x-rdp"],"m3u":["audio/mpegurl","audio/x-mpegurl"],"ctx":["chemical/x-ctx"],"appcache":["text/cache-manifest"],"cbin":["chemical/x-cactvs-binary"],"rdf":["application/rdf+xml"],"boo":["text/x-boo"],"m3g":["application/m3g"],"maker":["application/x-maker"],"wmv":["video/x-ms-wmv"],"apk":["application/vnd.android.package-archive"],"sgl":["application/vnd.stardivision.writer-global"],"brf":["text/plain"],"txt":["text/plain"],"wbmp":["image/vnd.wap.wbmp"],"sgf":["application/x-go-sgf"],"zip":["application/zip"],"epsi":["application/postscript"],"epsf":["application/postscript"],"chm":["chemical/x-chemdraw"],"asn":["chemical/x-ncbi-asn1","chemical/x-ncbi-asn1-spec"],"msi":["application/x-msi"],"msh":["model/mesh"],"pfa":["application/x-font"],"wvx":["video/x-ms-wvx"],"pfb":["application/x-font"],"flv":["video/x-flv"],"flac":["audio/flac"],"wbxml":["application/vnd.wap.wbxml"],"iii":["application/x-iphone"],"me":["application/x-troff-me"],"mm":["application/x-freemind"],"uls":["text/iuls"],"cap":["application/vnd.tcpdump.pcap"],"cat":["application/vnd.ms-pki.seccat"],"fli":["video/fli"],"erf":["image/x-epson-erf"],"jdx":["chemical/x-jcamp-dx"],"ms":["application/x-troff-ms"],"xht":["application/xhtml+xml"],"cac":["chemical/x-cache"],"cab":["application/x-cab"],"deb":["application/x-debian-package"],"eps2":["application/postscript"],"eps3":["application/postscript"],"spx":["audio/ogg"],"ltx":["text/x-tex"],"xcf":["application/x-xcf"],"tar":["application/x-tar"],"dxr":["application/x-director"],"taz":["application/x-gtar-compressed"],"spl":["application/futuresplash","application/x-futuresplash"],"spc":["chemical/x-galactic-spc"],"mpc":["chemical/x-mopac-input"],"csm":["chemical/x-csml"],"chrt":["application/x-kchart"],"csh":["application/x-csh","text/x-csh"],"gcg":["chemical/x-gcg8-sequence"],"sit":["application/x-stuffit"],"csd":["audio/csound"],"csf":["chemical/x-cache-csf"],"sig":["application/pgp-signature"],"sid":["audio/prs.sid"],"sik":["application/x-trash"],"xhtml":["application/xhtml+xml"],"csv":["text/csv"],"css":["text/css"],"sis":["application/vnd.symbian.install"],"snd":["audio/basic"],"mpega":["audio/mpeg"],"fb":["application/x-maker"],"mesh":["model/mesh"],"fm":["application/x-maker"],"man":["application/x-troff-man"],"lha":["application/x-lha"],"gcf":["application/x-graphing-calculator"],"sw":["chemical/x-swissprot"],"sh":["application/x-sh","text/x-sh"],"lhs":["text/x-literate-haskell"],"sd":["chemical/x-mdl-sdfile"],"lsf":["video/x-la-asf"],"vmd":["chemical/x-vmd"],"jpeg":["image/jpeg"],"jng":["image/x-jng"],"vms":["chemical/x-vamas-iso14976"],"lsx":["video/x-la-asf"],"pcx":["image/pcx"],"djv":["image/vnd.djvu"],"wrl":["model/vrml","x-world/x-vrml"],"qgs":["application/x-qgis"],"gen":["chemical/x-genbank"],"html":["text/html"],"fig":["application/x-xfig"],"tsv":["text/tab-separated-values"],"ent":["chemical/x-ncbi-asn1-ascii","chemical/x-pdb"],"pcf":["application/x-font"],"tsp":["application/dsptype"],"ly":["text/x-lilypond"],"pptx":["application/vnd.openxmlformats-officedocument.presentationml.presentation"],"lzx":["application/x-lzx"],"docx":["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],"mxu":["video/vnd.mpegurl"],"dat":["application/x-ns-proxy-autoconfig"],"lzh":["application/x-lzh"],"pptm":["application/vnd.ms-powerpoint.presentation.macroEnabled.12"],"docm":["application/vnd.ms-word.document.macroEnabled.12"],"mxf":["application/mxf"],"qt":["video/quicktime"],"hqx":["application/mac-binhex40"],"kpr":["application/x-kpresenter"],"kpt":["application/x-kpresenter"],"xlb":["application/vnd.ms-excel"],"h":["text/x-chdr"],"xlt":["application/vnd.ms-excel"],"xls":["application/vnd.ms-excel"],"atomcat":["application/atomcat+xml"],"mdb":["application/msaccess"],"gtar":["application/x-gtar"],"ez":["application/andrew-inset"],"es":["application/ecmascript"],"vcd":["application/x-cdlink"],"vcf":["text/x-vcard"],"rd":["chemical/x-mdl-rdfile"],"vcs":["text/x-vcalendar"],"ra":["audio/x-pn-realaudio","audio/x-realaudio"],"rb":["application/x-ruby"],"rm":["audio/x-pn-realaudio"],"asx":["video/x-ms-asf"],"gnumeric":["application/x-gnumeric"],"mml":["text/mathml"],"asf":["video/x-ms-asf"],"orf":["image/x-olympus-orf"],"mmd":["chemical/x-macromodel-input"],"mmf":["application/vnd.smaf"],"aso":["chemical/x-ncbi-asn1-binary"],"orc":["audio/csound"],"cxx":["text/x-c++src"],"md5":["application/x-md5"],"xpm":["image/x-xpixmap"],"midi":["audio/midi"],"c3d":["chemical/x-chem3d"],"isp":["application/x-internet-signup"],"swfl":["application/x-shockwave-flash"],"ist":["chemical/x-isostar"],"mvb":["chemical/x-mopac-vib"],"iso":["application/x-iso9660-image"],"xul":["application/vnd.mozilla.xul+xml"],"pgn":["application/x-chess-pgn"],"pgm":["image/x-portable-graymap"],"one":["application/onenote"],"pgp":["application/pgp-encrypted"],"potx":["application/vnd.openxmlformats-officedocument.presentationml.template"],"x3dv":["model/x3d+vrml"],"potm":["application/vnd.ms-powerpoint.template.macroEnabled.12"],"gpt":["chemical/x-mopac-graph"],"x3db":["model/x3d+binary"],"phtml":["application/x-httpd-php"],"ods":["application/vnd.oasis.opendocument.spreadsheet"],"ogx":["application/ogg"],"wax":["audio/x-ms-wax"],"onetoc2":["application/onenote"],"pnm":["image/x-portable-anymap"],"cmdf":["chemical/x-cmdf"],"oga":["audio/ogg"],"png":["image/png"],"rss":["application/x-rss+xml"],"std":["application/vnd.sun.xml.draw.template"],"onetmp":["application/onenote"],"b":["chemical/x-molconn-Z"],"stc":["application/vnd.sun.xml.calc.template"],"stl":["application/sla","application/vnd.ms-pki.stl"],"ogg":["audio/ogg"],"sti":["application/vnd.sun.xml.impress.template"],"stw":["application/vnd.sun.xml.writer.template"],"torrent":["application/x-bittorrent"],"sldm":["application/vnd.ms-powerpoint.slide.macroEnabled.12"],"prf":["application/pics-rules"],"php3p":["application/x-httpd-php3-preprocessed"],"ram":["audio/x-pn-realaudio"],"prt":["chemical/x-ncbi-asn1-ascii"],"rar":["application/rar"],"ras":["image/x-cmu-raster"],"anx":["application/annodex"],"7z":["application/x-7z-compressed"],"shtml":["text/html"],"lin":["application/bbolin"],"mid":["audio/midi"],"mif":["application/x-mif","chemical/x-mif"],"323":["text/h323"],"istr":["chemical/x-isostar"],"csml":["chemical/x-csml"],"ogv":["video/ogg"],"sfv":["text/x-sfv"],"zmt":["chemical/x-mopac-input"],"mkv":["video/x-matroska"],"kar":["audio/midi"],"mpeg":["video/mpeg"],"sisx":["x-epoc/x-sisx-app"],"pyo":["application/x-python-code"],"bsd":["chemical/x-crossfire"],"pyc":["application/x-python-code"],"awb":["audio/amr-wb","audio/amr-wb"],"cc":["text/x-c++src"],"fbdoc":["application/x-maker"],"latex":["application/x-latex"],"exe":["application/x-msdos-program"],"axv":["video/annodex"],"doc":["application/msword"],"wmlsc":["application/vnd.wap.wmlscriptc"],"hh":["text/x-c++hdr"],"axa":["audio/annodex"],"dot":["application/msword"],"cdf":["application/x-cdf"],"rtf":["application/rtf"],"ctab":["chemical/x-cactvs-binary"],"cda":["application/x-cdf"],"text":["text/plain"],"atom":["application/atom+xml"],"cdt":["image/x-coreldrawtemplate"],"texi":["application/x-texinfo"],"cdr":["image/x-coreldraw"],"cdx":["chemical/x-cdx"],"cdy":["application/vnd.cinderella"],"xml":["application/xml"],"ksp":["application/x-kspread"],"cache":["chemical/x-cache"],"jar":["application/java-archive"],"jam":["application/x-jam"],"jad":["text/vnd.sun.j2me.app-descriptor"],"ief":["image/ief"],"dl":["video/dl"],"woff":["application/x-font-woff"],"cpio":["application/x-cpio"],"dx":["chemical/x-jcamp-dx"],"dv":["video/dv"],"xcos":["application/x-scilab-xcos"],"hin":["chemical/x-hin"],"silo":["model/mesh"],"shp":["application/x-qgis"],"bat":["application/x-msdos-program"],"crw":["image/x-canon-crw"],"crt":["application/x-x509-ca-cert"],"emb":["chemical/x-embl-dl-nucleotide"],"shx":["application/x-qgis"],"eml":["message/rfc822"],"c++":["text/x-c++src"],"patch":["text/x-diff"],"bak":["application/x-trash"],"crl":["application/x-pkcs7-crl"],"art":["image/x-jg"],"ser":["application/java-serialized-object"],"frame":["application/x-maker"],"mcif":["chemical/x-mmcif"],"qtl":["application/x-quicktimeplayer"],"movie":["video/x-sgi-movie"],"dll":["application/x-msdos-program"],"wm":["video/x-ms-wm"],"wk":["application/x-123"],"js":["application/javascript"],"key":["application/pgp-keys"],"sv4crc":["application/x-sv4crc"],"pcap":["application/vnd.tcpdump.pcap"],"wz":["application/x-wingz"],"vrm":["x-world/x-vrml"],"c":["text/x-csrc"],"etx":["text/x-setext"],"xlam":["application/vnd.ms-excel.addin.macroEnabled.12"],"sty":["text/x-tex"],"cod":["application/vnd.rim.cod"],"pdf":["application/pdf"],"com":["application/x-msdos-program"],"pdb":["chemical/x-pdb"],"xltm":["application/vnd.ms-excel.template.macroEnabled.12"],"kwd":["application/x-kword"],"tgz":["application/x-gtar-compressed"],"pot":["text/plain"],"xltx":["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],"kwt":["application/x-kword"],"cxf":["chemical/x-cxf"],"sxd":["application/vnd.sun.xml.draw"],"rpm":["application/x-redhat-package-manager"],"cu":["application/cu-seeme"],"jnlp":["application/x-java-jnlp-file"],"ps":["application/postscript"],"mpga":["audio/mpeg"],"iges":["model/iges"],"py":["text/x-python"],"frm":["application/x-maker"],"swf":["application/x-shockwave-flash"],"json":["application/json"],"pk":["application/x-tex-pk"],"pl":["text/x-perl"],"pm":["text/x-perl"],"oth":["application/vnd.oasis.opendocument.text-web"],"xlsx":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],"mcm":["chemical/x-macmolecule"],"lyx":["application/x-lyx"],"gau":["chemical/x-gaussian-input"],"dotx":["application/vnd.openxmlformats-officedocument.wordprocessingml.template"],"sldx":["application/vnd.openxmlformats-officedocument.presentationml.slide"],"otg":["application/vnd.oasis.opendocument.graphics-template"],"gan":["application/x-ganttproject"],"gam":["chemical/x-gamess-input"],"gal":["chemical/x-gaussian-log"],"xlsm":["application/vnd.ms-excel.sheet.macroEnabled.12"],"otp":["application/vnd.oasis.opendocument.presentation-template"],"ots":["application/vnd.oasis.opendocument.spreadsheet-template"],"ott":["application/vnd.oasis.opendocument.text-template"],"dotm":["application/vnd.ms-word.template.macroEnabled.12"],"ppsm":["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],"mopcrt":["chemical/x-mopac-input"],"hdf":["application/x-hdf"],"atomsrv":["application/atomserv+xml"],"aif":["audio/x-aiff"],"mbox":["application/mbox"],"~":["application/x-trash"],"svgz":["image/svg+xml"],"cef":["chemical/x-cxf"],"wp5":["application/vnd.wordperfect5.1"],"jpe":["image/jpeg"],"jpg":["image/jpeg"],"sitx":["application/x-stuffit"],"avi":["video/x-msvideo"],"texinfo":["application/x-texinfo"],"shar":["application/x-shar"],"pas":["text/x-pascal"],"pat":["image/x-coreldrawpattern"],"pac":["application/x-ns-proxy-autoconfig"],"hxx":["text/x-c++hdr"],"3gp":["video/3gpp"],"kin":["chemical/x-kinemage"],"kil":["application/x-killustrator"],"wpd":["application/vnd.wordperfect"],"igs":["model/iges"],"php":["application/x-httpd-php"],"pht":["application/x-httpd-php"],"sha1":["application/x-sha1"],"gamin":["chemical/x-gamess-input"],"wmls":["text/vnd.wap.wmlscript"],"eps":["application/postscript"],"gsf":["application/x-font"],"wmlc":["application/vnd.wap.wmlc"],"gsm":["audio/x-gsm"],"cer":["chemical/x-cerius"],"hpp":["text/x-c++hdr"],"xspf":["application/xspf+xml"],"aiff":["audio/x-aiff"],"davmount":["application/davmount+xml"],"aifc":["audio/x-aiff"],"tcl":["application/x-tcl","text/x-tcl"],"cls":["text/x-tex"],"bcpio":["application/x-bcpio"],"roff":["application/x-troff"],"skt":["application/x-koan"],"skp":["application/x-koan"],"skd":["application/x-koan"],"rgb":["image/x-rgb"],"cub":["chemical/x-gaussian-cube"],"skm":["application/x-koan"],"m4a":["audio/mpeg"],"bin":["application/octet-stream"],"embl":["chemical/x-embl-dl-nucleotide"],"mop":["chemical/x-mopac-input"],"bib":["text/x-bibtex"],"mov":["video/quicktime"],"psd":["image/x-photoshop"],"moo":["chemical/x-mopac-out"],"mol":["chemical/x-mdl-molfile"],"moc":["text/x-moc"],"amr":["audio/amr","audio/amr"],"ustar":["application/x-ustar"],"d":["text/x-dsrc"],"t":["application/x-troff"],"xsd":["application/xml"],"gjf":["chemical/x-gaussian-input"],"tgf":["chemical/x-mdl-tgf"],"vrml":["model/vrml","x-world/x-vrml"],"gjc":["chemical/x-gaussian-input"],"xsl":["application/xml"],"old":["application/x-trash"],"webm":["video/webm"],"vsd":["application/vnd.visio"],"diff":["text/x-diff"],"udeb":["application/x-debian-package"],"ico":["image/vnd.microsoft.icon"],"scala":["text/x-scala"],"ica":["application/x-ica"],"kml":["application/vnd.google-earth.kml+xml"],"ice":["x-conference/x-cooltalk"],"icz":["text/calendar"],"x3d":["model/x3d+xml"],"ics":["text/calendar"],"xtel":["chemical/x-xtel"],"kmz":["application/vnd.google-earth.kmz"],"dcm":["application/dicom"],"pls":["audio/x-scpls"],"m3u8":["application/x-mpegURL"],"mmod":["chemical/x-macromodel-input"],"java":["text/x-java"],"dcr":["application/x-director"],"src":["application/x-wais-source"],"o":["application/x-object"],"srt":["text/plain"],"sd2":["audio/x-sd2"],"tiff":["image/tiff"],"xyz":["chemical/x-xyz"],"ppm":["image/x-portable-pixmap"],"pps":["application/vnd.ms-powerpoint"],"fch":["chemical/x-gaussian-checkpoint"],"ppt":["application/vnd.ms-powerpoint"],"djvu":["image/vnd.djvu"],"xpi":["application/x-xpinstall"],"val":["chemical/x-ncbi-asn1-binary"],"ppam":["application/vnd.ms-powerpoint.addin.macroEnabled.12"],"wad":["application/x-doom"],"class":["application/java-vm"],"gif":["image/gif"],"smil":["application/smil"],"wav":["audio/x-wav"],"rhtml":["application/x-httpd-eruby"],"sdw":["application/vnd.stardivision.writer"],"sds":["application/vnd.stardivision.chart"],"hs":["text/x-haskell"],"sdd":["application/vnd.stardivision.impress"],"sdf":["application/vnd.stardivision.math","chemical/x-mdl-sdfile"],"sda":["application/vnd.stardivision.draw"],"sdc":["application/vnd.stardivision.calc"],"sv4cpio":["application/x-sv4cpio"],"info":["application/x-info"],"cif":["chemical/x-cif"],"dmg":["application/x-apple-diskimage"],"dms":["application/x-dms"],"svg":["image/svg+xml"],"xwd":["image/x-xwindowdump"],"jmz":["application/x-jmol"],"sxc":["application/vnd.sun.xml.calc"],"p7r":["application/x-pkcs7-certreqresp"],"ppsx":["application/vnd.openxmlformats-officedocument.presentationml.slideshow"],"sxg":["application/vnd.sun.xml.writer.global"],"ai":["application/postscript"],"sxi":["application/vnd.sun.xml.impress"],"inp":["chemical/x-gamess-input"],"sxm":["application/vnd.sun.xml.math"],"ins":["application/x-internet-signup"],"cbr":["application/x-cbr"],"au":["audio/basic"],"sxw":["application/vnd.sun.xml.writer"],"cbz":["application/x-cbz"],"%":["application/x-trash"],"nb":["application/mathematica"],"nc":["application/x-netcdf"],"book":["application/x-maker"],"php4":["application/x-httpd-php4"],"php5":["application/x-httpd-php5"],"tif":["image/tiff"],"php3":["application/x-httpd-php3"],"mol2":["chemical/x-mol2"],"h++":["text/x-c++hdr"],"sql":["application/x-sql"],"hwp":["application/x-hwp"],"dvi":["application/x-dvi"],"pcf.Z":["application/x-font"],"rxn":["chemical/x-mdl-rxnfile"],"cpa":["chemical/x-compass"],"bmp":["image/x-ms-bmp"],"xbm":["image/x-xbitmap"],"eot":["application/vnd.ms-fontobject"],"cpp":["text/x-c++src"],"cpt":["application/mac-compactpro","image/x-corelphotopaint"],"phps":["application/x-httpd-php-source"]};jsmime.getMimesByExt=function(ext)
{return mimes[ext]||["application/octet-stream","text/plain"];}
jsmime.getMimesByPath=function(path)
{var ext=path.substring(path.lastIndexOf(".")+1);return jsmime.getMimesByExt(ext);}
jsmime.pathIsMime=function(path,mime)
{var mimes=jsmime.getMimesByPath(path);for(var i=0;i<mimes.length;i++)
if(mime==mimes[i])
return true;return false;}})();(function($){var cookie_local_prefix="ls_";var cookie_session_prefix="ss_";function _get(storage){var l=arguments.length,s=window[storage],a=arguments,a1=a[1],vi,ret,tmp;if(l<2)throw new Error('Minimum 2 arguments must be given');else if($.isArray(a1)){ret={};for(var i in a1){vi=a1[i];try{ret[vi]=JSON.parse(s.getItem(vi));}catch(e){ret[vi]=s.getItem(vi);}}
return ret;}else if(l==2){try{return JSON.parse(s.getItem(a1));}catch(e){return s.getItem(a1);}}else{try{ret=JSON.parse(s.getItem(a1));}catch(e){throw new ReferenceError(a1+' is not defined in this storage');}
for(var i=2;i<l-1;i++){ret=ret[a[i]];if(ret===undefined)throw new ReferenceError([].slice.call(a,1,i+1).join('.')+' is not defined in this storage');}
if($.isArray(a[i])){tmp=ret;ret={};for(var j in a[i]){ret[a[i][j]]=tmp[a[i][j]];}
return ret;}else{return ret[a[i]];}}}
function _set(storage){var l=arguments.length,s=window[storage],a=arguments,a1=a[1],a2=a[2],vi,to_store={},tmp;if(l<2||!$.isPlainObject(a1)&&l<3)throw new Error('Minimum 3 arguments must be given or second parameter must be an object');else if($.isPlainObject(a1)){for(var i in a1){vi=a1[i];if(!$.isPlainObject(vi))s.setItem(i,vi);else s.setItem(i,JSON.stringify(vi));}
return a1;}else if(l==3){if(typeof a2==='object')s.setItem(a1,JSON.stringify(a2));else s.setItem(a1,a2);return a2;}else{try{tmp=s.getItem(a1);if(tmp!=null){to_store=JSON.parse(tmp);}}catch(e){}
tmp=to_store;for(var i=2;i<l-2;i++){vi=a[i];if(!tmp[vi]||!$.isPlainObject(tmp[vi]))tmp[vi]={};tmp=tmp[vi];}
tmp[a[i]]=a[i+1];s.setItem(a1,JSON.stringify(to_store));return to_store;}}
function _remove(storage){var l=arguments.length,s=window[storage],a=arguments,a1=a[1],to_store,tmp;if(l<2)throw new Error('Minimum 2 arguments must be given');else if($.isArray(a1)){for(var i in a1){s.removeItem(a1[i]);}
return true;}else if(l==2){s.removeItem(a1);return true;}else{try{to_store=tmp=JSON.parse(s.getItem(a1));}catch(e){throw new ReferenceError(a1+' is not defined in this storage');}
for(var i=2;i<l-1;i++){tmp=tmp[a[i]];if(tmp===undefined)throw new ReferenceError([].slice.call(a,1,i).join('.')+' is not defined in this storage');}
if($.isArray(a[i])){for(var j in a[i]){delete tmp[a[i][j]];}}else{delete tmp[a[i]];}
s.setItem(a1,JSON.stringify(to_store));return true;}}
function _removeAll(storage,reinit_ns){var keys=_keys(storage);for(var i in keys){_remove(storage,keys[i]);}
if(reinit_ns){for(var i in $.namespaceStorages){_createNamespace(i);}}}
function _isEmpty(storage){var l=arguments.length,a=arguments,s=window[storage],a1=a[1];if(l==1){return(_keys(storage).length==0);}else if($.isArray(a1)){for(var i=0;i<a1.length;i++){if(!_isEmpty(storage,a1[i]))return false;}
return true;}else{try{var v=_get.apply(this,arguments);if(!$.isArray(a[l-1]))v={'totest':v};for(var i in v){if(!(($.isPlainObject(v[i])&&$.isEmptyObject(v[i]))||($.isArray(v[i])&&!v[i].length)||(!v[i])))return false;}
return true;}catch(e){return true;}}}
function _isSet(storage){var l=arguments.length,a=arguments,s=window[storage],a1=a[1];if(l<2)throw new Error('Minimum 2 arguments must be given');if($.isArray(a1)){for(var i=0;i<a1.length;i++){if(!_isSet(storage,a1[i]))return false;}
return true;}else{try{var v=_get.apply(this,arguments);if(!$.isArray(a[l-1]))v={'totest':v};for(var i in v){if(!(v[i]!==undefined&&v[i]!==null))return false;}
return true;}catch(e){return false;}}}
function _keys(storage){var l=arguments.length,s=window[storage],a=arguments,a1=a[1],keys=[],o={};if(l>1){o=_get.apply(this,a);}else{o=s;}
if(o._cookie){for(var key in $.cookie()){if(key!=''){keys.push(key.replace(o._prefix,''));}}}else{for(var i in o){keys.push(i);}}
return keys;}
function _createNamespace(name){if(!name||typeof name!="string")throw new Error('First parameter must be a string');if(!window.localStorage.getItem(name))window.localStorage.setItem(name,'{}');if(!window.sessionStorage.getItem(name))window.sessionStorage.setItem(name,'{}');var ns={localStorage:$.extend({},$.localStorage,{_ns:name}),sessionStorage:$.extend({},$.sessionStorage,{_ns:name})};if($.cookie){if(!window.cookieStorage.getItem(name))window.cookieStorage.setItem(name,'{}');ns.cookieStorage=$.extend({},$.cookieStorage,{_ns:name});}
$.namespaceStorages[name]=ns;return ns;}
var storage={_type:'',_ns:'',_callMethod:function(f,a){var p=[this._type];if(this._ns)p.push(this._ns);[].push.apply(p,a);return f.apply(this,p);},get:function(){return this._callMethod(_get,arguments);},set:function(){var l=arguments.length,a=arguments,a0=a[0];if(l<1||!$.isPlainObject(a0)&&l<2)throw new Error('Minimum 2 arguments must be given or first parameter must be an object');if($.isPlainObject(a0)&&this._ns){for(var i in a0){_set(this._type,this._ns,i,a0[i]);}
return a0;}else{r=this._callMethod(_set,a);if(this._ns)return r[a0];else return r;}},remove:function(){if(arguments.length<1)throw new Error('Minimum 1 argument must be given');return this._callMethod(_remove,arguments);},removeAll:function(reinit_ns){if(this._ns){_set(this._type,this._ns,{});return true;}else{return _removeAll(this._type,reinit_ns);}},isEmpty:function(){return this._callMethod(_isEmpty,arguments);},isSet:function(){if(arguments.length<1)throw new Error('Minimum 1 argument must be given');return this._callMethod(_isSet,arguments);},keys:function(){return this._callMethod(_keys,arguments);}};if($.cookie){if(!window.name)window.name=Math.floor(Math.random()*100000000);var cookie_storage={_cookie:true,_prefix:'',_expires:null,_path:null,_domain:null,setItem:function(n,v){$.cookie(this._prefix+n,v,{expires:this._expires,path:this._path,domain:this._domain});},getItem:function(n){return $.cookie(this._prefix+n);},removeItem:function(n){return $.removeCookie(this._prefix+n);},clear:function(){for(var key in $.cookie()){if(key!=''){if(!this._prefix&&key.indexOf(cookie_local_prefix)===-1&&key.indexOf(cookie_session_prefix)===-1||this._prefix&&key.indexOf(this._prefix)===0){$.removeCookie(key);}}}},setExpires:function(e){this._expires=e;return this;},setPath:function(p){this._path=p;return this;},setDomain:function(d){this._domain=d;return this;},setConf:function(c){if(c.path)this._path=c.path;if(c.domain)this._domain=c.domain;if(c.expires)this._expires=c.expires;return this;},setDefaultConf:function(){this._path=this._domain=this._expires=null;}};if(!window.localStorage){window.localStorage=$.extend({},cookie_storage,{_prefix:cookie_local_prefix,_expires:365*10});window.sessionStorage=$.extend({},cookie_storage,{_prefix:cookie_session_prefix+window.name+'_'});}
window.cookieStorage=$.extend({},cookie_storage);$.cookieStorage=$.extend({},storage,{_type:'cookieStorage',setExpires:function(e){window.cookieStorage.setExpires(e);return this;},setPath:function(p){window.cookieStorage.setPath(p);return this;},setDomain:function(d){window.cookieStorage.setDomain(d);return this;},setConf:function(c){window.cookieStorage.setConf(c);return this;},setDefaultConf:function(){window.cookieStorage.setDefaultConf();return this;}});}
$.initNamespaceStorage=function(ns){return _createNamespace(ns);};$.localStorage=$.extend({},storage,{_type:'localStorage'});$.sessionStorage=$.extend({},storage,{_type:'sessionStorage'});$.namespaceStorages={};$.removeAllStorages=function(reinit_ns){$.localStorage.removeAll(reinit_ns);$.sessionStorage.removeAll(reinit_ns);if($.cookieStorage)$.cookieStorage.removeAll(reinit_ns);if(!reinit_ns){$.namespaceStorages={};}}})(jQuery);!function($){"use strict";var toggle='[data-toggle=dropdown]',Dropdown=function(element){var $el=$(element).on('click.dropdown.data-api',this.toggle)
$('html').on('click.dropdown.data-api',function(){$el.parent().removeClass('open')})}
Dropdown.prototype={constructor:Dropdown,toggle:function(e){var $this=$(this),$parent,isActive
if($this.is('.disabled, :disabled'))return
$parent=getParent($this)
isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){$parent.toggleClass('open')}
$this.focus()
return false},keydown:function(e){var $this,$items,$active,$parent,isActive,index
if(!/(38|40|27)/.test(e.keyCode))return
$this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled'))return
$parent=getParent($this)
isActive=$parent.hasClass('open')
if(!isActive||(isActive&&e.keyCode==27)){if(e.which==27)$parent.find(toggle).focus()
return $this.click()}
$items=$('[role=menu] li:not(.divider):visible a',$parent)
if(!$items.length)return
index=$items.index($items.filter(':focus'))
if(e.keyCode==38&&index>0)index--
if(e.keyCode==40&&index<$items.length-1)index++
if(!~index)index=0
$items.eq(index).focus()}}
function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass('open')})}
function getParent($this){var selector=$this.attr('data-target'),$parent
if(!selector){selector=$this.attr('href')
selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
$parent=selector&&$(selector)
if(!$parent||!$parent.length)$parent=$this.parent()
return $parent}
var old=$.fn.dropdown
$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data('dropdown')
if(!data)$this.data('dropdown',(data=new Dropdown(this)))
if(typeof option=='string')data[option].call($this)})}
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
return this}
$(document).on('click.dropdown.data-api',clearMenus).on('click.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.dropdown-menu',function(e){e.stopPropagation()}).on('click.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.dropdown.data-api',toggle+', [role=menu]',Dropdown.prototype.keydown)}(window.jQuery);!function($){"use strict";var Collapse=function(element,options){this.$element=$(element)
this.options=$.extend({},$.fn.collapse.defaults,options)
if(this.options.parent){this.$parent=$(this.options.parent)}
this.options.toggle&&this.toggle()}
Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass('width')
return hasWidth?'width':'height'},show:function(){var dimension,scroll,actives,hasData
if(this.transitioning||this.$element.hasClass('in'))return
dimension=this.dimension()
scroll=$.camelCase(['scroll',dimension].join('-'))
actives=this.$parent&&this.$parent.find('> .accordion-group > .in')
if(actives&&actives.length){hasData=actives.data('collapse')
if(hasData&&hasData.transitioning)return
actives.collapse('hide')
hasData||actives.data('collapse',null)}
this.$element[dimension](0)
this.transition('addClass',$.Event('show'),'shown')
$.support.transition&&this.$element[dimension](this.$element[0][scroll])},hide:function(){var dimension
if(this.transitioning||!this.$element.hasClass('in'))return
dimension=this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass',$.Event('hide'),'hidden')
this.$element[dimension](0)},reset:function(size){var dimension=this.dimension()
this.$element.removeClass('collapse')
[dimension](size||'auto')
[0].offsetWidth
this.$element[size!==null?'addClass':'removeClass']('collapse')
return this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){if(startEvent.type=='show')that.reset()
that.transitioning=0
that.$element.trigger(completeEvent)}
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
this.transitioning=1
this.$element[method]('in')
$.support.transition&&this.$element.hasClass('collapse')?this.$element.one($.support.transition.end,complete):complete()},toggle:function(){this[this.$element.hasClass('in')?'hide':'show']()}}
var old=$.fn.collapse
$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data('collapse'),options=$.extend({},$.fn.collapse.defaults,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('collapse',(data=new Collapse(this,options)))
if(typeof option=='string')data[option]()})}
$.fn.collapse.defaults={toggle:true}
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function(){$.fn.collapse=old
return this}
$(document).on('click.collapse.data-api','[data-toggle=collapse]',function(e){var $this=$(this),href,target=$this.attr('data-target')||e.preventDefault()||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''),option=$(target).data('collapse')?'toggle':$this.data()
$this[$(target).hasClass('in')?'addClass':'removeClass']('collapsed')
$(target).collapse(option)})}(window.jQuery);!function($){"use strict";var Tab=function(element){this.element=$(element)}
Tab.prototype={constructor:Tab,show:function(){var $this=this.element,$ul=$this.closest('ul:not(.dropdown-menu)'),selector=$this.attr('data-target'),previous,$target,e
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
if($this.parent('li').hasClass('active'))return
previous=$ul.find('.active:last a')[0]
e=$.Event('show',{relatedTarget:previous})
$this.trigger(e)
if(e.isDefaultPrevented())return
$target=$(selector)
this.activate($this.parent('li'),$ul)
this.activate($target,$target.parent(),function(){$this.trigger({type:'shown',relatedTarget:previous})})},activate:function(element,container,callback){var $active=container.find('> .active'),transition=callback&&$.support.transition&&$active.hasClass('fade')
function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active')
element.addClass('active')
if(transition){element[0].offsetWidth
element.addClass('in')}else{element.removeClass('fade')}
if(element.parent('.dropdown-menu')){element.closest('li.dropdown').addClass('active')}
callback&&callback()}
transition?$active.one($.support.transition.end,next):next()
$active.removeClass('in')}}
var old=$.fn.tab
$.fn.tab=function(option){return this.each(function(){var $this=$(this),data=$this.data('tab')
if(!data)$this.data('tab',(data=new Tab(this)))
if(typeof option=='string')data[option]()})}
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function(){$.fn.tab=old
return this}
$(document).on('click.tab.data-api','[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault()
$(this).tab('show')})}(window.jQuery);!function($){"use strict";var Tooltip=function(element,options){this.init('tooltip',element,options)}
Tooltip.prototype={constructor:Tooltip,init:function(type,element,options){var eventIn,eventOut,triggers,trigger,i
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.enabled=true
triggers=this.options.trigger.split(' ')
for(i=triggers.length;i--;){trigger=triggers[i]
if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){eventIn=trigger=='hover'?'mouseenter':'focus'
eventOut=trigger=='hover'?'mouseleave':'blur'
this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()},getOptions:function(options){options=$.extend({},$.fn[this.type].defaults,this.$element.data(),options)
if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
return options},enter:function(e){var defaults=$.fn[this.type].defaults,options={},self
this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value},this)
self=$(e.currentTarget)[this.type](options).data(this.type)
if(!self.options.delay||!self.options.delay.show)return self.show()
clearTimeout(this.timeout)
self.hoverState='in'
this.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)},leave:function(e){var self=$(e.currentTarget)[this.type](this._options).data(this.type)
if(this.timeout)clearTimeout(this.timeout)
if(!self.options.delay||!self.options.delay.hide)return self.hide()
self.hoverState='out'
this.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)},show:function(){var $tip,pos,actualWidth,actualHeight,placement,tp,e=$.Event('show')
if(this.hasContent()&&this.enabled){this.$element.trigger(e)
if(e.isDefaultPrevented())return
$tip=this.tip()
this.setContent()
if(this.options.animation){$tip.addClass('fade')}
placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
$tip.detach().css({top:0,left:0,display:'block'})
this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
pos=this.getPosition()
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
switch(placement){case'bottom':tp={top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}
break
case'top':tp={top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}
break
case'left':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}
break
case'right':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}
break}
this.applyPlacement(tp,placement)
this.$element.trigger('shown')}},applyPlacement:function(offset,placement){var $tip=this.tip(),width=$tip[0].offsetWidth,height=$tip[0].offsetHeight,actualWidth,actualHeight,delta,replace
$tip.offset(offset).addClass(placement).addClass('in')
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight
replace=true}
if(placement=='bottom'||placement=='top'){delta=0
if(offset.left<0){delta=offset.left*-2
offset.left=0
$tip.offset(offset)
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight}
this.replaceArrow(delta-width+actualWidth,actualWidth,'left')}else{this.replaceArrow(actualHeight-height,actualHeight,'top')}
if(replace)$tip.offset(offset)},replaceArrow:function(delta,dimension,position){this.arrow().css(position,delta?(50*(1-delta/dimension)+"%"):'')},setContent:function(){var $tip=this.tip(),title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
$tip.removeClass('fade in top bottom left right')},hide:function(){var that=this,$tip=this.tip(),e=$.Event('hide')
this.$element.trigger(e)
if(e.isDefaultPrevented())return
$tip.removeClass('in')
function removeWithAnimation(){var timeout=setTimeout(function(){$tip.off($.support.transition.end).detach()},500)
$tip.one($.support.transition.end,function(){clearTimeout(timeout)
$tip.detach()})}
$.support.transition&&this.$tip.hasClass('fade')?removeWithAnimation():$tip.detach()
this.$element.trigger('hidden')
return this},fixTitle:function(){var $e=this.$element
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}},hasContent:function(){return this.getTitle()},getPosition:function(){var el=this.$element[0]
return $.extend({},(typeof el.getBoundingClientRect=='function')?el.getBoundingClientRect():{width:el.offsetWidth,height:el.offsetHeight},this.$element.offset())},getTitle:function(){var title,$e=this.$element,o=this.options
title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
return title},tip:function(){return this.$tip=this.$tip||$(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){if(!this.$element[0].parentNode){this.hide()
this.$element=null
this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(e){var self=e?$(e.currentTarget)[this.type](this._options).data(this.type):this
self.tip().hasClass('in')?self.hide():self.show()},destroy:function(){this.hide().$element.off('.'+this.type).removeData(this.type)}}
var old=$.fn.tooltip
$.fn.tooltip=function(option){return this.each(function(){var $this=$(this),data=$this.data('tooltip'),options=typeof option=='object'&&option
if(!data)$this.data('tooltip',(data=new Tooltip(this,options)))
if(typeof option=='string')data[option]()})}
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.defaults={animation:true,placement:'top',selector:false,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false}
$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
return this}}(window.jQuery);!function($){"use strict";var Popover=function(element,options){this.init('popover',element,options)}
Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype,{constructor:Popover,setContent:function(){var $tip=this.tip(),title=this.getTitle(),content=this.getContent()
$tip.find('.popover-title')[this.options.html?'html':'text'](title)
$tip.find('.popover-content')[this.options.html?'html':'text'](content)
$tip.removeClass('fade top bottom left right in')},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var content,$e=this.$element,o=this.options
content=(typeof o.content=='function'?o.content.call($e[0]):o.content)||$e.attr('data-content')
return content},tip:function(){if(!this.$tip){this.$tip=$(this.options.template)}
return this.$tip},destroy:function(){this.hide().$element.off('.'+this.type).removeData(this.type)}})
var old=$.fn.popover
$.fn.popover=function(option){return this.each(function(){var $this=$(this),data=$this.data('popover'),options=typeof option=='object'&&option
if(!data)$this.data('popover',(data=new Popover(this,options)))
if(typeof option=='string')data[option]()})}
$.fn.popover.Constructor=Popover
$.fn.popover.defaults=$.extend({},$.fn.tooltip.defaults,{placement:'right',trigger:'click',content:'',template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
$.fn.popover.noConflict=function(){$.fn.popover=old
return this}}(window.jQuery);!function($){"use strict";var Modal=function(element,options){this.options=options
this.$element=$(element).delegate('[data-dismiss="modal"]','click.dismiss.modal',$.proxy(this.hide,this))
this.options.remote&&this.$element.find('.modal-body').load(this.options.remote)}
Modal.prototype={constructor:Modal,toggle:function(){return this[!this.isShown?'show':'hide']()},show:function(){var that=this,e=$.Event('show')
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented())return
this.isShown=true
this.escape()
this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){that.$element.appendTo(document.body)}
that.$element.show()
if(transition){that.$element[0].offsetWidth}
that.$element.addClass('in').attr('aria-hidden',false)
that.enforceFocus()
transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger('shown')}):that.$element.focus().trigger('shown')})},hide:function(e){e&&e.preventDefault()
var that=this
e=$.Event('hide')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented())return
this.isShown=false
this.escape()
$(document).off('focusin.modal')
this.$element.removeClass('in').attr('aria-hidden',true)
$.support.transition&&this.$element.hasClass('fade')?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var that=this
$(document).on('focusin.modal',function(e){if(that.$element[0]!==e.target&&!that.$element.has(e.target).length){that.$element.focus()}})},escape:function(){var that=this
if(this.isShown&&this.options.keyboard){this.$element.on('keyup.dismiss.modal',function(e){e.which==27&&that.hide()})}else if(!this.isShown){this.$element.off('keyup.dismiss.modal')}},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end)
that.hideModal()},500)
this.$element.one($.support.transition.end,function(){clearTimeout(timeout)
that.hideModal()})},hideModal:function(){var that=this
this.$element.hide()
this.backdrop(function(){that.removeBackdrop()
that.$element.trigger('hidden')})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null},backdrop:function(callback){var that=this,animate=this.$element.hasClass('fade')?'fade':''
if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(document.body)
this.$backdrop.click(this.options.backdrop=='static'?$.proxy(this.$element[0].focus,this.$element[0]):$.proxy(this.hide,this))
if(doAnimate)this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback)return
doAnimate?this.$backdrop.one($.support.transition.end,callback):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one($.support.transition.end,callback):callback()}else if(callback){callback()}}}
var old=$.fn.modal
$.fn.modal=function(option){return this.each(function(){var $this=$(this),data=$this.data('modal'),options=$.extend({},$.fn.modal.defaults,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('modal',(data=new Modal(this,options)))
if(typeof option=='string')data[option]()
else if(options.show)data.show()})}
$.fn.modal.defaults={backdrop:true,keyboard:true,show:true}
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function(){$.fn.modal=old
return this}
$(document).on('click.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this),href=$this.attr('href'),$target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,''))),option=$target.data('modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
e.preventDefault()
$target.modal(option).one('hide',function(){$this.focus()})})}(window.jQuery);!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on('click',dismiss,this.close)}
Alert.prototype.close=function(e){var $this=$(this),selector=$this.attr('data-target'),$parent
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
$parent=$(selector)
e&&e.preventDefault()
$parent.length||($parent=$this.hasClass('alert')?$this:$this.parent())
$parent.trigger(e=$.Event('close'))
if(e.isDefaultPrevented())return
$parent.removeClass('in')
function removeElement(){$parent.trigger('closed').remove()}
$.support.transition&&$parent.hasClass('fade')?$parent.on($.support.transition.end,removeElement):removeElement()}
var old=$.fn.alert
$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data('alert')
if(!data)$this.data('alert',(data=new Alert(this)))
if(typeof option=='string')data[option].call($this)})}
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function(){$.fn.alert=old
return this}
$(document).on('click.alert.data-api',dismiss,Alert.prototype.close)}(window.jQuery);(function($,undefined){var uuid=0,runiqueId=/^ui-id-\d+$/;$.ui=$.ui||{};$.extend($.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});$.fn.extend({focus:(function(orig){return function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem);}},delay);}):orig.apply(this,arguments);};})($.fn.focus),scrollParent:function(){var scrollParent;if(($.ui.ie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.css(this,"position"))&&(/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));}).eq(0);}
return(/fixed/).test(this.css("position"))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex);}
if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}}
elem=elem.parent();}}
return 0;},uniqueId:function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});},removeUniqueId:function(){return this.each(function(){if(runiqueId.test(this.id)){$(this).removeAttr("id");}});}});function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;}
img=$("img[usemap=#"+mapName+"]")[0];return!!img&&visible(img);}
return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element);}
function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return $.css(this,"visibility")==="hidden";}).length;}
$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")));},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN);}});if(!$("<a>").outerWidth(1).jquery){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;}
if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;}
$.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);}
return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);}
return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});}
if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}
if($("<a>").data("a-b","a").removeData("a-b").data("a-b")){$.fn.removeData=(function(removeData){return function(key){if(arguments.length){return removeData.call(this,$.camelCase(key));}else{return removeData.call(this);}};})($.fn.removeData);}
$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());$.support.selectstart="onselectstart"in document.createElement("div");$.fn.extend({disableSelection:function(){return this.bind(($.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(event){event.preventDefault();});},enableSelection:function(){return this.unbind(".ui-disableSelection");}});$.extend($.ui,{plugin:{add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var i,set=instance.plugins[name];if(!set||!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11){return;}
for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false;}
var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;}});})(jQuery);(function($,undefined){var uuid=0,slice=Array.prototype.slice,_cleanData=$.cleanData;$.cleanData=function(elems){for(var i=0,elem;(elem=elems[i])!=null;i++){try{$(elem).triggerHandler("remove");}catch(e){}}
_cleanData(elems);};$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);}
if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return;}
proxiedPrototype[prop]=(function(){var _super=function(){return base.prototype[prop].apply(this,arguments);},_superApply=function(args){return base.prototype[prop].apply(this,args);};return function(){var __super=this._super,__superApply=this._superApply,returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);}
$.widget.bridge(name,constructor);};$.widget.extend=function(target){var input=slice.call(arguments,1),inputIndex=0,inputLength=input.length,key,value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}}
return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.widget.extend.apply(null,[options].concat(args)):options;if(isMethodCall){this.each(function(){var methodValue,instance=$.data(this,fullName);if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{})._init();}else{$.data(this,fullName,new object(options,this));}});}
return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=uuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this.bindings=$();this.hoverable=$();this.focusable=$();if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);}
this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");},_destroy:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key,parts,curOption,i;if(arguments.length===0){return $.widget.extend({},this.options);}
if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];}
curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];}
options[key]=value;}}
this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);}
return this;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!value).attr("aria-disabled",value);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");}
return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;}
if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);}
$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;}
return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;}
var match=event.match(/^(\w+)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];if(selector){delegateElement.delegate(selector,eventName,handlerProxy);}else{element.bind(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;element.unbind(eventName).undelegate(eventName);},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover");},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus");},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};}
var hasOptions,effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};}
hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);}
if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);}
next();});}};});})(jQuery);(function($,undefined){var mouseHandled=false;$(document).mouseup(function(){mouseHandled=false;});$.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.bind("mousedown."+this.widgetName,function(event){return that._mouseDown(event);}).bind("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);}},_mouseDown:function(event){if(mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent");}
this._mouseMoveDelegate=function(event){return that._mouseMove(event);};this._mouseUpDelegate=function(event){return that._mouseUp(event);};$(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true;},_mouseMove:function(event){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true);}
this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});})(jQuery);(function($,undefined){$.ui=$.ui||{};var cachedScrollbarWidth,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)];}
function parseCss(element,property){return parseInt($.css(element,property),10)||0;}
function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}};}
if($.isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};}
if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};}
return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};}
$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth;}
var w1,w2,div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow","scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth;}
div.remove();return(cachedScrollbarWidth=w1-w2);},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX=overflowX==="scroll"||(overflowX==="auto"&&within.width<within.element[0].scrollWidth),hasOverflowY=overflowY==="scroll"||(overflowY==="auto"&&within.height<within.element[0].scrollHeight);return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0};},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9;return{element:withinElement,isWindow:isWindow,isDocument:isDocument,offset:withinElement.offset()||{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:isWindow?withinElement.width():withinElement.outerWidth(),height:isWindow?withinElement.height():withinElement.outerHeight()};}};$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments);}
options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(target[0].preventDefault){options.at="left top";}
targetWidth=dimensions.width;targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset);$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset;if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"];}
pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]];});if(collision.length===1){collision[1]=collision[0];}
if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2;}
if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]==="center"){basePosition.top+=targetHeight/2;}
atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth;}else if(options.my[0]==="center"){position.left-=elemWidth/2;}
if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]==="center"){position.top-=elemHeight/2;}
position.left+=myOffset[0];position.top+=myOffset[1];if(!$.support.offsetFractions){position.left=round(position.left);position.top=round(position.top);}
collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem});}});if(options.using){using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center";}
if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle";}
if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal";}else{feedback.important="vertical";}
options.using.call(this,props,feedback);};}
elem.offset($.extend(position,{using:using}));});};$.ui.position={fit:{left:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>0&&overLeft<=0){position.left=withinOffset;}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth;}else{position.left=withinOffset;}}}else if(overLeft>0){position.left+=overLeft;}else if(overRight>0){position.left-=overRight;}else{position.left=max(position.left-collisionPosLeft,position.left);}},top:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset;position.top+=overTop-newOverBottom;}else if(overBottom>0&&overTop<=0){position.top=withinOffset;}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight;}else{position.top=withinOffset;}}}else if(overTop>0){position.top+=overTop;}else if(overBottom>0){position.top-=overBottom;}else{position.top=max(position.top-collisionPosTop,position.top);}}},flip:{left:function(position,data){var within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],newOverRight,newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset;}}
else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset;}}},top:function(position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],newOverTop,newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset;if((position.top+myOffset+atOffset+offset)>overTop&&(newOverBottom<0||newOverBottom<abs(overTop))){position.top+=myOffset+atOffset+offset;}}
else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop;if((position.top+myOffset+atOffset+offset)>overBottom&&(newOverTop>0||abs(newOverTop)<overBottom)){position.top+=myOffset+atOffset+offset;}}}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,arguments);},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(this,arguments);}}};(function(){var testElement,testElementParent,testElementStyle,offsetLeft,i,body=document.getElementsByTagName("body")[0],div=document.createElement("div");testElement=document.createElement(body?"div":"body");testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(body){$.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"});}
for(i in testElementStyle){testElement.style[i]=testElementStyle[i];}
testElement.appendChild(div);testElementParent=body||document.documentElement;testElementParent.insertBefore(testElement,testElementParent.firstChild);div.style.cssText="position: absolute; left: 10.7432222px;";offsetLeft=$(div).offset().left;$.support.offsetFractions=offsetLeft>10&&offsetLeft<11;testElement.innerHTML="";testElementParent.removeChild(testElement);})();}(jQuery));(function($,undefined){$.widget("ui.draggable",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative";}
if(this.options.addClasses){this.element.addClass("ui-draggable");}
if(this.options.disabled){this.element.addClass("ui-draggable-disabled");}
this._mouseInit();},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false;}
this.handle=this._getHandle(event);if(!this.handle){return false;}
$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this;}
this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offsetParent=this.helper.offsetParent();this.offsetParentCssPosition=this.offsetParent.css("position");this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.scroll=false;$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this._setContainment();if(this._trigger("start",event)===false){this._clear();return false;}
this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}
this._mouseDrag(event,true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event);}
return true;},_mouseDrag:function(event,noPropagation){if(this.offsetParentCssPosition==="fixed"){this.offset.parent=this._getParentOffset();}
this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp({});return false;}
this.position=ui.position;}
if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";}
if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";}
if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);}
return false;},_mouseStop:function(event){var that=this,dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event);}
if(this.dropped){dropped=this.dropped;this.dropped=false;}
if(this.options.helper==="original"&&!$.contains(this.element[0].ownerDocument,this.element[0])){return false;}
if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear();}});}else{if(this._trigger("stop",event)!==false){this._clear();}}
return false;},_mouseUp:function(event){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event);}
return $.ui.mouse.prototype._mouseUp.call(this,event);},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({});}else{this._clear();}
return this;},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:true;},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo==="parent"?this.element[0].parentNode:o.appendTo));}
if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute");}
return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");}
if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}
if("left"in obj){this.offset.click.left=obj.left+this.margins.left;}
if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}
if("top"in obj){this.offset.click.top=obj.top+this.margins.top;}
if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]===document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_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 over,c,ce,o=this.options;if(!o.containment){this.containment=null;return;}
if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;}
if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;}
if(o.containment.constructor===Array){this.containment=o.containment;return;}
if(o.containment==="parent"){o.containment=this.helper[0].parentNode;}
c=$(o.containment);ce=c[0];if(!ce){return;}
over=c.css("overflow")!=="hidden";this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=c;},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;}
var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent;if(!this.offset.scroll){this.offset.scroll={top:scroll.scrollTop(),left:scroll.scrollLeft()};}
return{top:(pos.top+
this.offset.relative.top*mod+
this.offset.parent.top*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():this.offset.scroll.top)*mod)),left:(pos.left+
this.offset.relative.left*mod+
this.offset.parent.left*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():this.offset.scroll.left)*mod))};},_generatePosition:function(event){var containment,co,top,left,o=this.options,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,pageX=event.pageX,pageY=event.pageY;if(!this.offset.scroll){this.offset.scroll={top:scroll.scrollTop(),left:scroll.scrollLeft()};}
if(this.originalPosition){if(this.containment){if(this.relative_container){co=this.relative_container.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top];}
else{containment=this.containment;}
if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left;}
if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top;}
if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left;}
if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top;}}
if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?((top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3])?top:((top-this.offset.click.top>=containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?((left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2])?left:((left-this.offset.click.left>=containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY-
this.offset.click.top-
this.offset.relative.top-
this.offset.parent.top+
(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():this.offset.scroll.top)),left:(pageX-
this.offset.click.left-
this.offset.relative.left-
this.offset.parent.left+
(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():this.offset.scroll.left))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove();}
this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type==="drag"){this.positionAbs=this._convertPositionTo("absolute");}
return $.Widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("ui-draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,"ui-sortable");if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable.refreshPositions();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("ui-draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=this.shouldRevert;}
this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper==="original"){this.instance.currentItem.css({top:"auto",left:"auto"});}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("ui-draggable"),that=this;$.each(inst.sortables,function(){var innermostIntersecting=false,thisSortable=this;this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){innermostIntersecting=true;$.each(inst.sortables,function(){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this!==thisSortable&&this.instance._intersectsWith(this.instance.containerCache)&&$.contains(thisSortable.instance.element[0],this.instance.element[0])){innermostIntersecting=false;}
return innermostIntersecting;});}
if(innermostIntersecting){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}
if(this.instance.currentItem){this.instance._mouseDrag(event);}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove();}
inst._trigger("fromSortable",event);inst.dropped=false;}}});}});$.ui.plugin.add("draggable","cursor",{start:function(){var t=$("body"),o=$(this).data("ui-draggable").options;if(t.css("cursor")){o._cursor=t.css("cursor");}
t.css("cursor",o.cursor);},stop:function(){var o=$(this).data("ui-draggable").options;if(o._cursor){$("body").css("cursor",o._cursor);}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("ui-draggable").options;if(t.css("opacity")){o._opacity=t.css("opacity");}
t.css("opacity",o.opacity);},stop:function(event,ui){var o=$(this).data("ui-draggable").options;if(o._opacity){$(ui.helper).css("opacity",o._opacity);}}});$.ui.plugin.add("draggable","scroll",{start:function(){var i=$(this).data("ui-draggable");if(i.scrollParent[0]!==document&&i.scrollParent[0].tagName!=="HTML"){i.overflowOffset=i.scrollParent.offset();}},drag:function(event){var i=$(this).data("ui-draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!==document&&i.scrollParent[0].tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}}
if(!o.axis||o.axis!=="y"){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}}
if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event);}}});$.ui.plugin.add("draggable","snap",{start:function(){var i=$(this).data("ui-draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});}});},drag:function(event,ui){var ts,bs,ls,rs,l,r,t,b,i,first,inst=$(this).data("ui-draggable"),o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));}
inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}}
first=(ts||bs||ls||rs);if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));}
inst.snapElements[i].snapping=(ts||bs||ls||rs||first);}}});$.ui.plugin.add("draggable","stack",{start:function(){var min,o=this.data("ui-draggable").options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0);});if(!group.length){return;}
min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i);});this.css("zIndex",(min+group.length));}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("ui-draggable").options;if(t.css("zIndex")){o._zIndex=t.css("zIndex");}
t.css("zIndex",o.zIndex);},stop:function(event,ui){var o=$(this).data("ui-draggable").options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex);}}});})(jQuery);(function($,undefined){function isOverAxis(x,reference,size){return(x>reference)&&(x<(reference+size));}
$.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=false;this.isout=true;this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept);};this.proportions=function(){if(arguments.length){proportions=arguments[0];}else{return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};}};$.ui.ddmanager.droppables[o.scope]=$.ui.ddmanager.droppables[o.scope]||[];$.ui.ddmanager.droppables[o.scope].push(this);(o.addClasses&&this.element.addClass("ui-droppable"));},_destroy:function(){var i=0,drop=$.ui.ddmanager.droppables[this.options.scope];for(;i<drop.length;i++){if(drop[i]===this){drop.splice(i,1);}}
this.element.removeClass("ui-droppable ui-droppable-disabled");},_setOption:function(key,value){if(key==="accept"){this.accept=$.isFunction(value)?value:function(d){return d.is(value);};}
$.Widget.prototype._setOption.apply(this,arguments);},_activate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass);}
if(draggable){this._trigger("activate",event,this.ui(draggable));}},_deactivate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass);}
if(draggable){this._trigger("deactivate",event,this.ui(draggable));}},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass);}
this._trigger("over",event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);}
this._trigger("out",event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=false;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return false;}
this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,"ui-droppable");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],(draggable.currentItem||draggable.element))&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return false;}});if(childrenIntersection){return false;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass);}
if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);}
this._trigger("drop",event,this.ui(draggable));return this.element;}
return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,offset:c.positionAbs};}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset){return false;}
var draggableLeft,draggableTop,x1=(draggable.positionAbs||draggable.position.absolute).left,y1=(draggable.positionAbs||draggable.position.absolute).top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return(l<=x1&&x2<=r&&t<=y1&&y2<=b);case"intersect":return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);case"pointer":draggableLeft=((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left);draggableTop=((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top);return isOverAxis(draggableTop,t,droppable.proportions().height)&&isOverAxis(draggableLeft,l,droppable.proportions().width);case"touch":return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));default:return false;}};$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue;}
for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop;}}
m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue;}
if(type==="mousedown"){m[i]._activate.call(m[i],event);}
m[i].offset=m[i].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight});}},drop:function(draggable,event){var dropped=false;$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return;}
if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance)){dropped=this._drop.call(this,event)||dropped;}
if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=true;this.isover=false;this._deactivate.call(this,event);}});return dropped;},dragStart:function(draggable,event){draggable.element.parentsUntil("body").bind("scroll.droppable",function(){if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}});},drag:function(draggable,event){if(draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}
$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return;}
var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance),c=!intersects&&this.isover?"isout":(intersects&&!this.isover?"isover":null);if(!c){return;}
if(this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)").filter(function(){return $.data(this,"ui-droppable").options.scope===scope;});if(parent.length){parentInstance=$.data(parent[0],"ui-droppable");parentInstance.greedyChild=(c==="isover");}}
if(parentInstance&&c==="isover"){parentInstance.isover=false;parentInstance.isout=true;parentInstance._out.call(parentInstance,event);}
this[c]=true;this[c==="isout"?"isover":"isout"]=false;this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){parentInstance.isout=false;parentInstance.isover=true;parentInstance._over.call(parentInstance,event);}});},dragStop:function(draggable,event){draggable.element.parentsUntil("body").unbind("scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}}};})(jQuery);(function($,undefined){function num(v){return parseInt(v,10)||0;}
function isNumber(value){return!isNaN(parseInt(value,10));}
$.widget("ui.resizable",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var n,i,handle,axis,hname,that=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({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.data("ui-resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom: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({margin:this.originalElement.css("margin")});this._proportionallyResize();}
this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw";}
n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=$.trim(n[i]);hname="ui-resizable-"+handle;axis=$("<div class='ui-resizable-handle "+hname+"'></div>");axis.css({zIndex:o.zIndex});if("se"===handle){axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");}
this.handles[handle]=".ui-resizable-"+handle;this.element.append(axis);}}
this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=$(this.handles[i],this.element).show();}
if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize();}
if(!$(this.handles[i]).length){continue;}}};this._renderAxis(this.element);this._handles=$(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);}
that.axis=axis&&axis[1]?axis[1]:"se";}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(o.disabled){return;}
$(this).removeClass("ui-resizable-autohide");that._handles.show();}).mouseleave(function(){if(o.disabled){return;}
if(!that.resizing){$(this).addClass("ui-resizable-autohide");that._handles.hide();}});}
this._mouseInit();},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove();}
this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this;},_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true;}}
return!this.options.disabled&&capture;},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;if((/absolute/).test(el.css("position"))){el.css({position:"absolute",top:el.css("top"),left:el.css("left")});}else if(el.is(".ui-draggable")){el.css({position:"absolute",top:iniPos.top,left:iniPos.left});}
this._renderProxy();curleft=num(this.helper.css("left"));curtop=num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio==="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var data,el=this.helper,props={},smp=this.originalMousePosition,a=this.axis,prevTop=this.position.top,prevLeft=this.position.left,prevWidth=this.size.width,prevHeight=this.size.height,dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0,trigger=this._change[a];if(!trigger){return false;}
data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event);}
data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);if(this.position.top!==prevTop){props.top=this.position.top+"px";}
if(this.position.left!==prevLeft){props.left=this.position.left+"px";}
if(this.size.width!==prevWidth){props.width=this.size.width+"px";}
if(this.size.height!==prevHeight){props.height=this.size.height+"px";}
el.css(props);if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize();}
if(!$.isEmptyObject(props)){this._trigger("resize",event,this.ui());}
return false;},_mouseStop:function(event){this.resizing=false;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&(/textarea/i).test(pr[0].nodeName);soffseth=ista&&$.ui.hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:(that.helper.width()-soffsetw),height:(that.helper.height()-soffseth)};left=(parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left))||null;top=(parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}));}
that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize();}}
$("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove();}
return false;},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:isNumber(o.minWidth)?o.minWidth:0,maxWidth:isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:isNumber(o.minHeight)?o.minHeight:0,maxHeight:isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth;}
if(pMinHeight>b.minHeight){b.minHeight=pMinHeight;}
if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth;}
if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight;}}
this._vBoundaries=b;},_updateCache:function(data){this.offset=this.helper.offset();if(isNumber(data.left)){this.position.left=data.left;}
if(isNumber(data.top)){this.position.top=data.top;}
if(isNumber(data.height)){this.size.height=data.height;}
if(isNumber(data.width)){this.size.width=data.width;}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(isNumber(data.height)){data.width=(data.height*this.aspectRatio);}else if(isNumber(data.width)){data.height=(data.width/this.aspectRatio);}
if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null;}
if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}
return data;},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height),dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth;}
if(isminh){data.height=o.minHeight;}
if(ismaxw){data.width=o.maxWidth;}
if(ismaxh){data.height=o.maxHeight;}
if(isminw&&cw){data.left=dw-o.minWidth;}
if(ismaxw&&cw){data.left=dw-o.maxWidth;}
if(isminh&&ch){data.top=dh-o.minHeight;}
if(ismaxh&&ch){data.top=dh-o.maxHeight;}
if(!data.width&&!data.height&&!data.left&&data.top){data.top=null;}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null;}
return data;},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return;}
var i,j,borders,paddings,prel,element=this.helper||this.element;for(i=0;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.borderDif){this.borderDif=[];borders=[prel.css("borderTopWidth"),prel.css("borderRightWidth"),prel.css("borderBottomWidth"),prel.css("borderLeftWidth")];paddings=[prel.css("paddingTop"),prel.css("paddingRight"),prel.css("paddingBottom"),prel.css("paddingLeft")];for(j=0;j<borders.length;j++){this.borderDif[j]=(parseInt(borders[j],10)||0)+(parseInt(paddings[j],10)||0);}}
prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0});}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div style='overflow:hidden;'></div>");this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx};},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!=="resize"&&this._trigger(n,event,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};}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).data("ui-resizable"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:(that.size.width-soffsetw),height:(that.size.height-soffseth)},left=(parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left))||null,top=(parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top))||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(that.element.css("width"),10),height:parseInt(that.element.css("height"),10),top:parseInt(that.element.css("top"),10),left:parseInt(that.element.css("left"),10)};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height});}
that._updateCache(data);that._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).data("ui-resizable"),o=that.options,el=that.element,oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce){return;}
that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}
else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name));});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw);height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).data("ui-resizable"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement;if(ce[0]!==document&&(/static/).test(ce.css("position"))){cop=co;}
if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+(that._helper?(that.position.left-co.left):(that.position.left-cop.left));if(pRatio){that.size.height=that.size.width/that.aspectRatio;}
that.position.left=o.helper?co.left:0;}
if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+(that._helper?(that.position.top-co.top):that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;}
that.position.top=that._helper?co.top:0;}
that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top;woset=Math.abs((that._helper?that.offset.left-cop.left:(that.offset.left-cop.left))+that.sizeDiff.width);hoset=Math.abs((that._helper?that.offset.top-cop.top:(that.offset.top-co.top))+that.sizeDiff.height);isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){woset-=Math.abs(that.parentData.left);}
if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;}}
if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;}}},stop:function(){var that=$(this).data("ui-resizable"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}
if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).data("ui-resizable"),o=that.options,_store=function(exp){$(exp).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10)});});};if(typeof(o.alsoResize)==="object"&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}
else{$.each(o.alsoResize,function(exp){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var that=$(this).data("ui-resizable"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:(that.size.height-os.height)||0,width:(that.size.width-os.width)||0,top:(that.position.top-op.top)||0,left:(that.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=c&&c.length?c:el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null;}});el.css(style);});};if(typeof(o.alsoResize)==="object"&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(){$(this).removeData("resizable-alsoresize");}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).data("ui-resizable"),o=that.options,cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof o.ghost==="string"?o.ghost:"");that.ghost.appendTo(that.helper);},resize:function(){var that=$(this).data("ui-resizable");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width});}},stop:function(){var that=$(this).data("ui-resizable");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0));}}});$.ui.plugin.add("resizable","grid",{resize:function(){var that=$(this).data("ui-resizable"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=(grid[0]||1),gridY=(grid[1]||1),ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&(o.maxWidth<newWidth),isMaxHeight=o.maxHeight&&(o.maxHeight<newHeight),isMinWidth=o.minWidth&&(o.minWidth>newWidth),isMinHeight=o.minHeight&&(o.minHeight>newHeight);o.grid=grid;if(isMinWidth){newWidth=newWidth+gridX;}
if(isMinHeight){newHeight=newHeight+gridY;}
if(isMaxWidth){newWidth=newWidth-gridX;}
if(isMaxHeight){newHeight=newHeight-gridY;}
if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox;}else{if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy;}else{that.size.height=gridY;that.position.top=op.top+os.height-gridY;}
if(newWidth-gridX>0){that.size.width=newWidth;that.position.left=op.left-ox;}else{that.size.width=gridX;that.position.left=op.left+os.width-gridX;}}}});})(jQuery);(function($,undefined){$.widget("ui.selectable",$.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var selectees,that=this;this.element.addClass("ui-selectable");this.dragged=false;this.refresh=function(){selectees=$(that.options.filter,that.element[0]);selectees.addClass("ui-selectee");selectees.each(function(){var $this=$(this),pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")});});};this.refresh();this.selectees=selectees.addClass("ui-selectee");this._mouseInit();this.helper=$("<div class='ui-selectable-helper'></div>");},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy();},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY];if(this.options.disabled){return;}
this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"left":event.pageX,"top":event.pageY,"width":0,"height":0});if(options.autoRefresh){this.refresh();}
this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey&&!event.ctrlKey){selectee.$element.removeClass("ui-selected");selectee.selected=false;selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");if(selectee){doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected");selectee.$element.removeClass(doSelect?"ui-unselecting":"ui-selected").addClass(doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,{selecting:selectee.element});}else{that._trigger("unselecting",event,{unselecting:selectee.element});}
return false;}});},_mouseDrag:function(event){this.dragged=true;if(this.options.disabled){return;}
var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){tmp=x2;x2=x1;x1=tmp;}
if(y1>y2){tmp=y2;y2=y1;y1=tmp;}
this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=false;if(!selectee||selectee.element===that.element[0]){return;}
if(options.tolerance==="touch"){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1));}else if(options.tolerance==="fit"){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2);}
if(hit){if(selectee.selected){selectee.$element.removeClass("ui-selected");selectee.selected=false;}
if(selectee.unselecting){selectee.$element.removeClass("ui-unselecting");selectee.unselecting=false;}
if(!selectee.selecting){selectee.$element.addClass("ui-selecting");selectee.selecting=true;that._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if((event.metaKey||event.ctrlKey)&&selectee.startselected){selectee.$element.removeClass("ui-selecting");selectee.selecting=false;selectee.$element.addClass("ui-selected");selectee.selected=true;}else{selectee.$element.removeClass("ui-selecting");selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;}
that._trigger("unselecting",event,{unselecting:selectee.element});}}
if(selectee.selected){if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){selectee.$element.removeClass("ui-selected");selectee.selected=false;selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var that=this;this.dragged=false;$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-unselecting");selectee.unselecting=false;selectee.startselected=false;that._trigger("unselected",event,{unselected:selectee.element});});$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-selecting").addClass("ui-selected");selectee.selecting=false;selectee.selected=true;selectee.startselected=true;that._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}});})(jQuery);(function($,undefined){function isOverAxis(x,reference,size){return(x>reference)&&(x<(reference+size));}
function isFloating(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"));}
$.widget("ui.sortable",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?o.axis==="x"||isFloating(this.items[0].item):false;this.offset=this.element.offset();this._mouseInit();this.ready=true;},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item");}
return this;},_setOption:function(key,value){if(key==="disabled"){this.options[key]=value;this.widget().toggleClass("ui-sortable-disabled",!!value);}else{$.Widget.prototype._setOption.apply(this,arguments);}},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,that=this;if(this.reverting){return false;}
if(this.options.disabled||this.options.type==="static"){return false;}
this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return false;}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target);}
if(!currentItem){return false;}
if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=true;}});if(!validHandle){return false;}}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();if(o.containment){this._setContainment();}
if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body);}
if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");}
this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");}
this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();}
this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions();}
if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this));}}
if($.ui.ddmanager){$.ui.ddmanager.current=this;}
if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}
this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=false;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;}
if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}}
this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";}
if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";}
for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;}
if(item.instance!==this.currentContainer){continue;}
if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);}
this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event){return;}
if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event);}
if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft);}
if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop);}
this.reverting=true;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0]);}
if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove();}
$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}}
return this;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]));}});if(!str.length&&o.key){str.push(o.key+"=");}
return str.join("&");},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"");});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=(this.options.axis==="x")||isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement){return false;}
return this.floating?(((horizontalDirection&&horizontalDirection==="right")||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this.refreshPositions();return this;},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);}}}}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this);}
for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems);}
return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return false;}}
return true;});},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}}}}
for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});}}},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]){continue;}
t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
p=t.offset();item.left=p.left;item.top=p.top;}
if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();}}
return this;},_createPlaceholder:function(that){that=that||this;var className,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(nodeName==="tr"){that.currentItem.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(element);});}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"));}
if(!className){element.css("visibility","hidden");}
return element;},update:function(container,p){if(className&&!o.forcePlaceholderSize){return;}
if(!p.height()){p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10));}
if(!p.width()){p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10));}}};}
that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder);},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,base,cur,nearBottom,floating,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue;}
if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue;}
innermostContainer=this.containers[i];innermostIndex=i;}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(!innermostContainer){return;}
if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";base=this.positionAbs[posProperty]+this.offset.click[posProperty];for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue;}
if(this.items[j].item[0]===this.currentItem[0]){continue;}
if(floating&&!isOverAxis(this.positionAbs.top+this.offset.click.top,this.items[j].top,this.items[j].height)){continue;}
cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(Math.abs(cur-base)>Math.abs(cur+this.items[j][sizeProperty]-base)){nearBottom=true;cur+=this.items[j][sizeProperty];}
if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down";}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return;}
if(this.currentContainer===this.containers[innermostIndex]){return;}
itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[innermostIndex].element,true);this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){$(o.appendTo!=="parent"?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);}
if(helper[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")};}
if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width());}
if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height());}
return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");}
if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}
if("left"in obj){this.offset.click.left=obj.left+this.margins.left;}
if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}
if("top"in obj){this.offset.click.top=obj.top+this.margins.top;}
if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if(this.offsetParent[0]===document.body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_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 ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode;}
if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}
if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;}
var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+
this.offset.relative.top*mod+
this.offset.parent.top*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+
this.offset.relative.left*mod+
this.offset.parent.left*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left;}
if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top;}
if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left;}
if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top;}}
if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY-
this.offset.click.top-
this.offset.relative.top-
this.offset.parent.top+
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-
this.offset.click.left-
this.offset.relative.left-
this.offset.parent.left+
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh);}});},_clear:function(event,noPropagation){this.reverting=false;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem);}
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]="";}}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});}
if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});}
if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.currentContainer));}}
function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}
for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]));}
if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("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();}
if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity);}
if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);}
this.dragging=false;if(this.cancelHelperRemoval){if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);}
this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return false;}
if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());}
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!==this.currentItem[0]){this.helper.remove();}
this.helper=null;if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);}
this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null};}});})(jQuery);(function($,undefined){var uid=0,hideProps={},showProps={};hideProps.height=hideProps.paddingTop=hideProps.paddingBottom=hideProps.borderTopWidth=hideProps.borderBottomWidth="hide";showProps.height=showProps.paddingTop=showProps.paddingBottom=showProps.borderTopWidth=showProps.borderBottomWidth="show";$.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:false,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var options=this.options;this.prevShow=this.prevHide=$();this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist");if(!options.collapsible&&(options.active===false||options.active==null)){options.active=0;}
this._processPanels();if(options.active<0){options.active+=this.headers.length;}
this._refresh();},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?$():this.active.next(),content:!this.active.length?$():this.active.next()};},_createIcons:function(){var icons=this.options.icons;if(icons){$("<span>").addClass("ui-accordion-header-icon ui-icon "+icons.header).prependTo(this.headers);this.active.children(".ui-accordion-header-icon").removeClass(icons.header).addClass(icons.activeHeader);this.headers.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove();},_destroy:function(){var contents;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){if(/^ui-accordion/.test(this.id)){this.removeAttribute("id");}});this._destroyIcons();contents=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){if(/^ui-accordion/.test(this.id)){this.removeAttribute("id");}});if(this.options.heightStyle!=="content"){contents.css("height","");}},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
if(key==="event"){if(this.options.event){this._off(this.headers,this.options.event);}
this._setupEvents(value);}
this._super(key,value);if(key==="collapsible"&&!value&&this.options.active===false){this._activate(0);}
if(key==="icons"){this._destroyIcons();if(value){this._createIcons();}}
if(key==="disabled"){this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!value);}},_keydown:function(event){if(event.altKey||event.ctrlKey){return;}
var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1];break;}
if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);toFocus.focus();event.preventDefault();}},_panelKeyDown:function(event){if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){$(event.currentTarget).prev().focus();}},refresh:function(){var options=this.options;this._processPanels();if((options.active===false&&options.collapsible===true)||!this.headers.length){options.active=false;this.active=$();}else if(options.active===false){this._activate(0);}else if(this.active.length&&!$.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){options.active=false;this.active=$();}else{this._activate(Math.max(0,options.active-1));}}else{options.active=this.headers.index(this.active);}
this._destroyIcons();this._refresh();},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all");this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide();},_refresh:function(){var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent(),accordionId=this.accordionId="ui-accordion-"+
(this.element.attr("id")||++uid);this.active=this._findActive(options.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all");this.active.next().addClass("ui-accordion-content-active").show();this.headers.attr("role","tab").each(function(i){var header=$(this),headerId=header.attr("id"),panel=header.next(),panelId=panel.attr("id");if(!headerId){headerId=accordionId+"-header-"+i;header.attr("id",headerId);}
if(!panelId){panelId=accordionId+"-panel-"+i;panel.attr("id",panelId);}
header.attr("aria-controls",panelId);panel.attr("aria-labelledby",headerId);}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"});}
this._createIcons();this._setupEvents(options.event);if(heightStyle==="fill"){maxHeight=parent.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
maxHeight-=elem.outerHeight(true);});this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).css("height","").height());}).height(maxHeight);}},_activate:function(index){var active=this._findActive(index)[0];if(active===this.active[0]){return;}
active=active||this.active[0];this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop});},_findActive:function(selector){return typeof selector==="number"?this.headers.eq(selector):$();},_setupEvents:function(event){var events={keydown:"_keydown"};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
this._off(this.headers.add(this.headers.next()));this._on(this.headers,events);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers);},_eventHandler:function(event){var options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};event.preventDefault();if((clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
options.active=collapsing?false:this.headers.index(clicked);this.active=clickedIsActive?$():clicked;this._toggle(eventData);active.removeClass("ui-accordion-header-active ui-state-active");if(options.icons){active.children(".ui-accordion-header-icon").removeClass(options.icons.activeHeader).addClass(options.icons.header);}
if(!clickedIsActive){clicked.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top");if(options.icons){clicked.children(".ui-accordion-header-icon").removeClass(options.icons.header).addClass(options.icons.activeHeader);}
clicked.next().addClass("ui-accordion-content-active");}},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=toShow;this.prevHide=toHide;if(this.options.animate){this._animate(toShow,toHide,data);}else{toHide.hide();toShow.show();this._toggleComplete(data);}
toHide.attr({"aria-hidden":"true"});toHide.prev().attr("aria-selected","false");if(toShow.length&&toHide.length){toHide.prev().attr({"tabIndex":-1,"aria-expanded":"false"});}else if(toShow.length){this.headers.filter(function(){return $(this).attr("tabIndex")===0;}).attr("tabIndex",-1);}
toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"});},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,adjust=0,down=toShow.length&&(!toHide.length||(toShow.index()<toHide.index())),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){that._toggleComplete(data);};if(typeof options==="number"){duration=options;}
if(typeof options==="string"){easing=options;}
easing=easing||options.easing||animate.easing;duration=duration||options.duration||animate.duration;if(!toHide.length){return toShow.animate(showProps,duration,easing,complete);}
if(!toShow.length){return toHide.animate(hideProps,duration,easing,complete);}
total=toShow.show().outerHeight();toHide.animate(hideProps,{duration:duration,easing:easing,step:function(now,fx){fx.now=Math.round(now);}});toShow.hide().animate(showProps,{duration:duration,easing:easing,complete:complete,step:function(now,fx){fx.now=Math.round(now);if(fx.prop!=="height"){adjust+=fx.now;}else if(that.options.heightStyle!=="content"){fx.now=Math.round(total-toHide.outerHeight()-adjust);adjust=0;}}});},_toggleComplete:function(data){var toHide=data.oldPanel;toHide.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");if(toHide.length){toHide.parent()[0].className=toHide.parent()[0].className;}
this._trigger("activate",null,data);}});})(jQuery);(function($,undefined){$.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,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,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea?true:isInput?false:this.element.prop("isContentEditable");this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;}
suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:case keyCode.NUMPAD_ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);}
break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);}
break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){this._value(this.term);this.close(event);event.preventDefault();}
break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();}
return;}
if(suppressKeyPressRepeat){return;}
var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;}
this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){if(this.cancelBlur){delete this.cancelBlur;return;}
clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;});var menuElement=this.menu.element[0];if(!$(event.target).closest(".ui-menu-item").length){this._delay(function(){var that=this;this.document.one("mousedown",function(event){if(event.target!==that.element[0]&&event.target!==menuElement&&!$.contains(menuElement,event.target)){that.close();}});});}},menufocus:function(event,ui){if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}}
var item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}}else{this.liveRegion.text(item.value);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==this.document[0].activeElement){this.element.focus();this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});}
if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element);this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();}
if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());}
if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);}
if(!element){element=this.element.closest(".ui-front");}
if(!element.length){element=this.document[0].body;}
return element;},_initSource:function(){var array,url,that=this;if($.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();}
that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){if(this.term!==this._value()){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);}
if(this._trigger("search",event)===false){return;}
return this._search(value);},_search:function(value){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return $.proxy(function(content){if(index===this.requestIndex){this.__response(content);}
this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading");}},this);},__response:function(content){if(content){content=this._normalize(content);}
this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;}
return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};}
return $.extend({label:item.label||item.value,value:item.value||item.label},item);});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();}},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").append($("<a>").text(item.label)).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;}
if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){this._value(this.term);this.menu.blur();return;}
this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;}
if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;}
this.liveRegion.text(message);}});}(jQuery));(function($,undefined){var lastActive,baseClasses="ui-button ui-widget ui-state-default ui-corner-all",typeClasses="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",formResetHandler=function(){var form=$(this);setTimeout(function(){form.find(":ui-button").button("refresh");},1);},radioGroup=function(radio){var name=radio.name,form=radio.form,radios=$([]);if(name){name=name.replace(/'/g,"\\'");if(form){radios=$(form).find("[name='"+name+"']");}else{radios=$("[name='"+name+"']",radio.ownerDocument).filter(function(){return!this.form;});}}
return radios;};$.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,formResetHandler);if(typeof this.options.disabled!=="boolean"){this.options.disabled=!!this.element.prop("disabled");}else{this.element.prop("disabled",this.options.disabled);}
this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var that=this,options=this.options,toggleButton=this.type==="checkbox"||this.type==="radio",activeClass=!toggleButton?"ui-state-active":"";if(options.label===null){options.label=(this.type==="input"?this.buttonElement.val():this.buttonElement.html());}
this._hoverable(this.buttonElement);this.buttonElement.addClass(baseClasses).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(options.disabled){return;}
if(this===lastActive){$(this).addClass("ui-state-active");}}).bind("mouseleave"+this.eventNamespace,function(){if(options.disabled){return;}
$(this).removeClass(activeClass);}).bind("click"+this.eventNamespace,function(event){if(options.disabled){event.preventDefault();event.stopImmediatePropagation();}});this._on({focus:function(){this.buttonElement.addClass("ui-state-focus");},blur:function(){this.buttonElement.removeClass("ui-state-focus");}});if(toggleButton){this.element.bind("change"+this.eventNamespace,function(){that.refresh();});}
if(this.type==="checkbox"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(options.disabled){return false;}});}else if(this.type==="radio"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(options.disabled){return false;}
$(this).addClass("ui-state-active");that.buttonElement.attr("aria-pressed","true");var radio=that.element[0];radioGroup(radio).not(radio).map(function(){return $(this).button("widget")[0];}).removeClass("ui-state-active").attr("aria-pressed","false");});}else{this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(options.disabled){return false;}
$(this).addClass("ui-state-active");lastActive=this;that.document.one("mouseup",function(){lastActive=null;});}).bind("mouseup"+this.eventNamespace,function(){if(options.disabled){return false;}
$(this).removeClass("ui-state-active");}).bind("keydown"+this.eventNamespace,function(event){if(options.disabled){return false;}
if(event.keyCode===$.ui.keyCode.SPACE||event.keyCode===$.ui.keyCode.ENTER){$(this).addClass("ui-state-active");}}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){$(this).removeClass("ui-state-active");});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(event){if(event.keyCode===$.ui.keyCode.SPACE){$(this).click();}});}}
this._setOption("disabled",options.disabled);this._resetButton();},_determineButtonType:function(){var ancestor,labelSelector,checked;if(this.element.is("[type=checkbox]")){this.type="checkbox";}else if(this.element.is("[type=radio]")){this.type="radio";}else if(this.element.is("input")){this.type="input";}else{this.type="button";}
if(this.type==="checkbox"||this.type==="radio"){ancestor=this.element.parents().last();labelSelector="label[for='"+this.element.attr("id")+"']";this.buttonElement=ancestor.find(labelSelector);if(!this.buttonElement.length){ancestor=ancestor.length?ancestor.siblings():this.element.siblings();this.buttonElement=ancestor.filter(labelSelector);if(!this.buttonElement.length){this.buttonElement=ancestor.find(labelSelector);}}
this.element.addClass("ui-helper-hidden-accessible");checked=this.element.is(":checked");if(checked){this.buttonElement.addClass("ui-state-active");}
this.buttonElement.prop("aria-pressed",checked);}else{this.buttonElement=this.element;}},widget:function(){return this.buttonElement;},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(baseClasses+" ui-state-active "+typeClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title");}},_setOption:function(key,value){this._super(key,value);if(key==="disabled"){this.element.prop("disabled",!!value);if(value){this.buttonElement.removeClass("ui-state-focus");}
return;}
this._resetButton();},refresh:function(){var isDisabled=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOption("disabled",isDisabled);}
if(this.type==="radio"){radioGroup(this.element[0]).each(function(){if($(this).is(":checked")){$(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true");}else{$(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false");}});}else if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true");}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false");}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label);}
return;}
var buttonElement=this.buttonElement.removeClass(typeClasses),buttonText=$("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),icons=this.options.icons,multipleIcons=icons.primary&&icons.secondary,buttonClasses=[];if(icons.primary||icons.secondary){if(this.options.text){buttonClasses.push("ui-button-text-icon"+(multipleIcons?"s":(icons.primary?"-primary":"-secondary")));}
if(icons.primary){buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>");}
if(icons.secondary){buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>");}
if(!this.options.text){buttonClasses.push(multipleIcons?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){buttonElement.attr("title",$.trim(buttonText));}}}else{buttonClasses.push("ui-button-text-only");}
buttonElement.addClass(buttonClasses.join(" "));}});$.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset");},_init:function(){this.refresh();},_setOption:function(key,value){if(key==="disabled"){this.buttons.button("option",key,value);}
this._super(key,value);},refresh:function(){var rtl=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return $(this).button("widget")[0];}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(rtl?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(rtl?"ui-corner-left":"ui-corner-right").end().end();},_destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return $(this).button("widget")[0];}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");}});}(jQuery));(function($,undefined){$.extend($.ui,{datepicker:{version:"1.10.4"}});var PROP_NAME="datepicker",instActive;function Datepicker(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;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:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));}
$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase();inline=(nodeName==="div"||nodeName==="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid;}
inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{});if(nodeName==="input"){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return;}
this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);this._autoSize(inst);$.data(target,PROP_NAME,inst);if(inst.settings.disabled){this._disableDatepicker(target);}},_attachments:function(input,inst){var showOn,buttonText,buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove();}
if(appendText){inst.append=$("<span class='"+this._appendClass+"'>"+appendText+"</span>");input[isRTL?"before":"after"](inst.append);}
input.unbind("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove();}
showOn=this._get(inst,"showOn");if(showOn==="focus"||showOn==="both"){input.focus(this._showDatepicker);}
if(showOn==="button"||showOn==="both"){buttonText=this._get(inst,"buttonText");buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$("<button type='button'></button>").addClass(this._triggerClass).html(!buttonImage?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){$.datepicker._hideDatepicker();}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0]);}else{$.datepicker._showDatepicker(input[0]);}
return false;});}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,12-1,20),dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){findMax=function(names){max=0;maxI=0;for(i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}}
return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay());}
inst.input.attr("size",this._formatDate(inst,date).length);}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return;}
divSpan.addClass(this.markerClassName).append(inst.dpDiv);$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target);}
inst.dpDiv.css("display","block");},_dialogDatepicker:function(input,date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;if(!inst){this.uuid+=1;id="dp"+this.uuid;this._dialogInput=$("<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst);}
extendRemove(inst.settings,settings||{});date=(date&&date.constructor===Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight;scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv);}
$.data(this._dialogInput[0],PROP_NAME,inst);return this;},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName==="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp);}else if(nodeName==="div"||nodeName==="span"){$target.removeClass(this.markerClassName).empty();}},_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});},_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;}
for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]===target){return true;}}
return false;},_getInst:function(target){try{return $.data(target,PROP_NAME);}
catch(err){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(target);if(arguments.length===2&&typeof name==="string"){return(name==="defaults"?$.extend({},$.datepicker._defaults):(inst?(name==="all"?$.extend({},inst.settings):this._get(inst,name)):null));}
settings=name||{};if(typeof name==="string"){settings={};settings[name]=value;}
if(inst){if(this._curInst===inst){this._hideDatepicker();}
date=this._getDateDatepicker(target,true);minDate=this._getMinMaxDate(inst,"min");maxDate=this._getMinMaxDate(inst,"max");extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate);}
if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate);}
if("disabled"in settings){if(settings.disabled){this._disableDatepicker(target);}else{this._enableDatepicker(target);}}
this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault);}
return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=true,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:sel=$("td."+$.datepicker._dayOverClass+":not(."+
$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);}
onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else{$.datepicker._hideDatepicker();}
return false;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");}
break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D");}
handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");}
break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D");}
handled=event.ctrlKey||event.metaKey;break;default:handled=false;}}else if(event.keyCode===36&&event.ctrlKey){$.datepicker._showDatepicker(this);}else{handled=false;}
if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var chars,chr,inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));chr=String.fromCharCode(event.charCode==null?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var date,inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal){try{date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);}}
catch(err){}}
return true;},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!=="input"){input=$("input",input.parentNode)[0];}
if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){return;}
var inst,beforeShow,beforeShowSettings,isFixed,offset,showAnim,duration;inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!==inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);}}
beforeShow=$.datepicker._get(inst,"beforeShow");beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return;}
extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value="";}
if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")==="fixed";return!isFixed;});offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){showAnim=$.datepicker._get(inst,"showAnim");duration=$.datepicker._get(inst,"duration");inst.dpDiv.zIndex($(input).zIndex()+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects.effect[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration);}else{inst.dpDiv[showAnim||"show"](showAnim?duration:null);}
if($.datepicker._shouldFocusInput(inst)){inst.input.focus();}
$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){this.maxRows=4;instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);inst.dpDiv.find("."+this._dayOverClass+" a").mouseover();var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17;inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em");}
inst.dpDiv[(numMonths[0]!==1||numMonths[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)){inst.input.focus();}
if(inst.yearshtml){origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);}
origyearshtml=inst.yearshtml=null;},0);}},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus");},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left===inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top===(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset;},_findPos:function(obj){var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");while(obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"];}
position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;if(!inst||(input&&inst!==$.data(input,PROP_NAME))){return;}
if(this._datepickerShowing){showAnim=this._get(inst,"showAnim");duration=this._get(inst,"duration");postProcess=function(){$.datepicker._tidyDialog(inst);};if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);}else{inst.dpDiv[(showAnim==="slideDown"?"slideUp":(showAnim==="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess);}
if(!showAnim){postProcess();}
this._datepickerShowing=false;onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst]);}
this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv);}}
this._inDialog=false;}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;}
var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!==$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length===0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst)){$.datepicker._hideDatepicker();}},_adjustDate:function(id,offset,period){var target=$(id),inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;}
this._adjustInstDate(inst,offset+
(period==="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst);},_gotoToday:function(id){var date,target=$(id),inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}else{date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);inst["selected"+(period==="M"?"Month":"Year")]=inst["draw"+(period==="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_selectDay:function(id,month,year,td){var inst,target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;}
inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));},_clearDate:function(id){var target=$(id);this._selectDate(target,"");},_selectDate:function(id,dateStr){var onSelect,target=$(id),inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr);}
this._updateAlternate(inst);onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else if(inst.input){inst.input.trigger("change");}
if(inst.inline){this._updateDatepicker(inst);}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!=="object"){inst.input.focus();}
this._lastInput=null;}},_updateAlternate:function(inst){var altFormat,date,dateStr,altField=this._get(inst,"altField");if(altField){altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr);});}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var time,checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments";}
value=(typeof value==="object"?value.toString():value+"");if(value===""){return null;}
var iFormat,dim,extra,iValue=0,shortYearCutoffTemp=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff=(typeof shortYearCutoffTemp!=="string"?shortYearCutoffTemp:new Date().getFullYear()%100+parseInt(shortYearCutoffTemp,10)),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=false,date,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},getNumber=function(match){var isDoubled=lookAhead(match),size=(match==="@"?14:(match==="!"?20:(match==="y"&&isDoubled?4:(match==="o"?3:2)))),digits=new RegExp("^\\d{1,"+size+"}"),num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue;}
iValue+=num[0].length;return parseInt(num[0],10);},getName=function(match,shortNames,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]];}).sort(function(a,b){return-(a[1].length-b[1].length);});$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()===name.toLowerCase()){index=pair[0];iValue+=name.length;return false;}});if(index!==-1){return index+1;}else{throw"Unknown name at position "+iValue;}},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;}
iValue++;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral();}else{literal=true;}
break;default:checkLiteral();}}}
if(iValue<value.length){extra=value.substr(iValue);if(!/^\s+/.test(extra)){throw"Extra/unparsed characters found in date: "+extra;}}
if(year===-1){year=new Date().getFullYear();}else if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);}
if(doy>-1){month=1;day=doy;do{dim=this._getDaysInMonth(year,month-1);if(day<=dim){break;}
month++;day-=dim;}while(true);}
date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day){throw"Invalid date";}
return date;},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:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+
Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return"";}
var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num;}}
return num;},formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);},output="",literal=false;if(date){for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'";}else{literal=true;}
break;default:output+=format.charAt(iFormat);}}}}
return output;},_possibleChars:function(format){var iFormat,chars="",literal=false,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'";}else{literal=true;}
break;default:chars+=format.charAt(iFormat);}}}
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst,noDefault){if(inst.input.val()===inst.lastVal){return;}
var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){dates=(noDefault?"":dates);}
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;},offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst));}
catch(e){}
var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date(),year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;}
matches=pattern.exec(offset);}
return new Date(year,month,day);},newDate=(date==null||date===""?defaultDate:(typeof date==="string"?offsetString(date):(typeof date==="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()==="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0);}
return this._daylightSavingAdjust(newDate);},_daylightSavingAdjust:function(date){if(!date){return null;}
date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){this._notifyChange(inst);}
this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M");},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M");},hide:function(){$.datepicker._hideDatepicker();},today:function(){$.datepicker._gotoToday(id);},selectDay:function(){$.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false;},selectMonth:function(){$.datepicker._selectMonthYear(id,this,"M");return false;},selectYear:function(){$.datepicker._selectMonthYear(id,this,"Y");return false;}};$(this).bind(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")]);});},_generateHTML:function(inst){var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date(),today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=(numMonths[0]!==1||numMonths[1]!==1),currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay))),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;}
if(maxDate){maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
inst.drawMonth=drawMonth;inst.drawYear=drawYear;prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'"+" title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>":(hideIfNoPrevNext?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>"));nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'"+" title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>":(hideIfNoPrevNext?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>"));currentText=this._get(inst,"currentText");gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));controls=(!inst.inline?"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+
this._get(inst,"closeText")+"</button>":"");buttonPanel=(showButtonPanel)?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(isRTL?controls:"")+
(this._isInRange(inst,gotoDate)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'"+">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);showWeek=this._get(inst,"showWeek");dayNames=this._get(inst,"dayNames");dayNamesMin=this._get(inst,"dayNamesMin");monthNames=this._get(inst,"monthNames");monthNamesShort=this._get(inst,"monthNamesShort");beforeShowDay=this._get(inst,"beforeShowDay");showOtherMonths=this._get(inst,"showOtherMonths");selectOtherMonths=this._get(inst,"selectOtherMonths");defaultDate=this._getDefaultDate(inst);html="";dow;for(row=0;row<numMonths[0];row++){group="";this.maxRows=4;for(col=0;col<numMonths[1];col++){selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));cornerClass=" ui-corner-all";calender="";if(isMultiMonth){calender+="<div class='ui-datepicker-group";if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break;}}
calender+="'>";}
calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+
(/all|left/.test(cornerClass)&&row===0?(isRTL?next:prev):"")+
(/all|right/.test(cornerClass)&&row===0?(isRTL?prev:next):"")+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";thead=(showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"");for(dow=0;dow<7;dow++){day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+dayNames[day]+"'>"+dayNamesMin[day]+"</span></th>";}
calender+=thead+"</tr></thead><tbody>";daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);}
leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;curRows=Math.ceil((leadDays+daysInMonth)/7);numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(dRow=0;dRow<numRows;dRow++){calender+="<tr>";tbody=(!showWeek?"":"<td class='ui-datepicker-week-col'>"+
this._get(inst,"calculateWeek")(printDate)+"</td>");for(dow=0;dow<7;dow++){daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);otherMonth=(printDate.getMonth()!==drawMonth);unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+="<td class='"+
((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+
(otherMonth?" ui-datepicker-other-month":"")+
((printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime())?" "+this._dayOverClass:"")+
(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+
(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+
(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+
(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+
((!otherMonth||showOtherMonths)&&daySettings[2]?" title='"+daySettings[2].replace(/'/g,"&#39;")+"'":"")+
(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+
(otherMonth&&!showOtherMonths?"&#xa0;":(unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+
(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+
(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+
(otherMonth?" ui-priority-secondary":"")+"' href='#'>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
calender+=tbody+"</tr>";}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
calender+="</tbody></table>"+(isMultiMonth?"</div>"+
((numMonths[0]>0&&col===numMonths[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");group+=calender;}
html+=group;}
html+=buttonPanel;inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth){monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>";}else{inMinYear=(minDate&&minDate.getFullYear()===drawYear);inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear);monthHtml+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+="<option value='"+month+"'"+
(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>";}}
monthHtml+="</select>";}
if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?"&#xa0;":"");}
if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";}else{years=this._get(inst,"yearRange").split(":");thisYear=new Date().getFullYear();determineYear=function(value){var year=(value.match(/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+\-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year);};year=determineYear(years[0]);endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;year<=endYear;year++){inst.yearshtml+="<option value='"+year+"'"+
(year===drawYear?" selected='selected'":"")+">"+year+"</option>";}
inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null;}}
html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml;}
html+="</div>";return html;},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period==="Y"?offset:0),month=inst.drawMonth+(period==="M"?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period==="D"?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period==="M"||period==="Y"){this._notifyChange(inst);}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),newDate=(minDate&&date<minDate?minDate:date);return(maxDate&&newDate>maxDate?maxDate:newDate);},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths==="number"?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null);},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));}
return this._isInRange(inst,date);},_isInRange:function(inst,date){var yearSplit,currentYear,minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,maxYear=null,years=this._get(inst,"yearRange");if(years){yearSplit=years.split(":");currentYear=new Date().getFullYear();minYear=parseInt(yearSplit[0],10);maxYear=parseInt(yearSplit[1],10);if(yearSplit[0].match(/[+\-].*/)){minYear+=currentYear;}
if(yearSplit[1].match(/[+\-].*/)){maxYear+=currentYear;}}
return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!=="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
var date=(day?(typeof day==="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst));}});function bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.delegate(selector,"mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).removeClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).removeClass("ui-datepicker-next-hover");}}).delegate(selector,"mouseover",function(){if(!$.datepicker._isDisabledDatepicker(instActive.inline?dpDiv.parent()[0]:instActive.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).addClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).addClass("ui-datepicker-next-hover");}}});}
function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=props[name];}}
return target;}
$.fn.datepicker=function(options){if(!this.length){return this;}
if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick);$.datepicker.initialized=true;}
if($("#"+$.datepicker._mainDivId).length===0){$("body").append($.datepicker.dpDiv);}
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
return this.each(function(){typeof options==="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.10.4";})(jQuery);(function($,undefined){var sizeRelatedOptions={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};$.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:true,buttons:[],closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css("top",pos.top-topOffset);}}},resizable:true,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},_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");this.options.title=this.options.title||this.originalTitle;this._createWrapper();this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog);this._createTitlebar();this._createButtonPane();if(this.options.draggable&&$.fn.draggable){this._makeDraggable();}
if(this.options.resizable&&$.fn.resizable){this._makeResizable();}
this._isOpen=false;},_init:function(){if(this.options.autoOpen){this.open();}},_appendTo:function(){var element=this.options.appendTo;if(element&&(element.jquery||element.nodeType)){return $(element);}
return this.document.find(element||"body").eq(0);},_destroy:function(){var next,originalPosition=this.originalPosition;this._destroyOverlay();this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach();this.uiDialog.stop(true,true).remove();if(this.originalTitle){this.element.attr("title",this.originalTitle);}
next=originalPosition.parent.children().eq(originalPosition.index);if(next.length&&next[0]!==this.element[0]){next.before(this.element);}else{originalPosition.parent.append(this.element);}},widget:function(){return this.uiDialog;},disable:$.noop,enable:$.noop,close:function(event){var activeElement,that=this;if(!this._isOpen||this._trigger("beforeClose",event)===false){return;}
this._isOpen=false;this._destroyOverlay();if(!this.opener.filter(":focusable").focus().length){try{activeElement=this.document[0].activeElement;if(activeElement&&activeElement.nodeName.toLowerCase()!=="body"){$(activeElement).blur();}}catch(error){}}
this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event);});},isOpen:function(){return this._isOpen;},moveToTop:function(){this._moveToTop();},_moveToTop:function(event,silent){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event);}
return moved;},open:function(){var that=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable();}
return;}
this._isOpen=true;this.opener=$(this.document[0].activeElement);this._size();this._position();this._createOverlay();this._moveToTop(null,true);this._show(this.uiDialog,this.options.show,function(){that._focusTabbable();that._trigger("focus");});this._trigger("open");},_focusTabbable:function(){var hasFocus=this.element.find("[autofocus]");if(!hasFocus.length){hasFocus=this.element.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogButtonPane.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogTitlebarClose.filter(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialog;}
hasFocus.eq(0).focus();},_keepFocus:function(event){function checkFocus(){var activeElement=this.document[0].activeElement,isActive=this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement);if(!isActive){this._focusTabbable();}}
event.preventDefault();checkFocus.call(this);this._delay(checkFocus);},_createWrapper:function(){this.uiDialog=$("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+
this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){event.preventDefault();this.close(event);return;}
if(event.keyCode!==$.ui.keyCode.TAB){return;}
var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.filter(":first"),last=tabbables.filter(":last");if((event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){first.focus(1);event.preventDefault();}else if((event.target===first[0]||event.target===this.uiDialog[0])&&event.shiftKey){last.focus(1);event.preventDefault();}},mousedown:function(event){if(this._moveToTop(event)){this._focusTabbable();}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")});}},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog);this._on(this.uiDialogTitlebar,{mousedown:function(event){if(!$(event.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.focus();}}});this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:false}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar);this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault();this.close(event);}});uiDialogTitle=$("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar);this._title(uiDialogTitle);this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")});},_title:function(title){if(!this.options.title){title.html("&#160;");}
title.text(this.options.title);},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiButtonSet=$("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);this._createButtons();},_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if($.isEmptyObject(buttons)||($.isArray(buttons)&&!buttons.length)){this.uiDialog.removeClass("ui-dialog-buttons");return;}
$.each(buttons,function(name,props){var click,buttonOptions;props=$.isFunction(props)?{click:props,text:name}:props;props=$.extend({type:"button"},props);click=props.click;props.click=function(){click.apply(that.element[0],arguments);};buttonOptions={icons:props.icons,text:props.showText};delete props.icons;delete props.showText;$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet);});this.uiDialog.addClass("ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog);},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui){return{position:ui.position,offset:ui.offset};}
this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){$(this).addClass("ui-dialog-dragging");that._blockFrames();that._trigger("dragStart",event,filteredUi(ui));},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui));},stop:function(event,ui){options.position=[ui.position.left-that.document.scrollLeft(),ui.position.top-that.document.scrollTop()];$(this).removeClass("ui-dialog-dragging");that._unblockFrames();that._trigger("dragStop",event,filteredUi(ui));}});},_makeResizable:function(){var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size};}
this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");that._blockFrames();that._trigger("resizeStart",event,filteredUi(ui));},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui));},stop:function(event,ui){options.height=$(this).height();options.width=$(this).width();$(this).removeClass("ui-dialog-resizing");that._unblockFrames();that._trigger("resizeStop",event,filteredUi(ui));}}).css("position",position);},_minHeight:function(){var options=this.options;return options.height==="auto"?options.minHeight:Math.min(options.minHeight,options.height);},_position:function(){var isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}
this.uiDialog.position(this.options.position);if(!isVisible){this.uiDialog.hide();}},_setOptions:function(options){var that=this,resize=false,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value);if(key in sizeRelatedOptions){resize=true;}
if(key in resizableRelatedOptions){resizableOptions[key]=value;}});if(resize){this._size();this._position();}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",resizableOptions);}},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;if(key==="dialogClass"){uiDialog.removeClass(this.options.dialogClass).addClass(value);}
if(key==="disabled"){return;}
this._super(key,value);if(key==="appendTo"){this.uiDialog.appendTo(this._appendTo());}
if(key==="buttons"){this._createButtons();}
if(key==="closeText"){this.uiDialogTitlebarClose.button({label:""+value});}
if(key==="draggable"){isDraggable=uiDialog.is(":data(ui-draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy");}
if(!isDraggable&&value){this._makeDraggable();}}
if(key==="position"){this._position();}
if(key==="resizable"){isResizable=uiDialog.is(":data(ui-resizable)");if(isResizable&&!value){uiDialog.resizable("destroy");}
if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value);}
if(!isResizable&&value!==false){this._makeResizable();}}
if(key==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));}},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(options.minWidth>options.width){options.width=options.minWidth;}
nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);maxContentHeight=typeof options.maxHeight==="number"?Math.max(0,options.maxHeight-nonContentHeight):"none";if(options.height==="auto"){this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"});}else{this.element.height(Math.max(0,options.height-nonContentHeight));}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight());}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_allowInteraction:function(event){if($(event.target).closest(".ui-dialog").length){return true;}
return!!$(event.target).closest(".ui-datepicker").length;},_createOverlay:function(){if(!this.options.modal){return;}
var that=this,widgetFullName=this.widgetFullName;if(!$.ui.dialog.overlayInstances){this._delay(function(){if($.ui.dialog.overlayInstances){this.document.bind("focusin.dialog",function(event){if(!that._allowInteraction(event)){event.preventDefault();$(".ui-dialog:visible:last .ui-dialog-content").data(widgetFullName)._focusTabbable();}});}});}
this.overlay=$("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo());this._on(this.overlay,{mousedown:"_keepFocus"});$.ui.dialog.overlayInstances++;},_destroyOverlay:function(){if(!this.options.modal){return;}
if(this.overlay){$.ui.dialog.overlayInstances--;if(!$.ui.dialog.overlayInstances){this.document.unbind("focusin.dialog");}
this.overlay.remove();this.overlay=null;}}});$.ui.dialog.overlayInstances=0;if($.uiBackCompat!==false){$.widget("ui.dialog",$.ui.dialog,{_position:function(){var position=this.options.position,myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||(typeof position==="object"&&"0"in position)){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0];}
$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition;}});position={my:myAt[0]+(offset[0]<0?offset[0]:"+"+offset[0])+" "+
myAt[1]+(offset[1]<0?offset[1]:"+"+offset[1]),at:myAt.join(" ")};}
position=$.extend({},$.ui.dialog.prototype.options.position,position);}else{position=$.ui.dialog.prototype.options.position;}
isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}
this.uiDialog.position(position);if(!isVisible){this.uiDialog.hide();}}});}}(jQuery));(function($,undefined){$.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},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=false;this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,$.proxy(function(event){if(this.options.disabled){event.preventDefault();}},this));if(this.options.disabled){this.element.addClass("ui-state-disabled").attr("aria-disabled","true");}
this._on({"mousedown .ui-menu-item > a":function(event){event.preventDefault();},"click .ui-state-disabled > a":function(event){event.preventDefault();},"click .ui-menu-item:has(a)":function(event){var target=$(event.target).closest(".ui-menu-item");if(!this.mouseHandled&&target.not(".ui-state-disabled").length){this.select(event);if(!event.isPropagationStopped()){this.mouseHandled=true;}
if(target.has(".ui-menu").length){this.expand(event);}else if(!this.element.is(":focus")&&$(this.document[0].activeElement).closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer);}}}},"mouseenter .ui-menu-item":function(event){var target=$(event.currentTarget);target.siblings().children(".ui-state-active").removeClass("ui-state-active");this.focus(event,target);},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.children(".ui-menu-item").eq(0);if(!keepActiveItem){this.focus(event,item);}},blur:function(event){this._delay(function(){if(!$.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(event);}});},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(event){if(!$(event.target).closest(".ui-menu").length){this.collapseAll(event);}
this.mouseHandled=false;}});},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var elem=$(this);if(elem.data("ui-menu-submenu-carat")){elem.remove();}});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content");},_keydown:function(event){var match,prev,character,skip,regex,preventDefault=true;function escape(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");}
switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(event);}
break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=false;prev=this.previousFilter||"";character=String.fromCharCode(event.keyCode);skip=false;clearTimeout(this.filterTimer);if(character===prev){skip=true;}else{character=prev+character;}
regex=new RegExp("^"+escape(character),"i");match=this.activeMenu.children(".ui-menu-item").filter(function(){return regex.test($(this).children("a").text());});match=skip&&match.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):match;if(!match.length){character=String.fromCharCode(event.keyCode);regex=new RegExp("^"+escape(character),"i");match=this.activeMenu.children(".ui-menu-item").filter(function(){return regex.test($(this).children("a").text());});}
if(match.length){this.focus(event,match);if(match.length>1){this.previousFilter=character;this.filterTimer=this._delay(function(){delete this.previousFilter;},1000);}else{delete this.previousFilter;}}else{delete this.previousFilter;}}
if(preventDefault){event.preventDefault();}},_activate:function(event){if(!this.active.is(".ui-state-disabled")){if(this.active.children("a[aria-haspopup='true']").length){this.expand(event);}else{this.select(event);}}},refresh:function(){var menus,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length);submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.prev("a"),submenuCarat=$("<span>").addClass("ui-menu-icon ui-icon "+icon).data("ui-menu-submenu-carat",true);item.attr("aria-haspopup","true").prepend(submenuCarat);menu.attr("aria-labelledby",item.attr("id"));});menus=submenus.add(this.element);menus.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()});menus.children(":not(.ui-menu-item)").each(function(){var item=$(this);if(!/[^\-\u2014\u2013\s]/.test(item.text())){item.addClass("ui-widget-content ui-menu-divider");}});menus.children(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!$.contains(this.element[0],this.active[0])){this.blur();}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role];},_setOption:function(key,value){if(key==="icons"){this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu);}
this._super(key,value);},focus:function(event,item){var nested,focused;this.blur(event,event&&event.type==="focus");this._scrollIntoView(item);this.active=item.first();focused=this.active.children("a").addClass("ui-state-focus");if(this.options.role){this.element.attr("aria-activedescendant",focused.attr("id"));}
this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");if(event&&event.type==="keydown"){this._close();}else{this.timer=this._delay(function(){this._close();},this.delay);}
nested=item.children(".ui-menu");if(nested.length&&event&&(/^mouse/.test(event.type))){this._startOpening(nested);}
this.activeMenu=item.parent();this._trigger("focus",event,{item:item});},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;if(this._hasScroll()){borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0;paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0;offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop;scroll=this.activeMenu.scrollTop();elementHeight=this.activeMenu.height();itemHeight=item.height();if(offset<0){this.activeMenu.scrollTop(scroll+offset);}else if(offset+itemHeight>elementHeight){this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight);}}},blur:function(event,fromFocus){if(!fromFocus){clearTimeout(this.timer);}
if(!this.active){return;}
this.active.children("a").removeClass("ui-state-focus");this.active=null;this._trigger("blur",event,{item:this.active});},_startOpening:function(submenu){clearTimeout(this.timer);if(submenu.attr("aria-hidden")!=="true"){return;}
this.timer=this._delay(function(){this._close();this._open(submenu);},this.delay);},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true");submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position);},collapseAll:function(event,all){clearTimeout(this.timer);this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));if(!currentMenu.length){currentMenu=this.element;}
this._close(currentMenu);this.blur(event);this.activeMenu=currentMenu;},this.delay);},_close:function(startMenu){if(!startMenu){startMenu=this.active?this.active.parent():this.element;}
startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active");},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(newItem&&newItem.length){this._close();this.focus(event,newItem);}},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();if(newItem&&newItem.length){this._open(newItem.parent());this._delay(function(){this.focus(event,newItem);});}},next:function(event){this._move("next","first",event);},previous:function(event){this._move("prev","last",event);},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},_move:function(direction,filter,event){var next;if(this.active){if(direction==="first"||direction==="last"){next=this.active
[direction==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1);}else{next=this.active
[direction+"All"](".ui-menu-item").eq(0);}}
if(!next||!next.length||!this.active){next=this.activeMenu.children(".ui-menu-item")[filter]();}
this.focus(event,next);},nextPage:function(event){var item,base,height;if(!this.active){this.next(event);return;}
if(this.isLastItem()){return;}
if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base-height<0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.children(".ui-menu-item")
[!this.active?"first":"last"]());}},previousPage:function(event){var item,base,height;if(!this.active){this.next(event);return;}
if(this.isFirstItem()){return;}
if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base+height>0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.children(".ui-menu-item").first());}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight");},select:function(event){this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(event,true);}
this._trigger("select",event,ui);}});}(jQuery));(function($,undefined){$.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min});this.valueDiv=$("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this._refreshValue();},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();},value:function(newValue){if(newValue===undefined){return this.options.value;}
this.options.value=this._constrainedValue(newValue);this._refreshValue();},_constrainedValue:function(newValue){if(newValue===undefined){newValue=this.options.value;}
this.indeterminate=newValue===false;if(typeof newValue!=="number"){newValue=0;}
return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,newValue));},_setOptions:function(options){var value=options.value;delete options.value;this._super(options);this.options.value=this._constrainedValue(value);this._refreshValue();},_setOption:function(key,value){if(key==="max"){value=Math.max(this.min,value);}
this._super(key,value);},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min);},_refreshValue:function(){var value=this.options.value,percentage=this._percentage();this.valueDiv.toggle(this.indeterminate||value>this.min).toggleClass("ui-corner-right",value===this.options.max).width(percentage.toFixed(0)+"%");this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=$("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv);}}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":value});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null;}}
if(this.oldValue!==value){this.oldValue=value;this._trigger("change");}
if(value===this.options.max){this._trigger("complete");}}});})(jQuery);(function($,undefined){var numPages=5;$.widget("ui.slider",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._refresh();this._setOption("disabled",this.options.disabled);this._animateOff=false;},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue();},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),handle="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",handles=[];handleCount=(options.values&&options.values.length)||1;if(existingHandles.length>handleCount){existingHandles.slice(handleCount).remove();existingHandles=existingHandles.slice(0,handleCount);}
for(i=existingHandles.length;i<handleCount;i++){handles.push(handle);}
this.handles=existingHandles.add($(handles.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(i){$(this).data("ui-slider-handle-index",i);});},_createRange:function(){var options=this.options,classes="";if(options.range){if(options.range===true){if(!options.values){options.values=[this._valueMin(),this._valueMin()];}else if(options.values.length&&options.values.length!==2){options.values=[options.values[0],options.values[0]];}else if($.isArray(options.values)){options.values=options.values.slice(0);}}
if(!this.range||!this.range.length){this.range=$("<div></div>").appendTo(this.element);classes="ui-slider-range"+" ui-widget-header ui-corner-all";}else{this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({"left":"","bottom":""});}
this.range.addClass(classes+
((options.range==="min"||options.range==="max")?" ui-slider-range-"+options.range:""));}else{if(this.range){this.range.remove();}
this.range=null;}},_setupEvents:function(){var elements=this.handles.add(this.range).filter("a");this._off(elements);this._on(elements,this._handleEvents);this._hoverable(elements);this._focusable(elements);},_destroy:function(){this.handles.remove();if(this.range){this.range.remove();}
this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._mouseDestroy();},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;if(o.disabled){return false;}
this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));if((distance>thisDistance)||(distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))){distance=thisDistance;closestHandle=$(this);index=i;}});allowed=this._start(event,index);if(allowed===false){return false;}
this._mouseSliding=true;this._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-
(closestHandle.height()/2)-
(parseInt(closestHandle.css("borderTopWidth"),10)||0)-
(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+
(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue);}
this._animateOff=true;return true;},_mouseStart:function(){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false;},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal";},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}
percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1;}
if(percentMouse<0){percentMouse=0;}
if(this.orientation==="vertical"){percentMouse=1-percentMouse;}
valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse);},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
return this._trigger("start",event,uiHash);},_slide:function(event,index,newVal){var otherVal,newValues,allowed;if(this.options.values&&this.options.values.length){otherVal=this.values(index?0:1);if((this.options.values.length===2&&this.options.range===true)&&((index===0&&newVal>otherVal)||(index===1&&newVal<otherVal))){newVal=otherVal;}
if(newVal!==this.values(index)){newValues=this.values();newValues[index]=newVal;allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues});otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal);}}}else{if(newVal!==this.value()){allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal});if(allowed!==false){this.value(newVal);}}}},_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("stop",event,uiHash);},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._lastChangedValue=index;this._trigger("change",event,uiHash);}},value:function(newValue){if(arguments.length){this.options.value=this._trimAlignValue(newValue);this._refreshValue();this._change(null,0);return;}
return this._value();},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return;}
if(arguments.length){if($.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(newValues[i]);this._change(null,i);}
this._refreshValue();}else{if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}}else{return this._values();}},_setOption:function(key,value){var i,valsLength=0;if(key==="range"&&this.options.range===true){if(value==="min"){this.options.value=this._values(0);this.options.values=null;}else if(value==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null;}}
if($.isArray(this.options.values)){valsLength=this.options.values.length;}
$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=0;i<valsLength;i+=1){this._change(null,i);}
this._animateOff=false;break;case"min":case"max":this._animateOff=true;this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break;}},_value:function(){var val=this.options.value;val=this._trimAlignValue(val);return val;},_values:function(index){var val,vals,i;if(arguments.length){val=this.options.values[index];val=this._trimAlignValue(val);return val;}else if(this.options.values&&this.options.values.length){vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i]);}
return vals;}else{return[];}},_trimAlignValue:function(val){if(val<=this._valueMin()){return this._valueMin();}
if(val>=this._valueMax()){return this._valueMax();}
var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step);}
return parseFloat(alignValue.toFixed(5));},_valueMin:function(){return this.options.min;},_valueMax:function(){return this.options.max;},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=(!this._animateOff)?o.animate:false,_set={};if(this.options.values&&this.options.values.length){this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100;_set[that.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(that.options.range===true){if(that.orientation==="horizontal"){if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate);}
if(i===1){that.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}else{if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate);}
if(i===1){that.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}}
lastValPercent=valPercent;});}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[this.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate);}
if(oRange==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(100-valPercent)+"%"},{queue:false,duration:o.animate});}
if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate);}
if(oRange==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(100-valPercent)+"%"},{queue:false,duration:o.animate});}}},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:event.preventDefault();if(!this._keySliding){this._keySliding=true;$(event.target).addClass("ui-state-active");allowed=this._start(event,index);if(allowed===false){return;}}
break;}
step=this.options.step;if(this.options.values&&this.options.values.length){curVal=newVal=this.values(index);}else{curVal=newVal=this.value();}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+((this._valueMax()-this._valueMin())/numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-((this._valueMax()-this._valueMin())/numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax()){return;}
newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin()){return;}
newVal=this._trimAlignValue(curVal-step);break;}
this._slide(event,index,newVal);},click:function(event){event.preventDefault();},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(event,index);this._change(event,index);$(event.target).removeClass("ui-state-active");}}}});}(jQuery));(function($){function modifier(fn){return function(){var previous=this.element.val();fn.apply(this,arguments);this._refresh();if(previous!==this.element.val()){this._trigger("change");}};}
$.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,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);if(this.value()!==""){this._value(this.element.val(),true);}
this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_getCreateOptions:function(){var options={},element=this.element;$.each(["min","max","step"],function(i,option){var value=element.attr(option);if(value!==undefined&&value.length){options[option]=value;}});return options;},_events:{keydown:function(event){if(this._start(event)&&this._keydown(event)){event.preventDefault();}},keyup:"_stop",focus:function(){this.previous=this.element.val();},blur:function(event){if(this.cancelBlur){delete this.cancelBlur;return;}
this._stop();this._refresh();if(this.previous!==this.element.val()){this._trigger("change",event);}},mousewheel:function(event,delta){if(!delta){return;}
if(!this.spinning&&!this._start(event)){return false;}
this._spin((delta>0?1:-1)*this.options.step,event);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(event);}},100);event.preventDefault();},"mousedown .ui-spinner-button":function(event){var previous;previous=this.element[0]===this.document[0].activeElement?this.previous:this.element.val();function checkFocus(){var isActive=this.element[0]===this.document[0].activeElement;if(!isActive){this.element.focus();this.previous=previous;this._delay(function(){this.previous=previous;});}}
event.preventDefault();checkFocus.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;checkFocus.call(this);});if(this._start(event)===false){return;}
this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event);},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(event){if(!$(event.currentTarget).hasClass("ui-state-active")){return;}
if(this._start(event)===false){return false;}
this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event);},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var uiSpinner=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton");this.buttons=uiSpinner.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all");if(this.buttons.height()>Math.ceil(uiSpinner.height()*0.5)&&uiSpinner.height()>0){uiSpinner.height(uiSpinner.height());}
if(this.options.disabled){this.disable();}},_keydown:function(event){var options=this.options,keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.UP:this._repeat(null,1,event);return true;case keyCode.DOWN:this._repeat(null,-1,event);return true;case keyCode.PAGE_UP:this._repeat(null,options.page,event);return true;case keyCode.PAGE_DOWN:this._repeat(null,-options.page,event);return true;}
return false;},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";},_buttonHtml:function(){return""+"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>"+"<span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>";},_start:function(event){if(!this.spinning&&this._trigger("start",event)===false){return false;}
if(!this.counter){this.counter=1;}
this.spinning=true;return true;},_repeat:function(i,steps,event){i=i||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,steps,event);},i);this._spin(steps*this.options.step,event);},_spin:function(step,event){var value=this.value()||0;if(!this.counter){this.counter=1;}
value=this._adjustValue(value+step*this._increment(this.counter));if(!this.spinning||this._trigger("spin",event,{value:value})!==false){this._value(value);this.counter++;}},_increment:function(i){var incremental=this.options.incremental;if(incremental){return $.isFunction(incremental)?incremental(i):Math.floor(i*i*i/50000-i*i/500+17*i/200+1);}
return 1;},_precision:function(){var precision=this._precisionOf(this.options.step);if(this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min));}
return precision;},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1;},_adjustValue:function(value){var base,aboveMin,options=this.options;base=options.min!==null?options.min:0;aboveMin=value-base;aboveMin=Math.round(aboveMin/options.step)*options.step;value=base+aboveMin;value=parseFloat(value.toFixed(this._precision()));if(options.max!==null&&value>options.max){return options.max;}
if(options.min!==null&&value<options.min){return options.min;}
return value;},_stop:function(event){if(!this.spinning){return;}
clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",event);},_setOption:function(key,value){if(key==="culture"||key==="numberFormat"){var prevValue=this._parse(this.element.val());this.options[key]=value;this.element.val(this._format(prevValue));return;}
if(key==="max"||key==="min"||key==="step"){if(typeof value==="string"){value=this._parse(value);}}
if(key==="icons"){this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(value.up);this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(value.down);}
this._super(key,value);if(key==="disabled"){if(value){this.element.prop("disabled",true);this.buttons.button("disable");}else{this.element.prop("disabled",false);this.buttons.button("enable");}}},_setOptions:modifier(function(options){this._super(options);this._value(this.element.val());}),_parse:function(val){if(typeof val==="string"&&val!==""){val=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(val,10,this.options.culture):+val;}
return val===""||isNaN(val)?null:val;},_format:function(value){if(value===""){return"";}
return window.Globalize&&this.options.numberFormat?Globalize.format(value,this.options.numberFormat,this.options.culture):value;},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())});},_value:function(value,allowAny){var parsed;if(value!==""){parsed=this._parse(value);if(parsed!==null){if(!allowAny){parsed=this._adjustValue(parsed);}
value=this._format(parsed);}}
this.element.val(value);this._refresh();},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",false).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.uiSpinner.replaceWith(this.element);},stepUp:modifier(function(steps){this._stepUp(steps);}),_stepUp:function(steps){if(this._start()){this._spin((steps||1)*this.options.step);this._stop();}},stepDown:modifier(function(steps){this._stepDown(steps);}),_stepDown:function(steps){if(this._start()){this._spin((steps||1)*-this.options.step);this._stop();}},pageUp:modifier(function(pages){this._stepUp((pages||1)*this.options.page);}),pageDown:modifier(function(pages){this._stepDown((pages||1)*this.options.page);}),value:function(newVal){if(!arguments.length){return this._parse(this.element.val());}
modifier(this._value).call(this,newVal);},widget:function(){return this.uiSpinner;}});}(jQuery));(function($,undefined){var tabId=0,rhash=/#.*$/;function getNextTabId(){return++tabId;}
function isLocal(anchor){anchor=anchor.cloneNode(false);return anchor.hash.length>1&&decodeURIComponent(anchor.href.replace(rhash,""))===decodeURIComponent(location.href.replace(rhash,""));}
$.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var that=this,options=this.options;this.running=false;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",options.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(event){if($(this).is(".ui-state-disabled")){event.preventDefault();}}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){if($(this).closest("li").is(".ui-state-disabled")){this.blur();}});this._processTabs();options.active=this._initialActive();if($.isArray(options.disabled)){options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li);}))).sort();}
if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(options.active);}else{this.active=$();}
this._refresh();if(this.active.length){this.load(options.active);}},_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,locationHash=location.hash.substring(1);if(active===null){if(locationHash){this.tabs.each(function(i,tab){if($(tab).attr("aria-controls")===locationHash){active=i;return false;}});}
if(active===null){active=this.tabs.index(this.tabs.filter(".ui-tabs-active"));}
if(active===null||active===-1){active=this.tabs.length?0:false;}}
if(active!==false){active=this.tabs.index(this.tabs.eq(active));if(active===-1){active=collapsible?false:0;}}
if(!collapsible&&active===false&&this.anchors.length){active=0;}
return active;},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?$():this._getPanelForTab(this.active)};},_tabKeydown:function(event){var focusedTab=$(this.document[0].activeElement).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=true;if(this._handlePageNav(event)){return;}
switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=false;selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex);return;case $.ui.keyCode.ENTER:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex===this.options.active?false:selectedIndex);return;default:return;}
event.preventDefault();clearTimeout(this.activating);selectedIndex=this._focusNextTab(selectedIndex,goingForward);if(!event.ctrlKey){focusedTab.attr("aria-selected","false");this.tabs.eq(selectedIndex).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",selectedIndex);},this.delay);}},_panelKeydown:function(event){if(this._handlePageNav(event)){return;}
if(event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){event.preventDefault();this.active.focus();}},_handlePageNav:function(event){if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true;}
if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true;}},_findNextTab:function(index,goingForward){var lastTabIndex=this.tabs.length-1;function constrain(){if(index>lastTabIndex){index=0;}
if(index<0){index=lastTabIndex;}
return index;}
while($.inArray(constrain(),this.options.disabled)!==-1){index=goingForward?index+1:index-1;}
return index;},_focusNextTab:function(index,goingForward){index=this._findNextTab(index,goingForward);this.tabs.eq(index).focus();return index;},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
if(key==="disabled"){this._setupDisabled(value);return;}
this._super(key,value);if(key==="collapsible"){this.element.toggleClass("ui-tabs-collapsible",value);if(!value&&this.options.active===false){this._activate(0);}}
if(key==="event"){this._setupEvents(value);}
if(key==="heightStyle"){this._setupHeightStyle(value);}},_tabId:function(tab){return tab.attr("aria-controls")||"ui-tabs-"+getNextTabId();},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):"";},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab);});this._processTabs();if(options.active===false||!this.anchors.length){options.active=false;this.active=$();}else if(this.active.length&&!$.contains(this.tablist[0],this.active[0])){if(this.tabs.length===options.disabled.length){options.active=false;this.active=$();}else{this._activate(this._findNextTab(Math.max(0,options.active-1),false));}}else{options.active=this.tabs.index(this.active);}
this._refresh();},_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0);}else{this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0});this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"});}},_processTabs:function(){var that=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return $("a",this)[0];}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=$();this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");if(isLocal(anchor)){selector=anchor.hash;panel=that.element.find(that._sanitizeSelector(selector));}else{panelId=that._tabId(tab);selector="#"+panelId;panel=that.element.find(selector);if(!panel.length){panel=that._createPanel(panelId);panel.insertAfter(that.panels[i-1]||that.tablist);}
panel.attr("aria-live","polite");}
if(panel.length){that.panels=that.panels.add(panel);}
if(originalAriaControls){tab.data("ui-tabs-aria-controls",originalAriaControls);}
tab.attr({"aria-controls":selector.substring(1),"aria-labelledby":anchorId});panel.attr("aria-labelledby",anchorId);});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel");},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0);},_createPanel:function(id){return $("<div>").attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",true);},_setupDisabled:function(disabled){if($.isArray(disabled)){if(!disabled.length){disabled=false;}else if(disabled.length===this.anchors.length){disabled=true;}}
for(var i=0,li;(li=this.tabs[i]);i++){if(disabled===true||$.inArray(i,disabled)!==-1){$(li).addClass("ui-state-disabled").attr("aria-disabled","true");}else{$(li).removeClass("ui-state-disabled").removeAttr("aria-disabled");}}
this.options.disabled=disabled;},_setupEvents:function(event){var events={click:function(event){event.preventDefault();}};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
this._off(this.anchors.add(this.tabs).add(this.panels));this._on(this.anchors,events);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs);},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();if(heightStyle==="fill"){maxHeight=parent.height();maxHeight-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
maxHeight-=elem.outerHeight(true);});this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(true);});this.panels.each(function(){$(this).height(Math.max(0,maxHeight-
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height());}).height(maxHeight);}},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=!active.length?$():this._getPanelForTab(active),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault();if(tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||(clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
options.active=collapsing?false:this.tabs.index(tab);this.active=clickedIsActive?$():tab;if(this.xhr){this.xhr.abort();}
if(!toHide.length&&!toShow.length){$.error("jQuery UI Tabs: Mismatching fragment identifier.");}
if(toShow.length){this.load(this.tabs.index(tab),event);}
this._toggle(event,eventData);},_toggle:function(event,eventData){var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=true;function complete(){that.running=false;that._trigger("activate",event,eventData);}
function show(){eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active");if(toShow.length&&that.options.show){that._show(toShow,that.options.show,complete);}else{toShow.show();complete();}}
if(toHide.length&&this.options.hide){this._hide(toHide,this.options.hide,function(){eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");show();});}else{eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");toHide.hide();show();}
toHide.attr({"aria-expanded":"false","aria-hidden":"true"});eventData.oldTab.attr("aria-selected","false");if(toShow.length&&toHide.length){eventData.oldTab.attr("tabIndex",-1);}else if(toShow.length){this.tabs.filter(function(){return $(this).attr("tabIndex")===0;}).attr("tabIndex",-1);}
toShow.attr({"aria-expanded":"true","aria-hidden":"false"});eventData.newTab.attr({"aria-selected":"true",tabIndex:0});},_activate:function(index){var anchor,active=this._findActive(index);if(active[0]===this.active[0]){return;}
if(!active.length){active=this.active;}
anchor=active.find(".ui-tabs-anchor")[0];this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop});},_findActive:function(index){return index===false?$():this.tabs.eq(index);},_getIndex:function(index){if(typeof index==="string"){index=this.anchors.index(this.anchors.filter("[href$='"+index+"']"));}
return index;},_destroy:function(){if(this.xhr){this.xhr.abort();}
this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if($.data(this,"ui-tabs-destroy")){$(this).remove();}else{$(this).removeClass("ui-state-default ui-state-active ui-state-disabled "+"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role");}});this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");if(prev){li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls");}else{li.removeAttr("aria-controls");}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","");}},enable:function(index){var disabled=this.options.disabled;if(disabled===false){return;}
if(index===undefined){disabled=false;}else{index=this._getIndex(index);if($.isArray(disabled)){disabled=$.map(disabled,function(num){return num!==index?num:null;});}else{disabled=$.map(this.tabs,function(li,num){return num!==index?num:null;});}}
this._setupDisabled(disabled);},disable:function(index){var disabled=this.options.disabled;if(disabled===true){return;}
if(index===undefined){disabled=true;}else{index=this._getIndex(index);if($.inArray(index,disabled)!==-1){return;}
if($.isArray(disabled)){disabled=$.merge([index],disabled).sort();}else{disabled=[index];}}
this._setupDisabled(disabled);},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel};if(isLocal(anchor[0])){return;}
this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData));if(this.xhr&&this.xhr.statusText!=="canceled"){tab.addClass("ui-tabs-loading");panel.attr("aria-busy","true");this.xhr.success(function(response){setTimeout(function(){panel.html(response);that._trigger("load",event,eventData);},1);}).complete(function(jqXHR,status){setTimeout(function(){if(status==="abort"){that.panels.stop(false,true);}
tab.removeClass("ui-tabs-loading");panel.removeAttr("aria-busy");if(jqXHR===that.xhr){delete that.xhr;}},1);});}},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href"),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData));}};},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id));}});})(jQuery);(function($){var increments=0;function addDescribedBy(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")));}
function removeDescribedBy(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){describedby.splice(index,1);}
elem.removeData("ui-tooltip-id");describedby=$.trim(describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby);}else{elem.removeAttr("aria-describedby");}}
$.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,tooltipClass:null,track:false,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};if(this.options.disabled){this._disable();}},_setOption:function(key,value){var that=this;if(key==="disabled"){this[value?"_disable":"_enable"]();this.options[key]=value;return;}
this._super(key,value);if(key==="content"){$.each(this.tooltips,function(id,element){that._updateContent(element);});}},_disable:function(){var that=this;$.each(this.tooltips,function(id,element){var event=$.Event("blur");event.target=event.currentTarget=element[0];that.close(event,true);});this.element.find(this.options.items).addBack().each(function(){var element=$(this);if(element.is("[title]")){element.data("ui-tooltip-title",element.attr("title")).attr("title","");}});},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));}});},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);if(!target.length||target.data("ui-tooltip-id")){return;}
if(target.attr("title")){target.data("ui-tooltip-title",target.attr("title"));}
target.data("ui-tooltip-open",true);if(event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true);}
if(parent.attr("title")){parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr("title","");}});}
this._updateContent(target,event);},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;if(typeof contentOption==="string"){return this._open(event,target,contentOption);}
content=contentOption.call(target[0],function(response){if(!target.data("ui-tooltip-open")){return;}
that._delay(function(){if(event){event.type=eventType;}
this._open(event,target,response);});});if(content){this._open(event,target,content);}},_open:function(event,target,content){var tooltip,events,delayedShow,positionOption=$.extend({},this.options.position);if(!content){return;}
tooltip=this._find(target);if(tooltip.length){tooltip.find(".ui-tooltip-content").html(content);return;}
if(target.is("[title]")){if(event&&event.type==="mouseover"){target.attr("title","");}else{target.removeAttr("title");}}
tooltip=this._tooltip(target);addDescribedBy(target,tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);function position(event){positionOption.of=event;if(tooltip.is(":hidden")){return;}
tooltip.position(positionOption);}
if(this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});position(event);}else{tooltip.position($.extend({of:target},this.options.position));}
tooltip.hide();this._show(tooltip,this.options.show);if(this.options.show&&this.options.show.delay){delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(positionOption.of);clearInterval(delayedShow);}},$.fx.interval);}
this._trigger("open",event,{tooltip:tooltip});events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];this.close(fakeEvent,true);}},remove:function(){this._removeTooltip(tooltip);}};if(!event||event.type==="mouseover"){events.mouseleave="close";}
if(!event||event.type==="focusin"){events.focusout="close";}
this._on(true,target,events);},close:function(event){var that=this,target=$(event?event.currentTarget:this.element),tooltip=this._find(target);if(this.closing){return;}
clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")){target.attr("title",target.data("ui-tooltip-title"));}
removeDescribedBy(target);tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this));});target.removeData("ui-tooltip-open");this._off(target,"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove");}
this._off(this.document,"mousemove");if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title);delete that.parents[id];});}
this.closing=true;this._trigger("close",event,{tooltip:tooltip});this.closing=false;},_tooltip:function(element){var id="ui-tooltip-"+increments++,tooltip=$("<div>").attr({id:id,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+
(this.options.tooltipClass||""));$("<div>").addClass("ui-tooltip-content").appendTo(tooltip);tooltip.appendTo(this.document[0].body);this.tooltips[id]=element;return tooltip;},_find:function(target){var id=target.data("ui-tooltip-id");return id?$("#"+id):$();},_removeTooltip:function(tooltip){tooltip.remove();delete this.tooltips[tooltip.attr("id")];},_destroy:function(){var that=this;$.each(this.tooltips,function(id,element){var event=$.Event("blur");event.target=event.currentTarget=element[0];that.close(event,true);$("#"+id).remove();if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));element.removeData("ui-tooltip-title");}});}});}(jQuery));(function($,undefined){var dataSpace="ui-effects-";$.effects={effect:{}};(function(jQuery,undefined){var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]];}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,execResult[4]];}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)];}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16)];}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]];}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha);},spaces={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"}}}},propTypes={"byte":{floor:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},support=color.support={},supportElem=jQuery("<p>")[0],colors,each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)";support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1};});function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def;}
value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def;}
if(type.mod){return(value+type.mod)%type.mod;}
return 0>value?0:type.max<value?type.max:value;}
function stringParse(string){var inst=color(),rgba=inst._rgba=[];string=string.toLowerCase();each(stringParsers,function(i,parser){var parsed,match=parser.re.exec(string),values=match&&parser.parse(match),spaceName=parser.space||"rgba";if(values){parsed=inst[spaceName](values);inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache];rgba=inst._rgba=parsed._rgba;return false;}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent);}
return inst;}
return colors[string];}
color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this;}
if(red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined;}
var inst=this,type=jQuery.type(red),rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array";}
if(type==="string"){return this.parse(stringParse(red)||colors._default);}
if(type==="array"){each(spaces.rgba.props,function(key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop);});return this;}
if(type==="object"){if(red instanceof color){each(spaces,function(spaceName,space){if(red[space.cache]){inst[space.cache]=red[space.cache].slice();}});}else{each(spaces,function(spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if(key==="alpha"||red[key]==null){return;}
inst[cache]=space.to(inst._rgba);}
inst[cache][prop.idx]=clamp(red[key],prop,true);});if(inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){inst[cache][3]=1;if(space.from){inst._rgba=space.from(inst[cache]);}}});}
return this;}},is:function(compare){var is=color(compare),same=true,inst=this;each(spaces,function(_,space){var localCache,isCache=is[space.cache];if(isCache){localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[];each(space.props,function(_,prop){if(isCache[prop.idx]!=null){same=(isCache[prop.idx]===localCache[prop.idx]);return same;}});}
return same;});return same;},_space:function(){var used=[],inst=this;each(spaces,function(spaceName,space){if(inst[space.cache]){used.push(spaceName);}});return used.pop();},transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[spaceName],startColor=this.alpha()===0?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice();end=end[space.cache];each(space.props,function(key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};if(endValue===null){return;}
if(startValue===null){result[index]=endValue;}else{if(type.mod){if(endValue-startValue>type.mod/2){startValue+=type.mod;}else if(startValue-endValue>type.mod/2){startValue-=type.mod;}}
result[index]=clamp((endValue-startValue)*distance+startValue,prop);}});return this[spaceName](result);},blend:function(opaque){if(this._rgba[3]===1){return this;}
var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v;}));},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){return v==null?(i>2?1:0):v;});if(rgba[3]===1){rgba.pop();prefix="rgb(";}
return prefix+rgba.join()+")";},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0;}
if(i&&i<3){v=Math.round(v*100)+"%";}
return v;});if(hsla[3]===1){hsla.pop();prefix="hsl(";}
return prefix+hsla.join()+")";},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255));}
return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);return v.length===1?"0"+v:v;}).join("");},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString();}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}
if(h*2<1){return q;}
if(h*3<2){return p+(q-p)*((2/3)-h)*6;}
return p;}
spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]];}
var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*0.5,h,s;if(min===max){h=0;}else if(r===max){h=(60*(g-b)/diff)+360;}else if(g===max){h=(60*(b-r)/diff)+120;}else{h=(60*(r-g)/diff)+240;}
if(diff===0){s=0;}else if(l<=0.5){s=diff/add;}else{s=diff/(2-add);}
return[Math.round(h)%360,s,l,a==null?1:a];};spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,null,hsla[3]];}
var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=0.5?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(hue2rgb(p,q,h+(1/3))*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,h-(1/3))*255),a];};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(this._rgba);}
if(value===undefined){return this[cache].slice();}
var ret,type=jQuery.type(value),arr=(type==="array"||type==="object")?value:arguments,local=this[cache].slice();each(props,function(key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx];}
local[prop.idx]=clamp(val,prop);});if(from){ret=color(from(local));ret[cache]=local;return ret;}else{return color(local);}};each(props,function(key,prop){if(color.fn[key]){return;}
color.fn[key]=function(value){var vtype=jQuery.type(value),fn=(key==="alpha"?(this._hsla?"hsla":"rgba"):spaceName),local=this[fn](),cur=local[prop.idx],match;if(vtype==="undefined"){return cur;}
if(vtype==="function"){value=value.call(this,cur);vtype=jQuery.type(value);}
if(value==null&&prop.empty){return this;}
if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1);}}
local[prop.idx]=value;return this[fn](local);};});});color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode;}catch(e){}}
value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default");}
value=value.toRgbaString();}
try{elem.style[hook]=value;}catch(e){}}};jQuery.fx.step[hook]=function(fx){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=true;}
jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos));};});};color.hook(stepHooks);jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom","Left"],function(i,part){expanded["border"+part+"Color"]=value;});return expanded;}};colors=jQuery.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"};})(jQuery);(function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){jQuery.style(fx.elem,prop,fx.end);fx.setAttr=true;}};});function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;while(len--){key=style[len];if(typeof style[key]==="string"){styles[$.camelCase(key)]=style[key];}}}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key];}}}
return styles;}
function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name]||!isNaN(parseFloat(value))){diff[name]=value;}}}}
return diff;}
if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}
$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)};});applyClassChange=function(){$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[action]);}});};applyClassChange();allAnimations=allAnimations.map(function(){this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this;});animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:false,complete:function(){dfd.resolve(styleInfo);}});this.el.animate(this.diff,opts);return dfd.promise();});$.when.apply($,allAnimations.get()).done(function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"");});});o.complete.call(animated[0]);});});};$.fn.extend({addClass:(function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.addClass),removeClass:(function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.removeClass),toggleClass:(function(orig){return function(classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){return orig.apply(this,arguments);}else{return $.effects.animateClass.call(this,(force?{add:classNames}:{remove:classNames}),speed,easing,callback);}}else{return $.effects.animateClass.call(this,{toggle:classNames},force,speed,easing);}};})($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback);}});})();(function(){$.extend($.effects,{version:"1.10.4",save:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null){element.data(dataSpace+set[i],element[0].style[set[i]]);}}},restore:function(element,set){var val,i;for(i=0;i<set.length;i++){if(set[i]!==null){val=element.data(dataSpace+set[i]);if(val===undefined){val="";}
element.css(set[i],val);}}},setMode:function(el,mode){if(mode==="toggle"){mode=el.is(":hidden")?"show":"hide";}
return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=0.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height;}
switch(origin[1]){case"left":x=0;break;case"center":x=0.5;break;case"right":x=1;break;default:x=origin[1]/original.width;}
return{x:x,y:y};},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent();}
var props={width:element.outerWidth(true),height:element.outerHeight(true),"float":element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id;}catch(e){active=document.body;}
element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).focus();}
wrapper=element.parent();if(element.css("position")==="static"){wrapper.css({position:"relative"});element.css({position:"relative"});}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto";}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});}
element.css(size);return wrapper.css(props).show();},removeWrapper:function(element){var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent().replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).focus();}}
return element;},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1];}});return value;}});function _normalizeArguments(effect,options,speed,callback){if($.isPlainObject(effect)){options=effect;effect=effect.effect;}
effect={effect:effect};if(options==null){options={};}
if($.isFunction(options)){callback=options;speed=null;options={};}
if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={};}
if($.isFunction(speed)){callback=speed;speed=null;}
if(options){$.extend(effect,options);}
speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}
function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return true;}
if(typeof option==="string"&&!$.effects.effect[option]){return true;}
if($.isFunction(option)){return true;}
if(typeof option==="object"&&!option.effect){return true;}
return false;}
$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),mode=args.mode,queue=args.queue,effectMethod=$.effects.effect[args.effect];if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,args.complete);}else{return this.each(function(){if(args.complete){args.complete.call(this);}});}}
function run(next){var elem=$(this),complete=args.complete,mode=args.mode;function done(){if($.isFunction(complete)){complete.call(elem[0]);}
if($.isFunction(next)){next();}}
if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done();}else{effectMethod.call(elem[0],args,done);}}
return queue===false?this.each(run):this.queue(queue||"fx",run);},show:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="show";return this.effect.call(this,args);}};})($.fn.show),hide:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,args);}};})($.fn.hide),toggle:(function(orig){return function(option){if(standardAnimationOption(option)||typeof option==="boolean"){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,args);}};})($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit];}});return val;}});})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2);};});$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2);},Circ:function(p){return 1-Math.sqrt(1-p*p);},Elastic:function(p){return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15);},Back:function(p){return p*p*(3*p-2);},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11){}
return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((pow2*3-2)/22-p,2);}});$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p);};$.easing["easeInOut"+name]=function(p){return p<0.5?easeIn(p*2)/2:1-easeIn(p*-2+2)/2;};});})();})(jQuery);(function($,undefined){var rvertical=/up|down|vertical/,rpositivemotion=/up|left|vertical|horizontal/;$.effects.effect.blind=function(o,done){var el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),direction=o.direction||"up",vertical=rvertical.test(direction),ref=vertical?"height":"width",ref2=vertical?"top":"left",motion=rpositivemotion.test(direction),animation={},show=mode==="show",wrapper,distance,margin;if(el.parent().is(".ui-effects-wrapper")){$.effects.save(el.parent(),props);}else{$.effects.save(el,props);}
el.show();wrapper=$.effects.createWrapper(el).css({overflow:"hidden"});distance=wrapper[ref]();margin=parseFloat(wrapper.css(ref2))||0;animation[ref]=show?distance:0;if(!motion){el.css(vertical?"bottom":"right",0).css(vertical?"top":"left","auto").css({position:"absolute"});animation[ref2]=show?margin:distance+margin;}
if(show){wrapper.css(ref,0);if(!motion){wrapper.css(ref2,margin+distance);}}
wrapper.animate(animation,{duration:o.duration,easing:o.easing,queue:false,complete:function(){if(mode==="hide"){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();}});};})(jQuery);(function($,undefined){$.effects.effect.bounce=function(o,done){var el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"effect"),hide=mode==="hide",show=mode==="show",direction=o.direction||"up",distance=o.distance,times=o.times||5,anims=times*2+(show||hide?1:0),speed=o.duration/anims,easing=o.easing,ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left"),i,upAnim,downAnim,queue=el.queue(),queuelen=queue.length;if(show||hide){props.push("opacity");}
$.effects.save(el,props);el.show();$.effects.createWrapper(el);if(!distance){distance=el[ref==="top"?"outerHeight":"outerWidth"]()/3;}
if(show){downAnim={opacity:1};downAnim[ref]=0;el.css("opacity",0).css(ref,motion?-distance*2:distance*2).animate(downAnim,speed,easing);}
if(hide){distance=distance/Math.pow(2,times-1);}
downAnim={};downAnim[ref]=0;for(i=0;i<times;i++){upAnim={};upAnim[ref]=(motion?"-=":"+=")+distance;el.animate(upAnim,speed,easing).animate(downAnim,speed,easing);distance=hide?distance*2:distance/2;}
if(hide){upAnim={opacity:0};upAnim[ref]=(motion?"-=":"+=")+distance;el.animate(upAnim,speed,easing);}
el.queue(function(){if(hide){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();});if(queuelen>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1)));}
el.dequeue();};})(jQuery);(function($,undefined){$.effects.effect.clip=function(o,done){var el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show=mode==="show",direction=o.direction||"vertical",vert=direction==="vertical",size=vert?"height":"width",position=vert?"top":"left",animation={},wrapper,animate,distance;$.effects.save(el,props);el.show();wrapper=$.effects.createWrapper(el).css({overflow:"hidden"});animate=(el[0].tagName==="IMG")?wrapper:el;distance=animate[size]();if(show){animate.css(size,0);animate.css(position,distance/2);}
animation[size]=show?distance:0;animation[position]=show?0:distance/2;animate.animate(animation,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(!show){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();}});};})(jQuery);(function($,undefined){$.effects.effect.drop=function(o,done){var el=$(this),props=["position","top","bottom","left","right","opacity","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show=mode==="show",direction=o.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left")?"pos":"neg",animation={opacity:show?1:0},distance;$.effects.save(el,props);el.show();$.effects.createWrapper(el);distance=o.distance||el[ref==="top"?"outerHeight":"outerWidth"](true)/2;if(show){el.css("opacity",0).css(ref,motion==="pos"?-distance:distance);}
animation[ref]=(show?(motion==="pos"?"+=":"-="):(motion==="pos"?"-=":"+="))+
distance;el.animate(animation,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(mode==="hide"){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();}});};})(jQuery);(function($,undefined){$.effects.effect.explode=function(o,done){var rows=o.pieces?Math.round(Math.sqrt(o.pieces)):3,cells=rows,el=$(this),mode=$.effects.setMode(el,o.mode||"hide"),show=mode==="show",offset=el.show().css("visibility","hidden").offset(),width=Math.ceil(el.outerWidth()/cells),height=Math.ceil(el.outerHeight()/rows),pieces=[],i,j,left,top,mx,my;function childComplete(){pieces.push(this);if(pieces.length===rows*cells){animComplete();}}
for(i=0;i<rows;i++){top=offset.top+i*height;my=i-(rows-1)/2;for(j=0;j<cells;j++){left=offset.left+j*width;mx=j-(cells-1)/2;el.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},o.duration||500,o.easing,childComplete);}}
function animComplete(){el.css({visibility:"visible"});$(pieces).remove();if(!show){el.hide();}
done();}};})(jQuery);(function($,undefined){$.effects.effect.fade=function(o,done){var el=$(this),mode=$.effects.setMode(el,o.mode||"toggle");el.animate({opacity:mode},{queue:false,duration:o.duration,easing:o.easing,complete:done});};})(jQuery);(function($,undefined){$.effects.effect.fold=function(o,done){var el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show=mode==="show",hide=mode==="hide",size=o.size||15,percent=/([0-9]+)%/.exec(size),horizFirst=!!o.horizFirst,widthFirst=show!==horizFirst,ref=widthFirst?["width","height"]:["height","width"],duration=o.duration/2,wrapper,distance,animation1={},animation2={};$.effects.save(el,props);el.show();wrapper=$.effects.createWrapper(el).css({overflow:"hidden"});distance=widthFirst?[wrapper.width(),wrapper.height()]:[wrapper.height(),wrapper.width()];if(percent){size=parseInt(percent[1],10)/100*distance[hide?0:1];}
if(show){wrapper.css(horizFirst?{height:0,width:size}:{height:size,width:0});}
animation1[ref[0]]=show?distance[0]:size;animation2[ref[1]]=show?distance[1]:0;wrapper.animate(animation1,duration,o.easing).animate(animation2,duration,o.easing,function(){if(hide){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();});};})(jQuery);(function($,undefined){$.effects.effect.highlight=function(o,done){var elem=$(this),props=["backgroundImage","backgroundColor","opacity"],mode=$.effects.setMode(elem,o.mode||"show"),animation={backgroundColor:elem.css("backgroundColor")};if(mode==="hide"){animation.opacity=0;}
$.effects.save(elem,props);elem.show().css({backgroundImage:"none",backgroundColor:o.color||"#ffff99"}).animate(animation,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(mode==="hide"){elem.hide();}
$.effects.restore(elem,props);done();}});};})(jQuery);(function($,undefined){$.effects.effect.pulsate=function(o,done){var elem=$(this),mode=$.effects.setMode(elem,o.mode||"show"),show=mode==="show",hide=mode==="hide",showhide=(show||mode==="hide"),anims=((o.times||5)*2)+(showhide?1:0),duration=o.duration/anims,animateTo=0,queue=elem.queue(),queuelen=queue.length,i;if(show||!elem.is(":visible")){elem.css("opacity",0).show();animateTo=1;}
for(i=1;i<anims;i++){elem.animate({opacity:animateTo},duration,o.easing);animateTo=1-animateTo;}
elem.animate({opacity:animateTo},duration,o.easing);elem.queue(function(){if(hide){elem.hide();}
done();});if(queuelen>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1)));}
elem.dequeue();};})(jQuery);(function($,undefined){$.effects.effect.puff=function(o,done){var elem=$(this),mode=$.effects.setMode(elem,o.mode||"hide"),hide=mode==="hide",percent=parseInt(o.percent,10)||150,factor=percent/100,original={height:elem.height(),width:elem.width(),outerHeight:elem.outerHeight(),outerWidth:elem.outerWidth()};$.extend(o,{effect:"scale",queue:false,fade:true,mode:mode,complete:done,percent:hide?percent:100,from:hide?original:{height:original.height*factor,width:original.width*factor,outerHeight:original.outerHeight*factor,outerWidth:original.outerWidth*factor}});elem.effect(o);};$.effects.effect.scale=function(o,done){var el=$(this),options=$.extend(true,{},o),mode=$.effects.setMode(el,o.mode||"effect"),percent=parseInt(o.percent,10)||(parseInt(o.percent,10)===0?0:(mode==="hide"?0:100)),direction=o.direction||"both",origin=o.origin,original={height:el.height(),width:el.width(),outerHeight:el.outerHeight(),outerWidth:el.outerWidth()},factor={y:direction!=="horizontal"?(percent/100):1,x:direction!=="vertical"?(percent/100):1};options.effect="size";options.queue=false;options.complete=done;if(mode!=="effect"){options.origin=origin||["middle","center"];options.restore=true;}
options.from=o.from||(mode==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:original);options.to={height:original.height*factor.y,width:original.width*factor.x,outerHeight:original.outerHeight*factor.y,outerWidth:original.outerWidth*factor.x};if(options.fade){if(mode==="show"){options.from.opacity=0;options.to.opacity=1;}
if(mode==="hide"){options.from.opacity=1;options.to.opacity=0;}}
el.effect(options);};$.effects.effect.size=function(o,done){var original,baseline,factor,el=$(this),props0=["position","top","bottom","left","right","width","height","overflow","opacity"],props1=["position","top","bottom","left","right","overflow","opacity"],props2=["width","height","overflow"],cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],mode=$.effects.setMode(el,o.mode||"effect"),restore=o.restore||mode!=="effect",scale=o.scale||"both",origin=o.origin||["middle","center"],position=el.css("position"),props=restore?props0:props1,zero={height:0,width:0,outerHeight:0,outerWidth:0};if(mode==="show"){el.show();}
original={height:el.height(),width:el.width(),outerHeight:el.outerHeight(),outerWidth:el.outerWidth()};if(o.mode==="toggle"&&mode==="show"){el.from=o.to||zero;el.to=o.from||original;}else{el.from=o.from||(mode==="show"?zero:original);el.to=o.to||(mode==="hide"?zero:original);}
factor={from:{y:el.from.height/original.height,x:el.from.width/original.width},to:{y:el.to.height/original.height,x:el.to.width/original.width}};if(scale==="box"||scale==="both"){if(factor.from.y!==factor.to.y){props=props.concat(vProps);el.from=$.effects.setTransition(el,vProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,vProps,factor.to.y,el.to);}
if(factor.from.x!==factor.to.x){props=props.concat(hProps);el.from=$.effects.setTransition(el,hProps,factor.from.x,el.from);el.to=$.effects.setTransition(el,hProps,factor.to.x,el.to);}}
if(scale==="content"||scale==="both"){if(factor.from.y!==factor.to.y){props=props.concat(cProps).concat(props2);el.from=$.effects.setTransition(el,cProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,cProps,factor.to.y,el.to);}}
$.effects.save(el,props);el.show();$.effects.createWrapper(el);el.css("overflow","hidden").css(el.from);if(origin){baseline=$.effects.getBaseline(origin,original);el.from.top=(original.outerHeight-el.outerHeight())*baseline.y;el.from.left=(original.outerWidth-el.outerWidth())*baseline.x;el.to.top=(original.outerHeight-el.to.outerHeight)*baseline.y;el.to.left=(original.outerWidth-el.to.outerWidth)*baseline.x;}
el.css(el.from);if(scale==="content"||scale==="both"){vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps);hProps=hProps.concat(["marginLeft","marginRight"]);props2=props0.concat(vProps).concat(hProps);el.find("*[width]").each(function(){var child=$(this),c_original={height:child.height(),width:child.width(),outerHeight:child.outerHeight(),outerWidth:child.outerWidth()};if(restore){$.effects.save(child,props2);}
child.from={height:c_original.height*factor.from.y,width:c_original.width*factor.from.x,outerHeight:c_original.outerHeight*factor.from.y,outerWidth:c_original.outerWidth*factor.from.x};child.to={height:c_original.height*factor.to.y,width:c_original.width*factor.to.x,outerHeight:c_original.height*factor.to.y,outerWidth:c_original.width*factor.to.x};if(factor.from.y!==factor.to.y){child.from=$.effects.setTransition(child,vProps,factor.from.y,child.from);child.to=$.effects.setTransition(child,vProps,factor.to.y,child.to);}
if(factor.from.x!==factor.to.x){child.from=$.effects.setTransition(child,hProps,factor.from.x,child.from);child.to=$.effects.setTransition(child,hProps,factor.to.x,child.to);}
child.css(child.from);child.animate(child.to,o.duration,o.easing,function(){if(restore){$.effects.restore(child,props2);}});});}
el.animate(el.to,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(el.to.opacity===0){el.css("opacity",el.from.opacity);}
if(mode==="hide"){el.hide();}
$.effects.restore(el,props);if(!restore){if(position==="static"){el.css({position:"relative",top:el.to.top,left:el.to.left});}else{$.each(["top","left"],function(idx,pos){el.css(pos,function(_,str){var val=parseInt(str,10),toRef=idx?el.to.left:el.to.top;if(str==="auto"){return toRef+"px";}
return val+toRef+"px";});});}}
$.effects.removeWrapper(el);done();}});};})(jQuery);(function($,undefined){$.effects.effect.shake=function(o,done){var el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"effect"),direction=o.direction||"left",distance=o.distance||20,times=o.times||3,anims=times*2+1,speed=Math.round(o.duration/anims),ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),animation={},animation1={},animation2={},i,queue=el.queue(),queuelen=queue.length;$.effects.save(el,props);el.show();$.effects.createWrapper(el);animation[ref]=(positiveMotion?"-=":"+=")+distance;animation1[ref]=(positiveMotion?"+=":"-=")+distance*2;animation2[ref]=(positiveMotion?"-=":"+=")+distance*2;el.animate(animation,speed,o.easing);for(i=1;i<times;i++){el.animate(animation1,speed,o.easing).animate(animation2,speed,o.easing);}
el.animate(animation1,speed,o.easing).animate(animation,speed/2,o.easing).queue(function(){if(mode==="hide"){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();});if(queuelen>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1)));}
el.dequeue();};})(jQuery);(function($,undefined){$.effects.effect.slide=function(o,done){var el=$(this),props=["position","top","bottom","left","right","width","height"],mode=$.effects.setMode(el,o.mode||"show"),show=mode==="show",direction=o.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),distance,animation={};$.effects.save(el,props);el.show();distance=o.distance||el[ref==="top"?"outerHeight":"outerWidth"](true);$.effects.createWrapper(el).css({overflow:"hidden"});if(show){el.css(ref,positiveMotion?(isNaN(distance)?"-"+distance:-distance):distance);}
animation[ref]=(show?(positiveMotion?"+=":"-="):(positiveMotion?"-=":"+="))+
distance;el.animate(animation,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(mode==="hide"){el.hide();}
$.effects.restore(el,props);$.effects.removeWrapper(el);done();}});};})(jQuery);(function($,undefined){$.effects.effect.transfer=function(o,done){var elem=$(this),target=$(o.to),targetFixed=target.css("position")==="fixed",body=$("body"),fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,height:target.innerHeight(),width:target.innerWidth()},startPosition=elem.offset(),transfer=$("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(o.className).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:elem.innerHeight(),width:elem.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,o.duration,o.easing,function(){transfer.remove();done();});};})(jQuery);var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r={b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b==="string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();(function(e){var t=!1,i=!1,o={isUrl:function(e){var t=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)?!0:!1},loadContent:function(e,t){e.html(t)},addPrefix:function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},execute:function(o,n,s){"function"==typeof n?(s=n,n="sidr"):n||(n="sidr");var a,d,l,c=e("#"+n),f=e(c.data("body")),u=e("html"),p=c.outerWidth(!0),y=c.data("speed"),v=c.data("side");if("open"===o||"toogle"===o&&!c.is(":visible")){if(c.is(":visible")||t)return;if(i!==!1)return r.close(i,function(){r.open(n)}),void 0;t=!0,"left"===v?(a={left:p+"px"},d={left:"0px"}):(a={right:p+"px"},d={right:"0px"}),l=u.scrollTop(),u.css("overflow-x","hidden").scrollTop(l),f.css({width:f.width(),position:"absolute"}).animate(a,y),c.css("display","block").animate(d,y,function(){t=!1,i=n,"function"==typeof s&&s(n)})}else{if(!c.is(":visible")||t)return;t=!0,"left"===v?(a={left:0},d={left:"-"+p+"px"}):(a={right:0},d={right:"-"+p+"px"}),l=u.scrollTop(),u.removeAttr("style").scrollTop(l),f.animate(a,y),c.animate(d,y,function(){c.removeAttr("style"),f.removeAttr("style"),e("html").removeAttr("style"),t=!1,i=!1,"function"==typeof s&&s(n)})}}},r={open:function(e,t){o.execute("open",e,t)},close:function(e,t){o.execute("close",e,t)},toogle:function(e,t){o.execute("toogle",e,t)}};e.sidr=function(t){return r[t]?r[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sidr"),void 0):r.toogle.apply(this,arguments)},e.fn.sidr=function(t){var i=e.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body"},t),n=i.name,s=e("#"+n);if(0===s.length&&(s=e("<div />").attr("id",n).appendTo(e("body"))),s.addClass("sidr").addClass(i.side).data({speed:i.speed,side:i.side,body:i.body}),"function"==typeof i.source){var a=i.source(n);o.loadContent(s,a)}else if("string"==typeof i.source&&o.isUrl(i.source))e.get(i.source,function(e){o.loadContent(s,e)});else if("string"==typeof i.source){var d="",l=i.source.split(",");if(e.each(l,function(t,i){d+='<div class="sidr-inner">'+e(i).html()+"</div>"}),i.renaming){var c=e("<div />").html(d);c.find("*").each(function(t,i){var r=e(i);o.addPrefix(r)}),d=c.html()}o.loadContent(s,d)}else null!==i.source&&e.error("Invalid Sidr Source");return this.each(function(){var t=e(this),i=t.data("sidr");i||(t.data("sidr",n),t.click(function(e){e.preventDefault(),r.toogle(n)}))})}})(jQuery);!function(a){"use strict";function b(a,b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):void 0}function c(a,b){var c,d;for(c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}function d(a,b){var c;a.createTextRange?(c=a.createTextRange(),c.move("character",b),c.select()):a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function e(a,b){try{return a.type=b,!0}catch(c){return!1}}a.Placeholders={Utils:{addEventListener:b,inArray:c,moveCaret:d,changeType:e}}}(this),function(a){"use strict";function b(){}function c(a){var b;return a.value===a.getAttribute(G)&&"true"===a.getAttribute(H)?(a.setAttribute(H,"false"),a.value="",a.className=a.className.replace(F,""),b=a.getAttribute(I),b&&(a.type=b),!0):!1}function d(a){var b,c=a.getAttribute(G);return""===a.value&&c?(a.setAttribute(H,"true"),a.value=c,a.className+=" "+E,b=a.getAttribute(I),b?a.type="text":"password"===a.type&&R.changeType(a,"text")&&a.setAttribute(I,"password"),!0):!1}function e(a,b){var c,d,e,f,g;if(a&&a.getAttribute(G))b(a);else for(c=a?a.getElementsByTagName("input"):o,d=a?a.getElementsByTagName("textarea"):p,g=0,f=c.length+d.length;f>g;g++)e=g<c.length?c[g]:d[g-c.length],b(e)}function f(a){e(a,c)}function g(a){e(a,d)}function h(a){return function(){q&&a.value===a.getAttribute(G)&&"true"===a.getAttribute(H)?R.moveCaret(a,0):c(a)}}function i(a){return function(){d(a)}}function j(a){return function(b){return s=a.value,"true"===a.getAttribute(H)&&s===a.getAttribute(G)&&R.inArray(C,b.keyCode)?(b.preventDefault&&b.preventDefault(),!1):void 0}}function k(a){return function(){var b;"true"===a.getAttribute(H)&&a.value!==s&&(a.className=a.className.replace(F,""),a.value=a.value.replace(a.getAttribute(G),""),a.setAttribute(H,!1),b=a.getAttribute(I),b&&(a.type=b)),""===a.value&&(a.blur(),R.moveCaret(a,0))}}function l(a){return function(){a===document.activeElement&&a.value===a.getAttribute(G)&&"true"===a.getAttribute(H)&&R.moveCaret(a,0)}}function m(a){return function(){f(a)}}function n(a){a.form&&(x=a.form,x.getAttribute(J)||(R.addEventListener(x,"submit",m(x)),x.setAttribute(J,"true"))),R.addEventListener(a,"focus",h(a)),R.addEventListener(a,"blur",i(a)),q&&(R.addEventListener(a,"keydown",j(a)),R.addEventListener(a,"keyup",k(a)),R.addEventListener(a,"click",l(a))),a.setAttribute(K,"true"),a.setAttribute(G,v),d(a)}var o,p,q,r,s,t,u,v,w,x,y,z,A,B=["text","search","url","tel","email","password","number","textarea"],C=[27,33,34,35,36,37,38,39,40,8,46],D="#ccc",E="placeholdersjs",F=new RegExp("(?:^|\\s)"+E+"(?!\\S)"),G="data-placeholder-value",H="data-placeholder-active",I="data-placeholder-type",J="data-placeholder-submit",K="data-placeholder-bound",L="data-placeholder-focus",M="data-placeholder-live",N=document.createElement("input"),O=document.getElementsByTagName("head")[0],P=document.documentElement,Q=a.Placeholders,R=Q.Utils;if(Q.nativeSupport=void 0!==N.placeholder,!Q.nativeSupport){for(o=document.getElementsByTagName("input"),p=document.getElementsByTagName("textarea"),q="false"===P.getAttribute(L),r="false"!==P.getAttribute(M),t=document.createElement("style"),t.type="text/css",u=document.createTextNode("."+E+" { color:"+D+"; }"),t.styleSheet?t.styleSheet.cssText=u.nodeValue:t.appendChild(u),O.insertBefore(t,O.firstChild),A=0,z=o.length+p.length;z>A;A++)y=A<o.length?o[A]:p[A-o.length],v=y.attributes.placeholder,v&&(v=v.nodeValue,v&&R.inArray(B,y.type)&&n(y));w=setInterval(function(){for(A=0,z=o.length+p.length;z>A;A++)y=A<o.length?o[A]:p[A-o.length],v=y.attributes.placeholder,v&&(v=v.nodeValue,v&&R.inArray(B,y.type)&&(y.getAttribute(K)||n(y),(v!==y.getAttribute(G)||"password"===y.type&&!y.getAttribute(I))&&("password"===y.type&&!y.getAttribute(I)&&R.changeType(y,"text")&&y.setAttribute(I,"password"),y.value===y.getAttribute(G)&&(y.value=v),y.setAttribute(G,v))));r||clearInterval(w)},100)}Q.disable=Q.nativeSupport?b:f,Q.enable=Q.nativeSupport?b:g}(this);register_command('likeComment',{onSuccess:function(data){commandUtils.updatePostScore(this.nodeId,data.result.score,true);}});register_command('share',{execute:function(evt){var $comment=$('#comment-'+this.nodeId);var ctx;if($comment.length>0){ctx=$.extend({shareURL:this.getParsedUrl('comment-url')},this.messages);ctx.description=this.getMessage("comment-description");ctx.title=this.getMessage("comment-title");}else{if(this.nodeElement.hasClass('answer-container')){ctx=$.extend({shareURL:this.getParsedUrl('answer-url')},this.messages);}else{ctx=$.extend({shareURL:this.getParsedUrl('solution-url')},this.messages);}}
var doptions={nodes:commandUtils.renderTemplate("share-dialog",ctx),shareURL:ctx.shareURL,title:ctx.title,yes_callback:function($dialog,close){close();},show_no:false,close_on_clickoutside:true,centered:false,event:ctx};return commandUtils.showDialog(doptions);}});register_command('deleteComment',{onSuccess:function(data){var $comment=$('#comment-'+this.nodeId);$comment.css('background','red');$comment.fadeOut('slow',function(){$comment.remove();});var post_id=data.result.parentNode.id;var $showCommentsLink=$("#"+post_id+"-show-comments-container");var $commentsContainer=$("#comments-container-"+post_id);var $commentCount=parseInt($showCommentsLink.attr("commentCount"))-1;$showCommentsLink.attr("commentCount",$commentCount);if($commentCount===1){$commentsContainer.css("display")==="none"?$showCommentsLink.html(pageContext.i18n.showOneComment):$showCommentsLink.html(pageContext.i18n.hideOneComment);}else{$commentsContainer.css("display")==="none"?$showCommentsLink.html(pageContext.i18n.showNComments.replace("$n",$commentCount)):$showCommentsLink.html(pageContext.i18n.hideNComments.replace("$n",$commentCount));}}});register_command('voteUp',{onSuccess:function(data){var spanScore=$("#post-"+this.nodeId+"-score");spanScore.parent().parent().addClass('already-voted');if(!spanScore.hasClass('comment-score')){$('#vote-down-button-'+this.nodeId).find('i').remove();$('#vote-up-button-'+this.nodeId).attr('style','height:18px');$('#vote-up-button-'+this.nodeId).find('i').remove();$('#vote-down-button-'+this.nodeId).addClass('clickable');}
if(data.result.cancelVoteAction!=undefined){commandUtils.updatePostScore(this.nodeId,data.result.score,false);spanScore.parent().parent().removeClass('already-voted');if(!spanScore.hasClass('comment-score')){$('#vote-down-button-'+this.nodeId).append($('<i/>').addClass('icon-chevron-down icon-2x'));$('#vote-up-button-'+this.nodeId).append($('<i/>').addClass('icon-chevron-up icon-2x'));}}else{var oldScore=parseInt(spanScore.text());if(oldScore==-1&&data.result.score==1){oldScore=0;}
commandUtils.updatePostScore(this.nodeId,oldScore+1,false);}
var voteDown=commandUtils.findAndExtractCommand(this.nodeId,'voteDown');if(voteDown!=undefined&&voteDown.getStatus()=='on'){voteDown.onCompleted(true);}},});register_command('voteDown',{onSuccess:function(data){var spanScore=$("#post-"+this.nodeId+"-score");spanScore.parent().parent().addClass('already-voted');if(!spanScore.hasClass('comment-score')){$('#vote-down-button-'+this.nodeId).find('i').remove();$('#vote-up-button-'+this.nodeId).attr('style','height:18px');$('#vote-up-button-'+this.nodeId).find('i').remove();$('#vote-down-button-'+this.nodeId).addClass('clickable');}
if(data.result.cancelVoteAction!=undefined){spanScore.parent().parent().removeClass('already-voted');if(!spanScore.hasClass('comment-score')){$('#vote-down-button-'+this.nodeId).append($('<i/>').addClass('icon-chevron-down icon-2x'));$('#vote-up-button-'+this.nodeId).append($('<i/>').addClass('icon-chevron-up icon-2x'));$("div[nodeId='"+this.nodeId+"']").find('.vertical-separator').remove();}}
commandUtils.updatePostScore(this.nodeId,data.result.score,false);var voteUp=commandUtils.findAndExtractCommand(this.nodeId,'voteUp');if(voteUp.getStatus()=='on'){voteUp.onCompleted(true);}
if($($('.problem-follow-widget').find('a').get(0)).hasClass('unfollowing')){$('.problem-follow-widget').find('.widget-action').get(0).click();}}});register_command('acceptAnswer',{onSuccess:function(data){var solutionType=this.nodeElement.find('.solution-type');if(data.result.acceptAction.canceled){solutionType.text("Solution");this.nodeElement.find('.labels .label-success').remove();this.nodeElement.find('.post-controls .accept-answer').text(pageContext.i18n.answer.controlBar.accept);this.nodeElement.find('.post-controls .accept-answer').prepend('<i class="icon-ok"></i> ');this.nodeElement.find('.post-controls .accept-answer').attr('title',pageContext.i18n.answer.controlBar.acceptCommand);this.nodeElement.removeClass('accepted-answer');this.nodeElement.removeClass('accepted-reply');}else{if(data.result.acceptAction.node.type=='solution'){solutionType.html("\u2714 Accepted Solution");}else{this.nodeElement.find('.labels').prepend('<span class="label label-success">'.concat(pageContext.i18n.answer.bestAnswer).concat('</span>'));}
this.nodeElement.find('.post-controls .accept-answer').text(pageContext.i18n.answer.controlBar.unaccept);this.nodeElement.find('.post-controls .accept-answer').prepend('<i class="icon-ok"></i> ');this.nodeElement.find('.post-controls .accept-answer').attr('title',pageContext.i18n.answer.controlBar.cancelAcceptedCommand);this.nodeElement.addClass('accepted-answer');this.nodeElement.addClass('accepted-reply');}}});register_command('markFavorite',{onSuccess:function(data){var canceled;try{canceled=data.result.favoriteAction.canceled;}catch(e){console.log(e);return;}
if(canceled){$('#favorite-mark-'+this.nodeId+' i').removeClass('icon-star').addClass('icon-star-empty');}else{$('#favorite-mark-'+this.nodeId+' i').removeClass('icon-star-empty').addClass('icon-star');}
if(data.result.favoriteCount==0){$('#favorite-count-'+this.nodeId).html('');}else{$('#favorite-count-'+this.nodeId).html(data.result.favoriteCount);}}});register_command('reportPost',{execute:function(evt){if(this.getStatus()=="off"){var parser=this;commandUtils.showPrompt(evt,'flag-or-close-post-dialog',this.messages,{title:pageContext.i18n.reportQuestionModalTitle,beforeShow:function($dialog){$dialog.find('.prompt-examples').change(function(){$('textarea[name=prompt]').val($(this).val());});},onOk:function(data){parser.executeRequest(data);}});}else{this.confirm(evt,pageContext.i18n.confirmModalTitle,pageContext.i18n.cancelReportModalText);}},onSuccess:function(data){if(data.result.reportCount!=undefined){this.element.attr('reportCount',data.result.reportCount);}else{this.element.removeAttr('reportCount');}
this.updateLinkText();$(".alert").hide();if(this.getStatus()=="off"){$(".post-container[nodeid="+this.nodeId+"]").before("<div class='alert'>"+pageContext.i18n.reportSuccessText+"</div>");}else{$(".post-container[nodeid="+this.nodeId+"]").before("<div class='alert'>"+pageContext.i18n.reportCancelText+"</div>");}},updateLinkText:function(){var newLink=this.getMessage('link.'+(this.element.hasClass('on')?'on':'off'));if(this.element.attr('reportCount')!=null){newLink+=('('+this.element.attr('reportCount')+')');}
this.element.html(newLink);}});register_command('publishPost',{onSuccess:function(data){commandUtils.reloadPage();}});register_command('sendToMod',{onSuccess:function(data){commandUtils.reloadPage();}});register_command('deletePost',{onSuccess:function(data){var targetNode=this.nodeElement;if(!targetNode.is('.post-container')){targetNode=targetNode.parents('.post-container');}
if(data.result.deleteAction.canceled){targetNode.removeClass("deleted")}else{targetNode.addClass('deleted');}}});register_command('closeQuestion',{execute:function(evt){if(this.getStatus()=="off"){var parser=this;commandUtils.showPrompt(evt,'flag-or-close-post-dialog',this.messages,{title:pageContext.i18n.closeQuestionTitle,beforeShow:function($dialog){$dialog.find('.prompt-examples').change(function(){$('textarea[name=prompt]').val($(this).val());}).change();},onOk:function(data){parser.executeRequest(data);}});}else{this.confirm(evt,null,null);}},onSuccess:function(data){commandUtils.reloadPage();}});register_command('lockPost',{execute:function(evt){if(this.getStatus()=="off"){var parser=this;commandUtils.showPrompt(evt,'flag-or-close-post-dialog',this.messages,{title:pageContext.i18n.lockPostModalTitle,beforeShow:function($dialog){$dialog.find('.prompt-examples').change(function(){$('textarea[name=prompt]').val($(this).val());}).change();},onOk:function(data){parser.executeRequest(data);}});}else{this.confirm(evt,pageContext.i18n.confirmModalTitle,pageContext.i18n.unlockPostModalText);}},onSuccess:function(data){commandUtils.reloadPage();}});register_command('wikifyPost',{onSuccess:function(data){if(data.result.wikifyAction.canceled){this.nodeElement.find('.labels .label-info.label-wiki').remove();}else{this.nodeElement.find('.labels').prepend('<span class="label label-info label-wiki">'.concat(pageContext.i18n.wiki).concat('</span>'));}
commandUtils.reloadPage();}});register_command('convertToComment',{execute:function(evt){var parser=this;$.getJSON(this.getParsedUrl('candidates'),function(data){$.each(data.result.parentCandidates,function(i,post){if(post.type=="question"){post.summary=parser.getMessage('question');}else{var postAuthor=(pageContext.userRealName&&post.author.realname)?post.author.realname:post.author.username;post.summary=parser.getMessage('answer')+' ('+pageContext.i18n.by+' '+postAuthor+', '+
commandUtils.friendlyDate(new Date(post.creationDate))+')';}});$.extend(data.result,parser.messages);parser.dialog(evt,'convert-to-comment-dialog',data.result,pageContext.i18n.commandsConvertToCommentTitle);});},onSuccess:function(data){commandUtils.reloadPage();}});register_command('convertToAnswer',{execute:function(evt){this.confirm(evt,pageContext.i18n.confirmModalTitle,pageContext.i18n.convertToAnswerText);},onSuccess:function(data){commandUtils.reloadPage();}});register_command('redirectQuestion',{execute:function(evt){if(this.getStatus()=="off"){var parser=this;commandUtils.showPrompt(evt,'redirect-question-dialog',this.messages,{extra_class:"redirectDialog",title:pageContext.i18n.postControlsRedirectTitle,beforeShow:function($dialog){var $searchQuestion=$dialog.find('.textInput');$searchQuestion.autocomplete({minLength:0,appendTo:"#results",highlight:function(match,keywords){keywords=keywords.split(' ').join('|');return match.replace(new RegExp("("+keywords+")","gi"),'<b>$1</b>');},source:function(request,response){$.ajax({url:parser.getParsedUrl('search'),dataType:'json',minLength:0,delay:30,data:{q:request.term,page:1,pageSize:5,type:"question"},success:function(data){response($.map(data.searchResults.results,function(item,index){if(item!=null){return{desc:item.title,label:item.title.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+
$.ui.autocomplete.escapeRegex(request.term)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:item.id};}}));}});},change:function(event,ui){var _autocomplete_value=$(this).val();if($('.ui-autocomplete li a').filter(function(){return $(this).text().trim()==_autocomplete_value;}).size()==0){$dialog.find('.textInput').val('');$dialog.find("input[name=to]").val('');}},select:function(event,ui){$dialog.find('.textInput').val(ui.item.desc);$dialog.find("input[name=to]").val(ui.item.value);return false;}});if($searchQuestion.length){$searchQuestion.data("ui-autocomplete")._renderItem=function(ul,item){ul.addClass("redirect-autocomplete-ul");return $("<li></li>").data("ui-autocomplete-item",item).append("<a>"+item.label+"</a>").appendTo(ul);};}},onOk:function(data){if(data.to){parser.executeRequest(data);}}});}else{this.confirm(evt,null,null);}},onSuccess:function(data){if(this.getStatus()=="off"){commandUtils.reloadPage();}else{$(".alert").hide();if(window.history.replaceState){var uri=window.location.toString();if(uri.indexOf("?")>0){var clean_uri=uri.substring(0,uri.indexOf("?")).replace(/#[^#]*$/,'');window.history.replaceState({},document.title,clean_uri);}}}}});register_command('moveToSpace',{execute:function(evt){var parser=this;$.getJSON(this.getParsedUrl('candidates'),function(data){$.extend(data.result,parser.messages);parser.dialog(evt,'move-to-space-dialog',data.result,pageContext.i18n.commandsMoveToSpace);});},onSuccess:function(data){commandUtils.reloadPage();}});register_command('switchPrivacy',{execute:function(evt){var parser=this;parser.dialog(evt,'switch-privacy-dialog',null,pageContext.i18n.confirmModalTitle);},onSuccess:function(data){commandUtils.reloadPage();}});register_command('giveReputation',{execute:function(evt){if(this.getStatus()=="off"){var parser=this;var ctx=$.extend({isAnswer:this.nodeElement.is('.answer-container')||this.nodeElement.parents('.answer-container').length,currentUserPoints:pageContext.currentUser.reputation},this.messages);commandUtils.showPrompt(evt,'give-reputation-dialog',ctx,{title:pageContext.i18n.commandsGiveReputation,onOk:function(data){data.node=parser.nodeId;if(data.points.match(/^[1-9]\d*$/)==null){$("#invaliderror").text(pageContext.i18n.invalidReputation);return false;}else{parser.executeRequest(data);}}});}},onSuccess:function(data,evt){if(data.success==false){commandUtils.showMessage(evt,data.errors.status,function(){commandUtils.reloadPage();});}
else{commandUtils.showMessage(evt,pageContext.i18n.commandsGiveReputationSuccess,function(){commandUtils.reloadPage();},pageContext.i18n.commandsGiveReputationSuccess);}}});$(document).ready(function(){$(".post-votes-modal").on("show",function(e){var $cur=$(this);var $curBody=$cur.find(".modal-body");var $curUl=$curBody.find("ul");var spinner="<li class='spinner'><i class='icon-spinner icon-spin icon-2x'></i></li>";if($cur.siblings(".post-score-wrapper").hasClass("positive")){var page=0;var pageSize=25;var updateList=function(follows){$.ajax({url:getVotesJsonUrl.replace("%7Bnode%7D",$cur.parent().attr("nodeId")),beforeSend:function(){if($curUl.find(".spinner").length==0){$curUl.append("<li class='spinner'><i class='icon-spinner icon-spin icon-2x'></i></li>");}},data:{page:page,pageSize:pageSize},success:function(data){page++;if(data.votes.length<pageSize){$curBody.unbind("scroll");}
$curUl.find(".spinner").remove();$.each(data.votes,function(i,vote){var context={user:vote.user};context.user.profileUrl=pageContext.url.profile.replace("{id}",vote.user.id).replace("{plug}",vote.user.username);context.user.displayName=(pageContext.userRealName&&vote.user.realname)?vote.user.realname:vote.user.username;context.follows=follows;$curUl.append(commandUtils.renderTemplate('user-with-follow',context));});commandUtils.initializeLabels();}});};if($cur.find("ul").children().length<1){var follows;$.ajax({url:pageContext.url.getUserFollows.replace("%7Buser%7D",pageContext.currentUser.id),beforeSend:function(){$cur.find("ul").append(spinner);},success:function(data){follows=data.follows;updateList(follows);$curBody.scroll(function(){if($curBody.scrollTop()>=$curUl.height()-$curBody.height()-10){updateList(follows);}});}});}}else{e.preventDefault();e.stopPropagation();}});});function initCommandOverrides(){function showWikiMark($el){var context={canEdit:false,isAnswer:false};var $editlink=$el.find('.node-tools-edit-link');if($editlink.length>0){if($el.parents("[nodeid]:first").is('.answer')){context.isAnswer=true;}
context.canEdit=true;context.editUrl=$editlink.attr('href');}
$el.append(commandUtils.renderTemplate('post-wiki-mark',context));}
function removeWikiMark($el){$el.find('.community-wiki').remove();}
commands.wikifyPost.showWikiMark=showWikiMark;commands.wikifyPost.removeWikiMark=removeWikiMark;commands.wikifyPost.updateLinkText=function(){var text=this.getLinkText();if(text!=null){this.element.html(text);}
if(this.getStatus()=='on'){showWikiMark(this.element.parents('.post-controls'));}else{removeWikiMark(this.element.parents('.post-controls'));}};}
var tools={roles:null,settings:null,questionAuthor:null,init:function(roles,settings){this.roles=roles;this.settings=settings;},roleOrAuthor:function(r1,isAuthor,r2){return r1||(isAuthor&&r2);},rel:function(rel){var userId=pageContext.currentUser.id;var ar=this.roles.a;var qr=this.roles.q;var cr=this.roles.c;var nr=this.roles.n;var mr=this.roles.m;for(var id in rel){var nodeRel=rel[id];var authorId=$("[nodeid="+id+"]").attr("authorId");var isAuthor=userId==authorId;var $topContainer;if(nodeRel.type=="answer"){$topContainer=$('#answer-'+id);}else{$topContainer=$('#question-container');}
setupComments($topContainer,(!nodeRel.locked&&this.roleOrAuthor(nr.c,isAuthor,nr.co)),nodeRel.locked,this.roles.pc);}}}
var setupComments=function($topContainer,canUseComments,commentsLocked,pcPermissions,defaultVisibility,autoExpandComments,notifyAndOptions){if($topContainer.find('.comment-form-container').find('form').length==0){return;}
if(!defaultVisibility){defaultVisibility='full';}
var resultBox=create_object(CommentsBox);resultBox.initialize($topContainer,canUseComments,commentsLocked,pcPermissions,defaultVisibility,notifyAndOptions);if(autoExpandComments){var commentsContainerShowHide=$topContainer.find('.comments-container-showhide');if(commentsContainerShowHide.length===0){commentsContainerShowHide=$topContainer.find('.comments-container');}
var showCommentsContainerLink=$topContainer.find('.show-comments-container');commentsContainerShowHide.show();updateShowComments(showCommentsContainerLink,parseInt(showCommentsContainerLink.attr('commentcount')),commentsContainerShowHide)}
return resultBox;}
function updateShowComments($link,count,commentsContainer){var isReaction=$link.hasClass("reaction");if(commentsContainer.css("display")==="none"){if(isReaction){$link.html(pageContext.i18n.showNReactions.replace("$n",count))}
else{if(count===1){$link.html(pageContext.i18n.showOneComment);}
else{$link.html(pageContext.i18n.showNComments.replace("$n",count));}}}
else{if(isReaction){$link.html(pageContext.i18n.hideNReactions.replace("$n",count))}
else{if(count===1){$link.html(pageContext.i18n.hideOneComment);}
else{$link.html(pageContext.i18n.hideNComments.replace("$n",count));}}}}
function updateShowCommentsLink($link,count,commentsContainerShowHide){updateShowComments($link,count,commentsContainerShowHide);}
var CommentsBox={initialize:function($topContainer,canUseComments,commentsLocked,pcPermissions,defaultVisibility,notifyAndOptions){var $container=$topContainer.find('.comment-form-container');var $comment_tools=$topContainer.find('.comment-tools');this.elements={topContainer:$topContainer,formContainer:$container,postControls:$topContainer.find('.post-controls'),commentTools:$topContainer.find('.comment-tools'),commentsContainer:$topContainer.find('.comments-container'),commentsContainerShowHide:$topContainer.find('.comments-container-showhide'),showCommentsContainerLink:$topContainer.find('.show-comments-container'),headerComment:$container.find('.header-comment'),headerReaction:$container.find('.header-reaction'),form:$container.find('form'),textarea:$container.find('textarea'),extraInputs:$container.find('.comment-form-extra-inputs'),submitButton:$container.find('.comment-submit'),cancelButton:$container.find('.comment-cancel'),charsLeftMessage:$container.find('.comments-chars-left-msg'),charsToGoMessage:$container.find('.comments-chars-togo-msg'),charsExceededMessage:$container.find('.comments-chars-exceeded-msg'),charsCounter:$container.find('.comments-char-left-count'),showAllCommentsLink:$comment_tools.find('.show-all-comments-link'),addCommentLink:$comment_tools.find('.add-comment-link'),onHideCommentForm:$comment_tools.find(".on-hide-comment-form"),commentsLockedLabel:$container.parent().find('.comments-locked'),recipientsMenu:$container.find('.comment-recipient-container'),recipientFullSelection:$container.find('.recipient-full'),recipientMsOnlySelection:$container.find('.recipient-msonly'),recipientMsAndOpSelection:$container.find('.recipient-msAndOp'),recipientsType:$container.find('input[name="visibility"]'),};if(this.elements.commentsContainerShowHide.length===0){this.elements.commentsContainerShowHide=this.elements.commentsContainer;}
else{this.elements.commentsContainerShowHide.hide();this.elements.commentsContainer.show();}
var chars_limits=this.elements.charsCounter.html().split('|');this.options={'commentsLocked':commentsLocked,'canUseComments':canUseComments,'pcPermissions':pcPermissions,'defaultVisibility':defaultVisibility,minLength:parseInt(chars_limits[0]),maxLength:parseInt(chars_limits[1]),commentsEditor:pageContext.options&&pageContext.options.commentsEditor?pageContext.options.commentsEditor:null};this.options.warnLength=this.options.maxLength-30;if(notifyAndOptions){this.notifyAndOptions=notifyAndOptions;}
else{this.notifyAndOptions={commentSubmit:function(isReaction){return{url:undefined,extraData:undefined};},request:function(){},success:function(){},failed:function(errorText){},defaultPlaceholderText:undefined}}
this.state={currentLength:0,inputCheckInterval:null,editing:null,replying:null,formContext:null,inPanelsTransition:false,currentPanel:'comments',isReaction:false,panelsContent:{}};this.setupUiMods();this.setupCallbacks();},listenToFormChanges:function(){if(this.state.inputCheckInterval){window.clearInterval(this.state.inputCheckInterval);}
var self=this;var options=self.options;var elements=self.elements;var state=self.state;this.state.inputCheckInterval=window.setInterval(function(){var tmpobj=$("<p>"+elements.textarea.val().replace(/[ ]{2,}/g," ")+"</p>");var length=tmpobj.text().length;if(state.currentLength==length)
return;if(length<options.warnLength){elements.charsCounter.removeClass('warn');}else if(length>=options.warnLength){elements.charsCounter.addClass('warn');}
if(length<options.minLength){elements.charsLeftMessage.hide();elements.charsExceededMessage.hide();elements.charsToGoMessage.show();elements.charsCounter.html(options.minLength-length);elements.charsCounter.addClass('warn');}else if(length>options.maxLength){elements.charsLeftMessage.hide();elements.charsToGoMessage.hide();elements.charsCounter.html(options.maxLength);elements.charsExceededMessage.show();elements.charsCounter.addClass('warn');}else{elements.charsToGoMessage.hide();elements.charsExceededMessage.hide();elements.charsLeftMessage.show();elements.charsCounter.html(options.maxLength-length);elements.charsCounter.removeClass('warn');}
if(length>options.maxLength||length<options.minLength){elements.submitButton.attr("disabled","disabled");}else{elements.submitButton.removeAttr("disabled");}
state.currentLength=length;},200);},cleanupForm:function(placeholderText){if(this.state.inputCheckInterval){window.clearInterval(this.state.inputCheckInterval);this.state.inputCheckInterval=null;}
if(placeholderText){$(this.elements.textarea).attr('placeholder',placeholderText);}else if(this.notifyAndOptions.defaultPlaceholderText){$(this.elements.textarea).attr('placeholder',this.notifyAndOptions.defaultPlaceholderText);}
$(this.elements.textarea).redactor('set','<p><br></p>');this.elements.extraInputs.html('');this.elements.textarea.css('height',200);this.elements.charsCounter.html(this.options.maxLength);this.elements.charsLeftMessage.removeClass('warn');this.state.currentLength=0;this.state.editing=null;this.state.replying=null;this.state.formContext=null;this.elements.charsLeftMessage.hide();this.elements.charsExceededMessage.hide();this.elements.charsToGoMessage.show();this.elements.charsCounter.removeClass('warn');this.elements.charsCounter.html(this.options.minLength);this.elements.submitButton.attr("disabled","disabled");if(this.elements.attachments){this.elements.attachments.img.html('');this.elements.attachments.node.html('');}},showForm:function($location){if($location&&$location[0].nextSibling!=this.elements.formContainer[0]){var cur=this;this.elements.formContainer.slideUp(400,function(){$location.after(cur.elements.formContainer);});}
this.elements.formContainer.slideDown('fast');this.elements.addCommentLink.find("a").attr('disabled',"true");this.elements.showAllCommentsLink.fadeOut('fast');this.elements.commentsContainer.find('.comment-reply').attr('disabled',"true");$(this.elements.textarea).focus();this.elements.extraInputs.html('');this.elements.recipientsType.val(this.options.defaultVisibility);if(this.options.pcPermissions.u){if(this.state.editing){this.elements.recipientsMenu.hide();}else{this.elements.recipientsMenu.show();}}
this.listenToFormChanges();},hideForm:function(fun){var self=this;this.elements.onHideCommentForm.click();this.elements.formContainer.slideUp('fast',function(){self.cleanupForm();if(typeof fun!=="undefined"){fun();}});this.elements.addCommentLink.find("a").removeAttr('disabled');this.elements.showAllCommentsLink.fadeIn('fast');this.elements.commentsContainer.find('.comment-reply').removeAttr('disabled');},setupUiMods:function(){var self=this;if(this.options.commentsLocked){this.elements.commentsLockedLabel.show();}
if(pageContext.options.commentsAttachmentsEnabled){var $mainAttachmentsContainer=$('<div class="comments-form-attachments"></div>');var $attachmentsContainer=$('<div></div>');var $imgAttachmentsContainer=$('<div></div>');$mainAttachmentsContainer.append($attachmentsContainer);$mainAttachmentsContainer.append($imgAttachmentsContainer);this.elements.form.append($mainAttachmentsContainer);this.elements.attachments={main:$mainAttachmentsContainer,node:$attachmentsContainer,img:$imgAttachmentsContainer};self.addAttachmentToForm=function(attachment){var $el=null;function createDeleteButton(){return $('<a class="node-attachment-delete" href="#">x</a>');}
if(attachment.isImage){$el=$('<div class="img-node-attachment"></div>');var $link=$('<a href="'+attachment.url+'" target="_blank"></a>');$link.append($('<img src="'+attachment.url+'" width="100" />'));$link.append($('<span>'+attachment.fileName+'('+attachment.size+')'+'</span>'));$el.append($link);$el.append($('<input type="hidden" name="attachments" value="'+attachment.fileId+'" />'));$el.append(createDeleteButton());$imgAttachmentsContainer.append($el);}else{$el=$('<div class="node-attachment"></div>');$el.append('<span class="attachment-icon"></span>');$el.append($('<a href="'+attachment.url+'" target="_blank">'+attachment.fileName+'</a>'));$el.append($('<span> ('+attachment.size+')</span>'));$el.append($('<input type="hidden" name="attachments" value="'+attachment.fileId+'" />'));$el.append(createDeleteButton());$attachmentsContainer.append($el);}
self.elements.recipientFullSelection.attr("checked",false);if(self.elements.recipientMsAndOpSelection.length>0){self.elements.recipientMsAndOpSelection.attr("checked",true);self.elements.recipientMsOnlySelection.attr("checked",false);$.proxy(self.setupMsAndOpRecipient,self)();}else{self.elements.recipientMsAndOpSelection.attr("checked",false);self.elements.recipientMsOnlySelection.attr("checked",true);$.proxy(self.setupMsOnlyRecipient,self)();}};var attachments={authorize:function(image){var current=[];$mainAttachmentsContainer.find('input[name=attachments]').each(function(){current.push($(this).val());});var ret={};$.extend(ret,pageContext.authorizeUploadContext);if(current.length>0){ret.current=current;}
if(image){ret.image=image;}
return ret;},toForm:self.addAttachmentToForm};this.elements.textarea.redactor({plugins:pageContext.editor.configs.standard.plugins,buttons:pageContext.editor.configs.standard.buttons,convertDivs:false,linkSize:1000,callback:function(redactor){redactor.fixBlocks();},convertUrlLinks:false,convertLinks:false,attachments:attachments});}
if(this.elements.attachments){self.attachmentsToComment=function($comment,attachments){if($comment.find('.comment-body:first').next().is('.node-attachments')){$comment.find('.comment-body:first').next().remove();}
var $attachments=$('<div class="node-attachments"></div>');$comment.find('.comment-body:first').after($attachments);$.each(attachments,function(i,attachment){var $attachment=$('<div class="node-attachment" ><span></span></div>');$attachment.find('span').addClass(attachment.isImage?'img-attachment-icon':'attachment-icon');$attachment.append($('<a href="'+attachment.url+'">'+attachment.fileName+'</a>'));$attachment.append($('<span>'+' ('+attachment.size+')'+'</span>'));$attachments.append($attachment);});};}
this.setupRecipientsMenu();},setupRecipientsMenu:function(){var self=this;var perm=this.options.pcPermissions;if(perm.u&&(perm.op||perm.m||perm.og||perm.as||perm.ag)){this.elements.recipientsMenu.find('.comment-recipients-selector').click(function(e){var value=$(this).attr('value');self.elements.recipientFullSelection.attr('checked',false);self.elements.recipientMsOnlySelection.attr('checked',false);self.elements.recipientMsAndOpSelection.attr('checked',false);$(this).attr('checked',true);if(value==="msonly"){$.proxy(self.setupMsOnlyRecipient,self)();}else if(value==="msAndOp"){$.proxy(self.setupMsAndOpRecipient,self)();}
else{self.elements.recipientsType.val(value);}
return true;});}else{this.elements.recipientsMenu.remove();self.elements.recipientsType.val("full");}},cleanUpExtraInput:function(){this.elements.extraInputs.html('');},setupMsOnlyRecipient:function(){this.cleanUpExtraInput();this.elements.extraInputs.append('<input type="hidden" name="recipients" value="272" />');this.elements.recipientsType.val('recipient');},setupMsAndOpRecipient:function(){this.cleanUpExtraInput();this.setupMsOnlyRecipient();this.elements.extraInputs.append('<input type="hidden" name="specialRecipients" value="op" />');this.elements.recipientsType.val('recipient');},resetCommentRecipient:function(){this.elements.recipientFullSelection.attr('checked',true);this.elements.recipientMsOnlySelection.attr('checked',false);this.elements.recipientMsAndOpSelection.attr('checked',false);},showCommentBox:function(doShow,asReaction,placeholderText,textReactNo,textReactYes){this.state.isReaction=asReaction;this.state.textReactNo=textReactNo;this.state.textReactYes=textReactYes;if(doShow){if(asReaction){this.elements.headerComment.hide();this.elements.headerReaction.show();}
else{this.elements.headerComment.show();this.elements.headerReaction.hide();}
this.cleanupForm(placeholderText);if(this.elements.topContainer.attr("class")=="question-container"){this.showForm(this.elements.postControls);}else{this.showForm(this.elements.commentTools);}}
else{if(this.state.editing){$('#comment-'+this.state.editing).slideDown('slow');}
this.hideForm();this.resetCommentRecipient();}},areCommentsVisible:function(){return this.elements.commentsContainerShowHide.css("display")!=="none";},toggleShowComments:function(){this.elements.commentsContainerShowHide.toggle();updateShowCommentsLink(this.elements.showCommentsContainerLink,parseInt(this.elements.showCommentsContainerLink.attr('commentcount')),this.elements.commentsContainerShowHide);if(this.elements.commentsContainerShowHide.css("display")!=="none"){this.elements.commentsContainerShowHide.hide();this.elements.commentsContainerShowHide.slideDown(400);}
else{this.elements.commentsContainerShowHide.show();this.elements.commentsContainerShowHide.slideUp(200);}},isReaction:function(){return this.state.isReaction;},addCommentToUI:function(data,reactVote,isEditing,textReactNo,textReactYes){if(isEditing==undefined){isEditing=false;}
if(data.crel.visibility=="moderation"){window.location.href=pageContext.url.commentView.replace("%ID%",data.comment.id);return;}
var post_id=data['comment']['parentId'];var comment_id=data['comment']['id'];var now=Date.today().setTimeToNow();data.commentDate=now.toString("MMM dd")+", "+now.toString("h:mm tt")+new Date().getUTCOffset();data.commentDateFriendly="("+pageContext.i18n.justNow+")";data.author=pageContext.currentUser;data.parentAuthor={username:$('#comment-'+post_id+' .comment-user').html(),url:$('#comment-'+post_id+' .comment-user').attr('href'),avatar:$('#comment-'+post_id+' .comment-user-gravatar img').attr('src')};data.revisionUrl=pageContext.url.revisionView.replace('{nodeId}',data.comment.id);if($('#comment-'+post_id+' .comment-user').html()==null){data.parentAuthor={username:$('#answer-'+post_id+' .answer_author').html(),url:$('#answer-'+post_id+' .answer_author').attr('href'),avatar:$('#answer-'+post_id+' .answer-gravatar img').attr('src')};}
this.elements.commentsContainer.find('.comments-empty').remove();if(isEditing){$('#comment-'+comment_id).find('.comment-text:first').html(data['comment']['bodyAsHTML']);if(this.elements.attachments){this.attachmentsToComment($('#comment-'+comment_id),data.comment.attachments?data.comment.attachments:[]);}}else{data.comment.isReactivateYes=(reactVote==='yes');data.comment.isReactivateNo=(reactVote==='no');data.comment.bodyParsedFromMarkdownIfNeeded=htmlFromMarkdown(data.comment.body);data.comment.textReactYes=textReactYes;data.comment.textReactNo=textReactNo;var $new_comment=commandUtils.renderTemplate('new-comment-skeleton',data);$("[rel=user]",$new_comment).each(function(){createUserPopOver($(this));});commandUtils.initializeLabelsOnElement($new_comment);if(!window.croles.doc&&!window.croles.dc){$(".comment-delete",$new_comment).hide();}
if(!window.croles.eo&&!window.croles.ea){$(".comment-edit",$new_comment).hide();}
if(this.state.replying){var $container=$('#comment-'+this.state.replying);$container.append($new_comment);}else{$new_comment.addClass('even');this.elements.commentsContainer.append($new_comment);}
if(this.elements.attachments&&data.comment.attachments){this.attachmentsToComment($('#comment-'+comment_id),data.comment.attachments);}}
var self=this;function updateCommentCount(){if(data.comment.depth===0){var parentId=data.firstNonCommentAncestor.id;var $showCommentsLink=$("#"+parentId+"-show-comments-container");var fullCommentCount=data.firstNonCommentAncestor.fullCommentCount;$showCommentsLink.attr("commentCount",fullCommentCount);if(!$showCommentsLink.is(':visible')){$showCommentsLink.show();}
updateShowCommentsLink($showCommentsLink,fullCommentCount,self.elements.commentsContainerShowHide);}}
updateCommentCount();this.hideForm(function(){if(data.comment.isReactivateYes){return;}
self.elements.commentsContainerShowHide.slideDown("400",function(){$('#comment-'+comment_id).slideDown('slow',function(){$('html, body').animate({scrollTop:$('#comment-'+comment_id).offset().top},1000);updateCommentCount();});});});if(data.comment.activeRevisionId){$('#comment-'+comment_id).attr('activerev',data.comment.activeRevisionId);}},setupCallbacks:function(){var self=this;self.elements.showAllCommentsLink.click(function(){if($(this).is('.loading')){return false;}
$(this).addClass('loading');self.loadComments(pageContext.url.getComments.replace("%25ID%25",self.elements.formContainer.parents("[nodeid]").attr("nodeid")),self.elements.commentsContainer,'',null);$(this).fadeOut('fast',function(){$(this).remove();});return false;});self.elements.showCommentsContainerLink.click(function(){self.toggleShowComments();});self.elements.addCommentLink.click(function(){self.showCommentBox(true,false);return false;});self.elements.cancelButton.click(function(event){self.showCommentBox(false);return false;});self.elements.submitButton.click(function(evt){if(evt.handled){return false;}
evt.handled=true;var submitOverride=self.notifyAndOptions.commentSubmit(self.state.isReaction)||{};self.elements.submitButton.attr('disabled','disabled');var post_data=commandUtils.extractFormData(self.elements.form);if(self.state.editing){post_data['edit']='true';}else{post_data['edit']='false';}
if(self.state.formContext){$.extend(post_data,self.state.formContext);}
if(submitOverride.extraData){$.extend(post_data,submitOverride.extraData);}
self.notifyAndOptions.request();$.ajax({'type':'POST','url':submitOverride.url||self.elements.form.attr('action'),'data':post_data,'dataType':'json','traditional':true,'success':function(result){if(result.comment==undefined){self.notifyAndOptions.failed("Error sending comment. Please try again");return;}
self.notifyAndOptions.success();self.addCommentToUI(result,self.state.isReaction?'no':undefined,post_data['edit']=='true',self.state.textReactNo,self.state.textReactYes);self.resetCommentRecipient();self.elements.submitButton.removeAttr("disabled");self.state.submitting=false;},'error':function(request,textStatus,errorThrown){self.notifyAndOptions.failed(errorThrown);}});return false;});$(document).on('click','#'+self.elements.commentsContainer.attr('id')+' .comment-edit',function(){if(self.state.editing){$('#comment-'+self.state.editing).slideDown('fast');}
self.cleanupForm();var $link=$(this);var $parent=$link.parents('.comment:first');var comment_id=$parent.attr('nodeid');var activerev_id=$parent.attr('activerev');var $comment=$('#comment-'+comment_id);self.state.editing=comment_id;self.state.formContext={node:comment_id,revisionId:activerev_id};$.post(pageContext.url.getRevision,{revision:activerev_id},function(revision){if(revision.body!=undefined){$(self.elements.textarea).redactor('set',revision.body);}else{}},"json");if(self.elements.attachments){$comment.find('.node-attachments:first').find('.node-attachment').each(function(){var $attachment=$(this);var attachment={};attachment.isImage=$attachment.find('.img-attachment-icon').length>0;attachment.url=$attachment.find('a').attr('href');attachment.fileName=$attachment.find('a').text();attachment.size=$attachment.find('span:last').text();attachment.size=/\(([^\)]*)\)/.exec(attachment.size)[1];attachment.fileId=/\/(\d+)\-/.exec(attachment.url)[1];self.addAttachmentToForm(attachment);});}
$comment.slideUp('slow');self.showForm($comment);return false;});$(document).on('click','#'+self.elements.commentsContainer.attr('id')+' .comment-replies-show',function(){var $link=$(this);var $parent=$($link.parents('.comment')[0]);var comment_id=$parent.attr('nodeid');$link.remove();self.loadComments(pageContext.url.getComments.replace("%25ID%25",comment_id),$parent,'',null);return false;});$(document).on('click','#'+self.elements.commentsContainer.attr('id')+' .comments-expand',function(){var $link=$(this);var $parent=$link.parent("[nodeid]:first");if(!$parent[0]){$parent=$link.parent().parent().parents("[nodeid]:first");}
var comment_id=$parent.attr('nodeid');$link.remove();var slideDownDeferred=$.Deferred();if(self.state.editing){self.hideForm(function(){slideDownDeferred.resolve()});}else{slideDownDeferred.resolve();}
slideDownDeferred.then(function(){var $container=$parent.is('.comment')?$parent:self.elements.commentsContainer;self.loadComments(pageContext.url.getComments.replace("%25ID%25",comment_id),$container,'',null);})
return false;});if(self.options.commentsLocked){$('head').append('<style type="text/css">#'+self.elements.commentsContainer.attr('id')+' .comment-reply{visibility: hidden;}</style>');}else{$(document).on('click','#'+self.elements.commentsContainer.attr('id')+' .comment-reply',function(){self.cleanupForm();var $parentContainer=$(this).parents("#"+$(this).attr("id").replace("-reply",""));var in_reply_id=$parentContainer.attr('nodeid');self.state.replying=in_reply_id;self.state.formContext={inReply:in_reply_id};self.showForm($parentContainer);return false;});}},renderLoadedComments:function($container,comments,jsonRelation){var self=this;for(var i=0;i<comments.length;i++){var comment=comments[i];var tplData={showTools:false};tplData.comment=comment;tplData.author={id:comment.author.id,username:comment.author.username,url:pageContext.url.profile.replace("{id}",comment.author.id).replace("{plug}",comment.author.username),avatar:comment.author.avatar};tplData.parentAuthor={username:$('#comment-'+comment.parentId+' .comment-user').html(),url:$('#comment-'+comment.parentId+' .comment-user').attr('href'),avatar:$('#comment-'+comment.parentId+' .comment-user-gravatar img').attr('src')}
tplData.commentDate=comment.creationDate;tplData.commentDateFriendly=commandUtils.friendlyDate(new Date(comment.creationDate));tplData.crel=jsonRelation[comment.id];tplData.revisionUrl=pageContext.url.revisionView.replace('{nodeId}',comment.id);tplData.comment.bodyParsedFromMarkdownIfNeeded=htmlFromMarkdown(tplData.comment.body);var $el=commandUtils.renderTemplate('new-comment-skeleton',tplData);commandUtils.initializeLabelsOnElement($el);if(i>0){$container.find('#comment-'+comments[i-1].id).after($el);}else{$container.append($el);}
if(self.elements.attachments&&comment.attachments){self.attachmentsToComment($el,comment.attachments);}
if(comment.replies&&comment.replies.comments){self.renderLoadedComments($el,comment.replies.comments,comment.replies.jsonRelation?comment.replies.jsonRelation:null);}}
if(jsonRelation){tools.rel(jsonRelation);}},loadComments:function(url,$container,no_comments_text,callback){var self=this;$.getJSON(url,function(data){if(data.success){if($container.is('.comment')){$container.find('.comment').remove();}else{$container.html('');}
if(data.result.comments&&data.result.comments.length==0){self.elements.commentsContainer.html('<span class="comments-empty">'+no_comments_text+'</span>');}else{if(data.result.replies){self.renderLoadedComments($container,data.result.replies.comments,data.result.replies.jsonRelation);}else{self.renderLoadedComments($container,data.result.comments,data.result.jsonRelation);}}
self.elements.commentTools.find('.comments-showing').fadeOut('slow');if(callback){callback();}}});}}
rangy.createModule("SaveRestore",function(api,module){api.requireModules(["DomUtil","DomRange","WrappedRange"]);var dom=api.dom;var markerTextChar="\ufeff";function gEBI(id,doc){return(doc||document).getElementById(id);}
function insertRangeBoundaryMarker(range,atStart){var markerId="selectionBoundary_"+(+new Date())+"_"+(""+Math.random()).slice(2);var markerEl;var doc=dom.getDocument(range.startContainer);var boundaryRange=range.cloneRange();boundaryRange.collapse(atStart);markerEl=doc.createElement("span");markerEl.id=markerId;markerEl.style.lineHeight="0";markerEl.style.display="none";markerEl.className="rangySelectionBoundary";markerEl.appendChild(doc.createTextNode(markerTextChar));boundaryRange.insertNode(markerEl);boundaryRange.detach();return markerEl;}
function setRangeBoundary(doc,range,markerId,atStart){var markerEl=gEBI(markerId,doc);if(markerEl){range[atStart?"setStartBefore":"setEndBefore"](markerEl);markerEl.parentNode.removeChild(markerEl);}else{module.warn("Marker element has been removed. Cannot restore selection.");}}
function compareRanges(r1,r2){return r2.compareBoundaryPoints(r1.START_TO_START,r1);}
function saveSelection(win){win=win||window;var doc=win.document;if(!api.isSelectionValid(win)){module.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");return;}
var sel=api.getSelection(win);var ranges=sel.getAllRanges();var rangeInfos=[],startEl,endEl,range;ranges.sort(compareRanges);for(var i=0,len=ranges.length;i<len;++i){range=ranges[i];if(range.collapsed){endEl=insertRangeBoundaryMarker(range,false);rangeInfos.push({markerId:endEl.id,collapsed:true});}else{endEl=insertRangeBoundaryMarker(range,false);startEl=insertRangeBoundaryMarker(range,true);rangeInfos[i]={startMarkerId:startEl.id,endMarkerId:endEl.id,collapsed:false,backwards:ranges.length==1&&sel.isBackwards()};}}
for(i=len-1;i>=0;--i){range=ranges[i];if(range.collapsed){range.collapseBefore(gEBI(rangeInfos[i].markerId,doc));}else{range.setEndBefore(gEBI(rangeInfos[i].endMarkerId,doc));range.setStartAfter(gEBI(rangeInfos[i].startMarkerId,doc));}}
sel.setRanges(ranges);return{win:win,doc:doc,rangeInfos:rangeInfos,restored:false};}
function restoreSelection(savedSelection,preserveDirection){if(!savedSelection.restored){var rangeInfos=savedSelection.rangeInfos;var sel=api.getSelection(savedSelection.win);var ranges=[];for(var len=rangeInfos.length,i=len-1,rangeInfo,range;i>=0;--i){rangeInfo=rangeInfos[i];range=api.createRange(savedSelection.doc);if(rangeInfo.collapsed){var markerEl=gEBI(rangeInfo.markerId,savedSelection.doc);if(markerEl){markerEl.style.display="inline";var previousNode=markerEl.previousSibling;if(previousNode&&previousNode.nodeType==3){markerEl.parentNode.removeChild(markerEl);range.collapseToPoint(previousNode,previousNode.length);}else{range.collapseBefore(markerEl);markerEl.parentNode.removeChild(markerEl);}}else{module.warn("Marker element has been removed. Cannot restore selection.");}}else{setRangeBoundary(savedSelection.doc,range,rangeInfo.startMarkerId,true);setRangeBoundary(savedSelection.doc,range,rangeInfo.endMarkerId,false);}
if(len==1){range.normalizeBoundaries();}
ranges[i]=range;}
if(len==1&&preserveDirection&&api.features.selectionHasExtend&&rangeInfos[0].backwards){sel.removeAllRanges();sel.addRange(ranges[0],true);}else{sel.setRanges(ranges);}
savedSelection.restored=true;}}
function removeMarkerElement(doc,markerId){var markerEl=gEBI(markerId,doc);if(markerEl){markerEl.parentNode.removeChild(markerEl);}}
function removeMarkers(savedSelection){var rangeInfos=savedSelection.rangeInfos;for(var i=0,len=rangeInfos.length,rangeInfo;i<len;++i){rangeInfo=rangeInfos[i];if(rangeInfo.collapsed){removeMarkerElement(savedSelection.doc,rangeInfo.markerId);}else{removeMarkerElement(savedSelection.doc,rangeInfo.startMarkerId);removeMarkerElement(savedSelection.doc,rangeInfo.endMarkerId);}}}
api.saveSelection=saveSelection;api.restoreSelection=restoreSelection;api.removeMarkerElement=removeMarkerElement;api.removeMarkers=removeMarkers;});function removePluginFromConfig(plugin,type){var config;if(type&&pageContext.editor.configs[type]){config=pageContext.editor.configs[type];}else{config=$.extend(true,{},pageContext.editor.configs.standard);}
var i=0;buttons=pageContext.editor.pluginButtons[plugin];while(i<buttons.length){var button=buttons[i];config.buttons.splice(config.buttons.indexOf(button),1);i++}
config.plugins.splice(config.plugins.indexOf(plugin),1);pageContext.editor.configs[type]=config;}
pageContext.editor={configs:{standard:{buttons:['code','bold','italic','blockquote','unorderedlist','orderedlist','image','file','link'],plugins:['upload','autotaguser','code']},topic:{buttons:['code','bold','italic','blockquote','unorderedlist','orderedlist','link'],plugins:['code']}},pluginButtons:{upload:['image','file'],code:['code']}};$(function(){var storage=$.localStorage;function readDraftValues($form,redactor,keys,load,setup,saveDraft){var ret=false;var formAction=$form.attr('data-draftKey');keys.push(formAction);$form.find('input:not(.redactor, .submit)').each(function(){var name=$(this).attr('name');var storageKey=formAction+':'+name;keys.push(storageKey);var oldVal=storage.get(storageKey);if(oldVal){ret=true;if(load){if($(this).is('.select2-offscreen')){var sel2Data=[];var loadedTags=oldVal.split(',');$.each(loadedTags,function(i,tag){sel2Data.push({id:tag,text:tag});});$(this).select2("data",sel2Data);}else{$(this).val(oldVal);}}}
if(setup){$(this).change(function(){storage.set(storageKey,$(this).val());saveDraft();})}});var oldContent=storage.get(formAction);var spaceSelect=storage.get('space_select');var spaceSelectText=storage.get('space_select_text');if(oldContent){ret=true;if(load){$("#space_select").val(spaceSelect.toString());$("#s2id_space_select .select2-chosen").text(spaceSelectText);redactor.redactor('set',oldContent.toString());}}
return ret;}
$(".redactor").each(function(){var $this=$(this),type=$this.attr("data-type"),config=pageContext.editor.configs.standard;if(type&&pageContext.editor.configs[type]){config=pageContext.editor.configs[type];}
var showSaveDraft=undefined;function waitUntilNextMessage(time){if(time==undefined){time=18000;}
window.setTimeout(function(){showSaveDraft=true;},time);}
function saveDraft(){if(showSaveDraft){var $message=$('<div class="redactor-draft-save"><p>'+pageContext.i18n.draftSaveMessage+'</p></div>');$this.parent('.redactor_box').append($message);$message.fadeIn(300,function(){$message.fadeOut(8000,function(){$message.remove();});});showSaveDraft=false;waitUntilNextMessage();}else if(showSaveDraft===undefined){showSaveDraft=false;waitUntilNextMessage(2000);}}
var $form=$this.parents('form');var formAction=$form.attr('data-draftKey');var keys=[];var showOverlay=false;if(formAction&&readDraftValues($form,$this,keys,false,false)){showOverlay=true;}
var draftsSetup=false;var redactor=$this.redactor({plugins:config.plugins,buttons:config.buttons,convertDivs:false,linkSize:1000,callback:function(redactor){redactor.fixBlocks();},changeCallback:function(html){if(draftsSetup){storage.set('space_select',$("#space_select").val());storage.set('space_select_text',$("#space_select option:selected").text());storage.set(formAction,html);saveDraft();}},focusCallback:function(e){if($(this.$element).parent().popover!=undefined){$(this.$element).parent().popover("show");}},blurCallback:function(e){if($(this.$element).parent().popover!=undefined){$(this.$element).parent().popover("hide");}},convertUrlLinks:false,convertLinks:false});if(showOverlay){var $overlay=$('<div class="redactor-draft-overlay"></div>');redactor.redactor('set','');$form.find("input[name=topics]").val('');$form.css('position','relative');$form.append($overlay);var $message=$('<div class="alert alert-info redactor-draft-message"><p>'+
pageContext.i18n.draftMessage.replace('TYPO',$form.attr('data-draftType'))+'</p><div class="buttons">'+'<input class="btn btn-primary pull-right load-draft" type="submit" value=\"'+
pageContext.i18n.draftLoadButton+'\">'+'<input class="btn btn-delete pull-right cancel-draft" type="submit" value=\"'+
pageContext.i18n.draftDeleteButton+'\">'+'</div></div>');$form.before($message);$overlay.click(function(){$message.animate({'background-color':'#BDDFFF'},500,'swing',function(){$message.animate({'background-color':'#D9EDF7'},500);})});$message.find('.cancel-draft').click(function(){$overlay.remove();$message.slideUp('fast');storage.remove(keys);redactor.redactor('set','');$form.find("input.select2-offscreen").select2("data",[]);readDraftValues($form,$this,[],false,true,saveDraft);draftsSetup=true;return false;});$message.find('.load-draft').click(function(){$overlay.remove();$message.slideUp('fast');readDraftValues($form,$this,[],true,true,saveDraft);draftsSetup=true;return false;});}else if(formAction){readDraftValues($form,$this,[],false,true,saveDraft);draftsSetup=true;}
if(formAction){$form.submit(function(){storage.remove(keys);});}});});(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var _=require("./util");var whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","colspan","align","valign"],tfoot:["align","valign"],th:["width","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","loop","preload","src","height","width"]};function onTag(tag,html,options){}function onIgnoreTag(tag,html,options){}function onTagAttr(tag,name,value){}function onIgnoreTagAttr(tag,name,value){}function escapeHtml(html){return html.replace(REGEXP_LT,"&lt;").replace(REGEXP_GT,"&gt;")}function safeAttrValue(tag,name,value,cssFilter){value=friendlyAttrValue(value);if(name==="href"||name==="src"){value=_.trim(value);if(value==="#")return"#";if(!(value.substr(0,7)==="http://"||value.substr(0,8)==="https://"||value.substr(0,7)==="mailto:"||value[0]==="/")){return""}}else if(name==="background"){REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)){return""}}else if(name==="style"){REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)){return""}REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)){REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)){return""}}value=cssFilter.process(value)}value=escapeAttrValue(value);return value}var REGEXP_LT=/</g;var REGEXP_GT=/>/g;var REGEXP_QUOTE=/"/g;var REGEXP_QUOTE_2=/&quot;/g;var REGEXP_ATTR_VALUE_1=/&#([a-zA-Z0-9]*);?/gim;var REGEXP_ATTR_VALUE_COLON=/&colon;?/gim;var REGEXP_ATTR_VALUE_NEWLINE=/&newline;?/gim;var REGEXP_DEFAULT_ON_TAG_ATTR_3=/\/\*|\*\//gm;var REGEXP_DEFAULT_ON_TAG_ATTR_4=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_5=/^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_6=/^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;var REGEXP_DEFAULT_ON_TAG_ATTR_7=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_8=/u\s*r\s*l\s*\(.*/gi;function escapeQuote(str){return str.replace(REGEXP_QUOTE,"&quot;")}function unescapeQuote(str){return str.replace(REGEXP_QUOTE_2,'"')}function escapeHtmlEntities(str){return str.replace(REGEXP_ATTR_VALUE_1,function replaceUnicode(str,code){return code[0]==="x"||code[0]==="X"?String.fromCharCode(parseInt(code.substr(1),16)):String.fromCharCode(parseInt(code,10))})}function escapeDangerHtml5Entities(str){return str.replace(REGEXP_ATTR_VALUE_COLON,":").replace(REGEXP_ATTR_VALUE_NEWLINE," ")}function clearNonPrintableCharacter(str){var str2="";for(var i=0,len=str.length;i<len;i++){str2+=str.charCodeAt(i)<32?" ":str.charAt(i)}return _.trim(str2)}function friendlyAttrValue(str){str=unescapeQuote(str);str=escapeHtmlEntities(str);str=escapeDangerHtml5Entities(str);str=clearNonPrintableCharacter(str);return str}function escapeAttrValue(str){str=escapeQuote(str);str=escapeHtml(str);return str}function onIgnoreTagStripAll(){return""}function StripTagBody(tags,next){if(typeof next!=="function"){next=function(){}}var isRemoveAllTag=!Array.isArray(tags);function isRemoveTag(tag){if(isRemoveAllTag)return true;return _.indexOf(tags,tag)!==-1}var removeList=[];var posStart=false;return{onIgnoreTag:function(tag,html,options){if(isRemoveTag(tag)){if(options.isClosing){var ret="[/removed]";var end=options.position+ret.length;removeList.push([posStart!==false?posStart:options.position,end]);posStart=false;return ret}else{if(!posStart){posStart=options.position}return"[removed]"}}else{return next(tag,html,options)}},remove:function(html){var rethtml="";var lastPos=0;_.forEach(removeList,function(pos){rethtml+=html.slice(lastPos,pos[0]);lastPos=pos[1]});rethtml+=html.slice(lastPos);return rethtml}}}function stripCommentTag(html){return html.replace(STRIP_COMMENT_TAG_REGEXP,"")}var STRIP_COMMENT_TAG_REGEXP=/<!--[\s\S]*?-->/g;function stripBlankChar(html){var chars=html.split("");chars=chars.filter(function(char){var c=char.charCodeAt(0);if(c===127)return false;if(c<=31){if(c===10||c===13)return true;return false}return true});return chars.join("")}exports.whiteList=whiteList;exports.onTag=onTag;exports.onIgnoreTag=onIgnoreTag;exports.onTagAttr=onTagAttr;exports.onIgnoreTagAttr=onIgnoreTagAttr;exports.safeAttrValue=safeAttrValue;exports.escapeHtml=escapeHtml;exports.escapeQuote=escapeQuote;exports.unescapeQuote=unescapeQuote;exports.escapeHtmlEntities=escapeHtmlEntities;exports.escapeDangerHtml5Entities=escapeDangerHtml5Entities;exports.clearNonPrintableCharacter=clearNonPrintableCharacter;exports.friendlyAttrValue=friendlyAttrValue;exports.escapeAttrValue=escapeAttrValue;exports.onIgnoreTagStripAll=onIgnoreTagStripAll;exports.StripTagBody=StripTagBody;exports.stripCommentTag=stripCommentTag;exports.stripBlankChar=stripBlankChar},{"./util":4}],2:[function(require,module,exports){var DEFAULT=require("./default");var parser=require("./parser");var FilterXSS=require("./xss");function filterXSS(html,options){var xss=new FilterXSS(options);return xss.process(html)}exports=module.exports=filterXSS;exports.FilterXSS=FilterXSS;for(var i in DEFAULT)exports[i]=DEFAULT[i];for(var i in parser)exports[i]=parser[i];if(typeof define==="function"&&define.amd){define(function(){return module.exports})}if(typeof window!=="undefined"){window.filterXSS=module.exports}},{"./default":1,"./parser":3,"./xss":5}],3:[function(require,module,exports){var _=require("./util");function getTagName(html){var i=html.indexOf(" ");if(i===-1){var tagName=html.slice(1,-1)}else{var tagName=html.slice(1,i+1)}tagName=_.trim(tagName).toLowerCase();if(tagName[0]==="/")tagName=tagName.slice(1);if(tagName[tagName.length-1]==="/")tagName=tagName.slice(0,-1);return tagName}function isClosing(html){return html.slice(0,2)==="</"}function parseTag(html,onTag,escapeHtml){"user strict";var rethtml="";var lastPos=0;var tagStart=false;var quoteStart=false;var currentPos=0;var len=html.length;var currentHtml="";var currentTagName="";for(currentPos=0;currentPos<len;currentPos++){var c=html.charAt(currentPos);if(tagStart===false){if(c==="<"){tagStart=currentPos;continue}}else{if(quoteStart===false){if(c==="<"){rethtml+=escapeHtml(html.slice(lastPos,currentPos));tagStart=currentPos;lastPos=currentPos;continue}if(c===">"){rethtml+=escapeHtml(html.slice(lastPos,tagStart));currentHtml=html.slice(tagStart,currentPos+1);currentTagName=getTagName(currentHtml);rethtml+=onTag(tagStart,rethtml.length,currentTagName,currentHtml,isClosing(currentHtml));lastPos=currentPos+1;tagStart=false;continue}if(c==='"'||c==="'"){quoteStart=c;continue}}else{if(c===quoteStart){quoteStart=false;continue}}}}if(lastPos<html.length){rethtml+=escapeHtml(html.substr(lastPos))}return rethtml}var REGEXP_ATTR_NAME=/[^a-zA-Z0-9_:\.\-]/gim;function parseAttr(html,onAttr){"user strict";var lastPos=0;var retAttrs=[];var tmpName=false;var len=html.length;function addAttr(name,value){name=_.trim(name);name=name.replace(REGEXP_ATTR_NAME,"").toLowerCase();if(name.length<1)return;retAttrs.push(onAttr(name,value||""))}for(var i=0;i<len;i++){var c=html.charAt(i),v;if(tmpName===false&&c==="="){tmpName=html.slice(lastPos,i);lastPos=i+1;continue}if(tmpName!==false){if(i===lastPos&&(c==='"'||c==="'")){var j=html.indexOf(c,i+1);if(j===-1){break}else{v=_.trim(html.slice(lastPos+1,j));addAttr(tmpName,v);tmpName=false;i=j;lastPos=i+1;continue}}}if(c===" "){v=_.trim(html.slice(lastPos,i));if(tmpName===false){addAttr(v)}else{addAttr(tmpName,v)}tmpName=false;lastPos=i+1;continue}}if(lastPos<html.length){if(tmpName===false){addAttr(html.slice(lastPos))}else{addAttr(tmpName,html.slice(lastPos))}}return _.trim(retAttrs.join(" "))}exports.parseTag=parseTag;exports.parseAttr=parseAttr},{"./util":4}],4:[function(require,module,exports){module.exports={indexOf:function(arr,item){var i,j;if(Array.prototype.indexOf){return arr.indexOf(item)}for(i=0,j=arr.length;i<j;i++){if(arr[i]===item){return i}}return-1},forEach:function(arr,fn,scope){var i,j;if(Array.prototype.forEach){return arr.forEach(fn,scope)}for(i=0,j=arr.length;i<j;i++){fn.call(scope,arr[i],i,arr)}},trim:function(str){if(String.prototype.trim){return str.trim()}return str.replace(/(^\s*)|(\s*$)/g,"")}}},{}],5:[function(require,module,exports){var FilterCSS=require("cssfilter").FilterCSS;var DEFAULT=require("./default");var parser=require("./parser");var parseTag=parser.parseTag;var parseAttr=parser.parseAttr;var _=require("./util");function isNull(obj){return obj===undefined||obj===null}function getAttrs(html){var i=html.indexOf(" ");if(i===-1){return{html:"",closing:html[html.length-2]==="/"}}html=_.trim(html.slice(i+1,-1));var isClosing=html[html.length-1]==="/";if(isClosing)html=_.trim(html.slice(0,-1));return{html:html,closing:isClosing}}function FilterXSS(options){options=options||{};if(options.stripIgnoreTag){if(options.onIgnoreTag){console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time')}options.onIgnoreTag=DEFAULT.onIgnoreTagStripAll}options.whiteList=options.whiteList||DEFAULT.whiteList;options.onTag=options.onTag||DEFAULT.onTag;options.onTagAttr=options.onTagAttr||DEFAULT.onTagAttr;options.onIgnoreTag=options.onIgnoreTag||DEFAULT.onIgnoreTag;options.onIgnoreTagAttr=options.onIgnoreTagAttr||DEFAULT.onIgnoreTagAttr;options.safeAttrValue=options.safeAttrValue||DEFAULT.safeAttrValue;options.escapeHtml=options.escapeHtml||DEFAULT.escapeHtml;options.css=options.css||{};this.options=options;this.cssFilter=new FilterCSS(options.css)}FilterXSS.prototype.process=function(html){html=html||"";html=html.toString();if(!html)return"";var me=this;var options=me.options;var whiteList=options.whiteList;var onTag=options.onTag;var onIgnoreTag=options.onIgnoreTag;var onTagAttr=options.onTagAttr;var onIgnoreTagAttr=options.onIgnoreTagAttr;var safeAttrValue=options.safeAttrValue;var escapeHtml=options.escapeHtml;var cssFilter=me.cssFilter;if(options.stripBlankChar){html=DEFAULT.stripBlankChar(html)}if(!options.allowCommentTag){html=DEFAULT.stripCommentTag(html)}if(options.stripIgnoreTagBody){var stripIgnoreTagBody=DEFAULT.StripTagBody(options.stripIgnoreTagBody,onIgnoreTag);onIgnoreTag=stripIgnoreTagBody.onIgnoreTag}else{stripIgnoreTagBody=false}var retHtml=parseTag(html,function(sourcePosition,position,tag,html,isClosing){var info={sourcePosition:sourcePosition,position:position,isClosing:isClosing,isWhite:tag in whiteList};var ret=onTag(tag,html,info);if(!isNull(ret))return ret;if(info.isWhite){if(info.isClosing){return"</"+tag+">"}var attrs=getAttrs(html);var whiteAttrList=whiteList[tag];var attrsHtml=parseAttr(attrs.html,function(name,value){var isWhiteAttr=_.indexOf(whiteAttrList,name)!==-1;var ret=onTagAttr(tag,name,value,isWhiteAttr);if(!isNull(ret))return ret;if(isWhiteAttr){value=safeAttrValue(tag,name,value,cssFilter);if(value){return name+'="'+value+'"'}else{return name}}else{var ret=onIgnoreTagAttr(tag,name,value,isWhiteAttr);if(!isNull(ret))return ret;return}});var html="<"+tag;if(attrsHtml)html+=" "+attrsHtml;if(attrs.closing)html+=" /";html+=">";return html}else{var ret=onIgnoreTag(tag,html,info);if(!isNull(ret))return ret;return escapeHtml(html)}},escapeHtml);if(stripIgnoreTagBody){retHtml=stripIgnoreTagBody.remove(retHtml)}return retHtml};module.exports=FilterXSS},{"./default":1,"./parser":3,"./util":4,cssfilter:8}],6:[function(require,module,exports){var DEFAULT=require("./default");var parseStyle=require("./parser");var _=require("./util");function isNull(obj){return obj===undefined||obj===null}function FilterCSS(options){options=options||{};options.whiteList=options.whiteList||DEFAULT.whiteList;options.onAttr=options.onAttr||DEFAULT.onAttr;options.onIgnoreAttr=options.onIgnoreAttr||DEFAULT.onIgnoreAttr;this.options=options}FilterCSS.prototype.process=function(css){css=css||"";css=css.toString();if(!css)return"";var me=this;var options=me.options;var whiteList=options.whiteList;var onAttr=options.onAttr;var onIgnoreAttr=options.onIgnoreAttr;var retCSS=parseStyle(css,function(sourcePosition,position,name,value,source){var check=whiteList[name];var isWhite=false;if(check===true)isWhite=check;else if(typeof check==="function")isWhite=check(value);else if(check instanceof RegExp)isWhite=check.test(value);if(isWhite!==true)isWhite=false;var opts={position:position,sourcePosition:sourcePosition,source:source,isWhite:isWhite};if(isWhite){var ret=onAttr(name,value,opts);if(isNull(ret)){return name+":"+value}else{return ret}}else{var ret=onIgnoreAttr(name,value,opts);if(!isNull(ret)){return ret}}});return retCSS};module.exports=FilterCSS},{"./default":7,"./parser":9,"./util":10}],7:[function(require,module,exports){var whiteList={};whiteList["align-content"]=false;whiteList["align-items"]=false;whiteList["align-self"]=false;whiteList["alignment-adjust"]=false;whiteList["alignment-baseline"]=false;whiteList["all"]=false;whiteList["anchor-point"]=false;whiteList["animation"]=false;whiteList["animation-delay"]=false;whiteList["animation-direction"]=false;whiteList["animation-duration"]=false;whiteList["animation-fill-mode"]=false;whiteList["animation-iteration-count"]=false;whiteList["animation-name"]=false;whiteList["animation-play-state"]=false;whiteList["animation-timing-function"]=false;whiteList["azimuth"]=false;whiteList["backface-visibility"]=false;whiteList["background"]=true;whiteList["background-attachment"]=true;whiteList["background-clip"]=true;whiteList["background-color"]=true;whiteList["background-image"]=true;whiteList["background-origin"]=true;whiteList["background-position"]=true;whiteList["background-repeat"]=true;whiteList["background-size"]=true;whiteList["baseline-shift"]=false;whiteList["binding"]=false;whiteList["bleed"]=false;whiteList["bookmark-label"]=false;whiteList["bookmark-level"]=false;whiteList["bookmark-state"]=false;whiteList["border"]=true;whiteList["border-bottom"]=true;whiteList["border-bottom-color"]=true;whiteList["border-bottom-left-radius"]=true;whiteList["border-bottom-right-radius"]=true;whiteList["border-bottom-style"]=true;whiteList["border-bottom-width"]=true;whiteList["border-collapse"]=true;whiteList["border-color"]=true;whiteList["border-image"]=true;whiteList["border-image-outset"]=true;whiteList["border-image-repeat"]=true;whiteList["border-image-slice"]=true;whiteList["border-image-source"]=true;whiteList["border-image-width"]=true;whiteList["border-left"]=true;whiteList["border-left-color"]=true;whiteList["border-left-style"]=true;whiteList["border-left-width"]=true;whiteList["border-radius"]=true;whiteList["border-right"]=true;whiteList["border-right-color"]=true;whiteList["border-right-style"]=true;whiteList["border-right-width"]=true;whiteList["border-spacing"]=true;whiteList["border-style"]=true;whiteList["border-top"]=true;whiteList["border-top-color"]=true;whiteList["border-top-left-radius"]=true;whiteList["border-top-right-radius"]=true;whiteList["border-top-style"]=true;whiteList["border-top-width"]=true;whiteList["border-width"]=true;whiteList["bottom"]=false;whiteList["box-decoration-break"]=true;whiteList["box-shadow"]=true;whiteList["box-sizing"]=true;whiteList["box-snap"]=true;whiteList["box-suppress"]=true;whiteList["break-after"]=true;whiteList["break-before"]=true;whiteList["break-inside"]=true;whiteList["caption-side"]=false;whiteList["chains"]=false;whiteList["clear"]=true;whiteList["clip"]=false;whiteList["clip-path"]=false;whiteList["clip-rule"]=false;whiteList["color"]=true;whiteList["color-interpolation-filters"]=true;whiteList["column-count"]=false;whiteList["column-fill"]=false;whiteList["column-gap"]=false;whiteList["column-rule"]=false;whiteList["column-rule-color"]=false;whiteList["column-rule-style"]=false;whiteList["column-rule-width"]=false;whiteList["column-span"]=false;whiteList["column-width"]=false;whiteList["columns"]=false;whiteList["contain"]=false;whiteList["content"]=false;whiteList["counter-increment"]=false;whiteList["counter-reset"]=false;whiteList["counter-set"]=false;whiteList["crop"]=false;whiteList["cue"]=false;whiteList["cue-after"]=false;whiteList["cue-before"]=false;whiteList["cursor"]=false;whiteList["direction"]=false;whiteList["display"]=true;whiteList["display-inside"]=true;whiteList["display-list"]=true;whiteList["display-outside"]=true;whiteList["dominant-baseline"]=false;whiteList["elevation"]=false;whiteList["empty-cells"]=false;whiteList["filter"]=false;whiteList["flex"]=false;whiteList["flex-basis"]=false;whiteList["flex-direction"]=false;whiteList["flex-flow"]=false;whiteList["flex-grow"]=false;whiteList["flex-shrink"]=false;whiteList["flex-wrap"]=false;whiteList["float"]=false;whiteList["float-offset"]=false;whiteList["flood-color"]=false;whiteList["flood-opacity"]=false;whiteList["flow-from"]=false;whiteList["flow-into"]=false;whiteList["font"]=true;whiteList["font-family"]=true;whiteList["font-feature-settings"]=true;whiteList["font-kerning"]=true;whiteList["font-language-override"]=true;whiteList["font-size"]=true;whiteList["font-size-adjust"]=true;whiteList["font-stretch"]=true;whiteList["font-style"]=true;whiteList["font-synthesis"]=true;whiteList["font-variant"]=true;whiteList["font-variant-alternates"]=true;whiteList["font-variant-caps"]=true;whiteList["font-variant-east-asian"]=true;whiteList["font-variant-ligatures"]=true;whiteList["font-variant-numeric"]=true;whiteList["font-variant-position"]=true;whiteList["font-weight"]=true;whiteList["grid"]=false;whiteList["grid-area"]=false;whiteList["grid-auto-columns"]=false;whiteList["grid-auto-flow"]=false;whiteList["grid-auto-rows"]=false;whiteList["grid-column"]=false;whiteList["grid-column-end"]=false;whiteList["grid-column-start"]=false;whiteList["grid-row"]=false;whiteList["grid-row-end"]=false;whiteList["grid-row-start"]=false;whiteList["grid-template"]=false;whiteList["grid-template-areas"]=false;whiteList["grid-template-columns"]=false;whiteList["grid-template-rows"]=false;whiteList["hanging-punctuation"]=false;whiteList["height"]=true;whiteList["hyphens"]=false;whiteList["icon"]=false;whiteList["image-orientation"]=false;whiteList["image-resolution"]=false;whiteList["ime-mode"]=false;whiteList["initial-letters"]=false;whiteList["inline-box-align"]=false;whiteList["justify-content"]=false;whiteList["justify-items"]=false;whiteList["justify-self"]=false;whiteList["left"]=false;whiteList["letter-spacing"]=true;whiteList["lighting-color"]=true;whiteList["line-box-contain"]=false;whiteList["line-break"]=false;whiteList["line-grid"]=false;whiteList["line-height"]=false;whiteList["line-snap"]=false;whiteList["line-stacking"]=false;whiteList["line-stacking-ruby"]=false;whiteList["line-stacking-shift"]=false;whiteList["line-stacking-strategy"]=false;whiteList["list-style"]=true;whiteList["list-style-image"]=true;whiteList["list-style-position"]=true;whiteList["list-style-type"]=true;whiteList["margin"]=true;whiteList["margin-bottom"]=true;whiteList["margin-left"]=true;whiteList["margin-right"]=true;whiteList["margin-top"]=true;whiteList["marker-offset"]=false;whiteList["marker-side"]=false;whiteList["marks"]=false;whiteList["mask"]=false;whiteList["mask-box"]=false;whiteList["mask-box-outset"]=false;whiteList["mask-box-repeat"]=false;whiteList["mask-box-slice"]=false;whiteList["mask-box-source"]=false;whiteList["mask-box-width"]=false;whiteList["mask-clip"]=false;whiteList["mask-image"]=false;whiteList["mask-origin"]=false;whiteList["mask-position"]=false;whiteList["mask-repeat"]=false;whiteList["mask-size"]=false;whiteList["mask-source-type"]=false;whiteList["mask-type"]=false;whiteList["max-height"]=true;whiteList["max-lines"]=false;whiteList["max-width"]=true;whiteList["min-height"]=true;whiteList["min-width"]=true;whiteList["move-to"]=false;whiteList["nav-down"]=false;whiteList["nav-index"]=false;whiteList["nav-left"]=false;whiteList["nav-right"]=false;whiteList["nav-up"]=false;whiteList["object-fit"]=false;whiteList["object-position"]=false;whiteList["opacity"]=false;whiteList["order"]=false;whiteList["orphans"]=false;whiteList["outline"]=false;whiteList["outline-color"]=false;whiteList["outline-offset"]=false;whiteList["outline-style"]=false;whiteList["outline-width"]=false;whiteList["overflow"]=false;whiteList["overflow-wrap"]=false;whiteList["overflow-x"]=false;whiteList["overflow-y"]=false;whiteList["padding"]=true;whiteList["padding-bottom"]=true;whiteList["padding-left"]=true;whiteList["padding-right"]=true;whiteList["padding-top"]=true;whiteList["page"]=false;whiteList["page-break-after"]=false;whiteList["page-break-before"]=false;whiteList["page-break-inside"]=false;whiteList["page-policy"]=false;whiteList["pause"]=false;whiteList["pause-after"]=false;whiteList["pause-before"]=false;whiteList["perspective"]=false;whiteList["perspective-origin"]=false;whiteList["pitch"]=false;whiteList["pitch-range"]=false;whiteList["play-during"]=false;whiteList["position"]=false;whiteList["presentation-level"]=false;whiteList["quotes"]=false;whiteList["region-fragment"]=false;whiteList["resize"]=false;whiteList["rest"]=false;whiteList["rest-after"]=false;whiteList["rest-before"]=false;whiteList["richness"]=false;whiteList["right"]=false;whiteList["rotation"]=false;whiteList["rotation-point"]=false;whiteList["ruby-align"]=false;whiteList["ruby-merge"]=false;whiteList["ruby-position"]=false;whiteList["shape-image-threshold"]=false;whiteList["shape-outside"]=false;whiteList["shape-margin"]=false;whiteList["size"]=false;whiteList["speak"]=false;whiteList["speak-as"]=false;whiteList["speak-header"]=false;whiteList["speak-numeral"]=false;whiteList["speak-punctuation"]=false;whiteList["speech-rate"]=false;whiteList["stress"]=false;whiteList["string-set"]=false;whiteList["tab-size"]=false;whiteList["table-layout"]=false;whiteList["text-align"]=true;whiteList["text-align-last"]=true;whiteList["text-combine-upright"]=true;whiteList["text-decoration"]=true;whiteList["text-decoration-color"]=true;whiteList["text-decoration-line"]=true;whiteList["text-decoration-skip"]=true;whiteList["text-decoration-style"]=true;whiteList["text-emphasis"]=true;whiteList["text-emphasis-color"]=true;whiteList["text-emphasis-position"]=true;whiteList["text-emphasis-style"]=true;whiteList["text-height"]=true;whiteList["text-indent"]=true;whiteList["text-justify"]=true;whiteList["text-orientation"]=true;whiteList["text-overflow"]=true;whiteList["text-shadow"]=true;whiteList["text-space-collapse"]=true;whiteList["text-transform"]=true;whiteList["text-underline-position"]=true;whiteList["text-wrap"]=true;whiteList["top"]=false;whiteList["transform"]=false;whiteList["transform-origin"]=false;whiteList["transform-style"]=false;whiteList["transition"]=false;whiteList["transition-delay"]=false;whiteList["transition-duration"]=false;whiteList["transition-property"]=false;whiteList["transition-timing-function"]=false;whiteList["unicode-bidi"]=false;whiteList["vertical-align"]=false;whiteList["visibility"]=false;whiteList["voice-balance"]=false;whiteList["voice-duration"]=false;whiteList["voice-family"]=false;whiteList["voice-pitch"]=false;whiteList["voice-range"]=false;whiteList["voice-rate"]=false;whiteList["voice-stress"]=false;whiteList["voice-volume"]=false;whiteList["volume"]=false;whiteList["white-space"]=false;whiteList["widows"]=false;whiteList["width"]=true;whiteList["will-change"]=false;whiteList["word-break"]=true;whiteList["word-spacing"]=true;whiteList["word-wrap"]=true;whiteList["wrap-flow"]=false;whiteList["wrap-through"]=false;whiteList["writing-mode"]=false;whiteList["z-index"]=false;function onAttr(name,value,options){}function onIgnoreAttr(name,value,options){}exports.whiteList=whiteList;exports.onAttr=onAttr;exports.onIgnoreAttr=onIgnoreAttr},{}],8:[function(require,module,exports){var DEFAULT=require("./default");var FilterCSS=require("./css");function filterCSS(html,options){var xss=new FilterCSS(options);return xss.process(html)}exports=module.exports=filterCSS;exports.FilterCSS=FilterCSS;for(var i in DEFAULT)exports[i]=DEFAULT[i];if(typeof define==="function"&&define.amd){define(function(){return module.exports})}if(typeof window!=="undefined"){window.filterCSS=module.exports}},{"./css":6,"./default":7}],9:[function(require,module,exports){var _=require("./util");function parseStyle(css,onAttr){css=_.trimRight(css);if(css[css.length-1]!==";")css+=";";var cssLength=css.length;var isParenthesisOpen=false;var lastPos=0;var i=0;var retCSS="";function addNewAttr(){if(!isParenthesisOpen){var source=_.trim(css.slice(lastPos,i));var j=source.indexOf(":");if(j!==-1){var name=_.trim(source.slice(0,j));var value=_.trim(source.slice(j+1));if(name){var ret=onAttr(lastPos,retCSS.length,name,value,source);if(ret)retCSS+=ret+"; "}}}lastPos=i+1}for(;i<cssLength;i++){var c=css[i];if(c==="/"&&css[i+1]==="*"){var j=css.indexOf("*/",i+2);if(j===-1)break;i=j+1;lastPos=i+1;isParenthesisOpen=false}else if(c==="("){isParenthesisOpen=true}else if(c===")"){isParenthesisOpen=false}else if(c===";"){if(isParenthesisOpen){}else{addNewAttr()}}else if(c==="\n"){addNewAttr()}}return _.trim(retCSS)}module.exports=parseStyle},{"./util":10}],10:[function(require,module,exports){module.exports={indexOf:function(arr,item){var i,j;if(Array.prototype.indexOf){return arr.indexOf(item)}for(i=0,j=arr.length;i<j;i++){if(arr[i]===item){return i}}return-1},forEach:function(arr,fn,scope){var i,j;if(Array.prototype.forEach){return arr.forEach(fn,scope)}for(i=0,j=arr.length;i<j;i++){fn.call(scope,arr[i],i,arr)}},trim:function(str){if(String.prototype.trim){return str.trim()}return str.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(str){if(String.prototype.trimRight){return str.trimRight()}return str.replace(/(\s*$)/g,"")}}},{}]},{},[2]);"use strict";var Translations=(function(){function Translations(){}
Translations.readAboutAllOurNewFeatures="Read about all our new features";Translations.downloadVisualStudio="Visual Studio Roadmap";Translations.downloadVisualStudioPreview="Visual Studio Roadmap";Translations.systemRequirements="System requirements";Translations.communityActivity="Community Activity";Translations.resolvedProblemsCountRaw="var0 Resolved feedback in var1";Translations.activeProblemsCountRaw="var0 Active problems";Translations.lastActivityRaw="Last activity var0";Translations.resolvedProblemsCountHtml=function(count,shortName){return Translations.resolvedProblemsCountRaw.replace("var0","<span class=\"samewidth\">"+count.toString()+"</span>").replace("var1",shortName);};Translations.activeProblemsCountHtml=function(count){return Translations.activeProblemsCountRaw.replace("var0","<span class=\"number\">"+count.toString()+"</span>");};Translations.lastActivity=function(date){return Translations.lastActivityRaw.replace("var0",date);};return Translations;}());var GET_BASE_URL="https://sendvsfeedback2.azurewebsites.net/api";var Apis;(function(Apis){Apis["Announcement_Incidents"]="/announcement/incidents";Apis["Announcement_Announcements"]="/announcement/announcements";Apis["Announcement_Topics"]="/announcement/topics";})(Apis||(Apis={}));function parseAspNetDate(aspNetDate){return new Date(parseInt(aspNetDate.replace("/Date(","").replace(")/",""),10));}
function setLoading(isLoading){if(isLoading){$("#bar-loading").show("fast");}
else{$("#bar-loading").hide("fast");}}
function onLoaded_Incidents(data,textStatus,request){setLoading(false);if(data.incidents==null||data.incidents.length===0){return;}
var container=$("#bar-incident-container");container.empty();if(data.incidents.length===1){$("#issues-text-single").show();$("#issues-text-multiple").hide();}
else{$("#issues-text-single").hide();$("#issues-text-multiple").show();}
for(var i=0;i<data.incidents.length;i++){var incident=data.incidents[i];container.append("<a href=\""+incident.url+"\">"+incident.title+"</a>");if(i<data.incidents.length-1){container.append(", ");}}
$("#bar-problems").show("slow");}
function addAnnouncement(container,announcement,backupIconUrl,installText){container.empty();var fixedInIssuesHtml=announcement.fixedInTopics.reduce(function(stringSoFar,currentTopic){return stringSoFar+"\n        <div><a href=\""+currentTopic.url+"\" class=\"emphasize\">"+Translations.resolvedProblemsCountHtml(currentTopic.issueCount,currentTopic.shortName)+"</a></div>";},"");container.append("\n<div class=\"announcement-icon\">\n    <img src=\""+(announcement.iconUrl||backupIconUrl)+"\" alt=\"Visual Studio icon\">\n</div>\n<div class=\"announcement-body\">\n    <div>\n        <span class=\"title-container\">\n            <span class=\"title\">"+announcement.title+"</span>\n        </span>\n    </div>\n    <div class=\"date\">"+announcement.announcementDate.toLocaleDateString()+"</div>\n    <div class=\"summary-text\">"+announcement.summaryText+"</div>\n    <a href=\""+announcement.moreInfoUrl+"\">"+Translations.readAboutAllOurNewFeatures+"</a>\n    <div class=\"announcement-activity-small\">\n        <div class=\"title2\">"+Translations.communityActivity+"</div>\n        "+fixedInIssuesHtml+"\n    </div>\n    <div>\n        <div class=\"cell\">\n            <a href=\""+announcement.downloadUrl+"\" class=\"download\">"+installText+"</a>\n        </div>\n    </div>\n</div>\n<div class=\"announcement-activity\">\n    <div class=\"title2\">"+Translations.communityActivity+"</div>\n    "+fixedInIssuesHtml+"\n</div>\n");}
function showTab(tab){tab.css("display","flex");}
function onLoaded_Announcements(data,textStatus,request){setLoading(false);if(data.release==null&&data.preview==null){return;}
var headerRelease=$("#release-header");var headerPreview=$("#preview-header");var tabRelease=$("#tab-release");var tabPreview=$("#tab-preview");headerPreview.hide();headerRelease.hide();tabPreview.hide();tabRelease.hide();if(data.preview){headerPreview.show();if(!data.release){headerPreview.addClass("active");showTab(tabPreview);}
data.preview.announcementDate=parseAspNetDate(data.preview.announcementDate);addAnnouncement(tabPreview,data.preview,"/themes/microsoft/images/icon-vs-preview-16.png",Translations.downloadVisualStudioPreview);}
if(data.release){headerRelease.show();headerRelease.addClass("active");showTab(tabRelease);data.release.announcementDate=parseAspNetDate(data.release.announcementDate);addAnnouncement(tabRelease,data.release,"/themes/microsoft/images/icon-vs-16.png",Translations.downloadVisualStudio);}
$("#bar-announcements").show("fast");}
function onLoaded_Topics(data,textStatus,request){setLoading(false);if(data.topics==null||data.topics.length===0){return;}
var container=$("#bar-topics-table");container.empty();data.topics.forEach(function(topic){var lastActivityDate=(new Date(topic.lastActivityDate)).toLocaleDateString();if(topic.title.toLowerCase()==="ide"){topic.title="IDE";}
container.append("\n<tr class=\"topic\">\n    <td>\n        <div class=\"last-activity-date\">"+Translations.lastActivity(lastActivityDate)+"</div>\n        <div class=\"title\">"+topic.title+"</div>\n        <div class=\"summary-text\">"+topic.description+"</div>\n        <div class=\"links\">\n            <img src=\"/themes/microsoft/images/icon-active-problems.png\" alt=\"Problem icon\">\n            <a href=\""+topic.activeIssuesUrl+"\" class=\"emphasize\">"+Translations.activeProblemsCountHtml(topic.activeIssueCount)+"</a>\n        </div>\n    </td>\n</tr>\n        ");});$("#bar-topics").show("fast");}
function onError(request,textStatus,errorThrown){setLoading(false);var errorBar=$("#bar-error");errorBar.empty();errorBar.append("Error loading: "+textStatus+" "+errorThrown+"<br>");errorBar.show("fast");}
function initAnnouncements(spaceId){var headerRelease=$("#release-header");var headerPreview=$("#preview-header");var tabRelease=$("#tab-release");var tabPreview=$("#tab-preview");headerRelease.on("click",function(e){e.preventDefault();headerRelease.addClass("active");showTab(tabRelease);headerPreview.removeClass("active");tabPreview.hide();});headerPreview.on("click",function(e){e.preventDefault();headerPreview.addClass("active");showTab(tabPreview);headerRelease.removeClass("active");tabRelease.hide();});$.ajax({url:""+GET_BASE_URL+Apis.Announcement_Incidents+"?source=devcom-space-"+spaceId,dataType:"json",success:onLoaded_Incidents,error:onError,});$.ajax({url:""+GET_BASE_URL+Apis.Announcement_Announcements+"?source=devcom-space-"+spaceId,dataType:"json",success:onLoaded_Announcements,error:onError,});$.ajax({url:""+GET_BASE_URL+Apis.Announcement_Topics+"?source=devcom-space-"+spaceId,dataType:"json",success:onLoaded_Topics,error:onError,});}
var UserProfile=(function(){function UserProfile(){}
return UserProfile;}());var PrivacyRequestType;(function(PrivacyRequestType){PrivacyRequestType[PrivacyRequestType["None"]=0]="None";PrivacyRequestType[PrivacyRequestType["Export"]=1]="Export";PrivacyRequestType[PrivacyRequestType["Restrict"]=2]="Restrict";PrivacyRequestType[PrivacyRequestType["Delete"]=3]="Delete";})(PrivacyRequestType||(PrivacyRequestType={}));var PrivacyStatusType;(function(PrivacyStatusType){PrivacyStatusType[PrivacyStatusType["NotStarted"]=0]="NotStarted";PrivacyStatusType[PrivacyStatusType["Received"]=1]="Received";PrivacyStatusType[PrivacyStatusType["InProgress"]=2]="InProgress";PrivacyStatusType[PrivacyStatusType["Completed"]=3]="Completed";PrivacyStatusType[PrivacyStatusType["Expired"]=4]="Expired";PrivacyStatusType[PrivacyStatusType["Error"]=5]="Error";})(PrivacyStatusType||(PrivacyStatusType={}));function onLoaded_Attachments(data,textStatus,request){var container=$("#attachment-stream");container.empty();for(var i=0;i<data.attachments.length;i++){var attachment=data.attachments[i];attachment.creationDate=new Date(parseInt(attachment.creationDate,10));var attachmentUrl=attachment.url;var indexOfTransferId=attachment.url.indexOf("=");var transferId="unknown";if(indexOfTransferId>=0){transferId=attachment.url.substring(indexOfTransferId+1);attachmentUrl="/users/"+UserProfile.profileId+"/privateAttachment.json?transferId="+transferId+"&fileName="+encodeURIComponent(attachment.fileName);}
var dateFormat=Intl.DateTimeFormat("en-us",{month:"short",day:"2-digit",year:"2-digit",weekday:"short",hour:"numeric",minute:"numeric",});container.append("<div class=\"row-fluid\" id=\"attachement-"+i+"\">\n        <div class=\"span10\">\n        <a href=\""+attachmentUrl+"\" target=\"_blank\">"+attachment.fileName+"</a>\n        was attached to the problem \"<a href=\""+attachment.problemLink+"\" target=\"_blank\">"+attachment.problemTitle+"</a>\"</div>\n        <div class=\"span2\">\n           "+dateFormat.format(attachment.creationDate)+"\n        </div>\n        </div>");}
hideSpinner(SECTIONID_ATTACHMENT);}
function onLoaded_UserMetadata(data,textStatus,request){var container=$("#metadata-stream");container.empty();for(var i=0;i<data.userTags.length;i++){var tag=data.userTags[i];container.append("<div class=\"row-fluid\" id=\"metadata-"+i+"\">\n        <div class=\"span12\">\n        <div>"+tag.key+"</div>\n        <pre class=\"tag-value\">"+tag.value+"</pre>\n        </div>\n        </div><br>");}
hideSpinner(SECTIONID_METADATA);}
function onLoaded_PrivacyStatus(status,textStatus,request){hideSpinner(SECTIONID_PRIVACY);updatePrivacyButtonState(status);updatePrivacyStatusText(status);}
function updatePrivacyButtonState(status){var buttonContainer=$("#exportRestrict-buttons");var sectionExport=$("#section-export");var sectionDelete=$("#section-delete");var btnExport=$("#btnPrivacy-export");var btnDelete=$("#btnPrivacy-delete");btnExport.show();btnDelete.show();switch(status.RequestType){case PrivacyRequestType.None:buttonContainer.show("fast");sectionExport.show();sectionDelete.show();break;case PrivacyRequestType.Export:buttonContainer.show("fast");sectionDelete.show();switch(status.Status){case PrivacyStatusType.Expired:case PrivacyStatusType.Completed:btnExport.show();break;case PrivacyStatusType.Error:case PrivacyStatusType.NotStarted:case PrivacyStatusType.Received:case PrivacyStatusType.InProgress:btnExport.hide();break;default:setError(SECTIONID_PRIVACY,"Unknown status type "+status.Status);break;}
break;case PrivacyRequestType.Restrict:buttonContainer.hide();break;case PrivacyRequestType.Delete:buttonContainer.show();sectionExport.hide();sectionDelete.show();btnDelete.hide();break;default:setError(SECTIONID_PRIVACY,"Unknown request type "+status.RequestType);break;}}
function updatePrivacyStatusText(status){switch(status.RequestType){case PrivacyRequestType.None:break;case PrivacyRequestType.Export:switch(status.Status){case PrivacyStatusType.Expired:break;case PrivacyStatusType.Completed:$("#exportRestrict-status-ready").show("fast");var downloads_1=$("#exportRestrict-download-list");downloads_1.empty();status.ZipFiles.forEach(function(fileName){downloads_1.append("<a href=\"/users/"+UserProfile.profileId+"/exportRestrict/download.json?zipFileName="+encodeURIComponent(fileName)+"\">"+fileName+"</a><br>");});var dateFormat=Intl.DateTimeFormat("en-us",{month:"short",day:"2-digit",year:"numeric",});var createdDate=new Date(status.CreatedDate);$("#exportRestrict-date-created").text(dateFormat.format(createdDate));var expiryDate=void 0;if(status.ExpireDate!=null){expiryDate=new Date(status.ExpireDate);}
else{expiryDate=new Date(createdDate.getTime());expiryDate.setDate(expiryDate.getDate()+30);}
$("#exportRestrict-date-expiring").text(dateFormat.format(expiryDate));break;case PrivacyStatusType.Error:case PrivacyStatusType.NotStarted:case PrivacyStatusType.Received:case PrivacyStatusType.InProgress:$("#exportRestrict-status-ready").hide();$("#exportRestrict-status-exporting").show("fast");break;default:setError(SECTIONID_PRIVACY,"Unknown status type "+status.Status);break;}
break;case PrivacyRequestType.Restrict:$("#bar-restrict").show("fast");break;case PrivacyRequestType.Delete:$("#bar-delete").show("fast");break;default:setError(SECTIONID_PRIVACY,"Unknown request type "+status.RequestType);break;}}
var SECTIONID_ATTACHMENT="attachment-stream";var SECTIONID_METADATA="metadata-stream";var SECTIONID_PRIVACY="exportRestrict-stream";function showSpinner(sectionId){$("#"+sectionId+" .actions .spinner").show();}
function hideSpinner(sectionId){$("#"+sectionId+" .actions .spinner").hide();}
function setError(sectionId,errorText){var errorBar=$("#"+sectionId+" #bar-error");errorBar.empty();if(errorText==null){errorBar.hide();}
else{errorBar.append(errorText+"<br>");errorBar.show("fast");}}
function onErrorHandler(sectionId,additionalSpinnerToHide){if(additionalSpinnerToHide===void 0){additionalSpinnerToHide=null;}
return function(request,textStatus,errorThrown){if(additionalSpinnerToHide!=null){additionalSpinnerToHide.hide();}
hideSpinner(sectionId);setError(sectionId,errorThrown);};}
function showPrivacyData(){showSpinner(SECTIONID_ATTACHMENT);showSpinner(SECTIONID_METADATA);showSpinner(SECTIONID_PRIVACY);setError(SECTIONID_PRIVACY,null);$("#btnPrivacy-export").on("click",function(e){e.preventDefault();$("#btnPrivacy-export").hide();sendPrivacyActionAndUpdateUI("/users/"+UserProfile.profileId+"/exportRestrict/export.json",$("#spinnerPrivacy-export"));});var textAccountDelete=$("#textAccountDelete");var btnDeleteAccount=$("#btnPrivacy-delete-confirm");var deleteKeyword=UserProfile.deleteKeyword||"delete";textAccountDelete.on("input",function(){if(textAccountDelete.val()===deleteKeyword){btnDeleteAccount.removeClass("disabled");}
else{btnDeleteAccount.addClass("disabled");}});var modalDeleteAccount=$("#modalDeleteAccount");$("#btnPrivacy-delete").on("click",function(e){e.preventDefault();textAccountDelete.val("");modalDeleteAccount.modal("show");textAccountDelete.focus();});btnDeleteAccount.on("click",function(e){if(textAccountDelete.val()!==deleteKeyword){return;}
modalDeleteAccount.modal("hide");sendPrivacyActionAndUpdateUI("/users/"+UserProfile.profileId+"/exportRestrict/delete.json",$("#spinnerPrivacy-delete"),function(){$("#modalDeleteComplete").modal("show");});});$("#btnPrivacy-delete-signout").on("click",function(e){window.location.assign(UserProfile.logoutUrl);});modalDeleteAccount.on("hidden.bs.modal",function(e){$("#btnPrivacy-delete").focus();});$("#modalDeleteComplete").on("hidden.bs.modal",function(e){window.location.assign(UserProfile.logoutUrl);});$.ajax({url:"/users/"+UserProfile.profileId+"/userAllAttachment.json",dataType:"json",success:onLoaded_Attachments,error:onErrorHandler(SECTIONID_ATTACHMENT),});loadStatus(null);}
function sendPrivacyActionAndUpdateUI(url,spinner,onSuccess){spinner.show();$.ajax({url:url,dataType:"json",success:function(data,textStatus,request){if(onSuccess){onSuccess();}
else{loadStatus(spinner);}},error:function(request,textStatus,errorThrown){setError(SECTIONID_PRIVACY,errorThrown);loadStatus(spinner);},});}
function loadStatus(spinnerToHide){$.ajax({url:"/users/"+UserProfile.profileId+"/exportRestrict/status.json",dataType:"json",success:function(status,textStatus,request){if(spinnerToHide!=null){spinnerToHide.hide();}
onLoaded_PrivacyStatus(status,textStatus,request);},error:onErrorHandler(SECTIONID_PRIVACY,spinnerToHide),});}
var ReactivateStatus;(function(ReactivateStatus){ReactivateStatus["Allowed"]="Allowed";ReactivateStatus["Expired"]="Expired";ReactivateStatus["NotApplicable"]="NotApplicable";})(ReactivateStatus||(ReactivateStatus={}));var ReactionType;(function(ReactionType){ReactionType["reactYes"]="reactYes";ReactionType["reactNo"]="reactNo";})(ReactionType||(ReactionType={}));var Vote;(function(Vote){Vote[Vote["NotVoted"]=0]="NotVoted";Vote[Vote["Yes"]=1]="Yes";Vote[Vote["No"]=2]="No";})(Vote||(Vote={}));var OperationState;(function(OperationState){OperationState[OperationState["NotStarted"]=0]="NotStarted";OperationState[OperationState["Executing"]=1]="Executing";OperationState[OperationState["Failed"]=2]="Failed";OperationState[OperationState["Succeeded"]=3]="Succeeded";})(OperationState||(OperationState={}));var ReactionState=(function(){function ReactionState(){this.yesCount=null;this.noCount=null;this.vote=Vote.NotVoted;this.voteSubmitState={operation:OperationState.NotStarted,vote:Vote.Yes};this.error=null;this.reactionsAllowed=true;this.nodeId=0;this.userName=null;this.reactionBoxVisible=false;}
return ReactionState;}());var elem=null;var ReactionController=(function(){function ReactionController(){this.state=new ReactionState();}
ReactionController.updateCountUI=function(yesCount,noCount){elem.numYes.text(yesCount);elem.numNo.text(noCount);elem.noReactions.hide();elem.reactivateInfoContainer.hide();if((yesCount===0)&&(noCount===0)){elem.noReactions.show();elem.reactivateInfoContainer.show();}};ReactionController.prototype.clearError=function(){this.state.error=null;elem.error.hide();};ReactionController.prototype.setError=function(when,text,whileLoadingCounts){if(whileLoadingCounts===void 0){whileLoadingCounts=false;}
this.state.error={when:when,text:text};if(whileLoadingCounts){this.state.yesCount=null;this.state.noCount=null;}
if(whileLoadingCounts){elem.numNo.text("error");elem.numYes.text("error");}
elem.error.fadeIn(400);elem.error.text(when+":\r\n"+text);};ReactionController.prototype.setVoteCounts=function(yesCount,noCount){this.state.yesCount=yesCount;this.state.noCount=noCount;ReactionController.updateCountUI(yesCount,noCount);};ReactionController.prototype.showReactionBox=function(doShow){if(this.state.reactionBoxVisible===doShow){return;}
this.state.reactionBoxVisible=doShow;elem.showReactionBox(this.state.reactionBoxVisible);};ReactionController.prototype.initialLoad=function(){var _this=this;this.initialLoad_REQUEST();$.ajax({url:"/reactivate/"+this.state.nodeId+"/reactionInfo.json",dataType:"json",success:function(data,textStatus,request){_this.initialLoad_SUCCESS(data.result);},error:function(request,textStatus,errorThrown){_this.initialLoad_FAILED(errorThrown);},});};ReactionController.prototype.updateVoteStateAndReactionTitleUI=function(){if(this.state.reactionsAllowed){elem.titleDidItWork.show();elem.titleDidItWork_Expired.hide();switch(recon.state.vote){case Vote.Yes:elem.btnYes.prop("disabled",true);elem.btnNo.removeProp("disabled");break;case Vote.No:elem.btnYes.removeProp("disabled");elem.btnNo.prop("disabled",true);break;case Vote.NotVoted:elem.btnYes.removeProp("disabled");elem.btnNo.removeProp("disabled");break;default:throw new Error("Uknown vote state: "+recon.state.vote);}}
else{elem.titleDidItWork.hide();elem.titleDidItWork_Expired.show();elem.btnYes.prop("disabled",true);elem.btnNo.prop("disabled",true);}};ReactionController.prototype.voteYes=function(){var _this=this;if(this.state.voteSubmitState.operation===OperationState.Executing){console.log("VOTE IN PROGRESS");return;}
if(this.state.userName==null||this.state.userName==""){this.setError("Sign in required","Please sign in to add your reaction");return;}
if(this.state.vote===Vote.Yes){this.setError("Already voted","You already reacted with 'yes' reaction");return;}
if(this.state.yesCount===null){this.setError("Please vote again in few seconds","Still loading vote information.");return;}
this.voteYes_REQUEST();$.ajax({url:"/reactivate/"+this.state.nodeId+"/reactivate.json",dataType:"json",type:"post",data:{reaction:ReactionType.reactYes,username:this.state.userName,parent:this.state.nodeId,visibility:"full",body:"",},success:function(data,textStatus,request){_this.voteYes_SUCCESS(data);console.log("SUCCESS!!! 'Yes' reaction");console.log(data);console.log(textStatus);console.log(request);},error:function(request,textStatus,errorThrown){_this.voteYes_FAILED(errorThrown);},});};ReactionController.prototype.voteNo_REQUEST=function(){this.state.voteSubmitState={operation:OperationState.Executing,vote:Vote.No};this.clearError();};ReactionController.prototype.voteNo_SUCCESS=function(){this.state.voteSubmitState={operation:OperationState.Succeeded,vote:Vote.No};this.addVote(Vote.No);};ReactionController.prototype.voteNo_FAILED=function(errorThrown){this.state.voteSubmitState={operation:OperationState.Failed,vote:Vote.No};this.setError("Error reacting",errorThrown);};ReactionController.prototype.voteNo=function(){if(this.state.voteSubmitState.operation===OperationState.Executing){console.log("VOTE IN PROGRESS");return;}
if(this.state.userName==null||this.state.userName==""){this.setError("Sign in required","Please sign in to add your reaction");return;}
if(this.state.vote===Vote.No){this.setError("Already voted","You already reacted with 'no' reaction");return;}
this.showReactionBox(!this.state.reactionBoxVisible);};ReactionController.prototype.initialLoad_REQUEST=function(){this.clearError();};ReactionController.prototype.initialLoad_SUCCESS=function(result){this.state.yesCount=result.reactYesCount;this.state.noCount=result.reactNoCount;this.state.reactionsAllowed=result.reactivationStatus!==ReactivateStatus.Expired;ReactionController.updateCountUI(this.state.yesCount,this.state.noCount);elem.numNo.text(this.state.noCount);this.updateVoteStateAndReactionTitleUI();};ReactionController.prototype.initialLoad_FAILED=function(errorThrown){this.setError("Error loading reactivate info",errorThrown,true);};ReactionController.prototype.addVote=function(newVote){if(this.state.yesCount===null||this.state.noCount===null){this.setError("Unexpected error","Votes information is not yet available. Please let us know of this issue.");return;}
var newYesCount=this.state.yesCount;var newNoCount=this.state.noCount;var lastVote=this.state.vote;if(newVote===Vote.Yes){newYesCount++;if(lastVote===Vote.No){newNoCount--;}}
else{newNoCount++;if(lastVote===Vote.Yes){newYesCount--;}}
this.state.vote=newVote;this.setVoteCounts(newYesCount,newNoCount);this.updateVoteStateAndReactionTitleUI();};ReactionController.prototype.voteYes_REQUEST=function(){this.state.voteSubmitState={operation:OperationState.Executing,vote:Vote.Yes};this.clearError();elem.btnYesIdle.hide();elem.btnYesProgress.show();};ReactionController.prototype.voteYes_SUCCESS=function(result){this.state.voteSubmitState={operation:OperationState.Succeeded,vote:Vote.Yes};this.addVote(Vote.Yes);elem.addCommentToUI(result,"yes");elem.btnYesIdle.show();elem.btnYesProgress.hide();};ReactionController.prototype.voteYes_FAILED=function(errorThrown){this.state.voteSubmitState={operation:OperationState.Failed,vote:Vote.Yes};this.setError("Error reacting",errorThrown);elem.btnYesIdle.show();elem.btnYesProgress.hide();};return ReactionController;}());var recon=new ReactionController();function initReactions(nodeId,userName,info){recon.state.nodeId=nodeId;recon.state.userName=userName;elem=info;switch(info.voteState){case"yes":recon.state.vote=Vote.Yes;break;case"no":recon.state.vote=Vote.No;break;case"notvoted":recon.state.vote=Vote.NotVoted;break;default:throw new Error("Incorrect voteState: "+info.voteState);}
recon.updateVoteStateAndReactionTitleUI();recon.initialLoad();elem.btnYes.on("click",function(e){e.preventDefault();recon.voteYes();});elem.btnNo.on("click",function(e){e.preventDefault();recon.voteNo();});return{reactionBoxHidden:function(){recon.state.reactionBoxVisible=false;},voteNo_Request:function(){recon.voteNo_REQUEST();},voteNo_Success:function(){recon.voteNo_SUCCESS();},voteNo_Failed:function(errorText){recon.voteNo_FAILED(errorText);},};}
register_command('voteInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').html(data.result.score);this.getStatus()!="on"?this.element.addClass("btn-success"):this.element.removeClass("btn-success");}});register_command('voteUpInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').find('span').html(data.result.score);$("#problem-vote-down-"+this.nodeId).removeClass('on');}});register_command('voteDownInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').find('span').html(data.result.score);$("#problem-vote-up-"+this.nodeId).removeClass('on');}});register_command('problemStatus',{execute:function(evt){var parser=this;var currentStatus=parser.getStatus();var statuses=problemsStatuses;if(!statuses){statuses=['none','submitted','started','completed'];}
statuses=$.grep(statuses,function(status){return currentStatus!=status;});var context={'statuses':statuses,'description':parser.getMessage('description'),'reportHints':parser.getMessage('reportHints'),'statusNames':parser.getMessage('statusNames')};var $dialog=commandUtils.showPrompt(evt,'change-problem-status-dialog',context,{beforeShow:function($dialog){var $statusSelectInput=$dialog.find("select[name='status']");var $reasonSelectInput=$dialog.find("select[name='reason']");function setupReply(stateDef){if(stateDef.requiresAnswer||stateDef.requiresComment){$dialog.find('.problem-reply-container').show();var redactorConfig=pageContext.editor.configs.standard;$dialog.find('.problem-reply-container').find('textarea').redactor({plugins:redactorConfig.plugins,buttons:redactorConfig.buttons,convertDivs:false,linkSize:1000,convertUrlLinks:false,convertLinks:false});}else{$dialog.find('.problem-reply-container').hide();}}
$statusSelectInput.change(function(e){var status=$(e.target).val();var stateDef=reportHints[status];if(reportHints[status].length>0){$dialog.find(".reasons-container select[name='reason']").empty();$.each(reportHints[status],function(key,value){$dialog.find(".reasons-container select[name='reason']").append('<option value="'+value.name+'">'+value.label+'</option>');});$dialog.find(".reasons-container").show();$dialog.find(".reasons-container select[name='reason']").trigger('change');}else{$("select[name='reason']").val('');$dialog.find(".reasons-container").hide();$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}
if(status.indexOf("duplicate")!==-1){$dialog.find(".dupInput").show();}
else{$dialog.find(".dupInput").hide();$dialog.find(".dupInput select[name='duplicateOfProblem']").val('');}
setupReply(stateDef);});$reasonSelectInput.change(function(e){var currentReason=$(e.target).val();var $statusSelectInput=$dialog.find("select[name='status']");var shouldShowExtraComments=false;$.each(reportHints[$statusSelectInput.val()],function(key,value){if(currentReason==value.name&&value.allowExtraComments=="true")
shouldShowExtraComments=true;});if(shouldShowExtraComments){$dialog.find(".other-comments-container").show();}else{$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}});if(reportHints[$statusSelectInput.val()].length>0){$dialog.find(".reasons-container select[name='reason']").empty();$.each(reportHints[$statusSelectInput.val()],function(key,value){$dialog.find(".reasons-container select[name='reason']").append('<option value="'+value.name+'">'+value.label+'</option>');});$dialog.find(".reasons-container").show();var currentReason=$dialog.find(".reasons-container select[name='reason']").val();var shouldShowExtraComments=false;var shouldShowExtraComments=false;$.each(reportHints[$statusSelectInput.val()],function(key,value){if(currentReason==value.name&&value.allowExtraComments=="true")
shouldShowExtraComments=true;});if(shouldShowExtraComments){$dialog.find(".other-comments-container").show();}else{$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}}else{$dialog.find(".reasons-container").hide();$dialog.find(".other-comments-container textarea").val('');$dialog.find(".other-comments-container").hide();}
if($statusSelectInput.val()=='duplicate'){$dialog.find(".dupInput").show();}
setupReply(reportHints[$statusSelectInput.val()]);},onOk:function(data){function textFromHtml(html){return $('<div></div>').html(html).text()}
function showErrorMessage(){$dialog.find('.problem-reply-container').addClass('error');$dialog.find('.problem-reply-container').find('.message').show();return false;}
var url=data.duplicateOfProblem;var idRegex=/\/content\/problem\/(\d+)\//;var match=idRegex.exec(url);if(data.status==="duplicate"){if(match==null||match.length!=2){return showErrorMessage();}
else if(!parseInt(match[1])){return showErrorMessage();}
else{data.duplicateOfProblem=match[1];}}
else{data.duplicateOfProblem=null;}
if(reportHints[data.status].requiresAnswer||reportHints[data.status].requiresComment){var reply=data.reply;if(!reply){reply=textFromHtml(data.reply);if(!reply){return showErrorMessage();}}}
parser.executeRequest(data);}});},onSuccess:function(data,evt){this.setStatus(data.result.setStatusAction.extra);},onCompleted:function(success,evt){if(success){this.updateTitle();commandUtils.reloadPage();}}});register_command('viewProblemStateHistoryCommand',{getRequestMethod:function(){return'GET';},onSuccess:function(data,evt){var parser=this;var context={'history':data.result.history,'description':parser.getMessage('description')};commandUtils.showPrompt(evt,'view-problem-status-history-dialog',context,{title:"Problem Status History",show_yes:false,show_no:false});},onCompleted:function(success,evt){}});register_command('nodeConversion',{execute:function(evt){var parser=this;var parents=null;commandUtils.showPrompt(evt,'converter-command-dialog',{'nodeId':parser.nodeId,'description':parser.getMessage('description'),'conversions':parser.getStatus().split(','),'typeNames':parser.getMessage('types')},{onOk:function(data){parser._requestData=data;if(parser.nodeElement.hasClass('accepted-reply')){parser.confirm(evt,"",parser.getMessage('confirmation-solution-accepted'));$('.modal-footer').find('.btn-primary').empty().append('Continue');}else if(parser.nodeElement.hasClass('problem-container')){parser.confirm(evt,parser.getMessage('confirmation.title'),parser.getMessage('confirmation'));}else{parser.executeRequest(data);}},onAfterShow:function($modal){var $parentsSelect=$modal.find('select[name=targetParent]');$modal.find('select[name=to]').change(function(){if($(this).val()=='comment'){$parentsSelect.show();if(!parents){$.get(parser.getParsedUrl('parents'),function(data){parents=data.result.parentCandidates;var targetParentMsg=parser.getMessage('targetParent');for(var i=0;i<data.result.parentCandidates.length;i++){var candidate=data.result.parentCandidates[i];var $option=$('<option></option>');$option.attr('value',candidate.id);var type=parser.getMessage(i==0?'contentType':'childType');var text=targetParentMsg.replace(/\[WHAT]/,type).replace(/\[WHO]/,candidate.author.realname||candidate.author.username).replace(/\[WHEN]/,candidate.creationDateFormatted);$option.text(text);$parentsSelect.append($option);}});}}else{$parentsSelect.hide();}}).change();}});},_requestData:null,getRequestData:function(){return this._requestData;},onSuccess:function(data,evt){window.location.href=data.result.newUrl;}});register_command('voteInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').html(data.result.score);this.getStatus()!="on"?this.element.addClass("btn-success"):this.element.removeClass("btn-success");}});register_command('voteUpInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').find('span').html(data.result.score);$("#idea-vote-down-"+this.nodeId).removeClass('on');}});register_command('voteDownInList',{onSuccess:function(data){$('#post-'+this.nodeId+'-score-wrapper').find('span').html(data.result.score);$("#idea-vote-up-"+this.nodeId).removeClass('on');}});register_command('ideaStatus',{execute:function(evt){var parser=this;var currentStatus=parser.getStatus();var statuses=ideasStatuses;if(!statuses){statuses=['none','submitted','started','completed'];}
statuses=$.grep(statuses,function(status){return currentStatus!=status;});var context={'statuses':statuses,'description':parser.getMessage('description'),'reportHints':parser.getMessage('reportHints'),'statusNames':parser.getMessage('statusNames')};commandUtils.showPrompt(evt,'change-idea-status-dialog',context,{beforeShow:function($dialog){var $statusSelectInput=$dialog.find("select[name='status']");var $reasonSelectInput=$dialog.find("select[name='reason']");$statusSelectInput.change(function(e){var status=$(e.target).val();if(reportHints[status].length>0){$dialog.find(".reasons-container select[name='reason']").empty();$.each(reportHints[status],function(key,value){$dialog.find(".reasons-container select[name='reason']").append('<option value="'+value.name+'">'+value.label+'</option>');});$dialog.find(".reasons-container").show();$dialog.find(".reasons-container select[name='reason']").trigger('change');}else{$("select[name='reason']").val('');$dialog.find(".reasons-container").hide();$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}});$reasonSelectInput.change(function(e){var currentReason=$(e.target).val();var $statusSelectInput=$dialog.find("select[name='status']");var shouldShowExtraComments=false;$.each(reportHints[$statusSelectInput.val()],function(key,value){if(currentReason==value.name&&value.allowExtraComments=="true")
shouldShowExtraComments=true;});if(shouldShowExtraComments){$dialog.find(".other-comments-container").show();}else{$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}});if(reportHints[$statusSelectInput.val()].length>0){$dialog.find(".reasons-container select[name='reason']").empty();$.each(reportHints[$statusSelectInput.val()],function(key,value){$dialog.find(".reasons-container select[name='reason']").append('<option value="'+value.name+'">'+value.label+'</option>');});$dialog.find(".reasons-container").show();var currentReason=$dialog.find(".reasons-container select[name='reason']").val();var shouldShowExtraComments=false;var shouldShowExtraComments=false;$.each(reportHints[$statusSelectInput.val()],function(key,value){if(currentReason==value.name&&value.allowExtraComments=="true")
shouldShowExtraComments=true;});if(shouldShowExtraComments){$dialog.find(".other-comments-container").show();}else{$dialog.find(".other-comments-container").hide();$dialog.find(".other-comments-container textarea").val('');}}else{$dialog.find(".reasons-container").hide();$dialog.find(".other-comments-container textarea").val('');$dialog.find(".other-comments-container").hide();}},onOk:function(data){parser.executeRequest(data);}});},onSuccess:function(data,evt){this.setStatus(data.result.setStatusAction.extra+","+data.result.setStatusActionReason);},onCompleted:function(success,evt){if(success){this.updateTitle();}},updateTitle:function(){if(this.getStatus()!="none"){var res=this.getStatus().split(",")
var status=res[0];var reason=res[1];var shouldShowReason=this.shouldShowReason?this.shouldShowReason:globalShouldShowReason;$("#id_tags_container .idea-status-label").remove();if(status!='none'){var text='<a href="#" class="idea-status-label label '+status+'">'+commands.ideaStatus.getMessage('statusNames')[status]
if(shouldShowReason&&reason&&reason!="none"){text+=' - '+reason}
text+='</a>'
$("#id_tags_container").prepend($(text));}}}});register_command('viewIdeaStateHistoryCommand',{getRequestMethod:function(){return'GET';},onSuccess:function(data,evt){var parser=this;var context={'history':data.result.history,'description':parser.getMessage('description')};commandUtils.showPrompt(evt,'view-idea-status-history-dialog',context,{title:"Idea Status History",show_yes:false,show_no:false});},onCompleted:function(success,evt){}});