/*!
 * jQuery JavaScript Library http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 */
if(window.jQuery?((console||{}).warn||function(){})("jQuery imported from third-party sources. Will not include it second time!"):function(e,t){"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(e,t){var n=[],r=e.document,i=n.slice,a=n.concat,o=n.push,s=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,d={},f="3.6.0",p=function(e,t){return new p.fn.init(e,t)},h=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,m=/^-ms-/,g=/-([\da-z])/gi,v=function(e,t){return t.toUpperCase()};function b(e){var t=!!e&&"length"in e&&e.length,n=p.type(e);return"function"!==n&&!p.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}p.fn=p.prototype={jquery:f,constructor:p,selector:"",length:0,toArray:function(){return i.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:i.call(this)},pushStack:function(e){var t=p.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return p.each(this,e)},map:function(e){return this.pushStack(p.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.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(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},p.extend=p.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[s]||{},s++),"object"==typeof o||p.isFunction(o)||(o={}),s===l&&(o=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)n=o[t],o!==(r=e[t])&&(c&&r&&(p.isPlainObject(r)||(i=p.isArray(r)))?(i?(i=!1,a=n&&p.isArray(n)?n:[]):a=n&&p.isPlainObject(n)?n:{},o[t]=p.extend(c,a,r)):void 0!==r&&(o[t]=r));return o},p.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===p.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!p.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==p.type(e)||e.nodeType||p.isWindow(e))return!1;if(e.constructor&&!u.call(e,"constructor")&&!u.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||u.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=p.trim(e))&&(1===e.indexOf("use strict")?((t=r.createElement("script")).text=e,r.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(m,"ms-").replace(g,v)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);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(h,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?p.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.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,a=e.length,o=!n;i<a;i++)!t(e[i],i)!==o&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(b(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,proxy:function(e,t){var n,r,a;if("string"==typeof t&&(n=e[t],t=e,e=n),p.isFunction(e))return r=i.call(arguments,2),a=function(){return e.apply(t||this,r.concat(i.call(arguments)))},a.guid=e.guid=e.guid||p.guid++,a},now:Date.now,support:d}),"function"==typeof Symbol&&(p.fn[Symbol.iterator]=n[Symbol.iterator]),p.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var y=
/*!
 * Sizzle CSS Selector Engine v2.2.1
 * http://sizzlejs.com/
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2015-10-17
 */
function(e){var t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g,v,b,y,w="sizzle"+1*new Date,C=e.document,x=0,k=0,P=ae(),S=ae(),T=ae(),W=function(e,t){return e===t&&(d=!0),0},E=1<<31,L={}.hasOwnProperty,A=[],_=A.pop,D=A.push,O=A.push,I=A.slice,F=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",q="\\["+N+"*("+R+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+N+"*\\]",B=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",z=new RegExp(N+"+","g"),$=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g"),j=new RegExp("^"+N+"*,"+N+"*"),H=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),U=new RegExp("="+N+"*([^\\]'\"]*?)"+N+"*\\]","g"),V=new RegExp(B),G=new RegExp("^"+R+"$"),Q={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+N+"?|("+N+")|.)","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=function(){f()};try{O.apply(A=I.call(C.childNodes),C.childNodes),A[C.childNodes.length].nodeType}catch(e){O={apply:A.length?function(e,t){D.apply(e,I.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ie(e,t,r,i){var a,s,c,u,d,h,v,b,x=t&&t.ownerDocument,k=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==k&&9!==k&&11!==k)return r;if(!i&&((t?t.ownerDocument||t:C)!==p&&f(t),t=t||p,m)){if(11!==k&&(h=J.exec(e)))if(a=h[1]){if(9===k){if(!(c=t.getElementById(a)))return r;if(c.id===a)return r.push(c),r}else if(x&&(c=x.getElementById(a))&&y(t,c)&&c.id===a)return r.push(c),r}else{if(h[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&!T[e+" "]&&(!g||!g.test(e))){if(1!==k)x=t,b=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(ee,"\\$&"):t.setAttribute("id",u=w),s=(v=o(e)).length,d=G.test(u)?"#"+u:"[id='"+u+"']";s--;)v[s]=d+" "+me(v[s]);b=v.join(","),x=Z.test(e)&&pe(t.parentNode)||t}if(b)try{return O.apply(r,x.querySelectorAll(b)),r}catch(e){}finally{u===w&&t.removeAttribute("id")}}}return l(e.replace($,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function oe(e){return e[w]=!0,e}function se(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||E)-(~e.sourceIndex||E);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return oe((function(t){return t=+t,oe((function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))}))}))}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ie.support={},a=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=ie.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:C;return o!==p&&9===o.nodeType&&o.documentElement?(h=(p=o).documentElement,m=!a(p),(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=se((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=se((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(p.getElementsByClassName),n.getById=se((function(e){return h.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}},r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=X.test(p.querySelectorAll))&&(se((function(e){h.appendChild(e).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+N+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+w+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]")})),se((function(e){var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+N+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=X.test(b=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&se((function(e){n.disconnectedMatch=b.call(e,"div"),b.call(e,"[s!='']:x"),v.push("!=",B)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=X.test(h.compareDocumentPosition),y=t||X.test(h.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)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===C&&y(C,e)?-1:t===p||t.ownerDocument===C&&y(C,t)?1:u?F(u,e)-F(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!i||!a)return e===p?-1:t===p?1:i?-1:a?1:u?F(u,e)-F(u,t):0;if(i===a)return ce(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[r]===s[r];)r++;return r?ce(o[r],s[r]):o[r]===C?-1:s[r]===C?1:0},p):p},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(U,"='$1']"),n.matchesSelector&&m&&!T[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=b.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return ie(t,p,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),y(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var i=r.attrHandle[t.toLowerCase()],a=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==a?a:n.attributes||!m?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,r=[],i=0,a=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(W),d){for(;t=e[a++];)t===e[a]&&(i=r.push(a));for(;i--;)e.splice(r[i],1)}return u=null,e},i=ie.getText=function(e){var t,n="",r=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},r=ie.selectors={cacheLength:50,createPseudo:oe,match:Q,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]||ie.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]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=o(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("(^|"+N+")"+e+"("+N+"|$)"))&&P(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=ie.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),b=!l&&!s,y=!1;if(g){if(a){for(;m;){for(f=t;f=f[m];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[o?g.firstChild:g.lastChild],o&&b){for(y=(p=(c=(u=(d=(f=g)[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===x&&c[1])&&c[2],f=p&&g.childNodes[p];f=++p&&f&&f[m]||(y=p=0)||h.pop();)if(1===f.nodeType&&++y&&f===t){u[e]=[x,p,y];break}}else if(b&&(y=p=(c=(u=(d=(f=t)[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===x&&c[1]),!1===y)for(;(f=++p&&f&&f[m]||(y=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++y||(b&&((u=(d=f[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[x,y]),f!==t)););return(y-=i)===r||y%r==0&&y/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?oe((function(e,n){for(var r,a=i(e,t),o=a.length;o--;)e[r=F(e,a[o])]=!(n[r]=a[o])})):function(e){return i(e,0,n)}):i}},pseudos:{not:oe((function(e){var t=[],n=[],r=s(e.replace($,"$1"));return r[w]?oe((function(e,t,n,i){for(var a,o=r(e,null,i,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))})):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}})),has:oe((function(e){return function(t){return ie(e,t).length>0}})),contains:oe((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:oe((function(e){return G.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Y.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:fe((function(){return[0]})),last:fe((function(e,t){return[t-1]})),eq:fe((function(e,t,n){return[n<0?n+t:n]})),even:fe((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:fe((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:fe((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:fe((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ue(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=de(t);function he(){}function me(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ge(e,t,n){var r=t.dir,i=n&&"parentNode"===r,a=k++;return t.first?function(t,n,a){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,a)}:function(t,n,o){var s,l,c,u=[x,a];if(o){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,o))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((s=(l=(c=t[w]||(t[w]={}))[t.uniqueID]||(c[t.uniqueID]={}))[r])&&s[0]===x&&s[1]===a)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,o))return!0}}}function ve(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var a,o=[],s=0,l=e.length,c=null!=t;s<l;s++)(a=e[s])&&(n&&!n(a,r,i)||(o.push(a),c&&t.push(s)));return o}function ye(e,t,n,r,i,a){return r&&!r[w]&&(r=ye(r)),i&&!i[w]&&(i=ye(i,a)),oe((function(a,o,s,l){var c,u,d,f=[],p=[],h=o.length,m=a||function(e,t,n){for(var r=0,i=t.length;r<i;r++)ie(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!a&&t?m:be(m,f,e,s,l),v=n?i||(a?e:h||r)?[]:o:g;if(n&&n(g,v,s,l),r)for(c=be(v,p),r(c,[],s,l),u=c.length;u--;)(d=c[u])&&(v[p[u]]=!(g[p[u]]=d));if(a){if(i||e){if(i){for(c=[],u=v.length;u--;)(d=v[u])&&c.push(g[u]=d);i(null,v=[],c,l)}for(u=v.length;u--;)(d=v[u])&&(c=i?F(a,d):f[u])>-1&&(a[c]=!(o[c]=d))}}else v=be(v===o?v.splice(h,v.length):v),i?i(null,o,v,l):O.apply(o,v)}))}function we(e){for(var t,n,i,a=e.length,o=r.relative[e[0].type],s=o||r.relative[" "],l=o?1:0,u=ge((function(e){return e===t}),s,!0),d=ge((function(e){return F(t,e)>-1}),s,!0),f=[function(e,n,r){var i=!o&&(r||n!==c)||((t=n).nodeType?u(e,n,r):d(e,n,r));return t=null,i}];l<a;l++)if(n=r.relative[e[l].type])f=[ge(ve(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[w]){for(i=++l;i<a&&!r.relative[e[i].type];i++);return ye(l>1&&ve(f),l>1&&me(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace($,"$1"),n,l<i&&we(e.slice(l,i)),i<a&&we(e=e.slice(i)),i<a&&me(e))}f.push(n)}return ve(f)}return he.prototype=r.filters=r.pseudos,r.setFilters=new he,o=ie.tokenize=function(e,t){var n,i,a,o,s,l,c,u=S[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=r.preFilter;s;){for(o in n&&!(i=j.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),n=!1,(i=H.exec(s))&&(n=i.shift(),a.push({value:n,type:i[0].replace($," ")}),s=s.slice(n.length)),r.filter)!(i=Q[o].exec(s))||c[o]&&!(i=c[o](i))||(n=i.shift(),a.push({value:n,type:o,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?ie.error(e):S(e,l).slice(0)},s=ie.compile=function(e,t){var n,i=[],a=[],s=T[e+" "];if(!s){for(t||(t=o(e)),n=t.length;n--;)(s=we(t[n]))[w]?i.push(s):a.push(s);s=T(e,function(e,t){var n=t.length>0,i=e.length>0,a=function(a,o,s,l,u){var d,h,g,v=0,b="0",y=a&&[],w=[],C=c,k=a||i&&r.find.TAG("*",u),P=x+=null==C?1:Math.random()||.1,S=k.length;for(u&&(c=o===p||o||u);b!==S&&null!=(d=k[b]);b++){if(i&&d){for(h=0,o||d.ownerDocument===p||(f(d),s=!m);g=e[h++];)if(g(d,o||p,s)){l.push(d);break}u&&(x=P)}n&&((d=!g&&d)&&v--,a&&y.push(d))}if(v+=b,n&&b!==v){for(h=0;g=t[h++];)g(y,w,o,s);if(a){if(v>0)for(;b--;)y[b]||w[b]||(w[b]=_.call(l));w=be(w)}O.apply(l,w),u&&!a&&w.length>0&&v+t.length>1&&ie.uniqueSort(l)}return u&&(x=P,c=C),y};return n?oe(a):a}(a,i)),s.selector=e}return s},l=ie.select=function(e,t,i,a){var l,c,u,d,f,p="function"==typeof e&&e,h=!a&&o(e=p.selector||e);if(i=i||[],1===h.length){if((c=h[0]=h[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&n.getById&&9===t.nodeType&&m&&r.relative[c[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(l=Q.needsContext.test(e)?0:c.length;l--&&(u=c[l],!r.relative[d=u.type]);)if((f=r.find[d])&&(a=f(u.matches[0].replace(te,ne),Z.test(c[0].type)&&pe(t.parentNode)||t))){if(c.splice(l,1),!(e=a.length&&me(c)))return O.apply(i,a),i;break}}return(p||s(e,h))(a,t,!m,i,!t||Z.test(e)&&pe(t.parentNode)||t),i},n.sortStable=w.split("").sort(W).join("")===w,n.detectDuplicates=!!d,f(),n.sortDetached=se((function(e){return 1&e.compareDocumentPosition(p.createElement("div"))})),se((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||le("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&se((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||le("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),se((function(e){return null==e.getAttribute("disabled")}))||le(M,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),ie}(e);p.find=y,p.expr=y.selectors,p.expr[":"]=p.expr.pseudos,p.uniqueSort=p.unique=y.uniqueSort,p.text=y.getText,p.isXMLDoc=y.isXML,p.contains=y.contains;var w=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&p(e).is(n))break;r.push(e)}return r},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},x=p.expr.match.needsContext,k=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,P=/^.[^:#\[\.,]*$/;function S(e,t,n){if(p.isFunction(t))return p.grep(e,(function(e,r){return!!t.call(e,r,e)!==n}));if(t.nodeType)return p.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(P.test(t))return p.filter(t,e,n);t=p.filter(t,e)}return p.grep(e,(function(e){return s.call(t,e)>-1!==n}))}p.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?p.find.matchesSelector(r,e)?[r]:[]:p.find.matches(e,p.grep(t,(function(e){return 1===e.nodeType})))},p.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(p(e).filter((function(){for(t=0;t<n;t++)if(p.contains(i[t],this))return!0})));for(t=0;t<n;t++)p.find(e,i[t],r);return(r=this.pushStack(n>1?p.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(S(this,e||[],!1))},not:function(e){return this.pushStack(S(this,e||[],!0))},is:function(e){return!!S(this,"string"==typeof e&&x.test(e)?p(e):e||[],!1).length}});var T,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(p.fn.init=function(e,t,n){var i,a;if(!e)return this;if(n=n||T,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:W.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof p?t[0]:t,p.merge(this,p.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),k.test(i[1])&&p.isPlainObject(t))for(i in t)p.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(a=r.getElementById(i[2]))&&a.parentNode&&(this.length=1,this[0]=a),this.context=r,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):p.isFunction(e)?void 0!==n.ready?n.ready(e):e(p):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),p.makeArray(e,this))}).prototype=p.fn,T=p(r);var E=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}p.fn.extend({has:function(e){var t=p(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(p.contains(this,t[e]))return!0}))},closest:function(e,t){for(var n,r=0,i=this.length,a=[],o=x.test(e)||"string"!=typeof e?p(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&p.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?p.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?s.call(p(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(p.uniqueSort(p.merge(this.get(),p(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),p.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return w(e,"parentNode")},parentsUntil:function(e,t,n){return w(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return w(e,"nextSibling")},prevAll:function(e){return w(e,"previousSibling")},nextUntil:function(e,t,n){return w(e,"nextSibling",n)},prevUntil:function(e,t,n){return w(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return e.contentDocument||p.merge([],e.childNodes)}},(function(e,t){p.fn[e]=function(n,r){var i=p.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=p.filter(r,i)),this.length>1&&(L[e]||p.uniqueSort(i),E.test(e)&&i.reverse()),this.pushStack(i)}}));var _,D=/\S+/g;function O(){r.removeEventListener("DOMContentLoaded",O),e.removeEventListener("load",O),p.ready()}p.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return p.each(e.match(D)||[],(function(e,n){t[n]=!0})),t}(e):p.extend({},e);var t,n,r,i,a=[],o=[],s=-1,l=function(){for(i=e.once,r=t=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)!1===a[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},c={add:function(){return a&&(n&&!t&&(s=a.length-1,o.push(n)),function t(n){p.each(n,(function(n,r){p.isFunction(r)?e.unique&&c.has(r)||a.push(r):r&&r.length&&"string"!==p.type(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return p.each(arguments,(function(e,t){for(var n;(n=p.inArray(t,a,n))>-1;)a.splice(n,1),n<=s&&s--})),this},has:function(e){return e?p.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=o=[],n||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},p.extend({Deferred:function(e){var t=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return p.Deferred((function(n){p.each(t,(function(t,a){var o=p.isFunction(e[t])&&e[t];i[a[1]]((function(){var e=o&&o.apply(this,arguments);e&&p.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this===r?n.promise():this,o?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?p.extend(e,r):r}},i={};return r.pipe=r.then,p.each(t,(function(e,a){var o=a[2],s=a[3];r[a[1]]=o.add,s&&o.add((function(){n=s}),t[1^e][2].disable,t[2][2].lock),i[a[0]]=function(){return i[a[0]+"With"](this===i?r:this,arguments),this},i[a[0]+"With"]=o.fireWith})),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,a=0,o=i.call(arguments),s=o.length,l=1!==s||e&&p.isFunction(e.promise)?s:0,c=1===l?e:p.Deferred(),u=function(e,n,r){return function(a){n[e]=this,r[e]=arguments.length>1?i.call(arguments):a,r===t?c.notifyWith(n,r):--l||c.resolveWith(n,r)}};if(s>1)for(t=new Array(s),n=new Array(s),r=new Array(s);a<s;a++)o[a]&&p.isFunction(o[a].promise)?o[a].promise().progress(u(a,n,t)).done(u(a,r,o)).fail(c.reject):--l;return l||c.resolveWith(r,o),c.promise()}}),p.fn.ready=function(e){return p.ready.promise().done(e),this},p.extend({isReady:!1,readyWait:1,holdReady:function(e){e?p.readyWait++:p.ready(!0)},ready:function(e){(!0===e?--p.readyWait:p.isReady)||(p.isReady=!0,!0!==e&&--p.readyWait>0||(_.resolveWith(r,[p]),p.fn.triggerHandler&&(p(r).triggerHandler("ready"),p(r).off("ready"))))}}),p.ready.promise=function(t){return _||(_=p.Deferred(),"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(p.ready):(r.addEventListener("DOMContentLoaded",O),e.addEventListener("load",O))),_.promise(t)},p.ready.promise();var I=function(e,t,n,r,i,a,o){var s=0,l=e.length,c=null==n;if("object"===p.type(n))for(s in i=!0,n)I(e,t,s,n[s],!0,a,o);else if(void 0!==r&&(i=!0,p.isFunction(r)||(o=!0),c&&(o?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(p(e),n)})),t))for(;s<l;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):a},F=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function M(){this.expando=p.expando+M.uid++}M.uid=1,M.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!F(e))return{};var t=e[this.expando];return t||(t={},F(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[t]=n;else for(r in t)i[r]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(r=this.get(e,t))?r:this.get(e,p.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,a=e[this.expando];if(void 0!==a){if(void 0===t)this.register(e);else{p.isArray(t)?r=t.concat(t.map(p.camelCase)):(i=p.camelCase(t),r=t in a?[t,i]:(r=i)in a?[r]:r.match(D)||[]),n=r.length;for(;n--;)delete a[r[n]]}(void 0===t||p.isEmptyObject(a))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!p.isEmptyObject(t)}};var N=new M,R=new M,q=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,B=/[A-Z]/g;function z(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(B,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:q.test(n)?p.parseJSON(n):n)}catch(e){}R.set(e,t,n)}else n=void 0;return n}p.extend({hasData:function(e){return R.hasData(e)||N.hasData(e)},data:function(e,t,n){return R.access(e,t,n)},removeData:function(e,t){R.remove(e,t)},_data:function(e,t,n){return N.access(e,t,n)},_removeData:function(e,t){N.remove(e,t)}}),p.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=R.get(a),1===a.nodeType&&!N.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=p.camelCase(r.slice(5)),z(a,r,i[r]));N.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){R.set(this,e)})):I(this,(function(t){var n,r;if(a&&void 0===t)return void 0!==(n=R.get(a,e)||R.get(a,e.replace(B,"-$&").toLowerCase()))?n:(r=p.camelCase(e),void 0!==(n=R.get(a,r))||void 0!==(n=z(a,r,void 0))?n:void 0);r=p.camelCase(e),this.each((function(){var n=R.get(this,r);R.set(this,r,t),e.indexOf("-")>-1&&void 0!==n&&R.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){R.remove(this,e)}))}}),p.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=N.get(e,t),n&&(!r||p.isArray(n)?r=N.access(e,t,p.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=p.queue(e,t),r=n.length,i=n.shift(),a=p._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,(function(){p.dequeue(e,t)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return N.get(e,n)||N.access(e,n,{empty:p.Callbacks("once memory").add((function(){N.remove(e,[t+"queue",n])}))})}}),p.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?p.queue(this[0],e):void 0===t?this:this.each((function(){var n=p.queue(this,e,t);p._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&p.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){p.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=p.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=N.get(a[o],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,j=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),H=["Top","Right","Bottom","Left"],U=function(e,t){return e=t||e,"none"===p.css(e,"display")||!p.contains(e.ownerDocument,e)};function V(e,t,n,r){var i,a=1,o=20,s=r?function(){return r.cur()}:function(){return p.css(e,t,"")},l=s(),c=n&&n[3]||(p.cssNumber[t]?"":"px"),u=(p.cssNumber[t]||"px"!==c&&+l)&&j.exec(p.css(e,t));if(u&&u[3]!==c){c=c||u[3],n=n||[],u=+l||1;do{u/=a=a||".5",p.style(e,t,u+c)}while(a!==(a=s()/l)&&1!==a&&--o)}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var G=/^(?:checkbox|radio)$/i,Q=/<([\w:-]+)/,Y=/^$|\/(?:java|ecma)script/i,K={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 X(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&p.nodeName(e,t)?p.merge([e],n):n}function J(e,t){for(var n=0,r=e.length;n<r;n++)N.set(e[n],"globalEval",!t||N.get(t[n],"globalEval"))}K.optgroup=K.option,K.tbody=K.tfoot=K.colgroup=K.caption=K.thead,K.th=K.td;var Z,ee,te=/<|&#?\w+;/;function ne(e,t,n,r,i){for(var a,o,s,l,c,u,d=t.createDocumentFragment(),f=[],h=0,m=e.length;h<m;h++)if((a=e[h])||0===a)if("object"===p.type(a))p.merge(f,a.nodeType?[a]:a);else if(te.test(a)){for(o=o||d.appendChild(t.createElement("div")),s=(Q.exec(a)||["",""])[1].toLowerCase(),l=K[s]||K._default,o.innerHTML=l[1]+p.htmlPrefilter(a)+l[2],u=l[0];u--;)o=o.lastChild;p.merge(f,o.childNodes),(o=d.firstChild).textContent=""}else f.push(t.createTextNode(a));for(d.textContent="",h=0;a=f[h++];)if(r&&p.inArray(a,r)>-1)i&&i.push(a);else if(c=p.contains(a.ownerDocument,a),o=X(d.appendChild(a),"script"),c&&J(o),n)for(u=0;a=o[u++];)Y.test(a.type||"")&&n.push(a);return d}Z=r.createDocumentFragment().appendChild(r.createElement("div")),(ee=r.createElement("input")).setAttribute("type","radio"),ee.setAttribute("checked","checked"),ee.setAttribute("name","t"),Z.appendChild(ee),d.checkClone=Z.cloneNode(!0).cloneNode(!0).lastChild.checked,Z.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!Z.cloneNode(!0).lastChild.defaultValue;var re=/^key/,ie=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ae=/^([^.]*)(?:\.(.+)|)/;function oe(){return!0}function se(){return!1}function le(){try{return r.activeElement}catch(e){}}function ce(e,t,n,r,i,a){var o,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ce(e,s,n,r,t[s],a);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===a&&(o=i,i=function(e){return p().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=p.guid++)),e.each((function(){p.event.add(this,t,i,r,n)}))}p.event={global:{},add:function(e,t,n,r,i){var a,o,s,l,c,u,d,f,h,m,g,v=N.get(e);if(v)for(n.handler&&(n=(a=n).handler,i=a.selector),n.guid||(n.guid=p.guid++),(l=v.events)||(l=v.events={}),(o=v.handle)||(o=v.handle=function(t){return void 0!==p&&p.event.triggered!==t.type?p.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(D)||[""]).length;c--;)h=g=(s=ae.exec(t[c])||[])[1],m=(s[2]||"").split(".").sort(),h&&(d=p.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=p.event.special[h]||{},u=p.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&p.expr.match.needsContext.test(i),namespace:m.join(".")},a),(f=l[h])||((f=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,o)||e.addEventListener&&e.addEventListener(h,o)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,u):f.push(u),p.event.global[h]=!0)},remove:function(e,t,n,r,i){var a,o,s,l,c,u,d,f,h,m,g,v=N.hasData(e)&&N.get(e);if(v&&(l=v.events)){for(c=(t=(t||"").match(D)||[""]).length;c--;)if(h=g=(s=ae.exec(t[c])||[])[1],m=(s[2]||"").split(".").sort(),h){for(d=p.event.special[h]||{},f=l[h=(r?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=f.length;a--;)u=f[a],!i&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(f.splice(a,1),u.selector&&f.delegateCount--,d.remove&&d.remove.call(e,u));o&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||p.removeEvent(e,h,v.handle),delete l[h])}else for(h in l)p.event.remove(e,h+t[c],n,r,!0);p.isEmptyObject(l)&&N.remove(e,"handle events")}},dispatch:function(e){e=p.event.fix(e);var t,n,r,a,o,s,l=i.call(arguments),c=(N.get(this,"events")||{})[e.type]||[],u=p.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(s=p.event.handlers.call(this,e,c),t=0;(a=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,n=0;(o=a.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,void 0!==(r=((p.event.special[o.origType]||{}).handle||o.handler).apply(a.elem,l))&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,a,o=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(r=[],n=0;n<s;n++)void 0===r[i=(a=t[n]).selector+" "]&&(r[i]=a.needsContext?p(i,this).index(l)>-1:p.find(i,this,null,[l]).length),r[i]&&r.push(a);r.length&&o.push({elem:l,handlers:r})}return s<t.length&&o.push({elem:this,handlers:t.slice(s)}),o},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,a,o=t.button;return null==e.pageX&&null!=t.clientX&&(i=(n=e.target.ownerDocument||r).documentElement,a=n.body,e.pageX=t.clientX+(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i&&i.clientLeft||a&&a.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||a&&a.scrollTop||0)-(i&&i.clientTop||a&&a.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[p.expando])return e;var t,n,i,a=e.type,o=e,s=this.fixHooks[a];for(s||(this.fixHooks[a]=s=ie.test(a)?this.mouseHooks:re.test(a)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new p.Event(o),t=i.length;t--;)e[n=i[t]]=o[n];return e.target||(e.target=r),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==le()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===le()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&p.nodeName(this,"input"))return this.click(),!1},_default:function(e){return p.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},p.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},p.Event=function(e,t){if(!(this instanceof p.Event))return new p.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?oe:se):this.type=e,t&&p.extend(this,t),this.timeStamp=e&&e.timeStamp||p.now(),this[p.expando]=!0},p.Event.prototype={constructor:p.Event,isDefaultPrevented:se,isPropagationStopped:se,isImmediatePropagationStopped:se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=oe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=oe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=oe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},p.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){p.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||p.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),p.fn.extend({on:function(e,t,n,r){return ce(this,e,t,n,r)},one:function(e,t,n,r){return ce(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,p(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(){p.event.remove(this,e,n,t)}))}});var ue=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,de=/<script|<style|<link/i,fe=/checked\s*(?:[^=]|=\s*.checked.)/i,pe=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function me(e,t){return p.nodeName(e,"table")&&p.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ge(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ve(e){var t=pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function be(e,t){var n,r,i,a,o,s,l,c;if(1===t.nodeType){if(N.hasData(e)&&(a=N.access(e),o=N.set(t,a),c=a.events))for(i in delete o.handle,o.events={},c)for(n=0,r=c[i].length;n<r;n++)p.event.add(t,i,c[i][n]);R.hasData(e)&&(s=R.access(e),l=p.extend({},s),R.set(t,l))}}function ye(e,t,n,r){t=a.apply([],t);var i,o,s,l,c,u,f=0,h=e.length,m=h-1,g=t[0],v=p.isFunction(g);if(v||h>1&&"string"==typeof g&&!d.checkClone&&fe.test(g))return e.each((function(i){var a=e.eq(i);v&&(t[0]=g.call(this,i,a.html())),ye(a,t,n,r)}));if(h&&(o=(i=ne(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(s=p.map(X(i,"script"),ge)).length;f<h;f++)c=i,f!==m&&(c=p.clone(c,!0,!0),l&&p.merge(s,X(c,"script"))),n.call(e[f],c,f);if(l)for(u=s[s.length-1].ownerDocument,p.map(s,ve),f=0;f<l;f++)c=s[f],Y.test(c.type||"")&&!N.access(c,"globalEval")&&p.contains(u,c)&&(c.src?p._evalUrl&&p._evalUrl(c.src):p.globalEval(c.textContent.replace(he,"")))}return e}function we(e,t,n){for(var r,i=t?p.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||p.cleanData(X(r)),r.parentNode&&(n&&p.contains(r.ownerDocument,r)&&J(X(r,"script")),r.parentNode.removeChild(r));return e}p.extend({htmlPrefilter:function(e){return e.replace(ue,"<$1></$2>")},clone:function(e,t,n){var r,i,a,o,s,l,c,u=e.cloneNode(!0),f=p.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||p.isXMLDoc(e)))for(o=X(u),r=0,i=(a=X(e)).length;r<i;r++)s=a[r],l=o[r],c=void 0,"input"===(c=l.nodeName.toLowerCase())&&G.test(s.type)?l.checked=s.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=s.defaultValue);if(t)if(n)for(a=a||X(e),o=o||X(u),r=0,i=a.length;r<i;r++)be(a[r],o[r]);else be(e,u);return(o=X(u,"script")).length>0&&J(o,!f&&X(e,"script")),u},cleanData:function(e){for(var t,n,r,i=p.event.special,a=0;void 0!==(n=e[a]);a++)if(F(n)){if(t=n[N.expando]){if(t.events)for(r in t.events)i[r]?p.event.remove(n,r):p.removeEvent(n,r,t.handle);n[N.expando]=void 0}n[R.expando]&&(n[R.expando]=void 0)}}}),p.fn.extend({domManip:ye,detach:function(e){return we(this,e,!0)},remove:function(e){return we(this,e)},text:function(e){return I(this,(function(e){return void 0===e?p.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 ye(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||me(this,e).appendChild(e)}))},prepend:function(){return ye(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=me(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ye(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ye(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&&(p.cleanData(X(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return p.clone(this,e,t)}))},html:function(e){return I(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&&!de.test(e)&&!K[(Q.exec(e)||["",""])[1].toLowerCase()]){e=p.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(p.cleanData(X(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return ye(this,arguments,(function(t){var n=this.parentNode;p.inArray(this,e)<0&&(p.cleanData(X(this)),n&&n.replaceChild(t,this))}),e)}}),p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){p.fn[e]=function(e){for(var n,r=[],i=p(e),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),p(i[s])[t](n),o.apply(r,n.get());return this.pushStack(r)}}));var Ce,xe={HTML:"block",BODY:"block"};function ke(e,t){var n=p(t.createElement(e)).appendTo(t.body),r=p.css(n[0],"display");return n.detach(),r}function Pe(e){var t=r,n=xe[e];return n||("none"!==(n=ke(e,t))&&n||((t=(Ce=(Ce||p("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=ke(e,t),Ce.detach()),xe[e]=n),n}var Se=/^margin/,Te=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),We=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ee=function(e,t,n,r){var i,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];for(a in i=n.apply(e,r||[]),t)e.style[a]=o[a];return i},Le=r.documentElement;function Ae(e,t,n){var r,i,a,o,s=e.style;return""!==(o=(n=n||We(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==o||p.contains(e.ownerDocument,e)||(o=p.style(e,t)),n&&!d.pixelMarginRight()&&Te.test(o)&&Se.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a),void 0!==o?o+"":o}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){var t,n,i,a,o=r.createElement("div"),s=r.createElement("div");function l(){s.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",Le.appendChild(o);var r=e.getComputedStyle(s);t="1%"!==r.top,a="2px"===r.marginLeft,n="4px"===r.width,s.style.marginRight="50%",i="4px"===r.marginRight,Le.removeChild(o)}s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===s.style.backgroundClip,o.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",o.appendChild(s),p.extend(d,{pixelPosition:function(){return l(),t},boxSizingReliable:function(){return null==n&&l(),n},pixelMarginRight:function(){return null==n&&l(),i},reliableMarginLeft:function(){return null==n&&l(),a},reliableMarginRight:function(){var t,n=s.appendChild(r.createElement("div"));return n.style.cssText=s.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",s.style.width="1px",Le.appendChild(o),t=!parseFloat(e.getComputedStyle(n).marginRight),Le.removeChild(o),s.removeChild(n),t}}))}();var De=/^(none|table(?!-c[ea]).+)/,Oe={position:"absolute",visibility:"hidden",display:"block"},Ie={letterSpacing:"0",fontWeight:"400"},Fe=["Webkit","O","Moz","ms"],Me=r.createElement("div").style;function Ne(e){if(e in Me)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Fe.length;n--;)if((e=Fe[n]+t)in Me)return e}function Re(e,t,n){var r=j.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function qe(e,t,n,r,i){for(var a=n===(r?"border":"content")?4:"width"===t?1:0,o=0;a<4;a+=2)"margin"===n&&(o+=p.css(e,n+H[a],!0,i)),r?("content"===n&&(o-=p.css(e,"padding"+H[a],!0,i)),"margin"!==n&&(o-=p.css(e,"border"+H[a]+"Width",!0,i))):(o+=p.css(e,"padding"+H[a],!0,i),"padding"!==n&&(o+=p.css(e,"border"+H[a]+"Width",!0,i)));return o}function Be(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,a=We(e),o="border-box"===p.css(e,"boxSizing",!1,a);if(i<=0||null==i){if(((i=Ae(e,t,a))<0||null==i)&&(i=e.style[t]),Te.test(i))return i;r=o&&(d.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+qe(e,t,n||(o?"border":"content"),r,a)+"px"}function ze(e,t){for(var n,r,i,a=[],o=0,s=e.length;o<s;o++)(r=e[o]).style&&(a[o]=N.get(r,"olddisplay"),n=r.style.display,t?(a[o]||"none"!==n||(r.style.display=""),""===r.style.display&&U(r)&&(a[o]=N.access(r,"olddisplay",Pe(r.nodeName)))):(i=U(r),"none"===n&&i||N.set(r,"olddisplay",i?n:p.css(r,"display"))));for(o=0;o<s;o++)(r=e[o]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?a[o]||"":"none"));return e}function $e(e,t,n,r,i){return new $e.prototype.init(e,t,n,r,i)}p.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ae(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=p.camelCase(t),l=e.style;if(t=p.cssProps[s]||(p.cssProps[s]=Ne(s)||s),o=p.cssHooks[t]||p.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:l[t];"string"===(a=typeof n)&&(i=j.exec(n))&&i[1]&&(n=V(e,t,i),a="number"),null!=n&&n==n&&("number"===a&&(n+=i&&i[3]||(p.cssNumber[s]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(l[t]=n))}},css:function(e,t,n,r){var i,a,o,s=p.camelCase(t);return t=p.cssProps[s]||(p.cssProps[s]=Ne(s)||s),(o=p.cssHooks[t]||p.cssHooks[s])&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=Ae(e,t,r)),"normal"===i&&t in Ie&&(i=Ie[t]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),p.each(["height","width"],(function(e,t){p.cssHooks[t]={get:function(e,n,r){if(n)return De.test(p.css(e,"display"))&&0===e.offsetWidth?Ee(e,Oe,(function(){return Be(e,t,r)})):Be(e,t,r)},set:function(e,n,r){var i,a=r&&We(e),o=r&&qe(e,t,r,"border-box"===p.css(e,"boxSizing",!1,a),a);return o&&(i=j.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=p.css(e,t)),Re(0,n,o)}}})),p.cssHooks.marginLeft=_e(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ae(e,"marginLeft"))||e.getBoundingClientRect().left-Ee(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),p.cssHooks.marginRight=_e(d.reliableMarginRight,(function(e,t){if(t)return Ee(e,{display:"inline-block"},Ae,[e,"marginRight"])})),p.each({margin:"",padding:"",border:"Width"},(function(e,t){p.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+H[r]+t]=a[r]||a[r-2]||a[0];return i}},Se.test(e)||(p.cssHooks[e+t].set=Re)})),p.fn.extend({css:function(e,t){return I(this,(function(e,t,n){var r,i,a={},o=0;if(p.isArray(t)){for(r=We(e),i=t.length;o<i;o++)a[t[o]]=p.css(e,t[o],!1,r);return a}return void 0!==n?p.style(e,t,n):p.css(e,t)}),e,t,arguments.length>1)},show:function(){return ze(this,!0)},hide:function(){return ze(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){U(this)?p(this).show():p(this).hide()}))}}),p.Tween=$e,$e.prototype={constructor:$e,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||p.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(p.cssNumber[n]?"":"px")},cur:function(){var e=$e.propHooks[this.prop];return e&&e.get?e.get(this):$e.propHooks._default.get(this)},run:function(e){var t,n=$e.propHooks[this.prop];return this.options.duration?this.pos=t=p.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):$e.propHooks._default.set(this),this}},$e.prototype.init.prototype=$e.prototype,$e.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=p.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){p.fx.step[e.prop]?p.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[p.cssProps[e.prop]]&&!p.cssHooks[e.prop]?e.elem[e.prop]=e.now:p.style(e.elem,e.prop,e.now+e.unit)}}},$e.propHooks.scrollTop=$e.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},p.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},p.fx=$e.prototype.init,p.fx.step={};var je,He,Ue=/^(?:toggle|show|hide)$/,Ve=/queueHooks$/;function Ge(){return e.setTimeout((function(){je=void 0})),je=p.now()}function Qe(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=H[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function Ye(e,t,n){for(var r,i=(Ke.tweeners[t]||[]).concat(Ke.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function Ke(e,t,n){var r,i,a=0,o=Ke.prefilters.length,s=p.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=je||Ge(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),a=0,o=c.tweens.length;a<o;a++)c.tweens[a].run(r);return s.notifyWith(e,[c,r,n]),r<1&&o?n:(s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:p.extend({},t),opts:p.extend(!0,{specialEasing:{},easing:p.easing._default},n),originalProperties:t,originalOptions:n,startTime:je||Ge(),duration:n.duration,tweens:[],createTween:function(t,n){var r=p.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,r,i,a,o;for(n in e)if(i=t[r=p.camelCase(n)],a=e[n],p.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(o=p.cssHooks[r])&&"expand"in o)for(n in a=o.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(u,c.opts.specialEasing);a<o;a++)if(r=Ke.prefilters[a].call(c,e,u,c.opts))return p.isFunction(r.stop)&&(p._queueHooks(c.elem,c.opts.queue).stop=p.proxy(r.stop,r)),r;return p.map(u,Ye,c),p.isFunction(c.opts.start)&&c.opts.start.call(e,c),p.fx.timer(p.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}p.Animation=p.extend(Ke,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return V(n.elem,e,j.exec(t),n),n}]},tweener:function(e,t){p.isFunction(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],Ke.tweeners[n]=Ke.tweeners[n]||[],Ke.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,o,s,l,c,u=this,d={},f=e.style,h=e.nodeType&&U(e),m=N.get(e,"fxshow");for(r in n.queue||(null==(s=p._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always((function(){u.always((function(){s.unqueued--,p.queue(e,"fx").length||s.empty.fire()}))}))),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],"inline"===("none"===(c=p.css(e,"display"))?N.get(e,"olddisplay")||Pe(e.nodeName):c)&&"none"===p.css(e,"float")&&(f.display="inline-block")),n.overflow&&(f.overflow="hidden",u.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),t)if(i=t[r],Ue.exec(i)){if(delete t[r],a=a||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;h=!0}d[r]=m&&m[r]||p.style(e,r)}else c=void 0;if(p.isEmptyObject(d))"inline"===("none"===c?Pe(e.nodeName):c)&&(f.display=c);else for(r in m?"hidden"in m&&(h=m.hidden):m=N.access(e,"fxshow",{}),a&&(m.hidden=!h),h?p(e).show():u.done((function(){p(e).hide()})),u.done((function(){var t;for(t in N.remove(e,"fxshow"),d)p.style(e,t,d[t])})),d)o=Ye(h?m[r]:0,r,u),r in m||(m[r]=o.start,h&&(o.end=o.start,o.start="width"===r||"height"===r?1:0))}],prefilter:function(e,t){t?Ke.prefilters.unshift(e):Ke.prefilters.push(e)}}),p.speed=function(e,t,n){var r=e&&"object"==typeof e?p.extend({},e):{complete:n||!n&&t||p.isFunction(e)&&e,duration:e,easing:n&&t||t&&!p.isFunction(t)&&t};return r.duration=p.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in p.fx.speeds?p.fx.speeds[r.duration]:p.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){p.isFunction(r.old)&&r.old.call(this),r.queue&&p.dequeue(this,r.queue)},r},p.fn.extend({fadeTo:function(e,t,n,r){return this.filter(U).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=p.isEmptyObject(e),a=p.speed(t,n,r),o=function(){var t=Ke(this,p.extend({},e),a);(i||N.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",a=p.timers,o=N.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&Ve.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||p.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=N.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=p.timers,o=r?r.length:0;for(n.finish=!0,p.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),p.each(["toggle","show","hide"],(function(e,t){var n=p.fn[t];p.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Qe(t,!0),e,r,i)}})),p.each({slideDown:Qe("show"),slideUp:Qe("hide"),slideToggle:Qe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){p.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),p.timers=[],p.fx.tick=function(){var e,t=0,n=p.timers;for(je=p.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||p.fx.stop(),je=void 0},p.fx.timer=function(e){p.timers.push(e),e()?p.fx.start():p.timers.pop()},p.fx.interval=13,p.fx.start=function(){He||(He=e.setInterval(p.fx.tick,p.fx.interval))},p.fx.stop=function(){e.clearInterval(He),He=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fn.delay=function(t,n){return t=p.fx&&p.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=r.createElement("input"),t=r.createElement("select"),n=t.appendChild(r.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=n.selected,t.disabled=!0,d.optDisabled=!n.disabled,(e=r.createElement("input")).value="t",e.type="radio",d.radioValue="t"===e.value}();var Xe,Je=p.expr.attrHandle;p.fn.extend({attr:function(e,t){return I(this,p.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){p.removeAttr(this,e)}))}}),p.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?p.prop(e,t,n):(1===a&&p.isXMLDoc(e)||(t=t.toLowerCase(),i=p.attrHooks[t]||(p.expr.match.bool.test(t)?Xe:void 0)),void 0!==n?null===n?void p.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=p.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&p.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,a=t&&t.match(D);if(a&&1===e.nodeType)for(;n=a[i++];)r=p.propFix[n]||n,p.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),Xe={set:function(e,t,n){return!1===t?p.removeAttr(e,n):e.setAttribute(n,n),n}},p.each(p.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Je[t]||p.find.attr;Je[t]=function(e,t,r){var i,a;return r||(a=Je[t],Je[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Je[t]=a),i}}));var Ze=/^(?:input|select|textarea|button)$/i,et=/^(?:a|area)$/i;p.fn.extend({prop:function(e,t){return I(this,p.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[p.propFix[e]||e]}))}}),p.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&p.isXMLDoc(e)||(t=p.propFix[t]||t,i=p.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=p.find.attr(e,"tabindex");return t?parseInt(t,10):Ze.test(e.nodeName)||et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(p.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)}}),p.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){p.propFix[this.toLowerCase()]=this}));var tt=/[\t\r\n\f]/g;function nt(e){return e.getAttribute&&e.getAttribute("class")||""}p.fn.extend({addClass:function(e){var t,n,r,i,a,o,s,l=0;if(p.isFunction(e))return this.each((function(t){p(this).addClass(e.call(this,t,nt(this)))}));if("string"==typeof e&&e)for(t=e.match(D)||[];n=this[l++];)if(i=nt(n),r=1===n.nodeType&&(" "+i+" ").replace(tt," ")){for(o=0;a=t[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(s=p.trim(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,a,o,s,l=0;if(p.isFunction(e))return this.each((function(t){p(this).removeClass(e.call(this,t,nt(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(D)||[];n=this[l++];)if(i=nt(n),r=1===n.nodeType&&(" "+i+" ").replace(tt," ")){for(o=0;a=t[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");i!==(s=p.trim(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):p.isFunction(e)?this.each((function(n){p(this).toggleClass(e.call(this,n,nt(this),t),t)})):this.each((function(){var t,r,i,a;if("string"===n)for(r=0,i=p(this),a=e.match(D)||[];t=a[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=nt(this))&&N.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":N.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+nt(n)+" ").replace(tt," ").indexOf(t)>-1)return!0;return!1}});var rt=/\r/g,it=/[\x20\t\r\n\f]+/g;p.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=p.isFunction(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,p(this).val()):e)?i="":"number"==typeof i?i+="":p.isArray(i)&&(i=p.map(i,(function(e){return null==e?"":e+""}))),(t=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=p.valHooks[i.type]||p.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(rt,""):null==n?"":n:void 0}}),p.extend({valHooks:{option:{get:function(e){var t=p.find.attr(e,"value");return null!=t?t:p.trim(p.text(e)).replace(it," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,a="select-one"===e.type||i<0,o=a?null:[],s=a?i+1:r.length,l=i<0?s:a?i:0;l<s;l++)if(((n=r[l]).selected||l===i)&&(d.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!p.nodeName(n.parentNode,"optgroup"))){if(t=p(n).val(),a)return t;o.push(t)}return o},set:function(e,t){for(var n,r,i=e.options,a=p.makeArray(t),o=i.length;o--;)((r=i[o]).selected=p.inArray(p.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),p.each(["radio","checkbox"],(function(){p.valHooks[this]={set:function(e,t){if(p.isArray(t))return e.checked=p.inArray(p(e).val(),t)>-1}},d.checkOn||(p.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var at=/^(?:focusinfocus|focusoutblur)$/;p.extend(p.event,{trigger:function(t,n,i,a){var o,s,l,c,d,f,h,m=[i||r],g=u.call(t,"type")?t.type:t,v=u.call(t,"namespace")?t.namespace.split("."):[];if(s=l=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!at.test(g+p.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),d=g.indexOf(":")<0&&"on"+g,(t=t[p.expando]?t:new p.Event(g,"object"==typeof t&&t)).isTrigger=a?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:p.makeArray(n,[t]),h=p.event.special[g]||{},a||!h.trigger||!1!==h.trigger.apply(i,n))){if(!a&&!h.noBubble&&!p.isWindow(i)){for(c=h.delegateType||g,at.test(c+g)||(s=s.parentNode);s;s=s.parentNode)m.push(s),l=s;l===(i.ownerDocument||r)&&m.push(l.defaultView||l.parentWindow||e)}for(o=0;(s=m[o++])&&!t.isPropagationStopped();)t.type=o>1?c:h.bindType||g,(f=(N.get(s,"events")||{})[t.type]&&N.get(s,"handle"))&&f.apply(s,n),(f=d&&s[d])&&f.apply&&F(s)&&(t.result=f.apply(s,n),!1===t.result&&t.preventDefault());return t.type=g,a||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),n)||!F(i)||d&&p.isFunction(i[g])&&!p.isWindow(i)&&((l=i[d])&&(i[d]=null),p.event.triggered=g,i[g](),p.event.triggered=void 0,l&&(i[d]=l)),t.result}},simulate:function(e,t,n){var r=p.extend(new p.Event,n,{type:e,isSimulated:!0});p.event.trigger(r,null,t)}}),p.fn.extend({trigger:function(e,t){return this.each((function(){p.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return p.event.trigger(e,t,n,!0)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){p.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),p.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),d.focusin="onfocusin"in e,d.focusin||p.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){p.event.simulate(t,e.target,p.event.fix(e))};p.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=N.access(r,t);i||r.addEventListener(e,n,!0),N.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=N.access(r,t)-1;i?N.access(r,t,i):(r.removeEventListener(e,n,!0),N.remove(r,t))}}}));var ot=e.location,st=p.now(),lt=/\?/;p.parseJSON=function(e){return JSON.parse(e+"")},p.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||p.error("Invalid XML: "+t),n};var ct=/#.*$/,ut=/([?&])_=[^&]*/,dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,ft=/^(?:GET|HEAD)$/,pt=/^\/\//,ht={},mt={},gt="*/".concat("*"),vt=r.createElement("a");function bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(D)||[];if(p.isFunction(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function yt(e,t,n,r){var i={},a=e===mt;function o(s){var l;return i[s]=!0,p.each(e[s]||[],(function(e,s){var c=s(t,n,r);return"string"!=typeof c||a||i[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)})),l}return o(t.dataTypes[0])||!i["*"]&&o("*")}function wt(e,t){var n,r,i=p.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&p.extend(!0,e,r),e}vt.href=ot.href,p.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ot.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ot.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":gt,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":p.parseJSON,"text xml":p.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?wt(wt(e,p.ajaxSettings),t):wt(p.ajaxSettings,e)},ajaxPrefilter:bt(ht),ajaxTransport:bt(mt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,a,o,s,l,c,u,d,f=p.ajaxSetup({},n),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?p(h):p.event,g=p.Deferred(),v=p.Callbacks("once memory"),b=f.statusCode||{},y={},w={},C=0,x="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===C){if(!s)for(s={};t=dt.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===C?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return C||(e=w[n]=w[n]||e,y[e]=t),this},overrideMimeType:function(e){return C||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(C<2)for(t in e)b[t]=[b[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||x;return i&&i.abort(t),P(0,t),this}};if(g.promise(k).complete=v.add,k.success=k.done,k.error=k.fail,f.url=((t||f.url||ot.href)+"").replace(ct,"").replace(pt,ot.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=p.trim(f.dataType||"*").toLowerCase().match(D)||[""],null==f.crossDomain){c=r.createElement("a");try{c.href=f.url,c.href=c.href,f.crossDomain=vt.protocol+"//"+vt.host!=c.protocol+"//"+c.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=p.param(f.data,f.traditional)),yt(ht,f,n,k),2===C)return k;for(d in(u=p.event&&f.global)&&0==p.active++&&p.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!ft.test(f.type),a=f.url,f.hasContent||(f.data&&(a=f.url+=(lt.test(a)?"&":"?")+f.data,delete f.data),!1===f.cache&&(f.url=ut.test(a)?a.replace(ut,"$1_="+st++):a+(lt.test(a)?"&":"?")+"_="+st++)),f.ifModified&&(p.lastModified[a]&&k.setRequestHeader("If-Modified-Since",p.lastModified[a]),p.etag[a]&&k.setRequestHeader("If-None-Match",p.etag[a])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+gt+"; q=0.01":""):f.accepts["*"]),f.headers)k.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(h,k,f)||2===C))return k.abort();for(d in x="abort",{success:1,error:1,complete:1})k[d](f[d]);if(i=yt(mt,f,n,k)){if(k.readyState=1,u&&m.trigger("ajaxSend",[k,f]),2===C)return k;f.async&&f.timeout>0&&(l=e.setTimeout((function(){k.abort("timeout")}),f.timeout));try{C=1,i.send(y,P)}catch(e){if(!(C<2))throw e;P(-1,e)}}else P(-1,"No Transport");function P(t,n,r,s){var c,d,y,w,x,P=n;2!==C&&(C=2,l&&e.clearTimeout(l),i=void 0,o=s||"",k.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(w=function(e,t,n){for(var r,i,a,o,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==l[0]&&l.unshift(a),n[a]}(f,k,r)),w=function(e,t,n,r){var i,a,o,s,l,c={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(a=u.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=u.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(o=c[l+" "+a]||c["* "+a]))for(i in c)if((s=i.split(" "))[1]===a&&(o=c[l+" "+s[0]]||c["* "+s[0]])){!0===o?o=c[i]:!0!==c[i]&&(a=s[0],u.unshift(s[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}(f,w,k,c),c?(f.ifModified&&((x=k.getResponseHeader("Last-Modified"))&&(p.lastModified[a]=x),(x=k.getResponseHeader("etag"))&&(p.etag[a]=x)),204===t||"HEAD"===f.type?P="nocontent":304===t?P="notmodified":(P=w.state,d=w.data,c=!(y=w.error))):(y=P,!t&&P||(P="error",t<0&&(t=0))),k.status=t,k.statusText=(n||P)+"",c?g.resolveWith(h,[d,P,k]):g.rejectWith(h,[k,P,y]),k.statusCode(b),b=void 0,u&&m.trigger(c?"ajaxSuccess":"ajaxError",[k,f,c?d:y]),v.fireWith(h,[k,P]),u&&(m.trigger("ajaxComplete",[k,f]),--p.active||p.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return p.get(e,t,n,"json")},getScript:function(e,t){return p.get(e,void 0,t,"script")}}),p.each(["get","post"],(function(e,t){p[t]=function(e,n,r,i){return p.isFunction(n)&&(i=i||r,r=n,n=void 0),p.ajax(p.extend({url:e,type:t,dataType:i,data:n,success:r},p.isPlainObject(e)&&e))}})),p._evalUrl=function(e){return p.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},p.fn.extend({wrapAll:function(e){var t;return p.isFunction(e)?this.each((function(t){p(this).wrapAll(e.call(this,t))})):(this[0]&&(t=p(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this)},wrapInner:function(e){return p.isFunction(e)?this.each((function(t){p(this).wrapInner(e.call(this,t))})):this.each((function(){var t=p(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p.isFunction(e);return this.each((function(n){p(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)})).end()}}),p.expr.filters.hidden=function(e){return!p.expr.filters.visible(e)},p.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var Ct=/%20/g,xt=/\[\]$/,kt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,St=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,r){var i;if(p.isArray(t))p.each(t,(function(t,i){n||xt.test(e)?r(e,i):Tt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==p.type(t))r(e,t);else for(i in t)Tt(e+"["+i+"]",t[i],n,r)}p.param=function(e,t){var n,r=[],i=function(e,t){t=p.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=p.ajaxSettings&&p.ajaxSettings.traditional),p.isArray(e)||e.jquery&&!p.isPlainObject(e))p.each(e,(function(){i(this.name,this.value)}));else for(n in e)Tt(n,e[n],t,i);return r.join("&").replace(Ct,"+")},p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=p.prop(this,"elements");return e?p.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!p(this).is(":disabled")&&St.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!G.test(e))})).map((function(e,t){var n=p(this).val();return null==n?null:p.isArray(n)?p.map(n,(function(e){return{name:t.name,value:e.replace(kt,"\r\n")}})):{name:t.name,value:n.replace(kt,"\r\n")}})).get()}}),p.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Et=p.ajaxSettings.xhr();d.cors=!!Et&&"withCredentials"in Et,d.ajax=Et=!!Et,p.ajaxTransport((function(t){var n,r;if(d.cors||Et&&!t.crossDomain)return{send:function(i,a){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];for(o in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),p.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 p.globalEval(e),e}}}),p.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),p.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain)return{send:function(i,a){t=p("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&a("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Lt=[],At=/(=)\?(?=&|$)|\?\?/;p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Lt.pop()||p.expando+"_"+st++;return this[e]=!0,e}}),p.ajaxPrefilter("json jsonp",(function(t,n,r){var i,a,o,s=!1!==t.jsonp&&(At.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&At.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=p.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(At,"$1"+i):!1!==t.jsonp&&(t.url+=(lt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||p.error(i+" was not called"),o[0]},t.dataTypes[0]="json",a=e[i],e[i]=function(){o=arguments},r.always((function(){void 0===a?p(e).removeProp(i):e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,Lt.push(i)),o&&p.isFunction(a)&&a(o[0]),o=a=void 0})),"script"})),p.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||r;var i=k.exec(e),a=!n&&[];return i?[t.createElement(i[1])]:(i=ne([e],t,a),a&&a.length&&p(a).remove(),p.merge([],i.childNodes))};var _t=p.fn.load;function Dt(e){return p.isWindow(e)?e:9===e.nodeType&&e.defaultView}p.fn.load=function(e,t,n){if("string"!=typeof e&&_t)return _t.apply(this,arguments);var r,i,a,o=this,s=e.indexOf(" ");return s>-1&&(r=p.trim(e.slice(s)),e=e.slice(0,s)),p.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&p.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){a=arguments,o.html(r?p("<div>").append(p.parseHTML(e)).find(r):e)})).always(n&&function(e,t){o.each((function(){n.apply(this,a||[e.responseText,t,e])}))}),this},p.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){p.fn[t]=function(e){return this.on(t,e)}})),p.expr.filters.animated=function(e){return p.grep(p.timers,(function(t){return e===t.elem})).length},p.offset={setOffset:function(e,t,n){var r,i,a,o,s,l,c=p.css(e,"position"),u=p(e),d={};"static"===c&&(e.style.position="relative"),s=u.offset(),a=p.css(e,"top"),l=p.css(e,"left"),("absolute"===c||"fixed"===c)&&(a+l).indexOf("auto")>-1?(o=(r=u.position()).top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(l)||0),p.isFunction(t)&&(t=t.call(e,n,p.extend({},s))),null!=t.top&&(d.top=t.top-s.top+o),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):u.css(d)}},p.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){p.offset.setOffset(this,e,t)}));var t,n,r=this[0],i={top:0,left:0},a=r&&r.ownerDocument;return a?(t=a.documentElement,p.contains(t,r)?(i=r.getBoundingClientRect(),n=Dt(a),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===p.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),p.nodeName(e[0],"html")||(r=e.offset()),r.top+=p.css(e[0],"borderTopWidth",!0),r.left+=p.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-p.css(n,"marginTop",!0),left:t.left-r.left-p.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===p.css(e,"position");)e=e.offsetParent;return e||Le}))}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;p.fn[e]=function(r){return I(this,(function(e,r,i){var a=Dt(e);if(void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i}),e,r,arguments.length)}})),p.each(["top","left"],(function(e,t){p.cssHooks[t]=_e(d.pixelPosition,(function(e,n){if(n)return n=Ae(e,t),Te.test(n)?p(e).position()[t]+"px":n}))})),p.each({Height:"height",Width:"width"},(function(e,t){p.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){p.fn[r]=function(r,i){var a=arguments.length&&(n||"boolean"!=typeof r),o=n||(!0===r||!0===i?"margin":"border");return I(this,(function(t,n,r){var i;return p.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?p.css(t,n,o):p.style(t,n,r,o)}),t,a?r:void 0,a,null)}}))})),p.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)},size:function(){return this.length}}),p.fn.andSelf=p.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return p}));var Ot=e.jQuery,It=e.$;return p.noConflict=function(t){return e.$===p&&(e.$=It),t&&e.jQuery===p&&(e.jQuery=Ot),p},t||(e.jQuery=e.$=p),p}))
/*!
 * JavaScript Cookie v2.2.0
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */,function(e){var t;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,r=window.Cookies=e();r.noConflict=function(){return window.Cookies=n,r}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function t(n){function r(t,i,a){if("undefined"!=typeof document){if(arguments.length>1){"number"==typeof(a=e({path:"/"},r.defaults,a)).expires&&(a.expires=new Date(1*new Date+864e5*a.expires)),a.expires=a.expires?a.expires.toUTCString():"";try{var o=JSON.stringify(i);/^[\{\[]/.test(o)&&(i=o)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in a)a[l]&&(s+="; "+l,!0!==a[l]&&(s+="="+a[l].split(";")[0]));return document.cookie=t+"="+i+s}for(var c={},u=function(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)},d=document.cookie?document.cookie.split("; "):[],f=0;f<d.length;f++){var p=d[f].split("="),h=p.slice(1).join("=");this.json||'"'!==h.charAt(0)||(h=h.slice(1,-1));try{var m=u(p[0]);if(h=(n.read||n)(h,m)||u(h),this.json)try{h=JSON.parse(h)}catch(e){}if(c[m]=h,t===m)break}catch(e){}}return t?c[t]:c}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(e){return r.call({json:!0},e)},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=t,r}((function(){}))})),jQuery.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},!jQuery.browser){var matched=jQuery.uaMatch(navigator.userAgent),browser={};matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser}
/*!
 * jQuery Transit - CSS3 transitions and transformations
 * Copyright(c) 2011 Rico Sta. Cruz <rico@ricostacruz.com>
 * MIT Licensed.
 *
 * http://ricostacruz.com/jquery.transit
 * http://github.com/rstacruz/jquery.transit
 */
/*!
jQuery WaitForImages

Copyright (c) 2012 Alex Dickson

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

https://github.com/alexanderdickson/waitForImages
*/!function(e){function t(e){if(e in s.style)return e;var t=["Moz","Webkit","O","ms"],n=e.charAt(0).toUpperCase()+e.substr(1);if(e in s.style)return e;for(e=0;e<t.length;++e){var r=t[e]+n;if(r in s.style)return r}}function n(e){return"string"==typeof e&&this.parse(e),this}function r(t,n,r,i){var a=[];e.each(t,(function(t){t=e.camelCase(t),t=(t=e.transit.propertyMap[t]||e.cssProps[t]||t).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})),-1===e.inArray(t,a)&&a.push(t)})),e.cssEase[r]&&(r=e.cssEase[r]);var s=o(n)+" "+r;0<parseInt(i,10)&&(s+=" "+o(i));var l=[];return e.each(a,(function(e,t){l.push(t+" "+s)})),l.join(", ")}function i(t,n){n||(e.cssNumber[t]=!0),e.transit.propertyMap[t]=l.transform,e.cssHooks[t]={get:function(n){return e(n).css("transit:transform").get(t)},set:function(n,r){var i=e(n).css("transit:transform");i.setFromString(t,r),e(n).css({"transit:transform":i})}}}function a(e,t){return"string"!=typeof e||e.match(/^[\-0-9\.]+$/)?""+e+t:e}function o(t){return e.fx.speeds[t]&&(t=e.fx.speeds[t]),a(t,"ms")}e.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:!0,useTransitionEnd:!1};var s=document.createElement("div"),l={},c=-1<navigator.userAgent.toLowerCase().indexOf("chrome");l.transition=t("transition"),l.transitionDelay=t("transitionDelay"),l.transform=t("transform"),l.transformOrigin=t("transformOrigin"),s.style[l.transform]="",s.style[l.transform]="rotateY(90deg)",l.transform3d=""!==s.style[l.transform];var u,d=l.transitionEnd={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"}[l.transition]||null;for(u in l)l.hasOwnProperty(u)&&void 0===e.support[u]&&(e.support[u]=l[u]);s=null,e.cssEase={_default:"ease",in:"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"},e.cssHooks["transit:transform"]={get:function(t){return e(t).data("transform")||new n},set:function(t,r){var i=r;i instanceof n||(i=new n(i)),t.style[l.transform]="WebkitTransform"!==l.transform||c?i.toString():i.toString(!0),e(t).data("transform",i)}},e.cssHooks.transform={set:e.cssHooks["transit:transform"].set},"1.8">e.fn.jquery&&(e.cssHooks.transformOrigin={get:function(e){return e.style[l.transformOrigin]},set:function(e,t){e.style[l.transformOrigin]=t}},e.cssHooks.transition={get:function(e){return e.style[l.transition]},set:function(e,t){e.style[l.transition]=t}}),i("scale"),i("translate"),i("rotate"),i("rotateX"),i("rotateY"),i("rotate3d"),i("perspective"),i("skewX"),i("skewY"),i("x",!0),i("y",!0),n.prototype={setFromString:function(e,t){var r="string"==typeof t?t.split(","):t.constructor===Array?t:[t];r.unshift(e),n.prototype.set.apply(this,r)},set:function(e){var t=Array.prototype.slice.apply(arguments,[1]);this.setter[e]?this.setter[e].apply(this,t):this[e]=t.join(",")},get:function(e){return this.getter[e]?this.getter[e].apply(this):this[e]||0},setter:{rotate:function(e){this.rotate=a(e,"deg")},rotateX:function(e){this.rotateX=a(e,"deg")},rotateY:function(e){this.rotateY=a(e,"deg")},scale:function(e,t){void 0===t&&(t=e),this.scale=e+","+t},skewX:function(e){this.skewX=a(e,"deg")},skewY:function(e){this.skewY=a(e,"deg")},perspective:function(e){this.perspective=a(e,"px")},x:function(e){this.set("translate",e,null)},y:function(e){this.set("translate",null,e)},translate:function(e,t){void 0===this._translateX&&(this._translateX=0),void 0===this._translateY&&(this._translateY=0),null!=e&&(this._translateX=a(e,"px")),null!=t&&(this._translateY=a(t,"px")),this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var e=(this.scale||"1,1").split(",");return e[0]&&(e[0]=parseFloat(e[0])),e[1]&&(e[1]=parseFloat(e[1])),e[0]===e[1]?e[0]:e},rotate3d:function(){for(var e=(this.rotate3d||"0,0,0,0deg").split(","),t=0;3>=t;++t)e[t]&&(e[t]=parseFloat(e[t]));return e[3]&&(e[3]=a(e[3],"deg")),e}},parse:function(e){var t=this;e.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,(function(e,n,r){t.setFromString(n,r)}))},toString:function(e){var t,n=[];for(t in this)this.hasOwnProperty(t)&&(l.transform3d||"rotateX"!==t&&"rotateY"!==t&&"perspective"!==t&&"transformOrigin"!==t)&&"_"!==t[0]&&(e&&"scale"===t?n.push(t+"3d("+this[t]+",1)"):e&&"translate"===t?n.push(t+"3d("+this[t]+",0)"):n.push(t+"("+this[t]+")"));return n.join(" ")}},e.fn.transition=e.fn.transit=function(t,n,i,a){var s=this,c=0,u=!0;"function"==typeof n&&(a=n,n=void 0),"function"==typeof i&&(a=i,i=void 0),void 0!==t.easing&&(i=t.easing,delete t.easing),void 0!==t.duration&&(n=t.duration,delete t.duration),void 0!==t.complete&&(a=t.complete,delete t.complete),void 0!==t.queue&&(u=t.queue,delete t.queue),void 0!==t.delay&&(c=t.delay,delete t.delay),void 0===n&&(n=e.fx.speeds._default),void 0===i&&(i=e.cssEase._default),n=o(n);var f=r(t,n,i,c),p=e.transit.enabled&&l.transition?parseInt(n,10)+parseInt(c,10):0;if(0===p)return i=function(e){s.css(t),a&&a.apply(s),e&&e()},!0===(n=u)?s.queue(i):n?s.queue(n,i):i(),s;var h={};return i=function(n){var r=0;"MozTransition"===l.transition&&25>r&&(r=25),window.setTimeout((function(){var r=!1,i=function(){r&&s.unbind(d,i),0<p&&s.each((function(){this.style[l.transition]=h[this]||null})),"function"==typeof a&&a.apply(s),"function"==typeof n&&n()};0<p&&d&&e.transit.useTransitionEnd?(r=!0,s.bind(d,i)):window.setTimeout(i,p),s.each((function(){0<p&&(this.style[l.transition]=f),e(this).css(t)}))}),r)},!0===(n=u)?s.queue(i):n?s.queue(n,i):i(),this},e.transit.getTransitionValue=r}(jQuery),function(e,t){jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,t,n,r,i){return jQuery.easing[jQuery.easing.def](e,t,n,r,i)},easeInQuad:function(e,t,n,r,i){return r*(t/=i)*t+n},easeOutQuad:function(e,t,n,r,i){return-r*(t/=i)*(t-2)+n},easeInOutQuad:function(e,t,n,r,i){return(t/=i/2)<1?r/2*t*t+n:-r/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,r,i){return r*(t/=i)*t*t+n},easeOutCubic:function(e,t,n,r,i){return r*((t=t/i-1)*t*t+1)+n},easeInOutCubic:function(e,t,n,r,i){return(t/=i/2)<1?r/2*t*t*t+n:r/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,r,i){return r*(t/=i)*t*t*t+n},easeOutQuart:function(e,t,n,r,i){return-r*((t=t/i-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,r,i){return(t/=i/2)<1?r/2*t*t*t*t+n:-r/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,r,i){return r*(t/=i)*t*t*t*t+n},easeOutQuint:function(e,t,n,r,i){return r*((t=t/i-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,r,i){return(t/=i/2)<1?r/2*t*t*t*t*t+n:r/2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,r,i){return-r*Math.cos(t/i*(Math.PI/2))+r+n},easeOutSine:function(e,t,n,r,i){return r*Math.sin(t/i*(Math.PI/2))+n},easeInOutSine:function(e,t,n,r,i){return-r/2*(Math.cos(Math.PI*t/i)-1)+n},easeInExpo:function(e,t,n,r,i){return 0==t?n:r*Math.pow(2,10*(t/i-1))+n},easeOutExpo:function(e,t,n,r,i){return t==i?n+r:r*(1-Math.pow(2,-10*t/i))+n},easeInOutExpo:function(e,t,n,r,i){return 0==t?n:t==i?n+r:(t/=i/2)<1?r/2*Math.pow(2,10*(t-1))+n:r/2*(2-Math.pow(2,-10*--t))+n},easeInCirc:function(e,t,n,r,i){return-r*(Math.sqrt(1-(t/=i)*t)-1)+n},easeOutCirc:function(e,t,n,r,i){return r*Math.sqrt(1-(t=t/i-1)*t)+n},easeInOutCirc:function(e,t,n,r,i){return(t/=i/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+n:r/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,r,i){var a=1.70158,o=0,s=r;if(0==t)return n;if(1==(t/=i))return n+r;if(o||(o=.3*i),s<Math.abs(r)){s=r;a=o/4}else a=o/(2*Math.PI)*Math.asin(r/s);return-s*Math.pow(2,10*(t-=1))*Math.sin(2*(t*i-a)*Math.PI/o)+n},easeOutElastic:function(e,t,n,r,i){var a=1.70158,o=0,s=r;if(0==t)return n;if(1==(t/=i))return n+r;if(o||(o=.3*i),s<Math.abs(r)){s=r;a=o/4}else a=o/(2*Math.PI)*Math.asin(r/s);return s*Math.pow(2,-10*t)*Math.sin(2*(t*i-a)*Math.PI/o)+r+n},easeInOutElastic:function(e,t,n,r,i){var a=1.70158,o=0,s=r;if(0==t)return n;if(2==(t/=i/2))return n+r;if(o||(o=.3*i*1.5),s<Math.abs(r)){s=r;a=o/4}else a=o/(2*Math.PI)*Math.asin(r/s);return t<1?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(t*i-a)*Math.PI/o)+n:s*Math.pow(2,-10*(t-=1))*Math.sin(2*(t*i-a)*Math.PI/o)*.5+r+n},easeInBack:function(e,t,n,r,i,a){return null==a&&(a=1.70158),r*(t/=i)*t*((a+1)*t-a)+n},easeOutBack:function(e,t,n,r,i,a){return null==a&&(a=1.70158),r*((t=t/i-1)*t*((a+1)*t+a)+1)+n},easeInOutBack:function(e,t,n,r,i,a){return null==a&&(a=1.70158),(t/=i/2)<1?r/2*t*t*((1+(a*=1.525))*t-a)+n:r/2*((t-=2)*t*((1+(a*=1.525))*t+a)+2)+n},easeInBounce:function(e,t,n,r,i){return r-jQuery.easing.easeOutBounce(e,i-t,0,r,i)+n},easeOutBounce:function(e,t,n,r,i){return(t/=i)<1/2.75?7.5625*r*t*t+n:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+n:r*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeInOutBounce:function(e,t,n,r,i){return t<i/2?.5*jQuery.easing.easeInBounce(e,2*t,0,r,i)+n:.5*jQuery.easing.easeOutBounce(e,2*t-i,0,r,i)+.5*r+n}}),e.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},e.expr[":"].uncached=function(t){var n=document.createElement("img");return n.src=t.src,e(t).is('img[src!=""]')&&!n.complete},e.fn.waitForImages=function(t,n,r){if(e.isPlainObject(arguments[0])&&(n=t.each,r=t.waitForAll,t=t.finished),t=t||e.noop,n=n||e.noop,r=!!r,!e.isFunction(t)||!e.isFunction(n))throw new TypeError("An invalid callback was supplied.");return this.each((function(){var i=e(this),a=[];if(r){var o=e.waitForImages.hasImageProperties||[],s=/url\((['"]?)(.*?)\1\)/g;i.find("*").each((function(){var t=e(this);t.is("img:uncached")&&a.push({src:t.attr("src"),element:t[0]}),e.each(o,(function(e,n){var r,i=t.css(n);if(!i)return!0;for(;r=s.exec(i);)a.push({src:r[2],element:t[0]})}))}))}else i.find("img:uncached").each((function(){a.push({src:this.src,element:this})}));var l=a.length,c=0;0==l&&t.call(i[0]),e.each(a,(function(r,a){var o=new Image;e(o).bind("load error",(function(e){if(c++,n.call(a.element,c,l,"load"==e.type),c==l)return t.call(i[0]),!1})),o.src=a.src}))}))},e.fn.swipe=function(t){if(!this)return!1;var n={fingers:1,threshold:75,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,click:null,triggerOnTouchEnd:!0,allowPageScroll:"auto"},r="left",i="right",a="up",o="down",s="none",l="horizontal",c="vertical",u="move",d="end",f="cancel",p="ontouchstart"in window,h=p?"touchstart":"mousedown",m=p?"touchmove":"mousemove",g=p?"touchend":"mouseup",v="start";return null!=t.allowPageScroll||null==t.swipe&&null==t.swipeStatus||(t.allowPageScroll=s),t&&e.extend(n,t),this.each((function(){function t(){var e=function(){var e=W.x-E.x,t=E.y-W.y,n=Math.atan2(t,e),r=Math.round(180*n/Math.PI);r<0&&(r=360-Math.abs(r));return r}();return e<=45&&e>=0||e<=360&&e>=315?r:e>=135&&e<=225?i:e>45&&e<135?o:a}function b(){return Math.round(Math.sqrt(Math.pow(E.x-W.x,2)+Math.pow(E.y-W.y,2)))}function y(e,t){if(n.allowPageScroll==s)e.preventDefault();else{var u="auto"==n.allowPageScroll;switch(t){case r:(n.swipeLeft&&u||!u&&n.allowPageScroll!=l)&&e.preventDefault();break;case i:(n.swipeRight&&u||!u&&n.allowPageScroll!=l)&&e.preventDefault();break;case a:(n.swipeUp&&u||!u&&n.allowPageScroll!=c)&&e.preventDefault();break;case o:(n.swipeDown&&u||!u&&n.allowPageScroll!=c)&&e.preventDefault()}}}function w(e,t){if(n.swipeStatus&&n.swipeStatus.call(S,e,t,direction||null,distance||0),t==f&&(!n.click||1!=T&&p||!isNaN(distance)&&0!=distance||n.click.call(S,e,e.target)),t==d)switch(n.swipe&&n.swipe.call(S,e,direction,distance),direction){case r:n.swipeLeft&&n.swipeLeft.call(S,e,direction,distance);break;case i:n.swipeRight&&n.swipeRight.call(S,e,direction,distance);break;case a:n.swipeUp&&n.swipeUp.call(S,e,direction,distance);break;case o:n.swipeDown&&n.swipeDown.call(S,e,direction,distance)}}function C(e){T=0,W.x=0,W.y=0,E.x=0,E.y=0,L.x=0,L.y=0}function x(e){e.preventDefault(),distance=b(),direction=t(),n.triggerOnTouchEnd?(v=d,T!=n.fingers&&p||0==E.x?(w(e,v=f),C()):distance>=n.threshold?(w(e,v),C()):(w(e,v=f),C())):v==u&&(w(e,v=f),C()),P.removeEventListener(m,k,!1),P.removeEventListener(g,x,!1)}function k(e){if(v!=d&&v!=f){var r=p?e.touches[0]:e;E.x=r.pageX,E.y=r.pageY,direction=t(),p&&(T=e.touches.length),v=u,y(e,direction),T!=n.fingers&&p?(w(e,v=f),C()):(distance=b(),n.swipeStatus&&w(e,v,direction,distance),n.triggerOnTouchEnd||distance>=n.threshold&&(w(e,v=d),C()))}}var P=this,S=e(this),T=0,W={x:0,y:0},E={x:0,y:0},L={x:0,y:0};try{this.addEventListener(h,(function(e){var t=p?e.touches[0]:e;v="start",p&&(T=e.touches.length),distance=0,direction=null,T!=n.fingers&&p?C():(W.x=E.x=t.pageX,W.y=E.y=t.pageY,n.swipeStatus&&w(e,v)),P.addEventListener(m,k,!1),P.addEventListener(g,x,!1)}),!1),this.addEventListener("touchcancel",C)}catch(e){}}))}}(jQuery),function(e,t){var n,r=e.jQuery||e.Cowboy||(e.Cowboy={});r.throttle=n=function(e,n,i,a){var o,s=0;function l(){var r=this,l=+new Date-s,c=arguments;function u(){s=+new Date,i.apply(r,c)}a&&!o&&u(),o&&clearTimeout(o),a===t&&l>e?u():!0!==n&&(o=setTimeout(a?function(){o=t}:u,a===t?e-l:e))}return"boolean"!=typeof n&&(a=i,i=n,n=t),r.guid&&(l.guid=i.guid=i.guid||r.guid++),l},r.debounce=function(e,r,i){return i===t?n(e,r,!1):n(e,i,!1!==r)}}(this),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,n){var r=(new Date).getTime(),i=Math.max(0,16-(r-e)),a=window.setTimeout((function(){t(r+i)}),i);return e=r+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),window.Modernizr=function(e,t,n){function r(e){m.cssText=e}function i(e,t){return typeof e===t}function a(e,t){return!!~(""+e).indexOf(t)}function o(e,t){for(var r in e){var i=e[r];if(!a(i,"-")&&m[i]!==n)return"pfx"!=t||i}return!1}function s(e,t,r){for(var a in e){var o=t[e[a]];if(o!==n)return!1===r?e[a]:i(o,"function")?o.bind(r||t):o}return!1}function l(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+b.join(r+" ")+r).split(" ");return i(t,"string")||i(t,"undefined")?o(a,t):s(a=(e+" "+y.join(r+" ")+r).split(" "),t,n)}var c,u,d={},f=t.documentElement,p="modernizr",h=t.createElement(p),m=h.style,g=" -webkit- -moz- -o- -ms- ".split(" "),v="Webkit Moz O ms",b=v.split(" "),y=v.toLowerCase().split(" "),w={},C=[],x=C.slice,k=function(e,n,r,i){var a,o,s,l,c=t.createElement("div"),u=t.body,d=u||t.createElement("body");if(parseInt(r,10))for(;r--;)(s=t.createElement("div")).id=i?i[r]:p+(r+1),c.appendChild(s);return a=["&#173;",'<style id="s',p,'">',e,"</style>"].join(""),c.id=p,(u?c:d).innerHTML+=a,d.appendChild(c),u||(d.style.background="",d.style.overflow="hidden",l=f.style.overflow,f.style.overflow="hidden",f.appendChild(d)),o=n(c,e),u?c.parentNode.removeChild(c):(d.parentNode.removeChild(d),f.style.overflow=l),!!o},P={}.hasOwnProperty;for(var S in u=i(P,"undefined")||i(P.call,"undefined")?function(e,t){return t in e&&i(e.constructor.prototype[t],"undefined")}:function(e,t){return P.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=x.call(arguments,1),r=function(){if(this instanceof r){var i=function(){};i.prototype=t.prototype;var a=new i,o=t.apply(a,n.concat(x.call(arguments)));return Object(o)===o?o:a}return t.apply(e,n.concat(x.call(arguments)))};return r}),w.csstransforms=function(){return!!l("transform")},w.csstransforms3d=function(){var e=!!l("perspective");return e&&"webkitPerspective"in f.style&&k("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",(function(t,n){e=9===t.offsetLeft&&3===t.offsetHeight})),e},w.csstransitions=function(){return l("transition")},w)u(w,S)&&(c=S.toLowerCase(),d[c]=w[S](),C.push((d[c]?"":"no-")+c));return d.addTest=function(e,t){if("object"==typeof e)for(var r in e)u(e,r)&&d.addTest(r,e[r]);else{if(e=e.toLowerCase(),d[e]!==n)return d;t="function"==typeof t?t():t,f.className+=" "+(t?"":"no-")+e,d[e]=t}return d},r(""),h=null,d._version="2.6.2",d._prefixes=g,d._domPrefixes=y,d._cssomPrefixes=b,d.testProp=function(e){return o([e])},d.testAllProps=l,d.testStyles=k,d.prefixed=function(e,t,n){return t?l(e,t,n):l(e,"pfx")},f.className=f.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+" js "+C.join(" "),d}(0,this.document),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.__customEventPolyfill=t()}(this,(function(){"use strict";function e(e,t){var n;t=t||{bubbles:!1,cancelable:!1,detail:void 0};try{(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail)}catch(i){for(var r in n=document.createEvent("Event"),t)n[r]=t[r];n.initEvent(e,t.bubbles,t.cancelable)}return n}void 0!==window.CustomEvent&&(e.prototype=window.CustomEvent.prototype),window.CustomEvent=e}));var FlipClock,Base=function(){};function b64EncodeUnicode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)})))}function b64DecodeUnicode(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}Base.extend=function(e,t){"use strict";var n=Base.prototype.extend;Base._prototyping=!0;var r=new this;n.call(r,e),r.base=function(){},delete Base._prototyping;var i=r.constructor,a=r.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==a)this._constructing=!0,i.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||n).call(arguments[0],r)};return a.ancestor=this,a.extend=this.extend,a.forEach=this.forEach,a.implement=this.implement,a.prototype=r,a.toString=this.toString,a.valueOf=function(e){return"object"==e?a:i.valueOf()},n.call(a,t),"function"==typeof a.init&&a.init(),a},Base.prototype={extend:function(e,t){if(arguments.length>1){var n=this[e];if(n&&"function"==typeof t&&(!n.valueOf||n.valueOf()!=t.valueOf())&&/\bbase\b/.test(t)){var r=t.valueOf();t=function(){var e=this.base||Base.prototype.base;this.base=n;var t=r.apply(this,arguments);return this.base=e,t},t.valueOf=function(e){return"object"==e?t:r},t.toString=Base.toString}this[e]=t}else if(e){var i=Base.prototype.extend;Base._prototyping||"function"==typeof this||(i=this.extend||i);for(var a={toSource:null},o=["constructor","toString","valueOf"],s=Base._prototyping?0:1;l=o[s++];)e[l]!=a[l]&&i.call(this,l,e[l]);for(var l in e)a[l]||i.call(this,l,e[l])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(e,t,n){for(var r in e)void 0===this.prototype[r]&&t.call(n,e[r],r,e)},implement:function(){for(var e=0;e<arguments.length;e++)"function"==typeof arguments[e]?arguments[e](this.prototype):this.prototype.extend(arguments[e]);return this},toString:function(){return String(this.valueOf())}}),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";(FlipClock=function(e,t,n){return t instanceof Object&&t instanceof Date==!1&&(n=t,t=0),new FlipClock.Factory(e,t,n)}).Lang={},FlipClock.Base=Base.extend({buildDate:"2014-12-12",version:"0.7.7",constructor:function(t,n){"object"!=typeof t&&(t={}),"object"!=typeof n&&(n={}),this.setOptions(e.extend(!0,{},t,n))},callback:function(e){if("function"==typeof e){for(var t=[],n=1;n<=arguments.length;n++)arguments[n]&&t.push(arguments[n]);e.apply(this,t)}},log:function(e){window.console&&console.log&&console.log(e)},getOption:function(e){return!!this[e]&&this[e]},getOptions:function(){return this},setOption:function(e,t){this[e]=t},setOptions:function(e){for(var t in e)void 0!==e[t]&&this.setOption(t,e[t])}})}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";FlipClock.Face=FlipClock.Base.extend({autoStart:!0,dividers:[],factory:!1,lists:[],constructor:function(e,t){this.dividers=[],this.lists=[],this.base(t),this.factory=e},build:function(){this.autoStart&&this.start()},createDivider:function(t,n,r){"boolean"!=typeof n&&n||(r=n,n=t);var i=['<span class="flex-1 justify-center center-vertically '+this.factory.classes.dot+' top" style="font-size: '+this.factory.size/2+"px; color: "+("transparent"===this.factory.bgColor?this.factory.color:this.factory.bgColor)+';">&bull;</span>','<span class="flex-1 justify-center center-vertically '+this.factory.classes.dot+' bottom" style="font-size: '+this.factory.size/2+"px; color: "+("transparent"===this.factory.bgColor?this.factory.color:this.factory.bgColor)+';">&bull;</span>'].join("");r&&(i=""),t=this.factory.localize(t);var a=['<span class="'+this.factory.classes.divider+" "+(n||"").toLowerCase()+' flex flex-col" style="height: '+(this.factory.size+10)+'px;">','<span class="'+this.factory.classes.label+'" style="font-size: '+this.factory.labelSize+"px; color: "+this.factory.labelColor+'">'+(t||"")+"</span>",i,"</span>"],o=e(a.join(""));return this.dividers.push(o),o},createList:function(e,t){"object"==typeof e&&(t=e,e=0);var n=new FlipClock.List(this.factory,e,t);return this.lists.push(n),n},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(e){e.$el.append(!1)},addDigit:function(e){var t=this.createList(e,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(t)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0==this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,n){var r=this;e.each(t,(function(e,t){var i=r.lists[e];i?(n||t==i.digit||i.play(),i.select(t)):r.addDigit(t)}))}})}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";FlipClock.Factory=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},color:"#ffffff",bgColor:"#333333",labelColor:"#333333",labelSize:14,size:70,classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,n,r){r||(r={}),this.lists=[],this.running=!1,this.base(r),this.$el=e(t).addClass(this.classes.wrapper),this.$wrapper=this.$el,this.original=n instanceof Date?n:n?Math.round(n):0,this.time=new FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new FlipClock.Timer(this,r),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,r),this.autoStart&&this.start()},loadClockFace:function(e,t){var n,r="Face",i=!1;return e=e.ucfirst()+r,this.face.stop&&(this.stop(),i=!0),this.$el.html(""),this.time.minimumDigits=this.minimumDigits,(n=FlipClock[e]?new FlipClock[e](this,t):new FlipClock[this.defaultClockFace+r](this,t)).build(),this.face=n,i&&this.start(),this.face},loadLanguage:function(e){var t;return t=FlipClock.Lang[e.ucfirst()]?FlipClock.Lang[e.ucfirst()]:FlipClock.Lang[e]?FlipClock.Lang[e]:FlipClock.Lang[this.defaultLanguage],this.lang=t},localize:function(e,t){var n=this.lang;if(!e)return null;var r=e.toLowerCase();return"object"==typeof t&&(n=t),n&&n[r]?n[r]:e},start:function(e){var t=this;t.running||t.countdown&&!(t.countdown&&t.time.time>0)?t.log("Trying to start timer when countdown already at 0"):(t.face.start(t.time),t.timer.start((function(){t.flip(),"function"==typeof e&&e()})))},stop:function(e){for(var t in this.face.stop(),this.timer.stop(e),this.lists)this.lists.hasOwnProperty(t)&&this.lists[t].stop()},reset:function(e){this.timer.reset(e),this.face.reset()},setTime:function(e){this.time.time=e,this.flip(!0)},getTime:function(e){return this.time},setCountdown:function(e){var t=this.running;this.countdown=!!e,t&&(this.stop(),this.start())},flip:function(e){this.face.flip(!1,e)}})}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";FlipClock.List=FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(e,t,n){this.factory=e,this.digit=t,this.lastDigit=t,this.$el=this.createList(),this.$obj=this.$el,t>0&&this.select(t),this.factory.$el.append(this.$el)},select:function(e){if(void 0===e?e=this.digit:this.digit=e,this.digit!=this.lastDigit){var t=this.$el.find("."+this.classes.before).removeClass(this.classes.before);this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.appendListItem(this.classes.active,this.digit),t.remove(),this.lastDigit=this.digit}},play:function(){this.$el.addClass(this.factory.classes.play)},stop:function(){var e=this;setTimeout((function(){e.$el.removeClass(e.factory.classes.play)}),this.factory.timer.interval)},createListItem:function(e,t){var n=this.factory.size<40?"border-radius: 3px;":"";return['<li class="'+(e||"")+'" style="line-height: '+(this.factory.size+10)+'px;">','<a href="javascript: void(0);">','<div class="up">','<div class="shadow"></div>','<div class="inn" style="color: '+this.factory.color+"; background-color: "+this.factory.bgColor+"; font-size: "+this.factory.size+"px; "+n+'">'+(t||"")+"</div>","</div>",'<div class="down">','<div class="shadow"></div>','<div class="inn" style="color: '+this.factory.color+"; background-color: "+this.factory.bgColor+"; font-size: "+this.factory.size+"px;"+n+'">'+(t||"")+"</div>","</div>","</a>","</li>"].join("")},appendListItem:function(e,t){var n=this.createListItem(e,t);this.$el.append(n)},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return e(['<ul class="'+this.classes.flip+" "+(this.factory.running?this.factory.classes.play:"")+'" style="width: '+.8*this.factory.size+"px; height: "+(this.factory.size+10)+'px;">',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"</ul>"].join(""))},getNextDigit:function(){return 9==this.digit?0:this.digit+1},getPrevDigit:function(){return 0==this.digit?9:this.digit-1}})}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},e.fn.FlipClock=function(t,n){return new FlipClock(e(this),t,n)},e.fn.flipClock=function(t,n){return e.fn.FlipClock(t,n)}}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(e,t,n){"object"!=typeof n&&(n={}),n.minimumDigits||(n.minimumDigits=e.minimumDigits),this.base(n),this.factory=e,t&&(this.time=t)},convertDigitsToArray:function(e){var t=[];e=e.toString();for(var n=0;n<e.length;n++)e[n].match(/^\d*$/g)&&t.push(e[n]);return t},digit:function(e){var t=this.toString(),n=t.length;return!!t[n-e]&&t[n-e]},digitize:function(t){var n=[];if(e.each(t,(function(e,t){1==(t=t.toString()).length&&(t="0"+t);for(var r=0;r<t.length;r++)n.push(t.charAt(r))})),n.length>this.minimumDigits&&(this.minimumDigits=n.length),this.minimumDigits>n.length)for(var r=n.length;r<this.minimumDigits;r++)n.unshift("0");return n},getDateObject:function(){return this.time instanceof Date?this.time:new Date((new Date).getTime()+1e3*this.getTimeSeconds())},getDayCounter:function(e){var t=[this.getDays(),this.getHours(!0),this.getMinutes(!0)];return e&&t.push(this.getSeconds(!0)),this.digitize(t)},getDays:function(e){var t=this.getTimeSeconds()/60/60/24;return e&&(t%=7),Math.floor(t)},getHourCounter:function(){return this.digitize([this.getHours(),this.getMinutes(!0),this.getSeconds(!0)])},getHourly:function(){return this.getHourCounter()},getHours:function(e){var t=this.getTimeSeconds()/60/60;return e&&(t%=24),Math.floor(t)},getMilitaryTime:function(e,t){void 0===t&&(t=!0),e||(e=this.getDateObject());var n=[e.getHours(),e.getMinutes()];return!0===t&&n.push(e.getSeconds()),this.digitize(n)},getMinutes:function(e){var t=this.getTimeSeconds()/60;return e&&(t%=60),Math.floor(t)},getMinuteCounter:function(){return this.digitize([this.getMinutes(),this.getSeconds(!0)])},getTimeSeconds:function(e){return e||(e=new Date),this.time instanceof Date?this.factory.countdown?Math.max(this.time.getTime()/1e3-e.getTime()/1e3,0):e.getTime()/1e3-this.time.getTime()/1e3:this.time},getTime:function(e,t){void 0===t&&(t=!0),e||(e=this.getDateObject()),console.log(e);var n=e.getHours(),r=[n>12?n-12:0===n?12:n,e.getMinutes()];return!0===t&&r.push(e.getSeconds()),this.digitize(r)},getSeconds:function(e){var t=this.getTimeSeconds();return e&&(60==t?t=0:t%=60),Math.ceil(t)},getWeeks:function(e){var t=this.getTimeSeconds()/60/60/24/7;return e&&(t%=52),Math.floor(t)},removeLeadingZeros:function(t,n){var r=0,i=[];return e.each(n,(function(e,a){e<t?r+=parseInt(n[e],10):i.push(n[e])})),0===r?i:n},addSeconds:function(e){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+e):this.time+=e},addSecond:function(){this.addSeconds(1)},subSeconds:function(e){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-e):this.time-=e},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),
/**
 * FlipClock.js
 *
 * @author     Justin Kimbrell
 * @copyright  2013 - Objective HTML, LLC
 * @licesnse   http://www.opensource.org/licenses/mit-license.php
 */
function(e){"use strict";FlipClock.Timer=FlipClock.Base.extend({callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},count:0,factory:!1,interval:1e3,animationRate:1e3,constructor:function(e,t){this.base(t),this.factory=e,this.callback(this.callbacks.init),this.callback(this.callbacks.create)},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(e){clearInterval(this.timer),this.count=0,this._setInterval(e),this.callback(this.callbacks.reset)},start:function(e){this.factory.running=!0,this._createTimer(e),this.callback(this.callbacks.start)},stop:function(e){this.factory.running=!1,this._clearInterval(e),this.callback(this.callbacks.stop),this.callback(e)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(e){this._setInterval(e)},_destroyTimer:function(e){this._clearInterval(),this.timer=!1,this.callback(e),this.callback(this.callbacks.destroy)},_interval:function(e){this.callback(this.callbacks.interval),this.callback(e),this.count++},_setInterval:function(e){var t=this;t._interval(e),t.timer=setInterval((function(){t._interval(e)}),this.interval)}})}(jQuery),function(e){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({constructor:function(e,t){this.base(e,t)},build:function(t){var n=this,r=this.factory.$el.find("ul");this.factory.time.time||(this.factory.original=new Date,this.factory.time=new FlipClock.Time(this.factory,this.factory.original)),(t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds)).length>r.length&&e.each(t,(function(e,t){n.createList(t)})),this.createDivider(),this.createDivider(),e(this.dividers[0]).insertBefore(this.lists[this.lists.length-2].$el),e(this.dividers[1]).insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(e,t){this.autoIncrement(),e=e||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(e,t)}})}(jQuery),function(e){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(e,t){"object"!=typeof t&&(t={}),e.autoStart=!!t.autoStart,t.autoStart&&(this.shouldAutoIncrement=!0),e.increment=function(){e.countdown=!1,e.setTime(e.getTime().getTimeSeconds()+1)},e.decrement=function(){e.countdown=!0;var t=e.getTime().getTimeSeconds();t>0&&e.setTime(t-1)},e.setValue=function(t){e.setTime(t)},e.setCounter=function(t){e.setTime(t)},this.base(e,t)},build:function(){var t=this,n=this.factory.$el.find("ul"),r=this.factory.getTime().digitize([this.factory.getTime().time]);r.length>n.length&&e.each(r,(function(e,n){t.createList(n).select(n)})),e.each(this.lists,(function(e,t){t.play()})),this.base()},flip:function(e,t){this.shouldAutoIncrement&&this.autoIncrement(),e||(e=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(e,t)},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}})}(jQuery),function(e){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,constructor:function(e,t){this.base(e,t)},build:function(t){var n=this,r=this.factory.$el.find("ul"),i=0;(t=t||this.factory.time.getDayCounter(this.showSeconds)).length>r.length&&e.each(t,(function(e,t){n.createList(t)}));var a=function(t,n,r){var i=t.find(".flip-clock-label").detach();t.insertBefore(n);var a=e('<div class="flip-part f-left flex flex-col"></div>'),o=e('<div class="digit-part flex-1"></div>'),s=e('<div class="label-part flex-1"></div>');a.insertBefore(n),o.append(n),o.append(r),s.append(i),a.append(o),a.append(s)};this.showSeconds?a(e(this.createDivider("Seconds")),this.lists[this.lists.length-2].$el,this.lists[this.lists.length-1].$el):i=2,a(e(this.createDivider("Minutes")),this.lists[this.lists.length-4+i].$el,this.lists[this.lists.length-4+i+1].$el),a(e(this.createDivider("Hours")),this.lists[this.lists.length-6+i].$el,this.lists[this.lists.length-6+i+1].$el),a(e(this.createDivider("Days",!0)),this.lists[0].$el,this.lists[1].$el),this.base()},flip:function(e,t){e||(e=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(e,t)}})}(jQuery),function(e){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(e,t){this.base(e,t)},build:function(t,n){var r=this,i=this.factory.$el.find("ul");(n=n||this.factory.time.getHourCounter()).length>i.length&&e.each(n,(function(e,t){r.createList(t)}));var a=function(t,n){var r=t.find(".flip-clock-label").detach();t.insertBefore(n[0]);var i=e('<div class="flip-part f-left flex flex-col"></div>'),a=e('<div class="digit-part flex-1"></div>'),o=e('<div class="label-part flex-1"></div>');i.insertBefore(n[0]);for(var s=0;s<n.length;++s)a.append(n[s]);o.append(r),i.append(a),i.append(o)};if(a(e(this.createDivider("Seconds")),[this.lists[this.lists.length-2].$el,this.lists[this.lists.length-1].$el]),a(e(this.createDivider("Minutes")),[this.lists[this.lists.length-4].$el,this.lists[this.lists.length-3].$el]),!t){for(var o=[],s=0;s<this.lists.length-4;++s)o.push(this.lists[s].$el);a(e(this.createDivider("Hours",!0)),o)}this.base()},flip:function(e,t){e||(e=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(e,t)},appendDigitToClock:function(e){this.base(e),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),jQuery,FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(e,t){this.base(e,t)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(e,t){e||(e=this.factory.time.getMinuteCounter()),this.base(e,t)}}),function(e){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=e(['<ul class="flip-clock-meridium">',"<li>",'<a href="#">'+this.meridiumText+"</a>","</li>","</ul>"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(e,t){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),t)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"==this.getMeridium()},isAM:function(){return"AM"==this.getMeridium()}})}(jQuery),jQuery,FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic,jQuery,FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish,jQuery,FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German,jQuery,FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English,jQuery,FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish,jQuery,FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish,jQuery,FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French,jQuery,FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian,jQuery,FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian,jQuery,FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch,jQuery,FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian,jQuery,FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese,jQuery,FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian,jQuery,FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish,jQuery,FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese,function(e){function t(){i=function(e){return r+"-"+e},a=function(e){return r+"-"+e},o=function(e){return e+"."+r},e.each([i,a,o],(function(e,t){t.add=function(e){for(var n in e=e.split(" "))t[e[n]]=t(e[n])}})),i.add("touch desktop scale-1 scale-2 scale-3 wrapper opened opening fixed inline hover slider slide loading noanimation fastanimation"),a.add("slide anchor"),o.add("open opening close closing prev next slideTo sliding click pinch scroll resize orientationchange load loading loaded transitionend webkitTransitionEnd"),s={complObject:function(t,n){return e.isPlainObject(t)||(t=n),t},complBoolean:function(e,t){return"boolean"!=typeof e&&(e=t),e},complNumber:function(t,n){return e.isNumeric(t)||(t=n),t},complString:function(e,t){return"string"!=typeof e&&(e=t),e},isPercentage:function(e){return"string"==typeof e&&"%"==e.slice(-1)},getPercentage:function(e){return parseInt(e.slice(0,-1))},resizeRatio:function(e,t,n,r,i){var a=t.width(),o=t.height();n&&a>n&&(a=n),r&&o>r&&(o=r),i>a/o?o=a/i:a=o*i,e.width(a).height(o)},transitionend:function(e,t,n){var r=!1,i=function(){r||t.call(e[0]),r=!0};e.one(o.transitionend,i),e.one(o.webkitTransitionEnd,i),setTimeout(i,1.1*n)},setViewportScale:function(){if(l.viewportScale){var e=l.viewportScale.getScale();void 0!==e&&(e=1/e,l.$body.removeClass(i["scale-1"]).removeClass(i["scale-2"]).removeClass(i["scale-3"]).addClass(i["scale-"+Math.max(Math.min(Math.round(e),3),1)]))}}},(l={$wndw:e(window),$html:e("html"),$body:e("body"),scrollPosition:0,viewportScale:null,viewportScaleInterval:null}).$body.addClass(e[n].support.touch?i.touch:i.desktop),l.$wndw.on(o.scroll,(function(e){l.$body.hasClass(i.opened)&&(window.scrollTo(0,l.scrollPosition),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())})),!l.viewportScale&&e[n].support.touch&&"undefined"!=typeof FlameViewportScale&&(l.viewportScale=new FlameViewportScale,s.setViewportScale(),l.$wndw.on(o.orientationchange+" "+o.resize,(function(){l.viewportScaleInterval&&(clearTimeout(l.viewportScaleInterval),l.viewportScaleInterval=null),l.viewportScaleInterval=setTimeout((function(){s.setViewportScale()}),500)}))),e[n]._c=i,e[n]._d=a,e[n]._e=o,e[n]._f=s,e[n]._g=l}var n="tosrus",r="tos";if(!e[n]){var i={},a={},o={},s={},l={};e[n]=function(e,t,n){return this.$node=e,this.opts=t,this.conf=n,this.vars={},this.nodes={},this.slides={},this._init(),this},e[n].prototype={_init:function(){var t=this;this._complementOptions(),this.vars.fixed="window"==this.opts.wrapper.target,this.nodes.$wrpr=e('<div class="'+i.wrapper+'" />'),this.nodes.$sldr=e('<div class="'+i.slider+'" />').appendTo(this.nodes.$wrpr),this.nodes.$wrpr.addClass(this.vars.fixed?i.fixed:i.inline).addClass(i("fx-"+this.opts.effect)).addClass(i(this.opts.slides.scale)).addClass(this.opts.wrapper.classes),this.nodes.$wrpr.on(o.open+" "+o.close+" "+o.prev+" "+o.next+" "+o.slideTo,(function(e){var n=(e=(arguments=Array.prototype.slice.call(arguments)).shift()).type;e.stopPropagation(),"function"==typeof t[n]&&t[n].apply(t,arguments)})).on(o.opening+" "+o.closing+" "+o.sliding+" "+o.loading+" "+o.loaded,(function(e){e.stopPropagation()})).on(o.click,(function(n){switch(n.stopPropagation(),t.opts.wrapper.onClick){case"toggleUI":t.nodes.$wrpr.toggleClass(i.hover);break;case"close":e(n.target).is("img")||t.close()}})),this.nodes.$anchors=this._initAnchors(),this.nodes.$slides=this._initSlides(),this.slides.total=this.nodes.$slides.length,this.slides.visible=this.opts.slides.visible,this.slides.index=0,this.vars.opened=!0;for(var r=0;r<e[n].addons.length;r++)e.isFunction(this["_addon_"+e[n].addons[r]])&&this["_addon_"+e[n].addons[r]]();for(var a=0;a<e[n].ui.length;a++)this.nodes.$wrpr.find("."+i[e[n].ui[a]]).length&&this.nodes.$wrpr.addClass(i("has-"+e[n].ui[a]));"close"==this.opts.wrapper.onClick&&(this.nodes.$uibg||e().add(this.nodes.$capt||e()).add(this.nodes.$pagr||e()).on(o.click,(function(e){e.stopPropagation()}))),this.vars.fixed?(this.nodes.$wrpr.appendTo(l.$body),this.close(!0)):(this.nodes.$wrpr.appendTo(this.opts.wrapper.target),this.opts.show?(this.vars.opened=!1,this.open(0,!0)):this.close(!0))},open:function(t,n){var r=this;this.vars.opened||(this.vars.fixed&&(l.scrollPosition=l.$wndw.scrollTop(),l.$body.addClass(i.opened),s.setViewportScale()),n?this.nodes.$wrpr.addClass(i.opening).trigger(o.opening,[t,n]):setTimeout((function(){r.nodes.$wrpr.addClass(i.opening).trigger(o.opening,[t,n])}),5),this.nodes.$wrpr.addClass(i.hover).addClass(i.opened)),this.vars.opened=!0,this._loadContents(),e.isNumeric(t)&&(n=n||!this.vars.opened,this.slideTo(t,n))},close:function(t){this.vars.opened&&(this.vars.fixed&&l.$body.removeClass(i.opened),t?this.nodes.$wrpr.removeClass(i.opened):s.transitionend(this.nodes.$wrpr,(function(){e(this).removeClass(i.opened)}),this.conf.transitionDuration),this.nodes.$wrpr.removeClass(i.hover).removeClass(i.opening).trigger(o.closing,[this.slides.index,t])),this.vars.opened=!1},prev:function(t,n){e.isNumeric(t)||(t=this.opts.slides.slide),this.slideTo(this.slides.index-t,n)},next:function(t,n){e.isNumeric(t)||(t=this.opts.slides.slide),this.slideTo(this.slides.index+t,n)},slideTo:function(t,r){if(!this.vars.opened)return!1;if(!e.isNumeric(t))return!1;var a=!0;if(0>t){var l=0==this.slides.index;this.opts.infinite?t=l?this.slides.total-this.slides.visible:0:(t=0,l&&(a=!1))}if(t+this.slides.visible>this.slides.total){var c=this.slides.index+this.slides.visible>=this.slides.total;this.opts.infinite?t=c?0:this.slides.total-this.slides.visible:(t=this.slides.total-this.slides.visible,c&&(a=!1))}if(this.slides.index=t,this._loadContents(),a){var u=0-this.slides.index*this.opts.slides.width+this.opts.slides.offset;for(var d in this.slides.widthPercentage&&(u+="%"),r&&(this.nodes.$sldr.addClass(i.noanimation),s.transitionend(this.nodes.$sldr,(function(){e(this).removeClass(i.noanimation)}),5)),e[n].effects)if(d==this.opts.effect){e[n].effects[d].call(this,u,r);break}this.nodes.$wrpr.trigger(o.sliding,[t,r])}},_initAnchors:function(){var t=this,r=e();if(this.$node.is("a"))for(var i in e[n].media)r=r.add(this.$node.filter((function(){if(t.opts.media[i]&&t.opts.media[i].filterAnchors){var r=t.opts.media[i].filterAnchors.call(t,e(this));if("boolean"==typeof r)return r}return e[n].media[i].filterAnchors.call(t,e(this))})));return r},_initSlides:function(){return this[this.$node.is("a")?"_initSlidesFromAnchors":"_initSlidesFromContent"](),this.nodes.$sldr.children().css("width",this.opts.slides.width+(this.slides.widthPercentage?"%":"px"))},_initSlidesFromAnchors:function(){var t=this;this.nodes.$anchors.each((function(n){var r=e(this),s=e('<div class="'+i.slide+" "+i.loading+'" />').data(a.anchor,r).appendTo(t.nodes.$sldr);r.data(a.slide,s).on(o.click,(function(e){e.preventDefault(),t.open(n)}))}))},_initSlidesFromContent:function(){var t=this;this.$node.children().each((function(){var r=e(this);for(var a in e('<div class="'+i.slide+'" />').append(r).appendTo(t.nodes.$sldr),e[n].media){var o=null;if(t.opts.media[a]&&t.opts.media[a].filterSlides&&(o=t.opts.media[a].filterSlides.call(t,r)),"boolean"!=typeof o&&(o=e[n].media[a].filterSlides.call(t,r)),o){e[n].media[a].initSlides.call(t,r),r.parent().addClass(i(a));break}}}))},_loadContents:function(){var e=this;switch(this.opts.slides.load){case"all":this._loadContent(0,this.slides.total);break;case"visible":this._loadContent(this.slides.index,this.slides.index+this.slides.visible);break;default:this._loadContent(this.slides.index,this.slides.index+this.slides.visible),setTimeout((function(){e._loadContent(e.slides.index-e.slides.visible,e.slides.index),e._loadContent(e.slides.index+e.slides.visible,e.slides.index+2*e.slides.visible)}),this.conf.transitionDuration)}},_loadContent:function(t,r){var s=this;this.nodes.$slides.slice(t,r).each((function(){var t=e(this);if(0==t.children().length){var r=t.data(a.anchor),l=r.attr("href");for(var c in e[n].media){var u=null;if(s.opts.media[c]&&s.opts.media[c].filterAnchors&&(u=s.opts.media[c].filterAnchors.call(s,r)),"boolean"!=typeof u&&(u=e[n].media[c].filterAnchors.call(s,r)),u){e[n].media[c].initAnchors.call(s,t,l),t.addClass(i(c));break}}t.trigger(o.loading,[t.data(a.anchor)])}}))},_complementOptions:function(){if(void 0===this.opts.wrapper.target&&(this.opts.wrapper.target=this.$node.is("a")?"window":this.$node),"window"!=this.opts.wrapper.target&&"string"==typeof this.opts.wrapper.target&&(this.opts.wrapper.target=e(this.opts.wrapper.target)),this.opts.show=s.complBoolean(this.opts.show,"window"!=this.opts.wrapper.target),e.isNumeric(this.opts.slides.width))this.slides.widthPercentage=!1,this.opts.slides.visible=s.complNumber(this.opts.slides.visible,1);else{var t=!!s.isPercentage(this.opts.slides.width)&&s.getPercentage(this.opts.slides.width);this.slides.widthPercentage=!0,this.opts.slides.visible=s.complNumber(this.opts.slides.visible,t?Math.floor(100/t):1),this.opts.slides.width=t||Math.ceil(1e4/this.opts.slides.visible)/100}this.opts.slides.slide=s.complNumber(this.opts.slides.slide,this.opts.slides.visible),this.opts.slides.offset=s.isPercentage(this.opts.slides.offset)?s.getPercentage(this.opts.slides.offset):s.complNumber(this.opts.slides.offset,0)},_uniqueID:function(){return this.__uniqueID||(this.__uniqueID=0),this.__uniqueID++,i("uid-"+this.__uniqueID)}},e.fn[n]=function(r,i,a,o){l.$wndw||t(),r=e.extend(!0,{},e[n].defaults,r),r=e.extend(!0,{},r,e[n].support.touch?a:i),o=e.extend(!0,{},e[n].configuration,o);var s=new e[n](this,r,o);return this.data(n,s),s.nodes.$wrpr},e[n].support={touch:"ontouchstart"in window.document||navigator.msMaxTouchPoints},e[n].defaults={infinite:!1,effect:"slide",wrapper:{classes:"",onClick:"toggleUI"},slides:{offset:0,scale:"fit",load:"near-visible",visible:1},media:{}},e[n].configuration={transitionDuration:400},e[n].constants={},e[n].debug=function(){},e[n].deprecated=function(e,t){"undefined"!=typeof console&&void 0!==console.warn&&console.warn(n+": "+e+" is deprecated, use "+t+" instead.")},e[n].effects={slide:function(e){this.nodes.$sldr.css("left",e)},fade:function(t){s.transitionend(this.nodes.$sldr,(function(){e(this).css("left",t).css("opacity",1)}),this.conf.transitionDuration),this.nodes.$sldr.css("opacity",0)}},e[n].version="2.4.2",e[n].media={},e[n].addons=[],e[n].ui=[]}}(jQuery),function(e){var t,n="tosrus",r="autoplay",i=!1;e[n].prototype["_addon_"+r]=function(){i||(e[n]._c,e[n]._d,t=e[n]._e,e[n]._f,e[n]._g,t.add("mouseover mouseout"),i=!0);var a=this,o=this.opts[r];o.play&&(this.opts.infinite=!0,this.nodes.$wrpr.on(t.sliding,(function(){a.autoplay()})),o.pauseOnHover&&this.nodes.$wrpr.on(t.mouseover,(function(){a.autostop()})).on(t.mouseout,(function(){a.autoplay()})),this.autoplay())},e[n].prototype.autoplay=function(){var e=this;this.autostop(),this.vars.autoplay=setTimeout((function(){e.next()}),this.opts[r].timeout)},e[n].prototype.autostop=function(){this.vars.autoplay&&clearTimeout(this.vars.autoplay)},e[n].defaults[r]={play:!1,timeout:4e3,pauseOnHover:!1},e[n].addons.push(r)}(jQuery),function(e){function t(t,n){return e('<a class="'+r[t]+n+'" href="#"><span></span></a>')}function n(e,t,n,r){t.on(i.click,(function(t){t.preventDefault(),t.stopPropagation(),e.trigger(i[n],[r])}))}var r,i,a="tosrus",o="buttons",s=!1;e[a].prototype["_addon_"+o]=function(){s||(r=e[a]._c,e[a]._d,i=e[a]._e,e[a]._f,e[a]._g,r.add("prev next close disabled"),s=!0);var l=this,c=this.opts[o];this.nodes.$prev=null,this.nodes.$next=null,this.nodes.$clse=null,("boolean"==typeof c||"string"==typeof c&&"inline"==c)&&(c={prev:c,next:c}),void 0===c.close&&(c.close=this.vars.fixed),this.nodes.$slides.length<2&&(c.prev=!1,c.next=!1),e.each({prev:"prev",next:"next",close:"clse"},(function(a,o){c[a]&&("string"==typeof c[a]&&"inline"==c[a]?l.vars.fixed&&"close"!=a&&l.nodes.$slides.on(i.loading,(function(){var i=t(a," "+r.inline)["prev"==a?"prependTo":"appendTo"](this);n(l.nodes.$wrpr,i,a,1),l.opts.infinite||("prev"==a&&e(this).is(":first-child")||"next"==a&&e(this).is(":last-child"))&&i.addClass(r.disabled)})):("string"==typeof c[a]&&(c[a]=e(c[a])),l.nodes["$"+o]=c[a]instanceof e?c[a]:t(a,"").appendTo(l.nodes.$wrpr),n(l.nodes.$wrpr,l.nodes["$"+o],a,null)))})),this.opts.infinite||(this.updateButtons(),this.nodes.$wrpr.on(i.sliding,(function(){l.updateButtons()})))},e[a].prototype.updateButtons=function(){this.nodes.$prev&&this.nodes.$prev[(this.slides.index<1?"add":"remove")+"Class"](r.disabled),this.nodes.$next&&this.nodes.$next[(this.slides.index>=this.slides.total-this.slides.visible?"add":"remove")+"Class"](r.disabled)},e[a].defaults[o]={prev:!e[a].support.touch,next:!e[a].support.touch},e[a].addons.push(o),e[a].ui.push("prev"),e[a].ui.push("next"),e[a].ui.push("close")}(jQuery),function(e){var t,n,r,i="tosrus",a="caption",o=!1;e[i].prototype["_addon_"+a]=function(){o||(t=e[i]._c,n=e[i]._d,r=e[i]._e,e[i]._f,e[i]._g,t.add("caption uibg"),n.add("caption"),o=!0);var s=this,l=this.opts[a];if(l.add){l.attributes=l.attributes||[],"string"==typeof l.target&&(l.target=e(l.target)),l.target instanceof e?this.nodes.$capt=l.target:(this.nodes.$capt=e('<div class="'+t.caption+'" />').appendTo(this.nodes.$wrpr),this.nodes.$uibg||(this.nodes.$uibg=e('<div class="'+t.uibg+'" />').prependTo(this.nodes.$wrpr)));for(var c=0,u=this.slides.visible;u>c;c++)e('<div class="'+t.caption+"-"+c+'" />').css("width",this.opts.slides.width+(this.slides.widthPercentage?"%":"px")).appendTo(this.nodes.$capt);this.nodes.$slides.each((function(){var t=e(this),r=s.vars.fixed?t.data(n.anchor):t.children();t.data(n.caption,"");for(var i=0,a=l.attributes.length;a>i;i++){var o=r.attr(l.attributes[i]);if(o&&o.length){t.data(n.caption,o);break}}})),this.nodes.$wrpr.on(r.sliding,(function(){for(var e=0,t=s.slides.visible;t>e;e++)s.nodes.$capt.children().eq(e).html(s.nodes.$sldr.children().eq(s.slides.index+e).data(n.caption)||"")}))}},e[i].defaults[a]={add:!1,target:null,attributes:["title","alt","rel"]},e[i].addons.push(a),e[i].ui.push("caption")}(jQuery),function(e){if("function"==typeof Hammer){var t,n,r,i="tosrus",a="drag",o=!1;e[i].prototype["_addon_"+a]=function(){o||(t=e[i]._c,e[i]._d,n=e[i]._e,r=e[i]._f,e[i]._g,o=!0);var s=this;if(this.opts[a]&&"slide"==this.opts.effect){if(Hammer.VERSION<2)return void e[i].deprecated("Older version of the Hammer library","version 2 or newer");if(this.nodes.$slides.length>1){var l=0,c=!1,u=!1;new Hammer(this.nodes.$wrpr[0]).on("panstart panleft panright panend swipeleft swiperight",(function(e){e.preventDefault()})).on("panstart",(function(){s.nodes.$sldr.addClass(t.noanimation)})).on("panleft panright",(function(e){switch(l=e.deltaX,u=!1,e.direction){case 2:c="left";break;case 4:c="right";break;default:c=!1}("left"==c&&s.slides.index+s.slides.visible>=s.slides.total||"right"==c&&0==s.slides.index)&&(l/=2.5),s.nodes.$sldr.css("margin-left",Math.round(l))})).on("swipeleft swiperight",(function(){u=!0})).on("panend",(function(){if(s.nodes.$sldr.removeClass(t.noanimation).addClass(t.fastanimation),r.transitionend(s.nodes.$sldr,(function(){s.nodes.$sldr.removeClass(t.fastanimation)}),s.conf.transitionDuration/2),s.nodes.$sldr.css("margin-left",0),"left"==c||"right"==c){if(u)var e=s.slides.visible;else{var i=s.nodes.$slides.first().width();e=Math.floor((Math.abs(l)+i/2)/i)}e>0&&s.nodes.$wrpr.trigger(n["left"==c?"next":"prev"],[e])}c=!1}))}}},e[i].defaults[a]=e[i].support.touch,e[i].addons.push(a)}}(jQuery),function(e){var t,n="tosrus",r="keys",i=!1;e[n].prototype["_addon_"+r]=function(){i||(e[n]._c,e[n]._d,t=e[n]._e,e[n]._f,e[n]._g,t.add("keyup"),i=!0);var a=this,o=this.opts[r];if("boolean"==typeof o&&o&&(o={prev:!0,next:!0,close:!0}),e.isPlainObject(o)){for(var s in e[n].constants[r])"boolean"==typeof o[s]&&o[s]&&(o[s]=e[n].constants[r][s]);this.nodes.$slides.length<2&&(o.prev=!1,o.next=!1),e(document).on(t.keyup,(function(e){if(a.vars.opened){var n=!1;switch(e.keyCode){case o.prev:n=t.prev;break;case o.next:n=t.next;break;case o.close:n=t.close}n&&(e.preventDefault(),e.stopPropagation(),a.nodes.$wrpr.trigger(n))}}))}},e[n].defaults[r]=!1,e[n].constants[r]={prev:37,next:39,close:27},e[n].addons.push(r)}(jQuery),function(e){var t,n,r,i="tosrus",a="pagination",o=!1;e[i].prototype["_addon_"+a]=function(){o||(t=e[i]._c,n=e[i]._d,r=e[i]._e,e[i]._f,e[i]._g,t.add("pagination selected uibg bullets thumbnails"),o=!0);var s=this,l=this.opts[a];if(this.nodes.$slides.length<2&&(l.add=!1),l.add){if("string"==typeof l.target&&(l.target=e(l.target)),l.target instanceof e?this.nodes.$pagr=l.target:(this.nodes.$pagr=e('<div class="'+t.pagination+" "+t[l.type]+'" />').appendTo(this.nodes.$wrpr),this.nodes.$uibg||(this.nodes.$uibg=e('<div class="'+t.uibg+'" />').prependTo(this.nodes.$wrpr))),"function"!=typeof l.anchorBuilder)if("thumbnails"===l.type){var c='<a href="#" style="background-image: url(',u=');"></a>';l.anchorBuilder=this.vars.fixed?function(){return c+e(this).data(n.anchor).attr("href")+u}:function(){return c+e(this).find("img").attr("src")+u}}else l.anchorBuilder=function(){return'<a href="#"></a>'};this.nodes.$slides.each((function(t){e(l.anchorBuilder.call(this,t+1)).appendTo(s.nodes.$pagr).on(r.click,(function(e){e.preventDefault(),e.stopPropagation(),s.nodes.$wrpr.trigger(r.slideTo,[t])}))})),this.updatePagination(),this.nodes.$wrpr.on(r.sliding,(function(){s.updatePagination()}))}},e[i].prototype.updatePagination=function(){this.nodes.$pagr&&this.nodes.$pagr.children().removeClass(t.selected).eq(this.slides.index).addClass(t.selected)},e[i].defaults[a]={add:!1,type:"bullets",target:null,anchorBuilder:null},e[i].addons.push(a),e[i].ui.push("pagination"),e[i].ui.push("bullets"),e[i].ui.push("thumbnails")}(jQuery),function(e){var t="tosrus",n="html";e[t].media[n]={filterAnchors:function(t){var n=t.attr("href");return"#"==n.slice(0,1)&&e(n).is("div")},initAnchors:function(n,r){e('<div class="'+e[t]._c("html")+'" />').append(e(r)).appendTo(n),n.removeClass(e[t]._c.loading).trigger(e[t]._e.loaded)},filterSlides:function(e){return e.is("div")},initSlides:function(){}},e[t].defaults.media[n]={}}(jQuery),function(e){var t="tosrus",n="image";e[t].media[n]={filterAnchors:function(t){return e.inArray(t.attr("href").toLowerCase().split(".").pop().split("?")[0],["jpg","jpe","jpeg","gif","png"])>-1},initAnchors:function(n,r){e('<img border="0" />').on(e[t]._e.load,(function(r){r.stopPropagation(),n.removeClass(e[t]._c.loading).trigger(e[t]._e.loaded)})).appendTo(n).attr("src",r)},filterSlides:function(e){return e.is("img")},initSlides:function(){}},e[t].defaults.media[n]={}}(jQuery),function(e){function t(t){function u(){d.length&&(d.attr("src",""),d.attr("src",p))}c||(n=e[s]._c,r=e[s]._d,i=e[s]._e,a=e[s]._f,o=e[s]._g,r.add("ratio maxWidth maxHeight"),c=!0);var d=t.children(),f=t.data(e[s]._d.anchor)||e(),p=d.attr("src"),h=f.data(r.ratio)||this.opts[l].ratio,m=f.data(r.maxWidth)||this.opts[l].maxWidth,g=f.data(r.maxHeight)||this.opts[l].maxHeight;t.removeClass(n.loading).trigger(i.loaded).on(i.loading,(function(){a.resizeRatio(d,t,m,g,h)})),this.nodes.$wrpr.on(i.sliding,(function(){u()})).on(i.closing,(function(){u()})),o.$wndw.on(i.resize,(function(){a.resizeRatio(d,t,m,g,h)}))}var n,r,i,a,o,s="tosrus",l="vimeo",c=!1;e[s].media[l]={filterAnchors:function(e){return e.attr("href").toLowerCase().indexOf("vimeo.com/")>-1},initAnchors:function(n,r){var i=this._uniqueID();r=r.split("vimeo.com/")[1].split("?")[0]+"?api=1&player_id="+i,e('<iframe id="'+i+'" src="http://player.vimeo.com/video/'+r+'" frameborder="0" allowfullscreen />').appendTo(n),t.call(this,n)},filterSlides:function(e){return!(!e.is("iframe")||!e.attr("src"))&&e.attr("src").toLowerCase().indexOf("vimeo.com/video/")>-1},initSlides:function(e){t.call(this,e)}},e[s].defaults.media[l]={},e[s].defaults[l]={ratio:16/9,maxWidth:!1,maxHeight:!1}}(jQuery),function(e){function t(t){function u(e){d.length&&d[0].contentWindow.postMessage('{ "event": "command", "func": "'+e+'Video" }',"*")}c||(n=e[s]._c,r=e[s]._d,i=e[s]._e,a=e[s]._f,o=e[s]._g,r.add("ratio maxWidth maxHeight"),c=!0);var d=t.children(),f=t.data(e[s]._d.anchor)||e(),p=f.data(r.ratio)||this.opts[l].ratio,h=f.data(r.maxWidth)||this.opts[l].maxWidth,m=f.data(r.maxHeight)||this.opts[l].maxHeight;t.removeClass(n.loading).trigger(i.loaded).on(i.loading,(function(){a.resizeRatio(d,t,h,m,p)})),this.nodes.$wrpr.on(i.sliding,(function(){u("pause")})).on(i.closing,(function(){u("stop")})),o.$wndw.on(i.resize,(function(){a.resizeRatio(d,t,h,m,p)}))}var n,r,i,a,o,s="tosrus",l="youtube",c=!1;e[s].media[l]={filterAnchors:function(e){return e.attr("href").toLowerCase().indexOf("youtube.com/watch?v=")>-1},initAnchors:function(n,r){var i=r;r=r.split("?v=")[1].split("&")[0],this.opts[l].imageLink?(r="http://img.youtube.com/vi/"+r+"/0.jpg",e('<a href="'+i+'" class="'+e[s]._c("play")+'" target="_blank" />').appendTo(n),e('<img border="0" />').on(e[s]._e.load,(function(t){t.stopPropagation(),n.removeClass(e[s]._c.loading).trigger(e[s]._e.loaded)})).appendTo(n).attr("src",r)):(e('<iframe src="http://www.youtube.com/embed/'+r+'?enablejsapi=1" frameborder="0" allowfullscreen />').appendTo(n),t.call(this,n))},filterSlides:function(e){return!(!e.is("iframe")||!e.attr("src"))&&e.attr("src").toLowerCase().indexOf("youtube.com/embed/")>-1},initSlides:function(e){t.call(this,e)}},e[s].defaults.media[l]={},e[s].defaults[l]={ratio:16/9,maxWidth:!1,maxHeight:!1,imageLink:e[s].support.touch}}(jQuery),
/*!
 *  CodeMirror
   Generated on 05/03/2020
   Version: 5.52.0

   CodeMirror Library:
   - codemirror.js
   Modes:
   - css.js
   - htmlmixed.js
   - javascript.js
   - sql.js
   - xml.js
   Add-ons:
   - match-brackets.js
   - active-line.js
   - fullscreen.js
 */
function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),l=!a&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!a&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),C=d&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(d=!1,l=!0);var x=b&&(c||d&&(null==C||C<12.11)),k=n||o&&s>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,T=function(e,t){var n=e.className,r=P(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function W(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return W(e).appendChild(t)}function L(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function A(e,t,n,r){var i=L(e,t,n,r);return i.setAttribute("role","presentation"),i}function _(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function O(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function I(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}S=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var F=function(e){e.select()};function M(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function N(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function R(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var a=r||0,o=i||0;;){var s=e.indexOf("\t",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}m?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(F=function(e){try{e.select()}catch(e){}});var q=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};function B(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var z=30,$={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},H={origin:"*mouse"},U={origin:"+move"};function V(e,t,n){for(var r=0,i=0;;){var a=e.indexOf("\t",r);-1==a&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,r=a+1,(i+=n-i%n)>=t)return r}}var G=[""];function Q(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function X(){}function J(e,t){var n;return Object.create?n=Object.create(e):(X.prototype=e,n=new X),t&&N(t,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}var se=null;function le(e,t,n){var r;se=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&"before"==n?r=i:se=i),a.from==t&&(a.from!=a.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var ce=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function a(e,t,n){this.level=e,this.from=t,this.to=n}return function(o,s){var l="ltr"==s?"L":"R";if(0==o.length||"ltr"==s&&!e.test(o))return!1;for(var c,u=o.length,d=[],f=0;f<u;++f)d.push((c=o.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var p=0,h=l;p<u;++p){var m=d[p];"m"==m?d[p]=h:h=m}for(var g=0,v=l;g<u;++g){var b=d[g];"1"==b&&"r"==v?d[g]="n":n.test(b)&&(v=b,"r"==b&&(d[g]="R"))}for(var y=1,w=d[0];y<u-1;++y){var C=d[y];"+"==C&&"1"==w&&"1"==d[y+1]?d[y]="1":","!=C||w!=d[y+1]||"1"!=w&&"n"!=w||(d[y]=w),w=C}for(var x=0;x<u;++x){var k=d[x];if(","==k)d[x]="N";else if("%"==k){var P=void 0;for(P=x+1;P<u&&"%"==d[P];++P);for(var S=x&&"!"==d[x-1]||P<u&&"1"==d[P]?"1":"N",T=x;T<P;++T)d[T]=S;x=P-1}}for(var W=0,E=l;W<u;++W){var L=d[W];"L"==E&&"1"==L?d[W]="L":n.test(L)&&(E=L)}for(var A=0;A<u;++A)if(t.test(d[A])){var _=void 0;for(_=A+1;_<u&&t.test(d[_]);++_);for(var D="L"==(A?d[A-1]:l),O=D==("L"==(_<u?d[_]:l))?D?"L":"R":l,I=A;I<_;++I)d[I]=O;A=_-1}for(var F,M=[],N=0;N<u;)if(r.test(d[N])){var R=N;for(++N;N<u&&r.test(d[N]);++N);M.push(new a(0,R,N))}else{var q=N,B=M.length,z="rtl"==s?1:0;for(++N;N<u&&"L"!=d[N];++N);for(var $=q;$<N;)if(i.test(d[$])){q<$&&(M.splice(B,0,new a(1,q,$)),B+=z);var j=$;for(++$;$<N&&i.test(d[$]);++$);M.splice(B,0,new a(2,j,$)),B+=z,q=$}else++$;q<N&&M.splice(B,0,new a(1,q,N))}return"ltr"==s&&(1==M[0].level&&(F=o.match(/^\s+/))&&(M[0].from=F[0].length,M.unshift(new a(0,0,F[0].length))),1==Y(M).level&&(F=o.match(/\s+$/))&&(Y(M).to-=F[0].length,M.push(new a(0,u-F[0].length,u)))),"rtl"==s?M.reverse():M}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=ce(e.text,t)),n}var de=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function pe(e,t){return e._handlers&&e._handlers[t]||de}function he(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=B(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function me(e,t){var n=pe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ge(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),me(e,n||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==B(n,t[r])&&n.push(t[r])}function be(e,t){return pe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function we(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ke(e){we(e),Ce(e)}function Pe(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Te,We,Ee=function(){if(o&&s<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==Te){var t=L("span","​");E(e,L("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=Te?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=We)return We;var t=E(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return W(e),!(!n||n.left==n.right)&&(We=r.right-n.right<3)}var _e,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var a=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),o=a.indexOf("\r");-1!=o?(n.push(a.slice(0,o)),t+=o+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(_e=L("div"))||(_e.setAttribute("oncopy","return;"),"function"==typeof _e.oncopy),Fe=null;var Me={},Ne={};function Re(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Me[e]=t}function qe(e){if("string"==typeof e&&Ne.hasOwnProperty(e))e=Ne[e];else if(e&&"string"==typeof e.name&&Ne.hasOwnProperty(e.name)){var t=Ne[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Be(e,t){t=qe(t);var n=Me[t.name];if(!n)return Be(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var i=ze[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var ze={};function $e(e,t){N(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function He(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ue(e,t,n){return!e.startState||e.startState(t,n)}var Ve=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function Qe(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i})),r}function Ye(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ke(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Xe(e){if(null==e.parent)return null;for(var t=e.parent,n=B(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Je(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function Ze(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,n){if(void 0===n&&(n=null),!(this instanceof tt))return new tt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function nt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==nt(e,t)}function it(e){return tt(e.line,e.ch)}function at(e,t){return nt(e,t)<0?t:e}function ot(e,t){return nt(e,t)<0?e:t}function st(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(e,t){if(t.line<e.first)return tt(e.first,0);var n=e.first+e.size-1;return t.line>n?tt(n,Ge(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,Ge(e,t.line).text.length)}function ct(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}Ve.prototype.eol=function(){return this.pos>=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ve.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ve.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],a={};Ct(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Ct(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var a=i[n+1];i[n+1]=(a?a+" ":"")+"overlay "+t}}),a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function pt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ht(e,Xe(t)),i=t.text.length>e.options.maxHighlightLength&&je(e.doc.mode,r.state),a=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new dt(r,!0,t);var a=function(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var l=Ge(a,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ut?c.lookAhead:0)<=a.modeFrontier))return s;var u=R(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),o=a>r.first&&Ge(r,a-1).stateAfter,s=o?dt.fromSaved(r,o,a):new dt(r,Ue(r.mode),a);return r.iter(a,t,(function(n){mt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function mt(e,t,n,r){var i=e.doc.mode,a=new Ve(t,e.options.tabSize,n);for(a.start=a.pos=r||0,""==t&&gt(i,n.state);!a.eol();)vt(i,a,n.state),a.start=a.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=He(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function vt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=He(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,n){return t instanceof ut?new dt(e,je(e.mode,t.state),n,t.lookAhead):new dt(e,je(e.mode,t),n)},dt.prototype.save=function(e){var t=!1!==e?je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,a,o=e.doc,s=o.mode,l=Ge(o,(t=lt(o,t)).line),c=ht(e,t.line,n),u=new Ve(l.text,e.options.tabSize,c);for(r&&(a=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=vt(s,u,c.state),r&&a.push(new bt(u,i,je(o.mode,c.state)));return r?a:new bt(u,i,c.state)}function wt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ct(e,t,n,r,i,a,o){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new Ve(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&wt(gt(n,r.state),a);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,o&&mt(e,t,r,d.pos),d.pos=t.length,l=null):l=wt(vt(n,d,r.state,f),a),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}var xt=!1,kt=!1;function Pt(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Tt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Wt(e,t){if(t.full)return null;var n=Ze(e,t.from.line)&&Ge(e,t.from.line).markedSpans,r=Ze(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=0==nt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&"bookmark"==o.type&&(!n||!a.marker.insertLeft)){var s=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Pt(o,a.from,s?null:a.to))}}return r}(n,i,o),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(null==a.to||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&"bookmark"==o.type&&(!n||a.marker.insertLeft)){var s=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Pt(o,s?null:a.from-t,null==a.to?null:a.to-t))}}return r}(r,a,o),c=1==t.text.length,u=Y(t.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var p=St(l,f.marker);p?c&&(f.to=null==p.to?null:p.to+u):f.to=i}}if(l)for(var h=0;h<l.length;++h){var m=l[h];if(null!=m.to&&(m.to+=u),null==m.from)St(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m));else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=Et(s)),l&&l!=s&&(l=Et(l));var g=[s];if(!c){var v,b=t.text.length-2;if(b>0&&s)for(var y=0;y<s.length;++y)null==s[y].to&&(v||(v=[])).push(new Pt(s[y].marker,null,null));for(var w=0;w<b;++w)g.push(v);g.push(l)}return g}function Et(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Lt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function _t(e){return e.inclusiveLeft?-1:0}function Dt(e){return e.inclusiveRight?1:0}function Ot(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),a=nt(r.from,i.from)||_t(e)-_t(t);if(a)return-a;var o=nt(r.to,i.to)||Dt(e)-Dt(t);return o||t.id-e.id}function It(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=void 0,a=0;a<r.length;++a)(i=r[a]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ot(n,i.marker)<0)&&(n=i.marker);return n}function Ft(e){return It(e,!0)}function Mt(e){return It(e,!1)}function Nt(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(null==a.from||a.from<t)&&(null==a.to||a.to>t)&&(!n||Ot(n,a.marker)<0)&&(n=a.marker)}return n}function Rt(e,t,n,r,i){var a=Ge(e,t),o=kt&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(l.marker.collapsed){var c=l.marker.find(0),u=nt(c.from,n)||_t(l.marker)-_t(i),d=nt(c.to,r)||Dt(l.marker)-Dt(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?nt(c.to,n)>=0:nt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?nt(c.from,r)<=0:nt(c.from,r)<0)))return!0}}}function qt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function Bt(e,t){var n=Ge(e,t),r=qt(n);return n==r?t:Xe(r)}function zt(e,t){if(t>e.lastLine())return t;var n,r=Ge(e,t);if(!$t(e,r))return t;for(;n=Mt(r);)r=n.find(1,!0).line;return Xe(r)+1}function $t(e,t){var n=kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&jt(e,t,r))return!0}}function jt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return jt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if((i=t.markedSpans[a]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&jt(e,t,i))return!0}function Ht(e){for(var t=0,n=(e=qt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;a=(n=a).parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function Ut(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Ft(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Mt(r);){var a=t.find(0,!0);n-=r.text.length-a.from.ch,n+=(r=a.to.line).text.length-a.to.ch}return n}function Vt(e){var t=e.display,n=e.doc;t.maxLine=Ge(n,n.first),t.maxLineLength=Ut(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Ut(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Gt=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function Qt(e){e.parent=null,Lt(e)}Gt.prototype.lineNo=function(){return Xe(this)},ye(Gt);var Yt={},Kt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:Yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var n=A("span",null,null,l?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=en,Ae(e.display.measure)&&(o=ue(a,e.doc.direction))&&(r.addToken=tn(r.addToken,o)),r.map=[],rn(a,r,pt(e,a,t!=e.display.externalMeasured&&Xe(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=I(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=I(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Le(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=I(r.pre.className,r.textClass||"")),r}function Zt(e){var t=L("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,i,a,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);" "!=a||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(a=" "),r+=a,n=" "==a}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){c=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));o&&s<9?c.appendChild(L("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var v=void 0;if("\t"==h[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(L("span",Q(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(L("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),o&&s<9?c.appendChild(L("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),o&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||f||a){var w=n||"";r&&(w+=r),i&&(w+=i);var C=L("span",[c],w,a);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&C.setAttribute(x,l[x]);return e.content.appendChild(C)}e.content.appendChild(c)}}function tn(e,t){return function(n,r,i,a,o,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>c&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,a,o,s,l);e(n,r.slice(0,d.to-c),i,a,null,s,l),a=null,r=r.slice(d.to-c),c=d.to}}}function nn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(r)for(var o,s,l,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=c=u=s="",f=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;w<r.length;++w){var C=r[w],x=C.marker;if("bookmark"==x.type&&C.from==h&&x.widgetNode)b.push(x);else if(C.from<=h&&(null==C.to||C.to>h||x.collapsed&&C.to==h&&C.from==h)){if(null!=C.to&&C.to!=h&&v>C.to&&(v=C.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&C.from==h&&(u+=" "+x.startStyle),x.endStyle&&C.to==v&&(y||(y=[])).push(x.endStyle,C.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var k in x.attributes)(f||(f={}))[k]=x.attributes[k];x.collapsed&&(!d||Ot(d.marker,x)<0)&&(d=C)}else C.from>h&&v>C.from&&(v=C.from)}if(y)for(var P=0;P<y.length;P+=2)y[P+1]==v&&(c+=" "+y[P]);if(!d||d.from==h)for(var S=0;S<b.length;++S)nn(t,0,b[S]);if(d&&(d.from||0)==h){if(nn(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=p)break;for(var T=Math.min(p,v);;){if(g){var W=h+g.length;if(!d){var E=W>T?g.slice(0,T-h):g;t.addToken(t,E,o?o+l:l,u,h+E.length==v?c:"",s,f)}if(W>=T){g=g.slice(T-h),h=T;break}h=W,u=""}g=i.slice(a,a=n[m++]),o=Xt(n[m++],t.cm.options)}}else for(var L=1;L<n.length;L+=2)t.addToken(t,i.slice(a,a=n[L]),Xt(n[L+1],t.cm.options))}function an(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Mt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Xe(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=$t(e,t)}function on(e,t,n){for(var r,i=[],a=t;a<n;a=r){var o=new an(e.doc,Ge(e.doc,a),a);r=a+o.size,i.push(o)}return i}var sn=null;var ln=null;function cn(e,t){var n=pe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(un,0));for(var a=function(e){r.push((function(){return n[e].apply(null,i)}))},o=0;o<n.length;++o)a(o)}}function un(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];"text"==a?hn(e,t):"gutter"==a?gn(e,t,n,r):"class"==a?mn(e,t):"widget"==a&&vn(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=L("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function pn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Jt(e,t)}function hn(e,t){var n=t.text.className,r=pn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,mn(e,t)):n&&(t.text.className=n)}function mn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=fn(t);t.background=r.insertBefore(L("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?fn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=fn(t);t.gutterBackground=L("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=fn(t),s=t.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(L("div",et(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=a.hasOwnProperty(c)&&a[c];u&&s.appendChild(L("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=P("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);yn(e,t,n)}function bn(e,t,n,r){var i=pn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),mn(e,t),gn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(wn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)wn(e,t.rest[r],t,n,!1)}function wn(e,t,n,r,i){if(t.widgets)for(var a=fn(n),o=0,s=t.widgets;o<s.length;++o){var l=s[o],c=L("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Cn(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?a.insertBefore(c,n.gutter||n.text):a.appendChild(c),cn(l,"redraw")}}function Cn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),E(t.display.measure,L("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t){for(var n=Pe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Pn(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Tn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,L("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Wn(e){return z-e.display.nativeBarWidth}function En(e){return e.display.scroller.clientWidth-Wn(e)-e.display.barWidth}function Ln(e){return e.display.scroller.clientHeight-Wn(e)-e.display.barHeight}function An(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Xe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function _n(e,t,n,r){return In(e,On(e,t),n,r)}function Dn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function On(e,t){var n=Xe(t),r=Dn(e,n);r&&!r.text?r=null:r&&r.changes&&(dn(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Xe(t=qt(t)),r=e.display.externalMeasured=new an(e.doc,t,n);r.lineN=n;var i=r.built=Jt(e,r);return r.text=i.pre,E(e.display.lineMeasure,i.pre),r}(e,t));var i=An(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function In(e,t,n,r,i){t.before&&(n=-1);var a,l=n+(r||"");return t.cache.hasOwnProperty(l)?a=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,n){var r=e.options.lineWrapping,i=r&&En(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],c=o[s+1];Math.abs(l.bottom-c.bottom)>2&&a.push((l.bottom+c.top)/2-n.top)}}a.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),a=function(e,t,n,r){var i,a=Nn(t.map,n,r),l=a.node,c=a.start,u=a.end,d=a.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;c&&ie(t.line.text.charAt(a.coverStart+c));)--c;for(;a.coverStart+u<a.coverEnd&&ie(t.line.text.charAt(a.coverStart+u));)++u;if((i=o&&s<9&&0==c&&u==a.coverEnd-a.coverStart?l.parentNode.getBoundingClientRect():Rn(S(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,d="right"}o&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=E(e,L("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return Fe=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;c>0&&(d=r="right"),i=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(o&&s<9&&!c&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ar(e.display),top:h.top,bottom:h.bottom}:Mn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var w=y?b[y-1]:0,C=b[y],x={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:C};i.left||i.right||(x.bogus=!0);e.options.singleCursorHeightPerLine||(x.rtop=m,x.rbottom=g);return x}(e,t,n,r),a.bogus||(t.cache[l]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Fn,Mn={left:0,right:0,top:0,bottom:0};function Nn(e,t,n){for(var r,i,a,o,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,a=1,o="left"):t<l?a=(i=t-s)+1:(c==e.length-3||t==l&&e[c+3]>t)&&(i=(a=l-s)-1,t>=l&&(o="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(o=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],o="left";if("right"==n&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:l}}function Rn(e,t){var n=Mn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function qn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Bn(e){e.display.externalMeasure=null,W(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qn(e.display.view[t])}function zn(e){Bn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function $n(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function Un(e,t,n,r,i){if(!i){var a=Hn(t);n.top+=a,n.bottom+=a}if("line"==r)return n;r||(r="local");var o=Ht(t);if("local"==r?o+=Pn(e.display):o-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+("window"==r?0:jn());var l=s.left+("window"==r?0:$n());n.left+=l,n.right+=l}return n.top+=o,n.bottom+=o,n}function Vn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=$n(),i-=jn();else if("local"==n||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Gn(e,t,n,r,i){return r||(r=Ge(e.doc,t.line)),Un(e,r,_n(e,r,t.ch,i),n)}function Qn(e,t,n,r,i,a){function o(t,o){var s=In(e,i,t,o?"right":"left",a);return o?s.left=s.right:s.right=s.left,Un(e,r,s,n)}r=r||Ge(e.doc,t.line),i||(i=On(e,r));var s=ue(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return o("before"==c?l-1:l,"before"==c);function u(e,t,n){return o(n?e-1:e,1==s[t].level!=n)}var d=le(s,l,c),f=se,p=u(l,d,"before"==c);return null!=f&&(p.other=u(l,f,"before"!=c)),p}function Yn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=ar(e.display)*t.ch);var r=Ge(e.doc,t.line),i=Ht(r)+Pn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Kn(e,t,n,r,i){var a=tt(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var i=Je(r,n),a=r.first+r.size-1;if(i>a)return Kn(r.first+r.size-1,Ge(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=Ge(r,i);;){var s=tr(e,o,i,t,n),l=Nt(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;o=Ge(r,i=c.line)}}function Jn(e,t,n,r){r-=Hn(t);var i=t.text.length,a=oe((function(t){return In(e,n,t-1).bottom<=r}),i,0);return{begin:a,end:i=oe((function(t){return In(e,n,t).top>r}),a,i)}}function Zn(e,t,n,r){return n||(n=On(e,t)),Jn(e,t,n,Un(e,t,In(e,n,r),"line").top)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,i){i-=Ht(t);var a=On(e,t),o=Hn(t),s=0,l=t.text.length,c=!0,u=ue(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?rr:nr)(e,t,n,a,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var f,p,h=null,m=null,g=oe((function(t){var n=In(e,a,t);return n.top+=o,n.bottom+=o,!!er(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),v=!1;if(m){var b=r-m.left<m.right-r,y=b==c;g=h+(y?0:1),p=y?"after":"before",f=b?m.left:m.right}else{c||g!=l&&g!=s||g++,p=0==g?"after":g==t.text.length?"before":In(e,a,g-(c?1:0)).bottom+o<=i==c?"after":"before";var w=Qn(e,tt(n,g,p),"line",t,a);f=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return Kn(n,g=ae(t.text,g,1),p,v,r-f)}function nr(e,t,n,r,i,a,o){var s=oe((function(s){var l=i[s],c=1!=l.level;return er(Qn(e,tt(n,c?l.to:l.from,c?"before":"after"),"line",t,r),a,o,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Qn(e,tt(n,c?l.from:l.to,c?"after":"before"),"line",t,r);er(u,a,o,!0)&&u.top>o&&(l=i[s-1])}return l}function rr(e,t,n,r,i,a,o){var s=Jn(e,t,r,o),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=c||p.to<=l)){var h=In(e,r,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=h<a?a-h+1e9:h-a;(!u||d>m)&&(u=p,d=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fn){Fn=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Fn.appendChild(document.createTextNode("x")),Fn.appendChild(L("br"));Fn.appendChild(document.createTextNode("x"))}E(e.measure,Fn);var n=Fn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),W(e.measure),n||1}function ar(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),n=L("pre",[t],"CodeMirror-line-like");E(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:sr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ar(e.display)-3);return function(i){if($t(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function cr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ke(e,t)}))}function ur(e,t,n,r){var i=e.display;if(!n&&"true"==Pe(t).getAttribute("cm-not-content"))return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(t){return null}var l,c=Xn(e,a,o);if(r&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=R(l,l.length,e.options.tabSize)-l.length;c=tt(c.line,Math.max(0,Math.round((a-Tn(e.display).left)/ar(e.display))-u))}return c}function dr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function fr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)kt&&Bt(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)kt&&zt(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var a=mr(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var o=mr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):hr(e)}else{var s=mr(e,t,t,-1),l=mr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):hr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function pr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[dr(e,t)];if(null!=a.node){var o=a.changes||(a.changes=[]);-1==B(o,n)&&o.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function mr(e,t,n,r){var i,a=dr(e,t),o=e.display.view;if(!kt||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var s=e.display.viewFrom,l=0;l<a;l++)s+=o[l].size;if(s!=t){if(r>0){if(a==o.length-1)return null;i=s+o[a].size-t,a++}else i=s-t;t+=i,n+=i}for(;Bt(e.doc,n)!=n;){if(a==(r<0?0:o.length-1))return null;n+=r*o[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function gr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function br(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(t||o!=n.sel.primIndex){var s=n.sel.ranges[o];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&yr(e,s.head,i),l||Cr(e,s,a)}}return r}function yr(e,t,n){var r=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(L("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var a=n.appendChild(L("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(e,t){return e.top-t.top||e.left-t.left}function Cr(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=Tn(e.display),s=o.left,l=Math.max(r.sizerWidth,En(e)-r.sizer.offsetLeft)-o.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n                             height: "+(r-t)+"px"))}function d(t,n,r){var a,o,d=Ge(i,t),f=d.text.length;function p(n,r){return Gn(e,tt(t,n),"div",d,r)}function h(t,n,r){var i=Zn(e,d,null,t),a="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),a)[a]}var m=ue(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),1==o.level?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,d){var g="ltr"==i,v=p(e,g?"left":"right"),b=p(t-1,g?"right":"left"),y=null==n&&0==e,w=null==r&&t==f,C=0==d,x=!m||d==m.length-1;if(b.top-v.top<=3){var k=(c?w:y)&&x,P=(c?y:w)&&C?s:(g?v:b).left,S=k?l:(g?b:v).right;u(P,v.top,S-P,v.bottom)}else{var T,W,E,L;g?(T=c&&y&&C?s:v.left,W=c?l:h(e,i,"before"),E=c?s:h(t,i,"after"),L=c&&w&&x?l:b.right):(T=c?h(e,i,"before"):s,W=!c&&y&&C?l:v.right,E=!c&&w&&x?s:b.left,L=c?h(t,i,"after"):l),u(T,v.top,W-T,v.bottom),v.bottom<b.top&&u(s,v.bottom,null,b.top),u(E,b.top,L-E,b.bottom)}(!a||wr(v,a)<0)&&(a=v),wr(b,a)<0&&(a=b),(!o||wr(v,o)<0)&&(o=v),wr(b,o)<0&&(o=b)})),{start:a,end:o}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var h=Ge(i,f.line),m=Ge(i,p.line),g=qt(h)==qt(m),v=d(f.line,f.ch,g?h.text.length+1:null).end,b=d(p.line,g?0:null,p.ch).start;g&&(v.top<b.top-2?(u(v.right,v.top,null,v.bottom),u(s,b.top,b.left,b.bottom)):u(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&u(s,v.bottom,null,b.top)}n.appendChild(a)}function xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function kr(e){e.state.focused||(e.display.input.focus(),Sr(e))}function Pr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Tr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,O(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function Tr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Wr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],a=e.options.lineWrapping,l=void 0,c=0;if(!i.hidden){if(o&&s<8){var u=i.node.offsetTop+i.node.offsetHeight;l=u-n,n=u}else{var d=i.node.getBoundingClientRect();l=d.bottom-d.top,!a&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-l;if((f>.005||f<-.005)&&(Ke(i.line,l),Er(i.line),i.rest))for(var p=0;p<i.rest.length;p++)Er(i.rest[p]);if(c>e.display.sizerWidth){var h=Math.ceil(c/ar(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Er(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Lr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Pn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,a=Je(t,r),o=Je(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<a?(a=s,o=Je(t,Ht(Ge(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(a=Je(t,Ht(Ge(t,l))-e.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function Ar(e,t){var n=e.display,r=ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,a=Ln(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+Sn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)o.scrollTop=l?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(c?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=En(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left-(p?0:10)):t.right>f+d-3&&(o.scrollLeft=t.right+(p?0:10)-f),o}function _r(e,t){null!=t&&(Ir(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Dr(e){Ir(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Or(e,t,n){null==t&&null==n||Ir(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ir(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fr(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Fr(e,t,n,r){var i=Ar(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Or(e,i.scrollLeft,i.scrollTop)}function Mr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ci(e,{top:t}),Nr(e,t,!0),n&&ci(e),ii(e,100))}function Nr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Rr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function qr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Wn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Br=function(e,t,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},Br.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var zr=function(){};function $r(e,t){t||(t=qr(e));var n=e.display.barWidth,r=e.display.barHeight;jr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Wr(e),jr(e,qr(e)),n=e.display.barWidth,r=e.display.barHeight}function jr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Hr={native:Br,null:zr};function Ur(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Rr(e,t):Mr(e,t)}),e),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)}var Vr=0;function Gr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vr},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Yr(t[n]);for(var r=0;r<t.length;r++)Kr(t[r]);for(var i=0;i<t.length;i++)Xr(t[i]);for(var a=0;a<t.length;a++)Jr(t[a]);for(var o=0;o<t.length;o++)Zr(t[o])}(e)}))}function Yr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Wn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Wn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Vt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kr(e){e.updatedDisplay=e.mustUpdate&&si(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Wr(t),e.barMeasure=qr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_n(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Wn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-En(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&$r(t,e.barMeasure),e.updatedDisplay&&di(t,e.barMeasure),e.selectionChanged&&xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&kr(e.cm)}function Zr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&li(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Nr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Rr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=Qn(e,t),l=n&&n!=t?Qn(e,n):s,c=Ar(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Mr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=c.scrollLeft&&(Rr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var a=L("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Pn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Wn(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||me(a[s],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&me(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&me(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ei(e,t){if(e.curOp)return t();Gr(e);try{return t()}finally{Qr(e)}}function ti(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gr(e);try{return t.apply(e,arguments)}finally{Qr(e)}}}function ni(e){return function(){if(this.curOp)return e.apply(this,arguments);Gr(this);try{return e.apply(this,arguments)}finally{Qr(this)}}}function ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gr(t);try{return e.apply(this,arguments)}finally{Qr(t)}}}function ii(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(ai,e))}function ai(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?je(t.mode,r.state):null,l=ft(e,a,r,!0);s&&(r.state=s),a.styles=l.styles;var c=a.styleClasses,u=l.classes;u?a.styleClasses=u:c&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&mt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ii(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ei(e,(function(){for(var t=0;t<i.length;t++)pr(e,i[t],"text")}))}}var oi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Lr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=En(e),this.force=n,this.dims=or(e),this.events=[]};function si(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(e))return!1;pi(e)&&(hr(e),t.dims=or(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),kt&&(a=Bt(e.doc,a),o=zt(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(dr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,dr(e,n)))),r.viewTo=n}(e,a,o),n.viewOffset=Ht(Ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=gr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!_(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var f=c[d];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;o!=f.node;)o=s(o);var p=i&&null!=t&&t<=u&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(p=!1),dn(e,f,u,n)),p&&(W(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),o=f.node.nextSibling}else{var h=bn(e,f,u,n);a.insertBefore(h,o)}u+=f.size}for(;o;)o=s(o)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),W(n.cursorDiv),W(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ii(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=En(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Ln(e),n.top)}),t.visible=Lr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&si(e,t);r=!1){Wr(e);var i=qr(e);vr(e),$r(e,i),di(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ci(e,t){var n=new oi(e,t);if(si(e,n)){Wr(e),li(e,n);var r=qr(e);vr(e),$r(e,r),di(e,r),n.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function di(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Wn(e)+"px"}function fi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=sr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function pi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=et(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(L("div",[L("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ui(e.display),!0}return!1}function hi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if("string"!=typeof a&&(o=a.style,a=a.className),"CodeMirror-linenumbers"==a){if(!t)continue;r=!0}n.push({className:a,style:o})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function mi(e){var t=e.gutters,n=e.gutterSpecs;W(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(L("div",null,"CodeMirror-gutter "+a));o&&(s.style.cssText=o),"CodeMirror-linenumbers"==a&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ui(e)}function gi(e){mi(e.display),fr(e),fi(e)}function vi(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=A("div",null,"CodeMirror-code"),a.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=L("div",null,"CodeMirror-cursors"),a.measure=L("div",null,"CodeMirror-measure"),a.lineMeasure=L("div",null,"CodeMirror-measure"),a.lineSpace=A("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var c=A("div",[a.lineSpace],"CodeMirror-lines");a.mover=L("div",[c],null,"position: relative"),a.sizer=L("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=L("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),a.gutters=L("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=L("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=L("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),l||n&&v||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=hi(i.gutters,i.lineNumbers),mi(a),r.init(a)}oi.prototype.signal=function(e,t){be(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)me.apply(null,this.events[e])};var bi=0,yi=null;function wi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Ci(e){var t=wi(e);return t.x*=yi,t.y*=yi,t}function xi(e,t){var r=wi(t),i=r.x,a=r.y,o=e.display,s=o.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||a&&u){if(a&&b&&l)e:for(var f=t.target,p=o.view;f!=s;f=f.parentNode)for(var h=0;h<p.length;h++)if(p[h].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=yi)return a&&u&&Mr(e,Math.max(0,s.scrollTop+a*yi)),Rr(e,Math.max(0,s.scrollLeft+i*yi)),(!a||a&&u)&&we(t),void(o.wheelStartX=null);if(a&&null!=yi){var m=a*yi,g=e.doc.scrollTop,v=g+o.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),ci(e,{top:g,bottom:v})}bi<20&&(null==o.wheelStartX?(o.wheelStartX=s.scrollLeft,o.wheelStartY=s.scrollTop,o.wheelDX=i,o.wheelDY=a,setTimeout((function(){if(null!=o.wheelStartX){var e=s.scrollLeft-o.wheelStartX,t=s.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(yi=(yi*bi+n)/(bi+1),++bi)}}),200)):(o.wheelDX+=i,o.wheelDY+=a))}}o?yi=-.53:n?yi=15:u?yi=-.7:f&&(yi=-1/3);var ki=function(e,t){this.ranges=e,this.primIndex=t};ki.prototype.primary=function(){return this.ranges[this.primIndex]},ki.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!rt(n.anchor,r.anchor)||!rt(n.head,r.head))return!1}return!0},ki.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Pi(it(this.ranges[t].anchor),it(this.ranges[t].head));return new ki(e,this.primIndex)},ki.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ki.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(nt(t,r.from())>=0&&nt(e,r.to())<=0)return n}return-1};var Pi=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=B(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],l=nt(s.to(),o.from());if(r&&!o.empty()?l>0:l>=0){var c=ot(s.from(),o.from()),u=at(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new Pi(d?u:c,d?c:u))}}return new ki(t,n)}function Ti(e,t){return new ki([new Pi(e,t||e)],0)}function Wi(e){return e.text?tt(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ei(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Wi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Wi(t).ch-t.to.ch),tt(n,r)}function Li(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Pi(Ei(i.anchor,t),Ei(i.head,t)))}return Si(e.cm,n,e.sel.primIndex)}function Ai(e,t,n){return e.line==t.line?tt(n.line,e.ch-t.ch+n.ch):tt(n.line+(e.line-t.line),e.ch)}function _i(e){e.doc.mode=Be(e.options,e.doc.modeOption),Di(e)}function Di(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ii(e,100),e.state.modeGen++,e.curOp&&fr(e)}function Oi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Lt(e),At(e,n);var i=r?r(e):1;i!=e.height&&Ke(e,i)}(e,n,i,r),cn(e,"change",e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new Gt(c[a],i(a),r));return n}var s=t.from,l=t.to,c=t.text,u=Ge(e,s.line),d=Ge(e,l.line),f=Y(c),p=i(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(Oi(e,t)){var m=o(0,c.length-1);a(d,d.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)a(u,u.text.slice(0,s.ch)+f+u.text.slice(l.ch),p);else{var g=o(1,c.length-1);g.push(new Gt(f+u.text.slice(l.ch),p,r)),a(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)a(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,h);else{a(u,u.text.slice(0,s.ch)+c[0],i(0)),a(d,f+d.text.slice(l.ch),p);var v=o(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}cn(e,"change",e,t)}function Fi(e,t,n){!function e(r,i,a){if(r.linked)for(var o=0;o<r.linked.length;++o){var s=r.linked[o];if(s.doc!=i){var l=a&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Mi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,cr(e),_i(e),Ni(e),e.options.lineWrapping||Vt(e),e.options.mode=t.modeOption,fr(e)}function Ni(e){("rtl"==e.doc.direction?O:T)(e.display.lineDiv,"CodeMirror-rtl")}function Ri(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function qi(e,t){var n={from:it(t.from),to:Wi(t),text:Qe(e,t.from,t.to)};return Hi(e,n,t.from.line,t.to.line+1),Fi(e,(function(e){return Hi(e,n,t.from.line,t.to.line+1)}),!0),n}function Bi(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function zi(e,t,n,r){var i=e.history;i.undone.length=0;var a,o,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=function(e,t){return t?(Bi(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))o=Y(a.changes),0==nt(t.from,t.to)&&0==nt(t.from,o.to)?o.to=Wi(t):a.changes.push(qi(e,t));else{var l=Y(i.done);for(l&&l.ranges||ji(e.sel,i.done),a={changes:[qi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,o||me(e,"historyAdded")}function $i(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,a,Y(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function ji(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hi(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=n.markedSpans),++a}))}function Ui(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Vi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ui(n[i]));return r}(e,t),r=Wt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)e:for(var s=0;s<o.length;++s){for(var l=o[s],c=0;c<a.length;++c)if(a[c].marker==l.marker)continue e;a.push(l)}else o&&(n[i]=o)}return n}function Gi(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges)r.push(n?ki.prototype.deepCopy.call(a):a);else{var o=a.changes,s=[];r.push({changes:s});for(var l=0;l<o.length;++l){var c=o[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(Y(s)[d]=c[d],delete c[d])}}}return r}function Qi(e,t,n,r){if(r){var i=e.anchor;if(n){var a=nt(t,i)<0;a!=nt(n,i)<0?(i=t,t=n):a!=nt(t,n)<0&&(t=n)}return new Pi(i,t)}return new Pi(n||t,t)}function Yi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),ea(e,new ki([Qi(e.sel.primary(),t,n,i)],0),r)}function Ki(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Qi(e.sel.ranges[a],t[a],null,i);ea(e,Si(e.cm,r,e.sel.primIndex),n)}function Xi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,ea(e,Si(e.cm,i,e.sel.primIndex),r)}function Ji(e,t,n,r){ea(e,Ti(t,n),r)}function Zi(e,t,n){var r=e.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=t,ta(e,t,n)):ea(e,t,n)}function ea(e,t,n){ta(e,t,n),$i(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ta(e,t,n){(be(e,"beforeSelectionChange")||e.cm&&be(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Pi(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return me(e,"beforeSelectionChange",e,r),e.cm&&me(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Si(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);na(e,ia(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Dr(e.cm)}function na(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),cn(e,"cursorActivity",e))}function ra(e){na(e,ia(e,e.sel,null,!1))}function ia(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],l=oa(e,o.anchor,s&&s.anchor,n,r),c=oa(e,o.head,s&&s.head,n,r);(i||l!=o.anchor||c!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Pi(l,c))}return i?Si(e.cm,i,t.primIndex):t}function aa(e,t,n,r,i){var a=Ge(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(me(l,"beforeCursorEnter"),l.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(d=sa(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=nt(d,n))&&(r<0?f<0:f>0))return aa(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=sa(e,p,r,p.line==t.line?a:null)),p?aa(e,p,t,r,i):null}}return t}function oa(e,t,n,r,i){var a=r||1,o=aa(e,t,n,a,i)||!i&&aa(e,t,n,a,!0)||aa(e,t,n,-a,i)||!i&&aa(e,t,n,-a,!0);return o||(e.cantEdit=!0,tt(e.first,0))}function sa(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:n>0&&t.ch==(r||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+n)}function la(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),j)}function ca(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),i&&(r.text=i),void 0!==a&&(r.origin=a)}),me(e,"beforeChange",e,r),e.cm&&me(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ua(e,t,n){if(e.cm){if(!e.cm.curOp)return ti(e.cm,ua)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"))||(t=ca(e,t,!0))){var r=xt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),l=0;l<i.length;++l){var c=i[l];if(!(nt(c.to,s.from)<0||nt(c.from,s.to)>0)){var u=[l,1],d=nt(c.from,s.from),f=nt(c.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)da(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else da(e,t)}}function da(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Li(e,t);zi(e,t,n,e.cm?e.cm.curOp.id:NaN),ha(e,t,n,Wt(e,t));var r=[];Fi(e,(function(e,n){n||-1!=B(r,e.history)||(ba(e.history,t),r.push(e.history)),ha(e,t,null,Wt(e,t))}))}}function fa(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,a=e.history,o=e.sel,s="undo"==t?a.done:a.undone,l="undo"==t?a.undone:a.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(a.lastOrigin=a.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(ji(i,l),n&&!i.equals(e.sel))return void ea(e,i,{clearRedo:!1});o=i}var u=[];ji(o,l),l.push({changes:u,generation:a.generation}),a.generation=i.generation||++a.maxGeneration;for(var d=be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!ca(e,r,!1))return s.length=0,{};u.push(qi(e,r));var a=n?Li(e,r):Y(s);ha(e,r,a,Vi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Wi(r)});var o=[];Fi(e,(function(e,t){t||-1!=B(o,e.history)||(ba(e.history,r),o.push(e.history)),ha(e,r,null,Vi(e,r))}))},p=i.changes.length-1;p>=0;--p){var h=f(p);if(h)return h.v}}}}function pa(e,t){if(0!=t&&(e.first+=t,e.sel=new ki(K(e.sel.ranges,(function(e){return new Pi(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)pr(e.cm,r,"gutter")}}function ha(e,t,n,r){if(e.cm&&!e.cm.curOp)return ti(e.cm,ha)(e,t,n,r);if(t.to.line<e.first)pa(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);pa(e,i),t={from:tt(e.first,0),to:tt(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:tt(a,Ge(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qe(e,t.from,t.to),n||(n=Li(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,l=a.line;e.options.lineWrapping||(l=Xe(qt(Ge(r,a.line))),r.iter(l,o.line+1,(function(e){if(e==i.maxLine)return s=!0,!0})));r.sel.contains(t.from,t.to)>-1&&ve(e);Ii(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(l,a.line+t.text.length,(function(e){var t=Ut(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ge(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}})(r,a.line),ii(e,400);var c=t.text.length-(o.line-a.line)-1;t.full?fr(e):a.line!=o.line||1!=t.text.length||Oi(e.doc,t)?fr(e,a.line,o.line+1,c):pr(e,a.line,"text");var u=be(e,"changes"),d=be(e,"change");if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&cn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Ii(e,t,r),ta(e,n,j),e.cantEdit&&oa(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}}function ma(e,t,n,r,i){var a;r||(r=n),nt(r,n)<0&&(n=(a=[r,n])[0],r=a[1]),"string"==typeof t&&(t=e.splitLines(t)),ua(e,{from:n,to:r,text:t,origin:i})}function ga(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function va(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||((a=e[i]=a.deepCopy()).copied=!0);for(var s=0;s<a.ranges.length;s++)ga(a.ranges[s].anchor,t,n,r),ga(a.ranges[s].head,t,n,r)}else{for(var l=0;l<a.changes.length;++l){var c=a.changes[l];if(n<c.from.line)c.from=tt(c.from.line+r,c.from.ch),c.to=tt(c.to.line+r,c.to.ch);else if(t<=c.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}}function ba(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;va(e.done,n,r,i),va(e.undone,n,r,i)}function ya(e,t,n,r){var i=t,a=t;return"number"==typeof t?a=Ge(e,st(e,t)):i=Xe(t),null==i?null:(r(a,i)&&e.cm&&pr(e.cm,i,n),a)}function wa(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function Ca(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Pi.prototype.from=function(){return ot(this.anchor,this.head)},Pi.prototype.to=function(){return at(this.anchor,this.head)},Pi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Qt(i),cn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},Ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e),s=i.height;if(i.removeInner(e,o),n.height-=s-i.height,a==o&&(n.children.splice(r--,1),i.parent=null),0==(t-=o))break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wa))){var l=[];this.collapse(l),this.children=[new wa(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var a=r.children[i],o=a.chunkSize();if(e<=o){if(a.insertInner(e,t,n),a.lines&&a.lines.length>50){for(var s=a.lines.length%25+25,l=s;l<a.lines.length;){var c=new wa(a.lines.slice(l,l+=25));a.height-=c.height,r.children.splice(++i,0,c),c.parent=r}a.lines=a.lines.slice(0,s),r.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Ca(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=B(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new Ca(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if(0==(t-=o))break;e=0}else e-=a}}};var xa=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function ka(e,t,n){Ht(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_r(e,n)}xa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Xe(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=xn(this);Ke(n,Math.max(0,n.height-a)),e&&(ei(e,(function(){ka(e,n,-a),pr(e,r,"widget")})),cn(e,"lineWidgetCleared",e,this,r))}},xa.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=xn(this)-t;i&&($t(this.doc,r)||Ke(r,r.height+i),n&&ei(n,(function(){n.curOp.forceUpdate=!0,ka(n,r,i),cn(n,"lineWidgetChanged",n,e,Xe(r))})))},ye(xa);var Pa=0,Sa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Pa};function Ta(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){r=N(r),r.shared=!1;var a=[Ta(e,t,n,r,i)],o=a[0],s=r.widgetNode;return Fi(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(Ta(e,lt(e,t),lt(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;o=Y(a)})),new Wa(a,o)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ti(e.cm,Ta)(e,t,n,r,i);var a=new Sa(e,i),o=nt(t,n);if(r&&N(r,a,!1),o>0||0==o&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Rt(e,t.line,t,n,a)||t.line!=n.line&&Rt(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");kt=!0}a.addToHistory&&zi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&a.collapsed&&!c.options.lineWrapping&&qt(e)==c.display.maxLine&&(s=!0),a.collapsed&&l!=t.line&&Ke(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Pt(a,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),a.collapsed&&e.iter(t.line,n.line+1,(function(t){$t(e,t)&&Ke(t,0)})),a.clearOnEnter&&fe(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Pa,a.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),a.collapsed)fr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)pr(c,u,"text");a.atomic&&ra(c.doc),cn(c,"markerAdded",c,a)}return a}Sa.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&Gr(t),be(this,"clear")){var r=this.find();r&&cn(this,"clear",r.from,r.to)}for(var i=null,a=null,o=0;o<this.lines.length;++o){var s=e.lines[o],l=St(s.markedSpans,e);t&&!e.collapsed?pr(t,Xe(s),"text"):t&&(null!=l.to&&(a=Xe(s)),null!=l.from&&(i=Xe(s))),s.markedSpans=Tt(s.markedSpans,l),null==l.from&&e.collapsed&&!$t(e.doc,s)&&t&&Ke(s,ir(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=qt(e.lines[c]),d=Ut(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&fr(t,i,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ra(t.doc)),t&&cn(t,"markerCleared",t,this,i,a),n&&Qr(t),this.parent&&this.parent.clear()}},Sa.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var a=this.lines[i],o=St(a.markedSpans,this);if(null!=o.from&&(n=tt(t?a:Xe(a),o.from),-1==e))return n;if(null!=o.to&&(r=tt(t?a:Xe(a),o.to),1==e))return r}return n&&{from:n,to:r}},Sa.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&ei(r,(function(){var i=t.line,a=Xe(t.line),o=Dn(r,a);if(o&&(qn(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!$t(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=xn(n)-s;l&&Ke(i,i.height+l)}cn(r,"markerChanged",r,e)}))},Sa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Sa.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Sa);var Wa=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ea(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),(function(e){return e.parent}))}function La(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Fi(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var a=n.markers[i];-1==B(r,a.doc)&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")}},Wa.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Wa);var Aa=0,_a=function(e,t,n,r,i){if(!(this instanceof _a))return new _a(e,t,n,r,i);null==n&&(n=0),Ca.call(this,[new wa([new Gt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=tt(n,0);this.sel=Ti(a),this.history=new Ri(null),this.id=++Aa,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ii(this,{from:a,to:a,text:e}),ea(this,Ti(a),j)};_a.prototype=J(Ca.prototype,{constructor:_a,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ye(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ri((function(e){var t=tt(this.first,0),n=this.first+this.size-1;ua(this,{from:t,to:tt(n,Ge(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Or(this.cm,0,0),ea(this,Ti(t),j)})),replaceRange:function(e,t,n,r){ma(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=Qe(this,lt(this,e),lt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ze(this,e))return Ge(this,e)},getLineNumber:function(e){return Xe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(e,t,n){Ji(this,lt(this,"number"==typeof e?tt(e,t||0):e),null,n)})),setSelection:ri((function(e,t,n){Ji(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ri((function(e,t,n){Yi(this,lt(this,e),t&&lt(this,t),n)})),extendSelections:ri((function(e,t){Ki(this,ct(this,e),t)})),extendSelectionsBy:ri((function(e,t){Ki(this,ct(this,K(this.sel.ranges,e)),t)})),setSelections:ri((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Pi(lt(this,e[i].anchor),lt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ea(this,Si(this.cm,r,t),n)}})),addSelection:ri((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Pi(lt(this,e),lt(this,t||e))),ea(this,Si(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Qe(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Qe(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ri((function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=tt(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],l=Ai(s.from,i,a),c=Ai(Wi(s),i,a);if(i=s.to,a=c,"around"==n){var u=e.sel.ranges[o],d=nt(u.head,u.anchor)<0;r[o]=new Pi(d?c:l,d?l:c)}else r[o]=new Pi(l,l)}return new ki(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)ua(this,r[l]);s?Zi(this,s):this.cm&&Dr(this.cm)})),undo:ri((function(){fa(this,"undo")})),redo:ri((function(){fa(this,"redo")})),undoSelection:ri((function(){fa(this,"undo",!0)})),redoSelection:ri((function(){fa(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ri(this.history.maxGeneration),Fi(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gi(this.history.done),undone:Gi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ri(this.history.maxGeneration);t.done=Gi(e.done.slice(0),null,!0),t.undone=Gi(e.undone.slice(0),null,!0)},setGutterMarker:ri((function(e,t,n){return ya(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ri((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ya(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Ze(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Xe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ri((function(e,t,n){return ya(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(P(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ri((function(e,t,n){return ya(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var a=i.match(P(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(a.index&&o!=i.length?" ":"")+i.slice(o)||null}return!0}))})),addLineWidget:ri((function(e,t,n){return function(e,t,n,r){var i=new xa(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ya(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!$t(e,t)){var r=Ht(t)<e.scrollTop;Ke(t,t.height+xn(i)),r&&_r(a,i.height),a.curOp.forceUpdate=!0}return!0})),a&&cn(a,"lineWidgetAdded",a,i,"number"==typeof t?t:Xe(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ta(this,lt(this,e),lt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Ta(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ge(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var l=o[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n})),lt(this,tt(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new _a(Ye(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new _a(Ye(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(nt(a,o)){var s=Ta(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Ea(this)),r},unlinkDoc:function(e){var t=this;if(e instanceof Eo&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){if(t.linked[n].doc==e){t.linked.splice(n,1),e.unlinkDoc(t),La(Ea(t));break}}if(e.history==this.history){var r=[e.id];Fi(e,(function(e){return r.push(e.id)}),!0),e.history=new Ri(null),e.history.done=Gi(this.history.done,r),e.history.undone=Gi(this.history.undone,r)}},iterLinkedDocs:function(e){Fi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&ei(t=this.cm,(function(){Ni(t),fr(t)})))}))}),_a.prototype.eachLine=_a.prototype.iter;var Da=0;function Oa(e){var t=this;if(Ia(t),!ge(t,e)&&!kn(t.display,e)){we(e),o&&(Da=+new Date);var n=ur(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,l=function(){++s==i&&ti(t,(function(){var e={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(a.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ua(t.doc,e),Zi(t.doc,Ti(lt(t.doc,n),lt(t.doc,Wi(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(a[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),ta(t.doc,Ti(n,n)),f)for(var p=0;p<f.length;++p)ma(t.doc,"",f[p].anchor,f[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ia(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Fa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Ma=!1;function Na(){var e;Ma||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Fa(Ra)}),100))})),fe(window,"blur",(function(){return Fa(Tr)})),Ma=!0)}function Ra(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var qa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ba=0;Ba<10;Ba++)qa[Ba+48]=qa[Ba+96]=String(Ba);for(var za=65;za<=90;za++)qa[za]=String.fromCharCode(za);for(var $a=1;$a<=12;$a++)qa[$a+111]=qa[$a+63235]="F"+$a;var ja={};function Ha(e){var t,n,r,i,a=e.split(/-(?!$)/);e=a[a.length-1];for(var o=0;o<a.length-1;o++){var s=a[o];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ua(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=K(n.split(" "),Ha),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(" "),o=r):(s=i.slice(0,a+1).join(" "),o="...");var l=t[s];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+s)}else t[s]=o}delete e[n]}for(var c in t)e[c]=t[c];return e}function Va(e,t,n,r){var i=(t=Ka(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Va(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Va(e,t.fallthrough[a],n,r);if(o)return o}}}function Ga(e){var t="string"==typeof e?e:qa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Qa(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Ya(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=qa[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Qa(n,e,t))}function Ka(e){return"string"==typeof e?ja[e]:e}function Xa(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&nt(a.from,Y(r).to)<=0;){var o=r.pop();if(nt(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}ei(e,(function(){for(var t=r.length-1;t>=0;t--)ma(e.doc,"",r[t].from,r[t].to,"+delete");Dr(e)}))}function Ja(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Za(e,t,n){var r=Ja(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function eo(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var a=ue(n,t.doc.direction);if(a){var o,s=i<0?Y(a):a[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=On(t,n);o=i<0?n.text.length-1:0;var u=In(t,c,o).top;o=oe((function(e){return In(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,o),"before"==l&&(o=Ja(n,o,1))}else o=i<0?s.to:s.from;return new tt(r,o,l)}}return new tt(r,i<0?n.text.length:0,i<0?"before":"after")}ja.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ja.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ja.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ja.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ja.default=b?ja.macDefault:ja.pcDefault;var to={selectAll:la,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Xa(e,(function(t){if(t.empty()){var n=Ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Xa(e,(function(t){return{from:tt(t.from().line,0),to:lt(e.doc,tt(t.to().line+1,0))}}))},delLineLeft:function(e){return Xa(e,(function(e){return{from:tt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Xa(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Xa(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return no(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ro(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ge(e.doc,t),r=function(e){for(var t;t=Mt(e);)e=t.find(1,!0).line;return e}(n);r!=n&&(t=Xe(r));return eo(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),U)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),U)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ro(e,t.head):r}),U)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=R(e.getLine(a.line),a.ch,r);t.push(Q(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ei(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=Ge(e.doc,i.line).text;if(a)if(i.ch==a.length&&(i=new tt(i.line,i.ch-1)),i.ch>0)i=new tt(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Ge(e.doc,i.line-1).text;o&&(i=new tt(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),tt(i.line-1,o.length-1),i,"+transpose"))}n.push(new Pi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return ei(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Dr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function no(e,t){var n=Ge(e.doc,t),r=qt(n);return r!=n&&(t=Xe(r)),eo(!0,e,r,t,1)}function ro(e,t){var n=no(e,t.line),r=Ge(e.doc,n.line),i=ue(r,e.doc.direction);if(!i||0==i[0].level){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return tt(n.line,o?0:a,n.sticky)}return n}function io(e,t,n){if("string"==typeof t&&!(t=to[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=$}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var ao=new q;function oo(e,t,n,r){var i=e.state.keySeq;if(i){if(Ga(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ao.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),so(e,i+" "+t,n,r))return!0}return so(e,t,n,r)}function so(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Va(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Va(t,e.options.extraKeys,n,e)||Va(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&cn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(we(n),xr(e)),!!i}function lo(e,t){var n=Ya(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?oo(e,"Shift-"+n,t,(function(t){return io(e,t,!0)}))||oo(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return io(e,t)})):oo(e,n,t,(function(t){return io(e,t)})))}var co=null;function uo(e){var t=this;if(t.curOp.focus=D(),!ge(t,e)){o&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=lo(t,e);d&&(co=i?r:null,i||88!=r||Ie||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n))}O(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function fo(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function po(e){var t=this;if(!(kn(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==co)return co=null,void we(e);if(!d||e.which&&!(e.which<10)||!lo(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return oo(e,"'"+n+"'",t,(function(t){return io(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var ho,mo,go=function(e,t,n){this.time=e,this.pos=t,this.button=n};function vo(e){var t=this,n=t.display;if(!(ge(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,kn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!wo(t,e)){var r=ur(t,e),i=Se(e),a=r?function(e,t){var n=+new Date;return mo&&mo.compare(n,e,t)?(ho=mo=null,"triple"):ho&&ho.compare(n,e,t)?(mo=new go(n,e,t),ho=null,"double"):(ho=new go(n,e,t),mo=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var a="Click";"double"==r?a="Double"+a:"triple"==r&&(a="Triple"+a);return a=(1==t?"Left":2==t?"Middle":"Right")+a,oo(e,Qa(a,i),i,(function(t){if("string"==typeof t&&(t=to[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=$}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,a,e)||(1==i?r?function(e,t,n,r){o?setTimeout(M(kr,e),0):e.curOp.focus=D();var i,a=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var a=y?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey);null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey));return i}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Ee&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(nt((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(nt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,a=!1,c=ti(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,he(i.wrapper.ownerDocument,"mouseup",c),he(i.wrapper.ownerDocument,"mousemove",u),he(i.scroller,"dragstart",d),he(i.scroller,"drop",c),a||(we(t),r.addNew||Yi(e.doc,n,null,null,r.extend),l||o&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),u=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};l&&(i.scroller.draggable=!0);e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();fe(i.wrapper.ownerDocument,"mouseup",c),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",d),fe(i.scroller,"drop",c),Pr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,a):function(e,t,n,r){var i=e.display,a=e.doc;we(t);var o,s,l=a.sel,c=l.ranges;r.addNew&&!r.extend?(s=a.sel.contains(n),o=s>-1?c[s]:new Pi(n,n)):(o=a.sel.primary(),s=a.sel.primIndex);if("rectangle"==r.unit)r.addNew||(o=new Pi(n,n)),n=ur(e,t,!0,!0),s=-1;else{var u=bo(e,n,r.unit);o=r.extend?Qi(o,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,ea(a,Si(e,c.concat([o]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(ea(a,Si(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):Xi(a,s,o,H):(s=0,ea(a,new ki([o],0),H),l=a.sel);var d=n;function f(t){if(0!=nt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=R(Ge(a,n.line).text,n.ch,c),f=R(Ge(a,t.line).text,t.ch,c),p=Math.min(u,f),h=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ge(a,m).text,b=V(v,p,c);p==h?i.push(new Pi(tt(m,b),tt(m,b))):v.length>b&&i.push(new Pi(tt(m,b),tt(m,V(v,h,c))))}i.length||i.push(new Pi(n,n)),ea(a,Si(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=o,C=bo(e,t,r.unit),x=w.anchor;nt(C.anchor,x)>0?(y=C.head,x=ot(w.from(),C.anchor)):(y=C.anchor,x=at(w.to(),C.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,r=t.head,i=Ge(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var a=ue(i);if(!a)return t;var o=le(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=o+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==a.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new Pi(new tt(n.line,h,m),r)}(e,new Pi(lt(a,x),y)),ea(a,Si(e,k,s),H)}}var p=i.wrapper.getBoundingClientRect(),h=0;function m(t){var n=++h,o=ur(e,t,!0,"rectangle"==r.unit);if(o)if(0!=nt(o,d)){e.curOp.focus=D(),f(o);var s=Lr(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(ti(e,(function(){h==n&&m(t)})),150)}else{var l=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;l&&setTimeout(ti(e,(function(){h==n&&(i.scroller.scrollTop+=l,m(t))})),50)}}function g(t){e.state.selectingText=!1,h=1/0,t&&(we(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",b),a.history.lastSelOrigin=null}var v=ti(e,(function(e){0!==e.buttons&&Se(e)?m(e):g(e)})),b=ti(e,g);e.state.selectingText=b,fe(i.wrapper.ownerDocument,"mousemove",v),fe(i.wrapper.ownerDocument,"mouseup",b)}(e,r,t,a)}(t,r,a,e):Pe(e)==n.scroller&&we(e):2==i?(r&&Yi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):Pr(t)))}}function bo(e,t,n){if("char"==n)return new Pi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Pi(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Pi(r.from,r.to)}function yo(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&we(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!be(e,n))return xe(t);a-=s.top-o.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=o.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return me(e,n,e,Je(e.doc,a),e.display.gutterSpecs[l].className,t),xe(t)}}function wo(e,t){return yo(e,t,"gutterClick",!0)}function Co(e,t){kn(e.display,t)||function(e,t){if(!be(e,"gutterContextMenu"))return!1;return yo(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function xo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}go.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var ko={toString:function(){return"CodeMirror.Init"}},Po={},So={};function To(e,t,n){if(!t!=!(n&&n!=ko)){var r=e.display.dragFunctions,i=t?fe:he;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Wo(e){e.options.lineWrapping?(O(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),Vt(e)),cr(e),fr(e),zn(e),setTimeout((function(){return $r(e)}),100)}function Eo(e,t){var n=this;if(!(this instanceof Eo))return new Eo(e,t);this.options=t=t?N(t):{},N(Po,t,!1);var r=t.value;"string"==typeof r?r=new _a(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Eo.inputStyles[t.inputStyle](this),a=this.display=new vi(e,r,i,t);for(var c in a.wrapper.CodeMirror=this,xo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ur(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ti(e,vo)),fe(t.scroller,"dblclick",o&&s<11?ti(e,(function(t){if(!ge(e,t)){var n=ur(e,t);if(n&&!wo(e,t)&&!kn(e.display,t)){we(t);var r=e.findWordAt(n);Yi(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||we(t)});fe(t.scroller,"contextmenu",(function(t){return Co(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Co(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function a(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!a(i)&&!wo(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,o=e.coordsChar(t.activeTouch,"page");a=!r.prev||l(r,r.prev)?new Pi(o,o):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(o):new Pi(tt(o.line,0),lt(e.doc,tt(o.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),we(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Mr(e,t.scroller.scrollTop),Rr(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return xi(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||ke(t)},over:function(t){ge(e,t)||(!function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,r)}}(e,t),ke(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-Da<100))ke(t);else if(!ge(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=L("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:ti(e,Oa),leave:function(t){ge(e,t)||Ia(e)}};var c=t.input.getField();fe(c,"keyup",(function(t){return fo.call(e,t)})),fe(c,"keydown",ti(e,uo)),fe(c,"keypress",ti(e,po)),fe(c,"focus",(function(t){return Sr(e,t)})),fe(c,"blur",(function(t){return Tr(e,t)}))}(this),Na(),Gr(this),this.curOp.forceUpdate=!0,Mi(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(M(Sr,this),20):Tr(this),So)So.hasOwnProperty(c)&&So[c](n,t[c],ko);pi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Lo.length;++u)Lo[u](n);Qr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}Eo.defaults=Po,Eo.optionHandlers=So;var Lo=[];function Ao(e,t,n,r){var i,a=e.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?i=ht(e,t).state:n="prev");var o=e.options.tabSize,s=Ge(a,t),l=R(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=a.mode.indent(i,s.text.slice(u.length),s.text))==$||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>a.first?R(Ge(a,t-1).text,null,o):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/o);p;--p)f+=o,d+="\t";if(f<c&&(d+=Q(c-f)),d!=u)return ma(a,d,tt(t,0),tt(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<a.sel.ranges.length;h++){var m=a.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var g=tt(t,u.length);Xi(a,h,new Pi(g,g));break}}}Eo.defineInitHook=function(e){return Lo.push(e)};var _o=null;function Do(e){_o=e}function Oo(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,s="paste"==i||e.state.pasteIncoming>o,l=De(t),c=null;if(s&&r.ranges.length>1)if(_o&&_o.text.join("\n")==t){if(r.ranges.length%_o.text.length==0){c=[];for(var u=0;u<_o.text.length;u++)c.push(a.splitLines(_o.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=K(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=tt(h.line,h.ch-n):e.state.overwrite&&!s?m=tt(m.line,Math.min(Ge(a,m.line).text.length,m.ch+Y(l).length)):s&&_o&&_o.lineWise&&_o.text.join("\n")==t&&(h=m=tt(h.line,0)));var g={from:h,to:m,text:c?c[f%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};ua(e.doc,g),cn(e,"inputRead",e,g)}t&&!s&&Fo(e,t),Dr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Io(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ei(t,(function(){return Oo(t,n,0,null,"paste")})),!0}function Fo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ao(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ge(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ao(e,i.head.line,"smart"));o&&cn(e,"electricInput",e,i.head.line)}}}function Mo(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:tt(i,0),head:tt(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function No(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ro(){var e=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=L("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),No(e),t}function qo(e,t,n,r,i){var a=t,o=n,s=Ge(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(r){var a,o;if(a=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return Za(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=le(i,n.ch,n.sticky),o=i[a];if("ltr"==e.doc.direction&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return Za(t,n,r);var s,l=function(e,n){return Ja(t,e instanceof tt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||On(e,t),Zn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==o.level){var d=1==o.level==r<0,f=l(n,d?1:-1);if(null!=f&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?"before":"after";return new tt(n.line,f,p)}}var h=function(e,t,r){for(var a=function(e,t){return t?new tt(n.line,l(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e<i.length;e+=t){var o=i[e],s=t>0==(1!=o.level),c=s?r.begin:l(r.end,-1);if(o.from<=c&&c<o.to)return a(c,s);if(c=s?o.from:l(o.to,-1),r.begin<=c&&c<r.end)return a(c,s)}},m=h(a+r,r,u);if(m)return m;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):Za(s,t,n),null==a){if(r||(o=t.line+l)<e.first||o>=e.first+e.size||(t=new tt(o,t.ch,t.sticky),!(s=Ge(e,o))))return!1;t=eo(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var h=s.text.charAt(t.ch)||"\n",m=te(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var g=oa(e,t,a,o,!0);return rt(a,g)&&(g.hitSide=!0),g}function Bo(e,t,n,r){var i,a,o=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ir(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(a=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=o.height){a.hitSide=!0;break}i+=5*n}return a}var zo=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function $o(e,t){var n=Dn(e,t.line);if(!n||n.hidden)return null;var r=Ge(e.doc,t.line),i=An(n,r,t.line),a=ue(r,e.doc.direction),o="left";a&&(o=le(a,t.ch)%2?"right":"left");var s=Nn(i.map,t.ch,o);return s.offset="right"==s.collapse?s.end:s.start,s}function jo(e,t){return t&&(e.bad=!0),e}function Ho(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return jo(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return Uo(a,t,n)}}function Uo(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!_(r,t))return jo(tt(Xe(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Y(e.rest):e.line;return jo(tt(Xe(a),a.text.length),i)}var o=3==t.nodeType?t:null,s=t;for(o||1!=t.childNodes.length||3!=t.firstChild.nodeType||(o=t.firstChild,n&&(n=o.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var a=i<0?l.map:c[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==n){var u=Xe(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||s!=t)&&(d=a[o+(r?1:0)]),tt(u,d)}}}var d=u(o,s,n);if(d)return jo(d,i);for(var f=s.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0))return jo(tt(d.line,d.ch-p),i);p+=f.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1))return jo(tt(d.line,d.ch+m),i);m+=h.textContent.length}}zo.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function a(e){if(!ge(r,e)){if(r.somethingSelected())Do({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Mo(r);Do({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,j),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=_o.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var o=Ro(),s=o.firstChild;r.display.lineSpace.insertBefore(o,r.display.lineSpace.firstChild),s.value=_o.text.join("\n");var l=document.activeElement;F(s),setTimeout((function(){r.display.lineSpace.removeChild(o),l.focus(),l==i&&n.showPrimarySelection()}),50)}}No(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(i,"paste",(function(e){ge(r,e)||Io(e,r)||s<=11&&setTimeout(ti(r,(function(){return t.updateFromDOM()})),20)})),fe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(i,"touchstart",(function(){return n.forceCompositionEnd()})),fe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(i,"copy",a),fe(i,"cut",a)},zo.prototype.prepareSelection=function(){var e=br(this.cm,!1);return e.focus=this.cm.state.focused,e},zo.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},zo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zo.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom)e.removeAllRanges();else{var o=Ho(t,e.anchorNode,e.anchorOffset),s=Ho(t,e.focusNode,e.focusOffset);if(!o||o.bad||!s||s.bad||0!=nt(ot(o,s),i)||0!=nt(at(o,s),a)){var l=t.display.view,c=i.line>=t.display.viewFrom&&$o(t,i)||{node:l[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&$o(t,a);if(!u){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(c&&u){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=S(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},zo.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},zo.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},zo.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zo.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},zo.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},zo.prototype.blur=function(){this.div.blur()},zo.prototype.getField=function(){return this.div},zo.prototype.supportsTouch=function(){return!0},zo.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ei(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},zo.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zo.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ho(t,e.anchorNode,e.anchorOffset),r=Ho(t,e.focusNode,e.focusOffset);n&&r&&ei(t,(function(){ea(t.doc,Ti(n,r),j),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},zo.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,a=r.doc.sel.primary(),o=a.from(),s=a.to();if(0==o.ch&&o.line>r.firstLine()&&(o=tt(o.line-1,Ge(r.doc,o.line-1).length)),s.ch==Ge(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=tt(s.line+1,0)),o.line<i.viewFrom||s.line>i.viewTo-1)return!1;o.line==i.viewFrom||0==(e=dr(r,o.line))?(t=Xe(i.view[0].line),n=i.view[0].node):(t=Xe(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=dr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=Xe(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var a="",o=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){o&&(a+=s,l&&(a+=s),o=l=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var a,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(tt(r,0),tt(i+1,0),c(+p));return void(h.length&&(a=h[0].find(0))&&d(Qe(e.doc,a.from,a.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(o=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=n;)t=t.nextSibling,l=!1;return a}(r,n,c,t,l)),f=Qe(r.doc,tt(t,0),tt(l,Ge(r.doc,l).text.length));d.length>1&&f.length>1;)if(Y(d)==Y(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var b=Y(d),y=Y(f),w=Math.min(b.length-(1==d.length?p:0),y.length-(1==f.length?p:0));h<w&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)++h;if(1==d.length&&1==f.length&&t==o.line)for(;p&&p>o.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)p--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var C=tt(t,p),x=tt(l,f.length?Y(f).length-h:0);return d.length>1||d[0]||nt(C,x)?(ma(r.doc,d,C,x,"+input"),!0):void 0},zo.prototype.ensurePolled=function(){this.forceCompositionEnd()},zo.prototype.reset=function(){this.forceCompositionEnd()},zo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zo.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},zo.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ei(this.cm,(function(){return fr(e.cm)}))},zo.prototype.setUneditable=function(e){e.contentEditable="false"},zo.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Oo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},zo.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},zo.prototype.onContextMenu=function(){},zo.prototype.resetPosition=function(){},zo.prototype.needsContentAttribute=!0;var Vo=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Vo.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function a(e){if(!ge(r,e)){if(r.somethingSelected())Do({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Mo(r);Do({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,j):(n.prevInput="",i.value=t.text.join("\n"),F(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),fe(i,"input",(function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){ge(r,e)||Io(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",a),fe(i,"copy",a),fe(e.scroller,"paste",(function(t){if(!kn(e,t)&&!ge(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var a=new Event("paste");a.clipboardData=t.clipboardData,i.dispatchEvent(a)}})),fe(e.lineSpace,"selectstart",(function(t){kn(e,t)||we(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Vo.prototype.createField=function(e){this.wrapper=Ro(),this.textarea=this.wrapper.firstChild},Vo.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=br(e);if(e.options.moveInputWithCursor){var i=Qn(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},Vo.prototype.showSelection=function(e){var t=this.cm.display;E(t.cursorDiv,e.cursors),E(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vo.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&F(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",o&&s>=9&&(this.hasSelection=null))}},Vo.prototype.getField=function(){return this.textarea},Vo.prototype.supportsTouch=function(){return!1},Vo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vo.prototype.blur=function(){this.textarea.blur()},Vo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vo.prototype.receivedFocus=function(){this.slowPoll()},Vo.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Vo.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Vo.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(8203!=a||r||(r="​"),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l<c&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return ei(t,(function(){Oo(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Vo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vo.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},Vo.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=ur(n,e),c=r.scroller.scrollTop;if(a&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&ti(n,ea)(n.doc,Ti(a),j);var u,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),o&&s>=9&&g(),k){ke(e);var m=function(){he(window,"mouseup",m),setTimeout(v,20)};fe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),a="​"+(e?i.value:"");i.value="⇚",i.value=a,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!o||o&&s<9)&&g();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ti(n,la)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}},Vo.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Vo.prototype.setUneditable=function(){},Vo.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=ko&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ko,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,_i(e)}),!0),n("indentUnit",2,_i,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Di(e),zn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(-1==a)break;i=a+t.length,n.push(tt(r,a))}r++}));for(var i=n.length-1;i>=0;i--)ma(e.doc,t,n[i],tt(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ko&&e.refresh()})),n("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xo(e),gi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ka(t),i=n!=ko&&Ka(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Wo,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=hi(t,e.options.lineNumbers),gi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return $r(e)}),!0),n("scrollbarStyle","native",(function(e){Ur(e),$r(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=hi(e.options.gutters,t),gi(e)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(e){return e}),gi,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Tr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,To),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Di,!0),n("addModeClass",!1,Di,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Di,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Eo),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ti(this,t[e])(this,n,i),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ka(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ni((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,fr(this)})),removeOverlay:ni((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void fr(this)}})),indentLine:ni((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ze(this.doc,e)&&Ao(this,e,t,n)})),indentSelection:ni((function(e){for(var t=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var a=n[i];if(a.empty())a.head.line>r&&(Ao(t,a.head.line,e,!0),r=a.head.line,i==t.doc.sel.primIndex&&Dr(t));else{var o=a.from(),s=a.to(),l=Math.max(r,o.line);r=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var c=l;c<r;++c)Ao(t,c,e);var u=t.doc.sel.ranges;0==o.ch&&n.length==u.length&&u[i].from().ch>0&&Xi(t.doc,i,new Pi(o,u[i].to()),j)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=pt(this,Ge(this.doc,e.line)),r=0,i=(n.length-1)/2,a=e.ch;if(0==a)t=n[2];else for(;;){var o=r+i>>1;if((o?n[2*o-1]:0)>=a)i=o;else{if(!(n[2*o+1]<a)){t=n[2*o+2];break}r=o+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if("string"==typeof a[t])i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var s=i[a[t][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(a,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ht(this,(e=st(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Qn(this,null==e?n.head:"object"==typeof e?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Gn(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=Vn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Vn(this,{top:e,left:0},t||"page").top,Je(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,i=!0),r=Ge(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ht(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a,o,s,l=this.display,c=(e=Qn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),f=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(a=this,o={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Ar(a,o)).scrollTop&&Mr(a,s.scrollTop),null!=s.scrollLeft&&Rr(a,s.scrollLeft))},triggerOnKeyDown:ni(uo),triggerOnKeyPress:ni(po),triggerOnKeyUp:fo,triggerOnMouseDown:ni(vo),execCommand:function(e){if(to.hasOwnProperty(e))return to[e].call(null,this)},triggerElectric:ni((function(e){Fo(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=lt(this.doc,e),o=0;o<t&&!(a=qo(this.doc,a,i,n,r)).hitSide;++o);return a},moveH:ni((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?qo(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),U)})),deleteH:ni((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Xa(this,(function(n){var i=qo(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=lt(this.doc,e),s=0;s<t;++s){var l=Qn(this,o,"div");if(null==a?a=l.left:l.left=a,(o=Bo(this,l,i,n)).hitSide)break}return o},moveV:ni((function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(o){if(a)return e<0?o.from():o.to();var s=Qn(n,o.head,"div");null!=o.goalColumn&&(s.left=o.goalColumn),i.push(s.left);var l=Bo(n,s,e,t);return"page"==t&&o==r.sel.primary()&&_r(n,Gn(n,l,"div").top-s.top),l}),U),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var a=t.charAt(n),o=te(a,i)?function(e){return te(e,i)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};n>0&&o(t.charAt(n-1));)--n;for(;r<t.length&&o(t.charAt(r));)++r}return new Pi(tt(e.line,n),tt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?O(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),me(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ni((function(e,t){Or(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Wn(this)-this.display.barHeight,width:e.scrollWidth-Wn(this)-this.display.barWidth,clientHeight:Ln(this),clientWidth:En(this)}},scrollIntoView:ni((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:tt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Ir(e),e.curOp.scrollToPos=t}(this,e):Fr(this,e.from,e.to,e.margin)})),setSize:ni((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Bn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){pr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,me(this,"refresh",this)})),operation:function(e){return ei(this,e)},startOperation:function(){return Gr(this)},endOperation:function(){return Qr(this)},refresh:ni((function(){var e=this.display.cachedTextHeight;fr(this),this.curOp.forceUpdate=!0,zn(this),Or(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==e||Math.abs(e-ir(this.display))>.5)&&cr(this),me(this,"refresh",this)})),swapDoc:ni((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Mi(this,e),zn(this),this.display.input.reset(),Or(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}(Eo);var Go="iter insert remove copy getEditor constructor".split(" ");for(var Qo in _a.prototype)_a.prototype.hasOwnProperty(Qo)&&B(Go,Qo)<0&&(Eo.prototype[Qo]=function(e){return function(){return e.apply(this.doc,arguments)}}(_a.prototype[Qo]));return ye(_a),Eo.inputStyles={textarea:Vo,contenteditable:zo},Eo.defineMode=function(e){Eo.defaults.mode||"null"==e||(Eo.defaults.mode=e),Re.apply(this,arguments)},Eo.defineMIME=function(e,t){Ne[e]=t},Eo.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Eo.defineMIME("text/plain","null"),Eo.defineExtension=function(e,t){Eo.prototype[e]=t},Eo.defineDocExtension=function(e,t){_a.prototype[e]=t},Eo.fromTextArea=function(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Eo((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=fe,e.wheelEventPixels=Ci,e.Doc=_a,e.splitLines=De,e.countColumn=R,e.findColumn=V,e.isWordChar=ee,e.Pass=$,e.signal=me,e.Line=Gt,e.changeEnd=Wi,e.scrollbarModel=Hr,e.Pos=tt,e.cmpPos=nt,e.modes=Me,e.mimeModes=Ne,e.resolveMode=qe,e.getMode=Be,e.modeExtensions=ze,e.extendMode=$e,e.copyState=je,e.startState=Ue,e.innerMode=He,e.commands=to,e.keyMap=ja,e.keyName=Ya,e.isModifierKey=Ga,e.lookupKey=Va,e.normalizeKeyMap=Ua,e.StringStream=Ve,e.SharedTextMarker=Wa,e.TextMarker=Sa,e.LineWidget=xa,e.e_preventDefault=we,e.e_stopPropagation=Ce,e.e_stop=ke,e.addClass=O,e.contains=_,e.rmClass=T,e.keyNames=qa}(Eo),Eo.version="5.52.0",Eo})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var i,a,o=t.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},f=n.propertyKeywords||{},p=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},m=n.counterDescriptors||{},g=n.colorKeywords||{},v=n.valueKeywords||{},b=n.allowNested,y=n.lineComment,w=!0===n.supportsAtComponent;function C(e,t){return i=t,e}function x(e,t){var n=e.next();if(s[n]){var r=s[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),C("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?C(null,"compare"):'"'==n||"'"==n?(t.tokenize=k(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),C("atom","hash")):"!"==n?(e.match(/^\s*\w*/),C("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),C("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?C(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?C("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?C(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=P),C("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),C("property","word")):C(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),C("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?C("variable-2","variable-definition"):C("variable-2","variable")):e.match(/^\w+-/)?C("meta","meta"):void 0}function k(e){return function(t,n){for(var r,i=!1;null!=(r=t.next());){if(r==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==r}return(r==e||!i&&")"!=e)&&(n.tokenize=null),C("string","string")}}function P(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=k(")"),C(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function T(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:o),e.context),n}function W(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function E(e,t,n){return _[n.context.type](e,t,n)}function L(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return E(e,t,n)}function A(e){var t=e.current().toLowerCase();a=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var _={top:function(e,t,n){if("{"==e)return T(n,t,"block");if("}"==e&&n.context.prev)return W(n);if(w&&/@component/i.test(e))return T(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(n,t,"at");if("hash"==e)a="builtin";else if("word"==e)a="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return T(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return f.hasOwnProperty(r)?(a="property","maybeprop"):p.hasOwnProperty(r)?(a="string-2","maybeprop"):b?(a=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(a+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?_.top(e,t,n):(a="error","block")},maybeprop:function(e,t,n){return":"==e?T(n,t,"prop"):E(e,t,n)},prop:function(e,t,n){if(";"==e)return W(n);if("{"==e&&b)return T(n,t,"propBlock");if("}"==e||"{"==e)return L(e,t,n);if("("==e)return T(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return T(n,t,"interpolation")}else a+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?W(n):"word"==e?(a="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?L(e,t,n):")"==e?W(n):"("==e?T(n,t,"parens"):"interpolation"==e?T(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(a="variable-3",n.context.type):E(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(a="tag",n.context.type):_.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return T(n,t,"atBlock_parens");if("}"==e||";"==e)return L(e,t,n);if("{"==e)return W(n)&&T(n,t,b?"block":"top");if("interpolation"==e)return T(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();a="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":f.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"string-2":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?L(e,t,n):"{"==e?W(n)&&T(n,t,b?"block":"top",!1):("word"==e&&(a="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?W(n):"{"==e||"}"==e?L(e,t,n,2):_.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?T(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(a="variable","restricted_atBlock_before"):E(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,W(n)):"word"==e?(a="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(a="variable","keyframes"):"{"==e?T(n,t,"top"):E(e,t,n)},at:function(e,t,n){return";"==e?W(n):"{"==e||"}"==e?L(e,t,n):("word"==e?a="tag":"hash"==e&&(a="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?W(n):"{"==e||";"==e?L(e,t,n):("word"==e?a="variable":"variable"!=e&&"("!=e&&")"!=e&&(a="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||x)(e,t);return n&&"object"==typeof n&&(i=n[1],n=n[0]),a=n,"comment"!=i&&(t.state=_[t.state](i,e,t)),a},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-o)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(i),o=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(o),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=t(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(f),h=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),w=n.concat(i).concat(o).concat(l).concat(u).concat(f).concat(g).concat(b);function C(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:r,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=C,C(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=C,C(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=C,C(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=C,C(e,t))}},name:"css",helperType:"gss"})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}((function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var n={};function r(e,t){var r=e.match(function(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],a=i.length-1;a>=0;a--)r.unshift(i[a])}e.defineMode("htmlmixed",(function(n,o){var s=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),l={},c=o&&o.tags,u=o&&o.scriptTypes;if(a(t,l),c&&a(c,l),u)for(var d=u.length-1;d>=0;d--)l.script.unshift(["type",u[d].matches,u[d].mode]);function f(t,a){var o,c=s.token(t,a.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(t.current())&&(o=a.htmlState.tagName&&a.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(o))a.inTag=o+" ";else if(a.inTag&&u&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(a.inTag);a.inTag=null;var p=">"==t.current()&&function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(!i[0]||i[1].test(r(t,i[0])))return i[2]}}(l[d[1]],d[2]),h=e.getMode(n,p),m=i(d[1],!0),g=i(d[1],!1);a.token=function(e,t){return e.match(m,!1)?(t.token=f,t.localState=t.localMode=null,null):function(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,g,t.localMode.token(e,t.localState))},a.localMode=h,a.localState=e.startState(h,s.indent(a.htmlState,"",""))}else a.inTag&&(a.inTag+=t.current(),t.eol()&&(a.inTag+=" "));return c}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:e.startState(s)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?s.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||s}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,a=t.indentUnit,o=n.statementIndent,s=n.jsonld,l=n.json||s,c=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),a=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,n){return r=e,i=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(p))return t.tokenize=m,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=m),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return h("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),h("comment","comment")):Ye(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),h("regexp","string-2")):(e.eat("="),h("operator","operator",e.current()));if("`"==r)return t.tokenize=v,v(e,t);if("#"==r)return e.skipToEnd(),h("error","error");if("<"==r&&e.match("!--")||"-"==r&&e.match("->"))return e.skipToEnd(),h("comment","comment");if(f.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),h("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var a=d[i];return h(a.type,a.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return h("async","keyword",i)}return h("variable","variable",i)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return h("comment","comment")}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return h("quasi","string-2",e.current())}var b="([{}])";function y(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,a=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),l=b.indexOf(s);if(l>=0&&l<3){if(!i){++o;break}if(0==--i){"("==s&&(a=!0);break}}else if(l>=3&&l<6)++i;else if(u.test(s))a=!0;else if(/["'\/`]/.test(s))for(;;--o){if(0==o)return;if(e.string.charAt(o-1)==s&&"\\"!=e.string.charAt(o-2)){o--;break}}else if(a&&!i){++o;break}}a&&!i&&(t.fatArrowAt=o)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function C(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,null!=r&&(this.align=r)}function x(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var k={state:null,column:null,marked:null,cc:null};function P(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function S(){return P.apply(null,arguments),!0}function T(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function W(e){var t=k.state;if(k.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=E(e,t.context);if(null!=r)return void(t.context=r)}else if(!T(e,t.localVars))return void(t.localVars=new _(e,t.localVars));n.globalVars&&!T(e,t.globalVars)&&(t.globalVars=new _(e,t.globalVars))}function E(e,t){if(t){if(t.block){var n=E(e,t.prev);return n?n==t.prev?t:new A(n,t.vars,!0):null}return T(e,t.vars)?t:new A(t.prev,new _(e,t.vars),!1)}return null}function L(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function A(e,t,n){this.prev=e,this.vars=t,this.block=n}function _(e,t){this.name=e,this.next=t}var D=new _("this",new _("arguments",null));function O(){k.state.context=new A(k.state.context,k.state.localVars,!1),k.state.localVars=D}function I(){k.state.context=new A(k.state.context,k.state.localVars,!0),k.state.localVars=null}function F(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function M(e,t){var n=function(){var n=k.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new C(r,k.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function N(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function R(e){return function t(n){return n==e?S():";"==e||"}"==n||")"==n||"]"==n?P():S(t)}}function q(e,t){return"var"==e?S(M("vardef",t),we,R(";"),N):"keyword a"==e?S(M("form"),j,q,N):"keyword b"==e?S(M("form"),q,N):"keyword d"==e?k.stream.match(/^\s*$/,!1)?S():S(M("stat"),U,R(";"),N):"debugger"==e?S(R(";")):"{"==e?S(M("}"),I,se,N,F):";"==e?S():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==N&&k.state.cc.pop()(),S(M("form"),j,q,N,Te)):"function"==e?S(Ae):"for"==e?S(M("form"),We,q,N):"class"==e||c&&"interface"==t?(k.marked="keyword",S(M("form","class"==e?e:t),Fe,N)):"variable"==e?c&&"declare"==t?(k.marked="keyword",S(q)):c&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?S(Ge):"type"==t?S(De,R("operator"),fe,R(";")):S(M("form"),Ce,R("{"),M("}"),se,N,N)):c&&"namespace"==t?(k.marked="keyword",S(M("form"),z,q,N)):c&&"abstract"==t?(k.marked="keyword",S(q)):S(M("stat"),ee):"switch"==e?S(M("form"),j,R("{"),M("}","switch"),I,se,N,N,F):"case"==e?S(z,R(":")):"default"==e?S(R(":")):"catch"==e?S(M("form"),O,B,q,N,F):"export"==e?S(M("stat"),qe,N):"import"==e?S(M("stat"),ze,N):"async"==e?S(q):"@"==t?S(z,q):P(M("stat"),z,R(";"),N)}function B(e){if("("==e)return S(Oe,R(")"))}function z(e,t){return H(e,t,!1)}function $(e,t){return H(e,t,!0)}function j(e){return"("!=e?P():S(M(")"),z,R(")"),N)}function H(e,t,n){if(k.state.fatArrowAt==k.stream.start){var r=n?X:K;if("("==e)return S(O,M(")"),ae(Oe,")"),N,R("=>"),r,F);if("variable"==e)return P(O,Ce,R("=>"),r,F)}var i=n?G:V;return w.hasOwnProperty(e)?S(i):"function"==e?S(Ae,i):"class"==e||c&&"interface"==t?(k.marked="keyword",S(M("form"),Ie,N)):"keyword c"==e||"async"==e?S(n?$:z):"("==e?S(M(")"),U,R(")"),N,i):"operator"==e||"spread"==e?S(n?$:z):"["==e?S(M("]"),Ve,N,i):"{"==e?oe(ne,"}",null,i):"quasi"==e?P(Q,i):"new"==e?S(function(e){return function(t){return"."==t?S(e?Z:J):"variable"==t&&c?S(ve,e?G:V):P(e?$:z)}}(n)):"import"==e?S(z):S()}function U(e){return e.match(/[;\}\)\],]/)?P():P(z)}function V(e,t){return","==e?S(U):G(e,t,!1)}function G(e,t,n){var r=0==n?V:G,i=0==n?z:$;return"=>"==e?S(O,n?X:K,F):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?S(r):c&&"<"==t&&k.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?S(M(">"),ae(fe,">"),N,r):"?"==t?S(z,R(":"),i):S(i):"quasi"==e?P(Q,r):";"!=e?"("==e?oe($,")","call",r):"."==e?S(te,r):"["==e?S(M("]"),U,R("]"),N,r):c&&"as"==t?(k.marked="keyword",S(fe,r)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),S(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?P():"${"!=t.slice(t.length-2)?S(Q):S(z,Y)}function Y(e){if("}"==e)return k.marked="string-2",k.state.tokenize=v,S(Q)}function K(e){return y(k.stream,k.state),P("{"==e?q:z)}function X(e){return y(k.stream,k.state),P("{"==e?q:$)}function J(e,t){if("target"==t)return k.marked="keyword",S(V)}function Z(e,t){if("target"==t)return k.marked="keyword",S(G)}function ee(e){return":"==e?S(N,q):P(V,R(";"),N)}function te(e){if("variable"==e)return k.marked="property",S()}function ne(e,t){return"async"==e?(k.marked="property",S(ne)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?S(re):(c&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),S(ie))):"number"==e||"string"==e?(k.marked=s?"property":k.style+" property",S(ie)):"jsonld-keyword"==e?S(ie):c&&L(t)?(k.marked="keyword",S(ne)):"["==e?S(z,le,R("]"),ie):"spread"==e?S($,ie):"*"==t?(k.marked="keyword",S(ne)):":"==e?P(ie):void 0;var n}function re(e){return"variable"!=e?P(ie):(k.marked="property",S(Ae))}function ie(e){return":"==e?S($):"("==e?P(Ae):void 0}function ae(e,t,n){function r(i,a){if(n?n.indexOf(i)>-1:","==i){var o=k.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),S((function(n,r){return n==t||r==t?P():P(e)}),r)}return i==t||a==t?S():n&&n.indexOf(";")>-1?P(e):S(R(t))}return function(n,i){return n==t||i==t?S():P(e,r)}}function oe(e,t,n){for(var r=3;r<arguments.length;r++)k.cc.push(arguments[r]);return S(M(t,n),ae(e,t),N)}function se(e){return"}"==e?S():P(q,se)}function le(e,t){if(c){if(":"==e)return S(fe);if("?"==t)return S(le)}}function ce(e,t){if(c&&(":"==e||"in"==t))return S(fe)}function ue(e){if(c&&":"==e)return k.stream.match(/^\s*\w+\s+is\b/,!1)?S(z,de,fe):S(fe)}function de(e,t){if("is"==t)return k.marked="keyword",S()}function fe(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(k.marked="keyword",S("typeof"==t?$:fe)):"variable"==e||"void"==t?(k.marked="type",S(ge)):"|"==t||"&"==t?S(fe):"string"==e||"number"==e||"atom"==e?S(ge):"["==e?S(M("]"),ae(fe,"]",","),N,ge):"{"==e?S(M("}"),ae(he,"}",",;"),N,ge):"("==e?S(ae(me,")"),pe,ge):"<"==e?S(ae(fe,">"),fe):void 0}function pe(e){if("=>"==e)return S(fe)}function he(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",S(he)):"?"==t||"number"==e||"string"==e?S(he):":"==e?S(fe):"["==e?S(R("variable"),ce,R("]"),he):"("==e?P(_e,he):void 0}function me(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?S(me):":"==e?S(fe):"spread"==e?S(me):P(fe)}function ge(e,t){return"<"==t?S(M(">"),ae(fe,">"),N,ge):"|"==t||"."==e||"&"==t?S(fe):"["==e?S(fe,R("]"),ge):"extends"==t||"implements"==t?(k.marked="keyword",S(fe)):"?"==t?S(fe,R(":"),fe):void 0}function ve(e,t){if("<"==t)return S(M(">"),ae(fe,">"),N,ge)}function be(){return P(fe,ye)}function ye(e,t){if("="==t)return S(fe)}function we(e,t){return"enum"==t?(k.marked="keyword",S(Ge)):P(Ce,le,Pe,Se)}function Ce(e,t){return c&&L(t)?(k.marked="keyword",S(Ce)):"variable"==e?(W(t),S()):"spread"==e?S(Ce):"["==e?oe(ke,"]"):"{"==e?oe(xe,"}"):void 0}function xe(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?S(Ce):"}"==e?P():"["==e?S(z,R("]"),R(":"),xe):S(R(":"),Ce,Pe)):(W(t),S(Pe))}function ke(){return P(Ce,Pe)}function Pe(e,t){if("="==t)return S($)}function Se(e){if(","==e)return S(we)}function Te(e,t){if("keyword b"==e&&"else"==t)return S(M("form","else"),q,N)}function We(e,t){return"await"==t?S(We):"("==e?S(M(")"),Ee,N):void 0}function Ee(e){return"var"==e?S(we,Le):"variable"==e?S(Le):P(Le)}function Le(e,t){return")"==e?S():";"==e?S(Le):"in"==t||"of"==t?(k.marked="keyword",S(z,Le)):P(z,Le)}function Ae(e,t){return"*"==t?(k.marked="keyword",S(Ae)):"variable"==e?(W(t),S(Ae)):"("==e?S(O,M(")"),ae(Oe,")"),N,ue,q,F):c&&"<"==t?S(M(">"),ae(be,">"),N,Ae):void 0}function _e(e,t){return"*"==t?(k.marked="keyword",S(_e)):"variable"==e?(W(t),S(_e)):"("==e?S(O,M(")"),ae(Oe,")"),N,ue,F):c&&"<"==t?S(M(">"),ae(be,">"),N,_e):void 0}function De(e,t){return"keyword"==e||"variable"==e?(k.marked="type",S(De)):"<"==t?S(M(">"),ae(be,">"),N):void 0}function Oe(e,t){return"@"==t&&S(z,Oe),"spread"==e?S(Oe):c&&L(t)?(k.marked="keyword",S(Oe)):c&&"this"==e?S(le,Pe):P(Ce,le,Pe)}function Ie(e,t){return"variable"==e?Fe(e,t):Me(e,t)}function Fe(e,t){if("variable"==e)return W(t),S(Me)}function Me(e,t){return"<"==t?S(M(">"),ae(be,">"),N,Me):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(k.marked="keyword"),S(c?fe:z,Me)):"{"==e?S(M("}"),Ne,N):void 0}function Ne(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&L(t))&&k.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",S(Ne)):"variable"==e||"keyword"==k.style?(k.marked="property",S(c?Re:Ae,Ne)):"number"==e||"string"==e?S(c?Re:Ae,Ne):"["==e?S(z,le,R("]"),c?Re:Ae,Ne):"*"==t?(k.marked="keyword",S(Ne)):c&&"("==e?P(_e,Ne):";"==e||","==e?S(Ne):"}"==e?S():"@"==t?S(z,Ne):void 0}function Re(e,t){if("?"==t)return S(Re);if(":"==e)return S(fe,Pe);if("="==t)return S($);var n=k.state.lexical.prev;return P(n&&"interface"==n.info?_e:Ae)}function qe(e,t){return"*"==t?(k.marked="keyword",S(Ue,R(";"))):"default"==t?(k.marked="keyword",S(z,R(";"))):"{"==e?S(ae(Be,"}"),Ue,R(";")):P(q)}function Be(e,t){return"as"==t?(k.marked="keyword",S(R("variable"))):"variable"==e?P($,Be):void 0}function ze(e){return"string"==e?S():"("==e?P(z):P($e,je,Ue)}function $e(e,t){return"{"==e?oe($e,"}"):("variable"==e&&W(t),"*"==t&&(k.marked="keyword"),S(He))}function je(e){if(","==e)return S($e,je)}function He(e,t){if("as"==t)return k.marked="keyword",S($e)}function Ue(e,t){if("from"==t)return k.marked="keyword",S(z)}function Ve(e){return"]"==e?S():P(ae($,"]"))}function Ge(){return P(M("form"),Ce,R("{"),M("}"),ae(Qe,"}"),N,N)}function Qe(){return P(Ce,Pe)}function Ye(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return F.lex=!0,N.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new C((e||0)-a,0,"block",!1),localVars:n.localVars,context:n.localVars&&new A(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),y(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(e,t,n,r,i){var a=e.cc;for(k.state=e,k.stream=i,k.marked=null,k.cc=a,k.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((a.length?a.pop():l?z:q)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return k.marked?k.marked:"variable"==n&&x(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==g)return e.Pass;if(t.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==N)l=l.prev;else if(u!=Te)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==V||i==G)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;o&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,p=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+a:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?o||a:0):"switch"!=l.info||p||0==n.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?0:a):l.indented+(/^(?:case|default)\b/.test(r)?a:2*a)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Ye,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=z&&t!=$||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",(function(t,n){var r=n.client||{},s=n.atoms||{false:!0,true:!0,null:!0},l=n.builtin||a(o),c=n.keywords||a(i),u=n.operatorChars||/^[*+\-%<>!=&|~^\/]/,d=n.support||{},f=n.hooks||{},p=n.dateSQL||{date:!0,time:!0,timestamp:!0},h=!1!==n.backslashStringEscapes,m=n.brackets||/^[\{}\(\)\[\]]/,g=n.punctuation||/^[;.,:]/;function v(e,t){var n=e.next();if(f[n]){var i=f[n](e,t);if(!1!==i)return i}if(d.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(d.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),d.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&d.doubleQuote)return t.tokenize=b(n),t.tokenize(e,t);if((d.nCharCast&&("n"==n||"N"==n)||d.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(d.escapeConstant&&("e"==n||"E"==n)&&("'"==e.peek()||'"'==e.peek()&&d.doubleQuote))return t.tokenize=function(e,t){return(t.tokenize=b(e.next(),!0))(e,t)},"keyword";if(d.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(d.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!d.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=y(1),t.tokenize(e,t);if("."!=n){if(u.test(n))return e.eatWhile(u),"operator";if(m.test(n))return"bracket";if(g.test(n))return e.eatWhile(g),"punctuation";if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return p.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":s.hasOwnProperty(a)?"atom":l.hasOwnProperty(a)?"builtin":c.hasOwnProperty(a)?"keyword":r.hasOwnProperty(a)?"string-2":null}return d.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:d.ODBCdotTable&&e.match(/^[\w\d_]+/)?"variable-2":void 0}function b(e,t){return function(n,r){for(var i,a=!1;null!=(i=n.next());){if(i==e&&!a){r.tokenize=v;break}a=(h||t)&&!a&&"\\"==i}return"string"}}function y(e){return function(t,n){var r=t.match(/^.*?(\/\*|\*\/)/);return r?"/*"==r[1]?n.tokenize=y(e+1):n.tokenize=e>1?y(e-1):v:t.skipToEnd(),"comment"}}function w(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}return{startState:function(){return{tokenize:v,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==v&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?w(e,t,")"):"["==r?w(e,t,"]"):t.context&&t.context.type==r&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var a=r.charAt(0)==i.type;return i.align?i.col+(a?0:1):i.indent+(a?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.commentSlashSlash?"//":d.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}}));var i="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function a(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric";e.defineMIME("text/x-sql",{name:"sql",keywords:a(i+"begin"),builtin:a(o),atoms:a("false true null unknown"),dateSQL:a("date time timestamp"),support:a("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:a("$partition binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id"),keywords:a(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx updlock with"),builtin:a("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:a("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"),operatorChars:/^[*+\-%<>!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:a("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:a("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:a(i+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:a("date time timestamp"),support:a("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:a("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:a(i+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:a("date time timestamp"),support:a("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-sqlite",{name:"sql",client:a("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:a(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:a("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:a("date time timestamp datetime"),support:a("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":n,":":n,"?":n,$:n,'"':function(e){for(var t;null!=(t=e.next());)if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:a("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:a("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:a("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:a("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:a("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:a("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:a("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:a("date time timestamp"),support:a("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:a("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:a("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:a("date timestamp"),support:a("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:a("source"),keywords:a(i+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:a("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:a("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:a("date time timestamp"),support:a("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),e.defineMIME("text/x-gql",{name:"sql",keywords:a("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:a("false true"),builtin:a("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:a("source"),keywords:a("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:a("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:a("date time timestamp"),support:a("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:a("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:a("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:a("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:a("date time timestamp"),support:a("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:a("source"),keywords:a("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:a("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:a("time"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber")})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var a,o,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,a=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return a="equals",null;if("<"==i){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"},r.isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=h(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=h(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?w:b}function y(e,t,n){return"word"==e?(n.tagName=t.current(),o="tag",k):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",k(e,t,n)):(o="error",y)}function w(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(o="tag",C):(o="tag error",x)}return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",C(e,t,n)):(o="error",x)}function C(e,t,n){return"endTag"!=e?(o="error",C):(g(n),b)}function x(e,t,n){return o="error",C(e,0,n)}function k(e,t,n){if("word"==e)return o="attribute",P;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?v(n,r):(v(n,r),n.context=new m(n,r,i==n.indented)),b}return o="error",k}function P(e,t,n){return"equals"==e?S:(l.allowMissing||(o="error"),k(e,0,n))}function S(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(o="string",k):(o="error",k(e,0,n))}function T(e,t,n){return"string"==e?T:k(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;a=null;var n=t.tokenize(e,t);return(n||a)&&"comment"!=n&&(o=null,t.state=t.state(a||n,e,t),o&&(n="error"==o?n+" error":o)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;i;){if(i.tagName==a[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(a)for(;i;){var o=l.contextGrabbers[i.tagName];if(!o||!o.hasOwnProperty(a[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=k)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,a){var s=e.getLineHandle(t.line),l=t.ch-1,c=a&&a.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(a),d=!c&&l>=0&&u.test(s.text.charAt(l))&&r[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!d)return null;var f=">"==d.charAt(1)?1:-1;if(a&&a.strict&&f>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=o(e,n(t.line,l+(f>0?1:0)),f,p||null,a);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==d.charAt(0),forward:f>0}}function o(e,t,a,o,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],d=i(s),f=a>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),p=t.line;p!=f;p+=a){var h=e.getLine(p);if(h){var m=a>0?0:h.length-1,g=a>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(a<0?1:0));m!=g;m+=a){var v=h.charAt(m);if(d.test(v)&&(void 0===o||e.getTokenTypeAt(n(p,m+1))==o)){var b=r[v];if(b&&">"==b.charAt(1)==a>0)u.push(v);else{if(!u.length)return{pos:n(p,m),ch:v};u.pop()}}}}}return p-a!=(a>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c<l.length;c++){var u=l[c].empty()&&a(e,l[c].head,i);if(u&&e.getLine(u.from.line).length<=o){var d=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(u.from,n(u.from.line,u.from.ch+1),{className:d})),u.to&&e.getLine(u.to.line).length<=o&&s.push(e.markText(u.to,n(u.to.line,u.to.ch+1),{className:d}))}}if(s.length){t&&e.state.focused&&e.focus();var f=function(){e.operation((function(){for(var e=0;e<s.length;e++)s[e].clear()}))};if(!r)return f;setTimeout(f,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=s(e,!1,e.state.matchBrackets)}))}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",l),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",l))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),a(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return o(this,e,t,n,r)}))})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",r="CodeMirror-activeline-gutter";function i(e){for(var i=0;i<e.state.activeLines.length;i++)e.removeLineClass(e.state.activeLines[i],"wrap",t),e.removeLineClass(e.state.activeLines[i],"background",n),e.removeLineClass(e.state.activeLines[i],"gutter",r)}function a(e,a){for(var o=[],s=0;s<a.length;s++){var l=a[s],c=e.getOption("styleActiveLine");if("object"==typeof c&&c.nonEmpty?l.anchor.line==l.head.line:l.empty()){var u=e.getLineHandleVisualStart(l.head.line);o[o.length-1]!=u&&o.push(u)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,o)||e.operation((function(){i(e);for(var a=0;a<o.length;a++)e.addLineClass(o[a],"wrap",t),e.addLineClass(o[a],"background",n),e.addLineClass(o[a],"gutter",r);e.state.activeLines=o}))}function o(e,t){a(e,t.ranges)}e.defineOption("styleActiveLine",!1,(function(t,n,r){var s=r!=e.Init&&r;n!=s&&(s&&(t.off("beforeSelectionChange",o),i(t),delete t.state.activeLines),n&&(t.state.activeLines=[],a(t,t.listSelections()),t.on("beforeSelectionChange",o)))}))})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,n,r){r==e.Init&&(r=!1),!r!=!n&&(n?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}(t))}))})),String.prototype.startsWith||(String.prototype.startsWith=function(e){return 0===this.indexOf(e)}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return this.length>=e.length&&this.substr(this.length-e.length)===e}),window.FileReader&&Uint8Array&&!FileReader.prototype.readAsBinaryString&&(FileReader.prototype.readAsBinaryString=function(e){var t="",n=this,r=new FileReader;r.onload=function(e){for(var i=new Uint8Array(r.result),a=i.byteLength,o=0;o<a;o++)t+=String.fromCharCode(i[o]);n.content=t,n.onload()},r.readAsArrayBuffer(e)}),window.nextact=window.nextact||function(e){return function(){WebPlatform.delay(50,(function(){window.location.href=b64DecodeUnicode(e)}))}};var toggleDisplay=function(e,t,n){return n?e[t?"slideDown":"slideUp"]("fast"):e[t?"removeClass":"addClass"]("none"),e},STORE_PRODUCT_TYPE={PHYSICAL_PRODUCT:"physical",DIGITAL_PRODUCT:"digital",SERVICE:"service",MEMBERSHIP:"membership",PAYWALL:"paywall"},COUNTRY_CODES=["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","IC","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","EL","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"],STATES={US:["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],CA:["Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon"],NG:["Abia","Abuja","Adamawa","Akwa Ibom","Anambra","Bauchi","Bayelsa","Benue","Borno","Cross River","Delta","Ebonyi","Enugu","Edo","Ekiti","Gombe","Imo","Jigawa","Kaduna","Kano","Katsina","Kebbi","Kogi","Kwara","Lagos","Nasarawa","Niger","Ogun","Ondo","Osun","Oyo","Plateau","Rivers","Sokoto","Taraba","Yobe","Zamfara"],DZ:["Adrar","Chlef","Laghouat","Oum el-Bouaghi","Batna","Béjaïa","Biskra","Béchar","Blida","Bouïra","Tamanghasset","Tébessa","Tlemcen","Tiaret","Tizi Ouzou","Algiers","Djelfa","Jijel","Sétif","Saïda","Skikda","Sidi Bel Abbès","Annaba","Guelma","Constantine","Médéa","Mostaganem","M'sila","Mascara","Ouargla","Oran","El Bayadh","Illizi","Bordj Bou Arréridj","Boumerdès","El Taref","Tindouf","Tissemsilt","El Oued","Khenchela","Souk Ahras","Tipaza","Mila","Aïn Defla","Naâma","Aïn Témouchent","Ghardaïa","Relizane","Algérie"],CO:["Amazonas","Antioquia","Arauca","Archipiélago de San Andrés, Providencia y Santa Catalina","Atlántico","Bogotá D.C.","Bolívar","Boyacá","Caldas","Caquetá","Casanare","Cauca","Cesar","Chocó","Córdoba","Cundinamarca","Guainía","Guaviare","Huila","La Guajira","Magdalena","Meta","Nariño","Norte de Santander","Putumayo","Quindío","Risaralda","Santander","Sucre","Tolima","Valle del Cauca","Vaupés","Vichada"],PE:["Amazonas","Áncash","Apurímac","Arequipa","Ayacucho","Cajamarca","Callao","Cusco","Huancavelica","Huánuco","Ica","Junín","La Libertad","Lambayeque","Lima Metropolitana","Lima (departamento)","Loreto","Madre de Dios","Moquegua","Pasco","Piura","Puno","San Martín","Tacna","Tumbes","Ucayali"],MX:["Aguascalientes","Baja California","Baja California Sur","Campeche","Chiapas","Chihuahua","Ciudad de México","Coahuila","Colima","Durango","Guanajuato","Guerrero","Hidalgo","Jalisco","México","Michoacán","Morelos","Nayarit","Nuevo León","Oaxaca","Puebla","Querétaro","Quintana Roo","San Luis Potosí","Sinaloa","Sonora","Tabasco","Tamaulipas","Tlaxcala","Veracruz","Yucatán"],EC:["Azuay","Bolívar","Cañar","Carchi","Chimborazo","Cotopaxi","El Oro","Esmeraldas","Galápagos","Guayas","Imbabura","Loja","Los Ríos","Manabí","Morona-Santiago","Napo","Orellana","Pastaza","Pichincha","Santa Elena","Santo Domingo de los Tsáchilas","Sucumbíos","Tungurahua","Zamora-Chinchipe"],PA:["Bocas Del Toro","Chiriquí","Coclé","Colón","Darién","Herrera","Los Santos","Panamá Oeste","Veraguas"],AR:["Buenos Aires","Catamarca","Chaco","Chubut","Córdoba","Corrientes","Entre Ríos","Formosa","Jujuy","La Pampa","La Rioja","Mendoza","Misiones","Neuquén","Río Negro","Salta","San Juan","San Luis","Santa Cruz","Santa Fe","Santiago del Estero","Tierra del Fuego, Antártida e Islas del Atlántico Sur","Tucumán"],BO:["Beni","Chuquisaca","Cochabamba","La Paz","Oruro","Pando","Potosí","Santa Cruz","Tarija"],BR:["São Paulo","Río de Janeiro","Distrito Federal","Ceará","Bahía","Minas Gerais","Amazonas","Paraná","Pernambuco","Goiás","Río Grande del Sur","Pará","Maranhão","Alagoas","Mato Grosso del Sur","Piauí","Paraíba","Río Grande del Norte","Mato Grosso","Sergipe","Santa Catarina","Rondônia","Amapá","Roraima","Acre","Espírito Santo","Tocantins"],CL:["Arica y Parinacota","Tarapacá","Antofagasta","Atacama","Coquimbo","Valparaíso","Metropolitana","O'Higgins","Maule","Bío-Bío","La Araucanía","Los Ríos","Los Lagos","Aysén","Magallanes"],CR:["San José","Alajuela","Cartago","Heredia","Guanacaste","Puntarenas","Limón"],CU:["Artemisa","Camagüey","Ciego de Ávila","Cienfuegos","Granma","Guantánamo","Holguín","La Habana","Las Tunas","Matanzas","Mayabeque","Pinar del Río","Sancti Spíritus","Santiago de Cuba","Villa Clara"],SV:["Ahuachapán","Cabañas","Chalatenango","Cuscatlán","La Libertad","La Paz","La Unión","Morazán","San Miguel","San Salvador","San Vicente","Santa Ana","Sonsonate","Usulután"],GT:["Alta Verapaz","Baja Verapaz","Chimaltenango","Chiquimula","El Progreso","Escuintla","Departamento de Guatemala","Huehuetenango","Izabal","Jalapa","Jutiapa","Petén","Quetzaltenango","Quiché","Retalhuleu","Sacatepéquez","San Marcos","Santa Rosa","Sololá","Suchitepéquez","Totonicapán","Zacapa"],HT:["Artibonito","Centro","Grand'Anse","Nippes","Norte","Noreste","Noroeste","Oeste","Sureste","Sur"],HN:["Atlántida","Colón","Comayagua","Copán","Cortés","Choluteca","El Paraíso","Francisco Morazán","Gracias a Dios","Intibucá","Islas de la Bahía","La Paz","Lempira","Ocotepeque","Olancho","Santa Bárbara","Valle","Yoro"],NI:["Boaco","Carazo","Chinandega","Chontales","Costa Caribe Norte","Costa Caribe Sur","Estelí","Granada","Jinotega","León","Madriz","Managua","Masaya","Matagalpa","Nueva Segovia","Río San Juan","Rivas"],PY:["Alto Paraguay","Alto Paraná","Amambay","Boquerón","Caaguazú","Caazapá","Canindeyú","Central","Concepción","Cordillera","Distrito Capital","Guairá","Itapúa","Misiones","Ñeembucú","Paraguarí","Presidente Hayes","San Pedro"],DO:["Azua","Bahoruco","Barahona","Dajabón","Duarte","Elías Piña","El Seibo","Espaillat","Hato Mayor","Hermanas Mirabal","Independencia","La Altagracia","La Romana","La Vega","María Trinidad Sánchez"],UY:["Artigas","Canelones","Cerro Largo","Colonia","Durazno","Flores","Florida","Lavalleja","Maldonado","Montevideo","Paysandú","Río Negro","Rivera","Rocha","Salto","San José","Soriano","Tacuarembó","Treinta y Tres"],VE:["Amazonas","Anzoátegui","Apure","Aragua","Barinas","Bolívar","Carabobo","Cojedes","Delta Amacuro","Distrito Capital","Falcón","Guárico","Lara","Mérida","Miranda","Monagas","Nueva Esparta","Portuguesa","Sucre","Táchira","Trujillo","Vargas","Yaracuy","Zulia","Dependencias Federales"]},STATES_ISO={US:[{code:"AL",name:"Alabama"},{code:"AK",name:"Alaska"},{code:"AZ",name:"Arizona"},{code:"AR",name:"Arkansas"},{code:"CA",name:"California"},{code:"CO",name:"Colorado"},{code:"CT",name:"Connecticut"},{code:"DE",name:"Delaware"},{code:"DC",name:"District of Columbia"},{code:"FL",name:"Florida"},{code:"GA",name:"Georgia"},{code:"HI",name:"Hawaii"},{code:"ID",name:"Idaho"},{code:"IL",name:"Illinois"},{code:"IN",name:"Indiana"},{code:"IA",name:"Iowa"},{code:"KS",name:"Kansas"},{code:"KY",name:"Kentucky"},{code:"LA",name:"Louisiana"},{code:"ME",name:"Maine"},{code:"MD",name:"Maryland"},{code:"MA",name:"Massachusetts"},{code:"MI",name:"Michigan"},{code:"MN",name:"Minnesota"},{code:"MS",name:"Mississippi"},{code:"MO",name:"Missouri"},{code:"MT",name:"Montana"},{code:"NE",name:"Nebraska"},{code:"NV",name:"Nevada"},{code:"NH",name:"New Hampshire"},{code:"NJ",name:"New Jersey"},{code:"NM",name:"New Mexico"},{code:"NY",name:"New York"},{code:"NC",name:"North Carolina"},{code:"ND",name:"North Dakota"},{code:"OH",name:"Ohio"},{code:"OK",name:"Oklahoma"},{code:"OR",name:"Oregon"},{code:"PA",name:"Pennsylvania"},{code:"RI",name:"Rhode Island"},{code:"SC",name:"South Carolina"},{code:"SD",name:"South Dakota"},{code:"TN",name:"Tennessee"},{code:"TX",name:"Texas"},{code:"UT",name:"Utah"},{code:"VA",name:"Virginia"},{code:"VT",name:"Vermont"},{code:"WA",name:"Washington"},{code:"WI",name:"Wisconsin"},{code:"WV",name:"West Virginia"},{code:"WY",name:"Wyoming"}],CA:[{code:"AB",name:"Alberta"},{code:"BC",name:"British Columbia"},{code:"MB",name:"Manitoba"},{code:"NB",name:"New Brunswick"},{code:"NL",name:"Newfoundland"},{code:"NT",name:"Northwest Territories"},{code:"NS",name:"Nova Scotia"},{code:"NU",name:"Nunavut"},{code:"ON",name:"Ontario"},{code:"PE",name:"Prince Edward Island"},{code:"QC",name:"Quebec"},{code:"SK",name:"Saskatchewan"},{code:"YT",name:"Yukon"}]},dummy=function(){},isUndefined=function(e){return void 0===e},isFunction=function(e){return"function"==typeof e};if(!window.mergeUnique)function mergeUnique(e,t,n,r){var i=!0===r?$.extend({},e):e;for(var a in t)(isUndefined(i[a])||""===i[a]&&!a.endsWith("Class")||!0===n&&null===i[a])&&(i[a]=t[a]);return i}var Log=Log||console||{};function getThumbnailsFromBase(e,t,n){return(!1===n?"":content)+e+"thumbnails/"+t+"/"}function getFileFromBase(e,t){return(!1===t?"":content)+e+"uploads/"}function extend(e,t){for(var n in t)t.hasOwnProperty(n)&&isUndefined(e[n])&&(e[n]=t[n])}Log.error=Log.error||dummy,Log.log=Log.log||dummy,Log.info=Log.info||dummy;var TmdpLightbox=function(){var e,t,n,r,i,a=!1,o=null,s=0,l=[],c='<div class="tmdp-simple-lightbox-detail in-lightbox show" data-role="close">  <div class="preview" data-role="close">%data%</div></div>',u=function(e){if(e<=0?r.removeClass("visible"):r.addClass("visible"),e>=l.length-1?i.removeClass("visible"):i.addClass("visible"),!(e<0||e>=l.length)){var t,a=l[e];$.isArray(a)&&1===a.length&&(a=a[0]);var o=!1;if(a.isVideo)t=$(WebPlatform.format(c,"data",a.video));else if($.isArray(a)){var u='<img src="'+a[0]+'" alt="" style="opacity: 0; visibility: hidden" />';u+='<div class="inline-gallery full-size absolute">';for(var d=0;d<a.length;++d)u+='<div class="inline-gallery-item" style="background-image: url(\''+a[d]+"')\"></div>";u+="</div>",t=$(WebPlatform.format(c,"data",u)),o=!0}else t=$(WebPlatform.format('<div class="tmdp-simple-lightbox-detail in-lightbox show" data-role="close">  <div class="preview" data-role="close">   <div style="background-image: url(\'%image%\')"></div>   <img class="hide-in-popup" src="%image%" alt="" />  </div></div>',"image",a));s=e;var f=n.find(".active");f.removeClass("active"),WebPlatform.delay(300,(function(){f.remove()})),n.addClass("active-loading"),n.append(t),o&&WebPlatform.refreshLightboxes(),WebPlatform.onImagesLoaded(t,(function(){n.removeClass("active-loading");var e=t.find(".preview").width(),r=.9*$window.width(),i=t.height(),a=$window.height();t.css({left:(r-e)/2+"px",top:(a>i?(a-i)/2:-(i-a)/2)+"px"}),t.addClass("active")}))}},d=function(a){if("close"===$(a.target).data("role")){e.removeClass("with-popup");var s=o.find(".active").add(o).add(t).add(n);s.removeClass("active"),r.add(i).removeClass("visible"),WebPlatform.delay(300,(function(){s.removeClass("show"),n.find(".tmdp-simple-lightbox-detail").remove()}))}},f=function(r,i){(i=$(i)).addClass("with-tmdp-lightbox");var a=[],s=i.attr("data-trigger"),c=i[0].hasAttribute("data-manual-trigger"),d=!!s;d||(s="[data-slide]"),c&&i.find(s).data("manual",!0),i.children("[data-slide]").each((function(){var e=$(this);if(c||!d||0!==e.find(s).length){var t=e.addClass("tmdp-simple-lightbox-slide").attr("data-slide");if(e.hasClass("no-lightbox-hover")||e.addClass("with-hover"),e.data("idx",a.length),""===t){var n=[];e.find("[data-image]").each((function(){var e=$(this),t=e.attr("data-image");"video"===t?n.push({isVideo:!0,video:e.html()}):n.push(t)})),t=n}a.push(t)}})),i.on("mousedown.lightbox",s,(function(r){var i=$(this);i.attr("data-slide")||!0===i.data("manual")||(i=i.closest("[data-slide]")),e.addClass("with-popup"),o.add(t).add(n).addClass("show active");var s=i.data("idx");return l=a,u(s),r.stopPropagation(),r.preventDefault(),!1}))};return{refreshLightboxes:function(l){a||a||(a=!0,e=$("body"),resources=e.data("resources")||window.resources,locale=e.data("locale")||window.locale,content=e.data("content")||window.content,resourcesVersion=WebPlatform.parse(e.data("ver"),0,!0)||window.resourcesVersion,e.append('<div id="tmdp-simple-lightbox-overlay"></div><div id="tmdp-simple-lightbox" data-role="close">  <a class="custom-popup-close-btn" data-role="close"><svg data-role="close" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"></path></svg></a>  <a class="prev" style="cursor: pointer" title=""> &lt; </a>  <a class="next" style="cursor: pointer" title=""> &gt; </a>  <div id="tmdp-simple-lightbox-content" data-role="close"></div></div>'),o=$("#tmdp-simple-lightbox"),t=$("#tmdp-simple-lightbox-overlay"),n=$("#tmdp-simple-lightbox-content"),r=o.find(".prev").click((function(){u(s-1)})),i=o.find(".next").click((function(){u(s+1)})),t.add(o).on("click",'[data-role="close"]',d).click(d)),l?f(0,l):e.find('[data-rel="lightbox"]:not(".with-tmdp-lightbox")').each(f)},removeLightbox:function(e){e.hasClass("with-tmdp-lightbox")&&e.removeClass("with-tmdp-lightbox").off(".lightbox")}}}();window.WebPlatform=window.WebPlatform||{},window.Simvoly=window.WebPlatform,WebPlatform.onReady||(WebPlatform.documentReadyRequests=[],WebPlatform.onReady=function(e){null===WebPlatform.documentReadyRequests?e():WebPlatform.documentReadyRequests.push(e)}),extend(WebPlatform,{_htmlSpecialChars:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},removeDiacritics:function(e,t){e+="";for(var n=[{base:"A",letters:/[\u0391\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0392\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0394\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0397\u0395\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u03A6\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0393\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u03A7\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0399\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u039A\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u039B\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u039C\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u039D\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u039F\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\u03A9\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u03A0\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u03A1\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u03A3\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u03A4\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TH",letters:/[\u0398]/g},{base:"TZ",letters:/[\uA728]/g},{base:"PS",letters:/[\u03A8]/g},{base:"SH",letters:/[]/g},{base:"SHT",letters:/[]/g},{base:"U",letters:/[\u03A5\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u039E\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[ѝ\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u0396\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[ა\u03B1\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[ბ\u03B2\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[დ\u03B4\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[ძ\u01F3\u01C6]/g},{base:"e",letters:/[ე\u03B7\u03B5\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u03C6\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[გ\u03B3\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[ჰ\u03C7\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[იѝ\u03B9\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[ჯ\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[ქკ\u03BA\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[ლ\u03BB\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[მ\u03BC\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[ნ\u03BD\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[ო\u03BF\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\u03C9\uA74F]/g},{base:"p",letters:/[ფპ\u03C0\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[ყ\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[რ\u03C1\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[ს\u03C2\u03C3\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[თტ\u03C4\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"th",letters:/[\u03B8]/g},{base:"tz",letters:/[\uA729]/g},{base:"ts",letters:/[წც]/g},{base:"kh",letters:/[ხ]/g},{base:"sh",letters:/[შ]/g},{base:"ch",letters:/[ჭჩ]/g},{base:"sh",letters:/[\u03C8]/g},{base:"sht",letters:/[]/g},{base:"zh",letters:/[ჟ]/g},{base:"gh",letters:/[ღ]/g},{base:"u",letters:/[უ\u03C5\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[ვ\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u03BE\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[ზ\u03B6\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],r=0;r<n.length;r++)e=e.replace(n[r].letters,n[r].base);return!0===t&&(e=e.replace(/\u0401/g,"YO").replace(/\u0419/g,"I").replace(/\u0426/g,"TS").replace(/\u0423/g,"U").replace(/\u041A/g,"K").replace(/\u0415/g,"E").replace(/\u041D/g,"N").replace(/\u0413/g,"G").replace(/\u0428/g,"SH").replace(/\u0429/g,"SCH").replace(/\u0417/g,"Z").replace(/\u0425/g,"H").replace(/\u042A/g,"").replace(/\u0451/g,"yo").replace(/\u0439/g,"i").replace(/\u0446/g,"ts").replace(/\u0443/g,"u").replace(/\u043A/g,"k").replace(/\u0435/g,"e").replace(/\u043D/g,"n").replace(/\u0433/g,"g").replace(/\u0448/g,"sh").replace(/\u0449/g,"sch").replace(/\u0437/g,"z").replace(/\u0445/g,"h").replace(/\u044A/g,"'").replace(/\u0424/g,"F").replace(/\u042B/g,"I").replace(/\u0412/g,"V").replace(/\u0410/g,"a").replace(/\u041F/g,"P").replace(/\u0420/g,"R").replace(/\u041E/g,"O").replace(/\u041B/g,"L").replace(/\u0414/g,"D").replace(/\u0416/g,"ZH").replace(/\u042D/g,"E").replace(/\u0444/g,"f").replace(/\u044B/g,"i").replace(/\u0432/g,"v").replace(/\u0430/g,"a").replace(/\u043F/g,"p").replace(/\u0440/g,"r").replace(/\u043E/g,"o").replace(/\u043B/g,"l").replace(/\u0434/g,"d").replace(/\u0436/g,"zh").replace(/\u044D/g,"e").replace(/\u042F/g,"Ya").replace(/\u0427/g,"CH").replace(/\u0421/g,"S").replace(/\u041C/g,"M").replace(/\u0418/g,"I").replace(/\u0422/g,"T").replace(/\u042C/g,"'").replace(/\u0411/g,"B").replace(/\u042E/g,"YU").replace(/\u044F/g,"ya").replace(/\u0447/g,"ch").replace(/\u0441/g,"s").replace(/\u043C/g,"m").replace(/\u0438/g,"i").replace(/\u0442/g,"t").replace(/\u044C/g,"'").replace(/\u0431/g,"b").replace(/\u044E/g,"yu")),e},preventDefault:function(e){return e.stopPropagation(),e.preventDefault(),!1},escapeHtml:function(e){return String(e).replace(/[&<>"']/g,(function(e){return WebPlatform._htmlSpecialChars[e]}))},tick:function(){return(new Date).getTime()%1e8},random:function(e){return Math.floor(Math.random()*e)},equals:function(e,t){if(e===t)return!0;for(var n in e)if(isUndefined(t[n])||e[n]!==t[n])return!1;for(var n in t)if(isUndefined(e[n])||e[n]!==t[n])return!1;return!0},numberEquals:function(e,t,n){return isUndefined(n)&&(n=1e-4),Math.abs(e-t)<=n},addrToStr:function(e,t){var n="";return e&&(n=WebPlatform.escapeHtml(e)),t.phone&&(n+=(""===n?"":", ")+WebPlatform.escapeHtml(t.phone)),n&&(n+="<br />"),t.companyName&&(n+=WebPlatform.escapeHtml(t.companyName)+"<br />"),t.companyName&&t.companyId&&(n+=WebPlatform.escapeHtml(t.companyId)+"<br />"),(t.city||t.address||t.state||t.zipCode)&&(t.address&&(n+=WebPlatform.escapeHtml(t.address)+"<br />"),t.address2&&(n+=WebPlatform.escapeHtml(t.address2)+"<br />"),t.city&&(n+=WebPlatform.escapeHtml(t.city)+"<br />"),t.state&&(n+=WebPlatform.escapeHtml(t.state)),t.zipCode&&(n+=(t.state?", ":"")+WebPlatform.escapeHtml(t.zipCode)),(t.state||t.zipCode)&&(n+="<br />"),t.country&&(n+=(window.COUNTRIES?COUNTRIES[COUNTRY_CODES.indexOf(t.country)]:t.country)||"")),n},ddmmyyStringToDate:function(e){if(""===(e=$.trim(e||"")))return null;var t=e.split("/");return new Date(WebPlatform.parse(t[2],2016),WebPlatform.parse(t[1],1)-1,WebPlatform.parse(t[0],1))},yyyymmddStringToDate:function(e){if(""===(e=$.trim(e||"")))return null;var t=e.split("-");return new Date(WebPlatform.parse(t[0],2020),WebPlatform.parse(t[1],1)-1,WebPlatform.parse(t[2],1))},mmddyyStringToDate:function(e){if(""===(e=$.trim(e||"")))return null;var t=e.split("/");return new Date(WebPlatform.parse(t[2],2016),WebPlatform.parse(t[0],1)-1,WebPlatform.parse(t[1],1))},ukDateTimeStringToDate:function(e){if(""===(e=$.trim(e||"")))return null;var t=e.split(" ");if(t.length<2)return null;var n=t[0],r=t[1];if(!r)return null;var i=r.split(":");if(i.length<2)return null;var a=WebPlatform.parse(i[0],0),o=WebPlatform.parse(i[1],0),s=i.length>2?WebPlatform.parse(i[2],0):0,l=WebPlatform.ddmmyyStringToDate(n);return null===l?null:(l.setHours(a,o,s),l)},capitalizeFirstLetter:function(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)},usDateTimeStringToDate:function(e){if(""===(e=$.trim(e||"")))return null;var t=e.split(" ");if(t.length<3)return null;var n=t[0],r=t[1],i="AM"===t[2].toUpperCase();if(!r)return null;var a=r.split(":");if(a.length<2)return null;var o=WebPlatform.parse(a[0],0),s=WebPlatform.parse(a[1],0),l=a.length>2?WebPlatform.parse(a[2],0):0;!i&&o<12&&(o+=12),i&&12===o&&(o=0);var c=WebPlatform.mmddyyStringToDate(n);return null===c?null:(c.setHours(o,s,l),c)},ddmmyyyyDateToStrWithMonth:function(e,t,n){var r=WebPlatform.ddmmyyStringToDate(e);return WebPlatform.dateToStrWithMonth(r,t,n)},yyyymmddDateToStrWithMonth:function(e,t,n){var r=WebPlatform.yyyymmddStringToDate(e);return WebPlatform.dateToStrWithMonth(r,t,n)},dateToStrWithMonth:function(e,t,n,r,i){var a=i||[WebPlatform.Phrases["label.january"],WebPlatform.Phrases["label.february"],WebPlatform.Phrases["label.march"],WebPlatform.Phrases["label.april"],WebPlatform.Phrases["label.may"],WebPlatform.Phrases["label.june"],WebPlatform.Phrases["label.july"],WebPlatform.Phrases["label.august"],WebPlatform.Phrases["label.september"],WebPlatform.Phrases["label.october"],WebPlatform.Phrases["label.november"],WebPlatform.Phrases["label.december"]],o=e.getDate(),s=e.getMonth(),l=e.getFullYear();return!1===r?a[s]+(!1!==n?", "+l:""):!0===t?o+" "+a[s]+(!1!==n?", "+l:""):a[s]+" "+o+(!1!==n?", "+l:"")},isTouchSupported:function(){return!!("ontouchstart"in window||navigator.maxTouchPoints||navigator.msMaxTouchPoints)},intersect:function(e,t,n,r){n=!0===n,r=r||dummy;for(var i=[],a=0;a<e.length;++a)for(var o=e[a],s=0;s<t.length;++s)if(!0===r(o,t[s])){i.push(n?o:t[s]);break}return i},hexToRgba:function(e,t){if(t=t||0,0!==e.indexOf("#"))return e;e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+t+")":e},transitionsSupported:function(){var e=(document.body||document.documentElement).style;return void 0!==e.transition||void 0!==e.WebkitTransition||void 0!==e.MozTransition||void 0!==e.MsTransition||void 0!==e.OTransition}(),onTransitionEnd:function(e,t,n){n=n||300,WebPlatform.transitionsSupported?e.on("webkitTransitionEnd.trans mozTransitionend.trans oTransitionEnd.trans msTransitionEnd.trans transitionend.trans",(function(){e.off(".trans"),t()})):WebPlatform.delay(n,t)},onAnimationEnd:function(e,t,n){WebPlatform.transitionsSupported?e.on("webkitAnimationEnd.trans mozAnimationEnd.trans oAnimationEnd.trans msAnimationEnd.trans animationend.trans",(function(){e.off(".trans"),t()})):WebPlatform.delay(n||50,t)},clearDelay:function(e){null!==e&&clearTimeout(e)},getCookieName:function(e){return"wplatform-"+e},delay:function(e,t){return setTimeout(t,e)},onImagesLoaded:function(e,t){e.waitForImages(t)},showClientError:function(e,t){t=t||3e3;var n=$('<div class="live-theme-message">'+e+"</div>");n.appendTo(".theme"),WebPlatform.delay(50,(function(){n.addClass("show-message"),WebPlatform.delay(t,(function(){WebPlatform.onTransitionEnd(n,(function(){n.remove()}),300),n.removeClass("show-message")}))}))},showClientMessage:function(e,t){t=t||3e3;var n=$('<div class="live-theme-message info-message">'+e+"</div>");n.appendTo(".theme"),WebPlatform.delay(50,(function(){n.addClass("show-message"),WebPlatform.delay(t,(function(){WebPlatform.onTransitionEnd(n,(function(){n.remove()}),300),n.removeClass("show-message")}))}))},parse:function(e,t,n){return n=!0===n,t=t||0,e=parseInt(e,10),isNaN(e)&&(e=t),!n&&e<0?t:e},sharePage:function(e,t,n){var r=n||window.location.href;r.indexOf("?")>=0?r+="&_share="+WebPlatform.tick():r+="?_share="+WebPlatform.tick();var i=encodeURIComponent(r),a=encodeURIComponent(document.title);"facebook"===e?window.open("https://www.facebook.com/sharer/sharer.php?u="+i,"_blank","width=600, height=600"):"google-plus"===e?window.open("https://plus.google.com/share?url="+i,"_blank","width=500, height=600"):"twitter"===e?window.open("https://twitter.com/intent/tweet?url="+i,"_blank","width=500, height=300"):"linkedin"===e?window.open("https://www.linkedin.com/shareArticle?mini=true&url="+i+"&title="+a,"_blank","width=500, height=300"):"tumblr"===e?window.open("http://www.tumblr.com/share/link?url="+i,"_blank","width=500, height=300"):"pinterest"===e?window.open("https://www.pinterest.com/pin/create/button/?url="+i,"_blank","width=800, height=500"):""!==$.trim(t)&&(t=encodeURIComponent($.trim(t)),window.open(t))},makeClientWebsiteRequestWithFile:function(e,t){if(t){mergeUnique(e,{url:"",data:{},onOk:dummy,action:"Invalid Action!",method:"getJSON",onRequestError:function(e,t,n){Log.log(n),WebPlatform.showClientError(n)},_onNotOk:function(t){Log.error("Action: "+e.action),WebPlatform.showClientError(WebPlatform.Phrases[t.message]||t.message)},always:dummy}),e.onNotOk=e.onNotOk||e._onNotOk;var n=WebPlatform.getCSRFToken(),r={action:e.action,_csrfToken:n,r:Math.random()};mergeUnique(r,e.data);var i=new FormData;for(var a in $.isArray(t)||(t=[t]),t.forEach((function(e,t){i.append("_file_"+(t>0?t:""),e),i.append("_file_name_"+(t>0?t:""),e.name||"")})),i.append("_has_file_",!0),i.append("_file_number",t.length),r){var o=r[a];$.isArray(o)&&(o=JSON.stringify(o)),i.append(a,o)}$.ajax({url:"/clientRequestHandler/"+e.url,headers:{"X-S-CSRF-TOKEN":n},type:"POST",data:i,cache:!1,contentType:!1,processData:!1},"json").done((function(t){t.ok?e.onOk(t):(isUndefined(t.ok)&&(Log.error("Response doesn't include status infurmation! {ok: true}"),Log.error(t)),e.onNotOk(t))})).fail(e.onRequestError).always(e.always)}else WebPlatform.makeClientWebsiteRequest(e)},makeClientWebsiteRequest:function(e){mergeUnique(e,{url:"",data:{},onOk:dummy,action:"Invalid Action!",method:"getJSON",onRequestError:function(e,t,n){Log.log(n),WebPlatform.showClientError(n)},_onNotOk:function(t){Log.error("Action: "+e.action),WebPlatform.showClientError(WebPlatform.Phrases[t.message]||t.message)},always:dummy}),e.onNotOk=e.onNotOk||e._onNotOk;var t=WebPlatform.getCSRFToken(),n={action:e.action,_csrfToken:t,r:Math.random()};mergeUnique(n,e.data);"getJSON"===e.method?$.getJSON:"post"===e.method?$.post:$.get;var r={url:"/clientRequestHandler/"+e.url,data:n,headers:{"X-S-CSRF-TOKEN":t}};"getJSON"===e.method&&(r.dataType="json"),"post"===e.method.toLowerCase()&&(r.type="POST"),$.ajax(r).done((function(t){t.ok?e.onOk(t):(isUndefined(t.ok)&&(Log.error("Response doesn't include status infurmation! {ok: true}"),Log.error(t)),e.onNotOk(t))})).fail(e.onRequestError).always(e.always)},format:function(){var e=arguments;if(e.length%2!=1)throw"Invalid number of arguments! Usage: format(formatString, key, value, key, value...)";for(var t=e[0],n=1;n<e.length;n+=2){var r=new RegExp("%"+e[n]+"%","g");t=t.replace(r,e[n+1])}return t},escapeFormat:function(){var e=arguments;if(e.length%2!=1)throw"Invalid number of arguments! Usage: format(formatString, key, value, key, value...)";for(var t=e[0],n=1;n<e.length;n+=2){var r=new RegExp("%"+e[n]+"%","g");t=t.replace(r,WebPlatform.escapeHtml(e[n+1]))}return t},isMobile:function(){return $window.width()<=1024},removeLightbox:function(e){isUndefined(window.TmdpLightbox)||TmdpLightbox.removeLightbox(e)},refreshInlineGallery:function(e){if($.tosrus){e.removeClass("none");var t={autoplay:{play:!1!==e.data("autoplay"),pauseOnHover:!0===e.data("pauseonhover"),timeout:e.data("timeout")||4e3},slides:{scale:e.data("scale")||"fill"},buttons:{prev:!1!==e.data("arrows"),next:!1!==e.data("arrows")},pagination:{add:!0===e.data("pagination")}},n=window.innerWidth<768?1:WebPlatform.parse(e.data("items"),1),r=e.data("width");n&&(t.slides.visible=n);var i=e.data("itemsPerSlide");i&&(t.slides.slide=i),r&&(t.slides.width=r),e.addClass("with-gallery").tosrus(t)}},refreshLightboxes:function(e,t){isUndefined(window.TmdpLightbox)||TmdpLightbox.refreshLightboxes(e),!0!==t&&$.tosrus&&$(".inline-gallery:not(.with-gallery)").each((function(){WebPlatform.refreshInlineGallery($(this))}))},_accumulatedRequests:[],addAccumulatedRequest:function(e){WebPlatform._accumulatedRequests.push({action:e.action||"",params:e.params||{},onOk:e.onOk||dummy})},processAccumulatedRequests:function(){if(WebPlatform._accumulatedRequests.length>0){var e=WebPlatform._accumulatedRequests,t=[];WebPlatform._accumulatedRequests=[];for(var n=0;n<e.length;++n)t.push({action:e[n].action,params:e[n].params});WebPlatform.makeClientWebsiteRequest({action:"accumulatedRequests",method:"post",data:{requests:JSON.stringify(t)},onOk:function(n){for(var r=n.data,i=0;i<e.length;++i){var a=r[e[i].action];if(a)try{(e[i].onOk||dummy)(a)}catch(e){Log.error(e)}}e=null,t=null}})}},parseSimpleShare:function(e,t,n,r){var i="",a=!0===n?e>0:1==(1&e),o=2,s=8,l=16;if(r=r||function(e){return'<i class="fa fa-'+e+'"></i>'},n&&(o=1,2,s=4,l=8),t=(t||"").toString(),a){i+='<div class="sharer">',t.indexOf("?")>=0?t+="&_share="+WebPlatform.tick():t+="?_share="+WebPlatform.tick();var c=encodeURIComponent(t);(e&o)===o&&(i+='<a href="javascript: void(0)" class="fb-icon" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u='+c+"', '_blank', 'width=600, height=600');\">"+r("facebook")+"</a>"),(e&s)===s&&(i+='<a href="javascript: void(0)" class="tw-icon" onclick="window.open(\'https://twitter.com/intent/tweet?url='+c+"', '_blank', 'width=500, height=300');\">"+r("twitter")+"</a>"),(e&l)===l&&(i+='<a href="javascript: void(0)" class="ln-icon" onclick="window.open(\'https://www.linkedin.com/shareArticle?mini=true&url='+c+"', '_blank', 'width=500, height=300');\">"+r("linkedin")+"</a>"),i+="</div>"}return i},URL_PARAM_INT:"\\d+",URL_PARAM_ANY:"[^/]+",URL_PARAM_ANY_WITH_EMPTY:"[^/]*",getUrlParameterMap:function(e,t){var n=(e=e||document.location.href).indexOf("?"),r=e.indexOf("#");if(r<0&&(r=e.length),n<0||n>=e.length||r<n)return{};for(var i,a=e.substring(n+1,r).split("+").join(" "),o={},s=/[?&]?([^=]+)=([^&]*)/g;i=s.exec(a);){var l=i[1];!0===t&&(l=l.toLowerCase()),o[decodeURIComponent(l)]=decodeURIComponent(i[2])}return o},getUrlParameter:function(e,t,n){var r=new RegExp("(/"+t+"/"+n+"$)|(/"+t+"/"+n+"/)",""),i=e.match(r);return null===i||i.length<1||!i[0]?"":(i=i[0]).substring(i.indexOf("/","/"===i[0]?1:0)+1,i.endsWith("/")?i.length-1:i.length)},clearUrlParameter:function(e,t,n){var r=new RegExp("(/"+t+"/"+n+"$)|(/"+t+"/"+n+"/)","");return e.replace(r,"/")},getUrlQueryParameter:function(e,t){var n=e.indexOf("?");if(n<0)return"";var r=e.indexOf("#");r<0&&(r=e.length);for(var i=(e=e.substring(n+1,r)).split("&"),a=0;a<i.length;++a){var o=i[a].split("=");if(o[0]===t)return o.length>0?o[1]:""}return""},tr:function(e,t){return((e||{})[locale]||{})[t]||t},timeToString:function(e,t){var n=e.getHours(),r=e.getMinutes();if(t)return(n<10?"0":"")+n+":"+(r<10?"0":"")+r;var i=n<12?"AM":"PM";return 0===n?n=12:n>12&&(n-=12),(n<10?"0":"")+n+":"+(r<10?"0":"")+r+" "+i},cartesianProduct:function(e,t){for(var n=[],r=e.length-1,i=[],a=!1,o=e.length;o--;)i[o]=e[o].length;!function o(s){var l=e[s],c=i[s];if(s===r){for(var u=0;u<c;++u)if(n[s]=l[u],a=!1===t.call(WebPlatform,n))return}else for(u=0;u<c;++u)if(n[s]=l[u],o(s+1),a)return;n.pop()}(0)},getRandomString:function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;++r)t+=n.charAt(Math.floor(Math.random()*n.length));return t},getCSRFToken:function(){var e=Cookies.get("_csrfToken")||null;if(null===e||e.length<36){var t=document.body.dataset.minor||(window.platformId||"")+"."+(window.websiteId||"")+"."+window.clientId;e=WebPlatform.getRandomString(6)+"-"+WebPlatform.getRandomString(6)+"-"+WebPlatform.getRandomString(6)+"-"+t;var n=new Date;n.setTime(n.getTime()+18e5);var r={expires:n,path:"/"};"https:"===window.location.protocol&&(r.sameSite="None",r.secure=!0),Cookies.set("_csrfToken",e,r)}return e},shuffle:function(e){var t,n,r;for(r=e.length;r;r--)t=Math.floor(Math.random()*r),n=e[r-1],e[r-1]=e[t],e[t]=n},getVatRate:function(e){switch(e){case"BE":case"CZ":case"ES":case"LV":case"LT":case"NL":return 21;case"BG":case"EE":case"FR":case"AT":case"SK":return 20;case"DK":case"HR":case"SE":case"NO":return 25;case"DE":case"CY":case"RO":return 19;case"GR":case"FI":case"EL":case"GR":return 24;case"IE":case"PL":case"PT":return 23;case"IT":case"SI":return 22;case"LU":return 17;case"HU":return 27;case"MT":return 18;default:return 0}},currencyWithCodeToStr:function(e,t,n){switch(t){case"USD":case"AUD":case"HKD":case"MXN":return WebPlatform.currToStr(e,"$",!0,t,n);case"EUR":return WebPlatform.currToStr(e,"€",!0,t,n);case"BGN":return WebPlatform.currToStr(e,"лв",!1,t,n);case"BRL":return WebPlatform.currToStr(e,"R$",!0,t,n);case"CAD":return WebPlatform.currToStr(e,"C$",!0,t,n);case"CHF":return WebPlatform.currToStr(e,"CHF",!1,t,n);case"CZK":return WebPlatform.currToStr(e,"Kč",!1,t,n);case"DKK":case"NOK":case"SEK":return WebPlatform.currToStr(e,"kr",!1,t,n);case"GBP":return WebPlatform.currToStr(e,"£",!0,t,n);case"HUF":return WebPlatform.currToStr(e,"Ft",!1,t,n);case"ILS":return WebPlatform.currToStr(e,"₪",!1,t,n);case"INR":return WebPlatform.currToStr(e,"₹",!0,t,n);case"JPY":case"CNY":return WebPlatform.currToStr(e,"¥",!0,t,n);case"MYR":return WebPlatform.currToStr(e,"RM",!1,t,n);case"NZD":return WebPlatform.currToStr(e,"NZ$",!0,t,n);case"PHP":return WebPlatform.currToStr(e,"₱",!0,t,n);case"PLN":return WebPlatform.currToStr(e,"zł",!1,t,n);case"RUB":return WebPlatform.currToStr(e,"RUB",!1,t,n);case"SGD":return WebPlatform.currToStr(e,"S$",!0,t,n);case"THB":return WebPlatform.currToStr(e,"฿",!0,t,n);case"TWD":return WebPlatform.currToStr(e,"NT$",!0,t,n);case"ZAR":return WebPlatform.currToStr(e,"R",!0,t,n);default:return WebPlatform.currToStr(e,t,!1,t,n)}},hasCents:function(e){if(null===e)return!0;switch(e){case"JPY":case"CNY":case"BIF":case"CLP":case"DJF":case"GNF":case"ISK":case"KMF":case"KRW":case"PYG":case"RWF":case"UGX":case"UYI":case"VND":case"VUV":case"XAF":case"XOF":case"XPF":case"COP":case"HUF":return!1}return!0},getStripeLocale:function(e){var t=e||window.locale||"auto";switch(t){case"pt_BR":return"pt-BR";case"pt_PT":return"pt";case"ar":case"bg":case"cs":case"da":case"de":case"el":case"et":case"en":case"es":case"fi":case"fr":case"he":case"id":case"it":case"ja":case"lt":case"lv":case"ms":case"nb":case"nl":case"pl":case"pt-BR":case"pt":case"ru":case"sk":case"sl":case"sv":case"zh":return t}return"auto"},addThousandsSeparator:function(e){return(e+"").replace(/\B(?=(\d{3})+(?!\d))/g,",")},currToStr:function(e,t,n,r,i){n=!0===n;var a=e<0;a&&(e=-e);var o=e.toFixed?e.toFixed(WebPlatform.hasCents(r)?2:0):""+e;return""!==t&&(o=WebPlatform.addThousandsSeparator(o)),t&&i&&(t=i(t)),(a?"-":"")+(n?t+o:o+t)},_requestedResources:[],requestScripts:function(e,t){if(t=t||dummy,0!==(e=e||[]).length){var n=document.getElementsByTagName("script")[0];e.forEach((function(e){for(var t=!1,r=0;r<WebPlatform._requestedResources.length;++r)if(WebPlatform._requestedResources[r]===e.script){t=!0;break}if(!t&&!e.check()){WebPlatform._requestedResources.push(e.script);var i=document.createElement("script");if(i.type="text/javascript",i.async=1,i.src=e.script,n.parentNode.insertBefore(i,n),e.style){let t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.href=e.style,n.parentNode.insertBefore(t,n)}}}));var r=function(){var n=0;e.forEach((function(e){e.check()||++n})),n>0?WebPlatform.delay(50,r):t()};r()}else t()},requestResource:function(e,t,n,r){if(r=r||dummy,(n=n||(()=>!0))())return void r();let i=document.getElementsByTagName("script")[0];if(e){if(!(WebPlatform._requestedResources.indexOf(e)>-1)){WebPlatform._requestedResources.push(e);let t=document.createElement("script");t.type="text/javascript",t.async=1,t.src=e,i.parentNode.insertBefore(t,i)}}if(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,i.parentNode.insertBefore(e,i)}let a=()=>{n()?r():WebPlatform.delay(50,a)};WebPlatform.delay(50,a)},initFixedHeader:function(e,t){var n=e.find(".fixed-header-wrapper");if(0!==n.length&&!n.hasClass("initiated")&&!n.hasClass("header-hidden")){n.addClass("initiated");var r=e.find(".main-header-wrapper");if(!0===t){var i=r.offset();n.css({top:i.top+"px"})}e.scroll($.throttle(150,(function(){var t=e.scrollTop();r.height()<=t?n.addClass("visible"):n.removeClass("visible")}))).scroll()}},getObjectFromLocalStorage:function(e,t){try{var n=window.localStorage.getItem(e);return n?JSON.parse(n+""):t}catch(e){return Log.error(e),t}},setObjectToLocalStorage:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){Log.error(e)}},removeFromLocalStorage:function(e){try{window.localStorage.removeItem(e)}catch(e){Log.error(e)}},initiateBraintree3DSecureIfEnabled:function(e,t,n){window.braintree.threeDSecure.create({client:e,version:2},(function(r,i){r?"THREEDS_NOT_ENABLED"===r.code?(Log.info("3DS not supported"),t(null)):"THREEDS_NOT_ENABLED_FOR_V2"===r.code?window.braintree.threeDSecure.create({client:e,version:1},(function(e,r){e?"THREEDS_NOT_ENABLED"===e.code?(Log.info("3DS not supported"),t(null)):n(e):t(r)})):n(r):t(i)}))},getLocaleName:function(e){switch(e){case"en":return"en_US";case"bg":return"bg_BG";case"da":case"da_JK":return"da_DK";case"de":return"de_DE";case"el":case"gr":return"el_GR";case"es":return"es_ES";case"fr":return"fr_FR";case"it":return"it_IT";case"nb":return"nb_NO";case"nl_NL":return"nl_NL";case"pt_PT":return"pt_PT";case"pt_BR":return"pt_BR";case"ro":return"ro_RO";case"sv_SE":return"sv_SE";case"pl":return"pl_PL";case"zh":case"zh_JO":return"zh_CN";case"iw":return"he_IL";case"ar":return"ar_EG";case"hu":return"hu_HU";case"hr":return"hr_HR";case"th":return"th_TH";case"kr":case"ko":return"ko_KR";case"vn":return"vi_VN";case"ru":return"ru_RU";case"is":return"is_IS";case"jp":return"ja_JP";default:return e}},isPartiallyInView:function(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,i=Math.max(document.documentElement.clientWidth,window.innerWidth||0),a=Math.max(document.documentElement.clientHeight,window.innerHeight||0),o=e.clientWidth,s=e.clientHeight;return r<a&&r+s>0&&n<i&&n+o>0},scrollIntoView:function(e){WebPlatform.delay(50,(function(){e[0].scrollIntoView&&!WebPlatform.isPartiallyInView(e[0])&&e[0].scrollIntoView({behavior:"smooth"})}))},extractYoutubeVideoId:function(e){var t,n=(e=e.replace("://www.","://")).toLowerCase().indexOf("://youtu.be");return n>-1?(t=e.substring(n+12)).indexOf("?")>-1&&(t=t.substring(0,t.indexOf("?"))):t=WebPlatform.getUrlQueryParameter(e,"v",WebPlatform.URL_PARAM_ANY_WITH_EMPTY),t},_sessionDetails:null,_pendingSDCallbacks:[],clearSessionDetails:function(){WebPlatform._sessionDetails=null},getSessionDetails:function(e){WebPlatform._sessionDetails?e(WebPlatform._sessionDetails):(WebPlatform._pendingSDCallbacks.push(e),1===WebPlatform._pendingSDCallbacks.length&&WebPlatform.makeClientWebsiteRequest({action:"getSessionDetails",onOk:function(e){WebPlatform._sessionDetails=e.data,WebPlatform.ipCountryCode=WebPlatform._sessionDetails.ipCountryCode,WebPlatform.Members.current=WebPlatform._sessionDetails.member,WebPlatform.hash=WebPlatform._sessionDetails.websiteHash,WebPlatform._pendingSDCallbacks.forEach((e=>e(WebPlatform._sessionDetails))),WebPlatform._pendingSDCallbacks=[]}}))},loadClientComponent:function(e,t){return new Promise((function(n){WebPlatform.requestResource([resources,"/components/client/",e,"/",t,".js?v=",resourcesVersion].join(""),[resources,"/components/client/",e,"/",t,".css?v=",resourcesVersion].join(""),(function(){return WebPlatform.ClientComponents&&WebPlatform.ClientComponents[e]}),(function(){n(WebPlatform.ClientComponents[e])}))}))},grecaptcha:function(e="submit",t){window.grecaptcha||console.error("reCAPTCHA is not loaded!"),window.grecaptcha.enterprise.ready((function(){window.grecaptcha.enterprise.execute(WebPlatform.gRecaptchaKey,{action:e}).then((function(e){t(e)}))}))}}),WebPlatform.gRecaptchaKey=window.inTestEnvironment?"6LcqRjErAAAAAIJgr-1eoZnlaU_clQadljtoFxHe":"6LclNS0rAAAAAHeEbgz5WBnqNPMKTu4VFG6LMKN7",WebPlatform.Phrases=mergeUnique(WebPlatform.Phrases||{},{"client.by":"by","client.on":"on","client.in":"in","label.of":"of","client.comment":"Comment","client.comments":"Comments","client.read_more":"Read more","client.load_more":"Load more","label.view":"View","label.years":"Years","label.months":"Months","label.month":"month","label.year":"year","label.months_lower":"months","label.years_lower":"years","label.week_lower":"week","label.weeks_lower":"weeks","label.saving":"Saving","label.days":"Days","label.hours":"Hours","label.seconds":"Seconds","label.shipping_address":"Shipping Address","label.billing_address":"Billing Address","label.january":"January","label.february":"February","label.march":"March","label.april":"April","label.may":"May","label.june":"June","label.july":"July","label.august":"August","label.september":"September","label.october":"October","label.november":"November","label.december":"December","label.jan":"Jan","label.feb":"Feb","label.mar":"Mar","label.apr":"Apr","label.may_short":"May","label.jun":"Jun","label.jul":"July","label.aug":"Aug","label.sep":"Sep","label.oct":"Oct","label.nov":"Nov","label.dec":"Dec","label.add_to_cart":"Add To Cart","label.buy_now":"Buy Now","label.update":"Update","label.change":"change","label.select_product_variant":"Choose variation for each item in your order","err.select_product_variants":"Select variant","label.checkout_now":"Checkout Now","label.cod":"Pay on delivery","label.bank":"Bank Transfer","label.yes":"YES","label.no":"NO","label.contact_booked_error":"You already booked a spot in this group event","label.already_booked_time_error":"Selected time is not available, please select different time","label.booking_notice_error":"Booking too close to current time, please reload the page","label.slots_left":"slots left","error.fill_required_fields":"Please fill all the required fields!"}),WebPlatform.Widgets={},WebPlatform.defaultPagePagination='<a class="none arrow-nav" rel="client-tab" title="" data-role="-1"> <i class="fa fa-angle-left fa-2x"></i></a><a class="none" rel="client-tab" title="" data-role="-2"></a><a class="none" rel="client-tab" title="" data-role="-1"></a><a rel="client-tab" title="" data-role="0"></a><a class="none" rel="client-tab" title="" data-role="+1"></a><a class="none" rel="client-tab" title="" data-role="+2"></a><a class="none arrow-nav" rel="client-tab" title="" data-role="+1"> <i class="fa fa-angle-right fa-2x"></i></a>',WebPlatform.defaultOnePagePagination='<a rel="client-tab" title="" data-role="more">%more%</a>',WebPlatform.Widgets.shouldRender=function(e){if(!e)return!1;if(e instanceof jQuery||(e=$(e)),!e.length)return!1;if(!window.ClientTools)return!0;if(!e.hasClass("widget")&&!e.hasClass("widget-row")){let t=e.closest(".widget");e=t.length?t:e.closest(".large-popup-wrapper")}if(!e||!e.length)return!1;var t=e.closest(".grid-row"),n=$window.width();return n<=768?n<=480?!t.hasClass("phone-hidden"):!t.hasClass("tablet-hidden"):!e.hasClass("mobile-only")&&!t.hasClass("mobile-only")},WebPlatform.Widgets.Blog=function(e){var t=e.id,n=e.baseNavigationUrl,r=e.listType,i=e.paginationType,a=e.blogCategory,o=e.itemsCount,s=!!e.disqusEnabled,l=e.author,c=e.ids||null,u=e.tag,d=e.socialNetworksSum||0,f=1,p=0,h="masonry"===r,m=e.root||$("#blog-widget-"+t),g=e.pagination||m.find(".pagination"),v="carousel"===r;if(!WebPlatform.Widgets.shouldRender(m))return{loadPage:dummy,destroy:dummy};function b(b,y){WebPlatform.addAccumulatedRequest({action:"getPostsInfo_"+t,params:{items:o,category:a,page:b,tag:u,author:l,ids:c||null},onNotOk:e.onFailed||dummy,onOk:function(t){WebPlatform.Phrases["client.by"],WebPlatform.Phrases["client.on"];var a=WebPlatform.Phrases["client.in"],l=WebPlatform.Phrases["client.comment"],c=WebPlatform.Phrases["client.comments"],u=WebPlatform.Phrases["client.read_more"],b=v?'<div %style% data-slide="" data-index="%idx%">':"";b+='<article class="blog-post-article %blogPostDelayed%" data-animation="blogPostAnimation" data-delay="0.05">   <a href="/'+e.blogUrl+'/%url%" title="%altText%" class="post-featured post-featured-%featuredtype%">%featured%</a>   <div class="post-summary">      <header>        <div class="post-header">        <h2 class="post-title"><a href="/'+e.blogUrl+'/%url%" class="highlightColor">%title%</a></h2>         <span class="post-meta">           <span class="post-author"><a href="/'+e.blogUrl+'/author/%author%">%author%</a></span>          <span class="post-category">%categories%</span>           <span class="post-time"><p>%created%</p></span>  '+(s?"":'<span class="post-comments">%comments%</span>  ')+'       </span>        </div>  %share%     </header>      <span class="post-description">%description%</span>      <div class="read-more-wrapper"><a href="/'+e.blogUrl+'/%url%" class="read-more primaryColor-bg">'+u+"</a></div>    </div>  </article>",v&&(b+="</div>");var y=t.posts;if(p=Math.floor(t.allPostsCount/o)+(t.allPostsCount%o>0?1:0),f=t.page,0!==y.length){var w=m.find(".posts-list-wrapper");"pagination"!==i||h||w.find("article").remove(),v&&(w.addClass("inline-gallery"),w.find(".blog-post-sizer").remove());for(var C=$([]),x=0;x<y.length;++x){var k=y[x],P="",S="",T="",W=WebPlatform.escapeHtml(k.title);if(v){T='style="width: 100%; margin: 0 auto; float: none;"'}if(0===k.featured.type){var E=k.featured.data,L=k.featured.dataBase;P+="large"===r||v?"<span style='background-image: url(\""+getFileFromBase(L)+E+"?format=webp\");'></span>":"medium"===r?"<span style='background-image: url(\""+getThumbnailsFromBase(L,"640x480")+E+"?format=webp\");'></span>":'<img src="'+getFileFromBase(L)+E+'?format=webp" alt="'+W+'" />'}else if(1===k.featured.type){P+='<div class="inline-gallery">';for(var A=0;A<k.featured.data.length;++A){P+='<img src="'+("large"===r||v?getFileFromBase(k.featured.dataBase[A])+k.featured.data[A]:getThumbnailsFromBase(k.featured.dataBase[A],"640x480")+k.featured.data[A])+'?format=webp" alt="" />'}P+="</div>"}else 2===k.featured.type?P+='<div class="fluid-video-wrapper">'+k.featured.data+"</div>":3===k.featured.type?P+='<h1 class="primaryColor-bg2">'+k.featured.data+"</h1>":k.featured.type;for(A=0;A<k.categories.length;++A)S+=0===A?"<span>"+a+"&nbsp;</span>":" / ",S+='<a href="/'+e.blogUrl+"/category/"+k.categories[A].second+'" title="">'+k.categories[A].first+"</a>";var _=window.location.protocol||"https:",D=k.created||" ";D=D.split(" ")[0];var O=WebPlatform.parseSimpleShare(d,_+"//"+location.hostname+"/"+e.blogUrl+"/"+k.url),I=WebPlatform.format(b,"featured",P,"featuredtype",k.featured.type,"comments",k.approvedCommentsCount+" "+(1!==k.approvedCommentsCount?c:l),"blogPostDelayed",h||v?"":"anim-delayed-item","share",O,"categories",S,"url",k.url,"title",k.title,"altText",W,"created",D,"description",k.description,"author",k.author,"idx",x,"style",T);I=$(I),w.append(I),h&&(C=C.add(I))}if(h&&y.length>0)"pagination"===i&&w.shuffle("remove",m.find(".shuffle-item")),w.data("shuffle").appended(C,!0,!0),WebPlatform.onImagesLoaded(w,(function(){w.shuffle("update")}));else if("pagination"===i){var F=$window.scrollTop(),M=m.offset().top;M<F&&$window.scrollTop(M)}!function(){if("none"===i||0===p)g.hide().find("a").removeAttr("href");else if("pagination"===i){var t=g.find('[data-role="0"]'),r=g.find('[data-role="-1"]'),a=g.find('[data-role="-2"]'),o=g.find('[data-role="+1"]'),s=g.find('[data-role="+2"]');t.text(f),e.baseNavigationUrl&&(r.attr("href",n+"page/"+(f-1)),a.attr("href",n+"page/"+(f-2)),o.attr("href",n+"page/"+(f+1)),s.attr("href",n+"page/"+(f+2))),r[f<2?"addClass":"removeClass"]("none").not(".arrow-nav").text(f-1),a.text(f-2)[f<3?"addClass":"removeClass"]("none"),o[f<p?"removeClass":"addClass"]("none").not(".arrow-nav").text(f+1),s.text(f+2)[f+1<p?"removeClass":"addClass"]("none"),g.show(),g.find("a.none").removeAttr("href")}else f===p?g.hide().find("a").removeAttr("href"):(e.baseNavigationUrl&&g.find('[data-role="more"]').attr("href",n+"page/"+(f+1)),g.show())}(),$window.scroll(),ClientTools&&ClientTools.refreshAnimations(),WebPlatform.refreshLightboxes(),(e.onLoaded||dummy)()}}}),y&&WebPlatform.processAccumulatedRequests()}return v&&(i="none"),e.baseNavigationUrl||g.on("click","[data-role]",(function(e){var t,n=$(e.currentTarget).data("role");if("more"===n)t=1;else{if("0"===n)return;t=parseInt(n)}if(!(f+t>p||f+t<0))return b(f+t,!0),e.stopPropagation(),!1})),"pagination"===i?g.append(WebPlatform.defaultPagePagination):g.append(WebPlatform.format(WebPlatform.defaultOnePagePagination,"more",WebPlatform.Phrases["client.load_more"])),h&&m.find(".posts-list-wrapper").shuffle({itemSelector:".blog-post-article",sizer:m.find(".blog-post-sizer")}),e.page&&b(e.page,!1),{loadPage:function(e){b(e,!0)},destroy:function(){if(h){var e=m.find(".posts-list-wrapper");e.shuffle&&e.shuffle("destroy")}}}},WebPlatform.Widgets.SimpleBlog=function(e){var t=e.id,n=e.blogUrl,r=e.blogType,i=e.blogCategory,a=e.itemsCount,o="posts";o="posts"===r?""===i?"getRecentPosts":"getRecentPostsByCategory":"categories"===r?"getCategories":"getTags",WebPlatform.addAccumulatedRequest({action:o,params:{items:a,category:i},onNotOk:e.onFailed||dummy,onOk:function(o){for(var s=(e.widget?e.widget:$("#blog-widget-"+t)).find(".blog-items-wrapper").removeClass("visible"),l="",c=0;c<Math.min(o.length,a);++c){var u=o[c];if("posts"===r){if(u.category===i){var d=u.created||" ";d=d.split(" ")[0],l+='<div class="blog-widget-item recent-post"><a href="/'+n+"/"+u.url+'" class="highlightColor">'+u.title+"</a><span>"+d+"</span></div>"}}else"categories"===r?l+='<div class="blog-widget-item blog-categories"><a href="/'+n+"/category/"+u.url+'" class="highlightColor">'+u.category+"</a></div>":"tags"===r&&(l+='<a href="/'+n+"/tag/"+u.url+'" class="highlightBg">'+u.tag+"</a>")}s.append(l).addClass("visible"),(e.onLoaded||dummy)()}})},WebPlatform.Widgets.Store=function(e){if(mergeUnique(e,{maxItemsCount:10,exclude:-1,root:null,labelFrom:"From&nbsp;",labelSale:"Sale",labelQuickView:"Quick View",labelSoldOut:"Sold Out",baseUrl:"",itemsPerRow:4,itemGap:1,showProductName:!0,showProductPrice:!0,hasProductQuickView:!1,autoChangeSlides:!1,autoChangeSlidesTimeout:4e3,layout:"grid",fakeGallery:!1,productLayout:"style-1",productAlign:"left",quickViewBtnStyle:"quick-view-1",itemsType:"products",storeItems:[],discountBadgeType:"none",currency:WebPlatform.Store.currency,currencySymbol:WebPlatform.Store.currencySymbol,currencySymbolAtLeft:WebPlatform.Store.currencySymbolAtLeft,imageSize:80,imageSizeType:"",storeProcess:"buy",imageBorderRadius:10,includeAddToCartButton:!1,sort:"",imageBgColor:"transparent",boxBg:"transparent",boxPadding:0,boxRadius:0,showingInventory:!0,leftInStockThreshold:10,textClass:"",priceTextClass:"",shadow:""}),null===e.root&&(e.root=$([])),WebPlatform.Widgets.shouldRender(e.root)){switch(e.productLayout){case"text-center":e.productLayout="style-1",e.productAlign="center";break;case"text-left":e.productLayout="style-1",e.productAlign="left";break;case"text-over":e.productLayout="product-list-style-text-over",e.productAlign="center";break;case"text-boxed":e.productLayout="style-2",e.productAlign="center"}var t="cart"===e.storeProcess?WebPlatform.Phrases["label.add_to_cart"]:WebPlatform.Phrases["label.buy_now"];e.fakeGallery=e.fakeGallery&&"grid"!==e.layout,e.fakeGallery?e.itemWidth=(100-e.itemsPerRow*e.itemGap)/e.itemsPerRow:e.itemWidth=(100-(e.itemsPerRow-1)*e.itemGap)/e.itemsPerRow,WebPlatform.addAccumulatedRequest({action:"latest"===e.itemsType?"getLatestStoreItems":"products"===e.itemsType?"getStoreItems":"getStoreItemsByCategory",params:{itemIds:e.storeItems,items:"latest"===e.itemsType?e.maxItemsCount:0,sort:e.sort},onOk:function(n){for(var r="grid"===e.layout||e.fakeGallery,i=[],a="products"!==e.itemsType,o="latest"===e.itemsType,s=0;s<n.length;++s){var l=n[s];if(e.maxItemsCount>0&&i.length>=e.maxItemsCount)break;if(l.id!==e.exclude)if(o)i.push(l);else if(a){for(var c=0;c<l.categories.length;++c)if(e.storeItems.indexOf(l.categories[c].id)>-1){i.push(l);break}}else e.storeItems.indexOf(l.id)>-1&&i.push(l)}var u=i.length;if(e.fakeGallery&&(u=Math.min(e.itemsPerRow,i.length)),r)var d='<div class="products-list">';else d='<div class="products-list inline-gallery" data-autoplay="true" data-pauseonhover="true" data-arrows="true" data-items="'+e.itemsPerRow+'" data-timeout="'+(e.autoChangeSlides?e.autoChangeSlidesTimeout:"86400000")+'" data-pagination="false">';var f=e.root.closest(".grid-row").hasClass("grid-row-fullwidth")?5:4;for(s=0;s<u;++s){l=i[s];var p=s<e.itemsPerRow?0:e.itemGap+"%",h=0,m=(s+1)%e.itemsPerRow==0?0:e.itemGap+"%";e.fakeGallery&&(p=0,h=m=e.itemGap/2+"%");var g="background: "+e.boxBg+"; padding: "+e.boxPadding+"px "+e.boxPadding+"px; border-radius: "+e.boxRadius+"px; ";e.shadow&&(g+=e.shadow+";"),g+=r?"width: "+e.itemWidth+"%; margin: "+p+" "+m+" 0 "+h+"; ":"width: "+e.itemWidth*e.itemsPerRow+"%; margin: 0 auto; float: none;",d+='<div class="product-item '+e.imageSizeType+" "+(e.hasProductQuickView?" with-quick-view ":"")+'" data-slide="" data-idx="'+s+'" data-id="'+l.id+'" style="'+g+'">';var v=resources+"/images/product-avatar.svg";null!==l.images&&l.images.length>0&&(v=e.itemsPerRow<f?getFileFromBase(l.images[0].base)+l.images[0].name+"?format=webp":getThumbnailsFromBase(l.images[0].base,"640x480")+l.images[0].name+"?format=webp");var b="border-radius: "+e.imageBorderRadius+"px;",y="";""!==e.imageSizeType&&(y+="padding-bottom: "+e.imageSize+"%;","cover-image"===e.imageSizeType&&(y+="background: url('"+v+"') no-repeat center center;",y+="background-size: cover;",y+=b)),d+='<div class="product-main-photo has-badge" style="'+(y+="background-color: "+e.imageBgColor+";")+'"><div class="product-photo-inner-wrapper">         <div class="quick-buttons-wrapper flex align-center justify-center">           <div class="quick-buttons-wrapper-inner flex align-center justify-center">             <a class="quick-store-button flex align-center" data-role="addToCart" data-process="'+e.storeProcess+'"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><path d="M18,6h-2c0-2.21-1.79-4-4-4S8,3.79,8,6H6C4.9,6,4,6.9,4,8v12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8C20,6.9,19.1,6,18,6z M12,4c1.1,0,2,0.9,2,2h-4C10,4.9,10.9,4,12,4z M18,20H6V8h2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8h4v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8 h2V20z"/></g></svg></a>             <a class="quick-store-button flex align-center" data-role="viewProduct"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="18px" fill="#000000"><rect fill="none" height="24" width="24"/><polygon points="21,11 21,3 13,3 16.29,6.29 6.29,16.29 3,13 3,21 11,21 7.71,17.71 17.71,7.71"/></svg></a>           </div>         </div>';var w=' href="'+e.baseUrl+l.url+'" ';WebPlatform.Funnels.isInFunnel()&&WebPlatform.Funnels.hideProductLinks&&(w=""),d+="<a"+w+">","none"!==e.discountBadgeType&&l.onSale&&l.price>0&&(d+='<div class="product-badge">',"text"===e.discountBadgeType?d+=e.labelSale:"percent"===e.discountBadgeType?d+=-l.roundedDiscountInPercent+"%":d+=WebPlatform.currToStr(-l.roundedDiscount,e.currencySymbol,e.currencySymbolAtLeft,e.currency),d+="</div>");var C="cover-image"!==e.imageSizeType?b:"";if(d+='<img src="'+v+'" alt="'+WebPlatform.escapeHtml(l.name)+'" style="'+C+'" />',d+="</a></div>",d+="</div>",e.showProductName||e.showProductPrice){if(d+='<div class="product-item-description"><div><div class="title-price-wrapper-1">',e.showProductName&&(d+='<h3 class="'+e.textClass+'"><a'+w+' class="highlightColor">'+WebPlatform.escapeHtml(l.title)+"</a></h3>"),e.showProductPrice&&(d+='<div class="col20 f-left product-stars flex align-center">                   <div class="product-stars-inner">                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px" class="full-star"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></svg>                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px" class="full-star"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></svg>                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px" class="full-star"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></svg>                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px" class="full-star"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></svg>                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M12 7.13l.97 2.29.47 1.11 1.2.1 2.47.21-1.88 1.63-.91.79.27 1.18.56 2.41-2.12-1.28-1.03-.64-1.03.62-2.12 1.28.56-2.41.27-1.18-.91-.79-1.88-1.63 2.47-.21 1.2-.1.47-1.11.97-2.27M12 2L9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2z"></path></svg>                   </div>                   <a href="" class="product-reviews-link">84 Reviews</a>                 </div><span class="product-item-price '+e.priceTextClass+'"><a'+w+">",l.priceComposite&&(d+=e.labelFrom),d+=WebPlatform.currToStr(l.onSale?l.salePrice:l.price,e.currencySymbol,e.currencySymbolAtLeft,e.currency),l.onSale&&(d+='<span class="scratched">'+WebPlatform.currToStr(l.price,e.currencySymbol,e.currencySymbolAtLeft,e.currency)+"</span>"),l.subscriptionPeriod&&(d+=' <span style="font-size: 0.9em">/'+l.subscriptionPeriod+"</span>"),d+="</a></span>"),d+="</div>",e.showingInventory){var x=0;if(l.combinations&&l.combinations.length)for(var k=0;k<l.combinations.length;++k){var P=l.combinations[k];if(null===P.quantity){x=null;break}x+=P.quantity}else x=null!==l.quantity&&l.quantity>0?l.quantity:null;if(null!==x&&x>0&&x<e.leftInStockThreshold){d+='<div class="scarcity-wrapper">'+(1===x?WebPlatform.Phrases["label.left_in_stock_single"]:WebPlatform.format(WebPlatform.Phrases["label.left_in_stock_multiple"],"x",x))+"</div>"}}d+="</div></div>"}e.hasProductQuickView&&(d+='<div class="quick-view-btn" data-role="viewProduct"><a>'+e.labelQuickView+"</a></div>"),e.includeAddToCartButton&&(d+='<div class="product-list-color none"><span class="color-select active"><div class="color-select-inner" style="background-color: #e1e1e1"></div></span><span class="color-select"><div class="color-select-inner" style="background-color: #de2750"></div></span></div><div class="add-to-btn-wrapper col20 f-left">',l.variations.length>0||null===l.quantity||""===l.quantity||l.quantity>0?(d+='<a data-role="'+(l.variations.length>0?"viewProduct":"addToCart")+'" data-process="'+e.storeProcess+'" class="primaryColor-bg2 add-to-cart">',d+=t,d+="</a>"):d+='<div class="sold-out-btn">'+e.labelSoldOut+"</div>",d+="</div>"),d+="</div>"}e.fakeGallery&&(d+='<a class="tos-prev" style="opacity: 1"><span></span></a>',d+='<a class="tos-next" style="opacity: 1"><span></span></a>'),d+="</div>",e.root.find(".product-list-wrapper").attr("class","product-list-wrapper full-width-layout col20 f-left products-per-row-"+e.itemsPerRow+" "+e.productLayout+" "+e.productAlign+"-align "+e.quickViewBtnStyle+" "+(""!==e.imageSizeType?" image-positioned":"")).html(d),(e.hasProductQuickView||e.includeAddToCartButton)&&e.root.on("mousedown",'[data-role="viewProduct"]',(function(){var e=$(this).closest(".product-item").data("id");return WebPlatform.Store.showProductInQuickView(e),!1})),e.root.on("mousedown",'[data-role="addToCart"]',(function(){var e=$(this),t=e.closest(".product-item").data("id"),n=e.data("process");return WebPlatform.Store.addProductToCart(t,n),!1})),r||WebPlatform.refreshInlineGallery(e.root.find(".inline-gallery"))}})}},WebPlatform.Members=WebPlatform.Members||{},WebPlatform.Store=WebPlatform.Store||{},extend(WebPlatform.Store,{hideUnavailableVariations:!1,activePage:"",editable:!0,cart:void 0,cartTargets:null,quickViewProductRowTemplate:'<div class="cart-row %editableClass% %notAvailableClass%" data-index="%index%" data-product="%productId%">         <div class="image">           <a href="%baseUrl%/%url%" class="highlightColor">%image%</a>         </div>          <div class="product-summary">           <div class="product-info">             <h4 class="col20 f-left"><a href="%baseUrl%/%url%" class="highlightColor">%title%</a></h4>             <span class="col20 f-left %variationsCls%">%variation%</span>             <div class="qty f-left col20 %quantityWrapperClass%">               <div class="number-selector f-left flex align-center">                 <a class="number-pad" data-role="-1" style="line-height: 23px;">-</a>                 <input %disabledAttr% class="cart-row-quantity" type="number" size="4" step="1" max="9999" min="1" value="%quantity%" />                 <a class="number-pad" data-role="+1">+</a>               </div>             </div>           </div>           <span class="row-total">%price%</span>           <a class="row-delete %deleteClass%"><i class="fa fa-trash-o"></i></a>        </div>     </div>',storeProductRowTemplate:'<div class="cart-row cart-row-new %editableClass% %notAvailableClass% %additionalClz%" data-index="%index%" data-product="%productId%">         <div class="image">           <a href="%baseUrl%/%url%" class="highlightColor">%image%</a>         </div>         <div class="product-info">           <h4 class="col20 f-left"><a href="%baseUrl%/%url%" class="highlightColor">%title%</a></h4>           <span class="col20 f-left %variationsCls%">%variation% <a class="variations-update f-none">%changeText%</a></span>           <div class="qty f-left col20 %quantityWrapperClass%">             <div class="number-selector f-left flex align-center">               <a class="number-pad" data-role="-1" style="line-height: 23px;">-</a>               <input %disabledAttr% class="cart-row-quantity" type="number" size="4" step="1" max="9999" min="1" value="%quantity%" />               <a class="number-pad" data-role="+1">+</a>             </div>         </div>           </div>         <span class="row-total">%price%</span>           <a class="row-delete %deleteClass%"><i class="fa fa-trash-o"></i></a>    </div>',storeProductRowTemplateNoLinks:'<div class="cart-row cart-row-new %editableClass% %notAvailableClass% %additionalClz%" data-index="%index%" data-product="%productId%">         <div class="image">%image%</div>         <div class="product-info">           <h4 class="col20 f-left">%title%</h4>           <span class="col20 f-left %variationsCls%">%variation% <a class="variations-update f-none">%changeText%</a></span>           <div class="qty f-left col20 %quantityWrapperClass%">             <div class="number-selector f-left flex align-center">               <a class="number-pad" data-role="-1" style="line-height: 23px;">-</a>               <input %disabledAttr% class="cart-row-quantity" type="number" size="4" step="1" max="9999" min="1" value="%quantity%" />               <a class="number-pad" data-role="+1">+</a>             </div>           </div>         </div>         <span class="row-total">%price%</span>         <a class="row-delete %deleteClass%"><i class="fa fa-trash-o"></i></a>    </div>',storeTaxHeading:'<span class="tax-title">%content%</span>',storeTaxRowTemplate:'<div class="subtotal-wrapper tax-wrapper">       <span class="subtotal"></span>       <span class="subtotal-price tax-value"></span>     </div>',Orders:function(){var e={},t={},n={};return{get:function(t,n){"string"==typeof t&&(t={orderId:t});var r=t.orderId||"cart";isUndefined(e[r])?WebPlatform.makeClientWebsiteRequest({action:"getOrder",data:t,onOk:function(i){var a=i.data.order;e[r]=a,"cart"===r&&(WebPlatform.Store.cart=a);var o={uid:i.uid};t.policies&&(o.policies=i.data.policies),t.paymentOptions&&(o.paymentOptions=i.data.paymentOptions),t.pickProducts&&(o.pickProducts=i.data.pickProducts),WebPlatform.Members.current=i.data.member,WebPlatform.ipCountryCode=i.data.ipCountryCode,n(a,o)}}):n(e[r])},reset:function(t){delete e[t]},set:function(r,i){e[r]=i,"cart"===r&&(WebPlatform.Store.cart=i);for(var a=t[r]||[],o=0;o<a.length;++o){var s=a[o];s&&$.contains(document,s[0])?WebPlatform.Store.renderOrder(i,s,n[r]||[]):a.splice(o--,1)}},bind:function(r,i){if(!i.hasClass("order-rendered")){"string"==typeof r&&(r={orderId:r});var a=(r=mergeUnique(r||{},{id:"cart",products:[],funnelId:-1,stepId:-1,variantId:-1})).id,o=t[a];o||(t[a]=o=[]),r.pickProducts&&r.pickProducts.length>0&&(n[a]=r.pickProducts),o.push(i),function(t,n){if(!n.hasClass("order-rendered")){var r=t.id,i=function(e){return(e=e||{}).orderId=t.id,e.products=JSON.stringify(t.products||[]),e.funnel=t.funnelId,e.funnelStep=t.funnelStepId,e.funnelStepVariant=t.funnelStepVariantId,e};n.on("click",".checkout-item-cbx:not(.checked)",(function(e){return e.stopPropagation(),e.preventDefault(),!1}));var a=function(t){if(t<0)return-1;if(!(n.find(".cart-table .fake-checkbox").length>0))return t;for(var i=(e[r]||{}).items||[],a=0;a<=t&&!(a>=i.length);++a)i[a].bump&&++t;return t>=i.length?-1:t},o=function(e,t){(e=a(e))<0||WebPlatform.makeClientWebsiteRequest({action:"updateCart",data:i({type:"update",index:e,quantity:t}),onOk:function(e){e.data.error&&WebPlatform.showClientError(e.data.error);var t=e.data.cart;WebPlatform.Store.Orders.set(r,t),WebPlatform.Store.updateCartNumber(t.size,!1),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:r,order:t})}})};n.on("click",".row-delete",(function(t){var n=$(this).closest(".cart-row");if(!n.hasClass("update-disabled")){var o=a(n.data("index"));if(!(o<0)){var s=(e[r]||{}).items||[],l=o<s.length?s[o]:null;return WebPlatform.makeClientWebsiteRequest({action:"updateCart",data:i({type:"remove",index:o}),onOk:function(e){l&&WebPlatform.Store.reportRemoveFromCart(l,WebPlatform.Store.currency);var t=e.data;WebPlatform.Store.Orders.set(r,t),WebPlatform.Store.updateCartNumber(t.size,!1),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:r,order:t})}}),t.stopPropagation(),t.preventDefault(),!1}}})).on("click",".number-pad",(function(){var e=$(this),t=e.closest(".cart-row");if(!t.hasClass("update-disabled")){var n=t.data("index");if(!(n<0)){var r=WebPlatform.parse(t.find(".cart-row-quantity").val(),0,!1)+(-1===e.data("role")?-1:1);r<1||o(n,r)}}})).on("change",".cart-row-quantity",(function(){var e=$(this),t=e.closest(".cart-row");if(!t.hasClass("update-disabled")){var n=t.data("index");if(!(n<0)){var r=WebPlatform.parse(e.val(),0,!1);o(n,r)}}})).on("click",".discount-code-btn",(function(){var e=n.find(".apply-code-input").val();WebPlatform.makeClientWebsiteRequest({action:"applyDiscountCode",data:i({code:e}),onOk:function(e){WebPlatform.Store.Orders.set(r,e.data),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:r,order:e.data})}})})).on("click",".promo-code-toggle-btn",(function(){n.find(".coupon-code-wrapper").toggleClass("none")})).on("click",".remove-discount-btn",(function(){$(this).hasClass("none")||WebPlatform.makeClientWebsiteRequest({action:"removeDiscount",data:i({}),onOk:function(e){WebPlatform.Store.Orders.set(r,e.data),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:r,order:e.data})}})}))}}(r,i);var s=e[a];isUndefined(s)||WebPlatform.Store.renderOrder(s,i,n[a]||[]),i.addClass("order-rendered")}},getLastOrder:async()=>new Promise(((e,t)=>{WebPlatform.makeClientWebsiteRequest({action:"getOrderByToken",onOk:t=>{e(t.data||{})},onNotOk:e=>{t(e)}})}))}}(),renderCart:function(){var e=$('div[data-role="cart-box"]').not(".order-rendered"),t=e.find(".loader").addClass("active-loading").removeClass("none");WebPlatform.Store.Orders.get("cart",(function(n){t.removeClass("active-loading").addClass("none");var r=0;null!==n&&n.items&&n.items.length&&n.items.forEach((function(e){r+=e.quantity})),e.each((function(e,t){WebPlatform.Store.Orders.bind({id:"cart"},$(t))})),WebPlatform.Store.updateCartNumber(r,!1)}))},subscriptionToStr:function(e){if(null!==e){var t=e.period,n=e.periodUnit;return t%12==0&&1===n?1==(t/=12)?WebPlatform.Phrases["label.year"]:t+"-"+WebPlatform.Phrases["label.years_lower"]:0===n?1==t?WebPlatform.Phrases["label.week_lower"]:t+"-"+WebPlatform.Phrases["label.weeks_lower"]:1==t?WebPlatform.Phrases["label.month"]:t+"-"+WebPlatform.Phrases["label.months_lower"]}},renderOrder:function(e,t,n){var r=t,i=r.hasClass("cart-preview"),a=!!r.data("showOldPrices"),o=(r.data("inFunnel"),!1),s=!0===r.find(".checkouts-wrapper").data("pickQuantity");if(n=n||[],null===e||0===e.items.length)r.find(".cart-items-wrapper").addClass("none"),r.find(".cart-empty-wrapper").removeClass("none");else{var l=r.find(".cart-table"),c=l.hasClass("simple-table");l.empty();var u="",d=0,f="cart"!==e.id&&n.length>1,p=[];f?n.forEach((function(t){for(var n=!1,r=0;r<e.items.length;++r)if(e.items[r].productId===t.productId){t=e.items[r],n=!0;break}p.push({item:t,inOrder:n})})):e.items.forEach((function(e){p.push({item:e,inOrder:!0})}));for(var h=0,m=0;m<p.length;++m){var g,v=p[m].item,b=p[m].inOrder;g=null===v.images||0===v.images.length?'<img src="'+resources+'/images/product-avatar.svg" alt="">':'<img src="'+getThumbnailsFromBase(v.images[0].base,"640x480")+v.images[0].name+'?format=webp" alt="" />';for(var y="",w=0;w<v.variation.length;++w)w>0&&(y+=", "),y+=WebPlatform.escapeHtml(v.variation[w].value);for(w=0;w<v.additions.length;++w)y+=(""===y?"":", ")+WebPlatform.escapeHtml(v.additions[w].name)+": "+WebPlatform.escapeHtml(v.additions[w].value);var C=!0===v.quantityAvailable;C||(o=!0);var x=WebPlatform.currToStr(v.price,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency);if(a&&v.onSale)x='<span class="checkout-old-price">'+WebPlatform.currToStr(v.basePrice,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)+"</span>"+x,b&&(d+=v.basePrice-v.price);v.subscription&&(x+=c?" / "+WebPlatform.Store.subscriptionToStr(v.subscription):'<span class="item-subscription-period"> / '+WebPlatform.Store.subscriptionToStr(v.subscription)+"</span>");var k=v.productWithVariations&&(!v.variation||0===v.variation.length),P=k?"incomplete-item":"",S=k?WebPlatform.Phrases["label.select_product_variant"]:(WebPlatform.Phrases["label.change"]||"change").toUpperCase(),T=!v.productWithVariations;f&&(P+=" fake-checkbox checkout-item-cbx",b&&(P+=" checked"));var W,E="cart"!==e.clientSessionId,L=E||WebPlatform.Funnels&&WebPlatform.Funnels.hideProductLinks,A=!E,_=!0===window.forceEnableQuantityChangeInCheckout||v.quantity>1||E&&s||!E&&!v.isSubscription&&"MEMBERSHIP"!==v.type&&!window.noStoreQuantityChange;W=L?WebPlatform.Store.storeProductRowTemplateNoLinks:i?WebPlatform.Store.quickViewProductRowTemplate:WebPlatform.Store.storeProductRowTemplate,u+=WebPlatform.format(W,"baseUrl",WebPlatform.Store.baseUrl,"editableClass",A||_?"":"update-disabled","deleteClass",A?"":"none","disabledAttr",_?"":"disabled","quantityWrapperClass",_?"":"none","notAvailableClass",C?"":"not-available","index",b?h++:-1,"url",v.url,"productId",v.productId,"title",WebPlatform.escapeHtml(v.title),"additionalClz",P,"changeText",S,"variationsCls",T?"none":"","image",g,"variation",y,"quantity",v.quantity,"price",x)}l.append(u),o&&l.append($('<span class="error-message"></span>').text(WebPlatform.Store.notEnoughQuantityMessage)),r.find(".remove-discount-btn, .promo-code-toggle-btn").removeClass("none");var D=r.find(".no-discount-wrapper"),O=r.find(".subtotal-value");O.text(WebPlatform.currToStr(e.subTotalNoDiscount,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency));var I=!1;null!==e.discount?D.hide():D.length>0?D.show():I=!0;var F=r.find(".product-discount-wrapper");null!==e.discount&&"FREE_SHIPPING"!==e.discount.type&&e.subTotalNoDiscount!==e.subTotal?(F.find(".subtotal-price").text(WebPlatform.currToStr(e.subTotal-e.subTotalNoDiscount,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)),F.find(".subtotal>span").text(e.discount.name+" ("+e.discount.code+"):"),F.show(),I=!1):(F.hide(),I=I&&!0);var M=WebPlatform.Store.priceWithTax?WebPlatform.Phrases["label.taxes_included"]:WebPlatform.Phrases["label.taxes"];if(null!==e.preShippingTaxes&&e.preShippingTaxes.length>0){var N=r.find(".pre-shipping-tax-wrapper").empty();e.preShippingTaxes.length&&N.append(WebPlatform.format(WebPlatform.Store.storeTaxHeading,"content",M));for(w=0;w<e.preShippingTaxes.length;++w){var R=0===(G=(V=e.preShippingTaxes[w]).type)?V.amount+"%":WebPlatform.currToStr(V.amount,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency),q=V.name+(0===G?" ("+R+")":"")+":",B=WebPlatform.currToStr(V.total,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency);(u=$(WebPlatform.Store.storeTaxRowTemplate)).find(".subtotal").text(q),u.find(".tax-value").text(B),N.append(u)}N.show(),I=!1}else r.find(".pre-shipping-tax-wrapper").hide(),I=I&&!0;if(null!==e.shipping){var z=r.find(".shipping-wrapper");z.find(".shipping > span").text("("+e.shipping.name+")"),z.find(".shipping-value").text(WebPlatform.currToStr(e.shipping.cost,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)),z.show(),I=!1}else r.find(".shipping-wrapper").hide(),I=I&&!0;var j=r.find(".shipping-discount-wrapper");if(null!==e.discount&&"FREE_SHIPPING"===e.discount.type){var H=null!==e.shipping?WebPlatform.currToStr(e.shipping.cost,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency):"-";j.find(".subtotal-price").text(H),j.find(".subtotal>span").text(e.discount.name+" ("+e.discount.code+"):"),j.show(),I=!1}else j.hide(),I=I&&!0;if(null!==e.postShippingTaxes&&e.postShippingTaxes.length>0){var U=r.find(".post-shipping-tax-wrapper").empty();e.preShippingTaxes&&e.preShippingTaxes.length&&null===e.shipping||U.append(WebPlatform.format(WebPlatform.Store.storeTaxHeading,"content",M));for(w=0;w<e.postShippingTaxes.length;++w){var V,G;R=0===(G=(V=e.postShippingTaxes[w]).type)?V.amount+"%":WebPlatform.currToStr(V.amount,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency),q=V.name+(0===G?" ("+R+")":"")+":",B=WebPlatform.currToStr(V.total,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency);(u=$(WebPlatform.Store.storeTaxRowTemplate)).find(".subtotal").text(q),u.find(".tax-value").text(B),U.append(u)}U.show(),I=!1}else r.find(".post-shipping-tax-wrapper").hide(),I=I&&!0;k&&c&&(I=!1),c?I?(O.closest(".no-discount-wrapper, .subtotal-wrapper").addClass("none"),O.closest(".checkout-totals").find(".simple-table").css("border","none")):(O.closest(".no-discount-wrapper, .subtotal-wrapper").removeClass("none"),O.closest(".checkout-totals").find(".simple-table").css("border","")):O.closest(".checkout-totals")[I?"hide":"show"]();var Q=WebPlatform.currToStr(e.total,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency);if(a&&d>0)Q='<span class="checkout-old-price old-grand-total">'+WebPlatform.currToStr(e.total+d,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)+"</span>"+Q;r.find(".grand-total").html(Q),r.find(".cart-empty-wrapper").addClass("none"),r.find(".cart-items-wrapper").removeClass("none")}},updateCartNumber:function(e,t){var n=$(".cart-button, .shopping-cart"),r=n.find(".cart-items-number");if(0===e?(r.addClass("none"),n.filter(".shopping-cart-mobile, .shopping-cart-smaller").addClass("none")):(n.removeClass("none"),r.text(e).removeClass("none pulse")),t&&!WebPlatform.Store.atCheckout){var i,a=WebPlatform.Funnels.isInFunnel();i=a?"javascript: WebPlatform.Funnels.showNextStepOrCheckout();":WebPlatform.Store.baseUrl+"/cart",e>0&&a&&WebPlatform.Funnels.showCheckoutButton?($(".next-step-popup").removeClass("none"),WebPlatform.Funnels.checkoutButtonTarget&&(i=WebPlatform.Funnels.checkoutButtonTarget)):$(".next-step-popup").addClass("none");var o='<a href="'+i+'">'+WebPlatform.Phrases["label.checkout_now"]+"</a>";WebPlatform.showClientMessage(WebPlatform.Store.productAddedToCart+o,6e3),WebPlatform.delay(10,(function(){r.addClass("pulse"),r=null}))}},removeProductFromCart:function(e,t){WebPlatform.Store.Orders.get("cart",(function(n){if(n&&n.items){for(var r=null,i=-1,a=0;a<n.items.length;++a)if(n.items[a].productId===e){i=a,r=n.items[a];break}i>=0&&WebPlatform.makeClientWebsiteRequest({action:"updateCart",data:{orderId:"cart",products:"[]",type:"remove",index:i},onOk:function(e){WebPlatform.Store.reportRemoveFromCart(r,WebPlatform.Store.currency);var n=e.data;WebPlatform.Store.Orders.set("cart",n),WebPlatform.Store.updateCartNumber(n.size,!1),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:"cart",order:n}),t&&t()}})}}))},addProductToOrder:function(e,t,n,r){WebPlatform.makeClientWebsiteRequest({action:"getStoreProduct",data:{id:e},onOk:function(e){var i=e.data;if(i.variations.length>0)WebPlatform.Store.showLoadedProductInQuickView({product:i,activeOrderDetails:n,onAddedToOrder:function(){r&&r()},storeProcess:t});else{var a={productId:i.id,quantity:1,combination:-1,variation:[],price:i.onSale?i.salePrice:i.price},o=n||{};o.orderId=o.orderId||"cart",o.option=JSON.stringify(a),o.process=t,WebPlatform.makeClientWebsiteRequest({action:"addToCart",data:o,onOk:function(e){WebPlatform.Store.reportAddToCart(e.uid,i,a,WebPlatform.Store.currency);var n=e.data;"buy"===t?WebPlatform.Funnels.isInFunnel()&&WebPlatform.Funnels.show("next",!0)||(window.location.href=(WebPlatform.Store.baseUrl||"/store")+"/checkout"):(WebPlatform.Store.Orders.set(o.orderId,n),"cart"===o.orderId&&WebPlatform.Store.updateCartNumber(n.size,!0));r&&r(),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:o.orderId,order:n})}})}}})},addProductToCart:function(e,t,n){WebPlatform.Store.addProductToOrder(e,t,null,n)},getOrderItemsToReport:function(e){var t=[];return e.forEach((function(e){t.push({id:e.productId,quantity:e.quantity,item_price:e.price})})),t},getOrderProductIds:function(e){var t=[];return e.forEach((function(e){t.push(e.productId)})),t},reportPurchase:function(e,t,n,r,i,a,o,s,l){var c=WebPlatform.Store.getOrderItemsToReport(n);if(o=o||(l?l.customerName:"")||WebPlatform.visitorName,s=s||(l?l.customerEmail:"")||WebPlatform.visitorEmail,WebPlatform.Events.trigger($("body"),WebPlatform.Events.ORDER_COMPLETED,{id:t,currency:a||WebPlatform.Store.currency,total:r,items:c,customerName:o,customerEmail:s,order:l}),WebPlatform.Store.fbPxId&&window.fbq&&"NewSubscription"!==i){var u=WebPlatform.Store.getOrderProductIds(n);window.fbq("track",i||"Purchase",{contents:c,content_ids:u,currency:a||WebPlatform.Store.currency,value:r,content_type:"product",num_items:c.length},{eventID:e||""})}window.gtag?gtag("event","purchase",{transaction_id:t+"",value:r,currency:a||WebPlatform.Store.currency,items:WebPlatform.Store._getOrderProductsForGA(n)}):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"ecommerce",ecommerce:{purchase:{actionField:{id:t+"",revenue:r},products:WebPlatform.Store._getOrderProductsForGA(n)}}})},reportRemoveFromCart:function(e,t){var n=[];e.variation&&e.variation.length&&e.variation.forEach((function(e){n.push(e.value)})),WebPlatform.Events.trigger($("body"),WebPlatform.Events.ORDER_REMOVE_FROM_CART,{currency:t||WebPlatform.Store.currency,items:[{id:e.productId,name:e.title,price:e.price/e.quantity,variant:n.length?n.join(", "):"",quantity:e.quantity}]}),window.gtag?gtag("event","remove_from_cart",{currency:t||WebPlatform.Store.currency,items:[{id:e.productId,name:e.title,price:e.price/e.quantity,variant:n.length?n.join(", "):"",quantity:e.quantity}]}):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"ecommerce",ecommerce:{currencyCode:(t||WebPlatform.Store.currency).toUpperCase(),remove:{products:[{id:e.productId,name:e.title,price:e.price/e.quantity,variant:n.length?n.join(", "):"",quantity:e.quantity}]}}})},reportAddToCart:function(e,t,n,r){var i=[];n.variation&&n.variation.length&&n.variation.forEach((function(e){i.push(e.value)})),WebPlatform.Events.trigger($("body"),WebPlatform.Events.ORDER_ADD_TO_CART,{currency:r||WebPlatform.Store.currency,items:[{id:t.id,name:t.title,price:n.price,variant:i.length?i.join(", "):"",quantity:n.quantity}]}),WebPlatform.Store.fbPxId&&window.fbq&&window.fbq("track","AddToCart",{content_ids:[""+t.id],content_type:"product",content_name:t.title,currency:r||WebPlatform.Store.currency,value:n.price,num_items:n.quantity},{eventID:e||""}),window.gtag?gtag("event","add_to_cart",{currency:r||WebPlatform.Store.currency,items:[{id:t.id,name:t.title,price:n.price,variant:i.length?i.join(", "):"",quantity:n.quantity}]}):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"ecommerce",ecommerce:{currencyCode:(r||WebPlatform.Store.currency).toUpperCase(),add:{products:[{id:t.id,name:t.title,price:n.price,variant:i.length?i.join(", "):"",quantity:n.quantity}]}}})},_getOrderProductsForGA:function(e){var t=[];return e.forEach((function(e){var n=[];e.variation&&e.variation.length&&e.variation.forEach((function(e){n.push(e.value)})),t.push({id:e.productId,name:e.title,price:e.price/e.quantity,variant:n.length?n.join(", "):"",quantity:e.quantity})})),t},reportInitiateCheckout:function(e,t,n){null!==t&&t.items&&0!==t.items.length&&(WebPlatform.Events.trigger($("body"),WebPlatform.Events.ORDER_INITIATE_CHECKOUT,{currency:n||WebPlatform.Store.currency,items:WebPlatform.Store._getOrderProductsForGA(t.items)}),WebPlatform.Store.fbPxId&&window.fbq&&window.fbq("track","InitiateCheckout",{content_type:"product",contents:WebPlatform.Store.getOrderItemsToReport(t.items),content_ids:WebPlatform.Store.getOrderProductIds(t.items),currency:n||WebPlatform.Store.currency,value:t.total,num_items:t.items.length},{eventID:e||""}),window.gtag?gtag("event","begin_checkout",{currency:n||WebPlatform.Store.currency,items:WebPlatform.Store._getOrderProductsForGA(t.items)}):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"ecommerce",ecommerce:{checkout:{actionField:{step:1},products:WebPlatform.Store._getOrderProductsForGA(t.items)}}}))},reportAddPaymentDetails:function(e,t){window.gtag?gtag("event","add_payment_info",{currency:t||WebPlatform.Store.currency,items:WebPlatform.Store._getOrderProductsForGA(e.items)}):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"ecommerce",ecommerce:{checkout:{actionField:{step:2},products:WebPlatform.Store._getOrderProductsForGA(e.items)}}})},goToThankYouPage:function(e,t){e=WebPlatform.parse(e);var n=function(e){0===e.toLowerCase().trim().indexOf("http")&&ClientTools.showLoader(),window.location.href=e};0===(t=(t||"").trim()).toLowerCase().indexOf("javascript:")&&t.toLowerCase().replace(/'"/g,"").indexOf("webplatform.funnels.show(next)")>-1&&(t="javascript:WebPlatform.Funnels.show('next', false, false)"),WebPlatform.Funnels.isInFunnel()?WebPlatform.Funnels.tryShowNextUpsell(e||0,(function(){n(t)})):n(t)}}),WebPlatform.Popups=WebPlatform.Popups||{},WebPlatform.Popups.POPUP_MARKUP='<div data-id="%id%" id="platform-popup-%id%" class="popup-wrapper %animationClass% %bgClass% %positionClass% %overlayBgClass%"><div class="popup-overlay" style="%overlayBg%;"></div></div>',WebPlatform.Popups.POPUP_BOX_MARKUP='<div class="wrapping-table">     <div class="popup-container" style="width: %width%;">       <div class="popup-container-inner">         <a class="popup-close-btn %btnColorClass%" style="%btnColor%;">&#10005;</a>         <div class="popup-content-wrapper %contentBgColorClass%" style="%contentBgColor%; padding: %contentPadding%px; %contentSize%"><div class="popup-content"></div></div>         <div class="popup-background-wrapper" style="%bgSize%"></div>       </div>     </div>   </div>',WebPlatform.Popups.prompt=function(e,t,n,r){var i='            <div class="simple-client-popup">              <h4>'+e+'</h4>              <div class="col20 f-left text-center mt-45">                <a data-role="close" class="inline-block text-btn" style="margin-right: auto; font-size: 14px;">'+(r||WebPlatform.Phrases["label.no"])+'</a>                <button data-role="confirm" class="save-changes inline-block mt-0" data-role="confirm">'+(n||WebPlatform.Phrases["label.yes"])+"</button>              </div>            </div>";WebPlatform.Popups.showSimplePopup(i,400,(function(e,n){n.find('[data-role="confirm"]').click((function(){e.close(),(t||dummy)()}))}))},WebPlatform.Popups.showSimplePopup=function(e,t,n,r){mergeUnique(r=r||{},{showCloseButton:!0,onHide:null,scrollable:!1});var i=$(`<div class="popup-wrapper at-center simple-popup">         <div class="popup-overlay" style="background: rgba(0, 0, 0, 0.7);"></div>           <div class="popup-container" style="width: ${t}px; ${r.scrollable?"overflow-y: scroll;":""}">`+(r.showCloseButton?'<a class="close-btn"></a>':"")+e+"</div></div>"),a=function(){i.removeClass("visible"),WebPlatform.onTransitionEnd(i,(function(){r.onHide&&r.onHide(),i.remove(),i=null}),300)};i.one("click",'.close-btn, [data-role="close"]',a),$("body").append(i),WebPlatform.delay(20,(function(){i.addClass("visible"),(n||dummy)({close:a},i)}))},WebPlatform.Popups.setDefaults=function(e){return mergeUnique(e,{name:"",pages:[],showOnExit:!1,animationType:"popup-fade",showPopupWithDelay:!1,popupDelay:3,showPopupOnScroll:!1,scrollDistance:15,popupShowFrequency:"once",size:50,overlayColor:"#000000",overlayColorClass:"",overlayTransparency:30,closeBtnColor:"#000000",closeBtnColorClass:"",contentBgColor:"#ffffff",contentBgColorClass:"",contentPadding:30,backgroundType:"background-none",position:"at-center",width:500,height:300,bgImage:"none",bgImageBase:"",bgColor:"#333333",bgRepeat:"no-repeat",bgSize:"cover",bgPosition:"center center",showOnMobile:!1,thumbImage:"none",thumbImageBase:"",visibleAsTemplate:!1}),e},WebPlatform.Popups.setBackground=function(e,t){var n=e.find(".popup-background-wrapper"),r=t.bgRepeat,i=t.bgSize,a=t.bgPosition,o="none"===t.bgImage?"none":"url("+getFileFromBase(t.bgImageBase)+t.bgImage+"?format=webp)",s=t.bgColor;n.css({backgroundColor:s,backgroundPosition:a,backgroundImage:o,backgroundRepeat:r,backgroundSize:i})},WebPlatform.Popups.show=function(e,t,n,r){var i,a,o,s=!1;"object"==typeof e?(i=e.id,a=e.funnelId,o=e.variant,s=!0===e.isTemplate):i=e,$("#platform-popup-"+i).length>0||WebPlatform.makeClientWebsiteRequest({action:"getPopup",data:{id:i,funnelId:a,variant:o,preview:t?"":WebPlatform.getUrlQueryParameter(window.location.href,"preview"),edit:!!t,isTemplate:s},onOk:function(e){var o,s,l=e.data.settings||{},c=e.data.content||"",u=e.data.funnelVariantId||0;l.name=e.data.name,WebPlatform.Popups.setDefaults(l),"background-top"===l.backgroundType||"background-bottom"===l.backgroundType?(o="",s="height: "+l.size+"px;"):(o="width: "+l.size+"%;",s="width: "+(100-l.size)+"%;");var d,f="";l.overlayColor.startsWith("#")?d="background: "+WebPlatform.hexToRgba(l.overlayColor,(100-l.overlayTransparency)/100):(d="background: "+l.overlayColor,l.overlayColorClass&&(f="bg-color-"+l.overlayColorClass,d=""));var p=$(WebPlatform.format(WebPlatform.Popups.POPUP_MARKUP,"id",i,"bgClass",l.backgroundType,"positionClass",l.position,"animationClass",l.animationType,"overlayBg",d,"overlayBgClass",f));p.append(WebPlatform.format(WebPlatform.Popups.POPUP_BOX_MARKUP,"width",l.width+"px","height",l.height+"px","btnColor",l.closeBtnColorClass?"":"color: "+l.closeBtnColor+";","btnColorClass",l.closeBtnColorClass?"color-"+l.closeBtnColorClass:"","contentBgColor",l.contentBgColorClass?"":"background: "+l.contentBgColor+";","contentBgColorClass",l.contentBgColorClass?"bg-color-"+l.contentBgColorClass:"","contentPadding",l.contentPadding,"contentSize",o,"bgSize",s)),$(".theme").append(p),p.find(".popup-content").html(c),WebPlatform.Popups.setBackground(p,l),p.data("popupShowFrequency",l.popupShowFrequency),p.data("editing",t),t||p.find(".popup-close-btn").click((function(){var e=$(this).closest(".popup-wrapper").data("id");WebPlatform.Popups.hide(e,r||dummy)})),WebPlatform.processAccumulatedRequests(),p.on(WebPlatform.Events.FORM_SUBMITTED,(function(e,t){WebPlatform.delay(3500,(function(){WebPlatform.Popups.hide(i,r||dummy)}))})),WebPlatform.delay(30,(function(){p.addClass("visible"),WebPlatform.onTransitionEnd(p,(function(){p.addClass("displayed"),window.ClientTools&&(window.ClientTools.refreshForms(),window.ClientTools.refreshLightboxes(),window.ClientTools.refreshCountdowns(),window.ClientTools.refreshToggles(),window.ClientTools.refreshAnimations(),window.ClientTools.refreshDelayedWidgets(),window.ClientTools.refreshContainerBgVideos(),$window.scroll()),(n||dummy)(i,l,p)}),300)})),a&&u&&!t&&WebPlatform.PageStatsService&&WebPlatform.PageStatsService.trackFunnelPopupStepView(a,i,u)}})},WebPlatform.Popups.hidden=[],WebPlatform.Popups.hide=function(e,t){var n=$("#platform-popup-"+e);if(n.length>0&&!n.hasClass("is-hiding")){n.addClass("is-hiding");var r=!0===n.data("editing"),i=n.data("popupShowFrequency");n.off(WebPlatform.Events.FORM_SUBMITTED),WebPlatform.Popups.hidden.push(e),n.removeClass("visible displayed"),WebPlatform.onTransitionEnd(n,(function(){n.remove(),(t||dummy)()}),300),r||"always"===i||("once"===i?Cookies.set("platform-popup-"+e,1,{expires:365,path:"/"}):Cookies.set("platform-popup-"+e,1,{path:"/"}))}},WebPlatform.Popups.registerPagePopups=function(e){for(var t=[],n=[],r=0;r<e.length;++r){var i=e[r];i.settings=i.settings||{},WebPlatform.Popups.setDefaults(i.settings),"always"!==i.settings.popupShowFrequency&&Cookies.get("platform-popup-"+i.id)||WebPlatform.isMobile()&&!i.settings.showOnMobile||(Cookies.remove("platform-popup-"+i.id),i.settings.showOnExit&&t.push(i),i.settings.showPopupWithDelay&&WebPlatform.delay(1e3*i.settings.popupDelay,function(e){return function(){-1===WebPlatform.Popups.hidden.indexOf(e)&&WebPlatform.Popups.show(e,!1,dummy)}}(i.id)),i.settings.showPopupOnScroll&&n.push(i))}t.length>0&&$document.on("mouseout.popups",(function(e){if(!(e.clientY>=50||"input"===e.target.tagName.toLowerCase()||e.clientX>=$(window).innerWidth()-50||e.relatedTarget||e.toElement)){$document.off("mouseout.popups");for(var n=0;n<t.length;++n)-1===WebPlatform.Popups.hidden.indexOf(t[n].id)&&WebPlatform.Popups.show(t[n].id,!1,dummy)}})),n.length>0&&window.ClientTools&&window.ClientTools.addOnScrollListener($.debounce(300,(function(){for(var e=$window.scrollTop()/($document.height()-$window.height())*100,t=0;t<n.length;++t){var r=n[t];e>=(r.settings.scrollDistance||101)&&-1===WebPlatform.Popups.hidden.indexOf(r.id)&&WebPlatform.Popups.show(r.id,!1,dummy)}})))},WebPlatform.VideoPopup=WebPlatform.VideoPopup||{},WebPlatform.VideoPopup.show=e=>{WebPlatform.onReady((()=>{WebPlatform.requestResource(resources+"/components/client/VideoPlaylist/video-playlist.js?v="+resourcesVersion,null,(()=>WebPlatform.ClientComponents&&WebPlatform.ClientComponents.VideoPlaylist),(()=>{WebPlatform.ClientComponents.VideoPlaylist.showVideoPopup(e)}))}))},WebPlatform.Events=WebPlatform.Events||{},WebPlatform.Events.ORDER_COMPLETED="platform.events.order_completed",WebPlatform.Events.ORDER_CHANGED="platform.events.order_changed",WebPlatform.Events.ORDER_ADD_TO_CART="platform.events.order_add_to_cart",WebPlatform.Events.ORDER_REMOVE_FROM_CART="platform.events.order_remove_from_cart",WebPlatform.Events.ORDER_INITIATE_CHECKOUT="platform.events.order_initiate_checkout",WebPlatform.Events.FORM_SUBMITTED="platform.events.client_form_submited",WebPlatform.Events.PAGE_LOADED="platform.events.page_loaded",WebPlatform.Events.CONFIGURATION_CHANGED="platform.events.configuration_changed",WebPlatform.Events.WEBSITE_SUBSCRIBED="platform.events.website_subscribed",WebPlatform.Events.WEBSITE_CANCELED="platform.events.website_canceled",WebPlatform.Events.NEW_REGISTRATION="platform.events.new_registration",WebPlatform.Events.trigger=function(e,t,n){try{e instanceof jQuery&&(e=e[0]);var r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(r)}catch(e){Log.error("Unable to dispatch event "+t+"!"),Log.error(e)}},WebPlatform.Countdown=WebPlatform.Countdown||{},WebPlatform.Countdown.create=function(e){e.length<0||e.hasClass("with-countdown")||e.each((function(e,t){var n=(t=$(t)).data("type"),r=WebPlatform.parse(t.data("date"),0),i=WebPlatform.parse(t.data("hours"),1),a=WebPlatform.parse(t.data("minutes"),0),o=WebPlatform.parse(t.data("seconds"),0),s=WebPlatform.parse(t.data("start"),100),l=WebPlatform.parse(t.data("end"),0),c=WebPlatform.parse(t.data("interval"),1),u=!0===t.data("reset"),d=t.data("link")||"",f=(t.data("target"),t.data("onend")||""),p=!1!==t.data("showdays"),h=!1!==t.data("showseconds"),m=t.data("color")||"#ffffff",g=t.data("bgcolor")||"#333333",v=WebPlatform.parse(t.data("size"),70),b=t.data("labelcolor")||"#333333",y=WebPlatform.parse(t.data("labelsize"),14),w=WebPlatform.parse(t.data("uid"),7),C=null;t.addClass("with-countdown");$(".theme").width();var x=function(){C.timer._destroyTimer(),"link"===f?window.ClientTools&&(window.location.href=d):"message"===f&&t.slideUp("fast",(function(){t.closest(".widget").find(".flip-countdown-end").slideDown("fast")}))},k=WebPlatform.getCookieName("time-cd-"+w);if("number"===n){var P=s;if(u)Cookies.remove(k,{path:"/"});else{var S=_=(new Date).getTime();if(D=Cookies.get(k)||"")if(2===(O=D.split(":")).length)s+"|"+l+"|"+c===O[0]&&0===(S=WebPlatform.parse(O[1])||0)&&(S=_);if(D!==s+"|"+l+"|"+c+":"+S&&Cookies.set(k,s+"|"+l+"|"+c+":"+S,{expires:7,path:"/"}),S>0){var T=Math.floor((_-S)/1e3/c);P=s+(s>l?-1:1)*T}}var W=s>l,E=W&&P<=l||!W&&P>=l;if(E&&(P=l),C=t.FlipClock(P,{clockFace:"Counter",color:m,bgColor:g,size:v,labelColor:b,labelSize:y}),t.data("clock",C),E)x();else{var L=function(){W?(--P,C.decrement()):(++P,C.increment()),W&&P<=l||!W&&P>=l?x():WebPlatform.delay(1e3*c,L)};WebPlatform.delay(1e3*c,L)}}else{var A=0;if("date"===n){(A=(r-(new Date).getTime())/1e3)<0&&(A=0)}else{if(A=o+60*a+60*i*60,u)Cookies.remove(k,{path:"/"});else{var _,D,O;S=_=(new Date).getTime();if(D=Cookies.get(k)||"")if(2===(O=D.split(":")).length)(WebPlatform.parse(O[0])||0)===A&&0===(S=WebPlatform.parse(O[1])||0)&&(S=_);D!==A+":"+S&&Cookies.set(k,A+":"+S,{expires:7,path:"/"}),A-=(_-S)/1e3}A<0&&(A=0)}0===A&&WebPlatform.delay(1e3,x),C=t.FlipClock(A,{clockFace:p?"DailyCounter":"HourlyCounter",showSeconds:h,countdown:!0,defaultLanguage:"custom",color:m,bgColor:g,size:v,labelColor:b,labelSize:y,callbacks:{stop:function(){x()}},localize:function(e,t){return WebPlatform.Phrases["label."+e.toLowerCase()]||e}}),t.data("clock",C)}}))},WebPlatform.Countdown.destroy=function(e){if(e instanceof jQuery&&(e.hasClass("flip-countdown")||(e=e.find("flip-countdown")),e.hasClass("with-countdown"))){e.removeClass("with-countdown");var t=e.data("clock")||null;null!==t&&t.timer._destroyTimer()}},WebPlatform.Countdown.get=function(e){return e.hasClass("with-countdown")?e.data("clock")||null:e.find(".with-countdown").data("clock")||null},WebPlatform.Funnels=WebPlatform.Funnels||{},WebPlatform.Funnels.currentStep=null,WebPlatform.Funnels.currentStepVariant=null,WebPlatform.Funnels.isInFunnel=function(){return WebPlatform.Funnels.steps&&WebPlatform.Funnels.steps.length>0},WebPlatform.Funnels.showNextStepOrCheckout=function(){WebPlatform.Funnels.show("next",!0)||(window.location.href=WebPlatform.Store.baseUrl+"/cart")},WebPlatform.Funnels.showNextStepOrDownsell=function(e,t,n){var r=WebPlatform.Funnels.steps||[];if(r.length){for(var i=null,a=-1,o=0;o<r.length;++o)if(r[o].id===e){i=r[o],a=o;break}if(null!==i){var s=a+1,l=r.length>s?r[s]:null;if(null!==l){if("UPSELL"===i.kind&&"DOWNSELL"===l.kind&&n)return WebPlatform.Funnels.show(l.funnelId+"|"+l.id,t);for(var c="UPSELL"===i.kind||"DOWNSELL"===i.kind;null!==l&&(!c&&"UPSELL"===l.kind||"DOWNSELL"===l.kind);)++s,l=r.length>s?r[s]:null;if(null!==l)return WebPlatform.Funnels.show(l.funnelId+"|"+l.id,t)}}}},WebPlatform.Funnels.tryShowNextUpsell=function(e,t){var n=WebPlatform.Funnels.steps||[];if(n.length){for(var r=null,i=-1,a=0;a<n.length;++a)if(n[a].id===e){r=n[a],i=a;break}if(null!==r){for(var o=i+1,s=n.length>o?n[o]:null;null!==s&&"DOWNSELL"===s.kind;)++o,s=n.length>o?n[o]:null;null!==s&&"UPSELL"===s.kind?WebPlatform.Funnels.show(s.funnelId+"|"+s.id):t()}else t()}},WebPlatform.Funnels.show=function(e,t,n){var r,i=WebPlatform.Funnels.steps||[];if(i.length)if("next"===e){if(WebPlatform.Funnels.currentStep)return WebPlatform.Funnels.showNextStepOrDownsell(WebPlatform.Funnels.currentStep.id,t,n);var a=window.location.pathname.substring(1).split(/\//g),o=decodeURIComponent(a[a.length-1]);1!==a.length&&(2!==a.length||""!==a[1])||decodeURIComponent(a[0])!==i[0].base&&""!==a[0]||(o=i[0].url);for(var s=0;s<i.length;++s)if(i[s].url===o)return WebPlatform.Funnels.showNextStepOrDownsell(i[s].id,t,n)}else{if((a=e.split(/\|/g)).length<2)return;var l=WebPlatform.parse(a[0],-1,!1),c=WebPlatform.parse(a[1],-1,!1);if(l<0||c<0||i[0].funnelId!==l)return;for(e=null,s=0;s<i.length;++s)if(i[s].id===c){e=i[s];break}if(null===e)return;if("POPUP"===e.type)WebPlatform.Popups.show({id:c,funnelId:l},!1,(function(){WebPlatform.Funnels.currentStep=e}),(r=WebPlatform.Funnels.currentStep,WebPlatform.Funnels.currentStepVariant,function(){WebPlatform.Funnels.currentStep=r}));else{var u=WebPlatform.getUrlQueryParameter(window.location.href,"preview"),d=(e.host&&e.host===window.location.hostname?"":"/"+(e.base||"")+"/")+e.url;WebPlatform.lastFormParams&&(d+="?"+WebPlatform.lastFormParams),u&&(d+=(d.indexOf("?")>-1?"&":"?")+"preview="+u),window.location.href=d}if(t)return!0}},WebPlatform.Widgets.Checkout=function(e){if(!WebPlatform.Widgets.shouldRender(e.root))return null;var t,n,r,i=null,a=e.id||"cart",o=null,s=(e.fields||[]).indexOf("billing")>-1,l=(e.fields||[]).indexOf("email")>-1,c=e.root,u=null,d={},f=c.find('div[data-role="addressWrapper"]'),p=c.find(".store-policies"),h=c.find('[data-role="error-message"]'),m=c.find('[data-role="navigation"]'),g=m.find('[data-role="next-step"]'),v=m.find('[data-role="back"]'),b=m.find('[data-role="continue"]'),y=c.find(".checkout-summary"),w="customer-info",C=null,x=null,k=null,P=null,S="",T="1-step"===e.layout,W="2-step"===e.layout,E="3-step"===e.layout,L=!1,A="card";c.data("inFunnel",!!e.funnel);var _=c.find('[name="additionalInfo"]');_.length>0&&_.hasClass("with-date")&&window.ClientTools&&ClientTools.requestResource(resources+"/scripts/jquery-ui.js?v="+resourcesVersion,resources+"/styles/jquery-ui.min.css?v="+resourcesVersion,(function(){return!!$.datepicker}),(function(){_.datepicker({firstDay:window.weekStartsAtMonday?1:0,dateFormat:WebPlatform.dateFormat})}));var D=function(t){return(t=t||{}).orderId=a,t.products=JSON.stringify(e.products||[]),t.funnel=e.funnel,t.funnelStep=e.funnelStep,t.funnelStepVariant=e.funnelStepVariant,t.fields=(e.fields||[]).join(","),t},O=0,I=function(){++O>1||(window.ClientTools&&ClientTools.showHideAjaxLoadingIndicator(!1),c.addClass("checkout-loading"))},F=function(){--O<0&&(O=0),0===O&&(window.ClientTools&&ClientTools.showHideAjaxLoadingIndicator(!0),c.removeClass("checkout-loading"))},M=function(e){var t={};e.find("input:not(:checkbox), select").each((function(){"new_password"!==this.name&&"new_password_repeat"!==this.name&&"password"!==this.name&&(t[this.name]=this.value)})),e.find('input[name="useDifferentBillingAddress"]').is(":checked")&&(t.useDifferentBillingAddress=!0),e.find('input[name="createAccount"]').is(":checked")&&(t.createAccount=!0);var n=e.find(o.loginRequired?'[data-role="member-login"]':'[data-role="password"]');return t.new_password=n.find('[name="new_password"]').val(),t.new_password_repeat=n.find('[name="new_password_repeat"]').val(),t},N=function(e,t){e.each((function(){var e=$(this);e.hasClass(t)||e.addClass(t).after('<i class="error-notification fa fa-exclamation-triangle" aria-hidden="true"></i>')}))},R=function(e){e.each((function(){var e=$(this),t=e.next();t.hasClass("error-notification")&&t.remove(),e.removeClass("field-invalid field-with-error")}))},q=function(t,n){if(!o.isSampleOrder&&!b.hasClass("disabled")){b.addClass("disabled");var r="",i=t.find('[name="paymentOption"]:checked');i.length>0&&(r=i.val());var s=n?M(n):null,u=function(e){ClientTools.resetRecaptcha(c,b),ClientTools.showMessageBox(e,b,"before",!0,1e4)},f=function(t,i,p){I();var h=D({method:r,token:t,order_extra:e.extra||"",resubmit:!0===i});p&&ClientTools.mergeUnique(h,p),s&&(h.withAddress=!0,$.extend(h,s)),c.removeClass("has-incomplete-items");var m={action:"completeOrder",method:"post",data:h,onOk:function(t){var i=t.data,p=n&&h.createAccount&&i.member;if(n&&R(n.find(".field-with-error")),i.order&&(o=i.order,WebPlatform.Store.Orders.set(a,o)),p&&(WebPlatform.Members=WebPlatform.Members||{},WebPlatform.Members.current=i.member,WebPlatform.reportMemberRegistration(t.uid),U(n)),i.message){if(b.removeClass("disabled"),"HAS_INCOMPLETE_ITEMS"===i.message)u(WebPlatform.Phrases["err.select_product_variants"]),c.addClass("has-incomplete-items");else if("HAS_INVALID_PAYMENT_METHOD"===i.message)u("Selected payment method is not supported for subscriptions!");else if("INITIATE_PAYSTACK_PAYMENT"===i.message){b.addClass("disabled");var m=Math.round(100*o.total),g=PaystackPop.setup({key:d.paystackPublicKey,email:o.customerEmail,channels:["card","ussd","qr","mobile_money"],amount:m,currency:WebPlatform.Store.currency,callback:function(e){f(e.reference,!0)},onClose:function(){b.removeClass("disabled")}});g.openIframe()}else if("barclays-init-3ds"===i.message)!function(e){b.addClass("disabled"),I();var t=e.accessToken,n=e.deviceDataCollectionUrl,r=e.flexToken,i=e.inSandbox?"https://centinelapistag.cardinalcommerce.com":"https://centinelapi.cardinalcommerce.com",a=function(e){if(e.origin&&e.origin===i){var t=JSON.parse(e.data);b.removeClass("disabled"),F(),t&&t.Status?f(r,!0,{step:"barclays-submit-payment",deviceSessionId:t.SessionId}):u("Unable to collect device data!"),window.removeEventListener("message",a),document.body.removeChild(o),o=null}};window.addEventListener("message",a,!1);var o=document.createElement("iframe"),s="iframe"+WebPlatform.getRandomString(6);o.src="about:blank",o.width=o.height="1",o.style.opacity="0",o.style.position="absolute",o.style.zIndex=-1,o.style.display="none",o.id=s,o.name=s,document.body.appendChild(o);var l=jQuery('<form class="none" action="'+n+'" method="POST" target="'+s+'"></form>'),c=jQuery('<input type="hidden" name="JWT" />');c.val(t),l.append(c),$("body").append(l),l.submit(),l.remove(),l=null}(i.payload);else if("barclays-collect-3ds"===i.message)!function(e){b.addClass("disabled"),I();var t=e.accessToken,n=e.flexToken,r=e.authUrl,i=e.pareq,a=400,o=400;try{var s=atob(i);if(s&&(s=JSON.parse(s))&&s.challengeWindowSize)switch(s.challengeWindowSize){case"01":a=250,o=400;break;case"02":a=390,o=400;break;case"03":a=500,o=600;break;case"04":a=600,o=400;break;case"05":a=$(window).width(),o=$(window).height()}}catch(e){Log.error(e)}var l="iframe"+WebPlatform.getRandomString(6),c='<div class="col20 f-left" style="background: #ffffff"><iframe src="about:blank" id="'+l+'" name="'+l+'" style="width: '+a+"px; height:"+o+'px"></iframe></div>';WebPlatform.Popups.showSimplePopup(c,a,(function(e){var a=jQuery('<form class="none" action="'+r+'" method="POST" target="'+l+'"></form>'),o=jQuery('<input type="hidden" name="JWT" />');o.val(t),a.append(o),(o=jQuery('<input type="hidden" name="PaReq" />')).val(i);var s=function(t){t.origin&&t.origin===window.location.protocol+"//"+window.location.host&&(window.removeEventListener("message",s),"barclays-setup-complete"===t.data.event&&(b.removeClass("disabled"),F(),e.close(),f(n,!0,{step:"barclays-submit-payment",threeDStransactionId:t.data.transactionId})))};window.addEventListener("message",s,!1),$("body").append(a),a.submit(),a.remove(),a=null}),{showCloseButton:!1})}(i.payload);else if("stripe"===r&&i.payload&&i.payload.extra&&("requires_action"===i.message||"requires_payment_method"===i.message)){b.addClass("disabled");var v=i.payload.extra||[],y=v.length?v[0]:"",w={payment_method:{card:x.elements}};(s&&s.name||o.customerName)&&(w.payment_method.billing_details={name:s&&s.name?s.name:o.customerName}),I(),x.stripe.confirmCardPayment(y,w).then((function(e){F(),e.error?(Log.error(e.error),message=e.error.message||e.error,u(message),b.removeClass("disabled")):f(e.paymentIntent.id,!0)}))}else u(i.message);var C=null;if(n&&i.errors&&i.errors.length)for(var k=0;k<i.errors.length;++k){var P=n.find('[name="'+i.errors[k]+'"]');N(P,"field-with-error"),null===C&&(C=P)}else if(i.additionalFieldsErrors&&i.additionalFieldsErrors.length){var S=i.additionalFieldsErrors,T=c.find(".form-field").not('[data-type="section"]');for(k=0;k<S.length;++k)if(S[k]){P=T.eq(k);N(P,"field-invalid"),null===C&&(C=P)}}P&&WebPlatform.scrollIntoView(C.parent())}else{var W=i.payload,E=function(t,n){WebPlatform.forceCheckoutThankYouPage&&(t=WebPlatform.forceCheckoutThankYouPage()),WebPlatform.visitorName=o.customerName,WebPlatform.visitorEmail=o.customerEmail,WebPlatform.Store.reportPurchase(n,o.id,o.items,o.total,"Purchase",WebPlatform.Store.currency,o.customerName,o.customerEmail,o),WebPlatform.delay(80,(function(){WebPlatform.Store.goToThankYouPage(e.funnelStep,t),toggleDisplay(c.find(".checkout-info"),!1),toggleDisplay(c.find(".checkout-summary"),!1),toggleDisplay(c.find('[data-step="complete"]'),!0)}))};if(W.review)W.cartUpdatedMessage&&u(W.cartUpdatedMessage),b.removeClass("disabled");else if(W.redirect)if("stripeConnect"===r){I();var L=o.shippingAddress&&o.shippingAddress.country?o.shippingAddress.country:o.billingAddress&&o.billingAddress.country?o.billingAddress.country:WebPlatform.Store.country.toUpperCase();"UK"===L&&(L="GB"),"EL"===L&&(L="GR");var _={name:s&&s.name?s.name:o.customerName,address:{country:L}};o.billingAddress&&(o.billingAddress.state&&(_.address.state=o.billingAddress.state),o.billingAddress.city&&(_.address.city=o.billingAddress.city),o.billingAddress.zipCode&&(_.address.postal_code=o.billingAddress.zipCode),o.billingAddress.address&&(_.address.line1=o.billingAddress.address),o.billingAddress.address2&&(_.address.line2=o.billingAddress.address2)),l||(_.email=o.customerEmail);var O={return_url:W.redirect,payment_method_data:{billing_details:_}};if(Log.log("selected method in Stripe: "+A),o.shippingInfoRequired||"afterpay_clearpay"===A){var M={name:_.name,address:{country:L}};o.shippingInfoRequired&&o.shippingAddress&&(o.shippingAddress.state&&(M.address.state=o.shippingAddress.state),o.shippingAddress.city&&(M.address.city=o.shippingAddress.city),o.shippingAddress.zipCode&&(M.address.postal_code=o.shippingAddress.zipCode),o.shippingAddress.address&&(M.address.line1=o.shippingAddress.address),o.shippingAddress.address2&&(M.address.line2=o.shippingAddress.address2)),"afterpay_clearpay"===A&&!M.address.state&&_.address.state&&(M.address=_.address),O.shipping=M}x.stripe.confirmPayment({elements:x.elements,confirmParams:O}).then((function(e){e.error?(F(),b.removeClass("disabled"),u(e.error.message||e.error.code||e.error.decline_code)):e.paymentIntent&&WebPlatform.makeClientWebsiteRequest({action:"paymentConfirmedByClient",method:"post",data:D({payload:e.paymentIntent.id}),onOk:function(e){E(e.data.redirect,e.uid)}})}))}else if("paypal"===r||"stripe-ideal"===r||"klarna"===r||"unipay"===r||"mollie"===r||"mercadopago"===r)!function(e){0===(e=e||"").toLowerCase().trim().indexOf("http")&&ClientTools.showLoader(),toggleDisplay(c.find(".checkout-info"),!1),toggleDisplay(c.find(".checkout-summary"),!1),toggleDisplay(c.find('[data-step="complete"]'),!0),window.location.href=e}(W.redirect);else if("twispay"===r){var q=$('<div class="hidden"></div>'),B=$('<form method="POST" action="'+W.redirect+'"></form>');for(var z in W.data){var j=$('<input type="hidden" />').attr("name",z).attr("value",W.data[z]);B.append(j)}q.append(B),$(document.body).append(q),B.submit(),ClientTools.showLoader()}else if("payfast"===r){var H="https://"+(d.payfastInSandbox?"sandbox":"www")+".payfast.co.za/eng/process";q=$('<div class="hidden"></div>'),B=$('<form method="POST" action="'+H+'"></form>');for(var z in W.data){j=$('<input type="hidden" />').attr("name",z).attr("value",W.data[z]);B.append(j)}q.append(B),$(document.body).append(q),B.submit(),ClientTools.showLoader()}else if("afterpay"===r)AfterPay.redirect({token:W.redirect});else if("mobilpay"===r||"mobilpay-btc"===r||"mobilpay-sms"===r){q=$('<div class="hidden"></div>');(B=$('<form method="POST" action="'+W.redirect+'"></form>')).append('<input type="hidden" name="env_key" value="'+W.envKey+'" />'),B.append('<input type="hidden" name="data" value="'+W.data+'" />'),q.append(B),$(document.body).append(q),B.submit(),ClientTools.showLoader()}else if("payulatam"===r){var V=W.data,G=!0===WebPlatform.Store.PayULatamInTestMode;B='<form method="post" action="'+(H=G?"https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/":"https://checkout.payulatam.com/ppp-web-gateway-payu/")+'">                       <input name="merchantId"    type="hidden"  value="'+V.merchantId+'" />                       <input name="accountId"     type="hidden"  value="'+V.accountId+'" />                       <input name="description"   type="hidden"  value="'+V.description+'" />                       <input name="referenceCode" type="hidden"  value="'+V.referenceCode+'" />                       <input name="amount"        type="hidden"  value="'+V.amount+'" />                       <input name="tax"           type="hidden"  value="'+V.tax+'" />                       <input name="taxReturnBase" type="hidden"  value="'+V.taxReturnBase+'" />                       <input name="currency"      type="hidden"  value="'+V.currency+'" />                       <input name="signature"     type="hidden"  value="'+V.signature+'" />                       <input name="algorithmSignature" type="hidden"  value="'+V.algorithmSignature+'" />';G&&(B+='<input name="test" type="hidden"  value="1" />'),B+='<input name="buyerFullName" type="hidden"  value="'+V.buyerFullName+'" />                       <input name="buyerEmail"    type="hidden"  value="'+V.buyerEmail+'" />                       <input name="responseUrl"   type="hidden"  value="'+V.responseUrl+'" />                       <input name="confirmationUrl" type="hidden"  value="'+V.confirmationUrl+'" />',V.hasShipping&&(B+='<input name="shippingAddress"   type="hidden"  value="'+V.shippingAddress+'" />                           <input name="shippingCity" type="hidden"  value="'+V.shippingCity+'" />                           <input name="shippingCountry" type="hidden"  value="'+V.shippingCountry+'" />'),B+='<input name="Submit" type="submit" value="" />                     </form>',(q=$('<div class="hidden"></div>')).append(B),$(document.body).append(q),q.find("form").submit(),ClientTools.showLoader()}else E(W.redirect,t.uid);else E(WebPlatform.Store.baseUrl+"/checkout/completed?m="+W.method,t.uid)}},always:function(){F()},onNotOk:function(e){Log.error("Action: "+h.action),b.removeClass("disabled"),u((e||{}).message||"There was an error processing your request!")}},g=c.find('[name="additionalInfo"]'),v=null;if(g.length)"file"===g.attr("type")?v=g[0].files.length>0?g[0].files[0]:null:h.additionalInfo=g.val();else{var y=c.find(".form-field").not('[data-type="section"]'),w=ClientTools.readFormFields(y);if(w.hasErrors)return b.removeClass("disabled"),void F();h.values=w.values,v=w.file}null===v?ClientTools.makeWebsiteRequest(m):WebPlatform.makeClientWebsiteRequestWithFile(m,v)};if("stripe"===r)f("");else if("braintree"===r)b.addClass("disabled"),I(),C.requestPaymentMethod({threeDSecure:{amount:WebPlatform.currToStr(o.total<.1?1:o.total,"",!0,WebPlatform.Store.currency)}},(function(e,t){if(F(),b.removeClass("disabled"),e){var n=((e.details||{}).originalError||{}).description||"";u((e.message||e)+(""===n?"":" - "+n))}else t.liabilityShifted||!t.liabilityShiftPossible?(b.removeClass("disabled"),f(t.nonce)):u("Card authorization failed. Please try again")}));else if("2checkout"===r)b.addClass("disabled"),TCO.loadPubKey("production",(function(){var e={sellerId:d.twocheckoutSellerId,publishableKey:d.twocheckoutPublicKey,ccNo:t.find('input[data-twocheckout="card-number"]').val(),cvv:t.find('input[data-twocheckout="cvc"]').val(),expMonth:t.find('input[data-twocheckout="exp_month"]').val(),expYear:t.find('input[data-twocheckout="exp_year"]').val()};d.twocheckoutInSandbox&&(e.demo="Y"),TCO.requestToken((function(e){f(e.response.token.token)}),(function(e){b.removeClass("disabled"),u(e.errorMsg)}),e)}));else if("afterpay"===r)AfterPay.init(),f(r);else if("paystack"===r)f("");else if("authorize.net"===r){var p=t.find('[data-payment="authorize.net"]');(m=WebPlatform.parse(p.find('input[data-type="yyyy"]').val()))<100&&(m+=2e3);var h={authData:{clientKey:d.authorizePublicClientKey,apiLoginID:d.authorizeApiLoginId},cardData:{cardNumber:p.find('input[data-type="card-number"]').val(),month:p.find('input[data-type="mm"]').val(),year:m,cardCode:p.find('input[data-type="cvc"]').val()}};window.Accept.dispatchData(h,(function(e){if("Error"===e.messages.resultCode){b.removeClass("disabled");for(var t=(e.messages.message.length,e.messages.message[0].text),n=0;n<e.messages.message.length;++n)Log.error("Error auhtorizing payment with Authorize.net: "+e.messages.message[n].code+": "+e.messages.message[n].text);u(t)}else f(JSON.stringify(e.opaqueData))}))}else if("barclays"===r){p=t.find('[data-payment="barclays"]');var m,g=WebPlatform.parse(p.find('input[data-type="mm"]').val());(m=WebPlatform.parse(p.find('input[data-type="yyyy"]').val()))<100&&(m+=2e3);var v={expirationMonth:""+(g<10?"0"+g:g),expirationYear:""+m};k.createToken(v,(function(e,t){if(e){Log.error(e);var n=e.message;e.details&&e.details.length&&e.details[0].message&&(n=e.details[0].message),u(n),b.removeClass("disabled")}else f(JSON.stringify(t),!1,{step:"barclays-init-3ds"})}))}else"stripeConnect"===r?f(r,!1,{paymentIntentId:x.paymentIntentId}):f(r)}},B=function(){var e=$(this).data("role");e!==w&&"billing"!==e&&("customer-info"!==e&&"billing"!==w||(w=e,X(),WebPlatform.scrollIntoView(c)))},z=function(){T||(I(),w=E?"customer-address"===w?"customer-info":"customer-address":"customer-info",X(),WebPlatform.scrollIntoView(c))},j=function(){T||(E&&"customer-info"===w?function(){R(t.find(".field-with-error"));var e=function(){w="customer-address",X()};if(L)H(e);else{var n=t.find('[name="name"]'),r=t.find('[name="email"]'),i=""!==n.val().trim(),a=""!==r.val().trim();i&&a?e():(h.text(WebPlatform.Phrases["error.fill_required_fields"]),toggleDisplay(h,!0),i||N(n,"field-with-error"),a||N(r,"field-with-error"))}}():(!function(){if(!o.isSampleOrder){I();var n=M(t),r=t.find(".form-field").not('[data-type="section"]'),i=ClientTools.readFormFields(r);if(i.hasErrors)F();else{n.values=i.values,n.order_extra=e.extra||"";var s={action:"orderEnterAddress",method:"post",data:D(n),onOk:function(e){if(R(t.find(".field-with-error")),toggleDisplay(h,!!e.data.errors),e.data&&e.data.message){if(e.data.errors)for(var r=e.data.errors,i=0;i<r.length;++i)N(t.find('[name="'+r[i]+'"]'),"field-with-error");else{r=e.data.additionalFieldsErrors||[];var s=t.find(".form-field").not('[data-type="section"]');for(i=0;i<r.length;++i)r[i]&&N(s.eq(i),"field-invalid")}h.text(e.data.message).removeClass("none"),E&&t.find('[data-role="member"] .field-with-error').length&&(w="customer-info",X()),F()}else w="billing",n.createAccount&&e.data.member&&(WebPlatform.Members=WebPlatform.Members||{},WebPlatform.Members.current=e.data.member,WebPlatform.reportMemberRegistration(e.uid)),o=e.data.order,WebPlatform.Store.Orders.set(a,o),J(),X()}};i.file?WebPlatform.makeClientWebsiteRequestWithFile(s,i.file):WebPlatform.makeClientWebsiteRequest(s)}}}(),WebPlatform.scrollIntoView(c)))},H=function(e){R(t.find(".field-with-error")),toggleDisplay(h,!1),I(),WebPlatform.makeClientWebsiteRequest({action:"loginMember",data:{email:t.find('input[name="email"]').val(),password:t.find('input[name="password"]').val()},onOk:function(t){var n=c.find('[data-role="member-login"]').find('[data-role="login-btn"]').find(".error-message");toggleDisplay(n,!!t.data.error),t.data.error?(n.text(t.data.error).removeClass("none"),F()):(L=!1,WebPlatform.Members=WebPlatform.Members||{},WebPlatform.Members.current=t.data.member,WebPlatform.Store.Orders.reset(a),WebPlatform.Store.Orders.get(D({}),(function(t){t.customerName=(WebPlatform.Members.current||{}).name||"",o=t,e()})))}})},U=function(t){var n=!!WebPlatform.Members.current,r=t.find('[data-role="member-login"]'),i=t.find('[data-role="password"]'),a=t.find('input[name="name"]').show();if(toggleDisplay(r,!n),toggleDisplay(i,!o.loginRequired&&!n&&(T||W||E&&"customer-info"!==w)),!n){var s=o.loginRequired||(e.fields||[]).indexOf("registration")>-1,l=r.find('[data-role="password-fields"]'),c=r.find('[data-role="login-btn"]'),u=c.find('a[data-role="showRegControls"]'),d=c.find('a[data-role="showLoginControls"]'),f=c.find('a[data-role="hideLoginControls"]'),p=c.find(".error-message"),h=r.find('[data-role="prompt-login"]');E&&toggleDisplay(c.find('a[data-role="login"]'),!1),o.loginRequired?(i.hide(),l.show(),h.show(),d.hide(),u.show(),f.hide()):s?(i.show(),u.hide(),f.show(),d.show(),l.hide(),h.show()):(i.hide(),l.hide(),h.hide()),c.hide(),t.hasClass("registration-initiated")||(t.addClass("registration-initiated"),t.on("click",'a[data-role="showRegControls"]',(function(){h.slideDown("fast"),c.slideUp("fast"),l.slideDown("fast"),a.slideDown("fast"),L=!1})).on("click",'a[data-role="hideLoginControls"]',(function(){h.slideDown("fast"),c.slideUp("fast"),p.addClass("none"),l.slideUp("fast"),a.slideDown("fast"),L=!1})).on("click",'a[data-role="showLoginControls"]',(function(){h.slideUp("fast"),c.slideDown("fast"),p.addClass("none"),l.slideUp("fast"),a.slideUp("fast"),L=!0})).on("change",'input[name="createAccount"]',(function(){toggleDisplay(i.find(".password-fields-wrapper"),this.checked,!0)})).on("click.checkout",'a[data-role="login"]',(function(){H((function(){X()}))})).on("keyup.checkout",'input[name="password"]',(function(e){13===e.which&&H((function(){X()}))})))}},V=function(e){if(o.shippingAddress)for(var t in o.shippingAddress)o.shippingAddress[t]&&e.find('input[name="shipping'+WebPlatform.capitalizeFirstLetter(t)+'"]').val(o.shippingAddress[t]);if(o.billingAddress)for(var t in o.billingAddress)o.billingAddress[t]&&e.find('input[name="billing'+WebPlatform.capitalizeFirstLetter(t)+'"]').val(o.billingAddress[t])},G=function(e,t){var n=e.find(".address-title");if(o.shippingInfoRequired?n.text(n.data("shippingLabel")||WebPlatform.Phrases["label.shipping_address"]):n.text(n.data("billingLabel")||WebPlatform.Phrases["label.billing_address"]),toggleDisplay(e.find('[data-role="billing-info"]'),o.shippingInfoRequired),U(e),window.ClientTools){var r=o.customerName?o.customerName:WebPlatform.Members.current?WebPlatform.Members.current.name:"";r||(r=decodeURIComponent(WebPlatform.getUrlQueryParameter(window.location.href,"name")));var i=e.find('input[name="name"]'),s=e.find('input[name="email"]');r&&i.val(r);var l=o.customerEmail||(WebPlatform.Members.current?WebPlatform.Members.current.email:"");l||(l=decodeURIComponent(WebPlatform.getUrlQueryParameter(window.location.href,"email"))),l&&s.val(l||""),WebPlatform.Members.current&&s.prop("disabled",!0);var c=e.find('input[name="useDifferentBillingAddress"]');if(o.shippingInfoRequired&&c.prop("checked",o.shippingAddress&&!ClientTools.isAddressTheSame(o.shippingAddress,o.billingAddress)),e.hasClass("address-initiated"))return V(e),void F();e.addClass("address-initiated"),WebPlatform.requestResource(resources+"/scripts/i18n/countries/"+locale+".js",null,(function(){return window.COUNTRIES&&window.COUNTRIES.length}),(function(){var n=o.shippingAddress&&o.shippingAddress.country?o.shippingAddress.country:WebPlatform.Store.country.toUpperCase(),r=o.billingAddress&&o.billingAddress.country?o.billingAddress.country:WebPlatform.Store.country.toUpperCase();"EN"===n&&(n="US"),"EN"===r&&(r="US"),V(e),P&&P.setCountry(n),ClientTools.bindMemberAddressForm(e,n,r,(function(e,t){return!o.shippingCountries||0===o.shippingCountries.length||"billing"===t||o.shippingCountries.indexOf(e)>-1}),(function(e){var n=e.attr("name");if("shippingCountry"===n||"shippingState"===n||"shippingCompanyName"===n||"shippingZipCode"===n||"shippingCompanyId"===n){var r=e.val();if(!o.isSampleOrder){var i=function(){if(P)switch(n){case"shippingCountry":P.setCountry(r.trim());break;case"shippingState":P.setState(r.trim());break;case"shippingZipCode":P.setZip(r.trim())}};!o.shippingAddress||null===o.shipping&&o.shippingOptions&&o.shippingOptions.length||"shippingCountry"===n&&o.shippingAddress.country!==r||"shippingState"===n&&o.shippingAddress.state!==r||"shippingCompanyName"===n&&o.shippingAddress.companyName!==r||"shippingCompanyId"===n&&o.shippingAddress.companyId!==r?WebPlatform.makeClientWebsiteRequest({action:"orderEnterShippingDetails",method:"post",data:D({type:n,value:r,updateBillingDetails:!c.is(":checked")}),onOk:function(e){o=e.data,WebPlatform.Store.Orders.set(a,o),Q(t),i()}}):i()}}}));var l=$.debounce(250,(function(){if(!o.isSampleOrder&&!WebPlatform.Members.current){var e=$(this),t=e.val().trim();""!==t?WebPlatform.makeClientWebsiteRequest({action:"setOrderEmail",method:"post",data:D({email:t,name:i.val()}),onOk:function(t){o=t.data,R(e)},onNotOk:function(){N(e,"field-with-error")}}):R(e)}}));s.blur(l),F()}))}else F()},Q=function(e){var t=o.shippingOptions||[],n=e.find('div[data-role="shipping-methods"]');toggleDisplay(n.find(".error-message"),0===t.length);var r=!1;n.find(".tick-wrapper").remove(),t.forEach((function(e,t){var i="";o.shipping&&o.shipping.countryCode===e.countryCode&&o.shipping.order===e.order&&(i="checked",r=!0);var a="";("system"===e.kind||i&&e.calculated)&&(a=WebPlatform.currToStr(e.cost,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency));var s=$(WebPlatform.escapeFormat('<label class="tick-wrapper col20 f-left" data-role="shipping-option-%kind%">             <input type="radio" name="shippingOption" data-country="%country%" data-order="%order%" data-kind="%kind%" %checked%>             <span><i class="fa fa-truck"></i>%name%</span>             <span class="price"> %price% </span>           </label>',"country",e.countryCode,"order",e.order,"checked",i,"name",e.name,"price",a,"kind",e.kind));n.append(s),i&&"system"!==e.kind&&P&&P.renderOption(s,e)})),P&&P.onShippingOptionsRendered(),r||n.find('input[type="radio"]').eq(0).prop("checked",!0).change()},Y=function(e){if(window.Stripe&&e){var t=o.total;x&&WebPlatform.numberEquals(x.total||0,t)||(I(),WebPlatform.makeClientWebsiteRequest({action:"getClientPaymentToken",data:D({type:"stripe"}),onOk:function(n){var r=n.data.token,i=n.data.platformPublishableKey,a=n.data.paymentIntentId;if(null===x&&((x={}).stripe=Stripe(i,{stripeAccount:d.stripeConnectAccountId})),x.paymentIntentId=a,x.total=t,x.token!==r&&(x.elements=null),x.token=r,x.elements)x.elements.fetchUpdates();else{x.elements=x.stripe.elements({appearance:{theme:"stripe"},clientSecret:r,locale:WebPlatform.getStripeLocale()});var o={name:"never",address:window.stripeFieldsAddressSettings||{country:"never"}};l||(o.email="never");var s=x.elements.create("payment",{terms:window.stripeTermsSettings||{card:"never"},fields:{billingDetails:o}}),c=e.find(".stripe-ui");s.mount(c[0]),s.on("change",(function(e){A=((e||{}).value||{}).type||"card"}))}},always:function(){F()}}))}},K=function(t){var n=o.total>=.01;t.find(".tick-wrapper").addClass("none");var r=!1;o.items.forEach((function(e){e.isSubscription&&(r=!0)}));var i=c.find(".recaptcha-target"),a=i.length>0&&!0,s=n&&!!d.stripeEnabled,l=n&&!!d.stripeConnectEnabled,u=n&&d.stripeEnabled&&d.stripeIdealEnabled&&!r,f=n&&d.twispayEnabled,p=n&&d.braintreeEnabled,h=n&&d.unipayEnabled,m=n&&d.mollieEnabled&&!r,g=n&&d.authorizeEnabled,v=n&&d.twocheckoutEnabled&&!r,b=n&&d.payulatamEnabled&&!r,y=n&&d.paypalEnabled&&!r,w=n&&d.klarnaEnabled&&!r,P=n&&d.afterpayEnabled&&!r,T=n&&d.mobilpayEnabled&&!r,W=T&&d.mobilpayBitcoinEnabled&&!r,E=n&&d.paystackEnabled,L=n&&d.payfastEnabled,A=!!d.afterpayInSandbox,_=(d.barclaysInSandbox,!!d.authorizeInSandbox),O=(d.payfastInSandbox,d.bankEnabled),M=n&&d.barclaysEnabled,N=n&&d.mercadopagoEnabled&&!r,R=(d.mercadopagoInSandbox,n&&!d.codEnabled&&!O&&!s&&!l&&!d.paypalEnabled&&!d.klarnaEnabled&&!p&&!v&&!P&&!T&&!E&&!g&&!d.payulatamEnabled&&!L&&!f&&!h&&!m&&!M&&!N);if(toggleDisplay(t.find('[data-role="no-methods"]'),R),toggleDisplay(t.find(".payment-mehtods-wrapper"),!R),n){if(toggleDisplay(t.find('[data-payment="no-payment"]'),!1),toggleDisplay(t.find('[data-payment="stripe"]'),s),toggleDisplay(t.find('[data-payment="stripeConnect"]'),l),toggleDisplay(t.find('[data-payment="ideal"]'),u),toggleDisplay(t.find('[data-payment="twispay"]'),f),toggleDisplay(t.find('[data-payment="unipay"]'),h),toggleDisplay(t.find('[data-payment="mollie"]'),m),toggleDisplay(t.find('[data-payment="braintree"]'),p),toggleDisplay(t.find('[data-payment="authorize.net"]'),g),toggleDisplay(t.find('[data-payment="2checkout"]'),v),toggleDisplay(t.find('[data-payment="payulatam"]'),b),toggleDisplay(t.find('[data-payment="paypal"]'),y),toggleDisplay(t.find('[data-payment="klarna"]'),w),toggleDisplay(t.find('[data-payment="afterpay"]'),P),toggleDisplay(t.find('[data-payment="mobilpay"]'),T),toggleDisplay(t.find('[data-payment="mobilpay-btc"]'),W),toggleDisplay(t.find('[data-payment="paystack"]'),E),toggleDisplay(t.find('[data-payment="payfast"]'),L),toggleDisplay(t.find('[data-payment="barclays"]'),M),toggleDisplay(t.find('[data-payment="cod"]'),d.codEnabled),toggleDisplay(t.find('[data-payment="bank"]'),O),toggleDisplay(t.find('[data-payment="mercadopago"]'),N),d.codEnabled){var q=t.find('[data-payment="cod"]');q.find('[data-role="button-label"]').text(d.codLabel||WebPlatform.Phrases["label.cod"]);var B=q.find('[data-role="codInfo"]');toggleDisplay(B,d.codInfo),d.codInfo&&B.text(d.codInfo)}if(O){var z=t.find('[data-payment="bank"]');z.find('[data-role="button-label"]').text(d.bankLabel||WebPlatform.Phrases["label.bank"]);var $=z.find('[data-role="bankInfo"]');toggleDisplay($,O),d.bankInfo&&$.text(d.bankInfo)}}else toggleDisplay(t.find('[data-payment="no-payment"]'),!0);var j=t.find(".payment-mehtods-wrapper .tick-wrapper").not(".none"),H=j.find('input[name="paymentOption"]:checked');if(S=H.length?H.val():j.first().find('input[name="paymentOption"]').prop("checked",!0).val(),(n||a)&&window.ClientTools){if("yes"===t.data("initialized"))return n&&d.stripeConnectEnabled&&Y(),void F();t.data("initialized","yes");var U=[];(s||l)&&U.push({script:"https://js.stripe.com/v3/",check:function(){return!!window.Stripe}}),p&&U.push({script:"https://js.braintreegateway.com/web/dropin/1.44.1/js/dropin.min.js",check:function(){return window.braintree&&window.braintree.dropin}}),v&&U.push({script:"https://www.2checkout.com/checkout/api/2co.min.js",check:function(){return!!window.TCO}}),g&&U.push({script:"https://"+(_?"jstest":"js")+".authorize.net/v1/Accept.js",check:function(){return!!window.Accept}}),P&&U.push({script:"https://"+(A?"portal-sandbox":"portal")+".afterpay.com/afterpay.js",check:function(){return!!window.AfterPay}}),E&&U.push({script:"https://js.paystack.co/v1/inline.js",check:function(){return!!window.PaystackPop}}),M&&U.push({script:"https://flex.cybersource.com/cybersource/assets/microform/0.11/flex-microform.min.js",check:function(){return!!window.Flex}}),WebPlatform.requestScripts(U,(function(){if(WebPlatform.Store.reportAddPaymentDetails(o,WebPlatform.Store.currency),a&&(I(),ClientTools.setupRecaptcha({ui:i,button:c.find('a[data-role="continue"]'),onLoaded:function(e){F()}})),l?Y(t):s&&function(e){I(),(x={}).stripe=Stripe(d.stripePublishableKey.trim()),x.elements=x.stripe.elements({locale:WebPlatform.getStripeLocale()}).create("card",{hidePostalCode:!1!==window.stripeElementsHidePostalCode});var t=e.find(".stripe-card-element");x.elements.mount(t[0]),x.elements.addEventListener("change",(function(e){e.error&&WebPlatform.showClientError(e.error.message,4e3)})),F()}(t),p&&(I(),C=null,null,WebPlatform.makeClientWebsiteRequest({action:"getClientPaymentToken",data:D({type:"braintree"}),onOk:function(e){var t={authorization:e.data.token,container:"#"+c.closest(".widget").attr("id")+" .braintree-element",threeDSecure:!0,locale:WebPlatform.getLocaleName(locale)};if(d.braintreePayPalEnabled){t.paypal={flow:"vault"};var n=c.find('[data-role="bt-payment-title"]');n.text(n.text()+" & PayPal")}window.braintree.dropin.create(t,(function(e,t){if(e)return WebPlatform.showClientError(e.message||e,4e3),void Log.error(e);C=t}))},always:function(){F()}})),M&&(I(),WebPlatform.makeClientWebsiteRequest({action:"getClientPaymentToken",data:D({type:"barclays"}),onOk:function(t){var n=t.data.token,r=new Flex(n);k=r.microform({styles:{input:{color:"#333"}}});var i=c.find("#barclays-card-number-"+e.uiId),a=c.find("#barclays-cvv-"+e.uiId),o=k.createField("number",{placeholder:i.data("placeholder")||"Enter card number"}),s=k.createField("securityCode",{placeholder:a.data("placeholder")||"•••"});o.load("#barclays-card-number-"+e.uiId),s.load("#barclays-cvv-"+e.uiId)},always:function(){F()}})),v||g){var n=t.find(".ccv-pop");t.on("mouseover",".ccv-info",(function(){n.fadeIn("fast")})).on("mouseout",".ccv-info",(function(){n.fadeOut("fast")}))}F()}))}else F()},X=function(){var i=c.find('div[data-role="steps-breadcrumbs"]');toggleDisplay(i,!1),p.find(".active").removeClass("active"),p.find(".visible").removeClass("visible");var a=c.find(".checkout-info");if(a.addClass("none").off(".checkout"),null===o||0===o.items.length)a.filter('[data-step="empty"]').removeClass("none"),F();else{a.filter('[data-step="info"]').removeClass("none");!function(i,a){var l=T?"step-billing":"step-"+w;c.removeClass("step-customer-info step-customer-address step-billing").addClass(l);var u=o.shippingInfoRequired||!s;if(toggleDisplay(f.children('[data-role="address-part"]'),u),"bottom"===e.summaryPosition){var d=c.find('[data-role="mid-nav-target"]'),p=c.find('[data-role="below-summary-nav-target"]'),h=c.find('[data-role="summary-nav-target"]');T||"billing"===w?(e.completeButtonsInSummary?h.append(m):p.append(m),m.addClass("mt-15")):(d.append(m),m.removeClass("mt-15"))}if(toggleDisplay(g,!1),toggleDisplay(v,!1),toggleDisplay(b,!1),toggleDisplay(t,!1),toggleDisplay(n,!1),toggleDisplay(r,!1),toggleDisplay(c.find('[data-role="second-step-items"]'),T||"billing"===w),T)toggleDisplay(b,!0),toggleDisplay(t,!0),G(t,n),o.shippingInfoRequired&&(Q(n),toggleDisplay(n,!0)),toggleDisplay(r,!0),K(r);else{toggleDisplay(a,!0);var C="customer-info"===w,x="customer-address"===w;a.find(".checkout-step").removeClass("active").filter('[data-role="'+w+'"]').addClass("active"),toggleDisplay(a.find('[data-role="address"]'),u),C||x?(toggleDisplay(g,!0),toggleDisplay(t,!0),toggleDisplay(v,x),"bottom"===e.summaryPosition&&toggleDisplay(y,!1),G(t,n),E&&(toggleDisplay(t.find('[data-role="member"]'),C),toggleDisplay(f,x))):(toggleDisplay(v,!0),toggleDisplay(b,!0),toggleDisplay(y,!0),o.shippingInfoRequired&&(toggleDisplay(n,!0),Q(n)),toggleDisplay(r,!0),K(r))}}(0,i)}},J=$.debounce(150,(function(t,n,r){P&&o.shipping&&"system"!==o.shipping.kind&&("1-step"!==e.layout&&"billing"!==w||WebPlatform.makeClientWebsiteRequest({action:"shippingServiceRequest",method:"post",data:D({provider:P.getType(),type:"price",isCod:"cod"===S,serviceId:t,officeId:n,description:r}),onOk:function(e){var t=e.data;WebPlatform.Store.Orders.set(a,t),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:a,order:t,withShippingPrice:!0})}}))})),Z=function(){I();var s=e.pick&&e.products.length>1&&"cart"!==e.id,l=[];c.find('.bump-wrapper[data-default="true"]').each((function(){var e=$(this).find("input").data("bump");e&&l.push(e)})),t=c.find('[data-step="address"]').removeClass("none"),n=c.find('[data-step="shipping"]').removeClass("none"),r=c.find('[data-step="billing"]').removeClass("none"),WebPlatform.Store.Orders.reset(a),WebPlatform.Store.Orders.get(D({policies:!0,paymentOptions:!0,pickProducts:s,pickProductIds:JSON.stringify(e.products),bumps:l.length?JSON.stringify(l):null}),(function(n,l){if(o=n,u=l.policies||null,d=l.paymentOptions||{},function(){var e=u&&u.termsOfService&&""!==u.termsOfService.trim(),t=u&&u.refundPolicy&&""!==u.refundPolicy.trim(),n=u&&u.privacyPolicy&&""!==u.privacyPolicy.trim();if(e||t||n){var r=function(e,t,n,r){n=p.find('[data-type="'+n+'"]'),t=p.find('[data-type="'+t+'"]'),e?(n.children().html(r),t.click((function(){var e=!t.hasClass("active");p.find(".active").removeClass("active"),p.find(".visible").removeClass("visible"),e&&(t.addClass("active"),n.addClass("visible"))}))):(t.remove(),n.remove())};r(e,"tos","tos-target",u.termsOfService.replace(/\n/g,"<br />")),r(n,"privacy","privacy-target",u.privacyPolicy.replace(/\n/g,"<br />")),r(t,"refunds","refunds-target",u.refundPolicy.replace(/\n/g,"<br />"))}else p.remove()}(),WebPlatform.Store.Orders.bind({id:a,products:e.products,funnelId:e.funnel,funnelStepId:e.funnelStep,funnelStepVariantId:e.funnelStepVariant,pickProducts:s&&l.pickProducts&&l.pickProducts.length>0?l.pickProducts:[]},c),o&&o.shippingOptions&&o.shippingOptions.length){o.shippingOptions.filter((e=>e.kind.startsWith("speedy-"))).length>0&&(P=WebPlatform.Widgets.Speedy(i,e.root))}WebPlatform.Store.reportInitiateCheckout(l.uid,o,WebPlatform.Store.currency),X(),o&&o.items&&o.items.forEach((function(e){e.bump&&c.find('input[name="bump'+e.productId+'"]').prop("checked",!0).closest(".bump-wrapper").addClass("bump-active")})),window.ClientTools&&(ClientTools.setupFormFields(c),ClientTools.loadPhoneInput((function(){var t=c.find("#billingPhone_"+e.uiId),n=c.find("#shippingPhone_"+e.uiId);t.length&&PhoneInput.wrap(t[0]),n.length&&PhoneInput.wrap(n[0])}))),c.on("change",".bump-wrapper input",(function(){if(!o.isSampleOrder){var e=$(this),t=e.is(":checked"),n=e.data("bump");o.total;WebPlatform.makeClientWebsiteRequest({action:"setOrderBump",data:D({product:n,add:t}),onOk:function(n){var r=n.data;WebPlatform.Store.Orders.set(a,r),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:a,order:r}),e.closest(".bump-wrapper")[t?"addClass":"removeClass"]("bump-active")}})}})),c.on("click",".variations-update",(function(e){var t=$(this).closest("[data-index]").data("index");if(!(t<0)){if(s&&l.pickProducts&&l.pickProducts.length)for(var n=0;n<o.items.length;++n)if(!o.items[n].bump){t=n;break}var r=o.items[t];r&&WebPlatform.Store.showProductInQuickView(r.productId,D(),r,t)}})),e.pick&&e.pickMultiple&&c.on("click",".checkout-item-cbx.checked",(function(e){var t=$(e.target);if(!t.closest(".qty").length&&!t.closest(".variations-update").length){e.stopPropagation(),e.preventDefault();var n=$(this).closest("[data-product]").data("product");n<1||o.items.length<2||WebPlatform.makeClientWebsiteRequest({action:"removeProductFromPredefinedOrder",method:"post",data:D({productId:n}),onOk:function(e){var t=e.data;WebPlatform.Store.Orders.set(a,t),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:a,order:t})}})}})),c.on("click",".checkout-item-cbx:not(.checked)",(function(t){var n=$(t.target);if(!n.closest(".qty").length&&!n.closest(".variations-update").length){t.stopPropagation(),t.preventDefault();var r=$(this).closest("[data-product]").data("product");r<1||WebPlatform.Store.addProductToOrder(r,e.pickMultiple?"add":"replace",D())}})),c.on("change.checkout",'input[name="shippingOption"]',(function(){if(!o.isSampleOrder){var e=$(this),t=e.data("country"),n=e.data("order");if(!o.shipping||o.shipping.countryCode!==t||o.shipping.order!==n){o.total;WebPlatform.makeClientWebsiteRequest({action:"orderSetShippingOption",method:"post",data:D({country:t,order:n,isCod:"cod"===S}),onOk:function(e){var t=e.data;WebPlatform.Store.Orders.set(a,t),WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:a,order:t,withShippingPrice:!0})}})}}})).on("change.checkout",'input[name="paymentOption"]',(function(){var e="cod"===S;S=this.value;var t="cod"===this.value;P&&(e&&!t||!e&&t)&&J()})).on("keypress.checkout",'input[name="shippingPhone"], input[name="billingPhone"]',(function(e){var t=String.fromCharCode(e.which);if("01234567890+ ()".indexOf(t)<0)return!1})).on("click.checkout",'a[data-role="back"]',z).on("click.checkout",'a[data-role="next-step"]',j).on("click.checkout",".checkout-step",B).on("click.checkout",'a[data-role="continue"]',(function(){q(r,T?t:null)})),document.addEventListener(WebPlatform.Events.ORDER_CHANGED,(function(e,t){if(e.detail.id===a){var n=e.detail.order,r=!0!==e.detail.withShippingPrice;o=n,X(),o.shippingInfoRequired&&r&&J()}}))}))};return{_init:function(){return i=this,Z(),delete this._init,this},getOrder:function(){return o},recalculateShippingPrice:J,setOrderRequestParams:D,clearFieldErrors:R,destroy:function(){}}._init()},WebPlatform.Store.showLoadedProductInQuickView=function(e){mergeUnique(e,{product:null,activeOrderDetails:null,activeOrderItem:null,activeOrderItemIdx:-1,onAddedToOrder:dummy,storeProcess:"",noQuantity:!1});var t=$(".quick-view-overlay"),n=function(e,r){return t.removeClass("animate"),WebPlatform.delay(300,(function(){t.removeClass("visible").off(".product"),t=null,r&&r()})),e&&(e.stopPropagation(),e.preventDefault()),n=null,!1};t.on("click.product",(function(e){$(e.target).hasClass("quick-view-overlay")&&n(e)})),t.on("click.product",'[data-role="close"]',n),t.addClass("visible"),WebPlatform.delay(20,(function(){t.addClass("animate");var r={view:t,product:e.product,populateStaticData:!0,activeOrderDetails:e.activeOrderDetails,selectedOrderItem:e.activeOrderItem,selectedOrderItemIdx:e.activeOrderItemIdx,storeProcess:e.storeProcess,noQuantity:e.noQuantity,onAddedToCart:function(){var t=function(){e.onAddedToOrder&&e.onAddedToOrder()};n?n(null,t):t()}};e.onOptionSelected&&(r.onOptionSelected=e.onOptionSelected),isUndefined(e.forcePrice)||(r.forcePrice=e.forcePrice),WebPlatform.Store.showProductDetailsInView(r)}))},WebPlatform.Store.showProductInQuickView=function(e,t,n,r,i){isUndefined(r)&&(r=-1),WebPlatform.makeClientWebsiteRequest({action:"getStoreProduct",data:{id:e},onOk:function(e){WebPlatform.Store.showLoadedProductInQuickView({product:e.data,activeOrderDetails:t,activeOrderItem:n,activeOrderItemIdx:r,onAddedToOrder:i})}})},WebPlatform.Store.renderProduct=function(e,t,n){(n=n||{}).view=e,n.product=t,WebPlatform.Store.showProductDetailsInView(n)},WebPlatform.Store.showProductPopupDetails=function(e,t,n,r,i,a,o,s){WebPlatform.Store.showProductDetailsInView({view:e,product:t,populateStaticData:n,activeOrderDetails:r,selectedOrderItem:i,selectedOrderItemIdx:a,onAddedToCart:o,storeProcess:s})},WebPlatform.Store.showProductDetailsInView=function(e){mergeUnique(e,{root:null,product:null,populateStaticData:!0,activeOrderDetails:null,selectedOrderItem:null,selectedOrderItemIdx:-1,onAddedToCart:dummy,storeProcess:"",noQuantity:!1,discountBadgeType:"none",showLeftInStock:!1,leftInStockThreshold:0});var t,n,r,i,a,o,s,l,c=e.view,u=e.product,d=e.populateStaticData,f=e.activeOrderDetails,p=e.selectedOrderItem,h=e.selectedOrderItemIdx,m=e.onAddedToCart,g=e.storeProcess,v=u.sku,b=u.price,y=u.salePrice||0,w=u.onSale,C=""===u.quantity||null===u.quantity?null:u.quantity,x=u.variations||[],k=u.combinations,P=[],S=WebPlatform.Store.hideUnavailableVariations,T=null,W=!1,E=function(){var t,d,f,p,h=!1;T={productId:u.id,quantity:parseInt(c.find('[name="orderQuantity"]').val())||1,combination:-1,variation:[],additions:[],price:null},c.find(".product-additional-field input").each((function(e,t){T.additions.push({name:u.additions.fields[e].name,value:t.value})}));for(var m=[],g=0;g<x.length;++g){var S=x[g],W=A.find('[name="'+S.name.replace('"','\\"')+'"]').val();T.variation.push({name:S.name,value:W}),S.advanced&&m.push(W)}if(0===k.length)t=w?y:b,d=w?b:null,p=v,f=C;else{var E=-1;WebPlatform.cartesianProduct(P,(function(e){++E;for(var t=0;t<e.length;++t)if(e[t]!==m[t])return!0;return!1}));var L=k[E];t=L.onSale?L.salePrice:L.price,d=L.onSale?L.price:null,f=L.quantity,p=L.sku,T.combination=L.combination}if((h=null===f||f>0)?(n.removeClass("none"),r.addClass("none")):(n.addClass("none"),r.removeClass("none")),isUndefined(e.forcePrice)||(null!==d&&e.forcePrice>=d&&(d=null),t=e.forcePrice),null===d)i.addClass("none"),a.addClass("none");else if(i.text(WebPlatform.currToStr(d,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)).removeClass("none"),e.discountBadgeType&&"none"!==e.discountBadgeType){var _="";switch(e.discountBadgeType){case"text":_=WebPlatform.Phrases["store.label.sale"];break;case"percent":_="-"+((d-t)/d*100).toFixed(0)+"%";break;case"amount":_=WebPlatform.currToStr(t-d,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)}a.text(_).removeClass("none")}if(l.text(WebPlatform.currToStr(t,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency)),s.closest(".product-sku")[""===p?"addClass":"removeClass"]("none"),s.text(p),T.price=t,h&&null!==f&&e.showLeftInStock&&f<e.leftInStockThreshold){var D="";D=1===f?WebPlatform.Phrases["label.left_in_stock_single"]:WebPlatform.format(WebPlatform.Phrases["label.left_in_stock_multiple"],"x",f),o.text(D).removeClass("none")}else o.addClass("none");return h},L=function(e){var n=c.find('[data-role="images"]'),r=n.find(".product-main-photo").hasClass("with-lens-zoom");if(WebPlatform.removeLightbox(n),null===e||0===e.length)n.removeAttr("data-rel").html('<div class="product-main-photo"><img src="'+resources+"/images/product-avatar-big.svg?v="+resourcesVersion+'" alt=""></div>');else{var i=n.data("images")||[];if(e.length===i.length){for(var a=!1,o=0;o<e.length;++o)if(e[o].name!==i[o].name||e[o].base!==i[o].base){a=!0;break}if(!a)return}var s="",l="";for(o=0;o<e.length;++o){var u=e[o];l+='<div class="none" data-slide="'+getFileFromBase(u.base)+u.name+'?format=webp"></div>',s+="<li>",s+='<a class="product-image '+(0===o?"active":"")+'" data-name="'+u.name+'" data-base="'+u.base+'">',s+=' <img src="'+getThumbnailsFromBase(u.base,"160x120")+u.name+'?format=webp" alt="" />',s+="</a>",s+="</li>"}if(l+='<div class="product-main-photo cursor-zoom'+(r?" with-lens-zoom":"")+'" data-idx="0"><div class="loader"></div>',l+='<img src="'+getFileFromBase(e[0].base)+e[0].name+'?format=webp" alt="" /></div>',e.length>1&&(l+='<ul class="product-photo-list">',l+=s,l+="</ul>"),n.attr("data-rel","lightbox"),n.html(l),r){var d=(t=n.find(".product-main-photo.with-lens-zoom")).children("img");d.ezPlus({zoomType:"lens",lensShape:"round",lensSize:250,containLensZoom:!0,cursor:"pointer"}),t.data("ez",d.data("ezPlus"))}else n.removeClass(".with-tmdp-lightbox"),WebPlatform.refreshLightboxes(n,!0)}n.data("images",e)};if(d){c.find('[data-role="title"]').text(u.title),L(u.images);for(var A=c.find('[data-role="variations"]'),_="",D=0;D<x.length;++D){var O=x[D],I=WebPlatform.escapeHtml(O.name),F=null;p&&p.variation&&p.variation[D]&&(F=p.variation[D].value),_+='<div class="variation-wrapper" data-name="'+I+'">',_+="<label>"+I+"</label>",_+='<select class="product-variation'+(O.advanced?" advanced-variation":"")+'" name="'+I+'">';for(var M=0;M<O.values.length;++M){var N=WebPlatform.escapeHtml(O.values[M]);_+='<option value="'+N+'" '+(N===F?'selected="selected"':"")+">"+N+"</option>"}_+="</select></div>"}if(u.additions&&u.additions.fields&&u.additions.fields.length>0)for(D=0;D<u.additions.fields.length;++D){var R=null;p&&p.additions&&p.additions[D]&&(R=p.additions[D].value);var q=u.additions.fields[D];_+='<div class="variation-wrapper product-additional-field"><label>'+WebPlatform.escapeHtml(q.name)+'</label><input type="text" '+(R?'value="'+WebPlatform.escapeHtml(R)+'"':"")+" /></div>"}A.html(_),p||WebPlatform.Funnels.isInFunnel()&&WebPlatform.Funnels.hideProductLinks?(c.find('[data-add="url"]').removeAttr("href"),c.find(".view-details-btn").css("visibility","hidden")):c.find('[data-add="url"]').css("visibility","visible").attr("href",WebPlatform.Store.baseUrl+"/"+u.url)}var B=c.find(".product-photo-container");if((t=c.find(".product-main-photo.with-lens-zoom")).length>0){var z=t.children("img");z.ezPlus({zoomType:"lens",lensShape:"round",lensSize:250,containLensZoom:!0,cursor:"pointer"}),t.data("ez",z.data("ezPlus"))}c.on("click.product",".product-image",(function(){var e=$(this),n=e.parent().index();if(!e.hasClass("active")){var r=B.find(".loader"),i=e.data("base"),a=e.data("name"),o=B.find(".product-main-photo");o.data("idx",n),o.find("img").attr("src",getFileFromBase(i)+a+"?format=webp"),t.length>0&&t.data("ez").swaptheimage(getFileFromBase(i)+a+"?format=webp",getFileFromBase(i)+a+"?format=webp"),r.addClass("active-loading"),B.find(".active").removeClass("active"),e.addClass("active"),WebPlatform.onImagesLoaded(o,(function(){r.removeClass("active-loading")}))}})),A=c.find(".product-variations"),n=c.find('[data-role="addToCart"]'),r=c.find('[data-role="soldOut"]'),i=c.find('[data-role="oldPrice"]'),a=c.find('[data-role="discount-badge"]'),o=c.find('[data-role="inventory"]'),l=c.find('[data-role="currentPrice"]');var j=c.find('[data-role="simple-desc"]');j.length&&u.description&&u.description.simple&&u.description.text?j.removeClass("none").html(u.description.text):j.addClass("none").empty(),u.subscriptionPeriod?c.find('[data-role="subPeriod"]').removeClass("none").text("/ "+u.subscriptionPeriod):c.find('[data-role="subPeriod"]').addClass("none"),s=c.find('[data-role="sku"]');for(M=0;M<x.length;++M)x[M].advanced&&P.push(x[M].values);c.on("click.product",'[data-role="addToCart"]',(function(){if(null!==T&&!n.hasClass("disabled")){if(e.onOptionSelected)return m(),void e.onOptionSelected(T);n.addClass("disabled");var t=f||{};h>-1&&(t.replaceIdx=h),t.orderId=t.orderId||"cart",t.option=JSON.stringify(T),t.process=g,WebPlatform.makeClientWebsiteRequest({action:"addToCart",data:t,onOk:function(e){var n=e.data;(WebPlatform.Store.reportAddToCart(e.uid,u,T,WebPlatform.Store.currency),W&&!f)?WebPlatform.Funnels.isInFunnel()&&WebPlatform.Funnels.show("next",!0)||(window.location.href=(WebPlatform.Store.baseUrl||"/store")+"/checkout"):(WebPlatform.Store.Orders.set(t.orderId,n),"cart"===t.orderId&&WebPlatform.Store.updateCartNumber(n.size,!0));WebPlatform.Events.trigger(document,WebPlatform.Events.ORDER_CHANGED,{id:t.orderId,order:n}),m()},always:function(){n.removeClass("disabled")}})}})),c.on("change.product",'select, input, [name="orderQuantity"]',E),c.on("change.product","select",$.debounce(100,(function(){var e=$(this);E(),U(e.attr("name"),e.val())}))),c.on("click.product",".number-pad",(function(){var e=$(this),t=parseInt(e.data("role")),n=e.parent().find("input");n.val(Math.max(1,parseInt(n.val())+t)),E()}));var H=function(e,t){for(var n=0;n<x.length;++n){var r=x[n];if(r.name===e){if(r.images&&r.images[t]&&r.images[t].length)return r.images[t];break}}return[]},U=function(e,t){var n=H(e,t);if(0===n.length)for(var r=0;r<T.variation.length;++r){var i=T.variation[r];if((n=H(i.name,i.value)).length)break}0===n.length&&(n=u.images),L(n)};if(S){var V=!1;for(D=0;D<k.length&&!(V=0!==k[D].quantity);++D);S=V}(e.noQuantity||u.withSubscription)&&c.find(".qty-wrapper").hide(),W="buy"===(g||n.data("process")),n.text(p?WebPlatform.Phrases["label.update"]:W?WebPlatform.Phrases["label.buy_now"]:WebPlatform.Phrases["label.add_to_cart"]);let G=c.find('[name="orderQuantity"]');if(G.length&&G.val(p&&p.quantity||1),S){var Q=A.find(".advanced-variation");Q.each((function(e,t){$(this).data("idx",e).change((function(){var e=$(this).data("idx");if(e+1<Q.length){for(var t="",n=0;n<=e;++n)""!==t&&(t+=" ● "),t+=Q.eq(n).val();var r;""!==t&&(t+=" ● "),(r=Q.eq(e+1)).find("option").prop("hidden",!0).each((function(){for(var e=t+this.value,n=0;n<k.length;++n)0!==k[n].quantity&&(0!==k[n].name.indexOf(e+" ● ")&&k[n].name!==e||(this.hidden=!1))})),r.find("option:selected").is("[hidden]")&&r.find("option:not([hidden])").eq(0).prop("selected",!0),r.change()}0!==e||E()||((r=Q.eq(0)).find("option:selected").prop("hidden",!0),r.find("option:not([hidden])").eq(0).prop("selected",!0),r.change(),E())}))})),Q.length>0&&Q.eq(0).change()}E()},WebPlatform.Widgets.Speedy=function(e,t){var n,r,i,a={BG:{id:100,requireState:!1,addressType:1,siteNomen:1},RO:{id:642,requireState:!1,addressType:1,siteNomen:1},GR:{id:300,requireState:!1,addressType:2,siteNomen:0},TR:{id:792,requireState:!1,addressType:2,siteNomen:0},RS:{id:688,requireState:!1,addressType:2,siteNomen:0},GB:{id:826,requireState:!1,addressType:2,siteNomen:0},DE:{id:276,requireState:!1,addressType:2,siteNomen:0},FR:{id:250,requireState:!1,addressType:2,siteNomen:0},IT:{id:380,requireState:!1,addressType:2,siteNomen:0},US:{id:840,requireState:!0,addressType:2,siteNomen:0}},o={},s=null,l=null,c=null,u=null,d=null,f=null,p=null,h=function(){var t=C(),n=l&&l.id?l.id:null;t.countryId===n&&t.siteId===c&&t.state===u&&t.zip===d||m({action:"shippingServiceRequest",method:"post",data:e.setOrderRequestParams({provider:s.getType(),type:"location",locationType:"setLocation",site:c,country:n,state:u,zip:d}),onOk:function(t){var n=e.getOrder();n.extra=n.extra||{},n.extra.speedy=t.data,e.recalculateShippingPrice()}})},m=function(e){var t=WebPlatform.disableAjaxLoader;WebPlatform.disableAjaxLoader=!0;var n=e.always||dummy;e.always=function(){WebPlatform.disableAjaxLoader=t,n()},WebPlatform.makeClientWebsiteRequest(e)};let g=(e,t)=>{m({action:"shippingServiceRequest",method:"post",data:{provider:s.getType(),type:"location",locationType:"site",country:l?l.id:null,name:(e||"").trim()},onOk:e=>{t(e.data||[])}})},v=e=>{r.val(e.name),f={x:e.x,y:e.y},i.val(e.postCode),c=e.id,(d=e.postCode||"").replace(/ /g,""),h()},b=()=>{n=t.find('[data-step="address"]'),r=n.find('[name="shippingCity"]'),stateUi=n.find('[name="shippingState"]'),i=n.find('[name="shippingZipCode"]'),r.length&&(r.autocomplete({highlightClass:"ui-autocomplete-match",delay:100,minLength:1,autoFocus:!0,source:function(e,t){if(null!==l&&1===l.siteNomen){var n=e.term.trim(),r=n.toLowerCase();r.startsWith("с.")||r.startsWith("с ")||r.startsWith("s ")||r.startsWith("s.")?n=n.substring(2):(r.startsWith("гр.")||r.startsWith("гр ")||r.startsWith("gr.")||r.startsWith("gr "))&&(n=n.substring(3)),g(n,(e=>{e.forEach((e=>{let t="";e.type&&(t=e.type+" "),t+=e.name,e.postCode&&(t+=", "+e.postCode);let n="общ. "+e.municipality+", обл. "+e.region;e.rowTop=t,e.rowBottom=n,e.value=e.name})),t(e)}))}},select:function(e,t){return v(t.item),!1}}).attr("autocomplete","no").autocomplete("instance")._renderItem=function(e,t){return $("<li>").append("<div>"+t.rowTop+"<br>"+t.rowBottom+"</div>").appendTo(e)},r.change((()=>{g(r.val(),(e=>{e.length&&v(e[0])}))}))),w()},y=(n,r)=>{let i=e.getOrder(),a=i.shipping&&"system"===i.shipping.kind;if(r||!a){let e=t.find(`input[name="shippingOption"][data-kind="${n}"]`);e&&e.length&&!e.is(":checked")&&e.prop("checked",!0).trigger("change")}let o=t.find('input[name="shippingAddress"], input[name="shippingAddress2"]'),s=t.find('[data-role="shipping-option-speedy-address"]'),l=t.find('[data-role="shipping-option-speedy-office"]');"speedy-address"===n||a?(s.removeClass("none"),l.addClass("none"),o.slideDown("fast"),o.each(((e,t)=>{"-"===t.value&&(t.value="")})),t.find('input[name="deliveryType"][value="speedy-address"]').prop("checked",!0)):(s.addClass("none"),l.removeClass("none"),o.slideUp("fast"),t.find('input[name="deliveryType"][value="speedy-office"]').prop("checked",!0),o.val("-")),p=n},w=()=>{let r=n.find('[name="shippingAddress"]'),i=e.getOrder();if(i.shippingOptions.filter((e=>e.kind&&e.kind.startsWith("speedy-"))).length>1&&!0!==window.speedyAddressOfficeSelectDisabled){const a=i.shipping&&"speedy-office"===i.shipping.kind,o=`<div class="col20 f-left flex flex-row" data-role="delivery-type-picker">\n          <label class="tick-wrapper flex-1">\n            <input type="radio" name="deliveryType" value="speedy-address" ${a?"":"checked"} />\n            <span>${WebPlatform.Phrases["label.speedy.to_address_short"]}</span>\n          </label>\n          <label class="tick-wrapper flex-1 ml-10">\n            <input type="radio" name="deliveryType" value="speedy-office" ${a?"checked":""} />\n            <span>${WebPlatform.Phrases["label.speedy.to_office_short"]}</span>\n          </label>\n      </div>`;r.before(o),n.find('div[data-role="delivery-type-picker"]').on("change","input",(n=>{e.clearFieldErrors(t.find(".field-with-error")),y(n.target.value,!0)})),y(a?"speedy-office":"speedy-address",!0)}};var C=function(){return mergeUnique((e.getOrder().extra||{}).speedy||{},{countryId:null,siteId:null,state:"",zip:""})},x=null,k=function(e){"EL"===e&&(e="GR");var t=function(e){l=e,C().countryId!=e.id&&(c=null,u=null,d=null,r.val(""),stateUi.val(""),i.val(""),h())};!function(e){x=e,a[e]?t(a[e]):m({action:"shippingServiceRequest",method:"post",data:{locationType:"country",provider:s.getType(),type:"location",name:e},onOk:function(n){var r=n.data;r.length&&(a[e]=r[0],x!==e?k(x):t(r[0]))}})}(e)};return{_init:function(){return s=this,b(),delete this._init,this},setCountry:k,setState:function(e){(e=(e||"").trim())!==u&&(u=e,l&&l.siteNomen||h())},setZip:function(e){(e=(e||"").trim())!==d&&((d=e||"").replace(/ /g,""),l&&l.siteNomen||h())},getCountryId:function(){return l&&l.id?l.id:null},getCityId:function(){return c},renderOption:function(t,n){var r=(n.extra||{}).speedy||{},i=C(),a=i.siteId,c="speedy-office"===n.kind,u=function(o){var s='<div class="col20 f-left speedy">',u=!n.calculated&&(null===l||1===l.siteNomen&&0===a||0===l.siteNomen&&""===i.zip);let d="coordinates=23.321744_42.697696";f&&(d=["coordinates=",f.x,"_",f.y].join(""));const p="https://services.speedy.bg/officesmap_v2/?selectOfficeButtonCaption=Избери&office_locator&lang=bg&dist=3&"+d;if(u)s+='<span class="col20 f-left mt-15">'+WebPlatform.Phrases["label.enter_delivery_address"]+"</span>";else if(c&&(s+='<div class="col20 f-left mt-15"><span>'+WebPlatform.Phrases["label.select_speedy_office"]+'</span><input type="text" class="col20 f-left mt-5" placeholder="'+WebPlatform.Phrases["label.select_speedy_office"]+'" name="shippingOffice"></input><a class="color-primary f-left" data-role="pickFromMap" href="'+p+'">Изберете офис от карта</a></div>'),!r.fixedPrice){var h=r.services||[];if(h.length>1){var m='<select class="col20 f-left mt-5" name="shippingService">';0===h.length?m+="<option selected disabled readonly>"+WebPlatform.Phrases["label.no_shipping_services"]+"</option>":h.forEach((function(e){var t=r.serviceId===e.id?"selected":"",n=WebPlatform.currToStr(e.cost,WebPlatform.Store.currencySymbol,WebPlatform.Store.currencySymbolAtLeft,WebPlatform.Store.currency);m+='<option value="'+e.id+'"'+t+">"+e.name+" - "+n+"</option>"})),m+="</select>",s+='<div class="col20 f-left mt-15"><span>'+WebPlatform.Phrases["label.select_delivery_type"]+"</span>"+m+"</div>"}}if(s+="</div>",t.find(".speedy").remove(),t.append(s),t.find('select[name="shippingService"]').change((function(){e.recalculateShippingPrice(this.value,null)})),c){const n=(o=o||[]).filter((e=>e.id===r.officeId))[0]||null,i=t.find('input[name="shippingOffice"]');if(i.length){t.find('a[data-role="pickFromMap"]').click((()=>{let t=null;const n='<iframe id="frameOfficeLocator" name="frameOfficeLocator" src="'+p+'" style="background: #eef1f3; height: '+.8*$window.height()+'px" class="col20 f-left"></iframe>',r=n=>{if(n.origin.indexOf("services.speedy.bg")>-1){const r=+n.data;let i=o.filter((e=>e.id===r)),a=i&&i.length?i[0].name:r;e.recalculateShippingPrice(null,r,a),t.close()}};return WebPlatform.Popups.showSimplePopup(n,.8*$window.width(),(e=>{t=e,window.addEventListener("message",r,!1)}),{showCloseButton:!0,onHide:()=>{t=null,window.removeEventListener("message",r)}}),!1}));let r=()=>{i.select(),i.autocomplete("search","")};n&&i.val(n.name),i.focus(r).click(r),i.keyup((e=>{var t=e.keyCode||e.charCode;if(8===t||46===t)return i.val("").autocomplete("search",""),!1})).autocomplete({minLength:0,delay:0,source:(e,t)=>{let n=o;const r=e.term?e.term.toLowerCase().trim():"";r&&(n=o.filter((e=>e.name.toLowerCase().indexOf(r)>-1||e.nameEn.toLowerCase().indexOf(r)>-1||e.address&&e.address.localAddressString&&e.address.localAddressString.toLowerCase().indexOf(r)>-1))),n.length?t(n):t([{id:null,name:WebPlatform.Phrases["label.no_delivery_offices"]}])},select:(t,n)=>(null!==n.item.id&&(i.val(n.item.name),e.recalculateShippingPrice(null,n.item.id,n.item.name)),!1)}).autocomplete("instance")._renderItem=(e,t)=>{let n=$("<li/>"),r=$("<div />").text(t.name);if(null===t.id&&n.addClass("ui-state-disabled"),n.append(r),t.address&&t.address.localAddressString){let e=$("<span />").text(t.address.localAddressString);n.append(e)}return n.appendTo(e)},i.autocomplete("widget").addClass("speedy-office-autocomplete")}}};if(c){var d=[];a?(d=o[a])&&d.length>0?u(d):m({action:"shippingServiceRequest",method:"post",data:{provider:s.getType(),locationType:"office",type:"location",country:i.countryId,site:a},onOk:function(e){var t=e.data;o[a]=t,u(t)}}):u([])}else u(null)},onShippingOptionsRendered:()=>{p&&y(p)},getType:function(){return"speedy"}}._init()},function(){var e=function(e){var t=this,n=function(e){if(!e.hasClass("initialized")){e.addClass("initialized"),ClientTools.setupFormFields(e);var t=e.find(".recaptcha-target");if(t.length){var n=e.find('[data-role="submit"]');ClientTools.setupRecaptcha({ui:t,button:n})}}},r=function(e){var r=t.root.find("div[data-tab]").filter('div[data-tab="'+e+'"]');null===t.activeTabUI?(t.activeTabUI=r,t.activeTab=e,t.activeTabUI.addClass("active").removeClass("none-soft"),n(t.activeTabUI)):t.activeTabUI.fadeOut(150,(function(){t.activeTab=e,t.activeTabUI.removeClass("active"),t.activeTabUI=r,t.activeTabUI.addClass("active").fadeIn(150),n(t.activeTabUI)}))},i=function(e){if(!e.root||!e.root.length)return null;t.options=e,t.root=e.root,t.activeTab=e.activeTab||ClientTools.getUrlQueryParameter(window.location.href,"tab")||"login",t.activeTabUI=null,t.options=null;-1===["login","recover-password","register"].indexOf(t.activeTab)&&(t.activeTab="login"),"recover-password"===t.activeTab&&ClientTools.getUrlQueryParameter(window.location.href,"t")&&(t.activeTab="recover-password-finish"),t.root.on("click","a[data-show]",(function(){r($(this).data("show"))})).on("keyup",'input[name="password"]',(function(e){13===e.keyCode&&$(this).closest("[data-tab]").find('[data-role="submit"]').trigger("click")})).on("click",'a[data-role="submit"]',(function(){$(this).hasClass("disabled")||function(){switch(t.activeTab){case"login":t.login();break;case"recover-password":t.recoverPassword();break;case"recover-password-finish":t.newPassword();break;case"register":t.register()}}()})),r(t.activeTab)};return{root:null,activeTab:null,activeTabUI:null,options:null,_init:function(e){return t=this,i(e),delete this._init,this},request:function(e){var n=e.data||{},r=this.activeTabUI.find(".error-wrapper").empty();n.act=e.action||"";var i={action:t.getBaseAction(),method:"post",data:n,onOk:function(t){(e.onSuccess||dummy)(t)},onNotOk:function(t){e.onError?e.onError(t):(ClientTools.showMessageBox(t.message,r,"html",!0),ClientTools.hideLoader())}};ClientTools.showLoader(),e.file?WebPlatform.makeClientWebsiteRequestWithFile(i,e.file):WebPlatform.makeClientWebsiteRequest(i)},login:dummy,register:dummy,recoverPassword:dummy,newPassword:dummy,getBaseAction:function(){return"memberRequest"},showTab:r,fireEvent:function(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}}._init(e)};WebPlatform.Widgets.MemberAuthForm=function(t){return $.extend(e(t),{login:function(){var e=this,n=this.activeTabUI.find('input[name="email"]').val(),r=this.activeTabUI.find('input[name="password"]').val(),i=this.activeTabUI.find('input[name="backTo"]').val();ClientTools.showLoader(),this.request({action:"login",data:{email:n,password:r,backTo:i},onSuccess:function(n){var r=t.nextPage?t.nextPage:n.data;n.data&&t.nextPage&&t.nextPage.startsWith("javascript:")&&(r=n.data),r=r||"/",t.eventOnSuccess?(WebPlatform.clearSessionDetails(),WebPlatform.getSessionDetails((()=>{ClientTools.hideLoader(),e.fireEvent(t.eventOnSuccess,{type:"login",nextPage:r})}))):window.location.href=r}})},register:function(){var e=this,n=this.activeTabUI.find('input[name="name"]').val(),r=this.activeTabUI.find('input[name="email"]').val(),i=this.activeTabUI.find('input[name="password"]').val(),a=this.activeTabUI.find('input[name="backTo"]').val(),o=this.activeTabUI.find(".recaptcha-target").data("captcharesponse"),s=this.activeTabUI.find('input[name="formid"]').val(),l=this.activeTabUI.find(".error-wrapper").empty(),c=this.activeTabUI.find(".form-field").not('[data-type="section"]'),u=ClientTools.readFormFields(c);if(!u.hasErrors){var d=u.values||[];d.length>2&&d.splice(0,3),ClientTools.showLoader(),this.request({action:"register",file:u.file,data:{name:n,email:r,password:i,validator:o,backTo:a,values:d,formId:s},onSuccess:function(n){var r=n.data;if(r.approve)e.showTab("register-approve"),ClientTools.hideLoader();else{WebPlatform.reportMemberRegistration(n.uid);var i=(t.nextPage?t.nextPage:r.redirect)||"/";t.eventOnSuccess?(WebPlatform.clearSessionDetails(),WebPlatform.getSessionDetails((()=>{ClientTools.hideLoader(),e.fireEvent(t.eventOnSuccess,{type:"register",nextPage:i})}))):WebPlatform.delay(80,(function(){window.location.href=i}))}},onError:function(t){ClientTools.showMessageBox(t.message,l,"html",!0),ClientTools.resetRecaptcha(e.activeTabUI,e.activeTabUI.find('a[data-role="submit"]')),ClientTools.hideLoader()}})}},recoverPassword:function(){var e=this,t=this.activeTabUI.find('input[name="email"]').val(),n=this.activeTabUI.find(".recaptcha-target").data("captcharesponse");this.request({action:"recover-pass",data:{email:t,validator:n},onSuccess:function(t){ClientTools.hideLoader(),e.showTab("recover-password-message")}})},newPassword:function(){var e=this,t=this.activeTabUI.find('input[name="password"]').val(),n=this.activeTabUI.find('input[name="repeatPassword"]').val(),r=this.activeTabUI.find('input[name="t"]').val();this.request({action:"recover-pass-set-new",data:{password:t,repeatPassword:n,t:r},onSuccess:function(t){ClientTools.hideLoader(),e.showTab("recover-password-success")}})}})},WebPlatform.Widgets.BuilderAuthForm=function(t){var n=$.extend(e(t),{getBaseAction:function(){return"builderAuthRequest"},login:function(){var e=this,n=this.activeTabUI.find('input[name="email"]').val(),r=this.activeTabUI.find('input[name="password"]').val(),i=this.activeTabUI.find('input[name="backto"]').val(),a=this.activeTabUI.find('input[name="wizard"]').val(),o=this.activeTabUI.find('input[name="cc"]').val(),s=this.activeTabUI.find('input[name="category"]').val(),l=this.activeTabUI.find('input[name="sub"]').val();ClientTools.showLoader(),this.request({action:"login",data:{email:n,password:r,backto:i,wizard:a,cc:o,category:s,sub:l},onSuccess:function(n){var r=n.data;t.nextPage&&"/"!==t.nextPage.trim()&&"/me/website"!==t.nextPage.trim()&&(r=t.nextPage),r=r||"/me/website",t.eventOnSuccess?(ClientTools.hideLoader(),e.fireEvent(t.eventOnSuccess,{type:"login",nextPage:r})):window.location.href=r}})},register:function(){var e=this,n=this.activeTabUI.find('input[name="name"]').val(),r=this.activeTabUI.find('input[name="email"]').val(),i=this.activeTabUI.find('input[name="password"]').val(),a=this.activeTabUI.find('input[name="backto"]').val(),o=this.activeTabUI.find(".recaptcha-target").data("captcharesponse"),s=this.activeTabUI.find('input[name="formid"]').val(),l=this.activeTabUI.find('input[name="template"]').val(),c=this.activeTabUI.find('input[name="funnel"]').val(),u=this.activeTabUI.find('input[name="category"]').val(),d=this.activeTabUI.find('input[name="promo"]').val(),f=this.activeTabUI.find('input[name="locale"]').val(),p=this.activeTabUI.find('input[name="wizard"]').val(),h=this.activeTabUI.find('input[name="cc"]').val(),m=this.activeTabUI.find(".error-wrapper").empty(),g=this.activeTabUI.find(".form-field").not('[data-type="section"]'),v=ClientTools.readFormFields(g);if(!v.hasErrors){var b=v.values||[];b.length>2&&b.splice(0,3),ClientTools.showLoader(),this.request({action:"register",file:v.file,data:{name:n,email:r,password:i,validator:o,backto:a,values:b,formId:s,template:l,funnel:c,category:u,promo:d,locale:f,wizard:p,cc:h,timezone:window.jstz?window.jstz.determine().name():""},onSuccess:function(n){var r=n.data;t.nextPage&&"/"!==t.nextPage&&""!==t.nextPage&&(r=t.nextPage),t.eventOnSuccess?(ClientTools.hideLoader(),e.fireEvent(t.eventOnSuccess,{type:"register",nextPage:r})):window.location.href=r},onError:function(t){ClientTools.showMessageBox(t.message,m,"html",!0),ClientTools.resetRecaptcha(e.activeTabUI,e.activeTabUI.find('a[data-role="submit"]')),ClientTools.hideLoader()}})}},recoverPassword:function(){var e=this,t=this.activeTabUI.find('input[name="email"]').val(),n=this.activeTabUI.find(".recaptcha-target").data("captcharesponse");this.request({action:"recover-pass",data:{email:t,validator:n},onSuccess:function(t){ClientTools.hideLoader(),e.showTab("recover-password-message")}})},newPassword:function(){var e=this,t=this.activeTabUI.find('input[name="password"]').val(),n=this.activeTabUI.find('input[name="repeatPassword"]').val(),r=this.activeTabUI.find('input[name="t"]').val();this.request({action:"recover-pass-set-new",data:{password:t,passwordRepeat:n,t:r},onSuccess:function(t){ClientTools.hideLoader(),e.showTab("recover-password-success")}})}});return n}}(),WebPlatform.Widgets.UpsellButton=function(e){if(e.root&&e.root.length){var t=function(t,n){WebPlatform.Popups.showSimplePopup(e.root.find(".card-template").html(),500,(function(e,r){WebPlatform.requestResource("https://"+(n.authorizeInSandbox?"jstest":"js")+".authorize.net/v1/Accept.js",null,(function(){return!!window.Accept}),(function(){var e=r.find("button"),i=r.find(".ccv-pop");r.on("mouseover",".ccv-info",(function(){i.fadeIn("fast")})).on("mouseout",".ccv-info",(function(){i.fadeOut("fast")})),e.on("click",(function(){if(!e.hasClass("disabled")){e.addClass("disabled");var i=WebPlatform.parse(r.find('input[data-role="year"]').val());i<100&&(i+=2e3);var o={authData:{clientKey:n.authorizePublicClientKey,apiLoginID:n.authorizeApiLoginId},cardData:{cardNumber:r.find('input[data-role="number"]').val(),month:r.find('input[data-role="month"]').val(),year:i,cardCode:r.find('input[data-role="cvc"]').val()}};window.Accept.dispatchData(o,(function(n){if("Error"===n.messages.resultCode){e.removeClass("disabled");for(var r=(n.messages.message.length,n.messages.message[0].text),i=0;i<n.messages.message.length;++i)Log.error("Error auhtorizing payment with Authorize.net: "+n.messages.message[i].code+": "+n.messages.message[i].text);ClientTools.showMessageBox(r,e,"before",!0,1e4)}else e.removeClass("disabled"),a(t,JSON.stringify(n.opaqueData))}))}}))}))}))},n=function(t,n,r){WebPlatform.Popups.showSimplePopup(e.root.find(".card-template").html(),500,(function(e,n){WebPlatform.requestResource("https://www.2checkout.com/checkout/api/2co.min.js",null,(function(){return!!window.TCO}),(function(){TCO.loadPubKey("production",(function(){var e=n.find("button"),i=n.find(".ccv-pop");n.on("mouseover",".ccv-info",(function(){i.fadeIn("fast")})).on("mouseout",".ccv-info",(function(){i.fadeOut("fast")})),e.on("click",(function(){if(!e.hasClass("disabled")){e.addClass("disabled");var i={sellerId:r.twocheckoutSellerId,publishableKey:r.twocheckoutPublicKey,ccNo:n.find('input[data-role="number"]').val(),cvv:n.find('input[data-role="cvc"]').val(),expMonth:n.find('input[data-role="month"]').val(),expYear:n.find('input[data-role="year"]').val()};r.twocheckoutInSandbox&&(i.demo="Y"),TCO.requestToken((function(n){e.removeClass("disabled"),a(t,n.response.token.token)}),(function(t){e.removeClass("disabled"),ClientTools.showMessageBox(t.errorMsg,e,"before",!0,1e4)}),i)}}))}))}))}))},r=function(e,t,n){if("collect-device-data"!==n.action){ClientTools.showLoader();var r=n.accessToken,i=n.stepUpUrl,o=n.pareq,s=400,l=400;try{var c=atob(o);if(c&&(c=JSON.parse(c))&&c.challengeWindowSize)switch(c.challengeWindowSize){case"01":s=250,l=400;break;case"02":s=390,l=400;break;case"03":s=500,l=600;break;case"04":s=600,l=400;break;case"05":s=$(window).width(),l=$(window).height()}}catch(e){Log.error(e)}var u="iframe"+WebPlatform.getRandomString(6),d='<div class="col20 f-left" style="background: #ffffff">'+('<iframe src="about:blank" id="'+u+'" name="'+u+'" style="width: '+s+"px; height:"+l+'px"></iframe>')+"</div>";WebPlatform.Popups.showSimplePopup(d,s,(function(t){ClientTools.hideLoader();var n=jQuery('<form class="none" action="'+i+'" method="POST" target="'+u+'"></form>'),s=jQuery('<input type="hidden" name="JWT" />');s.val(r),n.append(s),(s=jQuery('<input type="hidden" name="PaReq" />')).val(o);var l=function(n){n.origin&&n.origin===window.location.protocol+"//"+window.location.host&&(window.removeEventListener("message",l),"barclays-setup-complete"===n.data.event&&(t.close(),a(e,n.data.transactionId)))};window.addEventListener("message",l,!1),$("body").append(n),n.submit(),n.remove(),n=null}),{showCloseButton:!1})}else!function(e,t,n){ClientTools.showLoader();var r=n.accessToken,i=n.deviceDataCollectionUrl,o=n.inSandbox?"https://centinelapistag.cardinalcommerce.com":"https://centinelapi.cardinalcommerce.com",s=function(t){if(!t.origin||t.origin!==o)return;let n=JSON.parse(t.data);ClientTools.hideLoader(),n&&n.Status?a(e,"",{deviceSessionId:n.SessionId}):showError("Unable to collect device data!"),window.removeEventListener("message",s),document.body.removeChild(l),l=null};window.addEventListener("message",s,!1);var l=document.createElement("iframe"),c="iframe"+WebPlatform.getRandomString(6);l.src="about:blank",l.width=l.height="1",l.style.opacity="0",l.style.position="absolute",l.style.zIndex=-1,l.style.display="none",l.id=c,l.name=c,document.body.appendChild(l);var u=jQuery('<form class="none" action="'+i+'" method="POST" target="'+c+'"></form>'),d=jQuery('<input type="hidden" name="JWT" />');d.val(r),u.append(d),$("body").append(u),u.submit(),u.remove(),u=null}(e,0,n)},i=function(e,i,o,s){if("unipay"===o||"mollie"===o)window.location.href=s.redirect;else if("payulatam"===o)!function(e){var t=!0===WebPlatform.Store.PayULatamInTestMode,n='<form method="post" action="'+(t?"https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/":"https://checkout.payulatam.com/ppp-web-gateway-payu/")+'">                       <input name="merchantId"    type="hidden"  value="'+e.merchantId+'" />                       <input name="accountId"     type="hidden"  value="'+e.accountId+'" />                       <input name="description"   type="hidden"  value="'+e.description+'" />                       <input name="referenceCode" type="hidden"  value="'+e.referenceCode+'" />                       <input name="amount"        type="hidden"  value="'+e.amount+'" />                       <input name="tax"           type="hidden"  value="'+e.tax+'" />                       <input name="taxReturnBase" type="hidden"  value="'+e.taxReturnBase+'" />                       <input name="currency"      type="hidden"  value="'+e.currency+'" />                       <input name="signature"     type="hidden"  value="'+e.signature+'" />                       <input name="algorithmSignature" type="hidden"  value="'+e.algorithmSignature+'" />';t&&(n+='<input name="test" type="hidden"  value="1" />'),n+='<input name="buyerFullName" type="hidden"  value="'+e.buyerFullName+'" />                       <input name="buyerEmail"    type="hidden"  value="'+e.buyerEmail+'" />                       <input name="responseUrl"   type="hidden"  value="'+e.responseUrl+'" />                       <input name="confirmationUrl" type="hidden"  value="'+e.confirmationUrl+'" />',e.hasShipping&&(n+='<input name="shippingAddress"   type="hidden"  value="'+e.shippingAddress+'" />                           <input name="shippingCity" type="hidden"  value="'+e.shippingCity+'" />                           <input name="shippingCountry" type="hidden"  value="'+e.shippingCountry+'" />'),n+='<input name="Submit" type="submit" value="" />                     </form>';var r=$('<div class="hidden"></div>');r.append(n),$(document.body).append(r),r.find("form").submit(),ClientTools.showLoader()}(s);else if("authorize.net"===o)t(e,s);else if("stripe"===o)!function(e,t){t.paymentMethod?WebPlatform.requestResource("https://js.stripe.com/v3/",null,(function(){return!!window.Stripe}),(function(){window.stripeInstance||(window.stripeInstance=Stripe(t.stripePublishableKey.trim())),window.stripeInstance.confirmCardPayment(t.secret,{payment_method:t.paymentMethod}).then((function(t){t.error?(Log.error(t.error),message=t.error.message||t.error,ClientTools.showError(message)):a(e,t.paymentIntent.id)}))})):ClientTools.showError(t.status)}(e,s);else if("2checkout"===o)n(e,0,s);else if("barclays"===o)r(e,0,s);else if("paystack"===o)WebPlatform.requestResource("https://js.paystack.co/v1/inline.js",null,(function(){return!!window.PaystackPop}),(function(){i=Math.round(100*i),PaystackPop.setup({key:s.paystackPublicKey,email:s.customerEmail,channels:["card","ussd","qr","mobile_money"],amount:i,currency:WebPlatform.Store.currency,callback:function(t){a(e,t.reference)},onClose:function(){}}).openIframe()}));else if("payfast"===o){var l="https://"+(s.sandbox?"sandbox":"www")+".payfast.co.za/eng/process",c=$('<div class="hidden"></div>'),u=$('<form method="POST" action="'+l+'"></form>');for(var d in s)if("sandbox"!==d){var f=$('<input type="hidden" />').attr("name",d).attr("value",s[d]);u.append(f)}c.append(u),$(document.body).append(c),u.submit(),ClientTools.showLoader()}else if("mobilpay"===o){c=$('<div class="hidden"></div>');(u=$('<form method="POST" action="'+s.redirect+'"></form>')).append('<input type="hidden" name="env_key" value="'+s.envKey+'" />'),u.append('<input type="hidden" name="data" value="'+s.data+'" />'),c.append(u),$(document.body).append(c),u.submit(),ClientTools.showLoader()}},a=function(t,n,r){var o={extra:e.extra,orderToken:e.lastOrderToken,funnel:e.funnel,step:e.funnelStep,variant:e.funnelStepVariant,selectedOption:null===t?null:JSON.stringify(t),token:n};r&&mergeUnique(o,r),ClientTools.showLoader(),WebPlatform.makeClientWebsiteRequest({action:"approveUpsell",method:"post",data:o,always:function(){ClientTools.hideLoader()},onOk:function(n){var r=n.data;if(r.hasOptions){var o={product:r.product,storeProcess:"buy",noQuantity:!0,onOptionSelected:function(e){a(e,null)}};e.sellFor&&(o.forcePrice=e.sellFor),WebPlatform.Store.showLoadedProductInQuickView(o)}else r.requestLogin?function(t,n,r){WebPlatform.Popups.showSimplePopup(e.root.find(".member-template").html(),500,(function(e,i){i.find('[name="email"]').val(n);var o=i.find('[data-role="login-view"]'),s=i.find('[data-role="register-view"]'),l=i.find("button"),c=i.find('input[name="password"]'),u=i.find('input[name="new_password_repeat"]'),d=i.find(".error-message");i.on("click",'[data-role="register-btn"]',(function(){o.slideUp("fast",(function(){s.slideDown("fast")})),l.data("action","register")})),i.on("click",'[data-role="cancel-btn"]',(function(){s.slideUp("fast",(function(){o.slideDown("fast")})),l.data("action","login")})),l.click((function(){var i=l.data("action")||"login",o="loginMember",s={email:n,password:c.val()};"register"===i&&(o="registerMember",s.passwordRepeat=u.val(),s.name=r),d.addClass("none"),WebPlatform.makeClientWebsiteRequest({action:o,data:s,onOk:function(n){var r=n.data;r.error?d.removeClass("none").text(r.error):(e.close(),WebPlatform.Members=WebPlatform.Members||{},WebPlatform.Members.current=r.member,a(t))}})}))}))}(t,r.customerEmail,r.customerName):r.requestPayment?i(t,r.amount,r.paymentMethod,r.options):r.completed?(WebPlatform.Store.reportPurchase(n.uid,r.order.id,r.purchasedItems,r.total,null,null,r.order),WebPlatform.delay(50,(function(){WebPlatform.Store.goToThankYouPage(e.funnelStep,r.next)}))):r.redirect&&(ClientTools.showLoader(),window.location.href=r.redirect)}})};e.lastOrderToken?Cookies.set("last-order-token",e.lastOrderToken,{expires:30,path:"/"}):e.lastOrderToken=Cookies.get("last-order-token")||"",e.funnelStep=WebPlatform.parse(e.funnelStep),e.root.on("click",".upsell-positive-action",(function(){a(null,null)})).on("click",".upsell-negative-action",(function(){WebPlatform.Funnels.show("next",!1,!0)}))}},WebPlatform.Widgets.WebsiteSubscription=function(e){if(!WebPlatform.Widgets.shouldRender(e.root))return null;var t,n,r,i,a,o,s,l=e.root,c=l.find('[data-role="error-message"]'),u=l.find('input[name="formid"]').val(),d="1-step"===e.layout,f=[],p="regular"===e.subscriptionType,h=0,m=window.defaultSubscriptionWidgetPeriod||"yearly",g="",v=e.applyTax?WebPlatform.getVatRate(WebPlatform.ipCountryCode||e.invCountry||"US"):0,b=0,y=0,w="",C=0,x=0,k=d?null:l.find('[data-role="steps-breadcrumbs"]'),P=null,S=null,T=null,W=l.find('[data-role="next-step"]'),E=l.find('[data-role="continue"]'),L=l.find('[data-role="back"]'),A=l.find('[data-role="toggleLoginControls"]'),_=!0!==window.disableSubscriptionWidgetLogin&&e.user&&e.user.email?e.user:null,D=null===_,O={cardType:"",nonce:"",paypalEmail:"",paypalCountry:"",lastTwo:""},I=0,F=function(){++I>1||(window.ClientTools&&ClientTools.showHideAjaxLoadingIndicator(!1),l.addClass("checkout-loading"))},M=function(){--I<0&&(I=0),0===I&&(window.ClientTools&&ClientTools.showHideAjaxLoadingIndicator(!0),l.removeClass("checkout-loading"))},N=function(e){c.text(e).removeClass("none")},R=function(){c.addClass("none").text("")},q=function(t,n){t=t.toUpperCase(),(n=(n||"").trim().toUpperCase().replace(/[^0-9A-Z]/g,"")).length>7&&0===n.indexOf(t)&&t!==e.invCountry?v=0:e.applyTax&&(v=WebPlatform.getVatRate(t)),B()},B=function(){var t=b;x=y*(1+Math.max(0,v)/100);var n=l.find('[data-role="vatRow"]');if(v>0&&b>.01?(t=b*(1+v/100),vatAmount=t-b,n.removeClass("none"),n.find('[data-role="vat-percent"]').text(v+"%"),n.find(".subtotal-value").text(WebPlatform.currencyWithCodeToStr(vatAmount,e.currency))):n.addClass("none"),x<.01)l.find('[data-role="next-billing-details"]').hide();else{var r=w+" - "+WebPlatform.currencyWithCodeToStr(x,e.currency);l.find('[data-role="nextBillingInfo"]').text(r),l.find('[data-role="next-billing-details"]').show()}l.find(".trial-message")[e.trial?"removeClass":"addClass"]("none"),l.find(".final-cost")[t<.01?"addClass":"removeClass"]("none"),t>=.01&&l.find('[data-role="total-price"]').text(WebPlatform.currencyWithCodeToStr(t,e.currency)),C=t},z=function(){var e=[];return l.find(".bump-wrapper").removeClass("bump-active").find('input[type="checkbox"]:checked').each((function(){var t=$(this);e.push(WebPlatform.parse($(this).data("bump"))),t.closest(".bump-wrapper").addClass("bump-active")})),e},j=$.debounce(200,(function(){F();var i=z();WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"calculatePrice",form:u,bumps:JSON.stringify(i),selectedPeriod:m,selectedPlan:h,selectedDiscount:g},onOk:function(i){var a=i.data;b=a.totalNoVat,w=WebPlatform.ddmmyyyyDateToStrWithMonth(a.nextBillingDate),y=a.nextBillingPriceNoVat,a.discountCode.toUpperCase()!==g.toUpperCase()&&(g="",window.ClientTools&&ClientTools.showError("Invalid Promo Code")),g=a.discountCode;var o=l.find('[data-role="discount-row"]');if(g){var s=a.basePlanPrice-("monthly"===m?a.monthlyPrice:a.yearlyPrice),c=WebPlatform.currencyWithCodeToStr(s,e.currency);l.find(".no-discount-wrapper").addClass("none");var u=WebPlatform.escapeFormat('    <div class="subtotal-wrapper">       <span class="subtotal flex flex-row" style="line-height: 30px">         <a class="remove-discount-btn"><i class="fa fa-trash-o"></i></a>        <span class="col20 f-left">%title%</span>       </span>       <mark class="subtotal-price subtotal-value">%price%</mark>     </div>',"title",g+" (-"+a.discount+"%)","price",c);o.html(u).removeClass("none")}else l.find(".no-discount-wrapper").removeClass("none"),o.html("").addClass("none");var d=a.bumps||[],v=l.find('[data-role="bump-prices"]');if(d.length){var C="";d.forEach((function(t){var n=WebPlatform.currencyWithCodeToStr(t.price,e.currency);t.isSubscription&&(n+=" / "+WebPlatform.Store.subscriptionToStr(t.subscription)),C+=WebPlatform.escapeFormat('    <div class="subtotal-wrapper">       <span class="subtotal">         <span class="col20 f-left">%title%</span>       </span>       <mark class="subtotal-price subtotal-value">%price%</mark>     </div>',"title",t.name,"price",n)})),v.html(C).removeClass("none")}else v.addClass("none");if(p){for(var x="",k=0;k<f.length;++k)if(f[k].id===h){x=f[k].name;break}t.val(h),n.val(m),r.find('[data-role="plan-name"]').text(x);var P=a.monthlyPrice,S=a.yearlyPrice,T="";if("monthly"===m)T=WebPlatform.currencyWithCodeToStr(P,e.currency)+"/"+WebPlatform.Phrases["label.month"];else{var W=Math.round(100-S/(12*P)*100);T=WebPlatform.currencyWithCodeToStr(S,e.currency)+"/"+WebPlatform.Phrases["label.year"],W>0&&(T+=" <span>("+WebPlatform.Phrases["label.saving"]+" "+W+"%)</span>")}l.find('[data-role="plan-period-price"]').html(T)}B(),J()},always:function(){M()}})})),H=function(){var e=l.find(".connected-paypal-account"),t=l.find(".card-form");""===O.nonce?(toggleDisplay(t,!0),toggleDisplay(e,!1)):"PayPal"===O.cardType&&(e.find('[data-role="paypal-account"]').text(O.paypalEmail),toggleDisplay(e,!0),toggleDisplay(t,!1))},U=function(){null!==S&&S.tokenize({flow:"vault"},(function(e,t){e?"CUSTOMER"!==e.type&&N(e.message||"Unknown error"):(O.cardType="PayPal",O.nonce=t.nonce,O.paypalEmail=t.details.email,O.paypalCountry=t.details.countryCode,H())}))},V=function(){var t=l.find('[data-role="logged-info"]'),n=l.find('[data-role="guest-info"]');_?(t.show(),n.hide(),t.find(".logged-in-name").html(_.name),t.find(".logged-in-email").html(_.email)):(n.show(),t.hide()),function(){var t=l.find('[data-role="project-select"]');if(_&&!e.trial){var n=function(e){var n=t.find("select");n.find("option").not(":first").remove();var r=null;e.forEach((function(e){null===r&&"ACTIVE"!==e.status&&(r=e);var t=$("<option />").attr("value",e.id).text(e.name||"Project");n.append(t)})),r?n.val(r.id):0===e.length?n.val(""):n.val(e[0].id)};_.projects&&_.projects.length?n(_.projects):WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"listProjects",form:u},onOk:function(e){_.projects=e.data||[],n(_.projects)},onNotOk:function(e){}}),t.show()}else t.hide()}()},G=function(){F(),Q((function(e){null===e?(V(),d||(k.find("a").removeClass("active").eq(1).addClass("active"),l.find('[data-step="final"]').removeClass("none"),l.find('[data-step="initial"]').addClass("none")),R()):N(e),M()}))},Q=function(e){_?e(null):(i=l.find('[name="name"]').val(),a=l.find('[name="email"]').val(),o=l.find('[name="password"]').val(),s=l.find('[name="phone"]').val(),WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"checkAccountDetails",form:u,name:i,email:a,password:o,phone:s,login:!D},onOk:function(t){D||(_=t.data),e(null)},onNotOk:function(t){e(t.message)}}))},Y=function(){k.find("a").removeClass("active").eq(0).addClass("active"),l.find('[data-step="initial"]').removeClass("none"),l.find('[data-step="final"]').addClass("none"),R()},K=function(){E.hasClass("disabled")||(F(),i=l.find('[name="name"]').val(),a=l.find('[name="email"]').val(),o=l.find('[name="password"]').val(),s=l.find('[name="phone"]').val(),Z((function(){R();var t=WebPlatform.parse(WebPlatform.getUrlQueryParameter(window.location.href,"template"),0),n=WebPlatform.parse(WebPlatform.getUrlQueryParameter(window.location.href,"funnel"),0),r=WebPlatform.getUrlQueryParameter(window.location.href,"cc"),c=WebPlatform.getUrlQueryParameter(window.location.href,"category"),d=window.jstz&&jstz.determine().name()||"GMT",f=l.find('[name="companyName"]').val(),p=l.find('[name="companyId"]').val(),b=l.find('[name="country"]').val(),y=l.find('[name="city"]').val(),w=l.find('[name="state"]').val(),x=l.find('[name="zip"]').val(),k=l.find('[name="address"]').val(),P=D?-1:l.find('[name="project"]').val()||-1,S=l.find(".form-field").not('[data-type="section"]'),T=ClientTools.readFormFields(S);if(T.hasErrors)M();else{var W={action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"subscribe",form:u,bumps:JSON.stringify(z()),selectedPeriod:m,selectedPlan:h,selectedDiscount:g,templateId:t,funnelId:n,cc:r,category:c,timezone:d,total:C,vatPercent:v,paymentData:JSON.stringify(O),name:i,email:a,phone:s,password:o,companyName:f,companyId:p,countryCode:b,city:y||"-",state:w,zip:x,address:k||"-",currentFunnel:e.funnel,currentFunnelStep:e.funnelStep,currentFunnelStepVariant:e.funnelStepVariant,locale:WebPlatform.getUrlQueryParameter(window.location.href,"locale")||"",project:P,values:T.values},onOk:function(t){var n=t.data;if(n.errors&&n.errors.length){for(var r=l.find(".form-field").not('[data-type="section"]'),o=0;o<n.errors.length;++o)n.errors[o]&&r.eq(o).addClass("field-invalid").find(".field-error").text(n.errors[o]);ClientTools.resetRecaptcha(l,E),N(n.message)}else if(n.recalculateTax)v=n.tax,N("We've updated your total price. Please confirm your new price and try again."),ClientTools.resetRecaptcha(l,E),B();else if(n.redirectUrl){var s=[{id:0,quantity:1,price:C}];WebPlatform.visitorName=i,WebPlatform.visitorEmail=a,WebPlatform.Store.reportPurchase(t.uid,(new Date).getTime(),s,C,"NewSubscription",e.currency,i,a),WebPlatform.delay(50,(function(){window.location=n.redirectUrl,toggleDisplay(l,!1)}))}else"REQUIRES_ACTION"===n&&X();M()},onNotOk:function(e){N(e.message),ClientTools.resetRecaptcha(l,E),M()}};T.file?WebPlatform.makeClientWebsiteRequestWithFile(W,T.file):WebPlatform.makeClientWebsiteRequest(W)}}),(function(){M()})))},X=function(){F();var e="payment"===P.type?P.instance.confirmPayment:P.instance.confirmSetup,t=_&&_.name?_.name:l.find('[name="name"]').val().trim(),n=_&&_.email?_.email:l.find('[name="email"]').val().trim(),r={};t&&(r={name:t,email:n});var i=l.find('[name="country"]').val().trim();if("UK"===i?i="GB":"EL"===i&&(i="GR"),i){r.address={country:i};var a=l.find('[name="address"]').val();a&&(r.address.line1=a.trim());var o=l.find('[name="zip"]').val();o&&(r.address.postal_code=o.trim());var s=l.find('[name="city"]').val();s&&(r.address.city=s.trim());var c=l.find('[name="state"]').val();c&&(r.address.state=c.trim())}e({elements:P.elements,confirmParams:{return_url:window.location.protocol+"//"+window.location.host+"/_service/processing?type=stripe-widget",payment_method_data:{billing_details:r}}}).then((function(e){e.error&&N(e.error.message||e.error.code||e.error.decline_code||e.error),M()}))},J=$.debounce(250,(function(){switch(e.processor){case"braintree":case"paypal-bt":if(null!==P||null!==S)return;!function(t){F();var n=[{script:"https://js.braintreegateway.com/web/3.115.2/js/client.js",check:function(){return window.braintree&&window.braintree.client}}];"braintree"===t&&(n.push({script:"https://js.braintreegateway.com/web/3.115.2/js/three-d-secure.min.js",check:function(){return window.braintree&&window.braintree.threeDSecure}}),n.push({script:"https://js.braintreegateway.com/web/3.115.2/js/hosted-fields.js",check:function(){return window.braintree&&window.braintree.hostedFields}})),window.paypalDisabled||n.push({script:"https://js.braintreegateway.com/web/3.115.2/js/paypal.js",check:function(){return window.braintree&&window.braintree.paypal}}),WebPlatform.requestScripts(n,(function(){WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"getBTToken",form:u},onOk:function(n){var r=n.data;window.braintree.client.create({authorization:r},(function(n,r){n?N(n):("braintree"===t&&(F(),window.braintree.hostedFields.create({client:r,styles:{input:{color:"#898989","font-family":"Arial, sans-serif"}},fields:{number:{selector:e.rootSelector+" [data-name='card-number']",placeholder:"Card number"},cvv:{selector:e.rootSelector+" [data-name='card-cvv']",placeholder:"CVV"},expirationDate:{selector:e.rootSelector+" [data-name='card-expiration']",placeholder:"MM/YYYY"}}},(function(e,t){M(),e?N(e.message):WebPlatform.initiateBraintree3DSecureIfEnabled(r,(function(e){P=t,T=e}),(function(t){N(e.message)}))}))),window.paypalDisabled||(F(),window.braintree.paypal.create({client:r},(function(e,t){M(),e?N(e):S=t})))),M()}))}})})),l.find('[data-role="connectPayPal"]').click(U),l.find('[data-role="disconnectPayPal"]').click((function(){O.cardType="",O.nonce="",O.paypalEmail="",O.paypalCountry="",H()}))}(e.processor);break;case"stripe":if(null!==P)return;F(),WebPlatform.requestResource("https://js.stripe.com/v3/",null,(function(){return!isUndefined(window.Stripe)}),(function(){(P={}).stripe=Stripe(e.stripePK),P.elements=P.stripe.elements({locale:WebPlatform.getStripeLocale()}).create("card",{hidePostalCode:!0});var t=l.find('[data-name="card-number"]');P.elements.mount(t[0]),P.elements.addEventListener("change",(function(e){e.error?N(e.error.message):R()})),M()}));break;case"authorize.net":if(null!==P)return;!function(){F();var t="https://"+(e.authorizeInSandbox?"jstest":"js")+".authorize.net/v1/Accept.js";WebPlatform.requestResource(t,null,(function(){return!!window.Accept}),(function(){P={},l.on("keyup.cardEvents",".card-cvc",(function(e){var t=$(this);t.val(t.val().replace(/[^0-9]/g,"").substring(0,4))})),l.on("keyup.cardEvents",".card-date",(function(e){if(9===(e.which||e.keyCode))return!1;var t=$(this),n=t.val().replace(/[^0-9]/g,"");n.length>4&&(n=n.substring(0,4));var r=n.length>2?n.substring(2):"";n.length>1&&(n=n.substring(0,2)+" / "+r),t.val(n),7===n.length&&t.next().focus()})),M()}))}();break;case"paystack":if(null!==P)return;F(),WebPlatform.requestResource("https://js.paystack.co/v1/inline.js",null,(function(){return!isUndefined(window.PaystackPop)}),(function(){P={},M()}));break;case"stripe-connect":t=Math.round(100*(C+Number.EPSILON))/100,null!==P&&P.total===t||(F(),WebPlatform.requestResource("https://js.stripe.com/v3/",null,(function(){return!isUndefined(window.Stripe)}),(function(){WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"getStripeToken",amount:t<.1?0:t,form:u},onOk:function(e){var n=e.data.token,r=e.data.platformPublishableKey,i=e.data.stripeConnectAccountId;if(null===P&&((P={}).instance=Stripe(r,{stripeAccount:i})),P.total=t,t>0?("payment"!==P.type&&(P.elements=null),P.type="payment",P.token!==n&&(P.token=n,P.instance.retrievePaymentIntent(n).then((function(e){e.paymentIntent&&(P.intent=e.paymentIntent.id)})))):("setup"!==P.type&&(P.elements=null),P.type="setup",P.token!==n&&(P.token=n,P.instance.retrieveSetupIntent(n).then((function(e){e.setupIntent&&(P.intent=e.setupIntent.id)})))),P.elements)P.elements.fetchUpdates();else{P.elements=P.instance.elements({appearance:{theme:"stripe"},clientSecret:n,locale:WebPlatform.getStripeLocale(window.userLocale)});var a={name:"never",email:"never",address:{country:window.subscriptionWidgetStripeAskForCountry?"auto":"never"}};P.element=P.elements.create("payment",{terms:window.stripeTermsSettings||{card:"never"},fields:{billingDetails:a}}),P.element.mount(l.find('[data-name="card-area"]')[0])}M()}})})))}var t})),Z=function(t,n){switch(e.processor){case"braintree":case"paypal-bt":!function(t,n){null!==P||null!==S?"PayPal"!==O.cardType?null!==P?P.tokenize((function(r,i){if(r){var a=null;switch(r.code){case"HOSTED_FIELDS_FIELDS_EMPTY":case"HOSTED_FIELDS_FIELDS_INVALID":a="Please fill all card fields";break;default:a="There was an error processing your request - "+r.message}return N(a),void n()}T?T.verifyCard({challengeRequested:!0,onLookupComplete:function(e,t){t()},amount:WebPlatform.currToStr(C<.1?x<.1?1:x:C,"",!0,e.currency),nonce:i.nonce,bin:i.details.bin},(function(e,r){if(e){var i=((e.details||{}).originalError||{}).description||"";return N(e.message+(""===i?"":" - "+i)),void n()}r.liabilityShifted||!r.liabilityShiftPossible?(O.paypalEmail="",O.paypalCountry="",O.nonce=r.nonce,O.cardType=r.details.cardType,O.lastTwo=r.details.lastTwo,t()):(N("Card authorization failed. Please try again"),n())})):(O.paypalEmail="",O.paypalCountry="",O.nonce=i.nonce,O.cardType=i.details.cardType,O.lastTwo=i.details.lastTwo,t())})):n():t():n()}(t,n);break;case"stripe":!function(e,t){WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"getStripeToken",amount:C<.1?0:C,form:u},onOk:function(n){if(C<.1)P.stripe.handleCardSetup(n.data,P.elements,{payment_method_data:{}}).then((function(n){n.error?(N(n.error.message||n.error),t()):(O.paypalEmail="",O.paypalCountry="",O.cardType="",O.lastTwo="",O.nonce=n.setupIntent.id,R(),e())}));else{var r={payment_method:{card:P.elements}},i=_&&_.name?_.name:l.find('[name="name"]').val().trim(),a=_&&_.email?_.email:l.find('[name="email"]').val().trim();i&&(r.payment_method.billing_details={name:i,email:a}),P.stripe.confirmCardPayment(n.data,r).then((function(n){n.error?(N(n.error.message||n.error),t()):(O.paypalEmail="",O.paypalCountry="",O.cardType="",O.lastTwo="",O.nonce=n.paymentIntent.id,R(),e())}))}}})}(t,n);break;case"authorize.net":!function(t,n){var r=l.find(".card-number").val().trim(),i=l.find(".card-date").val().split("/"),a=l.find(".card-cvc").val(),o=i[0].trim(),s=WebPlatform.parse(i.length>1?i[1].trim():"",2018);s<100&&(s+=2e3);var c={authData:{clientKey:e.authorizePK,apiLoginID:e.authorizeApiLoginId},cardData:{cardNumber:r,month:o,year:s,cardCode:a.trim()}};window.Accept.dispatchData(c,(function(e){if("Error"===e.messages.resultCode){for(var i=(e.messages.message.length,e.messages.message[0].text),a=0;a<e.messages.message.length;++a)Log.error("Error auhtorizing payment with Authorize.net: "+e.messages.message[a].code+": "+e.messages.message[a].text);N(i),n()}else O.paypalEmail="",O.paypalCountry="",O.nonce=JSON.stringify(e.opaqueData),O.cardType="card",O.lastTwo=r.length>1?r.substring(r.length-2,r.length):"",t()}))}(t,n);break;case"paystack":!function(t,n){O.nonce?t():Q((function(r){if(null===r){var i=Math.round(100*C);PaystackPop.setup({key:e.paystackPK,email:a||_.email,channels:["card"],amount:i<1?"USD"===e.currency?20:5e3:i,currency:e.currency,metadata:{custom_fields:[{display_name:"Website Subscription",variable_name:"website",value:window.location.href}]},callback:function(e){O.paypalEmail="",O.paypalCountry="",O.nonce=e.reference,O.cardType="card",O.lastTwo="",t()},onClose:function(){O.nonce=null,O.cardType="",n()}}).openIframe()}else N(r),n()}))}(t,n);break;case"stripe-connect":!function(e,t){O.nonce=P.intent,e()}(t);break;default:N("Payment processor not supported"),n()}};!function(){if(d?l.find('[data-step="initial"], [data-step="final"]').removeClass("none"):Y(),L.click(Y),A.click((function(){D=!D,l.find('[data-role="prompt-register"]')[D?"slideUp":"slideDown"]("fast"),l.find('[data-role="prompt-login"]')[D?"slideDown":"slideUp"]("fast"),l.find('input[name="name"], input[name="phone"]')[D?"slideDown":"slideUp"]("fast")})),W.click(G),E.click(K),p){var i=l.find(".plan-select");r=i.find('[data-role="plan-selected"]'),t=i.find('[data-role="available-plans"]'),n=i.find('[data-role="plan-period"]'),t.find("option").each((function(){var e=$(this);f.push({id:WebPlatform.parse(e.attr("value")),name:e.text()})})),n.change((function(){m="monthly"===this.value.toLowerCase()?"monthly":"yearly",j()})),f.length<2?i.find(".plan-change").remove():i.on("click",".plan-change",(function(){r.addClass("none"),t.removeClass("none")})),t.change((function(){h=WebPlatform.parse($(this).val(),0),t.addClass("none"),r.removeClass("none"),j()})),h=WebPlatform.parse(WebPlatform.getUrlQueryParameter(window.location.href,"plan"),f.length>0?f[0].id:0),m="monthly"===(WebPlatform.getUrlQueryParameter(window.location.href,"period")||window.defaultSubscriptionWidgetPeriod||"yearly").toLowerCase()?"monthly":"yearly",g=WebPlatform.getUrlQueryParameter(window.location.href,"discount");for(var a=!1,o=0;o<f.length;++o)if(f[o].id===h){a=!0;break}a||(h=f.length>0?f[0].id:0),t.val(h)}var s=l.find('[name="country"]'),c=l.find('[name="state"]'),u=l.find('[name="companyId"]');if(window.ClientTools?(u.keyup((function(){q(s.val(),u.val())})),WebPlatform.requestResource(resources+"/scripts/i18n/countries/"+locale+".js",null,(function(){return window.COUNTRIES&&window.COUNTRIES.length}),(function(){WebPlatform.getSessionDetails((t=>{ClientTools.bindCountryAndState(s,c,t.ipCountryCode||e.invCountry||"US",(function(){q(s.val(),u.val())}))}))}))):q(e.invCountry||"US",u.val()),l.on("click",'a[data-role="toggle-billing-info"]',(function(){l.find('div[data-role="billing-form"]').slideToggle("fast")})).on("click",".promo-code-toggle-btn",(function(){l.find(".coupon-code-wrapper").toggleClass("none")})).on("click",".discount-code-btn",(function(){var e=l.find(".apply-code-input").val().trim();""!==e&&(g=e,j())})).on("click",".remove-discount-btn",(function(){g="",j()})).on("keyup",".apply-code-input",(function(e){13===e.keyCode&&l.find(".discount-code-btn").click()})),l.find(".bump-wrapper input").change(j),window.ClientTools){var v=l.find(".recaptcha-target");v.length>0&&ClientTools.setupRecaptcha({ui:v,button:l.find('a[data-step="final"][data-role="continue"]'),onLoaded:function(e){M()}}),ClientTools.setupFormFields(l)}V(),j()}()},WebPlatform.Widgets.WebsiteSubscriptionUpsell=function(e){if(!e.root||!e.root.length)return null;var t=e.root,n=t.find('input[name="formid"]').val(),r=t.find('[data-role="continue"]'),i=0,a=function(){ClientTools.showLoader(),WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"upsell",form:n,project:e.project,currentFunnel:e.funnel,currentFunnelStep:e.funnelStep,currentFunnelStepVariant:e.funnelStepVariant},onOk:function(n){var r=n.data;if(r.redirectUrl){window.location.href=r.redirectUrl;var a=[{id:0,quantity:1,price:i}];WebPlatform.Store.reportPurchase(n.uid,(new Date).getTime(),a,i,"NewBuilderSubscription",e.currency),WebPlatform.delay(50,(function(){window.location=r.redirectUrl,toggleDisplay(t,!1)}))}ClientTools.showLoader()},onNotOk:function(e){ClientTools.hideLoader(),ClientTools.showError(e.message)}})};r.click(a),e.project?Cookies.set("last-subscribed-project",e.project,{expires:7,path:"/"}):e.project=Cookies.get("last-subscribed-project")||"",e.projectUrl&&$('a[href="/me/website"], a[href="https://'+e.platformUrl+'/me/website"]').attr("href",e.projectUrl),WebPlatform.makeClientWebsiteRequest({action:"subscriptionWidgetReq",method:"post",data:{widgetAction:"calculatePrice",form:n,bumps:JSON.stringify([]),selectedPeriod:"yearly",selectedPlan:0},onOk:function(n){var r=n.data,a=r.totalNoVat,o=WebPlatform.ddmmyyyyDateToStrWithMonth(r.nextBillingDate),s=r.nextBillingPriceNoVat,l=e.tax||0,c=a;nextBillingPrice=s;var u=t.find('[data-role="vatRow"]');if(l>0&&a>.01?(c=a*(1+l/100),vatAmount=c-a,nextBillingPrice=s*(1+l/100),u.removeClass("none"),u.find('[data-role="vat-percent"]').text(l+"%"),u.find(".subtotal-value").text(WebPlatform.currencyWithCodeToStr(vatAmount,e.currency))):(u.addClass("none"),t.find(".final-cost").addClass("none")),nextBillingPrice<.01)t.find('[data-role="next-billing-details"]').hide();else{var d=o+" - "+WebPlatform.currencyWithCodeToStr(nextBillingPrice,e.currency);t.find('[data-role="nextBillingInfo"]').text(d),t.find('[data-role="next-billing-details"]').show()}t.find('[data-role="total-price"]').text(WebPlatform.currencyWithCodeToStr(c,e.currency)),i=c}})};var $document=$(document),$window=$(window),windowHeight=0,windowWidth=0,TMDP_SLIDERS=[],resources="",locale="en",content="",resourcesVersion=0,recaptchaLoaded=!1,onRecaptchaLoaded=function(){recaptchaLoaded=!0},ClientTools=function(){var e,t,n,r,i,a,o,s=[],l=[],c=[],u=[],d=null,f=!1,p=[],h=function(e){for(var t=0;t<e.length;++t)try{e[t]()}catch(e){Log.error(e)}},m=function(e){null===s?e():s.push(e)},g=function(){window.addEventListener("logged-in",(function(){h(p),p=null}))},v=!0,b=!0,y=function(e,t,n,r,i){var a=e.find('input[name="formid"]').val(),o=e.find(".form-field").not('[data-type="section"]'),s=ClientTools.readFormFields(o),l=s.hasOwnProperty("amount")?s.amount:0;if(s.hasErrors)t.removeClass("disabled");else{var c={action:"submitForm",method:"post",data:{values:s.values,form:a,amount:l,nonce:r,step:n},onOk:function(n){t.removeClass("disabled");var r=n.data;if(r.errors){for(var l=0;l<r.errors.length;++l){var c=r.errors[l];null!==c&&o.eq(l).addClass("field-invalid").find(".field-error").text(c)}ClientTools.resetRecaptcha(e,t)}else if(r.paymentError)"confirm_payment"===r.paymentError.error&&i?(t.addClass("disabled"),i(r.paymentError.extra)):(WebPlatform.showClientError(r.paymentError.error,3e3),ClientTools.resetRecaptcha(e,t));else{var u="page"===e.data("onSubmit")?e.data("onSubmitPage"):null;if(WebPlatform.Events.trigger(e,WebPlatform.Events.FORM_SUBMITTED,{formId:a,values:s.values,uid:n.uid}),null===u)ClientTools.showMessageBox(r.message,e,"before"),e.slideUp("fast");else{u=u.trim(),WebPlatform.lastFormParams="";var d=!0===e.data("passValues");s.urlFields.length>0&&s.urlFields.forEach((function(e){(d||"hidden"===e.type)&&e.value&&(""!==WebPlatform.lastFormParams&&(WebPlatform.lastFormParams+="&"),WebPlatform.lastFormParams+=encodeURIComponent(WebPlatform.removeDiacritics(e.name))+"="+encodeURIComponent(e.value))})),WebPlatform.delay(80,(function(){var e=0!==u.toLowerCase().trim().indexOf("javascript:")&&""!==WebPlatform.lastFormParams;window.location.href=e?u+(-1===u.indexOf("?")?"?":"&")+WebPlatform.lastFormParams:u}))}}},onNotOk:function(n){t.removeClass("disabled"),ClientTools.resetRecaptcha(e,t),this._onNotOk(n)}};null===s.file?ClientTools.makeWebsiteRequest(c):WebPlatform.makeClientWebsiteRequestWithFile(c,s.file)}};return m((function(){(f=!(!window.history||!window.history.pushState))&&($("body").on("click","a[rel='client-tab']",(function(e){var t=$(this).attr("href");return ClientTools.goToUrl(t),!1})),$window.bind("popstate",(function(e){window.location.pathname!==ClientTools.currentPage&&(ClientTools.currentPage=window.location.pathname,h(u))})))})),m(g),$((function(){var e;e=$('<div id="client-ajax-overlay"><div id="client-ajax-message"></div></div>'),$("body").append(e),$document.ajaxStart((function(){var t=WebPlatform.disableAjaxLoader?3e5:b?v?5e3:1e3:3e4;e.addClass("client-ajax-in-progress").delay(t).queue((function(t){e.addClass("client-slow-ajax"),t()})),v=!1})).ajaxStop((function(){e.hasClass("client-slow-ajax")?(WebPlatform.delay(350,(function(){e.removeClass("client-ajax-in-progress")})),e.removeClass("client-slow-ajax").clearQueue()):e.removeClass("client-ajax-in-progress").clearQueue()})),$window.scroll((function(){h(c)})).resize((function(){windowHeight=$window.height(),windowWidth=$window.width(),h(l)})),windowHeight=$window.height(),windowWidth=$window.width();var t=s;s=null,h(t),t=WebPlatform.documentReadyRequests||[],WebPlatform.documentReadyRequests=null,t.length>0&&h(t),d&&d(),h(u),$window.scroll(),WebPlatform.processAccumulatedRequests()})),{currentPage:window.location.pathname,showLoader:function(){var e=$('<div id="client-ajax-overlay" class="client-ajax-in-progress"><div id="client-ajax-message"></div></div>');$("body").append(e),WebPlatform.delay(20,(function(){e.addClass("client-slow-ajax"),e=null})),window.dispatchEvent(new Event("loading-start"))},hideLoader:function(){for(var e=$("#client-ajax-overlay");e.length;)e.remove(),e=$("#client-ajax-overlay");window.dispatchEvent(new Event("loading-end"))},showHideAjaxLoadingIndicator:function(e){b=!!e},goToUrl:function(e,t){(!0===t||e!==ClientTools.currentPage)&&(f?(window.history.pushState({path:e},"",e),ClientTools.currentPage=e,h(u)):window.location=e)},refreshLightboxes:WebPlatform.refreshLightboxes,refreshCountdowns:function(){$(".flip-countdown:not(.with-countdown)").each((function(){var e=$(this);WebPlatform.Countdown.create(e)}))},refreshToggles:function(){$(".toggle-widget").not(".with-toggle").each((function(){$(this).addClass("with-toggle").on("click",".toggle-header",(function(){var e=$(this).closest("section");if(!e.data("has-height")){var t=e.find(".toggle-widget-content-wrapper")[0];t.style.maxHeight=t.scrollHeight+"px",e.data("has-height",!0)}e.hasClass("open")?e.removeClass("open"):(e.parent().children(".open").removeClass("open"),e.addClass("open"))}))}))},onSetupMenu:function(e){d=e},transitionsSupported:WebPlatform.transitionsSupported,onDocumentReady:m,onLoggedIn:function(e){null===p?e():p.push(e)},addOnLocationChangeListener:function(e){u.push(e)},addOnScrollListener:function(e){c.push(e)},addOnResizeListener:function(e){l.push(e)},dateToString:function(e){var t=e.getDate(),n=e.getMonth()+1,r=e.getFullYear(),i=e.getHours(),a=e.getMinutes();e.getSeconds();return(t<10?"0"+t:t)+"/"+(n<10?"0"+n:n)+"/"+r+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)},dateToStr:function(e,t){var n=e.getDate(),r=e.getMonth()+1,i=e.getFullYear();return"uk"===t?(n<10?"0"+n:n)+"/"+(r<10?"0"+r:r)+"/"+i:(r<10?"0"+r:r)+"/"+(n<10?"0"+n:n)+"/"+i},timeToString:WebPlatform.timeToString,isUndefined:function(e){return void 0===e},escapeHtml:WebPlatform.escapeHtml,format:WebPlatform.format,escapeFormat:function(){var e=arguments;if(e.length%2!=1)throw"Invalid number of arguments! Usage: format(formatString, key, value, key, value...)";for(var t=e[0],n=1;n<e.length;n+=2){var r=new RegExp("%"+e[n]+"%","g");t=t.replace(r,ClientTools.escapeHtml(e[n+1]))}return t},delay:WebPlatform.delay,showMessageBox:function(e,t,n,r,i){i=ClientTools.isUndefined(i)?6e3:i,n=n||"append";var a=$('<div class="message-box"><span class="message"></span><a href="javascript: void(0)" title="" class="close"><i class="fa fa-times"></i></a></div>');r&&a.addClass("error-box"),a.find(".message").html(e),t[n](a),a.slideDown("fast");var o=!1,s=function(){o||(o=!0,a.slideUp("fast",(function(){a.remove(),a=null})))};a.find(".close").one("click",s),i>100&&ClientTools.delay(i,s)},showError:WebPlatform.showClientError,parse:WebPlatform.parse,getUrlParameter:WebPlatform.getUrlParameter,getUrlQueryParameter:WebPlatform.getUrlQueryParameter,scrollToTop:function(){return window.scrollTo({top:0,behavior:"smooth"}),!1},onImagesLoaded:WebPlatform.onImagesLoaded,mergeUnique:function(e,t){for(var n in t)ClientTools.isUndefined(e[n])&&(e[n]=t[n]);return e},sharePage:WebPlatform.sharePage,makeWebsiteRequest:WebPlatform.makeClientWebsiteRequest,highlightMarkup:function(){if(window.CodeMirror){var e=$(".code:not(.code-formatted)").addClass("code-formatted");e.length>0&&e.each((function(e,t){var n=$(t),r=n.data("theme");switch(r){case"dark":r="ambiance";break;case"material":r="material-darker";break;case"monokai":r="monokai";break;default:r="eclipse"}CodeMirror.fromTextArea(t,{lineNumbers:!0===n.data("rows"),styleActiveLine:!0,matchBrackets:!0,readOnly:!0,mode:n.data("language")||"text/html",theme:r})}))}},repaintParallaxes:function(){for(var e=0;e<ClientTools._parallaxes.length;++e){var t=t=ClientTools._parallaxes[e];if(t.recalculateDimensions){var n=t.image[0].naturalWidth,r=t.image[0].naturalHeight,i=t.parent.outerWidth(),a=n/r;t.parentTop=t.parent.offset().top,t.parentHeight=t.parent.outerHeight(),n!=i&&(r=(n=i)/a),r<t.parentHeight&&(n=(r=t.parentHeight)*a),t.image.css({width:n+"px",height:r+"px"}),t.imageHeight=r}var o=t.imageHeight-t.parentHeight,s=t.parentTop+t.parentHeight,l=t.parentTop,c=$(window).scrollTop(),u=window.innerHeight,d=(c+u-l)/(t.parentHeight+u),f=Math.round(o*d*("slow"===t.speed?.5:1));s>c&&l<c+u&&t.image.css("transform","translate3D(-50%,"+f+"px, 0)")}},refreshDelayedWidgets:function(){$("div.with-delay:not(.with-delay-initialized)").each((function(e,t){(t=$(t)).addClass("with-delay-initialized");var n=$window.width(),r=n<=480,i=!r&&n<=1024;if((r||i||!t.hasClass("mobile-only"))&&!(r&&t.hasClass("phone-hidden")||i&&t.hasClass("tablet-hidden"))){var a=WebPlatform.parse(t.data("delay"))||0;WebPlatform.delay(1e3*a,(function(){t.addClass("delay-ended")}))}}))},_parallaxes:[],refreshParallaxes:function(){$("body").find("[data-parallax]:not(.with-parallax)").each((function(e,t){var n,r,i=(t=$(t).addClass("with-parallax")).data("speed")||"normal",a=t.data("parallax"),o=t.data("alt")||"";r="fixed"===i?windowWidth<=768?"fixed-mobile-parallax":"fixed-parallax":"moving-parallax",(n=$('<div class="parallax-bg '+r+'"><img src="'+a+'" alt="'+WebPlatform.escapeHtml(o)+'"/></div>')).prependTo(t),ClientTools.onImagesLoaded(n,(function(){var e=n.find("img");e.css("display","block"),"fixed"===i?n.css("background-image",'url("'+a+'")'):(ClientTools._parallaxes.push({parent:t,image:e,speed:i,recalculateDimensions:!0}),window.requestAnimationFrame(ClientTools.repaintParallaxes)),a=null,t=null,i=null,n=null}))}))},tick:function(){return(new Date).getTime()},portfolioPopup:(e=null,t=null,n=null,r=null,i=null,a=null,o=function(e,n){if(n<=0?i.removeClass("visible"):i.addClass("visible"),n>=e.length-1?a.removeClass("visible"):a.addClass("visible"),!(n<0||n>=e.length)){var o=e.data("showingInPopup");e.data("currentItem",n);var s=e.filter('[data-index="'+n+'"]'),l=s.find(".zoom").length>0,c=s.find(".popup").length>0;l||c?o&&!c?o=!1:o||l||(o=!0):o=!1;var u=$(t),d=s.data("featured"),f="";if(0===d)f="<div style=\"background-image: url('"+s.find("[data-image]").data("image")+"')\"></div>",f+='<img class="hide-in-popup" src="'+s.find("[data-image]").data("image")+'" alt="" />';else if(1===d){var p=s.find("[data-image]"),h=p.eq(0).data("image");f+='<img src="'+h+'" alt="" style="opacity: 0; visibility: hidden" />',f+='<div class="inline-gallery">',p.each((function(){f+='<div class="inline-gallery-item" style="background-image: url(\''+$(this).data("image")+"')\"></div>"})),f+="</div>"}else f=s.find('[data-image="video"]').html();u.find(".preview").html(f);var m=s.find('[data-type="url"]'),g=u.find(".view");m.length>0?g.attr("href",m.attr("href")):g.remove(),u.find(".categories").html(s.find('[data-type="categories"]').html()),u.find(".post-title").html(s.find('[data-type="title"]').html()),u.find(".post-description").html(s.find('[data-type="description"]').html()),r.append(u),u.removeClass("in-popup in-lightbox").addClass(o?"in-popup":"in-lightbox");var v=r.find(".active");v.removeClass("active"),ClientTools.delay(300,(function(){v.remove()})),r.addClass("active-loading"),ClientTools.onImagesLoaded(u,(function(){r.removeClass("active-loading");var e=o?u.width():u.find(".preview").width(),t=.9*$window.width(),n=u.height(),i=$window.height();u.css({left:(t-e)/2+"px",top:(i>n?(i-n)/2:-(n-i)/2)+"px"}),ClientTools.refreshLightboxes(),u.addClass("active").data("lastshowtype",o)}))}},{setup:function(s){null===e&&(t='<div class="portfolio-item-detail show" data-role="close">             <div class="preview" data-role="close"></div>             <div class="details">               <div class="content">                 <div class="post-summary">                   <h5 class="post-title"></h5>                   <div class="categories"></div>                   <span class="post-description"></span>                 </div>               </div>               <div class="buttons">                 <a title="" class="view primaryColor-bg2">'+WebPlatform.Phrases["label.view"]+"</a>               </div>             </div>           </div>",$("body").append('<div id="portfolio-popups-overlay"></div>             <div id="portfolio-popups" data-role="close">               <a class="close" title="" data-role="close"> X </a>               <a class="prev" title=""> &lt; </a>               <a class="next" title=""> &gt; </a>               <div id="portfolio-popup-content" data-role="close">               </div>             </div>'),n=$("#portfolio-popups-overlay"),r=$("#portfolio-popup-content"),e=$("#portfolio-popups"),i=e.find(".prev"),a=e.find(".next"),n.add(e).on("click",'[data-role="close"]',(function(t){if("close"===$(t.target).data("role")){$("body").removeClass("with-popup");var o=e.find(".active").add(e).add(n).add(r);o.removeClass("active"),i.add(a).removeClass("visible").off("click"),ClientTools.delay(300,(function(){o.removeClass("show"),r.find(".portfolio-item-detail").remove()}))}}))),s.data("currentItem",0),s.data("showingInPopup",!1),s.find(".zoom, .popup").click((function(){i.click((function(){o(s,s.data("currentItem")-1)})),a.click((function(){o(s,s.data("currentItem")+1)}));var t=$(this);$("body").addClass("with-popup");var r=t.closest("[data-index]").data("index");return $("#portfolio-popup-content").addClass("show active").find(".portfolio-item-detail").addClass("show"),e.addClass("show active"),n.addClass("show active"),s.data("showingInPopup",t.hasClass("popup")),o(s,r),!1}))}}),setupPortfolioPopup:function(e){ClientTools.portfolioPopup.setup(e)},bindCountryAndState:function(e,t,n,r){for(var i="",a=0;a<COUNTRY_CODES.length;++a){var o=COUNTRY_CODES[a];i+='<option value="'+o+'">'+((COUNTRIES||COUNTRY_CODES)[a]||o)+"</option>"}e.empty().append(i).val(n).change((function(){var e=$(this),n=e.val(),i=t.val();if(STATES[n]){var a=t,o="",s="";t.is("input")?(o=t.attr("placeholder")||"State",s=t.attr("name")||"state",a=$('<select name="'+s+'"></select>'),t.replaceWith(a),t=a):(o=a.data("placeholder"),a.empty());var l=STATES[n];markup="",markup+='<option value="" disabled selected="selected">'+o+"</option>";for(var c=0;c<l.length;++c)markup+='<option value="'+l[c]+'">'+l[c]+"</option>";a.data("placeholder",o).html(markup);var u=a.find('option[value="'+(i||"")+'"]');u.length>0&&u.prop("selected",!0)}else if(t.is("select")){o=t.data("placeholder")||"State",s=t.attr("name")||"state",a=$('<input value="" type="text" placeholder="'+o+'" name="'+s+'" />');t.replaceWith(a),t=a}(r||dummy)(e)})).change()},isAddressTheSame:function(e,t){return e===t||(e=e||{},!((t=t||{}).name||t.companyName||t.companyId||t.phone||t.vatId||t.state||t.city||t.zipCode||t.address||t.address2)||(e.name||"")===(t.name||"")&&(e.companyName||"")===(t.companyName||"")&&(e.companyId||"")===(t.companyId||"")&&(e.phone||"")===(t.phone||"")&&(e.vatId||"")===(t.vatId||"")&&(e.country||"")===(t.country||"")&&(e.state||"")===(t.state||"")&&(e.city||"")===(t.city||"")&&(e.zipCode||"")===(t.zipCode||"")&&(e.address||"")===(t.address||"")&&(e.address2||"")===(t.address2||""))},bindMemberAddressForm:function(e,t,n,r,i){r=r||!1;for(var a=e.find('select[name="shippingCountry"]'),o=e.find('select[name="billingCountry"]'),s="",l=null,c=0;c<COUNTRY_CODES.length;++c){var u=COUNTRY_CODES[c];r&&!r(u,"shipping")||(u!==t&&null!==l||(l=u),s+='<option value="'+u+'">'+((COUNTRIES||COUNTRY_CODES)[c]||u)+"</option>")}a.empty().append(s).val(l),s="",l=null;for(c=0;c<COUNTRY_CODES.length;++c){u=COUNTRY_CODES[c];r&&!r(u,"billing")||(u!==n&&null!==l||(l=u),s+='<option value="'+u+'">'+((COUNTRIES||COUNTRY_CODES)[c]||u)+"</option>")}o.empty().append(s).val(l),s=null;var d=e.find(".billing-address-wrapper");e.find('input[name="useDifferentBillingAddress"]').change((function(){d[this.checked?"slideDown":"slideUp"]("fast")})).change(),e.find('input[name="shippingCompanyName"], input[name="billingCompanyName"]').keyup((function(){$(this).next()[""===this.value.trim()?"slideUp":"slideDown"]("fast")})).keyup(),e.on("change",'select[name="shippingState"], select[name="billingState"]',(function(){(i||dummy)($(this))})),e.on("change",'input[name="shippingCompanyName"], input[name="shippingCompanyId"], input[name="shippingZipCode"], input[name="shippingState"]',(function(){(i||dummy)($(this))})),e.find('select[name="shippingCountry"], select[name="billingCountry"]').change((function(){var e=$(this),t=e.val(),n=0===this.name.indexOf("shipping")?"shipping":"billing",r=e.parent().find('[name="'+n+'State"]'),a=r.val();if(STATES[t]){var o=r,s="";r.is("input")?(s=r.attr("placeholder")||"State",o=$('<select name="'+n+'State"></select>'),r.replaceWith(o)):(s=o.data("placeholder"),o.empty());var l=STATES[t];markup="",markup+='<option value="" disabled selected="selected">'+s+"</option>";for(var c=0;c<l.length;++c)markup+='<option value="'+l[c]+'">'+l[c]+"</option>";o.data("placeholder",s).html(markup);var u=o.find('option[value="'+(a||"")+'"]');u.length>0&&u.prop("selected",!0)}else if(r.is("select")){s=r.data("placeholder")||"State";r.replaceWith('<input value="" type="text" placeholder="'+s+'" name="'+n+'State" />')}(i||dummy)(e)})).change()},isMobile:WebPlatform.isMobile,loadPhoneInput:function(e){if(window.PhoneInput)e();else{var t=resources+"/scripts/external/intl-tel-input/intlTelInput.min.js?v="+resourcesVersion,n=resources+"/styles/intlTelInput.min.css?v="+resourcesVersion,r=resources+"/scripts/common/phoneInput.js?v="+resourcesVersion,i=resources+"/styles/phoneInput.css?v="+resourcesVersion;WebPlatform.requestResource(t,n,(function(){return!!window.intlTelInput}),(function(){WebPlatform.requestResource(r,i,(function(){return!!window.PhoneInput}),e)}))}},requestResource:WebPlatform.requestResource,setupFormFields:function(e){e.find(".with-phone:not(.phone-initialised)").each((function(){this.classList.add("phone-initialised");var e=this;ClientTools.loadPhoneInput((function(){PhoneInput.wrap(e)}))}));var t=e.find(".date-pick");t.length>0&&ClientTools.requestResource(resources+"/scripts/jquery-ui.min.js?v="+resourcesVersion,resources+"/styles/jquery-ui.min.css?v="+resourcesVersion,(function(){return!!$.datepicker}),(function(){t.datepicker({firstDay:window.weekStartsAtMonday?1:0,dateFormat:WebPlatform.dateFormat,monthNames:[WebPlatform.Phrases["label.january"],WebPlatform.Phrases["label.february"],WebPlatform.Phrases["label.march"],WebPlatform.Phrases["label.april"],WebPlatform.Phrases["label.may"],WebPlatform.Phrases["label.june"],WebPlatform.Phrases["label.july"],WebPlatform.Phrases["label.august"],WebPlatform.Phrases["label.september"],WebPlatform.Phrases["label.october"],WebPlatform.Phrases["label.november"],WebPlatform.Phrases["label.december"]],monthNamesShort:[WebPlatform.Phrases["label.jan"],WebPlatform.Phrases["label.feb"],WebPlatform.Phrases["label.mar"],WebPlatform.Phrases["label.apr"],WebPlatform.Phrases["label.may_short"],WebPlatform.Phrases["label.jun"],WebPlatform.Phrases["label.jul"],WebPlatform.Phrases["label.aug"],WebPlatform.Phrases["label.sep"],WebPlatform.Phrases["label.oct"],WebPlatform.Phrases["label.nov"],WebPlatform.Phrases["label.dec"]]})}));var n=e.find(".with-countries");n.length>0&&WebPlatform.requestResource(resources+"/scripts/i18n/countries/"+locale+".js",null,(function(){return window.COUNTRIES&&window.COUNTRIES.length}),(function(){const e=()=>{let e=WebPlatform.ipCountryCode||"",t="";for(let n=0;n<COUNTRY_CODES.length;++n){let r=COUNTRY_CODES[n];t+='<option value="'+r+'"'+(r===e?' selected="selected"':"")+">"+((COUNTRIES||COUNTRY_CODES)[n]||r)+"</option>"}n.html(t)};WebPlatform.ipCountryCode?e():WebPlatform.getSessionDetails(e)}));var r=WebPlatform.getUrlParameterMap(window.location.href)||{};Object.keys&&Object.keys(r).length&&e.find("[data-name]").each((function(){try{var e=$(this),t=e.data("name"),n=WebPlatform.removeDiacritics(t,!1);if(r[t])e.val(r[t]);else if(r[n])e.val(r[n]);else if(r[t.toLowerCase()])e.val(r[t.toLowerCase()]);else{var i=n.toLowerCase().replace(/[^a-zа-я0-9_\s]|_/g,"").replace(/\s+/g," ").trim(),a=i.replace(/ /g,"-");r[a]?e.val(r[a]):(a=i.replace(/ /g,"_"),r[a]&&e.val(r[a]))}}catch(e){}}))},readFormFields:function(e){var t={hasErrors:!1,values:[],urlFields:[],file:null};return e.each((function(e,n){var r=(n=$(n)).hasClass("required-field"),i=n.data("type"),a="",o="",s=!1;if("text"===i||"password"===i||"date"===i||"hidden"===i||"phone"===i){var l=n.find("input");a=l.data("name"),o=l.val()}else if("textarea"===i)o=n.find("textarea").val();else if("radio"===i||"range"===i||"select"===i&&n.children(".select-wrapper").length>0){var c=n.find("input:checked");o=c.length>0?c.val():"",a=c.data("name")}else if("select"===i){var u=n.find("select");o=u.val(),a=u.data("name")}else if("checkbox"===i){o=[];var d=n.find("input:checked");d.each((function(e,t){o.push(t.value)})),o=o.join("\n"),d.length&&(a=d.eq(0).data("name"))}else if("recaptcha"===i)o=n.find(".recaptcha-target").data("captcharesponse");else if("amount"===i){var f=n.find("input");o=f.val(),t.amount=o,s=!0,a=f.data("name")}else if("file"===i){var p=n.find('input[type="file"]');p.length>0&&(p=p[0],t.file=p.files.length>0?p.files[0]:null)}else s=!0;r&&("file"===i&&null===t.file||"file"!==i&&""===$.trim(o))?(n.addClass("field-invalid"),t.hasErrors=!0):n.removeClass("field-invalid"),s||t.values.push(o),a&&(a+"").trim()&&t.urlFields.push({name:a,value:o,type:i})})),t},setupRecaptcha:function(e){(e=$.extend({ui:null,button:null,onLoaded:dummy,onVerified:dummy,onExpired:dummy,useDarkTheme:!1},e)).button&&e.button.addClass("disabled");var t=e.ui.eq(0);ClientTools.requestResource("https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit",null,(function(){return recaptchaLoaded&&window.grecaptcha}),(function(){var n=window.grecaptcha.render(t[0],{sitekey:window.recaptchaSiteKey||"6LfMvTYUAAAAAG_8FphtAIqzNpbKW4UWV3IH0mg0",callback:function(n){t.data("captcharesponse",n),e.button&&e.button.removeClass("disabled"),e.onVerified()},"expired-callback":function(){e.button&&e.button.addClass("disabled"),e.onExpired()},theme:e.useDarkTheme?"dark":"light"});t.data("recaptchaid",n),e.onLoaded(n)}))},resetRecaptcha:function(e,t){var n=e;e instanceof jQuery&&(n=e.hasClass("recaptcha-target")?e.data("recaptchaid"):e.find(".recaptcha-target").data("recaptchaid")),window.grecaptcha&&!isUndefined(n)&&(window.grecaptcha.reset(n),t&&t.addClass("disabled"))},refreshForms:function(){var e=$document.find('div[data-role="form"]:not(.form-initialized)'),t=e.filter(".payment-form").length>0,n=!1,r=!1;t&&e.each((function(){if($(this).hasClass("payment-form")){var e=$(this).data("processor")||"braintree";r=r||"stripe"===e,n=n||"braintree"===e}}));var i=function(){e.addClass("form-initialized").each((function(e,t){!function(e){var t=e.hasClass("payment-form"),n=e.data("processor"),r=e.hasClass("widget-form-light"),i=!1,a=null,o=null;if(ClientTools.setupFormFields(e),t){var s=e.find('[name="payment-authorization"]').val();if(""===s)return void WebPlatform.showClientError("Invalid payment form settings!",3e3);var l=e.find(".payment-form-target");if(0===l.length)return;if("stripe"===n)i=!0,o=Stripe(s.trim()),(a=o.elements({locale:WebPlatform.getStripeLocale()}).create("card",{style:{base:{color:"#32325d",backgroundColor:"#ffffff",lineHeight:"56px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}}})).mount(l[0]),a.addEventListener("change",(function(e){e.error?WebPlatform.showClientError(e.error.message,3e3):i=!1}));else{var c=!!l.data("paypalEnabled"),u=l.data("amount")||0,d={authorization:s,container:l[0],threeDSecure:!0!==window.disableBTThreeDSecure};c&&(d.paypal={flow:"checkout",amount:u+"",currency:"USD"}),i=!0,window.braintree.dropin.create(d,(function(e,t){e?WebPlatform.showClientError(e,3e3):a=t,i=!1}))}}var f=e.find('[data-role="submit"]'),p=e.find(".recaptcha-target");p.length>0&&ClientTools.setupRecaptcha({ui:p,button:f,useDarkTheme:r}),f.click((function(){if(!f.hasClass("disabled")&&!(i||t&&null===a))if(f.addClass("disabled"),t)if("stripe"===n)y(e,f,"form","",(function(t){o.confirmCardPayment(t,{payment_method:{card:a}}).then((function(t){if(t.error){var n=t.error||"Unable to setup payment intent";Log.error(n),ClientTools.showError(n.message||n,3e3),f.removeClass("disabled")}else y(e,f,"payment-confirmed",t.paymentIntent.id)}))}));else{var r,s=e.find('input[name="__amount"]');r=s.length?WebPlatform.parse(s.val()):e.find(".payment-form-target").data("amount")||0,a.requestPaymentMethod({threeDSecure:{amount:WebPlatform.currToStr(r<.1?1:r,"",!0,WebPlatform.Store.currency)}},(function(t,n){if(t){var r=t.message||t,i=((t.details||{}).originalError||{}).description||"";ClientTools.showError(r+(""===i?"":" - "+i),3e3),f.removeClass("disabled")}else!n.liabilityShifted&&n.liabilityShiftPossible||y(e,f,"form",n.nonce),f.removeClass("disabled")}))}else y(e,f,"form",null)}))}($(this))}))};if(t){var a=0;r&&++a,n&&++a,r&&WebPlatform.requestResource("https://js.stripe.com/v3/",null,(function(){return!!window.Stripe}),(function(){0==--a&&i()})),n&&WebPlatform.requestResource("https://js.braintreegateway.com/web/dropin/1.44.1/js/dropin.min.js",null,(function(){return!!window.braintree}),(function(){0==--a&&i()}))}else i()},refreshContainerBgVideos:function(){if(0!==$("body").find(".grid-row[data-video]:not(.with-video)").addClass("with-video").length)if(window.onYouTubePlayerAPIReady)window.onYouTubePlayerAPIReady();else{var e=document.createElement("script");e.src="https://www.youtube.com/player_api";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);window.onYouTubePlayerAPIReady=function(){$(".grid-row.with-video:not(.bg-video-active)").addClass("bg-video-active").each((function(){var e=$(this),t="video-"+e.attr("id"),n=ClientTools.parse(e.data("videoStart"),0),r=ClientTools.parse(e.data("videoEnd"),0),i=ClientTools.parse(e.data("videoVolume"),0);if("none"===window.getComputedStyle(e[0]).display)return;let a=e.data("video-type");if(a&&"PLYR_INTERNAL"===a){let t=e.data("internal-video");r>0&&r>n&&n>=0&&n<1e4&&r<1e4&&(t+="&videoLoopAsThumbStart="+1e3*n+"&videoLoopAsThumbEnd="+1e3*r),i>0&&(t+="&volume="+i);let a='\n                <div class="full-size-abs container-video">\n                  <iframe class="container-video-wrapper slow-transition-opacity" style="opacity: 100;" src="'+t+'" \n                          allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" \n                          allowfullscreen>\n                  </iframe></div>\n                </div>\n                <div class="full-size-abs"></div></div>\n              ';e.append(a)}else{e.append('<div class="full-size-abs container-video"><div id="'+t+'" class="container-video-wrapper slow-transition-opacity"></div><div class="full-size-abs"></div></div>');var o=WebPlatform.extractYoutubeVideoId(e.data("video")||""),s=new YT.Player(t,{events:{onReady:function(e){!function(e,t,n,r,i,a){i<=r&&(i=9999999999),e.target.loadVideoById({videoId:n,startSeconds:r,endSeconds:i,suggestedQuality:"large"}),a>=10?e.target.setVolume(a):e.target.mute()}(e,0,o,n,r,i)},onStateChange:function(e){!function(e,t,n){switch(e.data){case YT.PlayerState.UNSTARTED:break;case YT.PlayerState.PLAYING:$("#"+t).addClass("active");break;case YT.PlayerState.ENDED:n>e.target.getDuration()&&(n=0),e.target.seekTo(n)}}(e,t,n)},onError:function(e){Log.error("Unable to load video background"),Log.error(e)}},playerVars:{autoplay:0,autohide:1,modestbranding:1,rel:0,mute:i<10?1:0,showinfo:0,controls:0,disablekb:0,enablejsapi:0,iv_load_policy:3,playsinline:1,origin:window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}});e.data("player",s)}}))},$window.on("load resize",(function(){$(".grid-row.with-video[data-video]").each((function(){var e=$(this),t=e.width(),n=e.height(),r=e.data("player"),i=e.find(".video-wrapper");r&&(t/n>16/9?(r.setSize(t,t/16*9),i.css("left","0px")):(r.setSize(n/9*16,n),i.css({left:-(i.outerWidth()-t)/2})))}))}))}},checkRedirectsInTrial:function(){if("yes"===document.body.getAttribute("data-trial")){var e=location.hostname.toLowerCase();document.querySelectorAll("a[href]").forEach((function(t){var n=t.hostname.toLowerCase().trim();t.classList.contains("not-visible-badge")||"#"===n||""===n||n.startsWith("javascript")||t.hostname.toLowerCase()!==e&&t.addEventListener("click",(function(e){if(!confirm("Are you sure you want to go to "+t.href+"? Continue only if you trust it!"))return e.stopPropagation(),e.preventDefault(),!1}))}))}},getColorAndInitialsFromNameAndEmail:function(e,t){var n=(r=e||"?").split(" "),r=n[0].substring(0,1);return n[1]&&(r+=n[1].substring(0,1)),{initials:r,color:ClientTools.colorFromString(t||""+(new Date).getTime())}},colorFromString:function(e){return"hsl("+function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t),t&=t;return t}(e)%360+", 65%, 75%)"}}}();ClientTools.onDocumentReady(ClientTools.refreshLightboxes),ClientTools.onDocumentReady((function(){var e=0;for(e=0;e<TMDP_SLIDERS.length;++e){var t=TMDP_SLIDERS[e++],n=$(t.sliderSelector);t.preprocess(t,n)}e=0;var r=function(){if(!(e>=TMDP_SLIDERS.length)){var t=TMDP_SLIDERS[e++],n=$(t.sliderSelector);try{n.tmdpSlide(t)}catch(e){Log.error(e)}ClientTools.delay(1e3,r)}};r()})),ClientTools.refreshAnimations=function(){!ClientTools.intersectionObserver&&IntersectionObserver&&(ClientTools.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){let t=e.target,n=t.dataset.animation||"",r=t.dataset.animationDuration||1100,i=t.dataset.animationDelay||0;t.style.animationDelay=i+"ms",t.style.animationDuration=r+"ms",t.classList.add("anim-displayed",n),ClientTools.intersectionObserver.unobserve(t)}}))}))),document.querySelectorAll(".anim-delayed-item:not(.anim-displayed)").forEach((e=>ClientTools.intersectionObserver.observe(e)))},ClientTools.onDocumentReady((function(){if(ClientTools.isMobile()&&!0!==window.scrollToTopEnabledOnMobile)$document.find(".scrollToTop").addClass("none");else{var e=$document.find(".scrollToTop");e.length>0&&(ClientTools.addOnScrollListener((function(){$window.scrollTop()>500?e.fadeIn():e.fadeOut()})),e.click(ClientTools.scrollToTop))}})),ClientTools.refreshNotifications=()=>{WebPlatform.notificationsEnabled&&WebPlatform.getSessionDetails((e=>{e.member&&WebPlatform.loadClientComponent("NotificationsWidget","notifications-widget").then((async e=>{await e.render(document.body,{})}))}))},ClientTools.onDocumentReady(ClientTools.refreshNotifications),ClientTools.onLoggedIn(ClientTools.refreshNotifications),ClientTools.onDocumentReady(ClientTools.highlightMarkup),ClientTools.onDocumentReady(ClientTools.refreshParallaxes),ClientTools.onDocumentReady(ClientTools.refreshAnimations),ClientTools.onDocumentReady(ClientTools.refreshDelayedWidgets),ClientTools.addOnScrollListener((function(){window.requestAnimationFrame(ClientTools.repaintParallaxes)})),ClientTools.addOnResizeListener((function(){for(var e=0;e<ClientTools._parallaxes.length;++e){ClientTools._parallaxes[e].recalculateDimensions=!0,window.requestAnimationFrame(ClientTools.repaintParallaxes)}})),ClientTools.onDocumentReady((function(){$(document).on("click",".player-icon",(function(){var e=$(this);let t,n=e.attr("data-plyr-videoType");if(n){let r={},i="";if("PLYR_EMBEDDED"===n){t=e.attr("data-plyr-id"),r={videoType:"PLYR_EMBEDDED",videoId:0,integration:!0,videoElementId:t,autoplay:!0},i='<div class="none" video-id="'+t+'" data-plyr-provider="'+e.attr("data-plyr-provider")+'" data-plyr-embed-id="'+e.attr("data-plyr-embed-id")+'"></div>'}else"PLYR_EXTERNAL"===n&&(t=e.attr("data-plyr-id"),r={videoType:"PLYR_EXTERNAL",videoId:0,videoElementId:t,videoAutoplay:!0,videoSource:e.attr("data-plyr-videoSource"),videoRemoveControls:"true"===e.attr("data-plyr-videoRemoveControls"),videoLoop:"true"===e.attr("data-plyr-videoLoop"),videoPlayInBackground:"true"===e.attr("data-plyr-videoPlayInBackground")},i='<video video-id="'+t+'" data-plyr="external" controls crossorigin playsinline ></video>');r.videoHtmlId=t,r.root=e.closest(".widget")[0],e.replaceWith(i),WebPlatform.Widgets.VideoService(r)}else{var r=$(e.parent().find(".source").text());r.andSelf().filter("[src]").each((function(e,t){var n=(t=$(t)).attr("src");n.indexOf("autoplay")<0?n+=(n.indexOf("?")>=0?"&":"?")+"autoplay=1":n=n.replace(/autoplay=0/gi,"autoplay=1"),t.attr("src",n)})),e.replaceWith(r)}}))})),ClientTools.onDocumentReady(ClientTools.refreshForms),ClientTools.onSetupMenu((function(){var e=$document.find(".navigation-wrapper"),t=e.hasClass("navigation-wrapper-fixed"),n=e.find(".navToggle");if($document.on("click",".burger-menu-trigger, .burger-menu-visible .website-nav-link",(function(){$(this).closest(".menu-widget").toggleClass("burger-menu-visible"),$(this).closest(".grid-row").toggleClass("burger-menu-visible"),$(this).closest(".header-row").toggleClass("burger-menu-visible"),$(document.body).toggleClass("no-overflow")})).on("click",".mobile-burger, .mobile-header-overlay",(function(){$(this).closest(".page-layout").toggleClass("open")})),WebPlatform.initFixedHeader($document),n.length>0){var r=$document.find(".slide"),i=r.filter("nav"),a=$document.find(".content"),o=$(document.body),s=function(){o.removeClass("nav-open"),r.removeClass("open"),WebPlatform.onTransitionEnd(i,(function(){o.removeClass("visible-nav")}),500)};n.click((function(e){return o.hasClass("nav-open")?s():(o.addClass("nav-open visible-nav"),r.addClass("open")),e.stopPropagation(),e.preventDefault(),!1})),a.click((function(){o.hasClass("nav-open")&&s()}))}setupMegaMenu(e);var l=$(".with-submenu");if(l.length>0){var c=e.hasClass("sidenav-dropdown");c||(windowWidth<=768&&e.addClass("sidenav-dropdown"),ClientTools.addOnResizeListener((function(){windowWidth>768?(e.removeClass("sidenav-dropdown"),e.find(".with-submenu>div").show()):e.addClass("sidenav-dropdown")}))),l.on("click",".submenu-arrow",(function(t){if(!(windowWidth>768&&e.length)||c){var n=$(this).closest(".with-submenu");return n.toggleClass("visible"),n.find(">div")[n.hasClass("visible")?"slideDown":"slideUp"]("fast"),t.stopPropagation(),t.preventDefault(),!1}}))}if(windowWidth>768){var u=$(".page-layout").hasClass("style-boxed-layout");enableStickyNavRight=!1,(t||enableStickyNavRight)&&WebPlatform.onImagesLoaded(e.find('[data-role="logo"]'),(function(){if(enableStickyNavRight&&u){var n=function(){var t=e.closest(".page-layout"),n=e.find("nav"),r=windowWidth-t.offset().left-t.width()-n.outerWidth(!0);n.css({right:r+"px",left:"auto"})};ClientTools.addOnResizeListener(n),n()}if(t){var r=0,i=e.height(),a=e.find(e.data("fixed"))||[],o=(0===a.length?e:a).offset().top,s=!1,l=e.hasClass("is-absolute")?null:e.closest(".page-layout");ClientTools.addOnScrollListener((function(){if(!(windowWidth<=768)||s){var t=window.pageYOffset||$document.scrollTop();t>o&&!s&&r<t?(e.addClass("smaller"),s=!0,null!==l&&l.css("padding-top",i+"px")):s&&t<=o&&r>t&&(e.removeClass("smaller"),s=!1,null!==l&&l.css("padding-top","0px")),r=t}}))}}))}$('a[href*="#"]:not([href="#"])').click((function(){if(window.location.pathname.replace(/^\//,"")===this.pathname.replace(/^\//,"")&&window.location.hostname===this.hostname){var n=this.hash.slice(1);if(n.indexOf("/")>0)return;var r=$('[name="'+n+'"]');r.length&&($(".page-layout").removeClass("open"),$("html, body").animate({scrollTop:r.offset().top-(t?e.height():0)},1e3))}}))}));var setupMegaMenu=function(e){var t=function(e){var t=$(this).data("megaId"),n=t?$("#"+t):null;null!==n&&0!==n.length&&(WebPlatform.delay(300,(function(){n.hasClass("over")||n.removeClass("visible").css("top","400px")})),n.removeClass("over"))};$("li[data-mega]").mouseenter((function(){var e=$(this),n=e.closest(".header-row"),r=e.closest(".container");if(0===n.length&&(n=e.closest(".navigation-wrapper")),0!==n.length&&0!==r.length){var i,a=e.data("megaId");if(a){if(0===(i=$("#"+a)).length)return}else{if(0===(i=e.children(".mega-menu-wrapper")).length)return;a=i.attr("id"),e.data("megaId",a),i.data("megaId",a),i.appendTo($(".page-layout")),i.mouseenter((function(){$(this).addClass("over")})).mouseleave(t)}var o=$(".mega-menu-wrapper.visible").not(i);o.length>0&&o.removeClass("over visible");var s=n[0].getBoundingClientRect(),l=r[0].getBoundingClientRect();i.css({top:s.bottom,left:l.left,width:l.right-l.left}),i.addClass("over"),WebPlatform.delay(10,(function(){i.addClass("visible"),$(window).scroll()}))}})).mouseleave(t)};ClientTools.onDocumentReady((function(){var e=WebPlatform.getUrlParameterMap(window.location.href,!0)||{},t=null;["gclid","fbclid","utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach((function(n){if(e[n]){if(null===t){var r=Cookies.get("wpup")||"";if(t={},r)try{t=JSON.parse(r)}catch(e){}}var i=e[n];"fbclid"===n&&(n="utm_source",i="___fbclid"),"gclid"===n&&(n="utm_source",i="___gclid"),t[n]=i}})),null!==t&&Cookies.set("wpup",JSON.stringify(t),{expires:window.defaultUtmExpires||null})})),ClientTools.onDocumentReady((function(){$document.on("click",".css-toggle",(function(){$(this).toggleClass("toggle-visible").nextAll(".css-toggle-target").slideToggle("fast")}))})),ClientTools.onDocumentReady((function(){if(""!==WebPlatform.cookiesDisclaimer&&!Cookies.get("dismiss_cookie_disclaimer")&&!Cookies.get("dismiss-cookie-disclaimer")&&"yes"!==WebPlatform.getUrlQueryParameter(window.location.href,"dismiss-cookies-disclaimer")){ClientTools.delay(3e3,(function(){var e=$('<div id="cookie-disclaimer-box"><div></div><a class="cookie-info"></a><a class="cookies-accept"></a></div>');e.children("div").html(WebPlatform.cookiesDisclaimer);var t=e.find(".cookie-info");WebPlatform.cookiesInfoBtn?t.html(WebPlatform.cookiesInfoBtn).attr("href",WebPlatform.cookiesInfoBtnLink):t.remove(),e.children(".cookies-accept").html(WebPlatform.cookiesAcceptBtnText).click((function(){e.removeClass("visible"),Cookies.set("dismiss_cookie_disclaimer","1",{expires:1825,path:"/"}),e=null,WebPlatform.setSystemAnalyticsEnabled(!0)})),e.appendTo(document.body),ClientTools.delay(200,(function(){e.addClass("visible")}))}))}})),ClientTools.onDocumentReady(ClientTools.refreshContainerBgVideos),ClientTools.onDocumentReady((function(){if("checkout"!==WebPlatform.Store.activePage&&"cart"!==WebPlatform.Store.activePage&&"order-processing"!==WebPlatform.Store.activePage){var e=$(".with-quick-cart");if(e.length>0){var t=$(".cart-preview-popup"),n=!1,r=!1,i=null,a=function(){n||r||!t.hasClass("visible")||WebPlatform.onTransitionEnd(t.removeClass("animate"),(function(){t.removeClass("visible")}),300)};t.mouseover((function(){n=!0})).mouseout((function(){n=!1,WebPlatform.clearDelay(i),i=WebPlatform.delay(500,a)}));var o=function(){var e=this.getBoundingClientRect();r=!0,WebPlatform.Store.renderCart(),t.css({top:e.bottom+10+"px",right:windowWidth-e.right+"px"}).addClass("visible"),WebPlatform.delay(10,(function(){t.addClass("animate")}))};t.hasClass("cart-preview-full-height")||ClientTools.isMobile()?e.click((function(e){e.stopPropagation(),e.preventDefault(),o.apply(this),$(".cart-preview-overlay").removeClass("none").one("click",(function(){r=!1,a(),$(this).addClass("none")}))})):e.mouseover(o).mouseout((function(){r=!1,WebPlatform.clearDelay(i),i=WebPlatform.delay(500,a)}))}}})),ClientTools.onDocumentReady((function(){$document.on("click",".plan-get-started",(function(){var e=$(this),t=e.data("link")||"";if(!t.trim().toLowerCase().startsWith("javascript:")){var n=e.data("plan"),r=e.data("period"),i=t.indexOf("?")>-1?"&":"?",a=WebPlatform.getUrlQueryParameter(window.location.href,"template"),o=WebPlatform.getUrlQueryParameter(window.location.href,"category"),s=WebPlatform.getUrlQueryParameter(window.location.href,"funnel");t+=i+"plan="+n+"&period="+r,a&&(t+="&template="+a),o&&(t+="&category="+o),s&&(t+="&funnel="+s)}window.location.href=t})),$document.on("click",".plan-switch a",(function(){var e=$(this),t=e.closest(".widget"),n=e.data("role");e.parent().find(".primaryColor-bg2").removeClass("primaryColor-bg2"),e.addClass("primaryColor-bg2"),t.find(".pricing-table").each((function(e,t){t=$(t);var r="monthly"===n?t.data("monthly"):t.data("yearly");t.find('[data-role="price"]').contents().filter((function(){return 3===this.nodeType&&""!==this.textContent.trim()})).each((function(){this.textContent=r}))})).removeClass("price-monthly price-yearly").addClass("price-"+n),t.find(".plan-get-started").data("period",n)}))})),ClientTools.onDocumentReady(ClientTools.refreshCountdowns),ClientTools.onDocumentReady(ClientTools.refreshToggles),ClientTools.onDocumentReady((function(){window.addEventListener(WebPlatform.Events.FORM_SUBMITTED,(function(e,t){e.detail&&e.detail.uid;WebPlatform.Store.fbPxId&&window.fbq("track","Lead",{},{eventID:e.detail.uid||""}),window.gtag?gtag("event","generate_lead"):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"Lead"})}),!1)})),ClientTools.onDocumentReady((function(){var e=/Chrome/.test(navigator.userAgent);window.location.hash&&e&&setTimeout((function(){var e=window.location.hash;if(e){var t=$('[name="'+e.replace("#","")+'"]');t.length&&$("html, body").scrollTop(t.offset().top)}}),300)})),ClientTools.onDocumentReady((()=>{if(WebPlatform.Funnels&&WebPlatform.Funnels.variant){let e=$('.next-step-popup[data-show-with-cart="true"]');e.length&&WebPlatform.getSessionDetails((t=>{t.cartSize>0&&e.removeClass("none")}))}})),isUndefined(window.WebPlatform)&&(window.WebPlatform={}),WebPlatform.reportMemberRegistration=function(e){WebPlatform.Store.fbPxId&&window.fbq&&window.fbq("track","CompleteRegistration",{currency:WebPlatform.Store.currency,value:0},{eventID:e||""}),window.gtag?gtag("event","sign_up"):window.dataLayer&&window.dataLayer.push&&window.dataLayer.push({event:"SignUp"})},WebPlatform.areSystemAnalyticsEnabled=function(){var e=WebPlatform.getCookieName("analytics-enabled"),t=null;try{t=window.localStorage.getItem(e)}catch(e){Log.error(e)}return!0===WebPlatform.systemAnalyticsDisabledByDefault?"yes"===t||"yes"===Cookies.get(e):"no"!==t&&"no"!==Cookies.get(e)},WebPlatform.setSystemAnalyticsEnabled=function(e){var t=WebPlatform.getCookieName("analytics-enabled"),n=e?"yes":"no";try{window.localStorage.setItem(t,n)}catch(e){Log.error(e)}if(Cookies.set(t,n,{expires:365,path:"/"}),e||Cookies.remove("tmdp_stats",{path:"/"}),WebPlatform.collectPageStats&&WebPlatform.collectPageStats(),!0!==window.disableDefaultGtagConsentModeSetup){let t=e?"granted":"denied",n={ad_storage:t,ad_user_data:t,ad_personalization:t,analytics_storage:t};window.gtag&&window.gtag("consent","update",n);try{localStorage.setItem("gtagConsentModeSavedState",JSON.stringify(n))}catch(e){}}},WebPlatform.ChangeSystemAnalyticsSettings=function(){var e=$("#analyticsSettings"),t=function(){e.removeClass("visible").addClass("none")},n=$("#analyticsTracking").prop("checked",WebPlatform.areSystemAnalyticsEnabled());e.removeClass("none").addClass("visible"),e.one("click",".close-btn",t),e.one("click",".save-changes",(function(){WebPlatform.setSystemAnalyticsEnabled(n.is(":checked")),t()}))},WebPlatform.CloseActivePopup=function(){var e=$(".popup-wrapper.visible");if(!(e.length<1)){var t=e.last().data("id");t&&WebPlatform.Popups.hide(t)}},window.addEventListener&&window.addEventListener("message",(function(e){if(e.data&&e.data.startsWith&&e.data.startsWith("showstep|")){var t=e.data.substring("showstep|".length);WebPlatform.Funnels.show(t)}})),WebPlatform.loadFragment=(e,t,n,r)=>{WebPlatform.makeClientWebsiteRequest({action:"getFragment",method:"GET",data:{fragment:e,data:JSON.stringify(t)},onOk:e=>{if(e.data){const t=document.createRange().createContextualFragment(e.data);n.innerHTML="",n.append(t)}r()}})};var inAnimations={bounceIn:"bounceOut",bounceInDown:"bounceOutDown",bounceInLeft:"bounceOutLeft",bounceInRight:"bounceOutRight",bounceInUp:"bounceOutUp",fadeIn:"fadeOut",fadeInUp:"fadeOutUp",fadeInDown:"fadeOutDown",fadeInLeft:"fadeOutLeft",fadeInRight:"fadeOutRight",flipInX:"flipOutX",flipInY:"flipOutY",lightSpeedIn:"lightSpeedOut",rotateIn:"rotateOut",rotateInDownLeft:"rotateOutDownLeft",rotateInDownRight:"rotateOutDownRight",rotateInUpLeft:"rotateOutUpLeft",rotateInUpRight:"rotateOutUpRight",rollIn:"rollOut",zoomIn:"zoomOut",zoomInDown:"zoomOutDown",zoomInLeft:"zoomOutLeft",zoomInRight:"zoomOutRight",zoomInUp:"zoomOutUp",slideInDown:"slideOutDown",slideInLeft:"slideOutLeft",slideInRight:"slideOutRight",slideInUp:"slideOutUp"};function showSimpleLoadingBar(e,t){var n=$('<div class="loadingBarContainer"></div>');e.append(n),n.append('<div class="loadingBarOverlay"></div><div class="loadingBarContent"></div>'),n.show(),t&&t()}function hideSimpleLoadingBar(e){var t=e.find(".loadingBarContainer");t.fadeOut("fast",(function(){t.remove(),t=null}))}function setupThemesDemo(e){if(!($("#themeOverlay").length>0)){var t='<div class="themes-overlay" id="themeOverlay" style="display: none;">       <a class="close-btn close-popup"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"></path></svg></a>      <div class="overlay-content theme-preview">        <section>          <div class="current-theme">            <div class="button-wrapper">              <a href="/Register" class="templateChooserBtn middle-button theme-select-blue" target="_top">'+(e=e||"Start with this theme")+'</a>              <div class="viewport-buttons">                <ul>                  <li>                    <a class="viewport-button button-tooltip active" data-size="desktop" data-tooltip="desktopView" title=""><img src="'+resources+'/images/small-icons/desktop-white.png"></a>                  </li>                  <li>                    <a class="viewport-button button-tooltip" data-size="tablet" data-tooltip="tabletView" title=""><img src="'+resources+'/images/small-icons/tablet-white.png"></a>                  </li>                  <li>                    <a class="viewport-button button-tooltip" data-size="mobile" data-tooltip="phoneView" title=""><img src="'+resources+'/images/small-icons/phone-white.png"></a>                  </li>                </ul>              </div>            </div>            <div class="iframe-content desktop-preview" style="overflow-y: auto; -webkit-overflow-scrolling: touch;">              <div class="iframe">                <iframe src="javascript: void(0)"></iframe>              </div>            </div>          </div>        </section>      </div>    </div>',n=$(document.body);n.append(t);var r=$("#themeOverlay"),i=r.find("iframe");r.find(".close-popup").click((function(){r.fadeOut("fast",(function(){n.removeClass("no-overflow"),r.find("iframe").attr("src","javascript: var s = "+ClientTools.tick()+";")}))})),r.find(".viewport-button ").click((function(){var e=$(this),t="fa-"+e.data("size");r.find(".viewport-buttons").find(".active").removeClass("active"),e.addClass("active"),r.removeClass("fa-tablet fa-mobile fa-desktop").addClass(t);var n=r.find("iframe");showSimpleLoadingBar(n.parent(),(function(){n.attr("src",n.attr("src")+"1")}))})),n.on("mousedown",'a[data-action="showDemo"]',(function(){var e=$(this).closest(".active-theme"),t=e.data("category")||"",a=e.data("url"),o=e.data("id"),s=e.data("selectUrl")||"/register",l=s.indexOf("?")>-1?"&":"?";s+=l+"template="+o,t&&(s+="&category="+t),r.find(".templateChooserBtn").attr("href",s),n.addClass("no-overflow"),showSimpleLoadingBar(i.parent(),(function(){r.removeClass("fa-tablet fa-mobile").addClass("fa-desktop").fadeIn("fast");var e=i.parent();i.remove(),(i=$('<iframe src="//'+a+"?v="+ClientTools.tick()+'"></iframe>')).load((function(){hideSimpleLoadingBar(i.parent())})),e.append(i)}))}))}}function setupFunnelsDemo(e){var t=e.buttonLabel||"Start with this funnel",n=e.stepLabel||"Step",r=e.popupLabel||"Popup",i=$(document.body),a='<div class="themes-overlay funnel-overlay" id="funnelOverlay" style="display: none;">       <a class="close-btn close-popup"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"></path></svg></a>      <div class="overlay-content theme-preview funnel-preview">        <section>          <div class="current-theme">            <div class="">              <div class="funnel-preview">                 <div class="button-wrapper">                  <select class="funnel-step-select"></select>                   <a class="middle-button main-action-btn big-button blue mobile-only-btn">'+t+'</a>                  <div class="viewport-buttons">                    <ul>                      <li>                        <a class="viewport-button button-tooltip active" data-size="desktop" data-tooltip="desktopView" title=""><img src="'+resources+'/images/small-icons/desktop-white.png"></a>                      </li>                      <li>                        <a class="viewport-button button-tooltip" data-size="tablet" data-tooltip="tabletView" title=""><img src="'+resources+'/images/small-icons/tablet-white.png"></a>                      </li>                      <li>                        <a class="viewport-button button-tooltip" data-size="mobile" data-tooltip="phoneView" title=""><img src="'+resources+'/images/small-icons/phone-white.png"></a>                      </li>                    </ul>                  </div>                </div>                <div class="iframe-content desktop-preview" style="overflow: hidden; -webkit-overflow-scrolling: touch; width: 55%;">                  <div class="iframe">                    <iframe src="javascript: void(0)"></iframe>                  </div>                </div>              </div>               <div class="funnel-right-content center-vertically flex-column" style="position: absolute; width: 40%; right: 0;">                 <div class="funnel-right-content-inner">                   <h2 class="f-left col20 roboto" data-role="name"></h2>                   <span class="f-left col20 mt-45" data-role="description"></span>                   <a class="main-action-btn big-button blue mt-25">'+t+"</a>                </div>               </div>             </div>          </div>        </section>      </div>     </div>";i.on("click",".funnel-demo-trigger",(function(){i.append(a);var e=$("#funnelOverlay");e.fadeIn("fast"),e.find(".close-popup").click((function(){e.fadeOut("fast",(function(){i.removeClass("no-overflow"),e.remove(),e.find("iframe").attr("src","javascript: var s = "+ClientTools.tick()+";")}))}));var t=$(this).closest(".active-theme"),o=t.data("funnel"),s=o.settings.name[locale]||o.settings.name.en,l=o.settings.longDescription[locale]||o.settings.longDescription.en;e.find('[data-role="name"]').text(s),e.find('[data-role="description"]').text(l);t.data("category");var c=null,u=e.find("iframe"),d=e.find(".iframe-content"),f=e.find(".funnel-step-select");f.empty(),f.change((function(){var e=$(this).find(":selected").data("step"),t="showstep|"+c.id+"|"+e.id;u[0].contentWindow.postMessage(t,c.url)})),e.find(".viewport-button").click((function(){var t=$(this),n=t.data("size"),r="fa-"+n;e.find(".viewport-buttons").find(".active").removeClass("active"),t.addClass("active"),e.removeClass("fa-tablet fa-mobile fa-desktop").addClass(r),d.removeClass("desktop-preview tablet-preview mobile-preview").addClass(n+"-preview"),showSimpleLoadingBar(u.parent(),(function(){u.attr("src",u.attr("src"))}))})),e.find(".viewport-item").click((function(){var e=$(this),t=e.data("size");e.closest("ul").find(".active").removeClass("active"),e.tooltip("hide").addClass("active"),d.removeClass("desktop-preview tablet-preview mobile-preview").addClass(t+"-preview"),u.attr("src",u.attr("src"))})),i.addClass("no-overflow");var p=t.data("selectUrl")||"/register",h=p.indexOf("?")>-1?"&":"?";p+=h+"funnel="+o.id+"&category=funnels",e.find(".main-action-btn").attr("href",p),showSimpleLoadingBar(u.parent(),(function(){ClientTools.showHideAjaxLoadingIndicator(!1),WebPlatform.makeClientWebsiteRequest({action:"getFunnelTemplateDetails",data:{templateId:o.id},onOk:function(t){ClientTools.showHideAjaxLoadingIndicator(!0),((c=t.data).steps||[]).forEach((function(e,t){var i="PAGE"===e.type?"":" ("+r+")";$("<option />").text(n+" "+(t+1)+": "+e.name+i).data("step",e).prop("selected",0===t).appendTo(f)})),e.removeClass("fa-tablet fa-mobile").addClass("fa-desktop").fadeIn("fast");var i=u.parent();u.remove(),(u=$('<iframe src="'+c.url+'"></iframe>')).load((function(){hideSimpleLoadingBar(u.parent())})),i.append(u)}})}))}))}$.fn.extend({animateCss:function(e,t){t=t||function(){};var n=$(this);n.addClass("animated "+e).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",(function(){n.removeClass("animated "+e),t()}))}}),$.fn.swipeX=function(e,t){return e=e||function(){},t=t||function(){},this.each((function(){var n=null;function r(i){if(i.preventDefault(),null!==n){var a=n-i.touches[0].pageX;Math.abs(a)>=25&&(this.removeEventListener("touchmove",r),n=null,a>0?e():t())}}"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",(function(e){e.touches&&1===e.touches.length&&(n=e.touches[0].pageX,this.addEventListener("touchmove",r,!1))}),!1)})),this},$.fn.webPlatformSlider=function(e){var t,n=$.extend({},{slideDuration:1e3,slideAnimationType:"fade",slideTransitionTime:1e3,stopOnHover:!1,showArrows:!0,showBullets:!0,showProgress:!0,layerAreaStartWidth:1100,layerAreaBaseFontSize:14},e),r=void 0!==(t=(document.body||document.documentElement).style).transition||void 0!==t.WebkitTransition||void 0!==t.MozTransition||void 0!==t.MsTransition||void 0!==t.OTransition,i=function(e,t,n){r?e.on("webkitTransitionEnd.trans mozTransitionend.trans oTransitionEnd.trans msTransitionEnd.trans transitionend.trans",(function(){e.off(".trans"),t()})):setTimeout(t,n||50)},a=function(e,t){var n=null,r=null,a=null,o=null,s=null,l=-1,c=-1,u=0,d=!0,f=t.find(".tmdp-slide"),p=f.length,h=null,m=null,g=!1,v=e.slideDuration,b=function(e,a){var o,s,l,c="image"===n?"url('"+r+"') no-repeat center center":r,u=t.width(),d=t.height(),f=[];a.slice?(s=1,o=10):(o=Math.min(u/100,10),s=Math.max(d/(u/o),1));for(var p=(o=Math.round(o))*(s=Math.round(s)),h=(f="",0);h<p;h++)f+='<div class="tmdp-tile tmdp-tile-'+a.animationType+'"><div class="tmdp-tile-inner" style="width: '+u+"px; height: "+d+"px; background: "+c+'"></div></div>';t.append(f),(l=t.find(".tmdp-tile")).css({width:u/o,height:d/s}),l.each((function(){var e=$(this).position();$(this).children().css({left:-e.left+"px ",top:-e.top+"px"})}));var m=function(e,t,n){for(var r=[],i=e;i<t;++i)r.push(i);return n(r)}(0,p,a.arrange),g=a.speed/p,v=l.eq(m[m.length-1]);i(v,(function(){y(!1,"none"),l.remove(),e()}),a.speed+g),m.forEach((function(e,t){setTimeout((function(){l.eq(e).toggleClass("tmdp-tile-animated")}),t*g)}))},y=function(s,l){if("none"===l){var u="image"===n?'url("'+r+'") no-repeat center center':r;t.css("background",u),s&&s()}else"fade"===l||"slide-from-left"===l||"slide-from-top"===l||"slide-from-right"===l||"slide-from-bottom"===l?function(a,o){var s="image"===n?'url("'+r+'") no-repeat center center':r,l=$('<div class="tmdp-slide-layer tmdp-animation-'+o+'"></div>').css({"transition-duration":e.slideTransitionTime/1e3+"s",background:s});l.appendTo(t),i(l,(function(){y(!1,"none"),l.remove(),a()}),e.slideTransitionTime),setTimeout((function(){l.addClass("tmdp-anim-end")}),10)}(s,l):"slide-horizontal"===l||"slide-vertical"===l?function(s,l){var u,d,f="image"===n?'url("'+r+'") no-repeat center center':r,p="image"===a?'url("'+o+'") no-repeat center center':o;g?(u=l?"slide-to-right":"slide-to-bottom",d=l?"slide-from-left":"slide-from-top"):(u=l?"slide-to-left":"slide-to-top",d=l?"slide-from-right":"slide-from-bottom");var h=$('<div class="tmdp-slide-layer tmdp-animation-'+u+'"></div>').css({"transition-duration":e.slideTransitionTime/1e3+"s",background:p}),m=$('<div class="tmdp-slide-layer tmdp-animation-'+d+'"></div>').css({"transition-duration":e.slideTransitionTime/1e3+"s",background:f});c>=0&&h.appendTo(t),m.appendTo(t),i(m,(function(){y(!1,"none"),c>=0&&h.remove(),m.remove(),s()}),e.slideTransitionTime),setTimeout((function(){c>=0&&h.addClass("tmdp-anim-end"),m.addClass("tmdp-anim-end")}),10)}(s,"slide-horizontal"===l):"box-fade"===l||"box-fade-random"===l?b(s,{slice:!1,animationType:l,speed:e.slideTransitionTime,arrange:function(e){return"box-fade-random"===l?e.map((function(e){return[Math.random(),e]})).sort().map((function(e){return e[1]})):e}}):"slice-from-left"!==l&&"slice-from-right"!==l||b(s,{slice:!0,animationType:l,speed:e.slideTransitionTime,arrange:function(e){return"slice-from-left"===l?e:e.reverse()}})},w=function(e){null!==h&&(h.stop(),e&&h.css("width","0%"),h.animate({width:"100%"},v,"linear"))},C=function(t){c=l,l=t,null!==m&&(m.find(".active").removeClass("active"),m.find(".tmdp-bullet").eq(l).addClass("active")),window.requestAnimationFrame((function(){!function(e){if(d=!1,c<0)e();else{var t=f.eq(c),n=t.addClass("tmdp-show").find(".tmdp-layer"),r=n.length;0===r?(t.removeClass("tmdp-show"),t=null,e()):n.css("animation-delay","0s").each((function(){var n=$(this),i=inAnimations[n.data("animationType")||"fadeIn"];n.animateCss(i,(function(){n.removeClass("tmdp-layer-show"),0==--r&&(t.removeClass("tmdp-show"),t=null,e())}))}))}}((function(){y((function(){var t;u=(new Date).getTime()+e.slideDuration,0===(t=f.eq(l).addClass("tmdp-show").find(".tmdp-layer")).length?d=!0:t.each((function(){var e=$(this),t=e.data("start"),n=e.data("speed"),r=e.data("animationType");e.css({"animation-duration":n/1e3+"s","animation-delay":t/1e3+"s","animation-timing-function":"cubic-bezier(0.215, 0.610, 0.355, 1.000)"}).animateCss(r||"fadeIn",(function(){e.addClass("tmdp-layer-show"),d=!0}))})),w(!0),null!==s&&clearTimeout(s),s=setTimeout(k,e.slideDuration),g=!1}),e.slideAnimationType)}))}))},x=function(i){i>=p&&(i=0),i<0&&(i=p-1),v=e.slideDuration;var s=f.eq(i);a=n,o=r,n=s.data("bgType"),r=s.data("bg"),"image"===n&&1!==s.data("loaded")?(t.addClass("tmdp-slides-loading"),$("<img />").attr("src",r).addClass("none tmdp-img-load").appendTo(s),s.waitForImages((function(){s.data("loaded",1).find(".tmdp-img-load").remove(),C(i),t.removeClass("tmdp-slides-loading")}))):C(i)},k=function(){d&&x(l+1)},P=function(){d&&x(l-1)},S=function(){if(0!==p){var n=t.width()/t.height(),r=f.eq(0).find(".tmdp-layers").width(),i=r/n;f.css("font-size",r/e.layerAreaStartWidth*e.layerAreaBaseFontSize+"px").find(".tmdp-layers").css({height:i+"px",marginTop:-i/2+"px"})}};if($(window).resize(S),p>0){var T=windowWidth||$(window).width();if(e.showProgress&&(h=$('<div class="tmdp-progress"><div class="tmdp-progress-inner"></div></div>').appendTo(t).find(".tmdp-progress-inner")),T>768?e.showArrows&&($('<div class="tmdp-nav-arrow tmdp-leftarrow"><i class="fa fa-angle-left fa-2x"></i></div>').appendTo(t).click($.throttle(1500,(function(){g=!0,P()}))),$('<div class="tmdp-nav-arrow tmdp-rightarrow"><i class="fa fa-angle-right fa-2x"></i></div>').appendTo(t).click($.throttle(1500,k))):t.swipeX($.throttle(1500,k),$.throttle(1500,(function(){g=!0,P()}))),e.showBullets){for(var W='<div class="tmdp-bullets">',E=0;E<p;++E)W+='<div class="tmdp-bullet"></div>';W+="</div>",(m=$(W)).appendTo(t).on("click",".tmdp-bullet",$.throttle(1500,(function(){var e=$(this).index();g=e<l,d&&l!==e&&x(e)})))}e.stopOnHover&&t.hover((function(){null!==s&&d&&(clearInterval(s),s=null,null!==h&&h.stop(),v=u-(new Date).getTime())}),(function(){null===s&&d&&(v<50?k():(u=(new Date).getTime()+v,w(!1),s=setTimeout(k,v)))})),S(),x(0)}};return this.each((function(){a(n,$(this).find(".tmdp-slider"))})),this},WebPlatform.Widgets.Booking=function(e){if(!WebPlatform.Widgets.shouldRender(e.container))return null;var t,n,r,i,a,o,s,l,c,u,d,f,p={},h=[],m=e.container,g=m.find(".booking-datepicker"),v=m.find(".time-select"),b=m.find(".calendar-section"),y=m.find(".form-section"),w=m.find(".confirmation-section"),C=m.find(".selected-date-label"),x=m.find(".selected-time-label"),k=m.find(".service-section"),P=m.find(".operator-section"),S=m.find(".selected-service-name"),T=m.find(".selected-operator-name"),W=m.find(".submit-button"),E=!1,L=0,A=function(e){var t=[WebPlatform.Phrases["label.jan"],WebPlatform.Phrases["label.feb"],WebPlatform.Phrases["label.mar"],WebPlatform.Phrases["label.apr"],WebPlatform.Phrases["label.may_short"],WebPlatform.Phrases["label.jun"],WebPlatform.Phrases["label.jul"],WebPlatform.Phrases["label.aug"],WebPlatform.Phrases["label.sep"],WebPlatform.Phrases["label.oct"],WebPlatform.Phrases["label.nov"],WebPlatform.Phrases["label.dec"]],n=[WebPlatform.Phrases["label.sunday_short"],WebPlatform.Phrases["label.monday_short"],WebPlatform.Phrases["label.tuesday_short"],WebPlatform.Phrases["label.wednesday_short"],WebPlatform.Phrases["label.thursday_short"],WebPlatform.Phrases["label.friday_short"],WebPlatform.Phrases["label.saturday_short"]],r=e.getDate(),i=e.getMonth(),a=e.getFullYear();return n[e.getDay()]+", "+t[i]+" "+r+" "+a},_=function(e,t){for(var n=0;n<t.length;n++)if(t[n].id===parseInt(e))return t[n];return null},D=function(e,t){if(i&&a){var n=new Date(e,t-1,1);Y(n,"onChangeMonth",null,!1)}},O=function(){var e=g.datepicker("getDate");J(p[F(e)],e),C.text(A(e)),B()},I=function(e,t){return t=null==t||t,e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)+(t?"T00:00:00.000Z":"")},F=function(e){return i+"-"+a+"_"+e.getFullYear()+"-"+e.getMonth()},M=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return JSON.stringify(e)===JSON.stringify({})},N=function(){var e;e=function(){var e,t=m.find(".timezone-popup"),n=t.find(".tz-select");n.empty(),d.forEach((function(t){e=f===t.id?"class='selected'":"",n.append("<li "+e+' data-id="'+t.id+'">'+t.name+"</option>")})),WebPlatform.Popups.showSimplePopup(t.html(),500,(function(e,t){m.find(".timezone-popup").show();var n=t.find(".tz-select");n.find(".selected")[0].scrollIntoView(),n.on("click","li",(function(){f=$(this).data("id"),m.find('span[data-role="current-timezone"]').text($(this).text()),p={},Y(g.datepicker("getDate")),e.close()}));var r=t.find("[name='tz-search']");r.focus(),r.on("keyup",(function(){var e=r.val();R(e,n)}))}))},d?e():WebPlatform.makeClientWebsiteRequest({action:"listTimezones",onOk:function(t){t.data&&(d=t.data,e())}})},R=$.debounce(250,(function(e,t){var n=t.find("li");n.removeClass("none"),$.each(n,(function(t,n){var r=$(n);-1===r.text().toLowerCase().indexOf(e.toLowerCase())&&r.addClass("none")}))})),q=function(){if(t.name=decodeURIComponent(t.name),t.description=t.description?WebPlatform.escapeHtml(decodeURIComponent(t.description)):"",t.location=t.location?decodeURIComponent(t.location):"",m.find(".booking-name-label").text(t.name),m.find(".book-description").html(t.description.replace(/\n/g,"<br />")),window.ClientTools){var n=m.find(".widget-form");ClientTools.setupFormFields(n);var s=n.find(".recaptcha-target");(E=s.length>0)&&ClientTools.setupRecaptcha({ui:s,button:W})}if(g.datepicker({firstDay:window.weekStartsAtMonday?1:0,minDate:new Date,maxDate:"+15m",onSelect:O,onChangeMonthYear:D,beforeShowDay:function(e){return-1!==h.indexOf(I(e,!1))?[!0,""]:[!1,""]},monthNames:[WebPlatform.Phrases["label.january"],WebPlatform.Phrases["label.february"],WebPlatform.Phrases["label.march"],WebPlatform.Phrases["label.april"],WebPlatform.Phrases["label.may"],WebPlatform.Phrases["label.june"],WebPlatform.Phrases["label.july"],WebPlatform.Phrases["label.august"],WebPlatform.Phrases["label.september"],WebPlatform.Phrases["label.october"],WebPlatform.Phrases["label.november"],WebPlatform.Phrases["label.december"]],dayNamesMin:[WebPlatform.Phrases["label.sunday_min"],WebPlatform.Phrases["label.monday_min"],WebPlatform.Phrases["label.tuesday_min"],WebPlatform.Phrases["label.wednesday_min"],WebPlatform.Phrases["label.thursday_min"],WebPlatform.Phrases["label.friday_min"],WebPlatform.Phrases["label.saturday_min"]]}),t.location?(m.find(".event-location").show(),m.find(".location").text(t.location)):m.find(".event-location").hide(),t.autoAssign&&m.find(".operator").hide(),C.text(A(g.datepicker("getDate"))),v.on("click","li",(function(){var e,n,s,l,c,u,d,f,p=$(this);v.find("li").removeClass("active"),p.addClass("active"),o=p.data("time"),x.text((e=p[0].childNodes[0].nodeValue,n=-1!==a?_(a,r).duration:t.autoAssign?t.operators[0].duration:_(i,t.operators).duration,s="dd/mm/yy"===WebPlatform.dateFormat,l=e.split(" "),c=l[0].split(":"),u=parseInt(c[0]),d=parseInt(c[1]),f=l[1],(d=parseInt(d)+n)>=60&&(u=Math.floor(d/60)+u,d%=60,!s&&(12===u||u>12&&parseInt(c[0])<12)&&(f="AM"===f?"PM":"AM")),!s&&u>12&&(u%=12),e+" - "+("0"+u).slice(-2)+":"+("0"+d).slice(-2)+" "+(s?"":f))),z(),Z()})),function(){var e=m.find('span[data-role="current-timezone"]');try{var t=(new Date).toString().split(" ").splice(5),n=t.splice(0,1)[0]||"";n&&(n=" ("+n.substr(0,n.length-2)+":"+n.substr(-2)+")");var r=(t.join(" ")||"").replace(/[()]/g,"")||"Times in";e.text(r+n)}catch(t){Log.error(t);var i=window.jstz?jstz.determine().name():"Times in GMT";e.text(i)}}(),m.find(".back-button").click(j),m.find(".change-timezone").click(N),m.find('[data-role="hide-time"]').click(z),f=window.jstz?jstz.determine().name():"UTC","service"===e.startWith)return c=[k,P,b,y,w],void U();c=[P,k,b,y,w],G()},B=function(){b.addClass("date-selected")},z=function(){b.removeClass("date-selected")},j=function(){z();var t=c.indexOf(u);-1===t&&(c.unshift("service"===e.startWith?k:P,u),t=c.indexOf(u)),u.addClass("none"),(u=c[t-1]).removeClass("none"),H()},H=function(){var e=c.indexOf(u)+1,t=c.length-1,n=m.find(".form-progress-wrapper");n.find("span").text(e+" "+(WebPlatform.Phrases["label.of"]||"of")+" "+t),n.find(".success-bar").css("width",e/t*100+"%")},U=function(){var n={};if(t.autoAssign||"service"===e.startWith){for(var a=0;a<t.operators.length;a++)for(var o=0;o<t.operators[a].services.length;o++)if(!n[t.operators[a].services[o]]){var s=t.operators[a].services[o];(f=_(s,r))&&(n[s]=f)}}else{var d=_(i,t.operators);for(a=0;a<d.services.length;a++)if(!n[d.services[a]]){var f;s=d.services[a];(f=_(s,r))&&(n[s]=f)}}if((l=Object.keys(n).length)<=1){var p=c.indexOf(k);return-1!==p&&c.splice(p,1),1===l?V(Object.keys(n)[0]):0===l&&V(-1),void H()}var h=k.find('ul[data-role="service-select"]');h.empty(),k.removeClass("none"),u=k,c[0]===u&&k.find(".back-button").hide(),$.each(n,(function(e,t){var n,r,i=t.image?getThumbnailsFromBase(t.imageBase,"160x120")+t.image+"?format=webp":"";h.append(WebPlatform.escapeFormat((n=!!i,r=!!t.description,'<li><a data-action="selectService" data-id="%id%">'+(n?'<span class="service-img" style="background-image: url(%img%);"></span><div>':"<div>")+'<span class="option-title">%title%</span><span class="option-desc">%duration%</span>'+(r?'<span class="option-desc">%description%</span>':"")+"</div></a></li>"),"id",e,"title",t.name,"duration",t.duration+" "+WebPlatform.Phrases["label.minutes_short"],"img",i,"description",t.description))})),h.on("click",'a[data-action="selectService"]',(function(){var e=$(this);e.parent("li").siblings("li").find("a").removeClass("active"),e.addClass("active"),V(e.data("id"))})),H()},V=function(n){if(k.addClass("none"),a=parseInt(n),L=0,-1!==a){var i=_(a,r);S.text(i.name)}else S.text(t.name);"service"!==e.startWith?Y():G()},G=function(){if(t.autoAssign)return-1!==(l=c.indexOf(P))&&c.splice(l,1),Q(-1),void H();var r={};if("service"===e.startWith)for(var i=0;i<t.operators.length;i++){if(a>0&&-1!==t.operators[i].services.indexOf(a)||-1===a&&0===t.operators[i].services.length)r[o=t.operators[i].id]||(r[o]=_(o,n))}else for(i=0;i<t.operators.length;i++)if(!r[t.operators[i].id]){var o=t.operators[i].id;r[t.operators[i].id]=_(o,n)}s=Object.keys(r).length;var l,d=P.find('ul[data-role="operator-select"]');(d.empty(),s>1)?(P.removeClass("none"),u=P,c[0]===u&&P.find(".back-button").hide(),$.each(r,(function(e,t){if(null!=t){var n,r,i=t.image?getThumbnailsFromBase(t.imageBase,"160x120")+t.image+"?format=webp":"";d.append(WebPlatform.escapeFormat((n=!!i,r=!!t.description,'<li><a data-action="selectOperator" data-id="%id%">'+(n?'<span class="operator-img" style="background-image: url(%img%);"></span><div>':"<div>")+'<span class="option-title">%title%</span>'+(r?'<span class="option-desc">%description%</span>':"")+"</div></a></li>"),"id",e,"title",t.name,"description",t.description||"","img",i))}})),d.on("click",'a[data-action="selectOperator"]',(function(){var e=$(this);e.parent("li").siblings("li").find("a").removeClass("active"),e.addClass("active"),Q(e.data("id"))}))):(-1!==(l=c.indexOf(P))&&c.splice(l,1),Q(Object.keys(r)[0]));H()},Q=function(r){if(P.addClass("none"),i=parseInt(r),L=0,!t.autoAssign){var a=_(i,n);if(null==a)return;T.text(a.name)}"service"!==e.startWith?U():Y()},Y=function(e,n,r,o){o=!!isUndefined(o)||o,e=e||new Date,r=r||dummy,b.removeClass("none"),u=b,c[0]===u&&b.find(".back-button").hide();var s=F(e);if(p.hasOwnProperty(s))K(p[s]),e=X(p[s],e,o),J(p[s],e),r();else{var l={bookingId:t.id,operatorId:i,serviceId:a,startDate:I(e,!1),endDate:I(new Date(e.getFullYear(),e.getMonth()+1,0),!1),timeZone:f};WebPlatform.makeClientWebsiteRequest({action:"getAvailableDates",data:{data:JSON.stringify(l)},onOk:function(t){p[s]=t.data,K(p[s]),e=X(p[s],e,M(t.data),n),!n&&M(t.data)&&Y(e,n,r,o),J(p[s],e),r()}})}H()},K=function(e){h=Object.keys(e),g.datepicker("refresh")},X=function(e,t,n,r){if("onChangeMonth"===r)return t;var i,a=[];for(var o in e)e.hasOwnProperty(o)&&a.push(o);if(!n&&0===a.length)return t;if(0===a.length)return++L%6==0?(g.datepicker("setDate",t),C.text(A(t)),t):11===t.getMonth()?new Date(t.getFullYear()+1,0,1):new Date(t.getFullYear(),t.getMonth()+1,1);a.sort();for(var s=0;s<a.length;s++){i=new Date(t.getTime());var l=a[s].split("-");if(i.setFullYear(l[0]),i.setMonth(parseInt(l[1])-1),i.setDate(l[2]),i.getMonth()===t.getMonth()){g.datepicker("setDate",i),C.text(A(i));break}}return i},J=function(e,t){if(null!=t){v.empty();var n="dd/mm/yy"===WebPlatform.dateFormat;$.each(e[I(t,!1)],(function(e,t){var r,i,a,o,s,l=n?t.time:(r=t.time,i=r.split(":"),a=parseInt(i[0]),o=parseInt(i[1]),s=a>=12?"PM":"AM",(a=("0"+(a=a%12||12)).slice(-2))+":"+(o=("0"+o).slice(-2))+" "+s),c=t.data?"<span>"+t.data+" "+WebPlatform.Phrases["label.slots_left"]+"</span>":"";v.append("<li data-time='"+t.time+"'>"+l+c+"</li>")}))}},Z=function(){var e=[];i||e.push("Please select operator."),a||e.push("Please select service."),g.datepicker("getDate")||e.push("Please select date."),o||e.push("Please select time."),e.length>0?WebPlatform.showClientError(e.join("<br>"),5e3):(b.addClass("none"),y.removeClass("none"),u=y,W.off("click"),W.click((function(){te()})),H())},ee=function(){E&&window.ClientTools&&ClientTools.resetRecaptcha(m,W)},te=function(){if(!W.hasClass("disabled")){var e=w.find(".call-to-action.button");if(e.addClass("none"),t.confirmation.title||t.confirmation.buttonText){var n=t.confirmation;n.title&&w.find(".confirmation-title").text(n.title),n.description&&w.find(".confirmation-description").html(WebPlatform.escapeHtml(n.description).replace(/\n/g,"<br />")),n.buttonLink&&(e.removeClass("none"),e.attr("href",n.buttonLink),e.find(".cta-text").text(n.buttonText))}var r=m.find(".widget-form .form-field").not('[data-type="section"]'),s=ClientTools.readFormFields(r);if(!s.hasErrors){var l=I(g.datepicker("getDate"),!1),c={id:t.id,operatorId:i,serviceId:a,date:l,time:o,timeZone:f},u=m.find('input[name="formid"]').val(),d={action:"reserveBooking",method:"post",data:{data:JSON.stringify(c),values:s.values,form:u},onOk:function(e){if(WebPlatform.Events.trigger(m,WebPlatform.Events.FORM_SUBMITTED,{formId:u,values:s.values,uid:e.uid}),m.find(".field-with-error").removeClass("field-with-error"),e.data&&e.data.errors){var n=e.data.errors;if(ee(),"existing"===n)return void ClientTools.showMessageBox(WebPlatform.Phrases["label.contact_booked_error"],b,"before",!0,1e4);if("notice"===n)return void ClientTools.showMessageBox(WebPlatform.Phrases["label.booking_notice_error"],b,"before",!0,1e4);if("booked"===n)return ClientTools.showMessageBox(WebPlatform.Phrases["label.already_booked_time_error"],b,"before",!0,1e4),void j();for(var i=0;i<n.length;++i)n[i]&&r.eq(i).addClass("field-invalid")}else if(y.addClass("none"),WebPlatform.lastFormParams=params="name="+encodeURIComponent(t.name)+"&date="+encodeURIComponent(c.date)+"&time="+encodeURIComponent(c.time),t.confirmation&&t.confirmation.link){var a=0!==t.confirmation.link.toLowerCase().trim().indexOf("javascript:");window.location.href=a?t.confirmation.link+(t.confirmation.link.indexOf("?")<0?"?":"&")+params:t.confirmation.link}else t.confirmation&&0===Object.keys(t.confirmation).length&&w.find(".call-to-action.button").hide(),m.find(".call-to-action2").click((function(){WebPlatform.makeClientWebsiteRequest({action:"getBookingIcs",method:"get",data:{id:e.data.id,timeZone:f},onOk:function(e){var t=document.createElement("a");t.download="event.ics";var n=new Blob([e.data],{type:"text/plain;charset=UTF-8",encoding:"UTF-8"});t.href=window.URL.createObjectURL(n),t.click()}})})),w.removeClass("none")},onNotOk:function(e){ee(),ClientTools.showMessageBox(e.message,W,"after",!0,1e4)}};s.file?WebPlatform.makeClientWebsiteRequestWithFile(d,s.file):WebPlatform.makeClientWebsiteRequest(d)}}};return{_init:function(){return function(){if(null!==(t=e.booking||null)){e.preview&&(t.name=encodeURIComponent(t.name||""),t.location=encodeURIComponent(t.location||""),t.description=encodeURIComponent(t.description||""));var i=function(){var e=[],i=[];(t.operators||[]).forEach((function(t){e.push(t.id),t.services&&t.services.length&&Array.prototype.push.apply(i,t.services)})),WebPlatform.makeClientWebsiteRequest({action:"getBookingOperatorsAndServices",data:{operators:JSON.stringify(e),services:JSON.stringify(i)},onOk:function(e){var t=e.data;n=t.operators,r=t.services,0!==(n||[]).length?q():m.find('[data-role="no-operators"]').removeClass("none")}})};if(window.ClientTools){var a=2;ClientTools.requestResource(resources+"/scripts/jquery-ui.min.js?v="+resourcesVersion,resources+"/styles/jquery-ui.min.css?v="+resourcesVersion,(function(){return!!$.datepicker}),(function(){0==--a&&i()})),ClientTools.requestResource(resources+"/scripts/external/jstz.js",null,(function(){return!!window.jstz}),(function(){0==--a&&i()}))}else i()}}(),delete this._init,this}}._init()},WebPlatform.Widgets.Quiz=function(e){if(!e.container||!e.container.length)return null;var t=e.container,n=t.find(".widget-form"),r=n.find(".recaptcha-target"),i=t.find('[data-role="quiz-step"]'),a=t.find(".form-progress-wrapper"),o=function(e){return e.closest('[data-role="quiz-step"]')},s=function(e){var t=e.find(".form-field").not('[data-type="section"]');if(ClientTools.readFormFields(t).hasErrors)u(t.filter(".field-invalid").eq(0));else{var n=function(){for(var t=e.find(".form-field"),n=0;n<t.length;++n){var r=t.eq(n),a=r.data("type");if("select"===a||"radio"===a||"checkbox"===a){var o=r.find("[data-skip]"),s=null;for(optionIdx=0;optionIdx<o.length;++optionIdx){var l=o.eq(optionIdx);if((l.is("input:checked")||l.is("option:selected"))&&(s=l.data("skip")),s)return s}}}var c=e.data("idx")+1;return i.eq(c).data("id")}();if("finish"!==n)l(n).data("back",e.data("id"));else c()}},l=function(e){var n=i.filter('[data-id="'+e+'"]');if(0!==n.length){i.addClass("none-soft"),n.removeClass("none-soft").addClass("visited-step");var r=n.data("idx")||0;return a.find(".success-bar").css("width",(r+1)/i.length*100+"%"),a.find(".steps-nav-wrapper a").filter(".active").removeClass("active").end().eq(r).addClass("active"),a.find('[data-role="current-step"]').text(r+1),u(t),n}},c=function(){var e=n.find('input[name="formid"]').val(),i=n.find(".visited-step");n.find(".field-invalid").removeClass("field-invalid");for(var o=$([]),s=[],l={},c=[],f=[],p=0;p<i.length;++p){var h=i.eq(p),m=h.find(".form-field").not('[data-type="section"]'),g=ClientTools.readFormFields(m);if(g.hasErrors)return void d(m);s.push.apply(s,g.values),o=o.add(m);var v=h.data("id");c.push(v),g.file&&f.push(g.file),l[v+""]=g.values.length}ClientTools.showLoader();var b={action:"submitForm",method:"post",data:{values:s,steps:JSON.stringify(c),stepLengths:JSON.stringify(l),form:e},onOk:function(l){var c=l.data;if(c.errors){for(var f=0;f<c.errors.length;++f){var p=c.errors[f];null!==p&&o.eq(f).addClass("field-invalid").find(".field-error").text(p)}d(o),r.length>0&&r.each((function(){var e=$(this),t=e.closest('[data-role="quiz-step"]').find(".next-button");ClientTools.resetRecaptcha(e,t)})),ClientTools.hideLoader()}else{WebPlatform.Events.trigger(n,WebPlatform.Events.FORM_SUBMITTED,{formId:e,values:s,uid:l.uid,score:c.score});var h=c.result||{};if(h.url){WebPlatform.lastFormParams="";var m=!0===n.data("passValues");g.urlFields.length>0&&g.urlFields.forEach((function(e){(m||"hidden"===e.type)&&e.value&&(""!==WebPlatform.lastFormParams&&(WebPlatform.lastFormParams+="&"),WebPlatform.lastFormParams+=encodeURIComponent(WebPlatform.removeDiacritics(e.name))+"="+encodeURIComponent(e.value))})),WebPlatform.delay(80,(function(){var e=0===h.url.toLowerCase().trim().indexOf("javascript:");e&&ClientTools.hideLoader();var t=!e&&""!==WebPlatform.lastFormParams;window.location.href=t?h.url+(-1===h.url.indexOf("?")?"?":"&")+WebPlatform.lastFormParams:h.url}))}else{var v=h.title||"Thank you!",b=h.description||"",y=!0===h.withCTA,w=h.ctaText||"",C=h.ctaTarget||"",x=t.find('[data-role="thank-you-message"]');if(v&&x.find('[data-role="title"]').removeClass("none").text(v),b&&x.find('[data-role="description"]').removeClass("none").text(b),y){var k=x.find('[data-role="cta"]');C&&k.find('[data-role="cta-link"]').attr("href",C),w&&k.find('[data-role="cta-text"]').text(w),k.removeClass("none")}i.add(a).addClass("none"),x.removeClass("none"),u(t),ClientTools.hideLoader()}}}};0===f.length?ClientTools.makeWebsiteRequest(b):WebPlatform.makeClientWebsiteRequestWithFile(b,f)},u=function(e){WebPlatform.delay(50,(function(){e[0].scrollIntoView&&e[0].scrollIntoView({behavior:"smooth"})}))},d=function(e){for(var t=e.filter(".field-invalid"),n=0;n<t.length;++n){var r=t.eq(n),a=o(r);if(a.hasClass("visited-step")){for(n=(a.data("idx")||0)+1;n<i.length;++n)i.eq(n).removeClass("visited-step");l(a.data("id"));break}}};return{_init:function(){return ClientTools.setupFormFields(n),r.length>0&&r.each((function(){var e=$(this),t=e.closest('[data-role="quiz-step"]').find(".next-button");ClientTools.setupRecaptcha({ui:e,button:t})})),t.find(".nps-wrapper a, .select-wrapper a").click((function(){var e=$(this),t=e.find("input")[0];t.checked=!t.checked;var n=e.closest(".form-field");n.find(".active").removeClass("active"),n.find("input:checked").each((function(){$(this).parent().addClass("active")}));var r=o(n);if(0===r.find(".next-button").length){var i=r.find(".form-field"),a=0;i.each((function(){$(this).find(":checked").length>0&&++a})),a===i.length&&s(r)}})),t.find('[data-role="submit"]').click((function(){$(this).hasClass("disabled")||c()})),t.find('[data-role="next"]').click((function(){var e=$(this);e.hasClass("disabled")||s(o(e))})),t.find('[data-role="back"]').click((function(){var e=o($(this)),t=e.data("back")||"";l(t)&&e.removeClass("visited-step")})),delete this._init,this}}._init()};const SEC_TO_WATCH_FOR_UNIQUE=3,VIDEO_PLAYER_LOCAL_STORAGE_KEY="video-player",SAVING_INTERVAL_SECONDS=4,UNKNOWN_MEMBER="thereisnoplacelikehome";WebPlatform._activePlayers=[];let registerPlayer=e=>(WebPlatform._activePlayers.push(e),1===WebPlatform._activePlayers.length&&setTimeout(cleanUpPlayers,500),e);cleanUpPlayers=()=>{for(let e=0;e<WebPlatform._activePlayers.length;e++){let t=WebPlatform._activePlayers[e];if(!document.contains(t.elements.container)){console.log("Cleaning up orphaned player");try{t.destroy()}catch(e){console.log("Error destroying player",e)}WebPlatform._activePlayers.splice(e,1)}}WebPlatform._activePlayers.length&&setTimeout(cleanUpPlayers,250)};const getDifferenceInTime=(e,t,n="all")=>{if(!e||!t)return{};let r=t-e,i=r/1e3,a=i/60,o=a/60,s=o/24;switch(n){case"milliseconds":return r;case"seconds":return i;case"minutes":return a;case"hours":return o;case"days":return s;default:return{seconds:i,minutes:a,hours:o,days:s}}},setMemberLastStopAt=(e,t,n)=>{!n.mid&&WebPlatform?.Members?.current&&(n.mid=`${n.memberKey}_${WebPlatform.Members.current.id}`);let r,i=n.mid?n.mid:UNKNOWN_MEMBER,a=localStorage.getItem("video-player");r=a?JSON.parse(a):{},r[i]||(r[i]={}),r[i][e]={stopAt:t,timestamp:new Date},localStorage.setItem("video-player",JSON.stringify(r))},getMemberLastStopAt=(e,t)=>{!t.mid&&WebPlatform?.Members?.current&&(t.mid=`${t.memberKey}_${WebPlatform.Members.current.id}`);let n=t.mid?t.mid:UNKNOWN_MEMBER,r=localStorage.getItem("video-player");if(!r)return{stopAt:0,timestamp:0};let i=JSON.parse(r);return i&&i[n]&&i[n][e]?i[n][e]:{stopAt:0,timestamp:0}},contentOverlayCls=(e,t)=>{let n,r;const i=async(e,t)=>{t&&t.forEach(((t,n)=>{a(t,e,n)}))},a=(e,t)=>{if(t.querySelector("#"+e.elementId))return;let n=document.createElement("div");n.id=e.elementId,n.style.zIndex=2,n.style.backgroundColor=e.backgroundColor,n.classList.add("video-content-overlay"),e.fullHeight&&n.classList.add("full-height"),n.classList.add(e.layoutClass),e.content&&e.content.length>4?(n.innerHTML=e.renderedContent,t.prepend(n)):(n.innerHTML=e.name,t.prepend(n))},o=async(e,t)=>{t&&t.forEach((t=>{s(t,e)}))};let s=(e,t)=>{let n=t.querySelector("#"+e);n&&n.remove()};return((e,t)=>{e=e||"[]",n=JSON.parse(e),r=new Array(Math.floor(t));for(let e=0;e<t;e++)r[e]={show:[],hide:[]};if(!n||0===n.length)return r;for(let e=0;e<n.length;e++){let t=n[e];t.elementId="video-content-overlay-"+e+"-"+(new Date).getTime();let i=t.showAt,a=t.hideAt;r.forEach(((e,n)=>{n<i||n>a?e.hide.push(t.elementId):e.show.push(t)}))}})(e,t),{apply:(e,t)=>{i(e,r[t]?.show),o(e,r[t]?.hide)}}},getAspectRatio=(e,t)=>{const n=(e,t)=>(t>e&&([e,t]=[t,e]),0===t?e:n(t,e%t));if(e&&e>0&&t&&t>0){const r=n(e,t);return e/r+":"+t/r}return"16:9"};WebPlatform.Widgets.VideoService=(e={})=>{if(!WebPlatform.Widgets.shouldRender(e.root))return null;e.videoServiceUrl||(e.videoServiceUrl=`https://${window.serviceApiDomain||WebPlatform.serviceApiDomain}/video`);let t=0,n=!1,r=!0,i="plyBtnId-"+(new Date).getTime(),a=(e,t)=>{if(!n)return void(n=!0);if(!e.playing)return;let a=document.createElement("div");a.classList.add("plyr-pause-btn-copy");let o=document.createElement("div");o.id=i,o.classList.add("plyr-pause-btn-copy-container"),o.appendChild(a),t.querySelector(".plyr").prepend(o),setTimeout((function(){o.remove(),r=!0}),1e3),a.addEventListener("touchstart",(t=>{e.pause(),o.remove(),r=!1}))},o=(i,o)=>{let l;!o.mid&&WebPlatform?.Members?.current&&(o.mid=`${o.memberKey}_${WebPlatform.Members.current.id}`);let c,u=o.videoLoopAsThumb.enabled,d=o.videoLoopAsThumb.start,f=o.videoLoopAsThumb.end,p=!1,h={settings:["speed","loop","quality"],quality:{default:720,options:[480,720,1080],forced:!0,onChange:e=>{if(p&&c){const t={480:0,720:1,1080:2};void 0!==t[e]&&(c.nextLevel=t[e])}}}};o.videoRemoveControls&&(h.controls=[],h.clickToPlay=!1);let m=o.videoElementId,g="plyr-btn-"+m,v=e.root.querySelector(`video[video-id="${m}"]`);e.videoElement&&(v=e.videoElement),o.keepAspectRatio&&(h.ratio=getAspectRatio(i.width,i.height));let b=v.closest(".plyr");b||(b=v);let y=i.backgroundColor;y&&"transparent"!==y||(y="none"),b.style.setProperty("--plyr-video-background",y);let w=o.isPlaylist?o.containerClass:".full-size",C=v.closest(w);u?(o.editMode&&(h.controls=!1),o.videoAutoplay=!1):i.thumbnail&&v.setAttribute("data-poster",i.thumbnail);const x=i.videoPath;let k;if(i.captions&&i.captions.length>0){let e=i.captions[0],t=!0===e.autoEnable;t&&(k=e.tag);for(const e of i.captions){let t=document.createElement("track");t.kind="captions",t.label=e.lang,t.srclang=e.tag,t.src=e.url,v.appendChild(t)}h.settings.push("captions"),h.captions={active:t,language:e.tag,update:!1}}let P=registerPlayer(new Plyr(v,h));if(b.getElementsByClassName("plyr__poster")&&b.getElementsByClassName("plyr__poster").length>0&&(b.getElementsByClassName("plyr__poster")[0].style.backgroundImage="url("+i.thumbnail+")"),window.plyrs||(window.plyrs={}),window.plyrs[m]=P,Hls.isSupported()){let e={lowLatencyMode:!0,progressive:!0,maxBufferLength:6,maxMaxBufferLength:12,autoStartLoad:!1,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrBandWidthFactor:.9,abrBandWidthUpFactor:.7,enableWorker:!0,testBandwidth:!o.editMode,startLevel:-1};c=new Hls(e),c.loadSource(x),c.attachMedia(v),u&&(c.config.autoStartLoad=!0,c.startLoad(startPosition=-1),p=!0),c.on(Hls.Events.LEVEL_SWITCHED,((e,t)=>{if(P){const e={0:480,1:720,2:1080}[t.level];e&&P.quality!==e&&(P.quality=e)}})),P.on("enterfullscreen",(()=>{p&&c&&(c.nextLevel=2,P.quality=1080)}))}else console.error("Hls not supported");function S(e){const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?"0":""}${n}`}function T(e,t){if(!e||!t||!t.length)return;const n=e.duration;if(!n)return;const r=e.elements.progress;if(!r)return;r.querySelectorAll(".plyr__chapter-marker").forEach((e=>e.remove()));const i=[...t].sort(((e,t)=>e.time-t.time));i.forEach(((t,a)=>{const o=t.time/(1e3*n)*100;let s;if(a<i.length-1){s=(i[a+1].time-t.time)/(1e3*n)*100}else{s=(1e3*n-t.time)/(1e3*n)*100}const l=document.createElement("div");l.classList.add("plyr__chapter-marker"),l.style.left=`${o}%`;const c=document.createElement("div");c.classList.add("plyr__chapter-section"),c.style.left=`${o}%`,c.style.width=`${s}%`;const u=document.createElement("div");u.classList.add("marker-tooltip"),u.textContent=`${S(t.time/1e3)} - ${t.label}`,l.addEventListener("click",(()=>{e.currentTime=t.time/1e3,e.play()})),l.addEventListener("mouseenter",(()=>{r.classList.add("marker-hover"),r.classList.add("hide-default-tooltip")})),l.addEventListener("mouseleave",(()=>{r.classList.remove("marker-hover"),r.classList.remove("hide-default-tooltip")})),l.appendChild(u),r.appendChild(l),r.appendChild(c)}))}if(k&&(P.language=k),o.videoRemoveControls&&P.once("click",P.play),u&&o.editMode&&P.on("ready",(e=>{let t=document.createElement("span");t.classList.add("video-unmute-layer"),t.innerHTML=WebPlatform.Phrases["label.click_to_unmute"];let n=document.createElement("div");n.classList.add("video-thumb-play");let r=document.createElement("div");r.id=g,r.classList.add("plyr-play-btn-copy-container"),r.appendChild(t),r.appendChild(n),C.prepend(r),setTimeout((()=>{P.currentTime=d}),600)})),!o.editMode){let h={isUnique:(e=>{let t=localStorage.getItem("video-service");if(!t)return!0;let n=JSON.parse(t);return!(n&&n[e])})(m),startTime:0,endTime:0,mid:o.mid?o.mid:-1,timeframes:[]},b=e=>{let t,n=localStorage.getItem("video-service");t=n?JSON.parse(n):{},t[e]=!0,localStorage.setItem("video-service",JSON.stringify(t))},y=!0,w=e=>{let t=getMemberLastStopAt(m,o);if(t||o.startAt){let n=0;return getDifferenceInTime(Date.parse(t.timestamp),new Date,"minutes")<10?n=t.stopAt:o.startAt&&(n=o.startAt),0===e||e-n>5?n:0}};P.on("loadeddata",(e=>{l=contentOverlayCls(i.contentOverlay,P.duration),y&&!u&&(P.currentTime=w(P.duration),y=!1)})),P.on("play",(e=>{p||(c.config.autoStartLoad=!0,c.startLoad(startPosition=-1),p=!0)})),P.on("ready",(e=>{if(u){P.muted=!0;let e=document.createElement("span");e.classList.add("video-unmute-layer"),e.innerHTML=WebPlatform.Phrases["label.click_to_unmute"];let t=document.createElement("div");t.classList.add("video-thumb-play");let n=document.createElement("div");n.id=g,n.classList.add("plyr-play-btn-copy-container"),n.appendChild(e),n.appendChild(t),n.addEventListener("click",(e=>{P.pause()})),v.parentElement.parentElement.parentElement.prepend(n),P.play(),setTimeout((()=>{let e=s(P.duration,d,f);d=e[0],f=e[1],P.currentTime=d}),150)}else o.videoAutoplay&&(o.unmuteAutoplay?P.muted=!1:P.muted=!0,P.play());i.timestamps&&i.timestamps.length>0&&(!function(e,t){const n=e.elements.progress,r=document.createElement("div");r.classList.add("plyr__time-tooltip"),n.appendChild(r),n.addEventListener("mousemove",(i=>{if(n.classList.contains("marker-hover"))return;n.classList.add("hide-default-tooltip");const a=n.getBoundingClientRect(),o=(i.clientX-a.left)/a.width,s=e.duration*o;let l="";for(let e=t.length-1;e>=0;e--)if(s>=t[e].time/1e3){l=t[e].label;break}r.textContent=l?`${S(s)} - ${l}`:S(s),r.style.display="block",r.style.left=i.clientX-a.left+"px";const c=r.getBoundingClientRect();c.right>a.right&&(r.style.left=i.clientX-a.left-(c.right-a.right)+"px"),c.left<a.left&&(r.style.left="0px")})),n.addEventListener("mouseleave",(()=>{r.style.display="none",n.classList.remove("hide-default-tooltip"),n.classList.remove("marker-hover")}))}(P,i.timestamps),T(P,i.timestamps))})),i.timestamps&&i.timestamps.length>0&&(P.on("loadedmetadata",(()=>{T(P,i.timestamps)})),P.on("durationchange",(()=>{T(P,i.timestamps)}))),P.on("timeupdate",(e=>{let n=P.currentTime,r=Math.floor(n);u?n>=f&&(P.currentTime=d):(l?.apply(v.parentElement.parentElement,r),Math.abs(n-h.endTime)<1&&(h.endTime=n),Math.abs(n-t)>4&&(t=n,setMemberLastStopAt(m,t,o)))})),P.on("playing",(e=>{n&&!r&&P.pause();let t=P.currentTime;t<1?(h.startTime=0,h.endTime=0):(h.startTime=t,h.endTime=t)})),P.on("pause",(e=>{if("hidden"===document.visibilityState&&u)return void P.play();if(u){let e=document.getElementById(g);return e&&e.remove(),u=!1,P.muted=!1,P.volume=.8,P.restart(),void P.play()}let t=h.startTime,n=h.endTime;t!==n&&(h.timeframes.push([t,n]),h.endTime=P.currentTime,h.isUnique&&n-t>3&&b(m),o.callback?.paused&&o.callback.paused({endTime:h.endTime}))})),P.on("ended",(e=>{o.videoLoop&&P.play(),o.callback?.ended&&o.callback.ended(),o.mid>0&&setMemberLastStopAt(m,0,o.mid)})),P.on("touchstart",(e=>{a(P,C)})),addEventListener("visibilitychange",(e=>{"hidden"===document.visibilityState?(o.videoPauseOnLostFocus&&!u&&P.pause(),!u&&i.owner&&k()):o.videoPauseOnLostFocus&&!u&&P.paused&&P.play()}));const x=WebPlatform.hash;let k=()=>{if(h.timeframes.length>0){let t=JSON.stringify({...h,websiteHash:x});navigator.sendBeacon(e.videoServiceUrl+"/analytics/"+m,t),W()}},W=()=>{h.timeframes=[],h.isUnique=!1}}},s=(e,t,n)=>(e||0===e||((t<0||t>=e-.5)&&(t=0),n-t>5&&(n=t+5),n>e-.5&&(n=e-.5)),[t,n]);WebPlatform.requestScripts([{script:resources+"/scripts/hls.js?v="+resourcesVersion,check:()=>!!window.Hls},{script:resources+"/scripts/plyr.polyfilled.js?v="+resourcesVersion,style:resources+"/styles/plyr.polyfilled.css?v="+resourcesVersion,check:()=>!!window.Plyr}],(()=>{"PLYR_EMBEDDED"===e.videoType?(t=>{let i=e.root.querySelector(`[video-id="${t.videoElementId}"]`);if(e.videoElement&&(i=e.videoElement),!i)return;let o=registerPlayer(new Plyr(i,{captions:{active:!0}}));t.autoplay&&o.on("ready",(e=>{o.play()}));let s=i.closest(".full-size");o.on("touchstart",(e=>{a(o,s)})),o.on("pause",(e=>{a(o,s)})),o.on("playing",(()=>{n&&!r&&o.pause()}))})(e):"PLYR_INTERNAL"===e.videoType?fetch(e.videoServiceUrl+"/file/"+e.videoId+"/meta",{headers:{"Content-Type":"application/json","X-Website-Hash":WebPlatform.hash}}).then((e=>e.json())).then((t=>{200===t.code&&(t.payload&&t.payload.videoPath?o(t.payload,e):(t=>{let n=e.root.querySelector(`video[video-id="${t}"]`);e.videoElement&&(n=videoElement);let r=document.createElement("div"),i=document.createElement("span");i.classList.add("missing-video-text"),i.innerHTML="Video is missing",r.appendChild(i),r.classList.add("missing-video-container"),n.parentNode.replaceChild(r,n)})(e.videoElementId))})).catch((e=>{console.error("PLYR_INTERNAL - Error fetching video meta data",e)})):"PLYR_EXTERNAL"===e.videoType&&(e=>{let t,i,o={settings:["speed","loop","quality"],quality:{default:720,options:[480,720,1080],forced:!0},onChange:e=>{if(i&&t){const n={480:0,720:1,1080:2};void 0!==n[e]&&(t.nextLevel=n[e])}}};e.videoRemoveControls&&(o.controls=[],o.clickToPlay=!1);let s=e.videoElementId,l=e.root.querySelector(`video[video-id="${s}"]`);e.videoElement&&(l=e.videoElement);let c=l.closest(".full-size");if(!l)return;const u=e.videoSource;let d=u.includes(".m3u8");d||l.setAttribute("src",u);let f=registerPlayer(new Plyr(l,o));Hls.isSupported()&&d&&(t=new Hls({maxBufferLength:9,maxMaxBufferLength:12,maxBufferSize:2e7,capLevelToPlayerSize:!0}),t.loadSource(u),t.attachMedia(l),i=!0,t.on("hlsLevelSwitched",((e,t)=>{if(f){const e={0:480,1:720,2:1080}[t.level];e&&f.quality!==e&&(f.quality=e)}})),f.on("enterfullscreen",(()=>{i&&t&&(t.nextLevel=2,f.quality=1080)})));e.videoRemoveControls&&f.once("click",f.play),e.editMode||(f.on("ready",(t=>{e.videoAutoplay&&f.play()})),f.on("ended",(t=>{e.videoLoop&&f.play()})),f.on("playing",(()=>{n&&!r&&f.pause()})),f.on("touchstart",(e=>{a(f,c)})),addEventListener("visibilitychange",(t=>{"hidden"===document.visibilityState?e.videoPauseOnLostFocus&&f.pause():f.paused&&e.videoPauseOnLostFocus&&f.currentTime>0&&f.play()})))})(e)}))};