From cf46814afe88e5d945d1c26ba934096419288016 Mon Sep 17 00:00:00 2001 From: Vadim Sikora Date: Mon, 8 Aug 2016 10:00:42 +0200 Subject: [PATCH] Fixed submit handlers not being executed on modal form This is a regression from the #5312, submitting form with jQuery doesn't run event handlers that are attached with `addEventListener`, e.g Django's `filter_horizontal` field. Ref: #5590 --- CHANGELOG.txt | 10 +++++----- .../cms/js/dist/3.3.0/bundle.toolbar.min.js | 6 +++--- cms/static/cms/js/modules/cms.modal.js | 15 ++++++++++++++- cms/templates/cms/wizards/create.html | 2 +- cms/templates/cms/wizards/start.html | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3b4270672cd..1c821a51097 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,11 +8,6 @@ * Changed cache-busting implementation, it is now handled by a path change, not by GET parameter. * Added a possibility to copy pages in the Page Tree by drag'n'drop. -* Fixed a bug where it wasn't possible to scroll the toolbar menu if scroll - started on the disabled menu item on small screens. -* Fixed a regression when standalone CMS Widgets wouldn't work due to - non-existing JavaScript dependencies. -* Fixed a possible recursion error when using the ``Alias`` plugin. * Make it possible to use multi-table inheritance for Page/Title extensions. * Refactored plugin rendering functionality to speed up loading time in both structure and content mode. @@ -23,6 +18,11 @@ * Fixed a bug where it wasn't possible to scroll the toolbar menu if scroll started on the disabled menu item on small screens. * Fixed a migration error (0014) that occurred under certain environments. +* Fixed a regression when standalone CMS Widgets wouldn't work due to + non-existing JavaScript dependencies. +* Fixed a possible recursion error when using the ``Alias`` plugin. +* Fixed a regression where submit handlers for modal form wouldn't be executed + under certain circumstances === 3.3.1 (2016-07-13) === diff --git a/cms/static/cms/js/dist/3.3.0/bundle.toolbar.min.js b/cms/static/cms/js/dist/3.3.0/bundle.toolbar.min.js index 3789e5d71f0..62601ac0a2a 100644 --- a/cms/static/cms/js/dist/3.3.0/bundle.toolbar.min.js +++ b/cms/static/cms/js/dist/3.3.0/bundle.toolbar.min.js @@ -2,7 +2,7 @@ image:!0})_.pseudos[C]=a(C);for(C in{submit:!0,reset:!0})_.pseudos[C]=l(C);return d.prototype=_.filters=_.pseudos,_.setFilters=new d,S=e.tokenize=function(t,i){var n,s,o,r,a,l,c,u=U[t+" "];if(u)return i?0:u.slice(0);for(a=t,l=[],c=_.preFilter;a;){(!n||(s=ct.exec(a)))&&(s&&(a=a.slice(s[0].length)||a),l.push(o=[])),n=!1,(s=ut.exec(a))&&(n=s.shift(),o.push({value:n,type:s[0].replace(lt," ")}),a=a.slice(n.length));for(r in _.filter)!(s=ft[r].exec(a))||c[r]&&!(s=c[r](s))||(n=s.shift(),o.push({value:n,type:r,matches:s}),a=a.slice(n.length));if(!n)break}return i?a.length:a?e.error(t):U(t,l).slice(0)},k=e.compile=function(t,e){var i,n=[],s=[],o=X[t+" "];if(!o){for(e||(e=S(t)),i=e.length;i--;)o=b(e[i]),o[z]?n.push(o):s.push(o);o=X(t,y(s,n)),o.selector=t}return o},E=e.select=function(t,e,i,n){var s,o,r,a,l,c="function"==typeof t&&t,d=!n&&S(t=c.selector||t);if(i=i||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(r=o[0]).type&&w.getById&&9===e.nodeType&&L&&_.relative[o[1].type]){if(e=(_.find.ID(r.matches[0].replace(wt,_t),e)||[])[0],!e)return i;c&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(s=ft.needsContext.test(t)?0:o.length;s--&&(r=o[s],!_.relative[a=r.type]);)if((l=_.find[a])&&(n=l(r.matches[0].replace(wt,_t),yt.test(o[0].type)&&u(e.parentNode)||e))){if(o.splice(s,1),t=n.length&&h(o),!t)return Q.apply(i,n),i;break}}return(c||k(t,d))(n,e,!L,i,yt.test(t)&&u(e.parentNode)||e),i},w.sortStable=z.split("").sort(Y).join("")===z,w.detectDuplicates=!!I,A(),w.sortDetached=s(function(t){return 1&t.compareDocumentPosition(N.createElement("div"))}),s(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,i){return i?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&s(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,i){return i||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),s(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,i){var n;return i?void 0:t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(o);ct.find=ft,ct.expr=ft.selectors,ct.expr[":"]=ct.expr.pseudos,ct.unique=ft.uniqueSort,ct.text=ft.getText,ct.isXMLDoc=ft.isXML,ct.contains=ft.contains;var mt=ct.expr.match.needsContext,gt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,vt=/^.[^:#\[\.,]*$/;ct.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?ct.find.matchesSelector(n,t)?[n]:[]:ct.find.matches(t,ct.grep(e,function(t){return 1===t.nodeType}))},ct.fn.extend({find:function(t){var e,i=[],n=this,s=n.length;if("string"!=typeof t)return this.pushStack(ct(t).filter(function(){for(e=0;s>e;e++)if(ct.contains(n[e],this))return!0}));for(e=0;s>e;e++)ct.find(t,n[e],i);return i=this.pushStack(s>1?ct.unique(i):i),i.selector=this.selector?this.selector+" "+t:t,i},filter:function(t){return this.pushStack(l(this,t||[],!1))},not:function(t){return this.pushStack(l(this,t||[],!0))},is:function(t){return!!l(this,"string"==typeof t&&mt.test(t)?ct(t):t||[],!1).length}});var bt,yt=o.document,Ct=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,wt=ct.fn.init=function(t,e){var i,n;if(!t)return this;if("string"==typeof t){if(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ct.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||bt).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof ct?e[0]:e,ct.merge(this,ct.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:yt,!0)),gt.test(i[1])&&ct.isPlainObject(e))for(i in e)ct.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}if(n=yt.getElementById(i[2]),n&&n.parentNode){if(n.id!==i[2])return bt.find(t);this.length=1,this[0]=n}return this.context=yt,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):ct.isFunction(t)?"undefined"!=typeof bt.ready?bt.ready(t):t(ct):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),ct.makeArray(t,this))};wt.prototype=ct.fn,bt=ct(yt);var _t=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};ct.extend({dir:function(t,e,i){for(var n=[],s=t[e];s&&9!==s.nodeType&&(void 0===i||1!==s.nodeType||!ct(s).is(i));)1===s.nodeType&&n.push(s),s=s[e];return n},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}}),ct.fn.extend({has:function(t){var e,i=ct(t,this),n=i.length;return this.filter(function(){for(e=0;n>e;e++)if(ct.contains(this,i[e]))return!0})},closest:function(t,e){for(var i,n=0,s=this.length,o=[],r=mt.test(t)||"string"!=typeof t?ct(t,e||this.context):0;s>n;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(r?r.index(i)>-1:1===i.nodeType&&ct.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?ct.unique(o):o)},index:function(t){return t?"string"==typeof t?ct.inArray(this[0],ct(t)):ct.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(ct.unique(ct.merge(this.get(),ct(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),ct.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ct.dir(t,"parentNode")},parentsUntil:function(t,e,i){return ct.dir(t,"parentNode",i)},next:function(t){return c(t,"nextSibling")},prev:function(t){return c(t,"previousSibling")},nextAll:function(t){return ct.dir(t,"nextSibling")},prevAll:function(t){return ct.dir(t,"previousSibling")},nextUntil:function(t,e,i){return ct.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return ct.dir(t,"previousSibling",i)},siblings:function(t){return ct.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return ct.sibling(t.firstChild)},contents:function(t){return ct.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:ct.merge([],t.childNodes)}},function(t,e){ct.fn[t]=function(i,n){var s=ct.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=ct.filter(n,s)),this.length>1&&(xt[t]||(s=ct.unique(s)),_t.test(t)&&(s=s.reverse())),this.pushStack(s)}});var Tt=/\S+/g,St={};ct.Callbacks=function(t){t="string"==typeof t?St[t]||u(t):ct.extend({},t);var e,i,n,s,o,r,a=[],l=!t.once&&[],c=function(u){for(i=t.memory&&u,n=!0,o=r||0,r=0,s=a.length,e=!0;a&&s>o;o++)if(a[o].apply(u[0],u[1])===!1&&t.stopOnFalse){i=!1;break}e=!1,a&&(l?l.length&&c(l.shift()):i?a=[]:d.disable())},d={add:function(){if(a){var n=a.length;!function o(e){ct.each(e,function(e,i){var n=ct.type(i);"function"===n?t.unique&&d.has(i)||a.push(i):i&&i.length&&"string"!==n&&o(i)})}(arguments),e?s=a.length:i&&(r=n,c(i))}return this},remove:function(){return a&&ct.each(arguments,function(t,i){for(var n;(n=ct.inArray(i,a,n))>-1;)a.splice(n,1),e&&(s>=n&&s--,o>=n&&o--)}),this},has:function(t){return t?ct.inArray(t,a)>-1:!(!a||!a.length)},empty:function(){return a=[],s=0,this},disable:function(){return a=l=i=void 0,this},disabled:function(){return!a},lock:function(){return l=void 0,i||d.disable(),this},locked:function(){return!l},fireWith:function(t,i){return!a||n&&!l||(i=i||[],i=[t,i.slice?i.slice():i],e?l.push(i):c(i)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},ct.extend({Deferred:function(t){var e=[["resolve","done",ct.Callbacks("once memory"),"resolved"],["reject","fail",ct.Callbacks("once memory"),"rejected"],["notify","progress",ct.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var t=arguments;return ct.Deferred(function(i){ct.each(e,function(e,o){var r=ct.isFunction(t[e])&&t[e];s[o[1]](function(){var t=r&&r.apply(this,arguments);t&&ct.isFunction(t.promise)?t.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[o[0]+"With"](this===n?i.promise():this,r?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?ct.extend(t,n):n}},s={};return n.pipe=n.then,ct.each(e,function(t,o){var r=o[2],a=o[3];n[o[1]]=r.add,a&&r.add(function(){i=a},e[1^t][2].disable,e[2][2].lock),s[o[0]]=function(){return s[o[0]+"With"](this===s?n:this,arguments),this},s[o[0]+"With"]=r.fireWith}),n.promise(s),t&&t.call(s,s),s},when:function(t){var e,i,n,s=0,o=tt.call(arguments),r=o.length,a=1!==r||t&&ct.isFunction(t.promise)?r:0,l=1===a?t:ct.Deferred(),c=function(t,i,n){return function(s){i[t]=this,n[t]=arguments.length>1?tt.call(arguments):s,n===e?l.notifyWith(i,n):--a||l.resolveWith(i,n)}};if(r>1)for(e=new Array(r),i=new Array(r),n=new Array(r);r>s;s++)o[s]&&ct.isFunction(o[s].promise)?o[s].promise().done(c(s,n,o)).fail(l.reject).progress(c(s,i,e)):--a;return a||l.resolveWith(n,o),l.promise()}});var kt;ct.fn.ready=function(t){return ct.ready.promise().done(t),this},ct.extend({isReady:!1,readyWait:1,holdReady:function(t){t?ct.readyWait++:ct.ready(!0)},ready:function(t){if(t===!0?!--ct.readyWait:!ct.isReady){if(!yt.body)return setTimeout(ct.ready);ct.isReady=!0,t!==!0&&--ct.readyWait>0||(kt.resolveWith(yt,[ct]),ct.fn.triggerHandler&&(ct(yt).triggerHandler("ready"),ct(yt).off("ready")))}}}),ct.ready.promise=function(t){if(!kt)if(kt=ct.Deferred(),"complete"===yt.readyState)setTimeout(ct.ready);else if(yt.addEventListener)yt.addEventListener("DOMContentLoaded",h,!1),o.addEventListener("load",h,!1);else{yt.attachEvent("onreadystatechange",h),o.attachEvent("onload",h);var e=!1;try{e=null==o.frameElement&&yt.documentElement}catch(i){}e&&e.doScroll&&!function n(){if(!ct.isReady){try{e.doScroll("left")}catch(t){return setTimeout(n,50)}d(),ct.ready()}}()}return kt.promise(t)};var Et,Pt="undefined";for(Et in ct(at))break;at.ownLast="0"!==Et,at.inlineBlockNeedsLayout=!1,ct(function(){var t,e,i,n;i=yt.getElementsByTagName("body")[0],i&&i.style&&(e=yt.createElement("div"),n=yt.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),typeof e.style.zoom!==Pt&&(e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",at.inlineBlockNeedsLayout=t=3===e.offsetWidth,t&&(i.style.zoom=1)),i.removeChild(n))}),function(){var t=yt.createElement("div");if(null==at.deleteExpando){at.deleteExpando=!0;try{delete t.test}catch(e){at.deleteExpando=!1}}t=null}(),ct.acceptData=function(t){var e=ct.noData[(t.nodeName+" ").toLowerCase()],i=+t.nodeType||1;return 1!==i&&9!==i?!1:!e||e!==!0&&t.getAttribute("classid")===e};var Mt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,It=/([A-Z])/g;ct.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){return t=t.nodeType?ct.cache[t[ct.expando]]:t[ct.expando],!!t&&!f(t)},data:function(t,e,i){return m(t,e,i)},removeData:function(t,e){return g(t,e)},_data:function(t,e,i){return m(t,e,i,!0)},_removeData:function(t,e){return g(t,e,!0)}}),ct.fn.extend({data:function(t,e){var i,n,s,o=this[0],r=o&&o.attributes;if(void 0===t){if(this.length&&(s=ct.data(o),1===o.nodeType&&!ct._data(o,"parsedAttrs"))){for(i=r.length;i--;)r[i]&&(n=r[i].name,0===n.indexOf("data-")&&(n=ct.camelCase(n.slice(5)),p(o,n,s[n])));ct._data(o,"parsedAttrs",!0)}return s}return"object"==typeof t?this.each(function(){ct.data(this,t)}):arguments.length>1?this.each(function(){ct.data(this,t,e)}):o?p(o,t,ct.data(o,t)):void 0},removeData:function(t){return this.each(function(){ct.removeData(this,t)})}}),ct.extend({queue:function(t,e,i){var n;return t?(e=(e||"fx")+"queue",n=ct._data(t,e),i&&(!n||ct.isArray(i)?n=ct._data(t,e,ct.makeArray(i)):n.push(i)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var i=ct.queue(t,e),n=i.length,s=i.shift(),o=ct._queueHooks(t,e),r=function(){ct.dequeue(t,e)};"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===e&&i.unshift("inprogress"),delete o.stop,s.call(t,r,o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return ct._data(t,i)||ct._data(t,i,{empty:ct.Callbacks("once memory").add(function(){ct._removeData(t,e+"queue"),ct._removeData(t,i)})})}}),ct.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.lengtha;a++)e(t[a],i,r?n:n.call(t[a],a,e(t[a],i)));return s?t:c?e.call(t):l?e(t[0],i):o},Ot=/^(?:checkbox|radio)$/i;!function(){var t=yt.createElement("input"),e=yt.createElement("div"),i=yt.createDocumentFragment();if(e.innerHTML="
a",at.leadingWhitespace=3===e.firstChild.nodeType,at.tbody=!e.getElementsByTagName("tbody").length,at.htmlSerialize=!!e.getElementsByTagName("link").length,at.html5Clone="<:nav>"!==yt.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),at.appendChecked=t.checked,e.innerHTML="",at.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,i.appendChild(e),e.innerHTML="",at.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,at.noCloneEvent=!0,e.attachEvent&&(e.attachEvent("onclick",function(){at.noCloneEvent=!1}),e.cloneNode(!0).click()),null==at.deleteExpando){at.deleteExpando=!0;try{delete e.test}catch(n){at.deleteExpando=!1}}}(),function(){var t,e,i=yt.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})e="on"+t,(at[t+"Bubbles"]=e in o)||(i.setAttribute(e,"t"),at[t+"Bubbles"]=i.attributes[e].expando===!1);i=null}();var Ht=/^(?:input|select|textarea)$/i,jt=/^key/,Rt=/^(?:mouse|pointer|contextmenu)|click/,zt=/^(?:focusinfocus|focusoutblur)$/,Wt=/^([^.]*)(?:\.(.+)|)$/;ct.event={global:{},add:function(t,e,i,n,s){var o,r,a,l,c,u,d,h,p,f,m,g=ct._data(t);if(g){for(i.handler&&(l=i,i=l.handler,s=l.selector),i.guid||(i.guid=ct.guid++),(r=g.events)||(r=g.events={}),(u=g.handle)||(u=g.handle=function(t){return typeof ct===Pt||t&&ct.event.triggered===t.type?void 0:ct.event.dispatch.apply(u.elem,arguments)},u.elem=t),e=(e||"").match(Tt)||[""],a=e.length;a--;)o=Wt.exec(e[a])||[],p=m=o[1],f=(o[2]||"").split(".").sort(),p&&(c=ct.event.special[p]||{},p=(s?c.delegateType:c.bindType)||p,c=ct.event.special[p]||{},d=ct.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&ct.expr.match.needsContext.test(s),namespace:f.join(".")},l),(h=r[p])||(h=r[p]=[],h.delegateCount=0,c.setup&&c.setup.call(t,n,f,u)!==!1||(t.addEventListener?t.addEventListener(p,u,!1):t.attachEvent&&t.attachEvent("on"+p,u))),c.add&&(c.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),s?h.splice(h.delegateCount++,0,d):h.push(d),ct.event.global[p]=!0);t=null}},remove:function(t,e,i,n,s){var o,r,a,l,c,u,d,h,p,f,m,g=ct.hasData(t)&&ct._data(t);if(g&&(u=g.events)){for(e=(e||"").match(Tt)||[""],c=e.length;c--;)if(a=Wt.exec(e[c])||[],p=m=a[1],f=(a[2]||"").split(".").sort(),p){for(d=ct.event.special[p]||{},p=(n?d.delegateType:d.bindType)||p,h=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=h.length;o--;)r=h[o],!s&&m!==r.origType||i&&i.guid!==r.guid||a&&!a.test(r.namespace)||n&&n!==r.selector&&("**"!==n||!r.selector)||(h.splice(o,1),r.selector&&h.delegateCount--,d.remove&&d.remove.call(t,r));l&&!h.length&&(d.teardown&&d.teardown.call(t,f,g.handle)!==!1||ct.removeEvent(t,p,g.handle),delete u[p])}else for(p in u)ct.event.remove(t,p+e[c],i,n,!0);ct.isEmptyObject(u)&&(delete g.handle,ct._removeData(t,"events"))}},trigger:function(t,e,i,n){var s,r,a,l,c,u,d,h=[i||yt],p=rt.call(t,"type")?t.type:t,f=rt.call(t,"namespace")?t.namespace.split("."):[];if(a=u=i=i||yt,3!==i.nodeType&&8!==i.nodeType&&!zt.test(p+ct.event.triggered)&&(p.indexOf(".")>=0&&(f=p.split("."),p=f.shift(),f.sort()),r=p.indexOf(":")<0&&"on"+p,t=t[ct.expando]?t:new ct.Event(p,"object"==typeof t&&t),t.isTrigger=n?2:3,t.namespace=f.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:ct.makeArray(e,[t]),c=ct.event.special[p]||{},n||!c.trigger||c.trigger.apply(i,e)!==!1)){if(!n&&!c.noBubble&&!ct.isWindow(i)){for(l=c.delegateType||p,zt.test(l+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(i.ownerDocument||yt)&&h.push(u.defaultView||u.parentWindow||o)}for(d=0;(a=h[d++])&&!t.isPropagationStopped();)t.type=d>1?l:c.bindType||p,s=(ct._data(a,"events")||{})[t.type]&&ct._data(a,"handle"),s&&s.apply(a,e),s=r&&a[r],s&&s.apply&&ct.acceptData(a)&&(t.result=s.apply(a,e),t.result===!1&&t.preventDefault());if(t.type=p,!n&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(h.pop(),e)===!1)&&ct.acceptData(i)&&r&&i[p]&&!ct.isWindow(i)){u=i[r],u&&(i[r]=null),ct.event.triggered=p;try{i[p]()}catch(m){}ct.event.triggered=void 0,u&&(i[r]=u)}return t.result}},dispatch:function(t){t=ct.event.fix(t);var e,i,n,s,o,r=[],a=tt.call(arguments),l=(ct._data(this,"events")||{})[t.type]||[],c=ct.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,t)!==!1){for(r=ct.event.handlers.call(this,t,l),e=0;(s=r[e++])&&!t.isPropagationStopped();)for(t.currentTarget=s.elem,o=0;(n=s.handlers[o++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(n.namespace))&&(t.handleObj=n,t.data=n.data,i=((ct.event.special[n.origType]||{}).handle||n.handler).apply(s.elem,a),void 0!==i&&(t.result=i)===!1&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,s,o,r=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==t.type)){for(s=[],o=0;a>o;o++)n=e[o],i=n.selector+" ",void 0===s[i]&&(s[i]=n.needsContext?ct(i,this).index(l)>=0:ct.find(i,this,null,[l]).length),s[i]&&s.push(n);s.length&&r.push({elem:l,handlers:s})}return a]","i"),Ut=/^\s+/,Xt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Yt=/<([\w:]+)/,$t=/\s*$/g,te={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:at.htmlSerialize?[0,"",""]:[1,"X
","
"]},ee=C(yt),ie=ee.appendChild(yt.createElement("div"));te.optgroup=te.option,te.tbody=te.tfoot=te.colgroup=te.caption=te.thead,te.th=te.td,ct.extend({clone:function(t,e,i){var n,s,o,r,a,l=ct.contains(t.ownerDocument,t);if(at.html5Clone||ct.isXMLDoc(t)||!qt.test("<"+t.nodeName+">")?o=t.cloneNode(!0):(ie.innerHTML=t.outerHTML,ie.removeChild(o=ie.firstChild)),!(at.noCloneEvent&&at.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ct.isXMLDoc(t)))for(n=w(o),a=w(t),r=0;null!=(s=a[r]);++r)n[r]&&P(s,n[r]);if(e)if(i)for(a=a||w(t),n=n||w(o),r=0;null!=(s=a[r]);r++)E(s,n[r]);else E(t,o);return n=w(o,"script"),n.length>0&&k(n,!l&&w(t,"script")),n=a=s=null,o},buildFragment:function(t,e,i,n){for(var s,o,r,a,l,c,u,d=t.length,h=C(e),p=[],f=0;d>f;f++)if(o=t[f],o||0===o)if("object"===ct.type(o))ct.merge(p,o.nodeType?[o]:o);else if(Vt.test(o)){for(a=a||h.appendChild(e.createElement("div")),l=(Yt.exec(o)||["",""])[1].toLowerCase(),u=te[l]||te._default,a.innerHTML=u[1]+o.replace(Xt,"<$1>")+u[2],s=u[0];s--;)a=a.lastChild;if(!at.leadingWhitespace&&Ut.test(o)&&p.push(e.createTextNode(Ut.exec(o)[0])),!at.tbody)for(o="table"!==l||$t.test(o)?""!==u[1]||$t.test(o)?0:a:a.firstChild,s=o&&o.childNodes.length;s--;)ct.nodeName(c=o.childNodes[s],"tbody")&&!c.childNodes.length&&o.removeChild(c);for(ct.merge(p,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=h.lastChild}else p.push(e.createTextNode(o));for(a&&h.removeChild(a),at.appendChecked||ct.grep(w(p,"input"),_),f=0;o=p[f++];)if((!n||-1===ct.inArray(o,n))&&(r=ct.contains(o.ownerDocument,o),a=w(h.appendChild(o),"script"),r&&k(a),i))for(s=0;o=a[s++];)Jt.test(o.type||"")&&i.push(o);return a=null,h},cleanData:function(t,e){for(var i,n,s,o,r=0,a=ct.expando,l=ct.cache,c=at.deleteExpando,u=ct.event.special;null!=(i=t[r]);r++)if((e||ct.acceptData(i))&&(s=i[a],o=s&&l[s])){if(o.events)for(n in o.events)u[n]?ct.event.remove(i,n):ct.removeEvent(i,n,o.handle);l[s]&&(delete l[s],c?delete i[a]:typeof i.removeAttribute!==Pt?i.removeAttribute(a):i[a]=null,Z.push(s))}}}),ct.fn.extend({text:function(t){return Lt(this,function(t){return void 0===t?ct.text(this):this.empty().append((this[0]&&this[0].ownerDocument||yt).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=x(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=x(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var i,n=t?ct.filter(t,this):this,s=0;null!=(i=n[s]);s++)e||1!==i.nodeType||ct.cleanData(w(i)),i.parentNode&&(e&&ct.contains(i.ownerDocument,i)&&k(w(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&ct.cleanData(w(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&ct.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return ct.clone(this,t,e)})},html:function(t){return Lt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Ft,""):void 0;if(!("string"!=typeof t||Kt.test(t)||!at.htmlSerialize&&qt.test(t)||!at.leadingWhitespace&&Ut.test(t)||te[(Yt.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(Xt,"<$1>");try{for(;n>i;i++)e=this[i]||{},1===e.nodeType&&(ct.cleanData(w(e,!1)),e.innerHTML=t);e=0}catch(s){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,ct.cleanData(w(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=et.apply([],t);var i,n,s,o,r,a,l=0,c=this.length,u=this,d=c-1,h=t[0],p=ct.isFunction(h);if(p||c>1&&"string"==typeof h&&!at.checkClone&&Gt.test(h))return this.each(function(i){var n=u.eq(i);p&&(t[0]=h.call(this,i,n.html())),n.domManip(t,e)});if(c&&(a=ct.buildFragment(t,this[0].ownerDocument,!1,this),i=a.firstChild,1===a.childNodes.length&&(a=i),i)){for(o=ct.map(w(a,"script"),T),s=o.length;c>l;l++)n=a,l!==d&&(n=ct.clone(n,!0,!0),s&&ct.merge(o,w(n,"script"))),e.call(this[l],n,l);if(s)for(r=o[o.length-1].ownerDocument,ct.map(o,S),l=0;s>l;l++)n=o[l],Jt.test(n.type||"")&&!ct._data(n,"globalEval")&&ct.contains(r,n)&&(n.src?ct._evalUrl&&ct._evalUrl(n.src):ct.globalEval((n.text||n.textContent||n.innerHTML||"").replace(Zt,"")));a=i=null}return this}}),ct.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){ct.fn[t]=function(t){for(var i,n=0,s=[],o=ct(t),r=o.length-1;r>=n;n++)i=n===r?this:this.clone(!0),ct(o[n])[e](i),it.apply(s,i.get());return this.pushStack(s)}});var ne,se={};!function(){var t;at.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,i,n;return i=yt.getElementsByTagName("body")[0],i&&i.style?(e=yt.createElement("div"),n=yt.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),typeof e.style.zoom!==Pt&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(yt.createElement("div")).style.width="5px",t=3!==e.offsetWidth), i.removeChild(n),t):void 0}}();var oe,re,ae=/^margin/,le=new RegExp("^("+At+")(?!px)[a-z%]+$","i"),ce=/^(top|right|bottom|left)$/;o.getComputedStyle?(oe=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):o.getComputedStyle(t,null)},re=function(t,e,i){var n,s,o,r,a=t.style;return i=i||oe(t),r=i?i.getPropertyValue(e)||i[e]:void 0,i&&(""!==r||ct.contains(t.ownerDocument,t)||(r=ct.style(t,e)),le.test(r)&&ae.test(e)&&(n=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=i.width,a.width=n,a.minWidth=s,a.maxWidth=o)),void 0===r?r:r+""}):yt.documentElement.currentStyle&&(oe=function(t){return t.currentStyle},re=function(t,e,i){var n,s,o,r,a=t.style;return i=i||oe(t),r=i?i[e]:void 0,null==r&&a&&a[e]&&(r=a[e]),le.test(r)&&!ce.test(e)&&(n=a.left,s=t.runtimeStyle,o=s&&s.left,o&&(s.left=t.currentStyle.left),a.left="fontSize"===e?"1em":r,r=a.pixelLeft+"px",a.left=n,o&&(s.left=o)),void 0===r?r:r+""||"auto"}),!function(){function t(){var t,e,i,n;e=yt.getElementsByTagName("body")[0],e&&e.style&&(t=yt.createElement("div"),i=yt.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",e.appendChild(i).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",s=r=!1,l=!0,o.getComputedStyle&&(s="1%"!==(o.getComputedStyle(t,null)||{}).top,r="4px"===(o.getComputedStyle(t,null)||{width:"4px"}).width,n=t.appendChild(yt.createElement("div")),n.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",t.style.width="1px",l=!parseFloat((o.getComputedStyle(n,null)||{}).marginRight),t.removeChild(n)),t.innerHTML="
t
",n=t.getElementsByTagName("td"),n[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===n[0].offsetHeight,a&&(n[0].style.display="",n[1].style.display="none",a=0===n[0].offsetHeight),e.removeChild(i))}var e,i,n,s,r,a,l;e=yt.createElement("div"),e.innerHTML="
a",n=e.getElementsByTagName("a")[0],(i=n&&n.style)&&(i.cssText="float:left;opacity:.5",at.opacity="0.5"===i.opacity,at.cssFloat=!!i.cssFloat,e.style.backgroundClip="content-box",e.cloneNode(!0).style.backgroundClip="",at.clearCloneStyle="content-box"===e.style.backgroundClip,at.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,ct.extend(at,{reliableHiddenOffsets:function(){return null==a&&t(),a},boxSizingReliable:function(){return null==r&&t(),r},pixelPosition:function(){return null==s&&t(),s},reliableMarginRight:function(){return null==l&&t(),l}}))}(),ct.swap=function(t,e,i,n){var s,o,r={};for(o in e)r[o]=t.style[o],t.style[o]=e[o];s=i.apply(t,n||[]);for(o in e)t.style[o]=r[o];return s};var ue=/alpha\([^)]*\)/i,de=/opacity\s*=\s*([^)]*)/,he=/^(none|table(?!-c[ea]).+)/,pe=new RegExp("^("+At+")(.*)$","i"),fe=new RegExp("^([+-])=("+At+")","i"),me={position:"absolute",visibility:"hidden",display:"block"},ge={letterSpacing:"0",fontWeight:"400"},ve=["Webkit","O","Moz","ms"];ct.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=re(t,"opacity");return""===i?"1":i}}}},cssNumber:{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":at.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,o,r,a=ct.camelCase(e),l=t.style;if(e=ct.cssProps[a]||(ct.cssProps[a]=N(l,a)),r=ct.cssHooks[e]||ct.cssHooks[a],void 0===i)return r&&"get"in r&&void 0!==(s=r.get(t,!1,n))?s:l[e];if(o=typeof i,"string"===o&&(s=fe.exec(i))&&(i=(s[1]+1)*s[2]+parseFloat(ct.css(t,e)),o="number"),null!=i&&i===i&&("number"!==o||ct.cssNumber[a]||(i+="px"),at.clearCloneStyle||""!==i||0!==e.indexOf("background")||(l[e]="inherit"),!(r&&"set"in r&&void 0===(i=r.set(t,i,n)))))try{l[e]=i}catch(c){}}},css:function(t,e,i,n){var s,o,r,a=ct.camelCase(e);return e=ct.cssProps[a]||(ct.cssProps[a]=N(t.style,a)),r=ct.cssHooks[e]||ct.cssHooks[a],r&&"get"in r&&(o=r.get(t,!0,i)),void 0===o&&(o=re(t,e,n)),"normal"===o&&e in ge&&(o=ge[e]),""===i||i?(s=parseFloat(o),i===!0||ct.isNumeric(s)?s||0:o):o}}),ct.each(["height","width"],function(t,e){ct.cssHooks[e]={get:function(t,i,n){return i?he.test(ct.css(t,"display"))&&0===t.offsetWidth?ct.swap(t,me,function(){return H(t,e,n)}):H(t,e,n):void 0},set:function(t,i,n){var s=n&&oe(t);return L(t,i,n?O(t,e,n,at.boxSizing&&"border-box"===ct.css(t,"boxSizing",!1,s),s):0)}}}),at.opacity||(ct.cssHooks.opacity={get:function(t,e){return de.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var i=t.style,n=t.currentStyle,s=ct.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=n&&n.filter||i.filter||"";i.zoom=1,(e>=1||""===e)&&""===ct.trim(o.replace(ue,""))&&i.removeAttribute&&(i.removeAttribute("filter"),""===e||n&&!n.filter)||(i.filter=ue.test(o)?o.replace(ue,s):o+" "+s)}}),ct.cssHooks.marginRight=A(at.reliableMarginRight,function(t,e){return e?ct.swap(t,{display:"inline-block"},re,[t,"marginRight"]):void 0}),ct.each({margin:"",padding:"",border:"Width"},function(t,e){ct.cssHooks[t+e]={expand:function(i){for(var n=0,s={},o="string"==typeof i?i.split(" "):[i];4>n;n++)s[t+Nt[n]+e]=o[n]||o[n-2]||o[0];return s}},ae.test(t)||(ct.cssHooks[t+e].set=L)}),ct.fn.extend({css:function(t,e){return Lt(this,function(t,e,i){var n,s,o={},r=0;if(ct.isArray(e)){for(n=oe(t),s=e.length;s>r;r++)o[e[r]]=ct.css(t,e[r],!1,n);return o}return void 0!==i?ct.style(t,e,i):ct.css(t,e)},t,e,arguments.length>1)},show:function(){return D(this,!0)},hide:function(){return D(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Dt(this)?ct(this).show():ct(this).hide()})}}),ct.Tween=j,j.prototype={constructor:j,init:function(t,e,i,n,s,o){this.elem=t,this.prop=i,this.easing=s||"swing",this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(ct.cssNumber[i]?"":"px")},cur:function(){var t=j.propHooks[this.prop];return t&&t.get?t.get(this):j.propHooks._default.get(this)},run:function(t){var e,i=j.propHooks[this.prop];return this.options.duration?this.pos=e=ct.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):j.propHooks._default.set(this),this}},j.prototype.init.prototype=j.prototype,j.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=ct.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){ct.fx.step[t.prop]?ct.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[ct.cssProps[t.prop]]||ct.cssHooks[t.prop])?ct.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},j.propHooks.scrollTop=j.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ct.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},ct.fx=j.prototype.init,ct.fx.step={};var be,ye,Ce=/^(?:toggle|show|hide)$/,we=new RegExp("^(?:([+-])=|)("+At+")([a-z%]*)$","i"),_e=/queueHooks$/,xe=[B],Te={"*":[function(t,e){var i=this.createTween(t,e),n=i.cur(),s=we.exec(e),o=s&&s[3]||(ct.cssNumber[t]?"":"px"),r=(ct.cssNumber[t]||"px"!==o&&+n)&&we.exec(ct.css(i.elem,t)),a=1,l=20;if(r&&r[3]!==o){o=o||r[3],s=s||[],r=+n||1;do a=a||".5",r/=a,ct.style(i.elem,t,r+o);while(a!==(a=i.cur()/n)&&1!==a&&--l)}return s&&(r=i.start=+r||+n||0,i.unit=o,i.end=s[1]?r+(s[1]+1)*s[2]:+s[2]),i}]};ct.Animation=ct.extend(q,{tweener:function(t,e){ct.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var i,n=0,s=t.length;s>n;n++)i=t[n],Te[i]=Te[i]||[],Te[i].unshift(e)},prefilter:function(t,e){e?xe.unshift(t):xe.push(t)}}),ct.speed=function(t,e,i){var n=t&&"object"==typeof t?ct.extend({},t):{complete:i||!i&&e||ct.isFunction(t)&&t,duration:t,easing:i&&e||e&&!ct.isFunction(e)&&e};return n.duration=ct.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in ct.fx.speeds?ct.fx.speeds[n.duration]:ct.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){ct.isFunction(n.old)&&n.old.call(this),n.queue&&ct.dequeue(this,n.queue)},n},ct.fn.extend({fadeTo:function(t,e,i,n){return this.filter(Dt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var s=ct.isEmptyObject(t),o=ct.speed(e,i,n),r=function(){var e=q(this,ct.extend({},t),o);(s||ct._data(this,"finish"))&&e.stop(!0)};return r.finish=r,s||o.queue===!1?this.each(r):this.queue(o.queue,r)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,s=null!=t&&t+"queueHooks",o=ct.timers,r=ct._data(this);if(s)r[s]&&r[s].stop&&n(r[s]);else for(s in r)r[s]&&r[s].stop&&_e.test(s)&&n(r[s]);for(s=o.length;s--;)o[s].elem!==this||null!=t&&o[s].queue!==t||(o[s].anim.stop(i),e=!1,o.splice(s,1));(e||!i)&&ct.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,i=ct._data(this),n=i[t+"queue"],s=i[t+"queueHooks"],o=ct.timers,r=n?n.length:0;for(i.finish=!0,ct.queue(this,t,[]),s&&s.stop&&s.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;r>e;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),ct.each(["toggle","show","hide"],function(t,e){var i=ct.fn[e];ct.fn[e]=function(t,n,s){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(z(e,!0),t,n,s)}}),ct.each({slideDown:z("show"),slideUp:z("hide"),slideToggle:z("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){ct.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),ct.timers=[],ct.fx.tick=function(){var t,e=ct.timers,i=0;for(be=ct.now();i
a",n=e.getElementsByTagName("a")[0],i=yt.createElement("select"),s=i.appendChild(yt.createElement("option")),t=e.getElementsByTagName("input")[0],n.style.cssText="top:1px",at.getSetAttribute="t"!==e.className,at.style=/top/.test(n.getAttribute("style")),at.hrefNormalized="/a"===n.getAttribute("href"),at.checkOn=!!t.value,at.optSelected=s.selected,at.enctype=!!yt.createElement("form").enctype,i.disabled=!0,at.optDisabled=!s.disabled,t=yt.createElement("input"),t.setAttribute("value",""),at.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),at.radioValue="t"===t.value}();var Se=/\r/g;ct.fn.extend({val:function(t){var e,i,n,s=this[0];return arguments.length?(n=ct.isFunction(t),this.each(function(i){var s;1===this.nodeType&&(s=n?t.call(this,i,ct(this).val()):t,null==s?s="":"number"==typeof s?s+="":ct.isArray(s)&&(s=ct.map(s,function(t){return null==t?"":t+""})),e=ct.valHooks[this.type]||ct.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))})):s?(e=ct.valHooks[s.type]||ct.valHooks[s.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(i=e.get(s,"value"))?i:(i=s.value,"string"==typeof i?i.replace(Se,""):null==i?"":i)):void 0}}),ct.extend({valHooks:{option:{get:function(t){var e=ct.find.attr(t,"value");return null!=e?e:ct.trim(ct.text(t))}},select:{get:function(t){for(var e,i,n=t.options,s=t.selectedIndex,o="select-one"===t.type||0>s,r=o?null:[],a=o?s+1:n.length,l=0>s?a:o?s:0;a>l;l++)if(i=n[l],!(!i.selected&&l!==s||(at.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&ct.nodeName(i.parentNode,"optgroup"))){if(e=ct(i).val(),o)return e;r.push(e)}return r},set:function(t,e){for(var i,n,s=t.options,o=ct.makeArray(e),r=s.length;r--;)if(n=s[r],ct.inArray(ct.valHooks.option.get(n),o)>=0)try{n.selected=i=!0}catch(a){n.scrollHeight}else n.selected=!1;return i||(t.selectedIndex=-1),s}}}}),ct.each(["radio","checkbox"],function(){ct.valHooks[this]={set:function(t,e){return ct.isArray(e)?t.checked=ct.inArray(ct(t).val(),e)>=0:void 0}},at.checkOn||(ct.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ke,Ee,Pe=ct.expr.attrHandle,Me=/^(?:checked|selected)$/i,Ie=at.getSetAttribute,Ae=at.input;ct.fn.extend({attr:function(t,e){return Lt(this,ct.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){ct.removeAttr(this,t)})}}),ct.extend({attr:function(t,e,i){var n,s,o=t.nodeType;return t&&3!==o&&8!==o&&2!==o?typeof t.getAttribute===Pt?ct.prop(t,e,i):(1===o&&ct.isXMLDoc(t)||(e=e.toLowerCase(),n=ct.attrHooks[e]||(ct.expr.match.bool.test(e)?Ee:ke)),void 0===i?n&&"get"in n&&null!==(s=n.get(t,e))?s:(s=ct.find.attr(t,e),null==s?void 0:s):null!==i?n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:(t.setAttribute(e,i+""),i):void ct.removeAttr(t,e)):void 0},removeAttr:function(t,e){var i,n,s=0,o=e&&e.match(Tt);if(o&&1===t.nodeType)for(;i=o[s++];)n=ct.propFix[i]||i,ct.expr.match.bool.test(i)?Ae&&Ie||!Me.test(i)?t[n]=!1:t[ct.camelCase("default-"+i)]=t[n]=!1:ct.attr(t,i,""),t.removeAttribute(Ie?i:n)},attrHooks:{type:{set:function(t,e){if(!at.radioValue&&"radio"===e&&ct.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}}}),Ee={set:function(t,e,i){return e===!1?ct.removeAttr(t,i):Ae&&Ie||!Me.test(i)?t.setAttribute(!Ie&&ct.propFix[i]||i,i):t[ct.camelCase("default-"+i)]=t[i]=!0,i}},ct.each(ct.expr.match.bool.source.match(/\w+/g),function(t,e){var i=Pe[e]||ct.find.attr;Pe[e]=Ae&&Ie||!Me.test(e)?function(t,e,n){var s,o;return n||(o=Pe[e],Pe[e]=s,s=null!=i(t,e,n)?e.toLowerCase():null,Pe[e]=o),s}:function(t,e,i){return i?void 0:t[ct.camelCase("default-"+e)]?e.toLowerCase():null}}),Ae&&Ie||(ct.attrHooks.value={set:function(t,e,i){return ct.nodeName(t,"input")?void(t.defaultValue=e):ke&&ke.set(t,e,i)}}),Ie||(ke={set:function(t,e,i){var n=t.getAttributeNode(i);return n||t.setAttributeNode(n=t.ownerDocument.createAttribute(i)),n.value=e+="","value"===i||e===t.getAttribute(i)?e:void 0}},Pe.id=Pe.name=Pe.coords=function(t,e,i){var n;return i?void 0:(n=t.getAttributeNode(e))&&""!==n.value?n.value:null},ct.valHooks.button={get:function(t,e){var i=t.getAttributeNode(e);return i&&i.specified?i.value:void 0},set:ke.set},ct.attrHooks.contenteditable={set:function(t,e,i){ke.set(t,""===e?!1:e,i)}},ct.each(["width","height"],function(t,e){ct.attrHooks[e]={set:function(t,i){return""===i?(t.setAttribute(e,"auto"),i):void 0}}})),at.style||(ct.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Ne=/^(?:input|select|textarea|button|object)$/i,De=/^(?:a|area)$/i;ct.fn.extend({prop:function(t,e){return Lt(this,ct.prop,t,e,arguments.length>1)},removeProp:function(t){return t=ct.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(e){}})}}),ct.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,i){var n,s,o,r=t.nodeType;return t&&3!==r&&8!==r&&2!==r?(o=1!==r||!ct.isXMLDoc(t),o&&(e=ct.propFix[e]||e,s=ct.propHooks[e]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:t[e]=i:s&&"get"in s&&null!==(n=s.get(t,e))?n:t[e]):void 0},propHooks:{tabIndex:{get:function(t){var e=ct.find.attr(t,"tabindex");return e?parseInt(e,10):Ne.test(t.nodeName)||De.test(t.nodeName)&&t.href?0:-1}}}}),at.hrefNormalized||ct.each(["href","src"],function(t,e){ct.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}}),at.optSelected||(ct.propHooks.selected={get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}}),ct.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ct.propFix[this.toLowerCase()]=this}),at.enctype||(ct.propFix.enctype="encoding");var Le=/[\t\r\n\f]/g;ct.fn.extend({addClass:function(t){var e,i,n,s,o,r,a=0,l=this.length,c="string"==typeof t&&t;if(ct.isFunction(t))return this.each(function(e){ct(this).addClass(t.call(this,e,this.className))});if(c)for(e=(t||"").match(Tt)||[];l>a;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(Le," "):" ")){for(o=0;s=e[o++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r=ct.trim(n),i.className!==r&&(i.className=r)}return this},removeClass:function(t){var e,i,n,s,o,r,a=0,l=this.length,c=0===arguments.length||"string"==typeof t&&t;if(ct.isFunction(t))return this.each(function(e){ct(this).removeClass(t.call(this,e,this.className))});if(c)for(e=(t||"").match(Tt)||[];l>a;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(Le," "):"")){for(o=0;s=e[o++];)for(;n.indexOf(" "+s+" ")>=0;)n=n.replace(" "+s+" "," ");r=t?ct.trim(n):"",i.className!==r&&(i.className=r)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):this.each(ct.isFunction(t)?function(i){ct(this).toggleClass(t.call(this,i,this.className,e),e)}:function(){if("string"===i)for(var e,n=0,s=ct(this),o=t.match(Tt)||[];e=o[n++];)s.hasClass(e)?s.removeClass(e):s.addClass(e);else(i===Pt||"boolean"===i)&&(this.className&&ct._data(this,"__className__",this.className),this.className=this.className||t===!1?"":ct._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",i=0,n=this.length;n>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(Le," ").indexOf(e)>=0)return!0;return!1}}),ct.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(t,e){ct.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),ct.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}});var Oe=ct.now(),He=/\?/,je=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ct.parseJSON=function(t){if(o.JSON&&o.JSON.parse)return o.JSON.parse(t+"");var e,i=null,n=ct.trim(t+"");return n&&!ct.trim(n.replace(je,function(t,n,s,o){return e&&n&&(i=0),0===i?t:(e=s||n,i+=!o-!s,"")}))?Function("return "+n)():ct.error("Invalid JSON: "+t)},ct.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{o.DOMParser?(i=new DOMParser,e=i.parseFromString(t,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(t))}catch(n){e=void 0}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||ct.error("Invalid XML: "+t),e};var Re,ze,We=/#.*$/,Be=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,qe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ue=/^(?:GET|HEAD)$/,Xe=/^\/\//,Ye=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,$e={},Ve={},Ke="*/".concat("*");try{ze=location.href}catch(Ge){ze=yt.createElement("a"),ze.href="",ze=ze.href}Re=Ye.exec(ze.toLowerCase())||[],ct.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ze,type:"GET",isLocal:qe.test(Re[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ke,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ct.parseJSON,"text xml":ct.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Y(Y(t,ct.ajaxSettings),e):Y(ct.ajaxSettings,t)},ajaxPrefilter:U($e),ajaxTransport:U(Ve),ajax:function(t,e){function i(t,e,i,n){var s,u,v,b,C,_=e;2!==y&&(y=2,a&&clearTimeout(a),c=void 0,r=n||"",w.readyState=t>0?4:0,s=t>=200&&300>t||304===t,i&&(b=$(d,w,i)),b=V(d,b,w,s),s?(d.ifModified&&(C=w.getResponseHeader("Last-Modified"),C&&(ct.lastModified[o]=C),C=w.getResponseHeader("etag"),C&&(ct.etag[o]=C)),204===t||"HEAD"===d.type?_="nocontent":304===t?_="notmodified":(_=b.state,u=b.data,v=b.error,s=!v)):(v=_,(t||!_)&&(_="error",0>t&&(t=0))),w.status=t,w.statusText=(e||_)+"",s?f.resolveWith(h,[u,_,w]):f.rejectWith(h,[w,_,v]),w.statusCode(g),g=void 0,l&&p.trigger(s?"ajaxSuccess":"ajaxError",[w,d,s?u:v]),m.fireWith(h,[w,_]),l&&(p.trigger("ajaxComplete",[w,d]),--ct.active||ct.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,s,o,r,a,l,c,u,d=ct.ajaxSetup({},e),h=d.context||d,p=d.context&&(h.nodeType||h.jquery)?ct(h):ct.event,f=ct.Deferred(),m=ct.Callbacks("once memory"),g=d.statusCode||{},v={},b={},y=0,C="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===y){if(!u)for(u={};e=Fe.exec(r);)u[e[1].toLowerCase()]=e[2];e=u[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===y?r:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return y||(t=b[i]=b[i]||t,v[t]=e),this},overrideMimeType:function(t){return y||(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>y)for(e in t)g[e]=[g[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||C;return c&&c.abort(e),i(0,e),this}};if(f.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,d.url=((t||d.url||ze)+"").replace(We,"").replace(Xe,Re[1]+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=ct.trim(d.dataType||"*").toLowerCase().match(Tt)||[""],null==d.crossDomain&&(n=Ye.exec(d.url.toLowerCase()),d.crossDomain=!(!n||n[1]===Re[1]&&n[2]===Re[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(Re[3]||("http:"===Re[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=ct.param(d.data,d.traditional)),X($e,d,e,w),2===y)return w;l=ct.event&&d.global,l&&0===ct.active++&&ct.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Ue.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(He.test(o)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Be.test(o)?o.replace(Be,"$1_="+Oe++):o+(He.test(o)?"&":"?")+"_="+Oe++)),d.ifModified&&(ct.lastModified[o]&&w.setRequestHeader("If-Modified-Since",ct.lastModified[o]),ct.etag[o]&&w.setRequestHeader("If-None-Match",ct.etag[o])),(d.data&&d.hasContent&&d.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",d.contentType),w.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ke+"; q=0.01":""):d.accepts["*"]);for(s in d.headers)w.setRequestHeader(s,d.headers[s]);if(d.beforeSend&&(d.beforeSend.call(h,w,d)===!1||2===y))return w.abort();C="abort";for(s in{success:1,error:1,complete:1})w[s](d[s]);if(c=X(Ve,d,e,w)){w.readyState=1,l&&p.trigger("ajaxSend",[w,d]),d.async&&d.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},d.timeout));try{y=1,c.send(v,i)}catch(_){if(!(2>y))throw _;i(-1,_)}}else i(-1,"No Transport");return w},getJSON:function(t,e,i){return ct.get(t,e,i,"json")},getScript:function(t,e){return ct.get(t,void 0,e,"script")}}),ct.each(["get","post"],function(t,e){ct[e]=function(t,i,n,s){return ct.isFunction(i)&&(s=s||n,n=i,i=void 0),ct.ajax({url:t,type:e,dataType:s,data:i,success:n})}}),ct._evalUrl=function(t){return ct.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ct.fn.extend({wrapAll:function(t){if(ct.isFunction(t))return this.each(function(e){ct(this).wrapAll(t.call(this,e))});if(this[0]){var e=ct(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return this.each(ct.isFunction(t)?function(e){ct(this).wrapInner(t.call(this,e))}:function(){var e=ct(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=ct.isFunction(t);return this.each(function(i){ct(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){ct.nodeName(this,"body")||ct(this).replaceWith(this.childNodes)}).end()}}),ct.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!at.reliableHiddenOffsets()&&"none"===(t.style&&t.style.display||ct.css(t,"display"))},ct.expr.filters.visible=function(t){return!ct.expr.filters.hidden(t)};var Je=/%20/g,Qe=/\[\]$/,Ze=/\r?\n/g,ti=/^(?:submit|button|image|reset|file)$/i,ei=/^(?:input|select|textarea|keygen)/i;ct.param=function(t,e){var i,n=[],s=function(t,e){e=ct.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=ct.ajaxSettings&&ct.ajaxSettings.traditional),ct.isArray(t)||t.jquery&&!ct.isPlainObject(t))ct.each(t,function(){s(this.name,this.value)});else for(i in t)K(i,t[i],e,s);return n.join("&").replace(Je,"+")},ct.fn.extend({serialize:function(){return ct.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ct.prop(this,"elements");return t?ct.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ct(this).is(":disabled")&&ei.test(this.nodeName)&&!ti.test(t)&&(this.checked||!Ot.test(t))}).map(function(t,e){var i=ct(this).val();return null==i?null:ct.isArray(i)?ct.map(i,function(t){return{name:e.name,value:t.replace(Ze,"\r\n")}}):{name:e.name,value:i.replace(Ze,"\r\n")}}).get()}}),ct.ajaxSettings.xhr=void 0!==o.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&G()||J()}:G;var ii=0,ni={},si=ct.ajaxSettings.xhr();o.attachEvent&&o.attachEvent("onunload",function(){for(var t in ni)ni[t](void 0,!0)}),at.cors=!!si&&"withCredentials"in si,si=at.ajax=!!si,si&&ct.ajaxTransport(function(t){if(!t.crossDomain||at.cors){var e;return{send:function(i,n){var s,o=t.xhr(),r=++ii;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)o[s]=t.xhrFields[s];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)void 0!==i[s]&&o.setRequestHeader(s,i[s]+"");o.send(t.hasContent&&t.data||null),e=function(i,s){var a,l,c;if(e&&(s||4===o.readyState))if(delete ni[r],e=void 0,o.onreadystatechange=ct.noop,s)4!==o.readyState&&o.abort();else{c={},a=o.status,"string"==typeof o.responseText&&(c.text=o.responseText);try{l=o.statusText}catch(u){l=""}a||!t.isLocal||t.crossDomain?1223===a&&(a=204):a=c.text?200:404}c&&n(a,l,c,o.getAllResponseHeaders())},t.async?4===o.readyState?setTimeout(e):o.onreadystatechange=ni[r]=e:e()},abort:function(){e&&e(void 0,!0)}}}}),ct.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return ct.globalEval(t),t}}}),ct.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),ct.ajaxTransport("script",function(t){if(t.crossDomain){var e,i=yt.head||ct("head")[0]||yt.documentElement;return{send:function(n,s){e=yt.createElement("script"),e.async=!0,t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,i){(i||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),e=null,i||s(200,"success"))},i.insertBefore(e,i.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var oi=[],ri=/(=)\?(?=&|$)|\?\?/;ct.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=oi.pop()||ct.expando+"_"+Oe++;return this[t]=!0,t}}),ct.ajaxPrefilter("json jsonp",function(t,e,i){var n,s,r,a=t.jsonp!==!1&&(ri.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ri.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(n=t.jsonpCallback=ct.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(ri,"$1"+n):t.jsonp!==!1&&(t.url+=(He.test(t.url)?"&":"?")+t.jsonp+"="+n),t.converters["script json"]=function(){return r||ct.error(n+" was not called"),r[0]},t.dataTypes[0]="json",s=o[n],o[n]=function(){r=arguments},i.always(function(){o[n]=s,t[n]&&(t.jsonpCallback=e.jsonpCallback,oi.push(n)),r&&ct.isFunction(s)&&s(r[0]),r=s=void 0}),"script"):void 0}),ct.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||yt;var n=gt.exec(t),s=!i&&[];return n?[e.createElement(n[1])]:(n=ct.buildFragment([t],e,s),s&&s.length&&ct(s).remove(),ct.merge([],n.childNodes))};var ai=ct.fn.load;ct.fn.load=function(t,e,i){if("string"!=typeof t&&ai)return ai.apply(this,arguments);var n,s,o,r=this,a=t.indexOf(" ");return a>=0&&(n=ct.trim(t.slice(a,t.length)),t=t.slice(0,a)),ct.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),r.length>0&&ct.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){s=arguments,r.html(n?ct("
").append(ct.parseHTML(t)).find(n):t)}).complete(i&&function(t,e){r.each(i,s||[t.responseText,e,t])}),this},ct.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ct.fn[e]=function(t){return this.on(e,t)}}),ct.expr.filters.animated=function(t){return ct.grep(ct.timers,function(e){return t===e.elem}).length};var li=o.document.documentElement;ct.offset={setOffset:function(t,e,i){var n,s,o,r,a,l,c,u=ct.css(t,"position"),d=ct(t),h={};"static"===u&&(t.style.position="relative"),a=d.offset(),o=ct.css(t,"top"),l=ct.css(t,"left"),c=("absolute"===u||"fixed"===u)&&ct.inArray("auto",[o,l])>-1,c?(n=d.position(),r=n.top,s=n.left):(r=parseFloat(o)||0,s=parseFloat(l)||0),ct.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(h.top=e.top-a.top+r),null!=e.left&&(h.left=e.left-a.left+s),"using"in e?e.using.call(t,h):d.css(h)}},ct.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ct.offset.setOffset(this,t,e)});var e,i,n={top:0,left:0},s=this[0],o=s&&s.ownerDocument;return o?(e=o.documentElement,ct.contains(e,s)?(typeof s.getBoundingClientRect!==Pt&&(n=s.getBoundingClientRect()),i=Q(o),{top:n.top+(i.pageYOffset||e.scrollTop)-(e.clientTop||0),left:n.left+(i.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):n):void 0},position:function(){if(this[0]){var t,e,i={top:0,left:0},n=this[0];return"fixed"===ct.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),ct.nodeName(t[0],"html")||(i=t.offset()),i.top+=ct.css(t[0],"borderTopWidth",!0),i.left+=ct.css(t[0],"borderLeftWidth",!0)),{top:e.top-i.top-ct.css(n,"marginTop",!0),left:e.left-i.left-ct.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||li;t&&!ct.nodeName(t,"html")&&"static"===ct.css(t,"position");)t=t.offsetParent;return t||li})}}),ct.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i=/Y/.test(e);ct.fn[t]=function(n){return Lt(this,function(t,n,s){var o=Q(t);return void 0===s?o?e in o?o[e]:o.document.documentElement[n]:t[n]:void(o?o.scrollTo(i?ct(o).scrollLeft():s,i?s:ct(o).scrollTop()):t[n]=s); },t,n,arguments.length,null)}}),ct.each(["top","left"],function(t,e){ct.cssHooks[e]=A(at.pixelPosition,function(t,i){return i?(i=re(t,e),le.test(i)?ct(t).position()[e]+"px":i):void 0})}),ct.each({Height:"height",Width:"width"},function(t,e){ct.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){ct.fn[n]=function(n,s){var o=arguments.length&&(i||"boolean"!=typeof n),r=i||(n===!0||s===!0?"margin":"border");return Lt(this,function(e,i,n){var s;return ct.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===n?ct.css(e,i,r):ct.style(e,i,n,r)},e,o?n:void 0,o,null)}})}),ct.fn.size=function(){return this.length},ct.fn.andSelf=ct.fn.addBack,i(7)&&(n=[],s=function(){return ct}.apply(e,n),!(void 0!==s&&(t.exports=s)));var ci=o.jQuery,ui=o.$;return ct.noConflict=function(t){return o.$===ct&&(o.$=ui),t&&o.jQuery===ct&&(o.jQuery=ci),ct},typeof r===Pt&&(o.jQuery=o.$=ct),ct})},function(t,e,i){var n=i(1),s=i(3),o={$:n,Class:s,API:{},KEYS:{SHIFT:16,TAB:9,UP:38,DOWN:40,ENTER:13,SPACE:32,ESC:27,CMD_LEFT:91,CMD_RIGHT:93,CMD_FIREFOX:224,CTRL:17}},r=function(t){return t.split(/\s+/g).map(function(t){return"cms-"+t}).join(" ")};o.API.Helpers={_isReloading:!1,reloadBrowser:function(t,e,i,s){var o=this,r=this._getWindow(),a=r.parent?r.parent:r;return o._isReloading=!0,i?(a.CMS.API.locked=!0,n.ajax({async:!1,type:"GET",url:a.CMS.config.request.url,data:s||{model:a.CMS.config.request.model,pk:a.CMS.config.request.pk},success:function(e){return a.CMS.API.locked=!1,""!==e||t?void(a.location.pathname!==e&&""!==e?o.reloadBrowser(e):"REFRESH_PAGE"===t?o.reloadBrowser():t&&o.reloadBrowser(t)):!1}}),!1):void a.setTimeout(function(){t&&t!==a.location.href?a.location.href=t:a.location.reload()},e||0)},onPluginSave:function(){this._isReloading||this.reloadBrowser(null,300)},preventSubmit:function(){var t=n(".cms-toolbar").find("form"),e=.5;t.submit(function(){o.API.Toolbar.showLoader(),n('input[type="submit"]').on("click",function(t){t.preventDefault()}).css("opacity",e)})},csrf:function(t){n.ajaxSetup({beforeSend:function(e){e.setRequestHeader("X-CSRFToken",t)}})},setSettings:function(t){var e=JSON.stringify(n.extend({},window.CMS.config.settings,t));return o.API.Toolbar&&o.API.Toolbar.showLoader(),this._isStorageSupported?(localStorage.setItem("cms_cookie",e),o.API.Toolbar&&o.API.Toolbar.hideLoader()):(o.API.locked=!0,n.ajax({async:!1,type:"POST",url:window.CMS.config.urls.settings,data:{csrfmiddlewaretoken:window.CMS.config.csrf,settings:e},success:function(t){o.API.locked=!1,e=t?JSON.parse(t):window.CMS.config.settings,o.API.Toolbar&&o.API.Toolbar.hideLoader()},error:function(t){o.API.Messages.open({message:t.responseText+" | "+t.status+" "+t.statusText,error:!0})}})),o.settings="object"==typeof e?e:JSON.parse(e),o.settings},getSettings:function(){var t;return o.API.Toolbar&&o.API.Toolbar.showLoader(),this._isStorageSupported?(t=JSON.parse(localStorage.getItem("cms_cookie")),o.API.Toolbar&&o.API.Toolbar.hideLoader()):(o.API.locked=!0,n.ajax({async:!1,type:"GET",url:window.CMS.config.urls.settings,success:function(e){o.API.locked=!1,t=e?JSON.parse(e):window.CMS.config.settings,o.API.Toolbar&&o.API.Toolbar.hideLoader()},error:function(t){o.API.Messages.open({message:t.responseText+" | "+t.status+" "+t.statusText,error:!0})}})),t||(t=this.setSettings(window.CMS.config.settings)),o.settings=t,o.settings},makeURL:function(t,e){var i=[],s=[],o=[],r="",a=[],l=[],c=t;t.split("?").length>1&&(a=t.split("?"),l=a[1].replace(/&(?:amp;)/g,"&").split("&"),c=a[0]),n.each(l,function(t,e){i.push({param:e.split("=")[0],value:e.split("=")[1]})}),e&&e.length&&n.each(e,function(t,e){i.push({param:e.split("=")[0],value:e.split("=")[1]})}),n.each(i,function(t,e){var i=n.inArray(e.param,s);-1===i?(s.push(e.param),o.push(e.value)):o[i]=e.value}),n.each(s,function(t,e){r+="&"+e+"="+o[t]}),r=r.replace("&","?");var u=c+r;return u=u.replace(/&/g,"&")},debounce:function(t,e,i){var n;return function(){var s=this,o=arguments,r=function(){n=null,i&&i.immediate||t.apply(s,o)},a=i&&i.immediate&&!n;clearTimeout(n),n=setTimeout(r,e),a&&t.apply(s,o)}},throttle:function(t,e,i){var s,o,r,a=null,l=0;i||(i={});var c=function(){l=i.leading===!1?0:n.now(),a=null,r=t.apply(s,o),a||(s=o=null)};return function(){var u=n.now();l||i.leading!==!1||(l=u);var d=e-(u-l);return s=this,o=arguments,0>=d||d>e?(a&&(clearTimeout(a),a=null),l=u,r=t.apply(s,o),a||(s=o=null)):a||i.trailing===!1||(a=setTimeout(c,d)),r}},secureConfirm:function(t){var e=Number(new Date),i=confirm(t),n=Number(new Date),s=10;return e+s>n||i===!0},_isStorageSupported:function(){var t="modernizr";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(e){return!1}}(),addEventListener:function(t,e){return o._eventRoot.on(r(t),e)},removeEventListener:function(t,e){return o._eventRoot.off(r(t),e)},dispatchEvent:function(t,e){var i=new n.Event(r(t));return o._eventRoot.trigger(i,[e]),i},once:function(t){var e,i=!1;return function(){return i?t=void 0:(i=!0,e=t.apply(this,arguments)),e}},preventTouchScrolling:function(t,e){t.on("touchmove.cms.preventscroll."+e,function(t){t.preventDefault()})},allowTouchScrolling:function(t,e){t.off("touchmove.cms.preventscroll."+e)},_getWindow:function(){return window}},n(function(){o._eventRoot=n("#cms-top"),o.API.Helpers.preventSubmit()}),t.exports=o},function(t,e){!function(){function t(t){var e=function(){};return e.prototype=t.prototype||t,new e}function e(t,e,i){if(i){var n={};for(var s in t)s!==e&&(n[s]=t[s])}else delete t[e];return n||t}function i(e,n,s){if(!e||!n)return e||n||{};e=t(e),n=t(n);for(var o in n)"[object Object]"===Object.prototype.toString.call(n[o])?i(e[o],n[o]):e[o]=s&&e[o]?e[o]:n[o];return e}function n(t){for(var s={},o=0;o-1?this.values[i]=e:(this.keys.push(t),this.values.push(e))},has:function(t){return this.keys.indexOf(t)>-1},"delete":function(t){var e=this.keys.indexOf(t);e>-1&&(this.keys.splice(e,1),this.values.splice(e,1))},get:function(t){var e=this.keys.indexOf(t);return this.values[e]},clear:function(){this.keys.length=0,this.values.length=0},forEach:function(t,e){this.values.forEach(function(i,n){t.call(e,i,this.keys[n],this)},this)},pointers:function(){return this.keys.length}};var h=t,p=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],f=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],m="undefined"!=typeof SVGElementInstance,g={pointermap:new h,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(t,e){var i=e,n=i.events;n&&(n.forEach(function(t){i[t]&&(this.eventMap[t]=i[t].bind(i))},this),this.eventSources[t]=i,this.eventSourceList.push(i))},register:function(t){for(var e,i=this.eventSourceList.length,n=0;i>n&&(e=this.eventSourceList[n]);n++)e.register.call(e,t)},unregister:function(t){for(var e,i=this.eventSourceList.length,n=0;i>n&&(e=this.eventSourceList[n]);n++)e.unregister.call(e,t)},contains:function(t,e){return t.contains(e)},down:function(t){t.bubbles=!0,this.fireEvent("pointerdown",t)},move:function(t){t.bubbles=!0,this.fireEvent("pointermove",t)},up:function(t){t.bubbles=!0,this.fireEvent("pointerup",t)},enter:function(t){t.bubbles=!1,this.fireEvent("pointerenter",t)},leave:function(t){t.bubbles=!1,this.fireEvent("pointerleave",t)},over:function(t){t.bubbles=!0,this.fireEvent("pointerover",t)},out:function(t){t.bubbles=!0,this.fireEvent("pointerout",t)},cancel:function(t){t.bubbles=!0,this.fireEvent("pointercancel",t)},leaveOut:function(t){this.out(t),this.contains(t.target,t.relatedTarget)||this.leave(t)},enterOver:function(t){this.over(t),this.contains(t.target,t.relatedTarget)||this.enter(t)},eventHandler:function(t){if(!t._handledByPE){var e=t.type,i=this.eventMap&&this.eventMap[e];i&&i(t),t._handledByPE=!0}},listen:function(t,e){e.forEach(function(e){this.addEvent(t,e)},this)},unlisten:function(t,e){e.forEach(function(e){this.removeEvent(t,e)},this)},addEvent:function(t,e){t.addEventListener(e,this.boundHandler)},removeEvent:function(t,e){t.removeEventListener(e,this.boundHandler)},makeEvent:function(t,e){this.captureInfo[e.pointerId]&&(e.relatedTarget=null);var i=new PointerEvent(t,e);return e.preventDefault&&(i.preventDefault=e.preventDefault),i._target=i._target||e.target,i},fireEvent:function(t,e){var i=this.makeEvent(t,e);return this.dispatchEvent(i)},cloneEvent:function(t){for(var e,i=Object.create(null),n=0;no&&(e=i[o]);o++){var a=Math.abs(n-e.x),l=Math.abs(s-e.y);if(O>=a&&O>=l)return!0}},prepareEvent:function(t){var e=v.cloneEvent(t),i=e.preventDefault;return e.preventDefault=function(){t.preventDefault(),i()},e.pointerId=this.POINTER_ID,e.isPrimary=!0,e.pointerType=this.POINTER_TYPE,j||(e.buttons=H[e.which]||0),e},mousedown:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=L.has(this.POINTER_ID);e&&this.cancel(t);var i=this.prepareEvent(t);L.set(this.POINTER_ID,t),v.down(i)}},mousemove:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);v.move(e)}},mouseup:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=L.get(this.POINTER_ID);if(e&&e.button===t.button){var i=this.prepareEvent(t);v.up(i),this.cleanupMouse()}}},mouseover:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);v.enterOver(e)}},mouseout:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);v.leaveOut(e)}},cancel:function(t){var e=this.prepareEvent(t);v.cancel(e),this.cleanupMouse()},cleanupMouse:function(){L["delete"](this.POINTER_ID)}},B=W,F=v.captureInfo,q=b.findTarget.bind(b),U=b.allShadows.bind(b),X=v.pointermap,Y=(Array.prototype.map.call.bind(Array.prototype.map),2500),$=200,V="data-touch-action",K=!1,G={events:["touchstart","touchmove","touchend","touchcancel"],register:function(t){K?v.listen(t,this.events):z.enableOnSubtree(t)},unregister:function(t){K&&v.unlisten(t,this.events)},elementAdded:function(t){var e=t.getAttribute(V),i=this.touchActionToScrollType(e);i&&(t._scrollType=i,v.listen(t,this.events),U(t).forEach(function(t){t._scrollType=i,v.listen(t,this.events)},this))},elementRemoved:function(t){t._scrollType=void 0,v.unlisten(t,this.events),U(t).forEach(function(t){t._scrollType=void 0,v.unlisten(t,this.events)},this)},elementChanged:function(t,e){var i=t.getAttribute(V),n=this.touchActionToScrollType(i),s=this.touchActionToScrollType(e);n&&s?(t._scrollType=n,U(t).forEach(function(t){t._scrollType=n},this)):s?this.elementRemoved(t):n&&this.elementAdded(t)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(t){var e=t,i=this.scrollTypes;return"none"===e?"none":e===i.XSCROLLER?"X":e===i.YSCROLLER?"Y":i.SCROLLER.exec(e)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(t){return this.firstTouch===t.identifier},setPrimaryTouch:function(t){(0===X.pointers()||1===X.pointers()&&X.has(1))&&(this.firstTouch=t.identifier,this.firstXY={X:t.clientX,Y:t.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(t){t.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var t=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(t,$)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(t){var e=0;return"touchstart"!==t&&"touchmove"!==t||(e=1),e},touchToPointer:function(t){var e=this.currentTouchEvent,i=v.cloneEvent(t),n=i.pointerId=t.identifier+2;i.target=F[n]||q(i),i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount,i.button=0,i.buttons=this.typeToButtons(e.type),i.width=t.webkitRadiusX||t.radiusX||0,i.height=t.webkitRadiusY||t.radiusY||0,i.pressure=t.webkitForce||t.force||.5,i.isPrimary=this.isPrimaryTouch(t),i.pointerType=this.POINTER_TYPE;var s=this;return i.preventDefault=function(){s.scrolling=!1,s.firstXY=null,e.preventDefault()},i},processTouches:function(t,e){var i=t.changedTouches;this.currentTouchEvent=t;for(var n,s=0;s=a}return this.firstXY=null,e}},findTouch:function(t,e){for(var i,n=0,s=t.length;s>n&&(i=t[n]);n++)if(i.identifier===e)return!0},vacuumTouches:function(t){var e=t.touches;if(X.pointers()>=e.length){var i=[];X.forEach(function(t,n){if(1!==n&&!this.findTouch(e,n-2)){var s=t.out;i.push(s)}},this),i.forEach(this.cancelOut,this)}},touchstart:function(t){this.vacuumTouches(t),this.setPrimaryTouch(t.changedTouches[0]),this.dedupSynthMouse(t),this.scrolling||(this.clickCount++,this.processTouches(t,this.overDown))},overDown:function(t){X.set(t.pointerId,{target:t.target,out:t,outTarget:t.target});v.over(t),v.enter(t),v.down(t)},touchmove:function(t){this.scrolling||(this.shouldScroll(t)?(this.scrolling=!0,this.touchcancel(t)):(t.preventDefault(),this.processTouches(t,this.moveOverOut)))},moveOverOut:function(t){var e=t,i=X.get(e.pointerId);if(i){var n=i.out,s=i.outTarget;v.move(e),n&&s!==e.target&&(n.relatedTarget=e.target,e.relatedTarget=s,n.target=s,e.target?(v.leaveOut(n),v.enterOver(e)):(e.target=s,e.relatedTarget=null,this.cancelOut(e))),i.out=e,i.outTarget=e.target}},touchend:function(t){this.dedupSynthMouse(t),this.processTouches(t,this.upOut)},upOut:function(t){this.scrolling||(v.up(t),v.out(t),v.leave(t)),this.cleanUpPointer(t)},touchcancel:function(t){this.processTouches(t,this.cancelOut)},cancelOut:function(t){v.cancel(t),v.out(t),v.leave(t),this.cleanUpPointer(t)},cleanUpPointer:function(t){X["delete"](t.pointerId),this.removePrimaryPointer(t)},dedupSynthMouse:function(t){var e=B.lastTouches,i=t.changedTouches[0];if(this.isPrimaryTouch(i)){var n={x:i.clientX,y:i.clientY};e.push(n);var s=function(t,e){var i=t.indexOf(e);i>-1&&t.splice(i,1)}.bind(null,e,n);setTimeout(s,Y)}}};K||(z=new k(G.elementAdded,G.elementRemoved,G.elementChanged,G));var J,Q,Z=G,tt=v.pointermap,et=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,it={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(t){v.listen(t,this.events)},unregister:function(t){v.unlisten(t,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(t){var e=t;return et&&(e=v.cloneEvent(t),e.pointerType=this.POINTER_TYPES[t.pointerType]),e},cleanup:function(t){tt["delete"](t)},MSPointerDown:function(t){tt.set(t.pointerId,t);var e=this.prepareEvent(t);v.down(e)},MSPointerMove:function(t){var e=this.prepareEvent(t);v.move(e)},MSPointerUp:function(t){var e=this.prepareEvent(t);v.up(e),this.cleanup(t.pointerId)},MSPointerOut:function(t){var e=this.prepareEvent(t);v.leaveOut(e)},MSPointerOver:function(t){var e=this.prepareEvent(t);v.enterOver(e)},MSPointerCancel:function(t){var e=this.prepareEvent(t);v.cancel(e),this.cleanup(t.pointerId)},MSLostPointerCapture:function(t){var e=v.makeEvent("lostpointercapture",t);v.dispatchEvent(e)},MSGotPointerCapture:function(t){var e=v.makeEvent("gotpointercapture",t);v.dispatchEvent(e)}},nt=it,st=window.navigator;st.msPointerEnabled?(J=function(t){l(t),this.msSetPointerCapture(t)},Q=function(t){l(t),this.msReleasePointerCapture(t)}):(J=function(t){l(t),v.setCapture(t,this)},Q=function(t){l(t),v.releaseCapture(t,this)}),r(),a(),c();var ot={dispatcher:v,Installer:k,PointerEvent:M,PointerMap:h,targetFinding:b};return ot})},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e,i){var n=i(1),s=i(3),o=i(2).API.Helpers,r=i(2).KEYS,a=i(10);i(27);var l=new s({implement:[o],options:{onClose:!1,closeOnEsc:!0,minHeight:400,minWidth:800,modalDuration:200,resizable:!0,maximizable:!0,minimizable:!0},initialize:function(t){this.options=n.extend(!0,{},this.options,t),this._setupUI(),this._setupEventEmitter(),this.click="click.cms.modal",this.pointerDown="pointerdown.cms.modal contextmenu.cms.modal",this.pointerUp="pointerup.cms.modal pointercancel.cms.modal",this.pointerMove="pointermove.cms.modal",this.doubleClick="dblclick.cms.modal",this.touchEnd="touchend.cms.modal",this.maximized=!1,this.minimized=!1,this.triggerMaximized=!1,this.saved=!1,this._beforeUnloadHandler=this._beforeUnloadHandler.bind(this)},_setupEventEmitter:function(){function t(t){return function(){return i[t].apply(i,arguments),e}}var e=this,i=n({});this.trigger=t("trigger"),this.one=t("one"),this.on=t("on"),this.off=t("off")},_setupUI:function(){var t=n(".cms-modal");this.ui={modal:t,body:n("html"),window:n(window),toolbarLeftPart:n(".cms-toolbar-left"),minimizeButton:t.find(".cms-modal-minimize"),maximizeButton:t.find(".cms-modal-maximize"),title:t.find(".cms-modal-title"),titlePrefix:t.find(".cms-modal-title-prefix"),titleSuffix:t.find(".cms-modal-title-suffix"),resize:t.find(".cms-modal-resize"),breadcrumb:t.find(".cms-modal-breadcrumb"),closeAndCancel:t.find(".cms-modal-close, .cms-modal-cancel"),modalButtons:t.find(".cms-modal-buttons"),modalBody:t.find(".cms-modal-body"),frame:t.find(".cms-modal-frame"),shim:t.find(".cms-modal-shim")}},_events:function(){var t=this;this.ui.minimizeButton.off(this.click+" "+this.touchEnd).on(this.click+" "+this.touchEnd,function(e){e.preventDefault(),t.minimize()}),this.ui.maximizeButton.off(this.click+" "+this.touchEnd).on(this.click+" "+this.touchEnd,function(e){e.preventDefault(),t.maximize()}),this.ui.title.off(this.pointerDown).on(this.pointerDown,function(e){e.preventDefault(),t._startMove(e)}),this.ui.title.off(this.doubleClick).on(this.doubleClick,function(){t.maximize()}),this.ui.resize.off(this.pointerDown).on(this.pointerDown,function(e){e.preventDefault(),t._startResize(e)}),this.ui.closeAndCancel.off(this.click+" "+this.touchEnd).on(this.click+" "+this.touchEnd,function(e){e.preventDefault(),t._cancelHandler()}),this.ui.breadcrumb.off(this.click,"a").on(this.click,"a",function(e){e.preventDefault(),t._changeIframe(n(this))})},open:function(t){if(!(t&&t.url||t&&t.html))throw new Error('The arguments passed to "open" were invalid.');this._events(),this.trigger("cms.modal.load"),this.ui.modal.trigger("cms.modal.load"),this.ui.resize.toggle(this.options.resizable),this.ui.minimizeButton.toggle(this.options.minimizable),this.ui.maximizeButton.toggle(this.options.maximizable);var e=this._calculateNewPosition(t);return this.ui.maximizeButton.removeClass("cms-modal-maximize-active"),this.maximized=!1,this.ui.body.hasClass("cms-modal-minimized")&&(this.minimized=!0,this.minimize()),this.ui.modalButtons.empty(),this.ui.breadcrumb.empty(),this.ui.modal.removeClass("cms-modal-has-breadcrumb"),CMS.API.Tooltip.hide(),t.url?this._loadIframe({url:t.url,title:t.title,breadcrumbs:t.breadcrumbs}):this._loadMarkup({html:t.html,title:t.title,subtitle:t.subtitle}),this.trigger("cms.modal.loaded"),this._show(n.extend({duration:this.options.modalDuration},e)),this},_calculateNewPosition:function(t){var e,i,n=300,s=300,o=this.ui.window.width(),r=this.ui.window.height(),a=t.width||this.options.minWidth,l=t.height||this.options.minHeight,c=o>=a+n,u=r>=l+s,d=c&&!t.width?o-n:a,h=u&&!t.height?r-s:l,p=this.ui.modal.css("left"),f=this.ui.modal.css("top");return"50%"===p&&(p=o/2),"50%"===f&&(f=r/2),f=parseInt(f,10),p=parseInt(p,10),(d/2+p>o||h/2+f>r||0>p-d/2||0>f-h/2)&&(e=o/2,i=r/2),(d>=o||h>=r)&&(this.triggerMaximized=!0),{width:d,height:h,top:i,left:e}},_show:function(t){var e=this,i=t.width,n=t.height,s=t.duration,o=t.top,a=t.left;this.ui.modal.hasClass("cms-modal-open")&&this.ui.modal.addClass("cms-modal-morphing"),this.ui.modal.css({display:"block",width:i,height:n,top:o,left:a,"margin-left":-(i/2),"margin-top":-(n/2)}),setTimeout(function(){e.ui.modal.addClass("cms-modal-open")},0),this.ui.modal.one("cmsTransitionEnd",function(){e.ui.modal.removeClass("cms-modal-morphing"),e.ui.modal.css({"margin-left":-(i/2),"margin-top":-(n/2)}),e.triggerMaximized&&e.maximize(),CMS.API.locked=!1,e.trigger("cms.modal.shown")}).emulateTransitionEnd(s),this.ui.body.off("keydown.cms.close").on("keydown.cms.close",function(t){t.keyCode===r.ESC&&e.options.closeOnEsc&&e._confirmDirtyEscCancel()&&e._cancelHandler()}),this.ui.modal.focus()},close:function(){var t=o.dispatchEvent("modal-close",{instance:this});return t.isDefaultPrevented()?!1:(o._getWindow().removeEventListener("beforeunload",this._beforeUnloadHandler),this.options.onClose&&o.reloadBrowser(this.options.onClose,!1,!0),void this._hide({duration:this.options.modalDuration/2}))},_hide:function(t){var e=this,i=this.options.modalDuration;t&&t.duration&&(i=t.duration),this.ui.frame.empty(),this.ui.modalBody.removeClass("cms-loader"),this.ui.modal.removeClass("cms-modal-open"),this.ui.modal.one("cmsTransitionEnd",function(){e.ui.modal.css("display","none")}).emulateTransitionEnd(i),setTimeout(function(){e.minimized&&e.minimize(),e.maximized&&e.maximize(),e.trigger("cms.modal.closed"),CMS.API.Toolbar.hideLoader(),o.dispatchEvent("modal-closed",{instance:e})},this.options.duration),this.ui.body.off("keydown.cms.close")},minimize:function(){var t=50;return this.maximized?!1:void(this.minimized===!1?(CMS.API.Toolbar.open(),this.ui.modal.data("css",this.ui.modal.css(["left","top","margin-left","margin-top"])),this.ui.body.addClass("cms-modal-minimized"),this.ui.modal.css({left:this.ui.toolbarLeftPart.outerWidth(!0)+t}),this.minimized=!0):(this.ui.body.removeClass("cms-modal-minimized"),this.ui.modal.css(this.ui.modal.data("css")),this.minimized=!1))},maximize:function(){return this.minimized?!1:void(this.maximized===!1?(this.ui.modal.data("css",this.ui.modal.css(["left","top","margin-left","margin-top","width","height"])),this.ui.body.addClass("cms-modal-maximized"),this.maximized=!0,this.dispatchEvent("modal-maximized",{instance:this})):(this.ui.body.removeClass("cms-modal-maximized"),this.ui.modal.css(this.ui.modal.data("css")),this.maximized=!1,this.dispatchEvent("modal-restored",{instance:this})))},_startMove:function(t){if(this.maximized||this.minimized)return!1;var e,i,n=this,s=this.ui.modal.position();this.ui.shim.show(),this.ui.body.on(this.pointerUp,function(t){n._stopMove(t)}),this.ui.body.on(this.pointerMove,function(o){e=s.left-(t.originalEvent.pageX-o.originalEvent.pageX),i=s.top-(t.originalEvent.pageY-o.originalEvent.pageY),n.ui.modal.css({left:e,top:i})}).attr("data-touch-action","none")},_stopMove:function(){this.ui.shim.hide(),this.ui.body.off(this.pointerMove+" "+this.pointerUp).removeAttr("data-touch-action")},_startResize:function(t){if(this.maximized)return!1;var e=this,i=this.ui.modal.width(),n=this.ui.modal.height(),s=this.ui.modal.position().left,o=this.ui.modal.position().top;this.ui.body.on(this.pointerUp,function(t){e._stopResize(t)}),this.ui.shim.show(),this.ui.body.on(this.pointerMove,function(r){var a=t.originalEvent.pageX-r.originalEvent.pageX,l=t.originalEvent.pageY-r.originalEvent.pageY,c=i-2*a,u=n-2*l,d=e.options.minWidth,h=e.options.minHeight,p=a+s,f=l+o; -d>=c&&(c=d,p=s+i/2-c/2),h>=u&&(u=h,f=o+n/2-u/2),e.ui.modal.css({width:c,height:u,left:p,top:f})}).attr("data-touch-action","none")},_stopResize:function(){this.ui.shim.hide(),this.ui.body.off(this.pointerMove+" "+this.pointerUp).removeAttr("data-touch-action")},_setBreadcrumb:function(t){var e="",i='{3}';return!t||t.length<=1?!1:t[0].title?(this.ui.modal.addClass("cms-modal-has-breadcrumb"),n.each(t,function(n,s){var o=n>=t.length-1?"active":"";e+=i.replace("{1}",s.url).replace("{2}",o).replace("{3}",s.title)}),void this.ui.breadcrumb.html(e)):!1},_setButtons:function(t){var e,i,s=t.contents().find(".suit-columns").length>0,o=this,r=n('
'),a=n('
'),l=n(''+CMS.config.lang.cancel+"");e=s?t.contents().find(".save-box:eq(0)"):t.contents().find(".submit-row:eq(0)");var c=t.contents().find("form");c.on("submit",function(){o.hideFrame&&(o.ui.modal.find(".cms-modal-frame iframe").hide(),o.saved=!0)});var u=e.find("input, a, button");u.on("click",function(){n(this).hasClass("default")&&(o.hideFrame=!0)}),t.contents().find(".submit-row").hide(),u.length||(e=t.contents().find("body:not(.change-list) #content form:eq(0)"),u=e.find('input[type="submit"], button[type="submit"]'),u.addClass("deletelink").hide()),u.each(function(t,e){var i=n(e);if(i.attr("data-rel","_"+t),"hidden"===i.attr("type"))return!1;var s=i.attr("value")||i.text(),l="cms-btn";i.is("button")&&(s=i.text()),i.hasClass("default")&&(l="cms-btn cms-btn-action"),i.hasClass("deletelink")&&(l="cms-btn cms-btn-caution");var c=n(''+s+"");c.on(o.click+" "+o.touchEnd,function(t){if(t.preventDefault(),i.is("a")&&o._loadIframe({url:i.prop("href"),name:s}),(i.hasClass("default")||i.hasClass("deletelink"))&&(i.hasClass("default")?o.hideFrame=!0:(o.ui.modal.find(".cms-modal-frame iframe").hide(),o.saved=!0)),i.is("input")||i.is("button")){o.ui.modalBody.addClass("cms-loader");var e=i.closest("form");e.find('button, input[type="button"], input[type="submit"]').length>1?i[0].click():e.submit()}}),c.wrap(r),a.append(c.parent())}),l.on(o.click,function(t){t.preventDefault(),o._cancelHandler()}),l.wrap(r),a.append(l.parent()),a.find(".cms-btn-group").unwrap(),i=a.find(".cms-btn-group").clone(!0,!0),a.find(".cms-btn-group").remove(),a.append(i.wrapAll(r.clone().addClass("cms-modal-item-buttons-left")).parent()),this.ui.modalButtons.html(a)},_loadIframe:function(t){var e=this;t.url=this.makeURL(t.url),t.title=t.title||"",t.breadcrumbs=t.breadcrumbs||"",CMS.API.Toolbar.showLoader(),this.ui.modal.removeClass("cms-modal-markup"),this.ui.modal.addClass("cms-modal-iframe"),this._setBreadcrumb(t.breadcrumbs);var i=this.ui.frame,s=n('