(function(){var n=[].slice;!function(t,i){"use strict";var r;return r=function(){function n(n,i){null==i&&(i={});this.$element=t(n);this.options=t.extend({},t.fn.bootstrapSwitch.defaults,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioAllOff:this.$element.data("radio-all-off"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),handleWidth:this.$element.data("handle-width"),labelWidth:this.$element.data("label-width"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")},i);this.prevOptions={};this.$wrapper=t("<div>",{"class":function(n){return function(){var t;return t=[""+n.options.baseClass].concat(n._getClasses(n.options.wrapperClass)),t.push(n.options.state?n.options.baseClass+"-on":n.options.baseClass+"-off"),null!=n.options.size&&t.push(n.options.baseClass+"-"+n.options.size),n.options.disabled&&t.push(n.options.baseClass+"-disabled"),n.options.readonly&&t.push(n.options.baseClass+"-readonly"),n.options.indeterminate&&t.push(n.options.baseClass+"-indeterminate"),n.options.inverse&&t.push(n.options.baseClass+"-inverse"),n.$element.attr("id")&&t.push(n.options.baseClass+"-id-"+n.$element.attr("id")),t.join(" ")}}(this)()});this.$container=t("<div>",{"class":this.options.baseClass+"-container"});this.$on=t("<span>",{html:this.options.onText,"class":this.options.baseClass+"-handle-on "+this.options.baseClass+"-"+this.options.onColor});this.$off=t("<span>",{html:this.options.offText,"class":this.options.baseClass+"-handle-off "+this.options.baseClass+"-"+this.options.offColor});this.$label=t("<span>",{html:this.options.labelText,"class":this.options.baseClass+"-label"});this.$element.on("init.bootstrapSwitch",function(t){return function(){return t.options.onInit.apply(n,arguments)}}(this));this.$element.on("switchChange.bootstrapSwitch",function(i){return function(){if(!1===i.options.onSwitchChange.apply(n,arguments))return i.$element.is(":radio")?t("[name='"+i.$element.attr("name")+"']").trigger("previousState.bootstrapSwitch",!0):i.$element.trigger("previousState.bootstrapSwitch",!0)}}(this));this.$container=this.$element.wrap(this.$container).parent();this.$wrapper=this.$container.wrap(this.$wrapper).parent();this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off);this.options.indeterminate&&this.$element.prop("indeterminate",!0);this._init();this._elementHandlers();this._handleHandlers();this._labelHandlers();this._formHandler();this._externalLabelHandler();this.$element.trigger("init.bootstrapSwitch",this.options.state)}return n.prototype._constructor=n,n.prototype.setPrevOptions=function(){return this.prevOptions=t.extend(!0,{},this.options)},n.prototype.state=function(n,i){return"undefined"==typeof n?this.options.state:this.options.disabled||this.options.readonly?this.$element:this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")?this.$element:(this.$element.is(":radio")?t("[name='"+this.$element.attr("name")+"']").trigger("setPreviousOptions.bootstrapSwitch"):this.$element.trigger("setPreviousOptions.bootstrapSwitch"),this.options.indeterminate&&this.indeterminate(!1),n=!!n,this.$element.prop("checked",n).trigger("change.bootstrapSwitch",i),this.$element)},n.prototype.toggleState=function(n){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",n)},n.prototype.size=function(n){return"undefined"==typeof n?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(this.options.baseClass+"-"+this.options.size),n&&this.$wrapper.addClass(this.options.baseClass+"-"+n),this._width(),this._containerPosition(),this.options.size=n,this.$element)},n.prototype.animate=function(n){return"undefined"==typeof n?this.options.animate:(n=!!n,n===this.options.animate?this.$element:this.toggleAnimate())},n.prototype.toggleAnimate=function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(this.options.baseClass+"-animate"),this.$element},n.prototype.disabled=function(n){return"undefined"==typeof n?this.options.disabled:(n=!!n,n===this.options.disabled?this.$element:this.toggleDisabled())},n.prototype.toggleDisabled=function(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleClass(this.options.baseClass+"-disabled"),this.$element},n.prototype.readonly=function(n){return"undefined"==typeof n?this.options.readonly:(n=!!n,n===this.options.readonly?this.$element:this.toggleReadonly())},n.prototype.toggleReadonly=function(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleClass(this.options.baseClass+"-readonly"),this.$element},n.prototype.indeterminate=function(n){return"undefined"==typeof n?this.options.indeterminate:(n=!!n,n===this.options.indeterminate?this.$element:this.toggleIndeterminate())},n.prototype.toggleIndeterminate=function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleClass(this.options.baseClass+"-indeterminate"),this._containerPosition(),this.$element},n.prototype.inverse=function(n){return"undefined"==typeof n?this.options.inverse:(n=!!n,n===this.options.inverse?this.$element:this.toggleInverse())},n.prototype.toggleInverse=function(){var n,t;return this.$wrapper.toggleClass(this.options.baseClass+"-inverse"),t=this.$on.clone(!0),n=this.$off.clone(!0),this.$on.replaceWith(n),this.$off.replaceWith(t),this.$on=n,this.$off=t,this.options.inverse=!this.options.inverse,this.$element},n.prototype.onColor=function(n){var t;return t=this.options.onColor,"undefined"==typeof n?t:(null!=t&&this.$on.removeClass(this.options.baseClass+"-"+t),this.$on.addClass(this.options.baseClass+"-"+n),this.options.onColor=n,this.$element)},n.prototype.offColor=function(n){var t;return t=this.options.offColor,"undefined"==typeof n?t:(null!=t&&this.$off.removeClass(this.options.baseClass+"-"+t),this.$off.addClass(this.options.baseClass+"-"+n),this.options.offColor=n,this.$element)},n.prototype.onText=function(n){return"undefined"==typeof n?this.options.onText:(this.$on.html(n),this._width(),this._containerPosition(),this.options.onText=n,this.$element)},n.prototype.offText=function(n){return"undefined"==typeof n?this.options.offText:(this.$off.html(n),this._width(),this._containerPosition(),this.options.offText=n,this.$element)},n.prototype.labelText=function(n){return"undefined"==typeof n?this.options.labelText:(this.$label.html(n),this._width(),this.options.labelText=n,this.$element)},n.prototype.handleWidth=function(n){return"undefined"==typeof n?this.options.handleWidth:(this.options.handleWidth=n,this._width(),this._containerPosition(),this.$element)},n.prototype.labelWidth=function(n){return"undefined"==typeof n?this.options.labelWidth:(this.options.labelWidth=n,this._width(),this._containerPosition(),this.$element)},n.prototype.baseClass=function(){return this.options.baseClass},n.prototype.wrapperClass=function(n){return"undefined"==typeof n?this.options.wrapperClass:(n||(n=t.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(n).join(" ")),this.options.wrapperClass=n,this.$element)},n.prototype.radioAllOff=function(n){return"undefined"==typeof n?this.options.radioAllOff:(n=!!n,n===this.options.radioAllOff?this.$element:(this.options.radioAllOff=n,this.$element))},n.prototype.onInit=function(n){return"undefined"==typeof n?this.options.onInit:(n||(n=t.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=n,this.$element)},n.prototype.onSwitchChange=function(n){return"undefined"==typeof n?this.options.onSwitchChange:(n||(n=t.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=n,this.$element)},n.prototype.destroy=function(){var n;return n=this.$element.closest("form"),n.length&&n.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element},n.prototype._width=function(){var t,n;return t=this.$on.add(this.$off),t.add(this.$label).css("width",""),n="auto"===this.options.handleWidth?Math.max(this.$on.width(),this.$off.width()):this.options.handleWidth,t.width(n),this.$label.width(function(t){return function(i,r){return"auto"!==t.options.labelWidth?t.options.labelWidth:n>r?n:r}}(this)),this._handleWidth=this.$on.outerWidth(),this._labelWidth=this.$label.outerWidth(),this.$container.width(2*this._handleWidth+this._labelWidth),this.$wrapper.width(this._handleWidth+this._labelWidth)},n.prototype._containerPosition=function(n,t){return null==n&&(n=this.options.state),this.$container.css("margin-left",function(t){return function(){var i;return i=[0,"-"+t._handleWidth+"px"],t.options.indeterminate?"-"+t._handleWidth/2+"px":n?t.options.inverse?i[1]:i[0]:t.options.inverse?i[0]:i[1]}}(this)),t?setTimeout(function(){return t()},50):void 0},n.prototype._init=function(){var n,t;return n=function(n){return function(){return n.setPrevOptions(),n._width(),n._containerPosition(null,function(){if(n.options.animate)return n.$wrapper.addClass(n.options.baseClass+"-animate")})}}(this),this.$wrapper.is(":visible")?n():t=i.setInterval(function(r){return function(){if(r.$wrapper.is(":visible"))return(n(),i.clearInterval(t))}}(this),50)},n.prototype._elementHandlers=function(){return this.$element.on({"setPreviousOptions.bootstrapSwitch":function(n){return function(){return n.setPrevOptions()}}(this),"previousState.bootstrapSwitch":function(n){return function(){return n.options=n.prevOptions,n.options.indeterminate&&n.$wrapper.addClass(n.options.baseClass+"-indeterminate"),n.$element.prop("checked",n.options.state).trigger("change.bootstrapSwitch",!0)}}(this),"change.bootstrapSwitch":function(n){return function(i,r){var u;return i.preventDefault(),i.stopImmediatePropagation(),u=n.$element.is(":checked"),n._containerPosition(u),u!==n.options.state?(n.options.state=u,n.$wrapper.toggleClass(n.options.baseClass+"-off").toggleClass(n.options.baseClass+"-on"),r?void 0:(n.$element.is(":radio")&&t("[name='"+n.$element.attr("name")+"']").not(n.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),n.$element.trigger("switchChange.bootstrapSwitch",[u]))):void 0}}(this),"focus.bootstrapSwitch":function(n){return function(t){return t.preventDefault(),n.$wrapper.addClass(n.options.baseClass+"-focused")}}(this),"blur.bootstrapSwitch":function(n){return function(t){return t.preventDefault(),n.$wrapper.removeClass(n.options.baseClass+"-focused")}}(this),"keydown.bootstrapSwitch":function(n){return function(t){if(t.which&&!n.options.disabled&&!n.options.readonly)switch(t.which){case 37:return t.preventDefault(),t.stopImmediatePropagation(),n.state(!1);case 39:return t.preventDefault(),t.stopImmediatePropagation(),n.state(!0)}}}(this)})},n.prototype._handleHandlers=function(){return this.$on.on("click.bootstrapSwitch",function(n){return function(t){return t.preventDefault(),t.stopPropagation(),n.state(!1),n.$element.trigger("focus.bootstrapSwitch")}}(this)),this.$off.on("click.bootstrapSwitch",function(n){return function(t){return t.preventDefault(),t.stopPropagation(),n.state(!0),n.$element.trigger("focus.bootstrapSwitch")}}(this))},n.prototype._labelHandlers=function(){return this.$label.on({click:function(n){return n.stopPropagation()},"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(n){return function(t){if(!n._dragStart&&!n.options.disabled&&!n.options.readonly)return(t.preventDefault(),t.stopPropagation(),n._dragStart=(t.pageX||t.originalEvent.touches[0].pageX)-parseInt(n.$container.css("margin-left"),10),n.options.animate&&n.$wrapper.removeClass(n.options.baseClass+"-animate"),n.$element.trigger("focus.bootstrapSwitch"))}}(this),"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(n){return function(t){var i;if(null!=n._dragStart&&(t.preventDefault(),i=(t.pageX||t.originalEvent.touches[0].pageX)-n._dragStart,!(i<-n._handleWidth||i>0)))return n._dragEnd=i,n.$container.css("margin-left",n._dragEnd+"px")}}(this),"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(n){return function(t){var i;if(n._dragStart)return t.preventDefault(),n.options.animate&&n.$wrapper.addClass(n.options.baseClass+"-animate"),n._dragEnd?(i=n._dragEnd>-(n._handleWidth/2),n._dragEnd=!1,n.state(n.options.inverse?!i:i)):n.state(!n.options.state),n._dragStart=!1}}(this),"mouseleave.bootstrapSwitch":function(n){return function(){return n.$label.trigger("mouseup.bootstrapSwitch")}}(this)})},n.prototype._externalLabelHandler=function(){var n;return n=this.$element.closest("label"),n.on("click",function(t){return function(i){return i.preventDefault(),i.stopImmediatePropagation(),i.target===n[0]?t.toggleState():void 0}}(this))},n.prototype._formHandler=function(){var n;return n=this.$element.closest("form"),n.data("bootstrap-switch")?void 0:n.on("reset.bootstrapSwitch",function(){return i.setTimeout(function(){return n.find("input").filter(function(){return t(this).data("bootstrap-switch")}).each(function(){return t(this).bootstrapSwitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},n.prototype._getClasses=function(n){var u,r,i,f;if(!t.isArray(n))return[this.options.baseClass+"-"+n];for(r=[],i=0,f=n.length;f>i;i++)u=n[i],r.push(this.options.baseClass+"-"+u);return r},n}(),t.fn.bootstrapSwitch=function(){var f,i,u;return i=arguments[0],f=2<=arguments.length?n.call(arguments,1):[],u=this,this.each(function(){var e,n;return e=t(this),n=e.data("bootstrap-switch"),n||e.data("bootstrap-switch",n=new r(this,i)),"string"==typeof i?u=n[i].apply(n,f):void 0}),u},t.fn.bootstrapSwitch.Constructor=r,t.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:"&nbsp;",handleWidth:"auto",labelWidth:"auto",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function(){},onSwitchChange:function(){}}}(window.jQuery,window)}).call(this);!function(n){"use strict";if("function"==typeof bootstrap)bootstrap("promise",n);else if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define(n);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=n}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var t="undefined"!=typeof window?window:self,i=t.Q;t.Q=n();t.Q.noConflict=function(){return t.Q=i,this}}}(function(){"use strict";function s(n){return function(){return bi.apply(n,arguments)}}function wt(n){return n===Object(n)}function bt(n){return"[object StopIteration]"===gi(n)||n instanceof k}function rt(n,t){var r,i,u;if(y&&t.stack&&"object"==typeof n&&null!==n&&n.stack&&-1===n.stack.indexOf(tt)){for(r=[],i=t;i;i=i.source)i.stack&&r.unshift(i.stack);r.unshift(n.stack);u=r.join("\n"+tt+"\n");n.stack=kt(u)}}function kt(n){for(var t,r=n.split("\n"),u=[],i=0;i<r.length;++i)t=r[i],gt(t)||dt(t)||!t||u.push(t);return u.join("\n")}function dt(n){return-1!==n.indexOf("(module.js:")||-1!==n.indexOf("(node.js:")}function ut(n){var r=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(n),t,i;return r?[r[1],Number(r[2])]:(t=/at ([^ ]+):(\d+):(?:\d+)$/.exec(n),t)?[t[1],Number(t[2])]:(i=/.*@(.+):(\d+)$/.exec(n),i?[i[1],Number(i[2])]:void 0)}function gt(n){var t=ut(n),r,i;return t?(r=t[0],i=t[1],r===vt&&i>=wi&&pt>=i):!1}function ft(){if(y)try{throw new Error;}catch(i){var n=i.stack.split("\n"),r=n[0].indexOf("@")>0?n[1]:n[2],t=ut(r);return t?(vt=t[0],t[1]):void 0}}function ni(n,t,i){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+i+" instead.",new Error("").stack),n.apply(n,arguments)}}function n(n){return n instanceof t?n:st(n)?ei(n):b(n)}function r(){function l(t){f=t;e.source=t;c(h,function(i,r){n.nextTick(function(){t.promiseDispatch.apply(t,r)})},void 0);h=void 0;a=void 0}var f,h=[],a=[],s=nt(r.prototype),e=nt(t.prototype);if(e.promiseDispatch=function(t,r,u){var e=i(arguments);h?(h.push(e),"when"===r&&u[1]&&a.push(u[1])):n.nextTick(function(){f.promiseDispatch.apply(f,e)})},e.valueOf=function(){if(h)return e;var n=ot(f);return o(n)&&(f=n),n},e.inspect=function(){return f?f.inspect():{state:"pending"}},n.longStackSupport&&y)try{throw new Error;}catch(v){e.stack=v.stack.substring(v.stack.indexOf("\n")+1)}return s.promise=e,s.resolve=function(t){f||l(n(t))},s.fulfill=function(n){f||l(b(n))},s.reject=function(n){f||l(u(n))},s.notify=function(t){f||c(a,function(i,r){n.nextTick(function(){r(t)})},void 0)},s}function e(n){if("function"!=typeof n)throw new TypeError("resolver must be a function.");var t=r();try{n(t.resolve,t.reject,t.notify)}catch(i){t.reject(i)}return t.promise}function et(t){return e(function(i,r){for(var u=0,f=t.length;f>u;u++)n(t[u]).then(i,r)})}function t(n,i,r){var f,e;return void 0===i&&(i=function(n){return u(new Error("Promise does not support operation: "+n))}),void 0===r&&(r=function(){return{state:"unknown"}}),f=nt(t.prototype),(f.promiseDispatch=function(t,r,e){var o;try{o=n[r]?n[r].apply(f,e):i.call(f,r,e)}catch(s){o=u(s)}t&&t(o)},f.inspect=r,r)&&(e=r(),"rejected"===e.state&&(f.exception=e.reason),f.valueOf=function(){var n=r();return"pending"===n.state||"rejected"===n.state?f:n.value}),f}function f(t,i,r,u){return n(t).then(i,r,u)}function ot(n){if(o(n)){var t=n.inspect();if("fulfilled"===t.state)return t.value}return n}function o(n){return n instanceof t}function st(n){return wt(n)&&"function"==typeof n.then}function ti(n){return o(n)&&"pending"===n.inspect().state}function ii(n){return!o(n)||"fulfilled"===n.inspect().state}function ri(n){return o(n)&&"rejected"===n.inspect().state}function w(){l.length=0;a.length=0;v||(v=!0)}function ui(t,i){v&&("object"==typeof process&&"function"==typeof process.emit&&n.nextTick.runAfter(function(){-1!==d(a,t)&&(process.emit("unhandledRejection",i,t),it.push(t))}),a.push(t),l.push(i&&"undefined"!=typeof i.stack?i.stack:"(no stack) "+i))}function fi(t){if(v){var i=d(a,t);-1!==i&&("object"==typeof process&&"function"==typeof process.emit&&n.nextTick.runAfter(function(){var n=d(it,t);-1!==n&&(process.emit("rejectionHandled",l[i],t),it.splice(n,1))}),a.splice(i,1),l.splice(i,1))}}function u(n){var i=t({when:function(t){return t&&fi(this),t?t(n):this}},function(){return this},function(){return{state:"rejected",reason:n}});return ui(i,n),i}function b(n){return t({when:function(){return n},get:function(t){return n[t]},set:function(t,i){n[t]=i},"delete":function(t){delete n[t]},post:function(t,i){return null===t||void 0===t?n.apply(void 0,i):n[t].apply(n,i)},apply:function(t,i){return n.apply(t,i)},keys:function(){return di(n)}},void 0,function(){return{state:"fulfilled",value:n}})}function ei(t){var i=r();return n.nextTick(function(){try{t.then(i.resolve,i.reject,i.notify)}catch(n){i.reject(n)}}),i.promise}function oi(i){return t({isDef:function(){}},function(n,t){return ct(i,n,t)},function(){return n(i).inspect()})}function ht(t,i,r){return n(t).spread(i,r)}function si(t){return function(){function i(t,i){var s;if("undefined"==typeof StopIteration){try{s=e[t](i)}catch(h){return u(h)}return s.done?n(s.value):f(s.value,r,o)}try{s=e[t](i)}catch(h){return bt(h)?n(h.value):u(h)}return f(s,r,o)}var e=t.apply(this,arguments),r=i.bind(i,"next"),o=i.bind(i,"throw");return r()}}function hi(t){n.done(n.async(t)())}function ci(n){throw new k(n);}function li(n){return function(){return ht([this,h(arguments)],function(t,i){return n.apply(t,i)})}}function ct(t,i,r){return n(t).dispatch(i,r)}function h(n){return f(n,function(n){var i=0,t=r();return c(n,function(r,u,e){var s;o(u)&&"fulfilled"===(s=u.inspect()).state?n[e]=s.value:(++i,f(u,function(r){n[e]=r;0==--i&&t.resolve(n)},t.reject,function(n){t.notify({index:e,value:n})}))},void 0),0===i&&t.resolve(n),t.promise})}function lt(t){if(0===t.length)return n.resolve();var i=n.defer(),r=0;return c(t,function(n,u,e){function o(n){i.resolve(n)}function s(){r--;0===r&&i.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function h(n){i.notify({index:e,value:n})}var c=t[e];r++;f(c,o,s,h)},void 0),i.promise}function at(t){return f(t,function(t){return t=g(t,n),f(h(g(t,function(n){return f(n,yt,yt)})),function(){return t})})}function ai(t){return n(t).allSettled()}function vi(t,i){return n(t).then(void 0,void 0,i)}function yi(t,i){return n(t).nodeify(i)}var y=!1,tt,pt;try{throw new Error;}catch(pi){y=!!pi.stack}var vt,k,wi=ft(),yt=function(){},p=function(){function n(){for(var n,i;t.next;)t=t.next,n=t.task,t.task=void 0,i=t.domain,i&&(t.domain=void 0,i.enter()),s(n,i);for(;e.length;)n=e.pop(),s(n);r=!1}function s(t,i){try{t()}catch(r){if(f)throw i&&i.exit(),setTimeout(n,0),i&&i.enter(),r;setTimeout(function(){throw r;},0)}i&&i.exit()}var t={task:void 0,next:null},h=t,r=!1,i=void 0,f=!1,e=[],u,o;return(p=function(n){h=h.next={task:n,domain:f&&process.domain,next:null};r||(r=!0,i())},"object"==typeof process&&"[object process]"===process.toString()&&process.nextTick)?(f=!0,i=function(){process.nextTick(n)}):"function"==typeof setImmediate?i="undefined"!=typeof window?setImmediate.bind(window,n):function(){setImmediate(n)}:"undefined"!=typeof MessageChannel?(u=new MessageChannel,u.port1.onmessage=function(){i=o;u.port1.onmessage=n;n()},o=function(){u.port2.postMessage(0)},i=function(){setTimeout(n,0);o()}):i=function(){setTimeout(n,0)},p.runAfter=function(n){e.push(n);r||(r=!0,i())},p}(),bi=Function.call,i=s(Array.prototype.slice),c=s(Array.prototype.reduce||function(n,t){var i=0,r=this.length;if(1===arguments.length)for(;;){if(i in this){t=this[i++];break}if(++i>=r)throw new TypeError;}for(;r>i;i++)i in this&&(t=n(t,this[i],i));return t}),d=s(Array.prototype.indexOf||function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return t;return-1}),g=s(Array.prototype.map||function(n,t){var i=this,r=[];return c(i,function(u,f,e){r.push(n.call(t,f,e,i))},void 0),r}),nt=Object.create||function(n){function t(){}return t.prototype=n,new t},ki=s(Object.prototype.hasOwnProperty),di=Object.keys||function(n){var i=[],t;for(t in n)ki(n,t)&&i.push(t);return i},gi=s(Object.prototype.toString);k="undefined"!=typeof ReturnValue?ReturnValue:function(n){this.value=n};tt="From previous event:";n.resolve=n;n.nextTick=p;n.longStackSupport=!1;"object"==typeof process&&process&&process.env&&process.env.Q_DEBUG&&(n.longStackSupport=!0);n.defer=r;r.prototype.makeNodeResolver=function(){var n=this;return function(t,r){t?n.reject(t):n.resolve(arguments.length>2?i(arguments,1):r)}};n.Promise=e;n.promise=e;e.race=et;e.all=h;e.reject=u;e.resolve=n;n.passByCopy=function(n){return n};t.prototype.passByCopy=function(){return this};n.join=function(t,i){return n(t).join(i)};t.prototype.join=function(t){return n([this,t]).spread(function(n,t){if(n===t)return n;throw new Error("Can't join: not the same: "+n+" "+t);})};n.race=et;t.prototype.race=function(){return this.then(n.race)};n.makePromise=t;t.prototype.toString=function(){return"[object Promise]"};t.prototype.then=function(t,i,f){function h(n){try{return"function"==typeof t?t(n):n}catch(i){return u(i)}}function c(n){if("function"==typeof i){rt(n,s);try{return i(n)}catch(t){return u(t)}}return u(n)}function l(n){return"function"==typeof f?f(n):n}var s=this,e=r(),o=!1;return n.nextTick(function(){s.promiseDispatch(function(n){o||(o=!0,e.resolve(h(n)))},"when",[function(n){o||(o=!0,e.resolve(c(n)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(t){var i,r=!1;try{i=l(t)}catch(u){if(r=!0,!n.onerror)throw u;n.onerror(u)}r||e.notify(i)}]),e.promise};n.tap=function(t,i){return n(t).tap(i)};t.prototype.tap=function(t){return t=n(t),this.then(function(n){return t.fcall(n).thenResolve(n)})};n.when=f;t.prototype.thenResolve=function(n){return this.then(function(){return n})};n.thenResolve=function(t,i){return n(t).thenResolve(i)};t.prototype.thenReject=function(n){return this.then(function(){throw n;})};n.thenReject=function(t,i){return n(t).thenReject(i)};n.nearer=ot;n.isPromise=o;n.isPromiseAlike=st;n.isPending=ti;t.prototype.isPending=function(){return"pending"===this.inspect().state};n.isFulfilled=ii;t.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state};n.isRejected=ri;t.prototype.isRejected=function(){return"rejected"===this.inspect().state};var l=[],a=[],it=[],v=!0;return n.resetUnhandledRejections=w,n.getUnhandledReasons=function(){return l.slice()},n.stopUnhandledRejectionTracking=function(){w();v=!1},w(),n.reject=u,n.fulfill=b,n.master=oi,n.spread=ht,t.prototype.spread=function(n,t){return this.all().then(function(t){return n.apply(void 0,t)},t)},n.async=si,n.spawn=hi,n["return"]=ci,n.promised=li,n.dispatch=ct,t.prototype.dispatch=function(t,i){var f=this,u=r();return n.nextTick(function(){f.promiseDispatch(u.resolve,t,i)}),u.promise},n.get=function(t,i){return n(t).dispatch("get",[i])},t.prototype.get=function(n){return this.dispatch("get",[n])},n.set=function(t,i,r){return n(t).dispatch("set",[i,r])},t.prototype.set=function(n,t){return this.dispatch("set",[n,t])},n.del=n["delete"]=function(t,i){return n(t).dispatch("delete",[i])},t.prototype.del=t.prototype["delete"]=function(n){return this.dispatch("delete",[n])},n.mapply=n.post=function(t,i,r){return n(t).dispatch("post",[i,r])},t.prototype.mapply=t.prototype.post=function(n,t){return this.dispatch("post",[n,t])},n.send=n.mcall=n.invoke=function(t,r){return n(t).dispatch("post",[r,i(arguments,2)])},t.prototype.send=t.prototype.mcall=t.prototype.invoke=function(n){return this.dispatch("post",[n,i(arguments,1)])},n.fapply=function(t,i){return n(t).dispatch("apply",[void 0,i])},t.prototype.fapply=function(n){return this.dispatch("apply",[void 0,n])},n["try"]=n.fcall=function(t){return n(t).dispatch("apply",[void 0,i(arguments,1)])},t.prototype.fcall=function(){return this.dispatch("apply",[void 0,i(arguments)])},n.fbind=function(t){var r=n(t),u=i(arguments,1);return function(){return r.dispatch("apply",[this,u.concat(i(arguments))])}},t.prototype.fbind=function(){var n=this,t=i(arguments);return function(){return n.dispatch("apply",[this,t.concat(i(arguments))])}},n.keys=function(t){return n(t).dispatch("keys",[])},t.prototype.keys=function(){return this.dispatch("keys",[])},n.all=h,t.prototype.all=function(){return h(this)},n.any=lt,t.prototype.any=function(){return lt(this)},n.allResolved=ni(at,"allResolved","allSettled"),t.prototype.allResolved=function(){return at(this)},n.allSettled=ai,t.prototype.allSettled=function(){return this.then(function(t){return h(g(t,function(t){function i(){return t.inspect()}return t=n(t),t.then(i,i)}))})},n.fail=n["catch"]=function(t,i){return n(t).then(void 0,i)},t.prototype.fail=t.prototype["catch"]=function(n){return this.then(void 0,n)},n.progress=vi,t.prototype.progress=function(n){return this.then(void 0,void 0,n)},n.fin=n["finally"]=function(t,i){return n(t)["finally"](i)},t.prototype.fin=t.prototype["finally"]=function(t){return t=n(t),this.then(function(n){return t.fcall().then(function(){return n})},function(n){return t.fcall().then(function(){throw n;})})},n.done=function(t,i,r,u){return n(t).done(i,r,u)},t.prototype.done=function(t,i,r){var u=function(t){n.nextTick(function(){if(rt(t,f),!n.onerror)throw t;n.onerror(t)})},f=t||i||r?this.then(t,i,r):this;"object"==typeof process&&process&&process.domain&&(u=process.domain.bind(u));f.then(void 0,u)},n.timeout=function(t,i,r){return n(t).timeout(i,r)},t.prototype.timeout=function(n,t){var i=r(),u=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+n+" ms"),t.code="ETIMEDOUT");i.reject(t)},n);return this.then(function(n){clearTimeout(u);i.resolve(n)},function(n){clearTimeout(u);i.reject(n)},i.notify),i.promise},n.delay=function(t,i){return void 0===i&&(i=t,t=void 0),n(t).delay(i)},t.prototype.delay=function(n){return this.then(function(t){var i=r();return setTimeout(function(){i.resolve(t)},n),i.promise})},n.nfapply=function(t,i){return n(t).nfapply(i)},t.prototype.nfapply=function(n){var t=r(),u=i(n);return u.push(t.makeNodeResolver()),this.fapply(u).fail(t.reject),t.promise},n.nfcall=function(t){var r=i(arguments,1);return n(t).nfapply(r)},t.prototype.nfcall=function(){var t=i(arguments),n=r();return t.push(n.makeNodeResolver()),this.fapply(t).fail(n.reject),n.promise},n.nfbind=n.denodeify=function(t){var u=i(arguments,1);return function(){var e=u.concat(i(arguments)),f=r();return e.push(f.makeNodeResolver()),n(t).fapply(e).fail(f.reject),f.promise}},t.prototype.nfbind=t.prototype.denodeify=function(){var t=i(arguments);return t.unshift(this),n.denodeify.apply(void 0,t)},n.nbind=function(t,u){var f=i(arguments,2);return function(){function s(){return t.apply(u,arguments)}var o=f.concat(i(arguments)),e=r();return o.push(e.makeNodeResolver()),n(s).fapply(o).fail(e.reject),e.promise}},t.prototype.nbind=function(){var t=i(arguments,0);return t.unshift(this),n.nbind.apply(void 0,t)},n.nmapply=n.npost=function(t,i,r){return n(t).npost(i,r)},t.prototype.nmapply=t.prototype.npost=function(n,t){var f=i(t||[]),u=r();return f.push(u.makeNodeResolver()),this.dispatch("post",[n,f]).fail(u.reject),u.promise},n.nsend=n.nmcall=n.ninvoke=function(t,u){var e=i(arguments,2),f=r();return e.push(f.makeNodeResolver()),n(t).dispatch("post",[u,e]).fail(f.reject),f.promise},t.prototype.nsend=t.prototype.nmcall=t.prototype.ninvoke=function(n){var u=i(arguments,1),t=r();return u.push(t.makeNodeResolver()),this.dispatch("post",[n,u]).fail(t.reject),t.promise},n.nodeify=yi,t.prototype.nodeify=function(t){return t?void this.then(function(i){n.nextTick(function(){t(null,i)})},function(i){n.nextTick(function(){t(i)})}):this},n.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global");},pt=ft(),n}),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):jQuery.sammy=window.Sammy=n(jQuery)}(function(n){var t,p="([^/]+)",s=/:([\w\d]+)/g,c=/\?([^#]*)?$/,r=function(n){return Array.prototype.slice.call(n)},i=function(n){return Object.prototype.toString.call(n)==="[object Function]"},u=function(n){return Object.prototype.toString.call(n)==="[object Array]"},l=function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},e=function(n){return decodeURIComponent((n||"").replace(/\+/g," "))},a=encodeURIComponent,v=function(n){return String(n).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},f=function(n){return function(){return this.route.apply(this,[n].concat(Array.prototype.slice.call(arguments)))}},h={},o=!!(window.history&&history.pushState),y=[];return t=function(){var u=r(arguments),f,e;return(t.apps=t.apps||{},u.length===0||u[0]&&i(u[0]))?t.apply(t,["body"].concat(u)):typeof(e=u.shift())=="string"?(f=t.apps[e]||new t.Application,f.element_selector=e,u.length>0&&n.each(u,function(n,t){f.use(t)}),f.element_selector!=e&&delete t.apps[e],t.apps[f.element_selector]=f,f):void 0},t.VERSION="0.7.5",t.addLogger=function(n){y.push(n)},t.log=function(){var i=r(arguments);i.unshift("["+Date()+"]");n.each(y,function(n,r){r.apply(t,i)})},typeof window.console!="undefined"?typeof window.console.log=="function"&&i(window.console.log.apply)?t.addLogger(function(){window.console.log.apply(window.console,arguments)}):t.addLogger(function(){window.console.log(arguments)}):typeof console!="undefined"&&t.addLogger(function(){console.log.apply(console,arguments)}),n.extend(t,{makeArray:r,isFunction:i,isArray:u}),t.Object=function(t){return n.extend(this,t||{})},n.extend(t.Object.prototype,{escapeHTML:v,h:v,toHash:function(){var t={};return n.each(this,function(n,r){i(r)||(t[n]=r)}),t},toHTML:function(){var t="";return n.each(this,function(n,r){i(r)||(t+="<strong>"+n+"<\/strong> "+r+"<br />")}),t},keys:function(n){var r=[],t;for(t in this)i(this[t])&&n||r.push(t);return r},has:function(t){return this[t]&&n.trim(this[t].toString())!==""},join:function(){var n=r(arguments),t=n.shift();return n.join(t)},log:function(){t.log.apply(t,arguments)},toString:function(t){var r=[];return n.each(this,function(n,u){(!i(u)||t)&&r.push('"'+n+'": '+u.toString())}),"Sammy.Object: {"+r.join(",")+"}"}}),t.targetIsThisWindow=function(t,i){var u=n(t.target).closest(i),r;return u.length===0?!0:(r=u.attr("target"),!r||r===window.name||r==="_self")?!0:r==="_blank"?!1:r==="top"&&window===window.top?!0:!1},t.DefaultLocationProxy=function(n,t){this.app=n;this.is_native=!1;this.has_history=o;this._startPolling(t)},t.DefaultLocationProxy.fullPath=function(n){var t=n.toString().match(/^[^#]*(#.+)$/),i=t?t[1]:"";return[n.pathname,n.search,i].join("")},n.extend(t.DefaultLocationProxy.prototype,{bind:function(){var u=this,r=this.app,i=t.DefaultLocationProxy;n(window).bind("hashchange."+this.app.eventNamespace(),function(n,t){u.is_native!==!1||t||(u.is_native=!0,window.clearInterval(i._interval),i._interval=null);r.trigger("location-changed")});o&&!r.disable_push_state&&(n(window).bind("popstate."+this.app.eventNamespace(),function(){r.trigger("location-changed")}),n(document).delegate("a","click.history-"+this.app.eventNamespace(),function(n){if(!n.isDefaultPrevented()&&!n.metaKey&&!n.ctrlKey){var f=i.fullPath(this),e=this.hostname?this.hostname:function(n){var t=document.createElement("a");return t.href=n.href,t.hostname}(this);if(e==window.location.hostname&&r.lookupRoute("get",f)&&t.targetIsThisWindow(n,"a"))return n.preventDefault(),u.setLocation(f),!1}}));i._bindings||(i._bindings=0);i._bindings++},unbind:function(){n(window).unbind("hashchange."+this.app.eventNamespace());n(window).unbind("popstate."+this.app.eventNamespace());n(document).undelegate("a","click.history-"+this.app.eventNamespace());t.DefaultLocationProxy._bindings--;t.DefaultLocationProxy._bindings<=0&&(window.clearInterval(t.DefaultLocationProxy._interval),t.DefaultLocationProxy._interval=null)},getLocation:function(){return t.DefaultLocationProxy.fullPath(window.location)},setLocation:function(n){if(/^([^#\/]|$)/.test(n)&&(n=o&&!this.app.disable_push_state?"/"+n:"#!/"+n),n!=this.getLocation())if(o&&!this.app.disable_push_state&&/^\//.test(n))history.pushState({path:n},window.title,n),this.app.trigger("location-changed");else return window.location=n},_startPolling:function(i){var u=this,r;t.DefaultLocationProxy._interval||(i||(i=10),r=function(){var i=u.getLocation();(typeof t.DefaultLocationProxy._last_location=="undefined"||i!=t.DefaultLocationProxy._last_location)&&window.setTimeout(function(){n(window).trigger("hashchange",[!0])},0);t.DefaultLocationProxy._last_location=i},r(),t.DefaultLocationProxy._interval=window.setInterval(r,i))}}),t.Application=function(n){var r=this;this.routes={};this.listeners=new t.Object({});this.arounds=[];this.befores=[];this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10);this.context_prototype=function(){t.EventContext.apply(this,arguments)};this.context_prototype.prototype=new t.EventContext;i(n)&&n.apply(this,[this]);this._location_proxy||this.setLocationProxy(new t.DefaultLocationProxy(this,this.run_interval_every));this.debug&&this.bindToAllEvents(function(n,t){r.log(r.toString(),n.cleaned_type,t||{})})},t.Application.prototype=n.extend({},t.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:!1,element_selector:"body",debug:!1,raise_errors:!1,run_interval_every:50,disable_push_state:!1,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(t){return t?n(this.element_selector).find(t):n(this.element_selector)},use:function(){var u=r(arguments),n=u.shift(),f=n||"";try{u.unshift(this);typeof n=="string"&&(f="Sammy."+n,n=t[n]);n.apply(this,u)}catch(e){typeof n=="undefined"?this.error("Plugin Error: called use() but plugin ("+f.toString()+") is not defined",e):i(n)?this.error("Plugin Error",e):this.error("Plugin Error: called use() but '"+f.toString()+"' is not a function",e)}return this},setLocationProxy:function(n){var t=this._location_proxy;this._location_proxy=n;this.isRunning()&&(t&&t.unbind(),this._location_proxy.bind())},log:function(){t.log.apply(t,Array.prototype.concat.apply([this.element_selector],arguments))},route:function(t,r){var f=this,o=[],e,h,u=Array.prototype.slice.call(arguments,2);if(u.length===0&&i(r)&&(u=[r],r=t,t="any"),t=t.toLowerCase(),r.constructor==String){for(s.lastIndex=0;(h=s.exec(r))!==null;)o.push(h[1]);r=new RegExp(r.replace(s,p)+"$")}return n.each(u,function(n,t){typeof t=="string"&&(u[n]=f[t])}),e=function(n){var t={verb:n,path:r,callback:u,param_names:o};f.routes[n]=f.routes[n]||[];f.routes[n].push(t)},t==="any"?n.each(this.ROUTE_VERBS,function(n,t){e(t)}):e(t),this},get:f("get"),post:f("post"),put:f("put"),del:f("delete"),any:f("any"),mapRoutes:function(t){var i=this;return n.each(t,function(n,t){i.route.apply(i,t)}),this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(n,t,i){var r=this,u;return typeof i=="undefined"&&(i=t),u=function(){var t,u,n;t=arguments[0];n=arguments[1];n&&n.context?(u=n.context,delete n.context):u=new r.context_prototype(r,"bind",t.type,n,t.target);t.cleaned_type=t.type.replace(r.eventNamespace(),"");i.apply(u,[t,n])},this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(u),this.isRunning()&&this._listen(n,u),this},trigger:function(n,t){return this.$element().trigger([n,this.eventNamespace()].join("."),[t]),this},refresh:function(){return this.last_location=null,this.trigger("location-changed"),this},before:function(n,t){return i(n)&&(t=n,n={}),this.befores.push([n,t]),this},after:function(n){return this.bind("event-context-after",n)},around:function(n){return this.arounds.push(n),this},onComplete:function(n){return this._onComplete=n,this},isRunning:function(){return this._running},helpers:function(t){return n.extend(this.context_prototype.prototype,t),this},helper:function(n,t){return this.context_prototype.prototype[n]=t,this},run:function(i){if(this.isRunning())return!1;var r=this;return n.each(this.listeners.toHash(),function(t,i){n.each(i,function(n,i){r._listen(t,i)})}),this.trigger("run",{start_url:i}),this._running=!0,this.last_location=null,/\#(.+)/.test(this.getLocation())||typeof i=="undefined"||this.setLocation(i),this._checkLocation(),this._location_proxy.bind(),this.bind("location-changed",function(){r._checkLocation()}),this.bind("submit",function(i){if(!t.targetIsThisWindow(i,"form"))return!0;var u=r._checkFormSubmission(n(i.target).closest("form"));return u===!1?i.preventDefault():!1}),n(window).bind("unload",function(){r.unload()}),this.trigger("changed")},unload:function(){if(!this.isRunning())return!1;var t=this;return this.trigger("unload"),this._location_proxy.unbind(),this.$element().unbind("submit").removeClass(t.eventNamespace()),n.each(this.listeners.toHash(),function(i,r){n.each(r,function(n,r){t._unlisten(i,r)})}),this._running=!1,this},destroy:function(){return this.unload(),delete t.apps[this.element_selector],this},bindToAllEvents:function(t){var i=this;return n.each(this.APP_EVENTS,function(n,r){i.bind(r,t)}),n.each(this.listeners.keys(!0),function(r,u){n.inArray(u,i.APP_EVENTS)==-1&&i.bind(u,t)}),this},routablePath:function(n){return n.replace(c,"")},lookupRoute:function(n,t){var e=this,u=!1,i=0,f,r;if(typeof this.routes[n]!="undefined")for(f=this.routes[n].length;i<f;i++)if(r=this.routes[n][i],e.routablePath(t).match(r.path)){u=r;break}return u},runRoute:function(t,i,r,u){var s=this,f=this.lookupRoute(t,i),o,c,y,l,a,h,v,p;if(this.debug&&this.log("runRoute",[t,i].join(" ")),this.trigger("run-route",{verb:t,path:i,params:r}),typeof r=="undefined"&&(r={}),n.extend(r,this._parseQueryString(i)),f){this.trigger("route-found",{route:f});(v=f.path.exec(this.routablePath(i)))!==null&&(v.shift(),n.each(v,function(n,t){f.param_names[n]?r[f.param_names[n]]=e(t):(r.splat||(r.splat=[]),r.splat.push(e(t)))}));o=new this.context_prototype(this,t,i,r,u);y=this.arounds.slice(0);l=this.befores.slice(0);h=[o];r.splat&&(h=h.concat(r.splat));c=function(){for(var n,t,i;l.length>0;)if(a=l.shift(),s.contextMatchesOptions(o,a[0])&&(n=a[1].apply(o,[o]),n===!1))return!1;return s.last_route=f,o.trigger("event-context-before",{context:o}),typeof f.callback=="function"&&(f.callback=[f.callback]),f.callback&&f.callback.length&&(t=-1,i=function(){t++;f.callback[t]?n=f.callback[t].apply(o,h):s._onComplete&&typeof(s._onComplete==="function")&&s._onComplete(o)},h.push(i),i()),o.trigger("event-context-after",{context:o}),n};n.each(y.reverse(),function(n,t){var i=c;c=function(){return t.apply(o,[i])}});try{p=c()}catch(w){this.error(["500 Error",t,i].join(" "),w)}return p}return this.notFound(t,i)},contextMatchesOptions:function(t,i,r){var f=i,h,e,a,v,c,o,s;if((typeof f=="string"||l(f))&&(f={path:f}),typeof r=="undefined"&&(r=!0),n.isEmptyObject(f))return!0;if(u(f.path)){for(h=[],e=0,v=f.path.length;e<v;e+=1)a=n.extend({},f,{path:f.path[e]}),h.push(this.contextMatchesOptions(t,a));return c=n.inArray(!0,h)>-1?!0:!1,r?c:!c}return f.only?this.contextMatchesOptions(t,f.only,!0):f.except?this.contextMatchesOptions(t,f.except,!1):(o=!0,s=!0,f.path&&(l(f.path)||(f.path=new RegExp(f.path.toString()+"$")),o=f.path.test(t.path)),f.verb&&(s=typeof f.verb=="string"?f.verb===t.verb:f.verb.indexOf(t.verb)>-1),r?s&&o:!(s&&o))},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(n){return this._location_proxy.setLocation(n)},swap:function(n,t){var r=this.$element().html(n);return i(t)&&t(n),r},templateCache:function(n,t){return typeof t!="undefined"?h[n]=t:h[n]},clearTemplateCache:function(){return h={}},notFound:function(n,t){var i=this.error(["404 Not Found",n,t].join(" "));return n==="get"?i:!0},error:function(n,t){if(t||(t=new Error),t.message=[n,t.message].join(" "),this.trigger("error",{message:t.message,error:t}),this.raise_errors)throw t;else this.log(t.message,t)},_checkLocation:function(){var n,t;return n=this.getLocation(),this.last_location&&this.last_location[0]=="get"&&this.last_location[1]==n||(this.last_location=["get",n],t=this.runRoute("get",n)),t},_getFormVerb:function(t){var u=n(t),i,r;return r=u.find('input[name="_method"]'),r.length>0&&(i=r.val()),i||(i=u[0].getAttribute("method")),i&&i!==""||(i="get"),n.trim(i.toString().toLowerCase())},_checkFormSubmission:function(t){var i,r,f,u,e;return this.trigger("check-form-submission",{form:t}),i=n(t),r=i.attr("action")||"",f=this._getFormVerb(i),this.debug&&this.log("_checkFormSubmission",i,r,f),f==="get"?(u=this._serializeFormParams(i),u!==""&&(r+="?"+u),this.setLocation(r),e=!1):(u=n.extend({},this._parseFormParams(i)),e=this.runRoute(f,r,u,t.get(0))),typeof e=="undefined"?!1:e},_serializeFormParams:function(n){var r="",t=n.serializeArray(),i;if(t.length>0)for(r=this._encodeFormPair(t[0].name,t[0].value),i=1;i<t.length;i++)r=r+"&"+this._encodeFormPair(t[i].name,t[i].value);return r},_encodeFormPair:function(n,t){return a(n)+"="+a(t)},_parseFormParams:function(n){for(var i={},r=n.serializeArray(),t=0;t<r.length;t++)i=this._parseParamPair(i,r[t].name,r[t].value);return i},_parseQueryString:function(n){var r={},t,u,f,i;if(t=n.match(c),t&&t[1])for(u=t[1].split("&"),i=0;i<u.length;i++)f=u[i].split("="),r=this._parseParamPair(r,e(f[0]),e(f[1]||""));return r},_parseParamPair:function(n,t,i){return typeof n[t]!="undefined"?u(n[t])?n[t].push(i):n[t]=[n[t],i]:n[t]=i,n},_listen:function(n,t){return this.$element().bind([n,this.eventNamespace()].join("."),t)},_unlisten:function(n,t){return this.$element().unbind([n,this.eventNamespace()].join("."),t)}}),t.RenderContext=function(n){this.event_context=n;this.callbacks=[];this.previous_content=null;this.content=null;this.next_engine=!1;this.waiting=!1},t.RenderContext.prototype=n.extend({},t.Object.prototype,{then:function(n){var r,t;if(!i(n))if(typeof n=="string"&&n in this.event_context)r=this.event_context[n],n=function(n){return r.apply(this.event_context,[n])};else return this;return t=this,this.waiting?this.callbacks.push(n):(this.wait(),window.setTimeout(function(){var i=n.apply(t,[t.content,t.previous_content]);i!==!1&&t.next(i)},0)),this},wait:function(){this.waiting=!0},next:function(n){this.waiting=!1;typeof n!="undefined"&&(this.previous_content=this.content,this.content=n);this.callbacks.length>0&&this.then(this.callbacks.shift())},load:function(t,r,u){var f=this;return this.then(function(){var e,s,o;return(i(r)?(u=r,r={}):r=n.extend({},r),u&&this.then(u),typeof t=="string")?(o=t.match(/\.json(\?|$)/)||r.json,e=o?r.cache===!0:r.cache!==!1,f.next_engine=f.event_context.engineFor(t),delete r.cache,delete r.json,r.engine&&(f.next_engine=r.engine,delete r.engine),e&&(s=this.event_context.app.templateCache(t)))?s:(this.wait(),n.ajax(n.extend({url:t,data:{},dataType:o?"json":"text",type:"get",success:function(n){e&&f.event_context.app.templateCache(t,n);f.next(n)}},r)),!1):t.nodeType?t.innerHTML:t.selector?(f.next_engine=t.attr("data-engine"),r.clone===!1?t.remove()[0].innerHTML.toString():t[0].innerHTML.toString()):void 0})},loadPartials:function(n){var t;if(n){this.partials=this.partials||{};for(t in n)(function(t,i){t.load(n[i]).then(function(n){this.partials[i]=n})})(this,t)}return this},render:function(n,t,r,u){return i(n)&&!t?this.then(n):(i(t)?(u=r,r=t,t=null):r&&!i(r)&&(u=r,r=null),this.loadPartials(u).load(n).interpolate(t,n).then(r))},partial:function(n,t,r,u){return i(r)?this.render(n,t,u).swap(r):i(t)?this.render(n,{},r).swap(t):this.render(n,t,r).swap()},send:function(){var t=this,n=r(arguments),i=n.shift();return u(n[0])&&(n=n[0]),this.then(function(){return n.push(function(n){t.next(n)}),t.wait(),i.apply(i,n),!1})},collect:function(t,r,u){var e=this,f=function(){i(t)&&(r=t,t=this.content);var u=[],f=!1;return n.each(t,function(n,t){var i=r.apply(e,[n,t]);return i.jquery&&i.length==1&&(i=i[0],f=!0),u.push(i),i}),f?u:u.join("")};return u?f():this.then(f)},renderEach:function(t,i,r,f){return u(i)&&(f=r,r=i,i=null),this.load(t).then(function(e){var o=this;if(r||(r=u(this.previous_content)?this.previous_content:[]),f)n.each(r,function(n,r){var u={},s=this.next_engine||t;i?u[i]=r:u=r;f(r,o.event_context.interpolate(e,u,s))});else return this.collect(r,function(n,r){var u={},f=this.next_engine||t;return i?u[i]=r:u=r,this.event_context.interpolate(e,u,f)},!0)})},interpolate:function(n,t,i){var r=this;return this.then(function(u,f){!n&&f&&(n=f);this.next_engine&&(t=this.next_engine,this.next_engine=!1);var e=r.event_context.interpolate(u,n,t,this.partials);return i?f+e:e})},swap:function(n){return this.then(function(t){return this.event_context.swap(t,n),t}).trigger("changed",{})},appendTo:function(t){return this.then(function(i){n(t).append(i)}).trigger("changed",{})},prependTo:function(t){return this.then(function(i){n(t).prepend(i)}).trigger("changed",{})},replace:function(t){return this.then(function(i){n(t).html(i)}).trigger("changed",{})},trigger:function(n,t){return this.then(function(i){return typeof t=="undefined"&&(t={content:i}),this.event_context.trigger(n,t),i})}}),t.EventContext=function(n,i,r,u,f){this.app=n;this.verb=i;this.path=r;this.params=new t.Object(u);this.target=f},t.EventContext.prototype=n.extend({},t.Object.prototype,{$element:function(){return this.app.$element(r(arguments).shift())},engineFor:function(n){var t=this,r;return i(n)?n:(n=(n||t.app.template_engine).toString(),(r=n.match(/\.([^\.\?\#]+)(\?|$)/))&&(n=r[1]),n&&i(t[n]))?t[n]:t.app.template_engine?this.engineFor(t.app.template_engine):function(n){return n}},interpolate:function(n,t,i,r){return this.engineFor(i).apply(this,[n,t,r])},render:function(n,i,r,u){return new t.RenderContext(this).render(n,i,r,u)},renderEach:function(n,i,r,u){return new t.RenderContext(this).renderEach(n,i,r,u)},load:function(n,i,r){return new t.RenderContext(this).load(n,i,r)},loadPartials:function(n){return new t.RenderContext(this).loadPartials(n)},partial:function(n,i,r,u){return new t.RenderContext(this).partial(n,i,r,u)},send:function(){var n=new t.RenderContext(this);return n.send.apply(n,arguments)},redirect:function(){var t,i=r(arguments),l=this.app.getLocation(),o=i.length,e;if(o>1){for(var u=0,s=[],h=[],f={},c=!1;u<o;u++)typeof i[u]=="string"?s.push(i[u]):(n.extend(f,i[u]),c=!0);if(t=s.join("/"),c){for(e in f)h.push(this.app._encodeFormPair(e,f[e]));t+="?"+h.join("&")}}else t=i[0];this.trigger("redirect",{to:t});this.app.last_location=[this.verb,this.path];this.app.setLocation(t);new RegExp(t).test(l)&&this.app.trigger("location-changed")},trigger:function(n,t){return typeof t=="undefined"&&(t={}),t.context||(t.context=this),this.app.trigger(n,t)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(n,t){return this.app.swap(n,t)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(t){return n.parseJSON(t)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}}),t}),function(){var n;n=function(){function n(){this.options_index=0;this.parsed=[]}return n.prototype.add_node=function(n){return n.nodeName==="OPTGROUP"?this.add_group(n):this.add_option(n)},n.prototype.add_group=function(n){var i,f,t,e,r,u;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:n.label,children:0,disabled:n.disabled}),r=n.childNodes,u=[],t=0,e=r.length;t<e;t++)f=r[t],u.push(this.add_option(f,i,n.disabled));return u},n.prototype.add_option=function(n,t,i){if(n.nodeName==="OPTION")return n.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:n.value,text:n.text,html:n.innerHTML,selected:n.selected,disabled:i===!0?i:n.disabled,group_array_index:t,classes:n.className,style:n.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},n}();n.select_to_array=function(t){var f,r,i,e,u;for(r=new n,u=t.childNodes,i=0,e=u.length;i<e;i++)f=u[i],r.add_node(f);return r.parsed};this.SelectParser=n}.call(this),function(){var n,t;t=this;n=function(){function n(n,t){this.form_field=n;this.options=t!=null?t:{};this.set_default_values();this.is_multiple=this.form_field.multiple;this.default_text_default=this.is_multiple?"Select Some Options":"Select an Option";this.is_ajax=this.form_field.className=="chzn-autoselect"?!0:!1;this.has_logic=$(this.form_field).siblings(".logic").length==1?!0:!1;this.setup();this.set_up_html();this.register_observers();this.finish_setup()}return n.prototype.set_default_values=function(){var n=this;this.click_test_action=function(t){return n.test_active_click(t)};this.activate_action=function(t){return n.activate_field(t)};this.active_field=!1;this.mouse_on_container=!1;this.results_showing=!1;this.result_highlighted=null;this.result_single_selected=null;this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1;this.disable_search_threshold=this.options.disable_search_threshold||0;this.choices=0;this.results_none_found=$(this.form_field).data("optionsNoResultsText")?this.options.no_results_text=$(this.form_field).data("optionsNoResultsText"):this.options.no_results_text||"No results match";return},n.prototype.mouse_enter=function(){return this.mouse_on_container=!0},n.prototype.mouse_leave=function(){return this.mouse_on_container=!1},n.prototype.input_focus=function(n){var t=this;if(!this.active_field&&n.type!=="mousedown")return setTimeout(function(){return t.container_mousedown()},50)},n.prototype.input_click=function(){if(this.is_multiple)return this.results_toggle()},n.prototype.input_blur=function(){var n=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return n.blur_test()},100)},n.prototype.result_add_option=function(n){var t,i;return n.disabled?"":(n.dom_id=this.container_id+"_o_"+n.array_index,t=n.selected&&this.is_multiple?[]:["active-result"],n.selected&&t.push("result-selected"),n.group_array_index!=null&&t.push("group-option"),n.classes!==""&&t.push(n.classes),i=n.style.cssText!==""?' style="'+n.style+'"':"",'<li id="'+n.dom_id+'" class="'+t.join(" ")+'"'+i+">"+n.html+"<\/li>")},n.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build(),this.results_search()},n.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.is_ajax?!1:this.results_show()},n.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},n.prototype.keyup_checker=function(n){var t,i;t=(i=n.which)!=null?i:n.keyCode;this.search_field_scale();switch(t){case 8:case 46:case 127:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.search_field.val().length>0?this.results_search():this.results_hide();break;case 13:if(n.preventDefault(),this.result_highlight!=null)return this.result_select(n);this.is_ajax?this.container.closest("form").submit():this.search_field.val().length===0?this.container.closest("form").submit():this.allows_new_values&&this.search_field.val().length>0&&this.add_and_select_new_value(this,this.search_field.val());break;case 27:if(this.results_showing)return this.results_hide();break;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},n.prototype.generate_field_id=function(){var n;return n=this.generate_random_id(),this.form_field.id=n,n},n.prototype.generate_random_char=function(){var n,t;return n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",t=Math.floor(Math.random()*n.length),n.substring(t,t+1)},n}();t.AbstractChosen=n}.call(this),function(){var n,r,t,i,u=Object.prototype.hasOwnProperty,f=function(n,t){function r(){this.constructor=n}for(var i in t)u.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n};i=this;n=jQuery;n.fn.extend({chosen:function(t){return n(this).each(function(){if(!n(this).hasClass("chzn-done"))return new r(this,t)})}});r=function(){function r(){r.__super__.constructor.apply(this,arguments)}return f(r,AbstractChosen),r.prototype.setup=function(){return this.form_field_jq=n(this.form_field),this.allows_new_values=n(this.form_field).attr("data-allows-new-values"),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},r.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},r.prototype.set_up_html=function(){var i,f,u,e,r;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(!1),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,i=n("<div />",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),r=this.default_text,this.form_field_jq.find(":selected").length>0&&(r=""),this.is_multiple?i.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+r+'" class="default" autocomplete="off" style="width:25px;" /><\/li><\/ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"><\/ul><\/div>'):i.html('<a href="javascript:void(0)" class="chzn-single"><span>'+r+'<\/span><div><b><\/b><\/div><\/a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /><\/div><ul class="chzn-results"><\/ul><\/div>'),this.form_field_jq.hide().after(i),this.container=n("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),f=this.container.height(),u=this.f_width-t(this.dropdown),this.dropdown.css({width:u+"px",top:f+"px"}),this.search_field=this.container.find("input").first(),this.form_field_jq.data("initialTextValue")&&this.search_field.val(this.form_field_jq.data("initialTextValue")),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),e=u-t(this.search_container)-t(this.search_field),this.search_field.css({width:e+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},r.prototype.register_observers=function(){var n=this;return this.container.mousedown(function(t){return n.container_mousedown(t)}),this.container.mouseup(function(t){return n.container_mouseup(t)}),this.container.mouseenter(function(t){return n.mouse_enter(t)}),this.container.mouseleave(function(t){return n.mouse_leave(t)}),this.search_results.mouseup(function(t){return n.search_results_mouseup(t)}),this.search_results.mouseover(function(t){return n.search_results_mouseover(t)}),this.search_results.mouseout(function(t){return n.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){return n.results_update_field(t)}),this.search_field.blur(function(t){return n.input_blur(t)}),this.search_field.click(function(t){return n.input_click(t)}),this.search_field.keyup(function(t){return n.keyup_checker(t)}),this.search_field.keydown(function(t){return n.keydown_checker(t)}),this.is_multiple?(this.search_choices.click(function(t){return n.choices_click(t)}),this.search_field.focus(function(t){return n.input_focus(t)})):void 0},r.prototype.search_field_disabled=function(){return(this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled)?(this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field()):(this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1,!this.is_multiple)?this.selected_item.bind("focus",this.activate_action):void 0},r.prototype.container_mousedown=function(t){var i;if(!this.is_disabled)return i=t!=null?n(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&t.stopPropagation(),this.pending_destroy_click||i?this.pending_destroy_click=!1:(this.active_field?!this.is_multiple&&t&&(n(t.target)[0]===this.selected_item[0]||n(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.search_field.val()==this.default_text&&this.search_field.val(""),n(document).click(this.click_test_action),this.is_multiple||this.results_show()),this.activate_field())},r.prototype.container_mouseup=function(n){if(n.target.nodeName==="ABBR")return this.results_reset(n)},r.prototype.blur_test=function(){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},r.prototype.close_field=function(){return n(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1),this.winnow_results_clear()),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.clear_backstroke(),this.search_field.val().length<1&&this.show_search_field_default(),this.search_field_scale()},r.prototype.activate_field=function(){return this.is_multiple||this.active_field||(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},r.prototype.test_active_click=function(t){return n(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){var t,n,r,f,u;for(this.parsing=!0,this.results_data=i.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),t="",u=this.results_data,r=0,f=u.length;r<f;r++)n=u[r],n.group?t+=this.result_add_group(n):n.empty||(t+=this.result_add_option(n),n.selected&&this.is_multiple?this.choice_build(n):n.selected&&!this.is_multiple&&(this.selected_item.find("span").text(n.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.search_field_scale(),this.search_results.html(t),this.parsing=!1},r.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+n("<div />").text(t.label).html()+"<\/li>")},r.prototype.result_do_highlight=function(n){var i,t,f,r,u;n.length&&(this.result_clear_highlight(),this.result_highlight=n,this.result_highlight.addClass("highlighted"),f=parseInt(this.search_results.css("maxHeight"),10),u=this.search_results.scrollTop(),r=f+u,t=this.result_highlight.position().top+this.search_results.scrollTop(),i=t+this.result_highlight.outerHeight(!1),t>=u&&i<=r||(t<u?this.search_results.scrollTop(t):i>r&&this.search_results.scrollTop(this.search_results.scrollTop()+i-r)))},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){var n;return this.is_multiple?this.container.children(".chzn-choices").addClass("chzn-choices-with-drop"):(this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected)),n=this.container.height(),this.dropdown.css({top:n+"px",left:0}),this.results_showing=!0,this.active_field&&this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},r.prototype.results_hide=function(){return this.is_multiple?this.container.children(".chzn-choices").removeClass("chzn-choices-with-drop"):this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},r.prototype.set_tab_index=function(){var n;if(this.form_field_jq.attr("tabindex"))return n=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.is_multiple?this.search_field.attr("tabindex",n):(this.selected_item.attr("tabindex",n),this.search_field.attr("tabindex",-1))},r.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.default_text.trim()===""?this.search_field.val(this.default_text):this.search_field.val(this.default_text).blur(),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},r.prototype.search_results_mouseup=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i.length?(this.result_highlight=i,this.result_select(t)):void 0},r.prototype.search_results_mouseover=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i?this.result_do_highlight(i):void 0},r.prototype.search_results_mouseout=function(t){if(n(t.target).hasClass("active-result"||n(t.target).parents(".active-result").first()))return this.result_clear_highlight()},r.prototype.choices_click=function(t){return t.preventDefault(),!this.is_ajax&&this.active_field&&!n(t.target).hasClass("search-choice"||n(t.target).parents(".search-choice").first)&&!this.results_showing?this.results_show():void 0},r.prototype.choice_build=function(t){var i,f,e=this,r,u;return i=this.container_id+"_c_"+t.array_index,this.choices+=1,r=n("<div>"+t.html+"<\/div>"),r.find(".info").remove(),u='<li class="search-choice" id="'+i+'"><span>'+r.html()+'<\/span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"><\/a><\/li>',this.has_logic&&(u+='<li class="search-logic"> '+this.form_field_jq.siblings(".logic").find("input:checked").val()+" <\/li>"),this.search_container.before(u),f=n("#"+i).find("a").first(),f.click(function(n){return e.choice_destroy_link_click(n)})},r.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(n(t.target)))},r.prototype.choice_destroy=function(n){return this.choices-=1,this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(n.attr("rel")),this.has_logic&&n.parents("li").next(".search-logic").remove(),n.parents("li").first().remove()},r.prototype.results_reset=function(t){return this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.show_search_field_default(),n(t.target).remove(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},r.prototype.result_select=function(n){var t,r,i,u;return this.result_highlight?(t=this.result_highlight,r=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t),t.addClass("result-selected"),u=r.substr(r.lastIndexOf("_")+1),i=this.results_data[u],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.is_multiple?this.choice_build(i):(this.selected_item.find("span").first().text(i.text),this.allow_single_deselect&&this.single_deselect_control_build()),n.metaKey&&this.is_multiple||this.results_hide(),this.search_field.val("").focus(),this.form_field_jq.trigger("change"),this.search_field_scale()):this.allows_new_values?this.add_and_select_new_value(this,this.search_field.val()):void 0},r.prototype.result_activate=function(n){return n.addClass("active-result")},r.prototype.result_deactivate=function(n){return n.removeClass("active-result")},r.prototype.result_deselect=function(t){var r,i;return i=this.results_data[t],i.selected=!1,this.form_field.options[i.options_index].selected=!1,r=n("#"+this.container_id+"_o_"+t),r.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field.focus(),this.search_field_scale()},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"><\/abbr>')},r.prototype.winnow_results=function(){var s,t,y,h,l,u,a,f,i,e,r,p,o,c,w,b,v;for(this.no_results_clear(),f=0,i=this.search_field.val()===this.default_text?"":n("<div/>").text(n.trim(this.search_field.val())).html(),l=new RegExp("^"+i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),v=this.results_data,o=0,w=v.length;o<w;o++)if(t=v[o],!t.disabled&&!t.empty)if(t.group)n("#"+t.dom_id).css("display","none");else if(!(this.is_multiple&&t.selected)){if(s=!1,a=t.dom_id,u=n("#"+a),l.test(t.html))s=!0,f+=1;else if((t.html.indexOf(" ")>=0||t.html.indexOf("[")===0)&&(h=t.html.replace(/\[|\]/g,"").split(" "),h.length))for(c=0,b=h.length;c<b;c++)y=h[c],l.test(y)&&(s=!0,f+=1);s?(i.length?(e=t.html.search(p),r=t.html.substr(0,e+i.length)+"<\/em>"+t.html.substr(e+i.length),r=r.substr(0,e)+"<em>"+r.substr(e)):r=t.html,u.html(r),this.result_activate(u),t.group_array_index!=null&&n("#"+this.results_data[t.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u));this.is_ajax&&(n("#"+this.results_data[o].dom_id).css("display","list-item"),this.result_activate(u),f+=1)}return f<1&&i.length?this.no_results(i):this.is_ajax?void 0:this.winnow_results_set_highlight()},r.prototype.winnow_results_clear=function(){var t,u,r,f,i;for(this.search_field.val(""),u=this.search_results.find("li"),i=[],r=0,f=u.length;r<f;r++)t=u[r],t=n(t),t.hasClass("group-result")?i.push(t.css("display","auto")):this.is_multiple&&t.hasClass("result-selected")?i.push(void 0):i.push(this.result_activate(t));return i},r.prototype.winnow_results_set_highlight=function(){var n,t;if(!this.result_highlight&&(t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),n=t.length?t.first():this.search_results.find(".active-result").first(),n!=null))return this.result_do_highlight(n)},r.prototype.no_results=function(t){var r,i,u;return r="",this.allows_new_values&&(r='<div class="chzn-add-button"><\/div>'),i=n('<li class="no-results">'+this.results_none_found+' "<span><\/span>"'+r+"<\/li>"),i.find("span").first().html(t),this.allows_new_values&&(u=this,i.find(".chzn-add-button").first().click(function(){return u.add_and_select_new_value(u,t),!1})),this.search_results.append(i)},r.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},r.prototype.loopBreak=!1,r.prototype.add_and_select_new_value=function(t,i){var r;return n(t.form_field).append('<option value="'+i+'">'+i+"<\/option>"),r=t.search_field.val(),t.results_build(),t.search_field.val(r),t.results_show(),t.results_search(),this.loopBreak?this.loopBreak=!1:(this.loopBreak=!0,t.result_select(n(t.form_field.options).last())),t.close_field()},r.prototype.keydown_arrow=function(){var t,i;return this.result_highlight?this.results_showing&&(i=this.result_highlight.nextAll("li.active-result").first(),i&&this.result_do_highlight(i)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(n(t)),this.search_results.scrollTop(t.position().top)),this.results_showing?void 0:this.results_show()},r.prototype.keyup_arrow=function(){var n;if(this.results_showing||this.is_multiple){if(this.result_highlight)return n=this.result_highlight.prevAll("li.active-result"),n.length?this.result_do_highlight(n.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())}else return this.results_show()},r.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},r.prototype.keydown_checker=function(n){var t,i;t=(i=n.which)!=null?i:n.keyCode;this.search_field_scale();t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(n);this.mouse_on_container=!1;break;case 13:n.preventDefault();break;case 38:n.preventDefault();this.keyup_arrow();break;case 40:this.keydown_arrow()}},r.prototype.search_field_scale=function(){var o,t,h,u,f,e,i,r,s;if(this.is_multiple){for(h=0,i=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",e=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],r=0,s=e.length;r<s;r++)u=e[r],f+=u+":"+this.search_field.css(u)+";";return t=n("<div />",{style:f}),t.text(this.search_field.val()),n("body").append(t),i=t.width()+25,t.remove(),i>this.f_width-10&&(i=this.f_width-10),this.search_field.css({width:i+"px"}),o=this.container.height(),this.dropdown.css({top:o+"px"})}},r.prototype.generate_random_id=function(){for(var t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();n("#"+t).length>0;)t+=this.generate_random_char();return t},r}();t=function(n){return n.outerWidth(!1)-n.width()};i.get_side_border_padding=t;String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")})}.call(this),function(n){function r(t,i){this.$target=n(t);this.cache=[];this.options={minChars:3,createListItemMarkup:function(t,i){n.each(t,function(n,t){var r=t[2]?t[2]:t[0];r&&(i[r]=t[0])})}};n.extend(this.options,i);this.init()}var t=".chzn-search > input, .search-field > input",i;n.fn.ajaxChosen=function(t){return this.each(function(){return new r(this||n("<input />"),t)})};r.prototype={init:function(){var i=n.trim(this.$target.val());this.$target.chosen(this.options);this.$target.next(".chzn-container").find(t).bind("keyup",[this],this.onKey).bind("keydown",[this],this.onBeforeKey);this.$target.data("AjaxChosen",this)},lookup:function(r,u){var f=i.encode(r.$target.next(".chzn-container").find(t).val()),o=r.cache[f],e;if(o)return r.populateSuggestions(o,r,r.$target.next(".chzn-container").find(t),u);if(e={term:f,field:r.$target.attr("id")},typeof r.options.callbackParams=="function"?n.extend(e,r.options.callbackParams(r.$target)):typeof r.options.callbackParams=="object"&&n.extend(e,r.options.callbackParams),f.length<3){r.$target.next(".chzn-container").find(".no-results").text("Type at least three characters");return}r.$target.next(".chzn-container").find(".no-results").text("Looking up '"+f+"'");n.getJSON(r.options.callbackUri,e,function(n,t,i){r.onResults(n,t,i,r,f,u)})},onKey:function(n){var t=n.data[0];n.ctrlKey||(n.which>=65&&n.which<=127?t.lookup(t,!0):n.which===8||n.which===46?t.lookup(t,!0):n.which>=48&&n.which<=57&&t.lookup(t,!0))},onBeforeKey:function(n){var t=n.data[0];return!0},invalidateResults:function(n){n.clearCache(n);n.lookup(n,!0)},onResults:function(n,i,r,u,f,e){var o=u.$target.next(".chzn-container").find(t);(u.cache[f]=n,o.val()===f)&&n&&u.populateSuggestions(n,u,o,e)},clearCache:function(n){n.cache=[]},populateSuggestions:function(t,i,r,u){var l,h,f,o,s,e,c,a;for(u=u?!0:!1,i.$target.find("option").not(":selected").remove(),l={},i.options.createListItemMarkup(t,l),n.each(l,function(t,r){i.$target.append(n("<option><\/option>").attr("value",t).html(r))}),h=i.$target.find("option:selected"),f=i.$target.find("option:not(:selected)"),f.sort(function(t,i){return n(t).text()>n(i).text()?1:-1}),o=[],s=0;s<h.length;++s)o.push(n("<option />").val(h[s].value).attr("selected","selected").html(n(h[s]).html()));for(e=0;e<f.length;++e)o.push(n("<option />").val(f[e].value).attr("selected",n(f[e]).attr("selected")).html(n(f[e]).html()));for(i.$target.html(""),c=0;c<o.length;++c)i.$target.append(o[c]);u&&(a=r.val(),i.$target.trigger("liszt:updated"),r.val(a))}};i=i||{encode:function(n){var i,r,t;if(!n)return"";for(n=n.replace(/\r\n/g,"\n"),i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i},decode:function(n){for(var r="",t=0,i=0,u=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(u=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|u&63),t+=2):(u=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(u&63)<<6|c3&63),t+=3);return r}}}(jQuery);!function(n,t,i,r){n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};n.site=n.fn.site=function(u){var f,o,l=(new Date).getTime(),h=[],y=u,b="string"==typeof y,k=[].slice.call(arguments,1),e=n.isPlainObject(u)?n.extend(!0,{},n.site.settings,u):n.extend({},n.site.settings),a=e.namespace,p=e.error,v="module-"+a,c=n(i),w=this,s=c.data(v);return f={initialize:function(){f.instantiate()},instantiate:function(){f.verbose("Storing instance of site",f);s=f;c.data(v,f)},normalize:function(){f.fix.console();f.fix.requestAnimationFrame()},fix:{console:function(){f.debug("Normalizing window.console");console!==r&&console.log!==r||(f.verbose("Console not available, normalizing events"),f.disable.console());void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(f.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){});void 0===console.markTimeline&&(f.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){f.debug("Disabling programmatic console clearing");t.console.clear=function(){}},requestAnimationFrame:function(){f.debug("Normalizing requestAnimationFrame");t.requestAnimationFrame===r&&(f.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)})}},moduleExists:function(t){return n.fn[t]!==r&&n.fn[t].settings!==r},enabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)&&i.push(t)}),i}},disabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)||i.push(t)}),i}},change:{setting:function(t,i,u,o){u="string"==typeof u?"all"===u?e.modules:[u]:u||e.modules;o=o===r||o;n.each(u,function(r,u){var e,s=!f.moduleExists(u)||n.fn[u].settings.namespace||!1;f.moduleExists(u)&&(f.verbose("Changing default setting",t,i,u),n.fn[u].settings[t]=i,o&&s&&0<(e=n(":data(module-"+s+")")).length&&(f.verbose("Modifying existing settings",e),e[u]("setting",t,i)))})},settings:function(t,i,u){i="string"==typeof i?[i]:i||e.modules;u=u===r||u;n.each(i,function(i,r){var e;f.moduleExists(r)&&(f.verbose("Changing default setting",t,r),n.extend(!0,n.fn[r].settings,t),u&&a&&0<(e=n(":data(module-"+a+")")).length&&(f.verbose("Modifying existing settings",e),e[r]("setting",t)))})}},enable:{console:function(){f.console(!0)},debug:function(n,t){n=n||e.modules;f.debug("Enabling debug for modules",n);f.change.setting("debug",!0,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Enabling verbose debug for modules",n);f.change.setting("verbose",!0,n,t)}},disable:{console:function(){f.console(!1)},debug:function(n,t){n=n||e.modules;f.debug("Disabling debug for modules",n);f.change.setting("debug",!1,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Disabling verbose debug for modules",n);f.change.setting("verbose",!1,n,t)}},console:function(n){if(n){if(s.cache.console===r)return void f.error(p.console);f.debug("Restoring console function");t.console=s.cache.console}else f.debug("Disabling console function"),s.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){f.verbose("Destroying previous site for",c);c.removeData(v)},cache:{},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,e,t);else{if(i===r)return e[t];e[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,f,t);else{if(i===r)return f[t];f[t]=i}},debug:function(){e.debug&&(e.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,e.name+":"),f.debug.apply(console,arguments)))},verbose:function(){e.verbose&&e.debug&&(e.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,e.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,e.name+":");f.error.apply(console,arguments)},performance:{log:function(n){var t,i;e.performance&&(i=(t=(new Date).getTime())-(l||t),l=t,h.push({Element:w,Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(f.performance.timer);f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=e.name+":",i=0;l=!1;clearTimeout(f.performance.timer);n.each(h,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";(console.group!==r||console.table!==r)&&0<h.length&&(console.groupCollapsed(t),console.table?console.table(h):n.each(h,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());h=[]}},invoke:function(t,i,u){var l,h,c,e=s;return i=i||k,u=w||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),l=t.length-1,n.each(t,function(i,u){var o=i!=l?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[o])&&i!=l)e=e[o];else{if(e[o]!==r)return h=e[o],!1;if(!n.isPlainObject(e[u])||i==l)return e[u]!==r?h=e[u]:f.error(p.method,t),!1;e=e[u]}})),n.isFunction(h)?c=h.apply(u,i):h!==r&&(c=h),Array.isArray(o)?o.push(c):o!==r?o=[o,c]:c!==r&&(o=c),h}},b?(s===r&&f.initialize(),f.invoke(y)):(s!==r&&f.destroy(),f.initialize()),o!==r?o:this};n.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","calendar","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","slider","rating","shape","sidebar","state","sticky","tab","toast","transition","visibility","visit"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}};n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])}})}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.form=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=u,l=arguments[1],a="string"==typeof c,v=[].slice.call(arguments,1);return o.each(function(){var d,it,at,vt,p,k,tt,w,nt,yt,ct,lt,ot,g,ut,y,b=n(this),ft=this,et=[],st=!1,pt=!1,ht=!1,rt=["clean","clean"];(y={initialize:function(){y.get.settings();a?(ut===r&&y.instantiate(),y.invoke(c)):(ut!==r&&ut.invoke("destroy"),y.verbose("Initializing form validation",b,p),y.bindEvents(),y.set.defaults(),y.instantiate())},instantiate:function(){y.verbose("Storing instance of module",y);ut=y;b.data(ot,y)},destroy:function(){y.verbose("Destroying previous module",ut);y.removeEvents();b.removeData(ot)},refresh:function(){y.verbose("Refreshing selector cache");d=b.find(w.field);it=b.find(w.group);at=b.find(w.message);b.find(w.prompt);vt=b.find(w.submit);b.find(w.clear);b.find(w.reset)},submit:function(){y.verbose("Submitting form",b);pt=!0;b.submit()},attachEvents:function(t,i){i=i||"submit";n(t).on("click"+g,function(n){y[i]();n.preventDefault()})},bindEvents:function(){y.verbose("Attaching form events");b.on("submit"+g,y.validate.form).on("blur"+g,w.field,y.event.field.blur).on("click"+g,w.submit,y.submit).on("click"+g,w.reset,y.reset).on("click"+g,w.clear,y.clear);p.keyboardShortcuts&&b.on("keydown"+g,w.field,y.event.field.keydown);d.each(function(t,i){var r=n(i),u=r.prop("type"),f=y.get.changeEvent(u,r);r.on(f+g,y.event.field.change)});p.preventLeaving&&n(t).on("beforeunload"+g,y.event.beforeUnload);d.on("change click keyup keydown blur",function(t){n(this).trigger(t.type+".dirty")});d.on("change.dirty click.dirty keyup.dirty keydown.dirty blur.dirty",y.determine.isDirty);b.on("dirty"+g,function(){p.onDirty.call()});b.on("clean"+g,function(){p.onClean.call()})},clear:function(){d.each(function(t,i){var r=n(i),u=r.parent(),f=r.closest(it),s=f.find(w.prompt),e=r.closest(w.uiCalendar),o=r.data(tt.defaultValue)||"",h=u.is(w.uiCheckbox),c=u.is(w.uiDropdown),l=0<e.length;f.hasClass(nt.error)&&(y.verbose("Resetting error on field",f),f.removeClass(nt.error),s.remove());c?(y.verbose("Resetting dropdown value",u,o),u.dropdown("clear")):h?r.prop("checked",!1):l?e.calendar("clear"):(y.verbose("Resetting field value",r,o),r.val(""))})},reset:function(){d.each(function(t,i){var u=n(i),e=u.parent(),o=u.closest(it),s=u.closest(w.uiCalendar),h=o.find(w.prompt),f=u.data(tt.defaultValue),c=e.is(w.uiCheckbox),l=e.is(w.uiDropdown),a=0<s.length,v=o.hasClass(nt.error);f!==r&&(v&&(y.verbose("Resetting error on field",o),o.removeClass(nt.error),h.remove()),l?(y.verbose("Resetting dropdown value",e,f),e.dropdown("restore defaults")):c?(y.verbose("Resetting checkbox value",e,f),u.prop("checked",f)):a?s.calendar("set date",f):(y.verbose("Resetting field value",u,f),u.val(f)))});y.determine.isDirty()},determine:{isValid:function(){var t=!0;return n.each(k,function(n,i){y.validate.field(i,n,!0)||(t=!1)}),t},isDirty:function(t){var i=!1;d.each(function(t,r){var f,u=n(r);f=0<u.filter(w.checkbox).length?y.is.checkboxDirty(u):y.is.fieldDirty(u);u.data(p.metadata.isDirty,f);i|=f});i?y.set.dirty():y.set.clean();t&&"dirty"===t.namespace&&(t.stopImmediatePropagation(),t.preventDefault())}},is:{bracketedRule:function(n){return n.type&&n.type.match(p.regExp.bracket)},shorthandFields:function(n){var t=n[Object.keys(n)[0]];return y.is.shorthandRules(t)},shorthandRules:function(n){return"string"==typeof n||Array.isArray(n)},empty:function(n){return!n||0===n.length||(n.is(w.checkbox)?!n.is(":checked"):y.is.blank(n))},blank:function(t){return""===n.trim(t.val())},valid:function(t){var i=!0;return t?(y.verbose("Checking if field is valid",t),y.validate.field(k[t],t,!1)):(y.verbose("Checking if form is valid"),n.each(k,function(n){y.is.valid(n)||(i=!1)}),i)},dirty:function(){return ht},clean:function(){return!ht},fieldDirty:function(n){var i=n.data(tt.defaultValue),t,r;return null==i&&(i=""),t=n.val(),null==t&&(t=""),r=/^(true|false)$/i,r.test(i)&&r.test(t)?!new RegExp("^"+i+"$","i").test(t):t!==i},checkboxDirty:function(n){return n.data(tt.defaultValue)!==n.is(":checked")},justDirty:function(){return"dirty"===rt[0]},justClean:function(){return"clean"===rt[0]}},removeEvents:function(){b.off(g);d.off(g);vt.off(g);d.off(g)},event:{field:{keydown:function(t){var i=n(this),r=t.which,u=i.is(w.input),f=i.is(w.checkbox),e=0<i.closest(w.uiDropdown).length;r==27&&(y.verbose("Escape key pressed blurring field"),i.blur());t.ctrlKey||r!=13||!u||e||f||(st||(i.one("keyup"+g,y.event.field.keyup),y.submit(),y.debug("Enter pressed on input submitting form")),st=!0)},keyup:function(){st=!1},blur:function(){var i=n(this),r=i.closest(it),t=y.get.validation(i);r.hasClass(nt.error)?(y.debug("Revalidating field",i,t),t&&y.validate.field(t)):"blur"==p.on&&t&&y.validate.field(t)},change:function(){var t=n(this),r=t.closest(it),i=y.get.validation(t);i&&("change"==p.on||r.hasClass(nt.error)&&p.revalidate)&&(clearTimeout(y.timer),y.timer=setTimeout(function(){y.debug("Revalidating field",t,y.get.validation(t));y.validate.field(i)},p.delay))}},beforeUnload:function(n){if(y.is.dirty()&&!pt)return(n=n||t.event)&&(n.returnValue=p.text.leavingMessage),p.text.leavingMessage}},get:{ancillaryValue:function(n){return!(!n.type||!n.value&&!y.is.bracketedRule(n))&&(n.value!==r?n.value:n.type.match(p.regExp.bracket)[1]+"")},ruleName:function(n){return y.is.bracketedRule(n)?n.type.replace(n.type.match(p.regExp.bracket)[0],""):n.type},changeEvent:function(n,t){return"checkbox"==n||"radio"==n||"hidden"==n||t.is("select")?"change":y.get.inputEvent()},inputEvent:function(){return i.createElement("input").oninput!==r?"input":i.createElement("input").onpropertychange!==r?"propertychange":"keyup"},fieldsFromShorthand:function(t){var i={};return n.each(t,function(t,r){"string"==typeof r&&(r=[r]);i[t]={rules:[]};n.each(r,function(n,r){i[t].rules.push({type:r})})}),i},prompt:function(t,i){var f,e,o=y.get.ruleName(t),s=y.get.ancillaryValue(t),u=y.get.field(i.identifier),h=u.val(),r=n.isFunction(t.prompt)?t.prompt(h):t.prompt||p.prompt[o]||p.text.unspecifiedRule,c=-1!==r.search("{value}"),l=-1!==r.search("{name}");return c&&(r=r.replace("{value}",u.val())),l&&(e=1==(f=u.closest(w.group).find("label").eq(0)).length?f.text():u.prop("placeholder")||p.text.unspecifiedField,r=r.replace("{name}",e)),r=(r=r.replace("{identifier}",i.identifier)).replace("{ruleValue}",s),t.prompt||y.verbose("Using default validation prompt for type",r,o),r},settings:function(){if(n.isPlainObject(u)){var t=Object.keys(u);0<t.length&&u[t[0]].identifier!==r&&u[t[0]].rules!==r?(p=n.extend(!0,{},n.fn.form.settings,l),k=n.extend({},n.fn.form.settings.defaults,u),y.error(p.error.oldSyntax,ft),y.verbose("Extending settings from legacy parameters",k,p)):(u.fields&&y.is.shorthandFields(u.fields)&&(u.fields=y.get.fieldsFromShorthand(u.fields)),p=n.extend(!0,{},n.fn.form.settings,u),k=n.extend({},n.fn.form.settings.defaults,p.fields),y.verbose("Extending settings",k,p))}else p=n.fn.form.settings,k=n.fn.form.settings.defaults,y.verbose("Using default form validation",k,p);lt=p.namespace;tt=p.metadata;w=p.selector;nt=p.className;yt=p.regExp;ct=p.error;ot="module-"+lt;g="."+lt;ut=b.data(ot);y.refresh()},field:function(t){var i;return y.verbose("Finding field with identifier",t),t=y.escape.string(t),0<(i=d.filter("#"+t)).length?i:0<(i=d.filter('[name="'+t+'"]')).length?i:0<(i=d.filter('[name="'+t+'[]"]')).length?i:0<(i=d.filter("[data-"+tt.validate+'="'+t+'"]')).length?i:n("<input/>")},fields:function(t){var i=n();return n.each(t,function(n,t){i=i.add(y.get.field(t))}),i},validation:function(t){var r,i;return!!k&&(n.each(k,function(u,f){i=f.identifier||u;n.each(y.get.field(i),function(n,u){if(u==t[0])return f.identifier=i,r=f,!1})}),r||!1)},value:function(n){var t=[];return t.push(n),y.get.values.call(ft,t)[n]},values:function(t){var u=Array.isArray(t)?y.get.fields(t):d,i={};return u.each(function(t,u){var o=n(u),s=o.closest(w.uiCalendar),f=o.prop("name"),h=o.val(),c=o.is(w.checkbox),v=o.is(w.radio),b=-1!==f.indexOf("[]"),k=0<s.length,l=!!c&&o.is(":checked"),e,a;if(f)if(b)f=f.replace("[]",""),i[f]||(i[f]=[]),c?l?i[f].push(h||!0):i[f].push(!1):i[f].push(h);else if(v)i[f]!==r&&0!=i[f]||(i[f]=!!l&&(h||!0));else if(c)i[f]=!!l&&(h||!0);else if(k)if(e=s.calendar("get date"),null!==e){if("date"==p.dateHandling)i[f]=e;else if("input"==p.dateHandling)i[f]=s.calendar("get input date");else if("formatter"==p.dateHandling){a=s.calendar("setting","type");switch(a){case"date":i[f]=p.formatter.date(e);break;case"datetime":i[f]=p.formatter.datetime(e);break;case"time":i[f]=p.formatter.time(e);break;case"month":i[f]=p.formatter.month(e);break;case"year":i[f]=p.formatter.year(e);break;default:y.debug("Wrong calendar mode",s,a);i[f]=""}}}else i[f]="";else i[f]=h}),i},dirtyFields:function(){return d.filter(function(t,i){return n(i).data(tt.isDirty)})}},has:{field:function(n){return y.verbose("Checking for existence of a field with identifier",n),"string"!=typeof(n=y.escape.string(n))&&y.error(ct.identifier,n),0<d.filter("#"+n).length||0<d.filter('[name="'+n+'"]').length||0<d.filter("[data-"+tt.validate+'="'+n+'"]').length}},escape:{string:function(n){return(n=String(n)).replace(yt.escape,"\\$&")}},add:{rule:function(n,t){y.add.field(n,t)},field:function(t,i){var r={};y.is.shorthandRules(i)?(i=Array.isArray(i)?i:[i],r[t]={rules:[]},n.each(i,function(n,i){r[t].rules.push({type:i})})):r[t]=i;k=n.extend({},k,r);y.debug("Adding rules",r,k)},fields:function(t){var i;i=t&&y.is.shorthandFields(t)?y.get.fieldsFromShorthand(t):t;k=n.extend({},k,i)},prompt:function(t,i,u){var e=y.get.field(t).closest(it),f=e.children(w.prompt),o=0!==f.length;i="string"==typeof i?[i]:i;y.verbose("Adding field error state",t);u||e.addClass(nt.error);p.inline&&(o||(f=p.templates.prompt(i,nt.label)).appendTo(e),f.html(i[0]),o?y.verbose("Inline errors are disabled, no inline error added",t):p.transition&&n.fn.transition!==r&&b.transition("is supported")?(y.verbose("Displaying error with css transition",p.transition),f.transition(p.transition+" in",p.duration)):(y.verbose("Displaying error with fallback javascript animation"),f.fadeIn(p.duration)))},errors:function(n){y.debug("Adding form error messages",n);y.set.error();at.html(p.templates.error(n))}},remove:{rule:function(t,i){var u=Array.isArray(i)?i:[i];if(k[t]!==r&&Array.isArray(k[t].rules))return i===r?(y.debug("Removed all rules"),void(k[t].rules=[])):void n.each(k[t].rules,function(n,i){i&&-1!==u.indexOf(i.type)&&(y.debug("Removed rule",i.type),k[t].rules.splice(n,1))})},field:function(t){var i=Array.isArray(t)?t:[t];n.each(i,function(n,t){y.remove.rule(t)})},rules:function(t,i){Array.isArray(t)?n.each(t,function(n,t){y.remove.rule(t,i)}):y.remove.rule(t,i)},fields:function(n){y.remove.field(n)},prompt:function(t){var u=y.get.field(t).closest(it),i=u.children(w.prompt);u.removeClass(nt.error);p.inline&&i.is(":visible")&&(y.verbose("Removing prompt for field",t),p.transition&&n.fn.transition!==r&&b.transition("is supported")?i.transition(p.transition+" out",p.duration,function(){i.remove()}):i.fadeOut(p.duration,function(){i.remove()}))}},set:{success:function(){b.removeClass(nt.error).addClass(nt.success)},defaults:function(){d.each(function(t,i){var r=n(i),u=r.parent(),f=0<r.filter(w.checkbox).length,e=u.is(w.uiDropdown),o=f?r.is(":checked"):r.val();e&&u.dropdown("save defaults");r.data(tt.defaultValue,o);r.data(tt.isDirty,!1)})},error:function(){b.removeClass(nt.success).addClass(nt.error)},value:function(n,t){var i={};return i[n]=t,y.set.values.call(ft,i)},values:function(t){n.isEmptyObject(t)||n.each(t,function(t,i){var f,u=y.get.field(t),r=u.parent(),o=Array.isArray(i),e=r.is(w.uiCheckbox),s=r.is(w.uiDropdown),h=u.is(w.radio)&&e;0<u.length&&(o&&e?(y.verbose("Selecting multiple",i,u),r.checkbox("uncheck"),n.each(i,function(n,t){f=u.filter('[value="'+t+'"]');r=f.parent();0<f.length&&r.checkbox("check")})):h?(y.verbose("Selecting radio value",i,u),u.filter('[value="'+i+'"]').parent(w.uiCheckbox).checkbox("check")):e?(y.verbose("Setting checkbox value",i,r),!0===i?r.checkbox("check"):r.checkbox("uncheck")):s?(y.verbose("Setting dropdown value",i,r),r.dropdown("set selected",i)):(y.verbose("Setting field value",i,u),u.val(i)))})},dirty:function(){y.verbose("Setting state dirty");ht=!0;rt[0]=rt[1];rt[1]="dirty";y.is.justClean()&&b.trigger("dirty")},clean:function(){y.verbose("Setting state clean");ht=!1;rt[0]=rt[1];rt[1]="clean";y.is.justDirty()&&b.trigger("clean")},asClean:function(){y.set.defaults();y.set.clean()},asDirty:function(){y.set.defaults();y.set.dirty()}},validate:{form:function(n,t){var i=y.get.values();if(st)return!1;if(et=[],y.determine.isValid()){if(y.debug("Form has no validation errors, submitting"),y.set.success(),!0!==t)return p.onSuccess.call(ft,n,i)}else if(y.debug("Form has errors"),y.set.error(),p.inline||y.add.errors(et),n&&b.data("moduleApi")!==r&&n.stopImmediatePropagation(),!0!==t)return p.onFailure.call(ft,et,i)},field:function(t,i,u){var s;u=u===r||u;"string"==typeof t&&(y.verbose("Validating field",t),t=k[i=t]);var f=t.identifier||i,e=y.get.field(f),h=!!t.depends&&y.get.field(t.depends),c=!0,o=[];return t.identifier||(y.debug("Using field name as identifier",f),t.identifier=f),s=!0,n.each(e,function(){if(!n(this).prop("disabled"))return s=!1}),s?y.debug("Field is disabled. Skipping",f):t.optional&&y.is.blank(e)?y.debug("Field is optional and blank. Skipping",f):t.depends&&y.is.empty(h)?y.debug("Field depends on another value that is not present or empty. Skipping",h):t.rules!==r&&(e.closest(it).removeClass(nt.error),n.each(t.rules,function(i,r){if(y.has.field(f)){var e=y.validate.rule(t,r,!0)||[];0<e.length&&(y.debug("Field is invalid",f,r.type),o.push(y.get.prompt(r,t)),c=!1,u&&n(e).closest(it).addClass(nt.error))}})),c?(u&&(y.remove.prompt(f,o),p.onValid.call(e)),!0):(u&&(et=et.concat(o),y.add.prompt(f,o,!0),p.onInvalid.call(e,o)),!1)},rule:function(t,i,u){function o(t){var i=c?n(t).filter(":checked").val():n(t).val();return i=i===r||""===i||null===i?"":p.shouldTrim?n.trim(i+""):String(i+""),h.call(t,i,l,b)}var f=y.get.field(t.identifier),l=y.get.ancillaryValue(i),s=y.get.ruleName(i),h=p.rules[s],e=[],c=f.is(w.checkbox);if(n.isFunction(h))return c?o(f)||(e=f):n.each(f,function(n,t){o(t)||e.push(t)}),u?e:!(0<e.length);y.error(ct.noRule,s)}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ft,"Execution Time":i}));clearTimeout(y.performance.timer);y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(y.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");1<o.length&&(t+=" ("+o.length+")");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||v,u=ft||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}}).initialize()}),f!==r?f:this};n.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,shouldTrim:!0,transition:"scale",duration:200,preventLeaving:!1,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain  "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(t){var i='<ul class="list">';return n.each(t,function(n,t){i+="<li>"+t+"<\/li>"}),n(i+="<\/ul>")},prompt:function(t,i){return n("<div/>").addClass(i).html(t[0])}},formatter:{date:function(n){return Intl.DateTimeFormat("en-GB").format(n)},datetime:function(n){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(n)},time:function(n){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(n)},month:function(n){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(n)},year:function(n){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(n)}},rules:{empty:function(n){return!(n===r||""===n||Array.isArray(n)&&0===n.length)},checked:function(){return 0<n(this).filter(":checked").length},email:function(t){return n.fn.form.settings.regExp.email.test(t)},url:function(t){return n.fn.form.settings.regExp.url.test(t)},regExp:function(t,i){if(i instanceof RegExp)return t.match(i);var u,r=i.match(n.fn.form.settings.regExp.flags);return r&&(i=2<=r.length?r[1]:i,u=3<=r.length?r[2]:""),t.match(new RegExp(i,u))},integer:function(t,i){var f,e,u,o=n.fn.form.settings.regExp.integer;return i&&-1===["",".."].indexOf(i)&&(-1==i.indexOf("..")?o.test(i)&&(f=e=+i):(u=i.split("..",2),o.test(u[0])&&(f=u[0]-0),o.test(u[1])&&(e=u[1]-0))),o.test(t)&&(f===r||f<=t)&&(e===r||t<=e)},decimal:function(t){return n.fn.form.settings.regExp.decimal.test(t)},number:function(t){return n.fn.form.settings.regExp.number.test(t)},is:function(n,t){return t="string"==typeof t?t.toLowerCase():t,(n="string"==typeof n?n.toLowerCase():n)==t},isExactly:function(n,t){return n==t},not:function(n,t){return(n="string"==typeof n?n.toLowerCase():n)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(n,t){return n!=t},contains:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i,"i"))},containsExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i))},doesntContain:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i,"i"))},doesntContainExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i))},minLength:function(n,t){return n!==r&&n.length>=t},length:function(n,t){return n!==r&&n.length>=t},exactLength:function(n,t){return n!==r&&n.length==t},maxLength:function(n,t){return n!==r&&n.length<=t},match:function(n,t,i){var f,u;return 0<(u=i.find('[data-validate="'+t+'"]')).length?f=u.val():0<(u=i.find("#"+t)).length?f=u.val():0<(u=i.find('[name="'+t+'"]')).length?f=u.val():0<(u=i.find('[name="'+t+'[]"]')).length&&(f=u),f!==r&&n.toString()==f.toString()},different:function(n,t,i){var f,u;return 0<(u=i.find('[data-validate="'+t+'"]')).length?f=u.val():0<(u=i.find("#"+t)).length?f=u.val():0<(u=i.find('[name="'+t+'"]')).length?f=u.val():0<(u=i.find('[name="'+t+'[]"]')).length&&(f=u),f!==r&&n.toString()!==f.toString()},creditCard:function(t,i){var e,r,u={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},o={},s=!1,h="string"==typeof i&&i.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),h&&(n.each(h,function(i,f){(r=u[f])&&(o={length:-1!==n.inArray(t.length,r.length),pattern:-1!==t.search(r.pattern)}).length&&o.pattern&&(s=!0)}),!s))return!1;if((e={number:-1!==n.inArray(t.length,u.unionPay.length),pattern:-1!==t.search(u.unionPay.pattern)}).number&&e.pattern)return!0;for(var c=t.length,l=0,a=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=a[l][parseInt(t.charAt(c),10)],l^=1;return f%10==0&&0<f}},minCount:function(n,t){return 0==t||(1==t?""!==n:n.split(",").length>=t)},exactCount:function(n,t){return 0==t?""===n:1==t?""!==n&&-1===n.search(","):n.split(",").length==t},maxCount:function(n,t){return 0!=t&&(1==t?-1===n.search(","):n.split(",").length<=t)}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.accordion=function(i){var u,o=n(this),e=(new Date).getTime(),f=[],s=i,h="string"==typeof s,c=[].slice.call(arguments,1);return o.each(function(){var nt,a,l=n.isPlainObject(i)?n.extend(!0,{},n.fn.accordion.settings,i):n.extend({},n.fn.accordion.settings),v=l.className,tt=l.namespace,y=l.selector,ut=l.error,it="."+tt,d="module-"+tt,rt=o.selector||"",p=n(this),b=p.find(y.title),w=p.find(y.content),g=this,k=p.data(d);a={initialize:function(){a.debug("Initializing",p);a.bind.events();l.observeChanges&&a.observeChanges();a.instantiate()},instantiate:function(){k=a;p.data(d,a)},destroy:function(){a.debug("Destroying previous instance",p);p.off(it).removeData(d)},refresh:function(){b=p.find(y.title);w=p.find(y.content)},observeChanges:function(){"MutationObserver"in t&&((nt=new MutationObserver(function(){a.debug("DOM tree modified, updating selector cache");a.refresh()})).observe(g,{childList:!0,subtree:!0}),a.debug("Setting up mutation observer",nt))},bind:{events:function(){a.debug("Binding delegated events");p.on(l.on+it,y.trigger,a.event.click)}},event:{click:function(){a.toggle.call(this)}},toggle:function(t){var i=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),u=i.next(w),f=u.hasClass(v.animating),e=u.hasClass(v.active),o=e&&!f,s=!e&&f;a.debug("Toggling visibility of content",i);o||s?l.collapsible?a.close.call(i):a.debug("Cannot close accordion content collapsing is disabled"):a.open.call(i)},open:function(t){var u=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=u.next(w),f=i.hasClass(v.animating);i.hasClass(v.active)||f?a.debug("Accordion already open, skipping",i):(a.debug("Opening accordion content",u),l.onOpening.call(i),l.onChanging.call(i),l.exclusive&&a.closeOthers.call(u),u.addClass(v.active),i.stop(!0,!0).addClass(v.animating),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration,skipInlineHidden:!0,onComplete:function(){i.children().removeClass(v.transition)}}):i.children().stop(!0,!0).animate({opacity:1},l.duration,a.resetOpacity)),i.slideDown(l.duration,l.easing,function(){i.removeClass(v.animating).addClass(v.active);a.reset.display.call(this);l.onOpen.call(this);l.onChange.call(this)}))},close:function(t){var f=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=f.next(w),e=i.hasClass(v.animating),u=i.hasClass(v.active);(u||!u&&e)&&(!u||!e)&&(a.debug("Closing accordion content",i),l.onClosing.call(i),l.onChanging.call(i),f.removeClass(v.active),i.stop(!0,!0).addClass(v.animating),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration,skipInlineHidden:!0}):i.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),i.slideUp(l.duration,l.easing,function(){i.removeClass(v.animating).removeClass(v.active);a.reset.display.call(this);l.onClose.call(this);l.onChange.call(this)}))},closeOthers:function(t){var i,s,u,h=t!==r?b.eq(t):n(this).closest(y.title),f=h.parents(y.content).prev(y.title),e=h.closest(y.accordion),o=y.title+"."+v.active+":visible",c=y.content+"."+v.active+":visible";u=l.closeNested?(i=e.find(o).not(f)).next(w):(i=e.find(o).not(f),s=e.find(c).find(o).not(f),(i=i.not(s)).next(w));0<i.length&&(a.debug("Exclusive enabled, closing other content",i),i.removeClass(v.active),u.removeClass(v.animating).stop(!0,!0),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?u.children().transition({animation:"fade out",useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration,skipInlineHidden:!0}):u.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),u.slideUp(l.duration,l.easing,function(){n(this).removeClass(v.active);a.reset.display.call(this)}))},reset:{display:function(){a.verbose("Removing inline display from element",this);n(this).css("display","");""===n(this).attr("style")&&n(this).attr("style","").removeAttr("style")},opacity:function(){a.verbose("Removing inline opacity from element",this);n(this).css("opacity","");""===n(this).attr("style")&&n(this).attr("style","").removeAttr("style")}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];n.isPlainObject(l[t])?n.extend(!0,l[t],i):l[t]=i}},internal:function(t,i){if(a.debug("Changing internal",t,i),i===r)return a[t];n.isPlainObject(t)?n.extend(!0,a,t):a[t]=i},debug:function(){!l.silent&&l.debug&&(l.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,l.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),a.verbose.apply(console,arguments)))},error:function(){l.silent||(a.error=Function.prototype.bind.call(console.error,console,l.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;l.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=l.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";rt&&(t+=" '"+rt+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=k;return i=i||c,f=g||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:a.error(ut.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),Array.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};h?(k===r&&a.initialize(),a.invoke(s)):(k!==r&&k.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating",transition:"transition"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.calendar=function(t){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=t,c="string"==typeof h,l=[].slice.call(arguments,1),a={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}};return o.each(function(){var ut,o,v=n.isPlainObject(t)?n.extend(!0,{},n.fn.calendar.settings,t):n.extend({},n.fn.calendar.settings),p=v.className,ht=v.namespace,ft=v.selector,g=v.formatter,rt=v.parser,y=v.metadata,ot=a[v.minTimeGap],ct=v.error,d="."+ht,et="module-"+ht,b=n(this),w=b.find(ft.input),k=b.find(ft.popup),nt=b.find(ft.activator),tt=this,it=b.data(et),st=!1,lt=!1;o={initialize:function(){o.debug("Initializing calendar for",tt,b);ut=o.get.isTouch();o.setup.config();o.setup.popup();o.setup.inline();o.setup.input();o.setup.date();o.create.calendar();o.bind.events();o.instantiate()},instantiate:function(){o.verbose("Storing instance of calendar");it=o;b.data(et,it)},destroy:function(){o.verbose("Destroying previous calendar for",tt);b.removeData(et);o.unbind.events()},setup:{config:function(){null!==o.get.minDate()&&o.set.minDate(b.data(y.minDate));null!==o.get.maxDate()&&o.set.maxDate(b.data(y.maxDate))},popup:function(){var t,e,i,u,f,s;!v.inline&&(nt.length||(nt=b.children().first()).length)&&(n.fn.popup!==r?(k.length||(t=nt.parent(),e=0!==t.closest(ft.append).length?"appendTo":"prependTo",k=n("<div/>").addClass(p.popup)[e](t)),k.addClass(p.calendar),i=v.onVisible,u=v.onHidden,w.length||(k.attr("tabindex","0"),i=function(){return o.focus(),v.onVisible.apply(k,arguments)},u=function(){return o.blur(),v.onHidden.apply(k,arguments)}),f=v.on||(w.length?"focus":"click"),s=n.extend({},v.popupOptions,{popup:k,on:f,hoverable:"hover"===f,onShow:function(){return o.set.focusDate(o.get.date()),o.set.mode(v.startMode),v.onShow.apply(k,arguments)},onVisible:i,onHide:v.onHide,onHidden:u}),o.popup(s)):o.error(ct.popup))},inline:function(){nt.length&&!v.inline||(k=n("<div/>").addClass(p.calendar).appendTo(b),w.length||k.attr("tabindex","0"))},input:function(){v.touchReadonly&&w.length&&ut&&w.prop("readonly",!0)},date:function(){var n,t;v.initialDate?(n=rt.date(v.initialDate,v),o.set.date(n,v.formatInput,!1)):b.data(y.date)!==r?(n=rt.date(b.data(y.date),v),o.set.date(n,v.formatInput,!1)):w.length&&(t=w.val(),n=rt.date(t,v),o.set.date(n,v.formatInput,!1))}},create:{calendar:function(){var s,yt,pt,b,h,t,fi,r=o.get.mode(),wt=new Date,ei=o.get.date(),it=o.get.focusDate(),c=it||ei||v.initialDate||wt,f,dt,hi,st,ht,gt,pi,ni,wi,ct,lt,ti,e,bi,tt,at,vt,ut,ii,ri,ki,di,ui;c=o.helper.dateInRange(c);it||(it=c,o.set.focusDate(it,!1,!1));var l="year"===r,a="month"===r,u="day"===r,d="hour"===r,bt="minute"===r,gi="time"===v.type,nr=Math.max(v.multiMonth,1),tr=u?o.get.monthOffset():0,ft=c.getMinutes(),w=c.getHours(),nt=c.getDate(),ir=c.getMonth()+tr,i=c.getFullYear(),kt=u?v.showWeekNumbers?8:7:d?4:ot.column,oi=u||d?6:ot.row,et=u?nr:1,rt=k,si=rt.hasClass("left")?"right center":"left center";for(rt.empty(),1<et&&(fi=n("<div/>").addClass(p.grid).appendTo(rt)),b=0;b<et;b++){1<et&&(rt=n("<div/>").addClass(p.column).appendTo(fi));f=ir+b;dt=(new Date(i,f,1).getDay()-v.firstDayOfWeek%7+7)%7;!v.constantHeight&&u&&(hi=new Date(i,f+1,0).getDate()+dt,oi=Math.ceil(hi/7));var ci=l?10:a?1:0,li=u?1:0,ai=d||bt?1:0,vi=d||bt?nt:1,rr=new Date(i-ci,f-li,vi-ai,w),ur=new Date(i+ci,f+li,vi+ai,w),fr=l?new Date(10*Math.ceil(i/10)-9,0,0):a?new Date(i,0,0):u?new Date(i,f,0):new Date(i,f,nt,-1),er=l?new Date(10*Math.ceil(i/10)+1,0,1):a?new Date(i+1,0,1):u?new Date(i,f+1,1):new Date(i,f,nt+1),yi=r;if(u&&v.showWeekNumbers&&(yi+=" andweek"),st=n("<table/>").addClass(p.table).addClass(yi).appendTo(rt),ht=kt,!gi&&(gt=n("<thead/>").appendTo(st),h=n("<tr/>").appendTo(gt),t=n("<th/>").attr("colspan",""+kt).appendTo(h),pi=l||a?new Date(i,0,1):u?new Date(i,f,1):new Date(i,f,nt,w,ft),ni=n("<span/>").addClass(p.link).appendTo(t),ni.text(g.header(pi,r,v)),wi=a?v.disableYear?"day":"year":u?v.disableMonth?"year":"month":"day",(ni.data(y.mode,wi),0===b)&&(ct=n("<span/>").addClass(p.prev).appendTo(t),ct.data(y.focusDate,rr),ct.toggleClass(p.disabledCell,!o.helper.isDateInRange(fr,r)),n("<i/>").addClass(p.prevIcon).appendTo(ct)),b===et-1&&(lt=n("<span/>").addClass(p.next).appendTo(t),lt.data(y.focusDate,ur),lt.toggleClass(p.disabledCell,!o.helper.isDateInRange(er,r)),n("<i/>").addClass(p.nextIcon).appendTo(lt)),u))for(h=n("<tr/>").appendTo(gt),v.showWeekNumbers&&((t=n("<th/>").appendTo(h)).text(v.text.weekNo),t.addClass(p.weekCell),ht--),s=0;s<ht;s++)(t=n("<th/>").appendTo(h)).text(g.dayColumnHeader((s+v.firstDayOfWeek)%7,v));for(ti=n("<tbody/>").appendTo(st),s=l?10*Math.ceil(i/10)-9:u?1-dt:0,yt=0;yt<oi;yt++)for(h=n("<tr/>").appendTo(ti),u&&v.showWeekNumbers&&((t=n("<th/>").appendTo(h)).text(o.get.weekOfYear(i,f,s+1-v.firstDayOfWeek)),t.addClass(p.weekCell)),pt=0;pt<ht;pt++,s++)e=l?new Date(s,f,1,w,ft):a?new Date(i,s,1,w,ft):u?new Date(i,f,s,w,ft):d?new Date(i,f,nt,s):new Date(i,f,nt,w,s*v.minTimeGap),bi=l?s:a?v.text.monthsShort[s]:u?e.getDate():g.time(e,v,!0),(t=n("<td/>").addClass(p.cell).appendTo(h)).text(bi),t.data(y.date,e),tt=u&&e.getMonth()!==(f+12)%12,at=!v.selectAdjacentDays&&tt||!o.helper.isDateInRange(e,r)||v.isDisabled(e,r)||o.helper.isDisabled(e,r)||!o.helper.isEnabled(e,r),at?(vt=o.helper.findDayAsObject(e,r,v.disabledDates),null!==vt&&vt[y.message]&&(t.attr("data-tooltip",vt[y.message]),t.attr("data-position",si))):(ut=o.helper.findDayAsObject(e,r,v.eventDates),null!==ut&&(t.addClass(ut[y.class]||v.eventClass),ut[y.message]&&(t.attr("data-tooltip",ut[y.message]),t.attr("data-position",si)))),ii=o.helper.dateEqual(e,ei,r),ri=o.helper.dateEqual(e,wt,r),t.toggleClass(p.adjacentCell,tt),t.toggleClass(p.disabledCell,at),t.toggleClass(p.activeCell,ii&&!tt),d||bt||t.toggleClass(p.todayCell,!tt&&ri),ki={mode:r,adjacent:tt,disabled:at,active:ii,today:ri},g.cell(t,e,ki),o.helper.dateEqual(e,it,r)&&o.set.focusDate(e,!1,!1);v.today&&(di=n("<tr/>").appendTo(ti),ui=n("<td/>").attr("colspan",""+kt).addClass(p.today).appendTo(di),ui.text(g.today(v)),ui.data(y.date,wt));o.update.focus(!1,st)}}},update:{focus:function(t,i){i=i||k;var r=o.get.mode(),h=o.get.date(),u=o.get.focusDate(),e=o.get.startDate(),s=o.get.endDate(),f=(t?u:null)||h||(ut?null:u);i.find("td").each(function(){var t=n(this),i=t.data(y.date);if(i){var h=t.hasClass(p.disabledCell),l=t.hasClass(p.activeCell),c=t.hasClass(p.adjacentCell),a=o.helper.dateEqual(i,u,r),w=!!f&&(!!e&&o.helper.isDateInRange(i,r,e,f)||!!s&&o.helper.isDateInRange(i,r,f,s));t.toggleClass(p.focusCell,a&&(!ut||st)&&(!c||v.selectAdjacentDays&&c)&&!h);t.toggleClass(p.rangeCell,w&&!l&&!h)}})}},refresh:function(){o.create.calendar()},bind:{events:function(){o.debug("Binding events");k.on("mousedown"+d,o.event.mousedown);k.on("touchstart"+d,o.event.mousedown);k.on("mouseup"+d,o.event.mouseup);k.on("touchend"+d,o.event.mouseup);k.on("mouseover"+d,o.event.mouseover);w.length?(w.on("input"+d,o.event.inputChange),w.on("focus"+d,o.event.inputFocus),w.on("blur"+d,o.event.inputBlur),w.on("click"+d,o.event.inputClick),w.on("keydown"+d,o.event.keydown)):k.on("keydown"+d,o.event.keydown)}},unbind:{events:function(){o.debug("Unbinding events");k.off(d);w.length&&w.off(d)}},event:{mouseover:function(t){var i=n(t.target).data(y.date),r=1===t.buttons;i&&o.set.focusDate(i,!1,!0,r)},mousedown:function(t){w.length&&t.preventDefault();st=0<=t.type.indexOf("touch");var i=n(t.target).data(y.date);i&&o.set.focusDate(i,!1,!0,!0)},mouseup:function(t){var i,r,s;if(o.focus(),t.preventDefault(),t.stopPropagation(),st=!1,i=n(t.target),!i.hasClass("disabled")){r=i.parent();(r.data(y.date)||r.data(y.focusDate)||r.data(y.mode))&&(i=r);var u=i.data(y.date),f=i.data(y.focusDate),e=i.data(y.mode);u&&!1!==v.onSelect.call(tt,u,o.get.mode())?(s=i.hasClass(p.today),o.selectDate(u,s)):f?o.set.focusDate(f):e&&o.set.mode(e)}},keydown:function(n){var i=n.which,s,r,t,f;if(27!==i&&9!==i||o.popup("hide"),o.popup("is visible"))if(37===i||38===i||39===i||40===i){s="day"===(t=o.get.mode())?7:"hour"===t?4:"minute"===t?ot.column:3;r=37===i?-1:38===i?-s:39==i?1:s;r*="minute"===t?v.minTimeGap:1;var u=o.get.focusDate()||o.get.date()||new Date,h=u.getFullYear()+("year"===t?r:0),c=u.getMonth()+("month"===t?r:0),l=u.getDate()+("day"===t?r:0),a=u.getHours()+("hour"===t?r:0),y=u.getMinutes()+("minute"===t?r:0),e=new Date(h,c,l,a,y);"time"===v.type&&(e=o.helper.mergeDateTime(u,e));o.helper.isDateInRange(e,t)&&o.set.focusDate(e)}else 13===i&&(t=o.get.mode(),f=o.get.focusDate(),f&&!v.isDisabled(f,t)&&!o.helper.isDisabled(f,t)&&o.helper.isEnabled(f,t)&&o.selectDate(f),n.preventDefault(),n.stopPropagation());38!==i&&40!==i||(n.preventDefault(),o.popup("show"))},inputChange:function(){var n=w.val(),t=rt.date(n,v);o.set.date(t,!1)},inputFocus:function(){k.addClass(p.active)},inputBlur:function(){if(k.removeClass(p.active),v.formatInput){var n=o.get.date(),t=g.datetime(n,v);w.val(t)}},inputClick:function(){o.popup("show")}},get:{weekOfYear:function(n,t,i){var u,r,f;return u=Date.UTC(n,t,i+3)/864e5,r=Math.floor(u/7),f=new Date(6048e5*r).getUTCFullYear(),r-Math.floor(Date.UTC(f,0,7)/6048e5)+1},date:function(){return o.helper.sanitiseDate(b.data(y.date))||null},inputDate:function(){return w.val()},focusDate:function(){return b.data(y.focusDate)||null},startDate:function(){var n=o.get.calendarModule(v.startCalendar);return(n?n.get.date():b.data(y.startDate))||null},endDate:function(){var n=o.get.calendarModule(v.endCalendar);return(n?n.get.date():b.data(y.endDate))||null},minDate:function(){return b.data(y.minDate)||null},maxDate:function(){return b.data(y.maxDate)||null},monthOffset:function(){return b.data(y.monthOffset)||0},mode:function(){var t=b.data(y.mode)||v.startMode,i=o.get.validModes();return 0<=n.inArray(t,i)?t:"time"===v.type?"hour":"month"===v.type?"month":"year"===v.type?"year":"day"},validModes:function(){var n=[];return"time"!==v.type&&(v.disableYear&&"year"!==v.type||n.push("year"),(v.disableMonth||"year"===v.type)&&"month"!==v.type||n.push("month"),0<=v.type.indexOf("date")&&n.push("day")),0<=v.type.indexOf("time")&&(n.push("hour"),v.disableMinute||n.push("minute")),n},isTouch:function(){try{return i.createEvent("TouchEvent"),!0}catch(n){return!1}},calendarModule:function(t){return t?(t instanceof n||(t=n(t).first()),t.data(et)):null}},set:{date:function(n,t,i){var u,f,e;if((t=!1!==t,i=!1!==i,n=o.helper.sanitiseDate(n),n=o.helper.dateInRange(n),u=o.get.mode(),f=g.datetime(n,v),i&&!1===v.onChange.call(tt,n,f,u))||(o.set.focusDate(n),v.isDisabled(n,u)))return!1;e=o.get.endDate();e&&n&&e<n&&o.set.endDate(r);o.set.dataKeyValue(y.date,n);t&&w.length&&w.val(f)},startDate:function(n,t){n=o.helper.sanitiseDate(n);var i=o.get.calendarModule(v.startCalendar);i&&i.set.date(n);o.set.dataKeyValue(y.startDate,n,t)},endDate:function(n,t){n=o.helper.sanitiseDate(n);var i=o.get.calendarModule(v.endCalendar);i&&i.set.date(n);o.set.dataKeyValue(y.endDate,n,t)},focusDate:function(n,t,i,r){var e,u,f,s,h;n=o.helper.sanitiseDate(n);n=o.helper.dateInRange(n);e="day"===o.get.mode();u=o.get.focusDate();e&&n&&u&&(f=12*(n.getFullYear()-u.getFullYear())+n.getMonth()-u.getMonth(),f&&(s=o.get.monthOffset()-f,o.set.monthOffset(s,!1)));h=o.set.dataKeyValue(y.focusDate,n,t);i=!1!==i&&h&&!1===t||lt!=r;lt=r;i&&o.update.focus(r)},minDate:function(n){n=o.helper.sanitiseDate(n);null!==v.maxDate&&v.maxDate<=n?o.verbose("Unable to set minDate variable bigger that maxDate variable",n,v.maxDate):(o.setting("minDate",n),o.set.dataKeyValue(y.minDate,n))},maxDate:function(n){n=o.helper.sanitiseDate(n);null!==v.minDate&&v.minDate>=n?o.verbose("Unable to set maxDate variable lower that minDate variable",n,v.minDate):(o.setting("maxDate",n),o.set.dataKeyValue(y.maxDate,n))},monthOffset:function(n,t){var i=Math.max(v.multiMonth,1);n=Math.max(1-i,Math.min(0,n));o.set.dataKeyValue(y.monthOffset,n,t)},mode:function(n,t){o.set.dataKeyValue(y.mode,n,t)},dataKeyValue:function(n,t,i){var r=b.data(n),u=r===t||r<=t&&t<=r;return t?b.data(n,t):b.removeData(n),(i=!1!==i&&!u)&&o.refresh(),!u}},selectDate:function(n,t){var i,r,u;o.verbose("New date selection",n);i=o.get.mode();t||"minute"===i||v.disableMinute&&"hour"===i||"date"===v.type&&"day"===i||"month"===v.type&&"month"===i||"year"===v.type&&"year"===i?!1===o.set.date(n)||!v.closable||(o.popup("hide"),r=o.get.calendarModule(v.endCalendar),r&&(r.popup("show"),r.focus())):(u="year"===i?v.disableMonth?"day":"month":"month"===i?"day":"day"===i?"hour":"minute",o.set.mode(u),"hour"===i||"day"===i&&o.get.date()?o.set.date(n):o.set.focusDate(n))},changeDate:function(n){o.set.date(n)},clear:function(){o.set.date(r)},popup:function(){return nt.popup.apply(nt,arguments)},focus:function(){w.length?w.focus():k.focus()},blur:function(){w.length?w.blur():k.blur()},helper:{isDisabled:function(n,t){return"day"===t&&(-1!==v.disabledDaysOfWeek.indexOf(n.getDay())||v.disabledDates.some(function(i){return"string"==typeof i&&(i=o.helper.sanitiseDate(i)),i instanceof Date?o.helper.dateEqual(n,i,t):null!==i&&"object"==typeof i&&i[y.date]?o.helper.dateEqual(n,o.helper.sanitiseDate(i[y.date]),t):void 0}))},isEnabled:function(n,t){return"day"!==t||0===v.enabledDates.length||v.enabledDates.some(function(i){return"string"==typeof i&&(i=o.helper.sanitiseDate(i)),i instanceof Date?o.helper.dateEqual(n,i,t):null!==i&&"object"==typeof i&&i[y.date]?o.helper.dateEqual(n,o.helper.sanitiseDate(i[y.date]),t):void 0})},findDayAsObject:function(n,t,i){var r,u,e,f;if("day"===t)for(u=0,e=i.length;u<e;u++){if("string"==typeof(r=i[u])&&(r=o.helper.sanitiseDate(r)),r instanceof Date&&o.helper.dateEqual(n,r,t))return f={},f[y.date]=r,f;if(null!==r&&"object"==typeof r&&r[y.date]&&o.helper.dateEqual(n,o.helper.sanitiseDate(r[y.date]),t))return r}return null},sanitiseDate:function(n){return n?(n instanceof Date||(n=rt.date(""+n,v)),!n||null===n||isNaN(n.getTime())?r:n):r},dateDiff:function(n,t,i){i=i||"day";var r="time"===v.type,u="year"===i,e=u||"month"===i,f="minute"===i,o=f||"hour"===i;return n=new Date(r?2e3:n.getFullYear(),r?0:u?0:n.getMonth(),r?1:e?1:n.getDate(),o?n.getHours():0,f?v.minTimeGap*Math.floor(n.getMinutes()/v.minTimeGap):0),(t=new Date(r?2e3:t.getFullYear(),r?0:u?0:t.getMonth(),r?1:e?1:t.getDate(),o?t.getHours():0,f?v.minTimeGap*Math.floor(t.getMinutes()/v.minTimeGap):0)).getTime()-n.getTime()},dateEqual:function(n,t,i){return!!n&&!!t&&0===o.helper.dateDiff(n,t,i)},isDateInRange:function(n,t,i,r){if(!i&&!r){var u=o.get.startDate();i=u&&v.minDate?new Date(Math.max(u,v.minDate)):u||v.minDate;r=v.maxDate}return i=i&&new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),v.minTimeGap*Math.ceil(i.getMinutes()/v.minTimeGap)),!(!n||i&&0<o.helper.dateDiff(n,i,t)||r&&0<o.helper.dateDiff(r,n,t))},dateInRange:function(n,t,i){var r,u;return t||i||(r=o.get.startDate(),t=r&&v.minDate?new Date(Math.max(r,v.minDate)):r||v.minDate,i=v.maxDate),t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),v.minTimeGap*Math.ceil(t.getMinutes()/v.minTimeGap)),u="time"===v.type,n?t&&0<o.helper.dateDiff(n,t,"minute")?u?o.helper.mergeDateTime(n,t):t:i&&0<o.helper.dateDiff(i,n,"minute")?u?o.helper.mergeDateTime(n,i):i:n:n},mergeDateTime:function(n,t){return n&&t?new Date(n.getFullYear(),n.getMonth(),n.getDate(),t.getHours(),t.getMinutes()):t}},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,v.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),o.verbose.apply(console,arguments)))},error:function(){v.silent||(o.error=Function.prototype.bind.call(console.error,console,v.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=v.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=it;return i=i||l,f=tt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?s=e[u]:o.error(ct.method,t),!1;e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),Array.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(it===r&&o.initialize(),o.invoke(h)):(it!==r&&it.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,minTimeGap:5,showWeekNumbers:null,disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(n,t,i){return"year"===t?i.formatter.yearHeader(n,i):"month"===t?i.formatter.monthHeader(n,i):"day"===t?i.formatter.dayHeader(n,i):"hour"===t?i.formatter.hourHeader(n,i):i.formatter.minuteHeader(n,i)},yearHeader:function(n){var t=10*Math.ceil(n.getFullYear()/10);return t-9+" - "+(2+t)},monthHeader:function(n){return n.getFullYear()},dayHeader:function(n,t){return t.text.months[n.getMonth()]+" "+n.getFullYear()},hourHeader:function(n,t){return t.formatter.date(n,t)},minuteHeader:function(n,t){return t.formatter.date(n,t)},dayColumnHeader:function(n,t){return t.text.days[n]},datetime:function(n,t){if(!n)return"";var i="time"===t.type?"":t.formatter.date(n,t),r=t.type.indexOf("time")<0?"":t.formatter.time(n,t,!1);return i+("datetime"===t.type?" ":"")+r},date:function(n,t){if(!n)return"";var u=n.getDate(),i=t.text.months[n.getMonth()],r=n.getFullYear();return"year"===t.type?r:"month"===t.type?i+" "+r:(t.monthFirst?i+" "+u:u+" "+i)+", "+r},time:function(n,t){if(!n)return"";var i=n.getHours(),r=n.getMinutes(),u="";return t.ampm&&(u=" "+(i<12?t.text.am:t.text.pm),i=0===i?12:12<i?i-12:i),i+":"+(r<10?"0":"")+r+u},today:function(n){return"date"===n.type?n.text.today:n.text.now},cell:function(){}},parser:{date:function(t,i){var u,f,l,b,d,g,a,w,v;if(t instanceof Date)return t;if(!t||0===(t=(""+t).trim().toLowerCase()).length)return null;if(b=new Date(t),!isNaN(b.getDate()))return b;var h=-1,o=-1,y=-1,s=-1,c=-1,k=r,tt="time"===i.type,nt=i.type.indexOf("time")<0,p=t.split(i.regExp.dateWords),e=t.split(i.regExp.dateNumbers);if(!nt)for(k=0<=n.inArray(i.text.am.toLowerCase(),p)||!(0<=n.inArray(i.text.pm.toLowerCase(),p))&&r,u=0;u<e.length;u++)if(d=e[u],0<=d.indexOf(":")){if(o<0||h<0)for(g=d.split(":"),l=0;l<Math.min(2,g.length);l++)f=parseInt(g[l]),isNaN(f)&&(f=0),0===l?o=f%24:h=f%60;e.splice(u,1)}if(!tt){for(u=0;u<p.length;u++)if(a=p[u],!(a.length<=0)){for(a=a.substring(0,Math.min(a.length,3)),f=0;f<i.text.months.length;f++)if(w=i.text.months[f],(w=w.substring(0,Math.min(a.length,Math.min(w.length,3))).toLowerCase())===a){s=f+1;break}if(0<=s)break}for(u=0;u<e.length;u++)if(f=parseInt(e[u]),!isNaN(f)&&f>=i.centuryBreak&&u===e.length-1){f<=99&&(f+=i.currentCentury-100);c=f;e.splice(u,1);break}if(s<0)for(u=0;u<e.length;u++)if(l=1<u||i.monthFirst?u:1===u?0:1,f=parseInt(e[l]),!isNaN(f)&&1<=f&&f<=12){s=f;e.splice(l,1);break}for(u=0;u<e.length;u++)if(f=parseInt(e[u]),!isNaN(f)&&1<=f&&f<=31){y=f;e.splice(u,1);break}if(c<0)for(u=e.length-1;0<=u;u--)if(f=parseInt(e[u]),!isNaN(f)){f<=99&&(f+=i.currentCentury);c=f;e.splice(u,1);break}}if(!nt){if(o<0)for(u=0;u<e.length;u++)if(f=parseInt(e[u]),!isNaN(f)&&0<=f&&f<=23){o=f;e.splice(u,1);break}if(h<0)for(u=0;u<e.length;u++)if(f=parseInt(e[u]),!isNaN(f)&&0<=f&&f<=59){h=f;e.splice(u,1);break}}return h<0&&o<0&&y<0&&s<0&&c<0?null:(h<0&&(h=0),o<0&&(o=0),y<0&&(y=1),s<0&&(s=1),c<0&&(c=(new Date).getFullYear()),k!==r&&(k?12===o&&(o=0):o<12&&(o+=12)),v=new Date(c,s-1,y,o,h),v.getMonth()===s-1&&v.getFullYear()===c||(v=new Date(c,s,0,o,h)),isNaN(v.getTime())?null:v)}},onChange:function(){return!0},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(){},isDisabled:function(){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",monthOffset:"monthOffset",message:"message","class":"class"},eventClass:"blue"}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.checkbox=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=u,l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var ut,s,v=n.extend(!0,{},n.fn.checkbox.settings,u),k=v.className,ft=v.namespace,b=v.selector,et=v.error,d="."+ft,it="module-"+ft,p=n(this),g=n(this).children(b.label),y=n(this).children(b.input),w=y[0],tt=!1,ot=!1,nt=p.data(it),rt=this;s={initialize:function(){s.verbose("Initializing checkbox",v);s.create.label();s.bind.events();s.set.tabbable();s.hide.input();s.observeChanges();s.instantiate();s.setup()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;p.data(it,s)},destroy:function(){s.verbose("Destroying module");s.unbind.events();s.show.input();p.removeData(it)},fix:{reference:function(){p.is(b.input)&&(s.debug("Behavior called on <input> adjusting invoked element"),p=p.closest(b.checkbox),s.refresh())}},setup:function(){s.set.initialLoad();s.is.indeterminate()?(s.debug("Initial value is indeterminate"),s.indeterminate()):s.is.checked()?(s.debug("Initial value is checked"),s.check()):(s.debug("Initial value is unchecked"),s.uncheck());s.remove.initialLoad()},refresh:function(){g=p.children(b.label);y=p.children(b.input);w=y[0]},hide:{input:function(){s.verbose("Modifying <input> z-index to be unselectable");y.addClass(k.hidden)}},show:{input:function(){s.verbose("Modifying <input> z-index to be selectable");y.removeClass(k.hidden)}},observeChanges:function(){"MutationObserver"in t&&((ut=new MutationObserver(function(){s.debug("DOM tree modified, updating selector cache");s.refresh()})).observe(rt,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",ut))},attachEvents:function(t,i){var r=n(t);i=n.isFunction(s[i])?s[i]:s.toggle;0<r.length?(s.debug("Attaching checkbox events to element",t,i),r.on("click"+d,i)):s.error(et.notFound)},preventDefaultOnInputTarget:function(){"undefined"!=typeof event&&n(event.target).is(b.input)&&(s.verbose("Preventing default check action after manual check action"),event.preventDefault())},event:{change:function(){s.should.ignoreCallbacks()||v.onChange.call(w)},click:function(t){var i=n(t.target);i.is(b.input)?s.verbose("Using default check action on initialized checkbox"):i.is(b.link)?s.debug("Clicking link inside checkbox, skipping toggle"):(s.toggle(),y.focus(),t.preventDefault())},keydown:function(t){var i=t.which,f=s.get.radios(),r=f.index(p),e=f.length,u=!1;if(i==37||i==38?u=(0===r?e:r)-1:i!=39&&i!=40||(u=r===e-1?0:r+1),!s.should.ignoreCallbacks()&&!1!==u){if(!1===v.beforeUnchecked.apply(w))return s.verbose("Option not allowed to be unchecked, cancelling key navigation"),!1;if(!1===v.beforeChecked.apply(n(f[u]).children(b.input)[0]))return s.verbose("Next option should not allow check, cancelling key navigation"),!1}ot=i==27?(s.verbose("Escape key pressed blurring field"),y.blur(),!0):!(t.ctrlKey||!(i==32||i==13&&v.enableEnterKey))&&(s.verbose("Enter/space key pressed, toggling checkbox"),s.toggle(),!0)},keyup:function(n){ot&&n.preventDefault()}},check:function(){s.should.allowCheck()&&(s.debug("Checking checkbox",y),s.set.checked(),s.should.ignoreCallbacks()||(v.onChecked.call(w),s.trigger.change()),s.preventDefaultOnInputTarget())},uncheck:function(){s.should.allowUncheck()&&(s.debug("Unchecking checkbox"),s.set.unchecked(),s.should.ignoreCallbacks()||(v.onUnchecked.call(w),s.trigger.change()),s.preventDefaultOnInputTarget())},indeterminate:function(){s.should.allowIndeterminate()?s.debug("Checkbox is already indeterminate"):(s.debug("Making checkbox indeterminate"),s.set.indeterminate(),s.should.ignoreCallbacks()||(v.onIndeterminate.call(w),s.trigger.change()))},determinate:function(){s.should.allowDeterminate()?s.debug("Checkbox is already determinate"):(s.debug("Making checkbox determinate"),s.set.determinate(),s.should.ignoreCallbacks()||(v.onDeterminate.call(w),s.trigger.change()))},enable:function(){s.is.enabled()?s.debug("Checkbox is already enabled"):(s.debug("Enabling checkbox"),s.set.enabled(),s.should.ignoreCallbacks()||(v.onEnable.call(w),v.onEnabled.call(w),s.trigger.change()))},disable:function(){s.is.disabled()?s.debug("Checkbox is already disabled"):(s.debug("Disabling checkbox"),s.set.disabled(),s.should.ignoreCallbacks()||(v.onDisable.call(w),v.onDisabled.call(w),s.trigger.change()))},get:{radios:function(){var t=s.get.name();return n('input[name="'+t+'"]').closest(b.checkbox)},otherRadios:function(){return s.get.radios().not(p)},name:function(){return y.attr("name")}},is:{initialLoad:function(){return tt},radio:function(){return y.hasClass(k.radio)||"radio"==y.attr("type")},indeterminate:function(){return y.prop("indeterminate")!==r&&y.prop("indeterminate")},checked:function(){return y.prop("checked")!==r&&y.prop("checked")},disabled:function(){return y.prop("disabled")!==r&&y.prop("disabled")},enabled:function(){return!s.is.disabled()},determinate:function(){return!s.is.indeterminate()},unchecked:function(){return!s.is.checked()}},should:{allowCheck:function(){return s.is.determinate()&&s.is.checked()&&!s.is.initialLoad()?(s.debug("Should not allow check, checkbox is already checked"),!1):!(!s.should.ignoreCallbacks()&&!1===v.beforeChecked.apply(w))||(s.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return s.is.determinate()&&s.is.unchecked()&&!s.is.initialLoad()?(s.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!(!s.should.ignoreCallbacks()&&!1===v.beforeUnchecked.apply(w))||(s.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return s.is.indeterminate()&&!s.is.initialLoad()?(s.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!(!s.should.ignoreCallbacks()&&!1===v.beforeIndeterminate.apply(w))||(s.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return s.is.determinate()&&!s.is.initialLoad()?(s.debug("Should not allow determinate, checkbox is already determinate"),!1):!(!s.should.ignoreCallbacks()&&!1===v.beforeDeterminate.apply(w))||(s.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},ignoreCallbacks:function(){return tt&&!v.fireOnInit}},can:{change:function(){return!(p.hasClass(k.disabled)||p.hasClass(k.readOnly)||y.prop("disabled")||y.prop("readonly"))},uncheck:function(){return"boolean"==typeof v.uncheckable?v.uncheckable:!s.is.radio()}},set:{initialLoad:function(){tt=!0},checked:function(){s.verbose("Setting class to checked");p.removeClass(k.indeterminate).addClass(k.checked);s.is.radio()&&s.uncheckOthers();s.is.indeterminate()||!s.is.checked()?(s.verbose("Setting state to checked",w),y.prop("indeterminate",!1).prop("checked",!0)):s.debug("Input is already checked, skipping input property change")},unchecked:function(){s.verbose("Removing checked class");p.removeClass(k.indeterminate).removeClass(k.checked);s.is.indeterminate()||!s.is.unchecked()?(s.debug("Setting state to unchecked"),y.prop("indeterminate",!1).prop("checked",!1)):s.debug("Input is already unchecked")},indeterminate:function(){s.verbose("Setting class to indeterminate");p.addClass(k.indeterminate);s.is.indeterminate()?s.debug("Input is already indeterminate, skipping input property change"):(s.debug("Setting state to indeterminate"),y.prop("indeterminate",!0))},determinate:function(){s.verbose("Removing indeterminate class");p.removeClass(k.indeterminate);s.is.determinate()?s.debug("Input is already determinate, skipping input property change"):(s.debug("Setting state to determinate"),y.prop("indeterminate",!1))},disabled:function(){s.verbose("Setting class to disabled");p.addClass(k.disabled);s.is.disabled()?s.debug("Input is already disabled, skipping input property change"):(s.debug("Setting state to disabled"),y.prop("disabled","disabled"))},enabled:function(){s.verbose("Removing disabled class");p.removeClass(k.disabled);s.is.enabled()?s.debug("Input is already enabled, skipping input property change"):(s.debug("Setting state to enabled"),y.prop("disabled",!1))},tabbable:function(){s.verbose("Adding tabindex to checkbox");y.attr("tabindex")===r&&y.attr("tabindex",0)}},remove:{initialLoad:function(){tt=!1}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=y[0];t&&(s.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},create:{label:function(){0<y.prevAll(b.label).length?(y.prev(b.label).detach().insertAfter(y),s.debug("Moving existing label",g)):s.has.label()||(g=n("<label>").insertAfter(y),s.debug("Creating label",g))}},has:{label:function(){return 0<g.length}},bind:{events:function(){s.verbose("Attaching checkbox events");p.on("click"+d,s.event.click).on("change"+d,s.event.change).on("keydown"+d,b.input,s.event.keydown).on("keyup"+d,b.input,s.event.keyup)}},unbind:{events:function(){s.debug("Removing events");p.off(d)}},uncheckOthers:function(){var n=s.get.otherRadios();s.debug("Unchecking other radios",n);n.removeClass(k.checked)},toggle:function(){s.can.change()?s.is.indeterminate()||s.is.unchecked()?(s.debug("Currently unchecked"),s.check()):s.is.checked()&&s.can.uncheck()&&(s.debug("Currently checked"),s.uncheck()):s.is.radio()||s.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(t,i){if(s.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else{if(i===r)return s[t];s[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:rt,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var c,o,h,e=nt;return i=i||a,u=rt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?o=e[u]:s.error(et.method,t),!1;e=e[u]}})),n.isFunction(o)?h=o.apply(u,i):o!==r&&(h=o),Array.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,enableEnterKey:!0,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dimmer=function(t){var u,e=n(this),o=(new Date).getTime(),f=[],s=t,h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var v,p,l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.dimmer.settings,t):n.extend({},n.fn.dimmer.settings),b=a.selector,tt=a.namespace,y=a.className,ut=a.error,k="."+tt,nt="module-"+tt,it=e.selector||"",rt="ontouchstart"in i.documentElement?"touchstart":"click",w=n(this),d=this,g=w.data(nt);(l={preinitialize:function(){v=l.is.dimmer()?(p=w.parent(),w):(p=w,l.has.dimmer()?a.dimmerName?p.find(b.dimmer).filter("."+a.dimmerName):p.find(b.dimmer):l.create())},initialize:function(){l.debug("Initializing dimmer",a);l.bind.events();l.set.dimmable();l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);g=l;w.data(nt,g)},destroy:function(){l.verbose("Destroying previous module",v);l.unbind.events();l.remove.variation();p.off(k)},bind:{events:function(){"hover"==a.on?p.on("mouseenter"+k,l.show).on("mouseleave"+k,l.hide):"click"==a.on&&p.on(rt+k,l.toggle);l.is.page()&&(l.debug("Setting as a page dimmer",p),l.set.pageDimmer());l.is.closable()&&(l.verbose("Adding dimmer close event",v),p.on(rt+k,b.dimmer,l.event.click))}},unbind:{events:function(){w.removeData(nt);p.off(k)}},event:{click:function(t){l.verbose("Determining if event occured on dimmer",t);(0===v.find(t.target).length||n(t.target).is(b.content))&&(l.hide(),t.stopImmediatePropagation())}},addContent:function(t){var i=n(t);l.debug("Add content to dimmer",i);i.parent()[0]!==v[0]&&i.detach().appendTo(v)},create:function(){var t=n(a.template.dimmer(a));return a.dimmerName&&(l.debug("Creating named dimmer",a.dimmerName),t.addClass(a.dimmerName)),t.appendTo(p),t},show:function(t){t=n.isFunction(t)?t:function(){};l.debug("Showing dimmer",v,a);l.set.variation();l.is.dimmed()&&!l.is.animating()||!l.is.enabled()?l.debug("Dimmer is already shown or disabled"):(l.animate.show(t),a.onShow.call(d),a.onChange.call(d))},hide:function(t){t=n.isFunction(t)?t:function(){};l.is.dimmed()||l.is.animating()?(l.debug("Hiding dimmer",v),l.animate.hide(t),a.onHide.call(d),a.onChange.call(d)):l.debug("Dimmer is not visible")},toggle:function(){l.verbose("Toggling dimmer visibility",v);l.is.dimmed()?l.is.closable()&&l.hide():l.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(a.useFlex?(l.debug("Using flex dimmer"),l.remove.legacy()):(l.debug("Using legacy non-flex dimmer"),l.set.legacy()),"auto"!==a.opacity&&l.set.opacity(),v.transition({displayType:a.useFlex?"flex":"block",animation:a.transition+" in",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.set.dimmed()},onComplete:function(){l.set.active();t()}})):(l.verbose("Showing dimmer animation with javascript"),l.set.dimmed(),"auto"==a.opacity&&(a.opacity=.8),v.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(l.get.duration(),a.opacity,function(){v.removeAttr("style");l.set.active();t()}))},hide:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(l.verbose("Hiding dimmer with css"),v.transition({displayType:a.useFlex?"flex":"block",animation:a.transition+" out",queue:!1,duration:l.get.duration(),useFailSafe:!0,onComplete:function(){l.remove.dimmed();l.remove.variation();l.remove.active();t()}})):(l.verbose("Hiding dimmer with javascript"),v.stop().fadeOut(l.get.duration(),function(){l.remove.dimmed();l.remove.active();v.removeAttr("style");t()}))}},get:{dimmer:function(){return v},duration:function(){return"object"==typeof a.duration?l.is.active()?a.duration.hide:a.duration.show:a.duration}},has:{dimmer:function(){return a.dimmerName?0<w.find(b.dimmer).filter("."+a.dimmerName).length:0<w.find(b.dimmer).length}},is:{active:function(){return v.hasClass(y.active)},animating:function(){return v.is(":animated")||v.hasClass(y.animating)},closable:function(){return"auto"==a.closable?"hover"!=a.on:a.closable},dimmer:function(){return w.hasClass(y.dimmer)},dimmable:function(){return w.hasClass(y.dimmable)},dimmed:function(){return p.hasClass(y.dimmed)},disabled:function(){return p.hasClass(y.disabled)},enabled:function(){return!l.is.disabled()},page:function(){return p.is("body")},pageDimmer:function(){return v.hasClass(y.pageDimmer)}},can:{show:function(){return!v.hasClass(y.disabled)}},set:{opacity:function(n){var i=v.css("background-color"),t=i.split(","),r=t&&3==t.length,u=t&&4==t.length;n=0===a.opacity?0:a.opacity||n;i=r||u?(t[3]=n+")",t.join(",")):"rgba(0, 0, 0, "+n+")";l.debug("Setting opacity to",n);v.css("background-color",i)},legacy:function(){v.addClass(y.legacy)},active:function(){v.addClass(y.active)},dimmable:function(){p.addClass(y.dimmable)},dimmed:function(){p.addClass(y.dimmed)},pageDimmer:function(){v.addClass(y.pageDimmer)},disabled:function(){v.addClass(y.disabled)},variation:function(n){(n=n||a.variation)&&v.addClass(n)}},remove:{active:function(){v.removeClass(y.active)},legacy:function(){v.removeClass(y.legacy)},dimmed:function(){p.removeClass(y.dimmed)},disabled:function(){v.removeClass(y.disabled)},variation:function(n){(n=n||a.variation)&&v.removeClass(n)}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";it&&(t+=" '"+it+"'");1<e.length&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=g;return i=i||c,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:l.error(ut.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),Array.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}}).preinitialize();h?(g===r&&l.initialize(),l.invoke(s)):(g!==r&&g.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},displayLoader:!1,loaderText:!1,loaderVariation:"",onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show",loader:"ui loader"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(t){var i,r=n("<div/>").addClass("ui dimmer");return t.displayLoader&&(i=n("<div/>").addClass(t.className.loader).addClass(t.loaderVariation),t.loaderText&&(i.text(t.loaderText),i.addClass("text")),r.append(i)),r}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dropdown=function(u){var f,e=n(this),o=n(i),l=e.selector||"",h="ontouchstart"in i.documentElement,c=(new Date).getTime(),s=[],a=u,v="string"==typeof a,y=[].slice.call(arguments,1);return e.each(function(p){var fi,ei,kt,gt,at,ni,ct,pt,w,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.dropdown.settings,u):n.extend({},n.fn.dropdown.settings),k=b.className,vt=b.message,ti=b.fields,et=b.keys,ut=b.metadata,li=b.namespace,ii=b.regExp,d=b.selector,lt=b.error,oi=b.templates,it="."+li,dt="module-"+li,g=n(this),ht=n(b.context),st=g.find(d.text),ft=g.find(d.search),ri=g.find(d.sizer),rt=g.find(d.input),ai=g.find(d.icon),vi=g.find(d.clearIcon),ui=0<g.prev().find(d.text).length?g.prev().find(d.text):g.prev(),nt=g.children(d.menu),tt=nt.find(d.item),yt=b.hideDividers?tt.parent().children(d.divider):n(),wt=!1,si=!1,hi=!1,ci=!1,ot=this,bt=g.data(dt);w={initialize:function(){w.debug("Initializing dropdown",b);w.is.alreadySetup()?w.setup.reference():(b.ignoreDiacritics&&!String.prototype.normalize&&(b.ignoreDiacritics=!1,w.error(lt.noNormalize,ot)),w.setup.layout(),b.values&&w.change.values(b.values),w.refreshData(),w.save.defaults(),w.restore.selected(),w.create.id(),w.bind.events(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w);bt=w;g.data(dt,w)},destroy:function(){w.verbose("Destroying previous dropdown",g);w.remove.tabbable();w.remove.active();nt.transition("stop all");nt.removeClass(k.visible).addClass(k.hidden);g.off(it).removeData(dt);nt.off(it);o.off(at);w.disconnect.menuObserver();w.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(ct=new MutationObserver(w.event.select.mutation),pt=new MutationObserver(w.event.menu.mutation),w.debug("Setting up mutation observer",ct,pt),w.observe.select(),w.observe.menu())},disconnect:{menuObserver:function(){pt&&pt.disconnect()},selectObserver:function(){ct&&ct.disconnect()}},observe:{select:function(){w.has.input()&&ct&&ct.observe(g[0],{childList:!0,subtree:!0})},menu:function(){w.has.menu()&&pt&&pt.observe(nt[0],{childList:!0,subtree:!0})}},create:{id:function(){ni=(Math.random().toString(16)+"000000000").substr(2,8);at="."+ni;w.verbose("Creating unique id for element",ni)},userChoice:function(t){var u,i,f;return!!(t=t||w.get.userValues())&&(t=Array.isArray(t)?t:[t],n.each(t,function(t,e){!1===w.get.item(e)&&(f=b.templates.addition(w.add.variables(vt.addResult,e)),i=n("<div />").html(f).attr("data-"+ut.value,e).attr("data-"+ut.text,e).addClass(k.addition).addClass(k.item),b.hideAdditions&&i.addClass(k.hidden),u=u===r?i:u.add(i),w.verbose("Creating user choices for value",e,i))}),u)},userLabels:function(){var t=w.get.userValues();t&&(w.debug("Adding user labels",t),n.each(t,function(n,t){w.verbose("Adding custom user value");w.add.label(t,t)}))},menu:function(){nt=n("<div />").addClass(k.menu).appendTo(g)},sizer:function(){ri=n("<span />").addClass(k.sizer).insertAfter(ft)}},search:function(n){n=n!==r?n:w.get.query();w.verbose("Searching for query",n);w.has.minCharacters(n)?w.filter(n):w.hide()},select:{firstUnfiltered:function(){w.verbose("Selecting first non-filtered element");w.remove.selectedItem();tt.not(d.unselectable).not(d.addition+d.hidden).eq(0).addClass(k.selected)},nextAvailable:function(n){var t=(n=n.eq(0)).nextAll(d.item).not(d.unselectable).eq(0),i=n.prevAll(d.item).not(d.unselectable).eq(0);0<t.length?(w.verbose("Moving selection to",t),t.addClass(k.selected)):(w.verbose("Moving selection to",i),i.addClass(k.selected))}},setup:{api:function(){var n={debug:b.debug,urlData:{value:w.get.value(),query:w.get.query()},on:!1};w.verbose("First request, initializing API");g.api(n)},layout:function(){g.is("select")&&(w.setup.select(),w.setup.returnedObject());w.has.menu()||w.create.menu();w.is.selection()&&w.is.clearable()&&!w.has.clearItem()&&(w.verbose("Adding clear icon"),vi=n("<i />").addClass("remove icon").insertBefore(st));w.is.search()&&!w.has.search()&&(w.verbose("Adding search input"),ft=n("<input />").addClass(k.search).prop("autocomplete","off").insertBefore(st));w.is.multiple()&&w.is.searchSelection()&&!w.has.sizer()&&w.create.sizer();b.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t);g.is("select")&&(rt=g);0<rt.parent(d.dropdown).length?(w.debug("UI dropdown already exists. Creating dropdown menu only"),g=rt.closest(d.dropdown),w.has.menu()||w.create.menu(),nt=g.children(d.menu),w.setup.menu(t)):(w.debug("Creating entire dropdown from select"),g=n("<div />").attr("class",rt.attr("class")).addClass(k.selection).addClass(k.dropdown).html(oi.dropdown(t,b.preserveHTML,b.className)).insertBefore(rt),rt.hasClass(k.multiple)&&!1===rt.prop("multiple")&&(w.error(lt.missingMultiple),rt.prop("multiple",!0)),rt.is("[multiple]")&&w.set.multiple(),rt.prop("disabled")&&(w.debug("Disabling dropdown"),g.addClass(k.disabled)),rt.removeAttr("class").detach().prependTo(g));w.refresh()},menu:function(t){nt.html(oi.menu(t,ti,b.preserveHTML,b.className));tt=nt.find(d.item);yt=b.hideDividers?tt.parent().children(d.divider):n()},reference:function(){w.debug("Dropdown behavior was called on select, replacing with closest dropdown");g=g.parent(d.dropdown);bt=g.data(dt);ot=g.get(0);w.refresh();w.setup.returnedObject()},returnedObject:function(){var n=e.slice(0,p),t=e.slice(p+1);e=n.add(g).add(t)}},refresh:function(){w.refreshSelectors();w.refreshData()},refreshItems:function(){tt=nt.find(d.item);yt=b.hideDividers?tt.parent().children(d.divider):n()},refreshSelectors:function(){w.verbose("Refreshing selector cache");st=g.find(d.text);ft=g.find(d.search);rt=g.find(d.input);ai=g.find(d.icon);ui=0<g.prev().find(d.text).length?g.prev().find(d.text):g.prev();nt=g.children(d.menu);tt=nt.find(d.item);yt=b.hideDividers?tt.parent().children(d.divider):n()},refreshData:function(){w.verbose("Refreshing cached metadata");tt.removeData(ut.text).removeData(ut.value)},clearData:function(){w.verbose("Clearing metadata");tt.removeData(ut.text).removeData(ut.value);g.removeData(ut.defaultText).removeData(ut.defaultValue).removeData(ut.placeholderText)},toggle:function(){w.verbose("Toggling menu visibility");w.is.active()?w.hide():w.show()},show:function(t){if(t=n.isFunction(t)?t:function(){},!w.can.show()&&w.is.remote()&&(w.debug("No API results retrieved, searching before show"),w.queryRemote(w.get.query(),w.show)),w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),!w.has.message()||w.has.maxSelections()||w.has.allResultsFiltered()||w.remove.message(),w.is.allFiltered())return!0;!1!==b.onShow.call(ot)&&w.animate.show(function(){w.can.click()&&w.bind.intent();w.has.search()&&w.focusSearch();w.set.visible();t.call(ot)})}},hide:function(t){t=n.isFunction(t)?t:function(){};w.is.active()&&!w.is.animatingOutward()?(w.debug("Hiding dropdown"),!1!==b.onHide.call(ot)&&w.animate.hide(function(){w.remove.visible();w.is.focusedOnSearch()&&ft.blur();t.call(ot)})):w.can.click()&&w.unbind.intent()},hideOthers:function(){w.verbose("Finding other dropdowns to hide");e.not(g).has(d.menu+"."+k.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu  instantaneously");w.remove.active();w.remove.visible();nt.transition("hide")},hideSubMenus:function(){var n=nt.children(d.item).find(d.menu);w.verbose("Hiding sub menus",n);n.transition("hide")},bind:{events:function(){h&&w.bind.touchEvents();w.bind.keyboardEvents();w.bind.inputEvents();w.bind.mouseEvents()},touchEvents:function(){w.debug("Touch device detected binding additional touch events");w.is.searchSelection()||w.is.single()&&g.on("touchstart"+it,w.event.test.toggle);nt.on("touchstart"+it,d.item,w.event.item.mouseenter)},keyboardEvents:function(){w.verbose("Binding keyboard events");g.on("keydown"+it,w.event.keydown);w.has.search()&&g.on(w.get.inputEvent()+it,d.search,w.event.input);w.is.multiple()&&o.on("keydown"+at,w.event.document.keydown)},inputEvents:function(){w.verbose("Binding input change events");g.on("change"+it,d.input,w.event.change)},mouseEvents:function(){w.verbose("Binding mouse events");w.is.multiple()&&g.on("click"+it,d.label,w.event.label.click).on("click"+it,d.remove,w.event.remove.click);w.is.searchSelection()?(g.on("mousedown"+it,w.event.mousedown).on("mouseup"+it,w.event.mouseup).on("mousedown"+it,d.menu,w.event.menu.mousedown).on("mouseup"+it,d.menu,w.event.menu.mouseup).on("click"+it,d.icon,w.event.icon.click).on("click"+it,d.clearIcon,w.event.clearIcon.click).on("focus"+it,d.search,w.event.search.focus).on("click"+it,d.search,w.event.search.focus).on("blur"+it,d.search,w.event.search.blur).on("click"+it,d.text,w.event.text.focus),w.is.multiple()&&g.on("click"+it,w.event.click)):("click"==b.on?g.on("click"+it,d.icon,w.event.icon.click).on("click"+it,w.event.test.toggle):"hover"==b.on?g.on("mouseenter"+it,w.delay.show).on("mouseleave"+it,w.delay.hide):g.on(b.on+it,w.toggle),g.on("mousedown"+it,w.event.mousedown).on("mouseup"+it,w.event.mouseup).on("focus"+it,w.event.focus).on("click"+it,d.clearIcon,w.event.clearIcon.click),w.has.menuSearch()?g.on("blur"+it,d.search,w.event.search.blur):g.on("blur"+it,w.event.blur));nt.on("mouseenter"+it,d.item,w.event.item.mouseenter).on("mouseleave"+it,d.item,w.event.item.mouseleave).on("click"+it,d.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document");h&&o.on("touchstart"+at,w.event.test.touch).on("touchmove"+at,w.event.test.touch);o.on("click"+at,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document");h&&o.off("touchstart"+at).off("touchmove"+at);o.off("click"+at)}},filter:function(t){function u(){w.is.multiple()&&w.filterActive();(t||!t&&0==w.get.activeItem().length)&&w.select.firstUnfiltered();w.has.allResultsFiltered()?b.onNoResults.call(ot,i)?b.allowAdditions?b.hideAdditions&&(w.verbose("User addition with no menu, setting empty style"),w.set.empty(),w.hideMenu()):(w.verbose("All items filtered, showing message",i),w.add.message(vt.noResults)):(w.verbose("All items filtered, hiding dropdown",i),w.hideMenu()):(w.remove.empty(),w.remove.message());b.allowAdditions&&w.add.userSuggestion(w.escape.htmlEntities(t));w.is.searchSelection()&&w.can.show()&&w.is.focusedOnSearch()&&w.show()}var i=t!==r?t:w.get.query();b.useLabels&&w.has.maxSelections()||(b.apiSettings?w.can.useAPI()?w.queryRemote(i,function(){b.filterRemoteData&&w.filterItems(i);var t=rt.val();Array.isArray(t)||(t=t&&""!==t?t.split(b.delimiter):[]);n.each(t,function(n,t){tt.filter('[data-value="'+t+'"]').addClass(k.filtered)});u()}):w.error(lt.noAPI):(w.filterItems(i),u()))},queryRemote:function(t,i){var r={errorDuration:!1,cache:"local",throttle:b.throttle,urlData:{query:t},onError:function(){w.add.message(vt.serverError);i()},onFailure:function(){w.add.message(vt.serverError);i()},onSuccess:function(n){var t=n[ti.remoteValues];Array.isArray(t)||(t=[]);w.remove.message();w.setup.menu({values:t});0!==t.length||b.allowAdditions||w.add.message(vt.noResults);i()}};g.api("get request")||w.setup.api();r=n.extend(!0,{},r,b.apiSettings);g.api("setting",r).api("query")},filterItems:function(t){var u=w.remove.diacritics(t!==r?t:w.get.query()),i=null,e=w.escape.string(u),f=new RegExp("^"+e,"igm");w.has.query()&&(i=[],w.verbose("Searching for matching values",u),tt.each(function(){var t,r,e=n(this);return("both"===b.match||"text"===b.match)&&(-1!==(t=w.remove.diacritics(String(w.get.choiceText(e,!1)))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,t)||!0===b.fullTextSearch&&w.fuzzySearch(u,t))?(i.push(this),!0):("both"===b.match||"value"===b.match)&&(-1!==(r=w.remove.diacritics(String(w.get.choiceValue(e,t)))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,r)||!0===b.fullTextSearch&&w.fuzzySearch(u,r))?(i.push(this),!0):void 0}));w.debug("Showing only matched items",u);w.remove.filteredItem();i&&tt.not(i).addClass(k.filtered);w.has.query()?!0===b.hideDividers?yt.addClass(k.hidden):"empty"===b.hideDividers&&yt.removeClass(k.hidden).filter(function(){var t=n(this).nextUntil(d.item);return 0===(t.length?t:n(this)).nextUntil(d.divider).filter(d.item+":not(."+k.filtered+")").length}).addClass(k.hidden):yt.removeClass(k.hidden)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),r<u)return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},exactSearch:function(n,t){return n=n.toLowerCase(),-1<(t=t.toLowerCase()).indexOf(n)},filterActive:function(){b.useLabels&&tt.filter("."+k.active).addClass(k.filtered)},focusSearch:function(n){w.has.search()&&!w.is.focusedOnSearch()&&(n?(g.off("focus"+it,d.search),ft.focus(),g.on("focus"+it,d.search,w.event.search.focus)):ft.focus())},blurSearch:function(){w.has.search()&&ft.blur()},forceSelection:function(){var t=tt.not(k.filtered).filter("."+k.selected).eq(0),i=tt.not(k.filtered).filter("."+k.active).eq(0),n=0<t.length?t:i;0<n.length&&!w.is.multiple()?(w.debug("Forcing partial selection to selected item",n),w.event.item.click.call(n,{},!0)):(b.allowAdditions&&w.set.selected(w.get.query()),w.remove.searchTerm())},change:{values:function(t){b.allowAdditions||w.clear();w.debug("Creating dropdown with specified values",t);w.setup.menu({values:t});n.each(t,function(n,t){if(1==t.selected&&(w.debug("Setting initial selection to",t[ti.value]),w.set.selected(t[ti.value]),!w.is.multiple()))return!1})}},event:{change:function(){hi||(w.debug("Input changed, updating selection"),w.set.selected())},focus:function(){b.showOnFocus&&!wt&&w.is.hidden()&&!kt&&w.show()},blur:function(){kt=i.activeElement===this;wt||kt||(w.remove.activeLabel(),w.hide())},mousedown:function(){w.is.searchSelection()?gt=!0:wt=!0},mouseup:function(){w.is.searchSelection()?gt=!1:wt=!1},click:function(t){n(t.target).is(g)&&(w.is.focusedOnSearch()?w.show():w.focusSearch())},search:{focus:function(n){wt=!0;w.is.multiple()&&w.remove.activeLabel();(b.showOnFocus||"focus"!==n.type&&"focusin"!==n.type)&&w.search()},blur:function(){kt=i.activeElement===this;w.is.searchSelection()&&!gt&&(si||kt||(b.forceSelection&&w.forceSelection(),w.hide()));gt=!1}},clearIcon:{click:function(n){w.clear();w.is.searchSelection()&&w.remove.searchTerm();w.hide();n.stopPropagation()}},icon:{click:function(){ci=!0;w.has.search()?w.is.active()?w.blurSearch():b.showOnFocus?w.focusSearch():w.toggle():w.toggle()}},text:{focus:function(){wt=!0;w.focusSearch()}},input:function(){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered();clearTimeout(w.timer);w.timer=setTimeout(w.search,b.delay.search)},label:{click:function(t){var i=n(this),u=g.find(d.label),r=u.filter("."+k.active),f=i.nextAll("."+k.active),e=i.prevAll("."+k.active),o=0<f.length?i.nextUntil(f).add(r).add(i):i.prevUntil(e).add(r).add(i);t.shiftKey?(r.removeClass(k.active),o.addClass(k.active)):t.ctrlKey?i.toggleClass(k.active):(r.removeClass(k.active),i.addClass(k.active));b.onLabelSelect.apply(this,u.filter("."+k.active))}},remove:{click:function(){var t=n(this).parent();t.hasClass(k.active)?w.remove.activeLabels():w.remove.activeLabels(t)}},test:{toggle:function(n){var t=w.is.multiple()?w.show:w.toggle;w.is.bubbledLabelClick(n)||w.is.bubbledIconClick(n)||w.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){w.determine.eventOnElement(n,function(){"touchstart"==n.type?w.timer=setTimeout(function(){w.hide()},b.delay.touch):"touchmove"==n.type&&clearTimeout(w.timer)});n.stopPropagation()},hide:function(t){w.determine.eventInModule(t,w.hide)&&ot.id&&n(t.target).attr("for")===ot.id&&t.preventDefault()}},select:{mutation:function(n){w.debug("<select> modified, recreating menu");w.is.selectMutation(n)&&(w.disconnect.selectObserver(),w.refresh(),w.setup.select(),w.set.selected(),w.observe.select())}},menu:{mutation:function(t){var i=t[0],u=i.addedNodes?n(i.addedNodes[0]):n(!1),f=i.removedNodes?n(i.removedNodes[0]):n(!1),r=u.add(f),e=r.is(d.addition)||0<r.closest(d.addition).length,o=r.is(d.message)||0<r.closest(d.message).length;e||o?(w.debug("Updating item selector cache"),w.refreshItems()):(w.debug("Menu modified, updating selector cache"),w.refresh())},mousedown:function(){si=!0},mouseup:function(){si=!1}},item:{mouseenter:function(t){var u=n(t.target),r=n(this),i=r.children(d.menu),f=r.siblings(d.item).children(d.menu),e=0<i.length;0<i.find(u).length||!e||(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",i);n.each(f,function(){w.animate.hide(!1,n(this))});w.animate.show(!1,i)},b.delay.show),t.preventDefault())},mouseleave:function(){var t=n(this).children(d.menu);0<t.length&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t);w.animate.hide(!1,t)},b.delay.hide))},click:function(t,r){var u=n(this),o=n(t?t.target:""),f=u.find(d.menu),e=w.get.choiceText(u),s=w.get.choiceValue(u,e),h=0<f.length,c=0<f.find(o).length;w.has.search()&&i.activeElement.isEqualNode(ft[0])||n(i.activeElement).blur();c||h&&!b.allowCategorySelection||(w.is.searchSelection()&&(b.allowAdditions&&w.remove.userAddition(),w.remove.searchTerm(),w.is.focusedOnSearch()||1==r||w.focusSearch(!0)),b.useLabels||(w.remove.filteredItem(),w.set.scrollPosition(u)),w.determine.selectAction.call(this,e,s))}},document:{keydown:function(n){var u=n.which;if(w.is.inObject(u,et)){var i=g.find(d.label),t=i.filter("."+k.active),s=(t.data(ut.value),i.index(t)),a=i.length,r=0<t.length,h=1<t.length,v=0===s,c=s+1==a,e=w.is.searchSelection(),f=w.is.focusedOnSearch(),l=w.is.focused(),o=f&&0===w.get.caretPosition(!1),y=o&&0!==w.get.caretPosition(!0);if(e&&!r&&!f)return;u==et.leftArrow?!l&&!o||r?r&&(n.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),i.removeClass(k.active)),v&&!h?t.addClass(k.active):t.prev(d.siblingLabel).addClass(k.active).end(),n.preventDefault()):(w.verbose("Selecting previous label"),i.last().addClass(k.active)):u==et.rightArrow?(l&&!r&&i.first().addClass(k.active),r&&(n.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),i.removeClass(k.active)),c?e?f?i.removeClass(k.active):w.focusSearch():h?t.next(d.siblingLabel).addClass(k.active):t.addClass(k.active):t.next(d.siblingLabel).addClass(k.active),n.preventDefault())):u==et.deleteKey||u==et.backspace?r?(w.verbose("Removing active labels"),c&&e&&!f&&w.focusSearch(),t.last().next(d.siblingLabel).addClass(k.active),w.remove.activeLabels(t),n.preventDefault()):!o||y||r||u!=et.backspace||(w.verbose("Removing last label on input backspace"),t=i.last().addClass(k.active),w.remove.activeLabels(t)):t.removeClass(k.active)}}},keydown:function(n){var t=n.which;if(w.is.inObject(t,et)){var r,s=tt.not(d.unselectable).filter("."+k.selected).eq(0),a=nt.children("."+k.active).eq(0),i=0<s.length?s:a,v=0<i.length?i.siblings(":not(."+k.filtered+")").addBack():nt.children(":not(."+k.filtered+")"),e=i.children(d.menu),u=i.closest(d.menu),h=u.hasClass(k.visible)||u.hasClass(k.animating)||0<u.parent(d.menu).length,c=0<e.length,f=0<i.length,l=0<i.not(d.unselectable).length,o=t==et.delimiter&&b.allowAdditions&&w.is.multiple();if(b.allowAdditions&&b.hideAdditions&&(t==et.enter||o)&&l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm(),w.is.multiple()&&n.preventDefault()),w.is.visible()){if(t!=et.enter&&!o||(t==et.enter&&f&&c&&!b.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=et.rightArrow):l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&(w.remove.searchTerm(),w.is.multiple()&&ft.focus())),n.preventDefault()),f&&(t==et.leftArrow&&u[0]!==nt[0]&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,u),i.removeClass(k.selected),u.closest(d.item).addClass(k.selected),n.preventDefault()),t==et.rightArrow&&c&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,e),i.removeClass(k.selected),e.find(d.item).eq(0).addClass(k.selected),n.preventDefault())),t==et.upArrow){if(r=f&&h?i.prevAll(d.item+":not("+d.unselectable+")").eq(0):tt.eq(0),v.index(r)<0)return w.verbose("Up key pressed but reached top of current menu"),void n.preventDefault();w.verbose("Up key pressed, changing active item");i.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}if(t==et.downArrow){if(0===(r=f&&h?r=i.nextAll(d.item+":not("+d.unselectable+")").eq(0):tt.eq(0)).length)return w.verbose("Down key pressed but reached bottom of current menu"),void n.preventDefault();w.verbose("Down key pressed, changing active item");tt.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}t==et.pageUp&&(w.scrollPage("up"),n.preventDefault());t==et.pageDown&&(w.scrollPage("down"),n.preventDefault());t==et.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else o&&n.preventDefault(),t!=et.downArrow||w.is.visible()||(w.verbose("Down key pressed, showing dropdown"),w.show(),n.preventDefault())}else w.has.search()||w.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=rt[0];t&&(w.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},determine:{selectAction:function(t,i){fi=!0;w.verbose("Determining action",b.action);n.isFunction(w.action[b.action])?(w.verbose("Triggering preset action",b.action,t,i),w.action[b.action].call(ot,t,i,this)):n.isFunction(b.action)?(w.verbose("Triggering user action",b.action,t,i),b.action.call(ot,t,i,this)):w.error(lt.action,b.action);fi=!1},eventInModule:function(t,r){var u=n(t.target),f=0<u.closest(i.documentElement).length,e=0<u.closest(g).length;return r=n.isFunction(r)?r:function(){},f&&!e?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,r){var u=n(t.target),f=u.closest(d.siblingLabel),e=i.body.contains(t.target),o=0===g.find(f).length||!(w.is.multiple()&&b.useLabels),s=0===u.closest(nt).length;return r=n.isFunction(r)?r:function(){},e&&o&&s?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i,u){i=i!==r?i:t;w.can.activate(n(u))&&(w.set.selected(i,n(u)),w.is.multiple()||w.hideAndClear())},select:function(t,i,u){i=i!==r?i:t;w.can.activate(n(u))&&(w.set.value(i,t,n(u)),w.is.multiple()||w.hideAndClear())},combo:function(t,i,u){i=i!==r?i:t;w.set.selected(i,n(u));w.hideAndClear()},hide:function(t,i,r){w.set.value(i,t,n(r));w.hideAndClear()}},get:{id:function(){return ni},defaultText:function(){return g.data(ut.defaultText)},defaultValue:function(){return g.data(ut.defaultValue)},placeholderText:function(){return"auto"!=b.placeholder&&"string"==typeof b.placeholder?b.placeholder:g.data(ut.placeholderText)||""},text:function(){return st.text()},query:function(){return n.trim(ft.val())},searchWidth:function(n){return n=n!==r?n:ft.val(),ri.text(n),Math.ceil(ri.width()+1)},selectionCount:function(){var n=w.get.values();return w.is.multiple()?Array.isArray(n)?n.length:0:""!==w.get.value()?1:0},transition:function(n){return"auto"==b.transition?w.is.upward(n)?"slide up":"slide down":b.transition},userValues:function(){var t=w.get.values();return!!t&&(t=Array.isArray(t)?t:[t],n.grep(t,function(n){return!1===w.get.item(n)}))},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(n){var r,u,t=ft.get(0);return n&&"selectionEnd"in t?t.selectionEnd:!n&&"selectionStart"in t?t.selectionStart:i.selection?(t.focus(),u=(r=i.selection.createRange()).text.length,n?u:(r.moveStart("character",-t.value.length),r.text.length-u)):void 0},value:function(){var n=0<rt.length?rt.val():g.data(ut.value),t=Array.isArray(n)&&1===n.length&&""===n[0];return n===r||t?"":n},values:function(){var n=w.get.value();return""===n?"":!w.has.selectInput()&&w.is.multiple()?"string"==typeof n?n.split(b.delimiter):"":n},remoteValues:function(){var t=w.get.values(),i=!1;return t&&("string"==typeof t&&(t=[t]),n.each(t,function(n,t){var r=w.read.remoteData(t);w.verbose("Restoring value from session data",r,t);r&&((i=i||{})[t]=r)})),i},choiceText:function(t,i){if(i=i!==r?i:b.preserveHTML,t)return 0<t.find(d.menu).length&&(w.verbose("Retrieving text of element with sub-menu"),(t=t.clone()).find(d.menu).remove(),t.find(d.menuIcon).remove()),t.data(ut.text)!==r?t.data(ut.text):i?n.trim(t.html()):n.trim(t.text())},choiceValue:function(t,i){return i=i||w.get.choiceText(t),!!t&&(t.data(ut.value)!==r?String(t.data(ut.value)):"string"==typeof i?n.trim(i.toLowerCase()):String(i))},inputEvent:function(){var n=ft[0];return!!n&&(n.oninput!==r?"input":n.onpropertychange!==r?"propertychange":"keyup")},selectValues:function(){var t={values:[]};return g.find("option").each(function(){var i=n(this),u=i.html(),e=i.attr("disabled"),f=i.attr("value")!==r?i.attr("value"):u;"auto"===b.placeholder&&""===f?t.placeholder=u:t.values.push({name:u,value:f,disabled:e})}),b.placeholder&&"auto"!==b.placeholder&&(w.debug("Setting placeholder value to",b.placeholder),t.placeholder=b.placeholder),b.sortSelect?(!0===b.sortSelect?t.values.sort(function(n,t){return n.name.localeCompare(t.name)}):"natural"===b.sortSelect?t.values.sort(function(n,t){return n.name.toLowerCase().localeCompare(t.name.toLowerCase())}):n.isFunction(b.sortSelect)&&t.values.sort(b.sortSelect),w.debug("Retrieved and sorted values from select",t)):w.debug("Retrieved values from select",t),t},activeItem:function(){return tt.filter("."+k.active)},selectedItem:function(){var n=tt.not(d.unselectable).filter("."+k.selected);return 0<n.length?n:tt.eq(0)},itemWithAdditions:function(n){var t=w.get.item(n),i=w.create.userChoice(n);return i&&0<i.length&&(t=0<t.length?t.add(i):i),t},item:function(t,i){var f,e,u=!1;return t=t!==r?t:w.get.values()!==r?w.get.values():w.get.text(),f=(e=w.is.multiple()&&Array.isArray(t))?0<t.length:t!==r&&null!==t,i=""===t||!1===t||!0===t||i||!1,f&&tt.each(function(){var f=n(this),s=w.get.choiceText(f),o=w.get.choiceValue(f,s);if(null!==o&&o!==r)if(e)-1!==n.inArray(String(o),t)&&(u=u?u.add(f):f);else if(i){if(w.verbose("Ambiguous dropdown value using strict type check",f,t),o===t)return u=f,!0}else if(String(o)==String(t))return w.verbose("Found select item by value",o,t),u=f,!0}),u}},check:{maxSelections:function(n){return!b.maxSelections||((n=n!==r?n:w.get.selectionCount())>=b.maxSelections?(w.debug("Maximum selection count reached"),b.useLabels&&(tt.addClass(k.filtered),w.add.message(vt.maxSelections)),!0):(w.verbose("No longer at maximum selection count"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filterItems(),!1))}},restore:{defaults:function(){w.clear();w.restore.defaultText();w.restore.defaultValue()},defaultText:function(){var n=w.get.defaultText();n===w.get.placeholderText?(w.debug("Restoring default placeholder text",n),w.set.placeholderText(n)):(w.debug("Restoring default text",n),w.set.text(n))},placeholderText:function(){w.set.placeholderText()},defaultValue:function(){var n=w.get.defaultValue();n!==r&&(w.debug("Restoring default value",n),""!==n?(w.set.value(n),w.set.selected()):(w.remove.activeItem(),w.remove.selectedItem()))},labels:function(){b.allowAdditions&&(b.useLabels||(w.error(lt.labels),b.useLabels=!0),w.debug("Restoring selected values"),w.create.userLabels());w.check.maxSelections()},selected:function(){w.restore.values();w.is.multiple()?(w.debug("Restoring previously selected values and labels"),w.restore.labels()):w.debug("Restoring previously selected values")},values:function(){w.set.initialLoad();b.apiSettings&&b.saveRemoteData&&w.get.remoteValues()?w.restore.remoteValues():w.set.selected();var n=w.get.value();!n||""===n||Array.isArray(n)&&0===n.length?rt.addClass(k.noselection):rt.removeClass(k.noselection);w.remove.initialLoad()},remoteValues:function(){var t=w.get.remoteValues();w.debug("Recreating selected from session data",t);t&&(w.is.single()?n.each(t,function(n,t){w.set.text(t)}):n.each(t,function(n,t){w.add.label(n,t)}))}},read:{remoteData:function(n){var i;if(t.Storage!==r)return(i=sessionStorage.getItem(n))!==r&&i;w.error(lt.noStorage)}},save:{defaults:function(){w.save.defaultText();w.save.placeholderText();w.save.defaultValue()},defaultValue:function(){var n=w.get.value();w.verbose("Saving default value as",n);g.data(ut.defaultValue,n)},defaultText:function(){var n=w.get.text();w.verbose("Saving default text as",n);g.data(ut.defaultText,n)},placeholderText:function(){var n;!1!==b.placeholder&&st.hasClass(k.placeholder)&&(n=w.get.text(),w.verbose("Saving placeholder text as",n),g.data(ut.placeholderText,n))},remoteData:function(n,i){t.Storage!==r?(w.verbose("Saving remote data to session storage",i,n),sessionStorage.setItem(i,n)):w.error(lt.noStorage)}},clear:function(){w.is.multiple()&&b.useLabels?w.remove.labels():(w.remove.activeItem(),w.remove.selectedItem(),w.remove.filteredItem());w.set.placeholderText();w.clearValue()},clearValue:function(){w.set.value("")},scrollPage:function(n,t){var r,u,f=t||w.get.selectedItem(),e=f.closest(d.menu),c=e.outerHeight(),h=e.scrollTop(),s=tt.eq(0).outerHeight(),o=Math.floor(c/s),l=(e.prop("scrollHeight"),"up"==n?h-s*o:h+s*o),i=tt.not(d.unselectable);u="up"==n?i.index(f)-o:i.index(f)+o;0<(r=("up"==n?0<=u:u<i.length)?i.eq(u):"up"==n?i.first():i.last()).length&&(w.debug("Scrolling page",n,r),f.removeClass(k.selected),r.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r),e.scrollTop(l))},set:{filtered:function(){var n=w.is.multiple(),i=w.is.searchSelection(),r=n&&i,t=i?w.get.query():"",u="string"==typeof t&&0<t.length,f=w.get.searchWidth(),e=""!==t;n&&u&&(w.verbose("Adjusting input width",f,b.glyphWidth),ft.css("width",f));u||r&&e?(w.verbose("Hiding placeholder text"),st.addClass(k.filtered)):n&&(!r||e)||(w.verbose("Showing placeholder text"),st.removeClass(k.filtered))},empty:function(){g.addClass(k.empty)},loading:function(){g.addClass(k.loading)},placeholderText:function(n){n=n||w.get.placeholderText();w.debug("Setting placeholder text",n);w.set.text(n);st.addClass(k.placeholder)},tabbable:function(){w.is.searchSelection()?(w.debug("Added tabindex to searchable dropdown"),ft.val("").attr("tabindex",0),nt.attr("tabindex",-1)):(w.debug("Added tabindex to dropdown"),g.attr("tabindex")===r&&(g.attr("tabindex",0),nt.attr("tabindex",-1)))},initialLoad:function(){w.verbose("Setting initial load");ei=!0},activeItem:function(n){b.allowAdditions&&0<n.filter(d.addition).length?n.addClass(k.filtered):n.addClass(k.active)},partialSearch:function(n){var t=w.get.query().length;ft.val(n.substr(0,t))},scrollPosition:function(n,t){var i,e,u,f,o,s;i=(n=n||w.get.selectedItem()).closest(d.menu);e=n&&0<n.length;t=t!==r&&t;n&&0<i.length&&e&&(n.position().top,i.addClass(k.loading),u=(f=i.scrollTop())-i.offset().top+n.offset().top,t||(s=f+i.height()<u+5,o=u-5<f),w.debug("Scrolling to active item",u),(t||o||s)&&i.scrollTop(u),i.removeClass(k.loading))},text:function(n){"combo"===b.action?(w.debug("Changing combo button text",n,ui),b.preserveHTML?ui.html(n):ui.text(n)):"activate"===b.action&&(n!==w.get.placeholderText()&&st.removeClass(k.placeholder),w.debug("Changing text",n,st),st.removeClass(k.filtered),b.preserveHTML?st.html(n):st.text(n))},selectedItem:function(n){var t=w.get.choiceValue(n),i=w.get.choiceText(n,!1),r=w.get.choiceText(n,!0);w.debug("Setting user selection to item",n);w.remove.activeItem();w.set.partialSearch(i);w.set.activeItem(n);w.set.selected(t,n);w.set.text(r)},selectedLetter:function(t){var u,r=tt.filter("."+k.selected),f=0<r.length&&w.has.firstLetter(r,t),i=!1;f&&(u=r.nextAll(tt).eq(0),w.has.firstLetter(u,t)&&(i=u));i||tt.each(function(){if(w.has.firstLetter(n(this),t))return i=n(this),!1});i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),r.removeClass(k.selected),i.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(i))},direction:function(n){"auto"==b.direction?(n?w.is.upward(n)&&w.remove.upward(n):w.remove.upward(),w.can.openDownward(n)?w.remove.upward(n):w.set.upward(n),w.is.leftward(n)||w.can.openRightward(n)||w.set.leftward(n)):"upward"==b.direction&&w.set.upward(n)},upward:function(n){(n||g).addClass(k.upward)},leftward:function(n){(n||nt).addClass(k.leftward)},value:function(n,t,i){n===r||""===n||Array.isArray(n)&&0===n.length?rt.addClass(k.noselection):rt.removeClass(k.noselection);var u=w.escape.value(n),o=0<rt.length,f=w.get.values(),e=n!==r?String(n):n;if(o){if(!b.allowReselection&&e==f&&(w.verbose("Skipping value update already same value",n,f),!w.is.initialLoad()))return;w.is.single()&&w.has.selectInput()&&w.can.extendSelect()&&(w.debug("Adding user option",n),w.add.optionValue(n));w.debug("Updating input value",u,f);hi=!0;rt.val(u);!1===b.fireOnInit&&w.is.initialLoad()?w.debug("Input native change event ignored on initial load"):w.trigger.change();hi=!1}else w.verbose("Storing value in metadata",u,rt),u!==f&&g.data(ut.value,e);!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onChange):b.onChange.call(ot,n,t,i)},active:function(){g.addClass(k.active)},multiple:function(){g.addClass(k.multiple)},visible:function(){g.addClass(k.visible)},exactly:function(n,t){w.debug("Setting selected to exact values");w.clear();w.set.selected(n,t)},selected:function(t,i){var r=w.is.multiple();(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t))&&(w.debug("Setting selected menu item to",i),w.is.multiple()&&w.remove.searchWidth(),w.is.single()?(w.remove.activeItem(),w.remove.selectedItem()):b.useLabels&&w.remove.selectedItem(),i.each(function(){var t=n(this),u=w.get.choiceText(t),f=w.get.choiceValue(t,u),e=t.hasClass(k.filtered),o=t.hasClass(k.active),s=t.hasClass(k.addition),h=r&&1==i.length;r?!o||s?(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),b.useLabels?(w.add.label(f,u,h),w.add.value(f,u,t),w.set.activeItem(t),w.filterActive(),w.select.nextAvailable(i)):(w.add.value(f,u,t),w.set.text(w.add.variables(vt.count)),w.set.activeItem(t))):e||!b.useLabels&&!fi||(w.debug("Selected active value, removing label"),w.remove.selected(f)):(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),w.set.text(u),w.set.value(f,u,t),t.addClass(k.active).addClass(k.selected))}))}},add:{label:function(t,i,r){var u,e=w.is.searchSelection()?ft:st,f=w.escape.value(t);b.ignoreCase&&(f=f.toLowerCase());u=n("<a />").addClass(k.label).attr("data-"+ut.value,f).html(oi.label(f,i,b.preserveHTML,b.className));u=b.onLabelCreate.call(u,f,i);w.has.label(t)?w.debug("User selection already exists, skipping",f):(b.label.variation&&u.addClass(b.label.variation),!0===r?(w.debug("Animating in label",u),u.addClass(k.hidden).insertBefore(e).transition({animation:b.label.transition,debug:b.debug,verbose:b.verbose,duration:b.label.duration})):(w.debug("Adding selection label",u),u.insertBefore(e)))},message:function(t){var i=nt.children(d.message),r=b.templates.message(w.add.variables(t));0<i.length?i.html(r):i=n("<div/>").html(r).addClass(k.message).appendTo(nt)},optionValue:function(t){var i=w.escape.value(t);0<rt.find('option[value="'+w.escape.string(i)+'"]').length||(w.disconnect.selectObserver(),w.is.single()&&(w.verbose("Removing previous user addition"),rt.find("option."+k.addition).remove()),n("<option/>").prop("value",i).addClass(k.addition).html(t).appendTo(rt),w.verbose("Adding user addition as an <option>",t),w.observe.select())},userSuggestion:function(n){var i,t=nt.children(d.addition),r=w.get.item(n),u=r&&r.not(d.addition).length,f=0<t.length;b.useLabels&&w.has.maxSelections()||(""===n||u?t.remove():(f?(t.data(ut.value,n).data(ut.text,n).attr("data-"+ut.value,n).attr("data-"+ut.text,n).removeClass(k.filtered),b.hideAdditions||(i=b.templates.addition(w.add.variables(vt.addResult,n)),t.html(i)),w.verbose("Replacing user suggestion with new value",t)):((t=w.create.userChoice(n)).prependTo(nt),w.verbose("Adding item choice to menu corresponding with user choice addition",t)),b.hideAdditions&&!w.is.allFiltered()||t.addClass(k.selected).siblings().removeClass(k.selected),w.refreshItems()))},variables:function(n,t){var i,r,u=-1!==n.search("{count}"),f=-1!==n.search("{maxCount}"),e=-1!==n.search("{term}");return w.verbose("Adding templated variables to message",n),u&&(i=w.get.selectionCount(),n=n.replace("{count}",i)),f&&(i=w.get.selectionCount(),n=n.replace("{maxCount}",b.maxSelections)),e&&(r=t||w.get.query(),n=n.replace("{term}",r)),n},value:function(n,t,i){var r,u=w.get.values();w.has.value(n)?w.debug("Value already selected"):""!==n?(r=Array.isArray(u)?(r=u.concat([n]),w.get.uniqueArray(r)):[n],w.has.selectInput()?w.can.extendSelect()&&(w.debug("Adding value to select",n,r,rt),w.add.optionValue(n)):(r=r.join(b.delimiter),w.debug("Setting hidden input to delimited value",r,rt)),!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("Skipping onadd callback on initial load",b.onAdd):b.onAdd.call(ot,n,t,i),w.set.value(r,n,t,i),w.check.maxSelections()):w.debug("Cannot select blank values from multiselect")}},remove:{active:function(){g.removeClass(k.active)},activeLabel:function(){g.find(d.label).removeClass(k.active)},empty:function(){g.removeClass(k.empty)},loading:function(){g.removeClass(k.loading)},initialLoad:function(){ei=!1},upward:function(n){(n||g).removeClass(k.upward)},leftward:function(n){(n||nt).removeClass(k.leftward)},visible:function(){g.removeClass(k.visible)},activeItem:function(){tt.removeClass(k.active)},filteredItem:function(){b.useLabels&&w.has.maxSelections()||(b.useLabels&&w.is.multiple()?tt.not("."+k.active).removeClass(k.filtered):tt.removeClass(k.filtered),b.hideDividers&&yt.removeClass(k.hidden),w.remove.empty())},optionValue:function(n){var i=w.escape.value(n),t=rt.find('option[value="'+w.escape.string(i)+'"]');0<t.length&&t.hasClass(k.addition)&&(ct&&(ct.disconnect(),w.verbose("Temporarily disconnecting mutation observer")),t.remove(),w.verbose("Removing user addition as an <option>",i),ct&&ct.observe(rt[0],{childList:!0,subtree:!0}))},message:function(){nt.children(d.message).remove()},searchWidth:function(){ft.css("width","")},searchTerm:function(){w.verbose("Cleared search term");ft.val("");w.set.filtered()},userAddition:function(){tt.filter(d.addition).remove()},selected:function(t,i){if(!(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t)))return!1;i.each(function(){var t=n(this),i=w.get.choiceText(t),r=w.get.choiceValue(t,i);w.is.multiple()?b.useLabels?(w.remove.value(r,i,t),w.remove.label(r)):(w.remove.value(r,i,t),0===w.get.selectionCount()?w.set.placeholderText():w.set.text(w.add.variables(vt.count))):w.remove.value(r,i,t);t.removeClass(k.filtered).removeClass(k.active);b.useLabels&&t.removeClass(k.selected)})},selectedItem:function(){tt.removeClass(k.selected)},value:function(n,t,i){var r,u=w.get.values();w.has.selectInput()?(w.verbose("Input is <select> removing selected option",n),r=w.remove.arrayValue(n,u),w.remove.optionValue(n)):(w.verbose("Removing from delimited values",n),r=(r=w.remove.arrayValue(n,u)).join(b.delimiter));!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onRemove):b.onRemove.call(ot,n,t,i);w.set.value(r,t,i);w.check.maxSelections()},arrayValue:function(t,i){return Array.isArray(i)||(i=[i]),i=n.grep(i,function(n){return t!=n}),w.verbose("Removed value from delimited string",t,i),i},label:function(n){var t=g.find(d.label).filter("[data-"+ut.value+'="'+w.escape.string(n)+'"]');w.verbose("Removing label",t);t.remove()},activeLabels:function(n){n=n||g.find(d.label).filter("."+k.active);w.verbose("Removing active label selections",n);w.remove.labels(n)},labels:function(t){t=t||g.find(d.label);w.verbose("Removing labels",t);t.each(function(){var u=n(this),t=u.data(ut.value),i=t!==r?String(t):t,f=w.is.userValue(i);!1!==b.onLabelRemove.call(u,t)?(w.remove.message(),f?(w.remove.value(i),w.remove.label(i)):w.remove.selected(i)):w.debug("Label remove callback cancelled removal")})},tabbable:function(){w.is.searchSelection()?(w.debug("Searchable dropdown initialized"),ft.removeAttr("tabindex")):(w.debug("Simple selection dropdown initialized"),g.removeAttr("tabindex"));nt.removeAttr("tabindex")},diacritics:function(n){return b.ignoreDiacritics?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n}},has:{menuSearch:function(){return w.has.search()&&0<ft.closest(nt).length},clearItem:function(){return 0<vi.length},search:function(){return 0<ft.length},sizer:function(){return 0<ri.length},selectInput:function(){return rt.is("select")},minCharacters:function(n){return b.minCharacters&&!ci?(n=n!==r?String(n):String(w.get.query())).length>=b.minCharacters:!(ci=!1)},firstLetter:function(n,t){var i;return!(!n||0===n.length||"string"!=typeof t)&&(i=w.get.choiceText(n,!1),(t=t.toLowerCase())==String(i).charAt(0).toLowerCase())},input:function(){return 0<rt.length},items:function(){return 0<tt.length},menu:function(){return 0<nt.length},message:function(){return 0!==nt.children(d.message).length},label:function(n){var t=w.escape.value(n),i=g.find(d.label);return b.ignoreCase&&(t=t.toLowerCase()),0<i.filter("[data-"+ut.value+'="'+w.escape.string(t)+'"]').length},maxSelections:function(){return b.maxSelections&&w.get.selectionCount()>=b.maxSelections},allResultsFiltered:function(){var n=tt.not(d.addition);return n.filter(d.unselectable).length===n.length},userSuggestion:function(){return 0<nt.children(d.addition).length},query:function(){return""!==w.get.query()},value:function(n){return b.ignoreCase?w.has.valueIgnoringCase(n):w.has.valueMatchingCase(n)},valueMatchingCase:function(t){var i=w.get.values();return!!(Array.isArray(i)?i&&-1!==n.inArray(t,i):i==t)},valueIgnoringCase:function(t){var i=w.get.values(),r=!1;return Array.isArray(i)||(i=[i]),n.each(i,function(n,i){if(String(t).toLowerCase()==String(i).toLowerCase())return!(r=!0)}),r}},is:{active:function(){return g.hasClass(k.active)},animatingInward:function(){return nt.transition("is inward")},animatingOutward:function(){return nt.transition("is outward")},bubbledLabelClick:function(t){return n(t.target).is("select, input")&&0<g.closest("label").length},bubbledIconClick:function(t){return 0<n(t.target).closest(ai).length},alreadySetup:function(){return g.is("select")&&g.parent(d.dropdown).data(dt)!==r&&0===g.prev().length},animating:function(n){return n?n.transition&&n.transition("is animating"):nt.transition&&nt.transition("is animating")},leftward:function(n){return(n||nt).hasClass(k.leftward)},clearable:function(){return g.hasClass(k.clearable)||b.clearable},disabled:function(){return g.hasClass(k.disabled)},focused:function(){return i.activeElement===g[0]},focusedOnSearch:function(){return i.activeElement===ft[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!(0==b.hideAdditions&&w.has.userSuggestion())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(n){return!w.is.visible(n)},initialLoad:function(){return ei},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return r=!0}),r},multiple:function(){return g.hasClass(k.multiple)},remote:function(){return b.apiSettings&&w.can.useAPI()},single:function(){return!w.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(n(r.target).is("select")||n(r.addedNodes).is("select"))return!(i=!0)}),i},search:function(){return g.hasClass(k.search)},searchSelection:function(){return w.has.search()&&1===ft.parent(d.dropdown).length},selection:function(){return g.hasClass(k.selection)},userValue:function(t){return-1!==n.inArray(t,w.get.userValues())},upward:function(n){return(n||g).hasClass(k.upward)},visible:function(n){return n?n.hasClass(k.visible):nt.hasClass(k.visible)},verticallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-y");return"auto"==n||"scroll"==n},horizontallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-X");return"auto"==n||"scroll"==n}},can:{activate:function(n){return!!b.useLabels||!w.has.maxSelections()||!(!w.has.maxSelections()||!n.hasClass(k.active))},openDownward:function(n){var r,i,u=n||nt,f=!0;return u.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollTop:ht.scrollTop(),height:ht.outerHeight()},menu:{offset:u.offset(),height:u.outerHeight()}},w.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),f=(r={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(w.verbose("Dropdown can fit in context downward",r),!0):r.below||r.above?(w.verbose("Dropdown cannot fit below, opening upward",r),!1):(w.verbose("Dropdown cannot fit in either direction, favoring downward",r),!0),u.removeClass(k.loading),f},openRightward:function(n){var u,i,r=n||nt,f=!0;return r.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollLeft:ht.scrollLeft(),width:ht.outerWidth()},menu:{offset:r.offset(),width:r.outerWidth()}},w.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(u=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(w.verbose("Dropdown cannot fit in context rightward",u),f=!1),r.removeClass(k.loading),f},click:function(){return h||"click"==b.on},extendSelect:function(){return b.allowAdditions||b.apiSettings},show:function(){return!w.is.disabled()&&(w.has.items()||w.has.message())},useAPI:function(){return n.fn.api!==r}},animate:{show:function(t,i){var f,u=i||nt,e=i?function(){}:function(){w.hideSubMenus();w.hideOthers();w.set.active()};t=n.isFunction(t)?t:function(){};w.verbose("Doing menu show animation",u);w.set.direction(i);f=w.get.transition(i);w.is.selection()&&w.set.scrollPosition(w.get.selectedItem(),!0);(w.is.hidden(u)||w.is.animating(u))&&("none"==f?(e(),u.transition("show"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:f+" in",debug:b.debug,verbose:b.verbose,duration:b.duration,queue:!0,onStart:e,onComplete:function(){t.call(ot)}}):w.error(lt.noTransition,f))},hide:function(t,i){var u=i||nt,f=i?function(){}:function(){w.can.click()&&w.unbind.intent();w.remove.active()},e=w.get.transition(i);t=n.isFunction(t)?t:function(){};(w.is.visible(u)||w.is.animating(u))&&(w.verbose("Doing menu hide animation",u),"none"==e?(f(),u.transition("hide"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:e+" out",duration:b.duration,debug:b.debug,verbose:b.verbose,queue:!1,onStart:f,onComplete:function(){t.call(ot)}}):w.error(lt.transition))}},hideAndClear:function(){w.remove.searchTerm();w.has.maxSelections()||(w.has.search()?w.hide(function(){w.remove.filteredItem()}):w.hide())},delay:{show:function(){w.verbose("Delaying show event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.show,b.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.hide,b.delay.hide)}},escape:{value:function(t){var i=Array.isArray(t),r="string"==typeof t,f=!r&&!i,e=r&&-1!==t.search(ii.quote),u=[];return f||!e?t:(w.debug("Encoding quote values for use in select",t),i?(n.each(t,function(n,t){u.push(t.replace(ii.quote,"&quot;"))}),u):t.replace(ii.quote,"&quot;"))},string:function(n){return(n=String(n)).replace(ii.escape,"\\$&")},htmlEntities:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return t[n]}):n}},setting:function(t,i){if(w.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else{if(i===r)return w[t];w[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,b.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),w.verbose.apply(console,arguments)))},error:function(){b.silent||(w.error=Function.prototype.bind.call(console.error,console,b.name+":"),w.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ot,"Execution Time":i}));clearTimeout(w.performance.timer);w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(w.performance.timer);n.each(s,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";l&&(t+=" '"+l+"'");(console.group!==r||console.table!==r)&&0<s.length&&(console.groupCollapsed(t),console.table?console.table(s):n.each(s,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());s=[]}},invoke:function(t,i,u){var h,o,s,e=bt;return i=i||y,u=ot||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:w.error(lt.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};v?(bt===r&&w.initialize(),w.invoke(a)):(bt!==r&&bt.invoke("destroy"),w.initialize())}),f!==r?f:e};n.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,ignoreDiacritics:!1,hideDividers:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(){},onAdd:function(){},onRemove:function(){},onLabelSelect:function(){},onLabelCreate:function(){return n(this)},onLabelRemove:function(){return!0},onNoResults:function(){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}<\/b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text",type:"type",image:"image",imageClass:"imageClass",icon:"icon",iconClass:"iconClass"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",divider:".divider, .header",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered",clearIcon:"> .remove.icon"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",icon:"icon",image:"image",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",leftward:"left",visible:"visible",clearable:"clearable",noselection:"noselection","delete":"delete"}};n.fn.dropdown.settings.templates={deQuote:function(n){return String(n).replace(/"/g,"")},escape:function(n,t){if(t)return n;var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return i[n]}):n},dropdown:function(t,i,r){var f=t.placeholder||!1,o=t.values||[],u="",e=n.fn.dropdown.settings.templates.escape,s=n.fn.dropdown.settings.templates.deQuote;return u+='<i class="dropdown icon"><\/i>',u+=f?'<div class="default text">'+e(f,i)+"<\/div>":'<div class="text"><\/div>',u+='<div class="'+r.menu+'">',n.each(o,function(n,t){u+='<div class="'+(t.disabled?r.disabled+" ":"")+r.item+'" data-value="'+s(t.value)+'">'+e(t.name,i)+"<\/div>"}),u+="<\/div>"},menu:function(t,i,r,u){var s=t[i.values]||[],f="",o=n.fn.dropdown.settings.templates.escape,e=n.fn.dropdown.settings.templates.deQuote;return n.each(s,function(n,t){var s=t[i.type]?t[i.type]:"item",h,c;"item"===s?(h=t[i.text]?' data-text="'+e(t[i.text])+'"':"",c=t[i.disabled]?u.disabled+" ":"",f+='<div class="'+c+u.item+'" data-value="'+e(t[i.value])+'"'+h+">",t[i.image]&&(f+='<img class="'+(t[i.imageClass]?e(t[i.imageClass]):u.image)+'" src="'+e(t[i.image])+'">'),t[i.icon]&&(f+='<i class="'+e(t[i.icon])+" "+(t[i.iconClass]?e(t[i.iconClass]):u.icon)+'"><\/i>'),f+=o(t[i.name],r),f+="<\/div>"):"header"===s&&(f+='<div class="header">',f+=o(t[i.name],r),f+="<\/div>")}),f},label:function(t,i,r,u){return n.fn.dropdown.settings.templates.escape(i,r)+'<i class="'+u.delete+' icon"><\/i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.embed=function(t){var i,f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=t,h="string"==typeof s,c=[].slice.call(arguments,1);return f.each(function(){var l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.embed.settings,t):n.extend({},n.fn.embed.settings),w=a.selector,g=a.className,p=a.sources,it=a.error,y=a.metadata,rt=a.namespace,ut=a.templates,nt="."+rt,tt="module-"+rt,v=n(this),b=(v.find(w.placeholder),v.find(w.icon),v.find(w.embed)),k=this,d=v.data(tt);l={initialize:function(){l.debug("Initializing embed");l.determine.autoplay();l.create();l.bind.events();l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);d=l;v.data(tt,l)},destroy:function(){l.verbose("Destroying previous instance of embed");l.reset();v.removeData(tt).off(nt)},refresh:function(){l.verbose("Refreshing selector cache");v.find(w.placeholder);v.find(w.icon);b=v.find(w.embed)},bind:{events:function(){l.has.placeholder()&&(l.debug("Adding placeholder events"),v.on("click"+nt,w.placeholder,l.createAndShow).on("click"+nt,w.icon,l.createAndShow))}},create:function(){l.get.placeholder()?l.createPlaceholder():l.createAndShow()},createPlaceholder:function(n){var t=l.get.icon(),i=l.get.url();l.generate.embed(i);n=n||l.get.placeholder();v.html(ut.placeholder(n,t));l.debug("Creating placeholder for embed",n,t)},createEmbed:function(t){l.refresh();t=t||l.get.url();b=n("<div/>").addClass(g.embed).html(l.generate.embed(t)).appendTo(v);a.onCreate.call(k,t);l.debug("Creating embed object",b)},changeEmbed:function(n){b.html(l.generate.embed(n))},createAndShow:function(){l.createEmbed();l.show()},change:function(n,t,i){l.debug("Changing video to ",n,t,i);v.data(y.source,n).data(y.id,t);i?v.data(y.url,i):v.removeData(y.url);l.has.embed()?l.changeEmbed():l.create()},reset:function(){l.debug("Clearing embed and showing placeholder");l.remove.data();l.remove.active();l.remove.embed();l.showPlaceholder();a.onReset.call(k)},show:function(){l.debug("Showing embed");l.set.active();a.onDisplay.call(k)},hide:function(){l.debug("Hiding embed");l.showPlaceholder()},showPlaceholder:function(){l.debug("Showing placeholder image");l.remove.active();a.onPlaceholderDisplay.call(k)},get:{id:function(){return a.id||v.data(y.id)},placeholder:function(){return a.placeholder||v.data(y.placeholder)},icon:function(){return a.icon?a.icon:v.data(y.icon)!==r?v.data(y.icon):l.determine.icon()},source:function(){return a.source?a.source:v.data(y.source)!==r?v.data(y.source):l.determine.source()},type:function(){var n=l.get.source();return p[n]!==r&&p[n].type},url:function(){return a.url?a.url:v.data(y.url)!==r?v.data(y.url):l.determine.url()}},determine:{autoplay:function(){l.should.autoplay()&&(a.autoplay=!0)},source:function(t){var i=!1;return(t=t||l.get.url())&&n.each(p,function(n,r){if(-1!==t.search(r.domain))return i=n,!1}),i},icon:function(){var n=l.get.source();return p[n]!==r&&p[n].icon},url:function(){var n,i=a.id||v.data(y.id),t=a.source||v.data(y.source);return(n=p[t]!==r&&p[t].url.replace("{id}",i))&&v.data(y.url,n),n}},set:{active:function(){v.addClass(g.active)}},remove:{data:function(){v.removeData(y.id).removeData(y.icon).removeData(y.placeholder).removeData(y.source).removeData(y.url)},active:function(){v.removeClass(g.active)},embed:function(){b.empty()}},encode:{parameters:function(n){var t,i=[];for(t in n)i.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return i.join("&amp;")}},generate:{embed:function(n){l.debug("Generating embed html");var t,i,r=l.get.source();return(n=l.get.url(n))?(i=l.generate.parameters(r),t=ut.iframe(n,i)):l.error(it.noURL,v),t},parameters:function(t,i){var u=p[t]&&p[t].parameters!==r?p[t].parameters(a):{};return(i=i||a.parameters)&&(u=n.extend({},u,i)),u=a.onEmbed(u),l.encode.parameters(u)}},has:{embed:function(){return 0<b.length},placeholder:function(){return a.placeholder||v.data(y.placeholder)}},should:{autoplay:function(){return"auto"===a.autoplay?a.placeholder||v.data(y.placeholder)!==r:a.autoplay}},is:{video:function(){return"video"==l.get.type()}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:k,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(l.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");1<f.length&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&0<u.length&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(t,u,f){var h,o,s,e=d;return u=u||c,f=k||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:l.error(it.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),Array.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(d===r&&l.initialize(),l.invoke(s)):(d!==r&&d.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(){},onEmbed:function(n){return n},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(n){return{autohide:!n.brandedUI,autoplay:n.autoplay,color:n.color||r,hq:n.hd,jsapi:n.api,modestbranding:!n.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(n){return{api:n.api,autoplay:n.autoplay,byline:n.brandedUI,color:n.color||r,portrait:n.brandedUI,title:n.brandedUI}}}},templates:{iframe:function(n,t){var i=n;return t&&(i+="?"+t),'<iframe src="'+i+'" width="100%" height="100%" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>'},placeholder:function(n,t){var i="";return t&&(i+='<i class="'+t+' icon"><\/i>'),n&&(i+='<img class="placeholder" src="'+n+'">'),i}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.modal=function(u){var e,h=n(this),c=n(t),l=n(i),f=n("body"),a=h.selector||"",s=(new Date).getTime(),o=[],v=u,y="string"==typeof v,p=[].slice.call(arguments,1),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return h.each(function(){var vt,it,ht,g,tt,wt,bt,ft,yt,ct,h,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.modal.settings,u):n.extend({},n.fn.modal.settings),nt=b.selector,d=b.className,kt=b.namespace,st=b.error,rt="."+kt,pt="module-"+kt,k=n(this),lt=n(b.context),dt=k.find(nt.close),ut=this,ot=k.data(pt),et=!1,at="";h={initialize:function(){h.verbose("Initializing dimmer",lt);h.create.id();h.create.dimmer();b.allowMultiple&&h.create.innerDimmer();b.centered||k.addClass("top aligned");h.refreshModals();h.bind.events();b.observeChanges&&h.observeChanges();h.instantiate()},instantiate:function(){h.verbose("Storing instance of modal");ot=h;k.data(pt,ot)},create:{dimmer:function(){var t={debug:b.debug,dimmerName:"modals"},i=n.extend(!0,t,b.dimmerSettings);n.fn.dimmer!==r?(h.debug("Creating dimmer"),g=lt.dimmer(i),b.detachable?(h.verbose("Modal is detachable, moving content into dimmer"),g.dimmer("add content",k)):h.set.undetached(),tt=g.dimmer("get dimmer")):h.error(st.dimmer)},id:function(){yt=(Math.random().toString(16)+"000000000").substr(2,8);ft="."+yt;h.verbose("Creating unique id for element",yt)},innerDimmer:function(){0==k.find(nt.dimmer).length&&k.prepend('<div class="ui inverted dimmer"><\/div>')}},destroy:function(){ct&&ct.disconnect();h.verbose("Destroying previous modal");k.removeData(pt).off(rt);c.off(ft);tt.off(ft);dt.off(rt);lt.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&((ct=new MutationObserver(function(){h.debug("DOM tree modified, refreshing");h.refresh()})).observe(ut,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",ct))},refresh:function(){h.remove.scrolling();h.cacheSizes();h.can.useFlex()||h.set.modalOffset();h.set.screenHeight();h.set.type()},refreshModals:function(){it=k.siblings(nt.modal);vt=it.add(k)},attachEvents:function(t,i){var r=n(t);i=n.isFunction(h[i])?h[i]:h.toggle;0<r.length?(h.debug("Attaching modal events to element",t,i),r.off(rt).on("click"+rt,i)):h.error(st.notFound,t)},bind:{events:function(){h.verbose("Attaching events");k.on("click"+rt,nt.close,h.event.close).on("click"+rt,nt.approve,h.event.approve).on("click"+rt,nt.deny,h.event.deny);c.on("resize"+ft,h.event.resize)},scrollLock:function(){g.get(0).addEventListener("touchmove",h.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){g.get(0).removeEventListener("touchmove",h.event.preventScroll,{passive:!1})}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){et||!1===b.onApprove.call(ut,n(this))?h.verbose("Approve callback returned false cancelling hide"):(et=!0,h.hide(function(){et=!1}))},preventScroll:function(n){-1!==n.target.className.indexOf("dimmer")&&n.preventDefault()},deny:function(){et||!1===b.onDeny.call(ut,n(this))?h.verbose("Deny callback returned false cancelling hide"):(et=!0,h.hide(function(){et=!1}))},close:function(){h.hide()},mousedown:function(i){var r=n(i.target);(wt=0<r.closest(nt.modal).length)&&h.verbose("Mouse down event registered inside the modal");(bt=h.is.scrolling()&&n(t).outerWidth()-b.scrollbarWidth<=i.clientX)&&h.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(t){if(b.closable)if(wt)h.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(bt)h.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var r=0<n(t.target).closest(nt.modal).length,u=n.contains(i.documentElement,t.target);if(!r&&u&&h.is.active()&&k.hasClass(d.front)){if(h.debug("Dimmer clicked, hiding all modals"),b.allowMultiple){if(!h.hideAll())return}else if(!h.hide())return;h.remove.clickaway()}}else h.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(n,t){clearTimeout(h.timer);h.timer=setTimeout(n,t)},keyboard:function(n){27==n.which&&(b.closable?(h.debug("Escape key pressed hiding modal"),k.hasClass(d.front)&&h.hide()):h.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){g.dimmer("is active")&&(h.is.animating()||h.is.active())&&w(h.refresh)}},toggle:function(){h.is.active()||h.is.animating()?h.hide():h.show()},show:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.set.dimmerSettings();h.set.dimmerStyles();h.showModal(t)},hide:function(t){return t=n.isFunction(t)?t:function(){},h.refreshModals(),h.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){};h.is.animating()||!h.is.active()?(h.showDimmer(),h.cacheSizes(),h.can.useFlex()?h.remove.legacy():(h.set.legacy(),h.set.modalOffset(),h.debug("Using non-flex legacy modal positioning.")),h.set.screenHeight(),h.set.type(),h.set.clickaway(),!b.allowMultiple&&h.others.active()?h.hideOthers(h.showModal):(et=!1,b.allowMultiple&&(h.others.active()&&it.filter("."+d.active).find(nt.dimmer).addClass("active"),b.detachable&&k.detach().appendTo(tt)),b.onShow.call(ut),b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.debug("Showing modal with css animations"),k.transition({debug:b.debug,animation:b.transition+" in",queue:b.queue,duration:b.duration,useFailSafe:!0,onComplete:function(){b.onVisible.apply(ut);b.keyboardShortcuts&&h.add.keyboardShortcuts();h.save.focus();h.set.active();b.autofocus&&h.set.autofocus();t()}})):h.error(st.noTransition))):h.debug("Modal is already visible")},hideModal:function(t,i,u){var f=it.filter("."+d.active).last();if(t=n.isFunction(t)?t:function(){},h.debug("Hiding modal"),!1===b.onHide.call(ut,n(this)))return h.verbose("Hide callback returned false cancelling hide"),et=!1;(h.is.animating()||h.is.active())&&(b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.remove.active(),k.transition({debug:b.debug,animation:b.transition+" out",queue:b.queue,duration:b.duration,useFailSafe:!0,onStart:function(){h.others.active()||h.others.animating()||i||h.hideDimmer();b.keyboardShortcuts&&!h.others.active()&&h.remove.keyboardShortcuts()},onComplete:function(){h.unbind.scrollLock();b.allowMultiple&&(f.addClass(d.front),k.removeClass(d.front),u?vt.find(nt.dimmer).removeClass("active"):f.find(nt.dimmer).removeClass("active"));b.onHidden.call(ut);h.remove.dimmerStyles();h.restore.focus();t()}})):h.error(st.noTransition))},showDimmer:function(){g.dimmer("is animating")||!g.dimmer("is active")?(h.save.bodyMargin(),h.debug("Showing dimmer"),g.dimmer("show")):h.debug("Dimmer already visible")},hideDimmer:function(){g.dimmer("is animating")||g.dimmer("is active")?(h.unbind.scrollLock(),g.dimmer("hide",function(){h.restore.bodyMargin();h.remove.clickaway();h.remove.screenHeight()})):h.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var r=vt.filter("."+d.active+", ."+d.animating),i;if(t=n.isFunction(t)?t:function(){},0<r.length)return h.debug("Hiding all visible modals"),i=!0,n(r.get().reverse()).each(function(r,u){i=i&&n(u).modal("hide modal",t,!1,!0)}),i&&h.hideDimmer(),i},hideOthers:function(t){var i=it.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};0<i.length&&(h.debug("Hiding other modals",it),i.modal("hide modal",t,!0))},others:{active:function(){return 0<it.filter("."+d.active).length},animating:function(){return 0<it.filter("."+d.animating).length}},add:{keyboardShortcuts:function(){h.verbose("Adding keyboard shortcuts");l.on("keyup"+rt,h.event.keyboard)}},save:{focus:function(){0<n(i.activeElement).closest(k).length||(ht=n(i.activeElement).blur())},bodyMargin:function(){at=f.css("margin-right");var n=parseInt(at.replace(/[^\d.]/g,""))+(t.innerWidth-i.documentElement.clientWidth);f.css("margin-right",n+"px");f.find(nt.bodyFixed).css("padding-right",n+"px")}},restore:{focus:function(){ht&&0<ht.length&&b.restoreFocus&&ht.focus()},bodyMargin:function(){f.css("margin-right",at);f.find(nt.bodyFixed).css("padding-right",at)}},remove:{active:function(){k.removeClass(d.active)},legacy:function(){k.removeClass(d.legacy)},clickaway:function(){tt.off("mousedown"+ft);tt.off("mouseup"+ft)},dimmerStyles:function(){tt.removeClass(d.inverted);g.removeClass(d.blurring)},bodyStyle:function(){""===f.attr("style")&&(h.verbose("Removing style attribute"),f.removeAttr("style"))},screenHeight:function(){h.debug("Removing page height");f.css("height","")},keyboardShortcuts:function(){h.verbose("Removing keyboard shortcuts");l.off("keyup"+rt)},scrolling:function(){g.removeClass(d.scrolling);k.removeClass(d.scrolling)}},cacheSizes:function(){k.addClass(d.loading);var f=k.prop("scrollHeight"),e=k.outerWidth(),u=k.outerHeight();h.cache!==r&&0===u||(h.cache={pageHeight:n(i).outerHeight(),width:e,height:u+b.offset,scrollHeight:f+b.offset,contextHeight:"body"==b.context?n(t).height():g.height()},h.cache.topOffset=-h.cache.height/2);k.removeClass(d.loading);h.debug("Caching modal and container sizes",h.cache)},can:{useFlex:function(){return"auto"==b.useFlex?b.detachable&&!h.is.ie():b.useFlex},fit:function(){var n=h.cache.contextHeight,u=h.cache.contextHeight/2,f=h.cache.topOffset,t=h.cache.scrollHeight,i=h.cache.height,r=b.padding;return i<t?u+f+t+r<n:i+2*r<n}},is:{active:function(){return k.hasClass(d.active)},ie:function(){return!t.ActiveXObject&&"ActiveXObject"in t||"ActiveXObject"in t},animating:function(){return k.transition("is supported")?k.transition("is animating"):k.is(":visible")},scrolling:function(){return g.hasClass(d.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){var t=k.find("[tabindex], :input").filter(":visible").filter(function(){return 0===n(this).closest(".disabled").length}),i=t.filter("[autofocus]"),r=0<i.length?i.first():t.first();0<r.length&&r.focus()},clickaway:function(){tt.on("mousedown"+ft,h.event.mousedown);tt.on("mouseup"+ft,h.event.mouseup)},dimmerSettings:function(){if(n.fn.dimmer!==r){var i={debug:b.debug,dimmerName:"modals",closable:"auto",useFlex:h.can.useFlex(),duration:{show:b.duration,hide:b.duration}},t=n.extend(!0,i,b.dimmerSettings);b.inverted&&(t.variation=t.variation!==r?t.variation+" inverted":"inverted");lt.dimmer("setting",t)}else h.error(st.dimmer)},dimmerStyles:function(){b.inverted?tt.addClass(d.inverted):tt.removeClass(d.inverted);b.blurring?g.addClass(d.blurring):g.removeClass(d.blurring)},modalOffset:function(){var n=h.cache.width,t=h.cache.height;k.css({marginTop:!k.hasClass("aligned")&&h.can.fit()?-t/2:0,marginLeft:-n/2});h.verbose("Setting modal offset for legacy mode")},screenHeight:function(){h.can.fit()?f.css("height",""):k.hasClass("bottom")||(h.debug("Modal is taller than page content, resizing page height"),f.css("height",h.cache.height+2*b.padding))},active:function(){k.addClass(d.active+" "+d.front);it.filter("."+d.active).removeClass(d.front)},scrolling:function(){g.addClass(d.scrolling);k.addClass(d.scrolling);h.unbind.scrollLock()},legacy:function(){k.addClass(d.legacy)},type:function(){h.can.fit()?(h.verbose("Modal fits on screen"),h.others.active()||h.others.animating()||(h.remove.scrolling(),h.bind.scrollLock())):k.hasClass("bottom")?h.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(h.verbose("Modal cannot fit on screen setting to scrolling"),h.set.scrolling())},undetached:function(){g.addClass(d.undetached)}},setting:function(t,i){if(h.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,h,t);else{if(i===r)return h[t];h[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,b.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),h.verbose.apply(console,arguments)))},error:function(){b.silent||(h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ut,"Execution Time":i}));clearTimeout(h.performance.timer);h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",i=0;s=!1;clearTimeout(h.performance.timer);n.each(o,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&0<o.length&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());o=[]}},invoke:function(t,i,u){var h,o,s,f=ot;return i=i||p,u=ut||u,"string"==typeof t&&f!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var e=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[e])&&i!=h)f=f[e];else{if(f[e]!==r)return o=f[e],!1;if(!n.isPlainObject(f[u])||i==h)return f[u]!==r&&(o=f[u]),!1;f=f[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(e)?e.push(s):e!==r?e=[e,s]:s!==r&&(e=s),o}};y?(ot===r&&h.initialize(),h.invoke(v)):(ot!==r&&ot.invoke("destroy"),h.initialize())}),e!==r?e:this};n.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.nag=function(i){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=i,c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var a,o=n.isPlainObject(i)?n.extend(!0,{},n.fn.nag.settings,i):n.extend({},n.fn.nag.settings),nt=o.selector,y=o.error,b=o.namespace,k="."+b,w=b+"-module",v=n(this),d=o.context?n(o.context):n("body"),g=this,p=v.data(w);a={initialize:function(){a.verbose("Initializing element");v.on("click"+k,nt.close,a.dismiss).data(w,a);o.detachable&&v.parent()[0]!==d[0]&&v.detach().prependTo(d);0<o.displayTime&&setTimeout(a.hide,o.displayTime);a.show()},destroy:function(){a.verbose("Destroying instance");v.removeData(w).off(k)},show:function(){a.should.show()&&!v.is(":visible")&&(a.debug("Showing nag",o.animation.show),"fade"==o.animation.show?v.fadeIn(o.duration,o.easing):v.slideDown(o.duration,o.easing))},hide:function(){a.debug("Showing nag",o.animation.hide);"fade"==o.animation.show?v.fadeIn(o.duration,o.easing):v.slideUp(o.duration,o.easing)},onHide:function(){a.debug("Removing nag",o.animation.hide);v.remove();o.onHide&&o.onHide()},dismiss:function(n){o.storageMethod&&a.storage.set(o.key,o.value);a.hide();n.stopImmediatePropagation();n.preventDefault()},should:{show:function(){return o.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(o.key)!=o.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(o.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(o.key)),!1)}},get:{storageOptions:function(){var n={};return o.expires&&(n.expires=o.expires),o.domain&&(n.domain=o.domain),o.path&&(n.path=o.path),n}},clear:function(){a.storage.remove(o.key)},storage:{set:function(i,u){var f=a.get.storageOptions();if("localstorage"==o.storageMethod&&t.localStorage!==r)t.localStorage.setItem(i,u),a.debug("Value stored using local storage",i,u);else if("sessionstorage"==o.storageMethod&&t.sessionStorage!==r)t.sessionStorage.setItem(i,u),a.debug("Value stored using session storage",i,u);else{if(n.cookie===r)return void a.error(y.noCookieStorage);n.cookie(i,u,f);a.debug("Value stored using cookie",i,u,f)}},get:function(i){var u;return"localstorage"==o.storageMethod&&t.localStorage!==r?u=t.localStorage.getItem(i):"sessionstorage"==o.storageMethod&&t.sessionStorage!==r?u=t.sessionStorage.getItem(i):n.cookie!==r?u=n.cookie(i):a.error(y.noCookieStorage),"undefined"!=u&&"null"!=u&&u!==r&&null!==u||(u=r),u},remove:function(i){var u=a.get.storageOptions();"localstorage"==o.storageMethod&&t.localStorage!==r?t.localStorage.removeItem(i):"sessionstorage"==o.storageMethod&&t.sessionStorage!==r?t.sessionStorage.removeItem(i):n.cookie!==r?n.removeCookie(i,u):a.error(y.noStorage)}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];n.isPlainObject(o[t])?n.extend(!0,o[t],i):o[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];a[t]=i}},debug:function(){!o.silent&&o.debug&&(o.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,o.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),a.verbose.apply(console,arguments)))},error:function(){o.silent||(a.error=Function.prototype.bind.call(console.error,console,o.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;o.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=o.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=p;return i=i||l,f=g||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:a.error(y.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),Array.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(p===r&&a.initialize(),a.invoke(h)):(p!==r&&p.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.popup=function(u){var f,l=n(this),s=n(i),o=n(t),h=n("body"),a=l.selector||"",v="ontouchstart"in i.documentElement?"touchstart":"click",c=(new Date).getTime(),e=[],y=u,p="string"==typeof y,w=[].slice.call(arguments,1);return l.each(function(){var k,rt,ct,ut,lt,l,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.popup.settings,u):n.extend({},n.fn.popup.settings),st=b.selector,nt=b.className,ht=b.error,tt=b.metadata,kt=b.namespace,ft="."+b.namespace,pt="module-"+kt,d=n(this),wt=n(b.context),bt=n(b.scrollContext),at=n(b.boundary),it=b.target?n(b.target):d,vt=0,et=!1,yt=!1,g=this,ot=d.data(pt);l={initialize:function(){l.debug("Initializing",d);l.createID();l.bind.events();!l.exists()&&b.preserve&&l.create();b.observeChanges&&l.observeChanges();l.instantiate()},instantiate:function(){l.verbose("Storing instance",l);ot=l;d.data(pt,ot)},observeChanges:function(){"MutationObserver"in t&&((ct=new MutationObserver(l.event.documentChanged)).observe(i,{childList:!0,subtree:!0}),l.debug("Setting up mutation observer",ct))},refresh:function(){b.popup?k=n(b.popup).eq(0):b.inline&&(k=it.nextAll(st.popup).eq(0),b.popup=k);b.popup?(k.addClass(nt.loading),rt=l.get.offsetParent(),k.removeClass(nt.loading),b.movePopup&&l.has.popup()&&l.get.offsetParent(k)[0]!==rt[0]&&(l.debug("Moving popup to the same offset parent as target"),k.detach().appendTo(rt))):rt=b.inline?l.get.offsetParent(it):l.has.popup()?l.get.offsetParent(k):h;rt.is("html")&&rt[0]!==h[0]&&(l.debug("Setting page as offset parent"),rt=h);l.get.variation()&&l.set.variation()},reposition:function(){l.refresh();l.set.position()},destroy:function(){l.debug("Destroying previous module");ct&&ct.disconnect();k&&!b.preserve&&l.removePopup();clearTimeout(l.hideTimer);clearTimeout(l.showTimer);l.unbind.close();l.unbind.events();d.removeData(pt)},event:{start:function(){var t=n.isPlainObject(b.delay)?b.delay.show:b.delay;clearTimeout(l.hideTimer);(!yt||yt&&b.addTouchEvents)&&(l.showTimer=setTimeout(l.show,t))},end:function(){var t=n.isPlainObject(b.delay)?b.delay.hide:b.delay;clearTimeout(l.showTimer);l.hideTimer=setTimeout(l.hide,t)},touchstart:function(){yt=!0;b.addTouchEvents&&l.show()},resize:function(){l.is.visible()&&l.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==g||0<n(t).find(g).length)&&(l.debug("Element removed from DOM, tearing down events"),l.destroy())})})},hideGracefully:function(t){var r=n(t.target),u=n.contains(i.documentElement,t.target),f=0<r.closest(st.popup).length;t&&!f&&u?(l.debug("Click occurred outside popup hiding popup"),l.hide()):l.debug("Click was inside popup, keeping popup open")}},create:function(){var t=l.get.html(),i=l.get.title(),r=l.get.content();t||r||i?(l.debug("Creating pop-up html"),t=t||b.templates.popup({title:i,content:r}),k=n("<div/>").addClass(nt.popup).data(tt.activator,d).html(t),b.inline?(l.verbose("Inserting popup element inline",k),k.insertAfter(d)):(l.verbose("Appending popup element to body",k),k.appendTo(wt)),l.refresh(),l.set.variation(),b.hoverable&&l.bind.popup(),b.onCreate.call(k,g)):0!==it.next(st.popup).length?(l.verbose("Pre-existing popup found"),b.inline=!0,b.popup=it.next(st.popup).data(tt.activator,d),l.refresh(),b.hoverable&&l.bind.popup()):b.popup?(n(b.popup).data(tt.activator,d),l.verbose("Used popup specified in settings"),l.refresh(),b.hoverable&&l.bind.popup()):l.debug("No content specified skipping display",g)},createID:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);ut="."+lt;l.verbose("Creating unique id for element",lt)},toggle:function(){l.debug("Toggling pop-up");l.is.hidden()?(l.debug("Popup is hidden, showing pop-up"),l.unbind.close(),l.show()):(l.debug("Popup is visible, hiding pop-up"),l.hide())},show:function(n){if(n=n||function(){},l.debug("Showing pop-up",b.transition),l.is.hidden()&&(!l.is.active()||!l.is.dropdown())){if(l.exists()||l.create(),!1===b.onShow.call(k,g))return void l.debug("onShow callback returned false, cancelling popup animation");b.preserve||b.popup||l.refresh();k&&l.set.position()&&(l.save.conditions(),b.exclusive&&l.hideAll(),l.animate.show(n))}},hide:function(n){if(n=n||function(){},l.is.visible()||l.is.animating()){if(!1===b.onHide.call(k,g))return void l.debug("onHide callback returned false, cancelling popup animation");l.remove.visible();l.unbind.close();l.restore.conditions();l.animate.hide(n)}},hideAll:function(){n(st.popup).filter("."+nt.popupVisible).each(function(){n(this).data(tt.activator).popup("hide")})},exists:function(){return!!k&&(b.inline||b.popup?l.has.popup():1<=k.closest(wt).length)},removePopup:function(){l.has.popup()&&!b.popup&&(l.debug("Removing popup",k),k.remove(),k=r,b.onRemove.call(k,g))},save:{conditions:function(){l.cache={title:d.attr("title")};l.cache.title&&d.removeAttr("title");l.verbose("Saving original attributes",l.cache.title)}},restore:{conditions:function(){return l.cache&&l.cache.title&&(d.attr("title",l.cache.title),l.verbose("Restoring original attributes",l.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};b.transition&&n.fn.transition!==r&&d.transition("is supported")?(l.set.visible(),k.transition({animation:b.transition+" in",queue:!1,debug:b.debug,verbose:b.verbose,duration:b.duration,onComplete:function(){l.bind.close();t.call(k,g);b.onVisible.call(k,g)}})):l.error(ht.noTransition)},hide:function(t){t=n.isFunction(t)?t:function(){};l.debug("Hiding pop-up");b.transition&&n.fn.transition!==r&&d.transition("is supported")?k.transition({animation:b.transition+" out",queue:!1,duration:b.duration,debug:b.debug,verbose:b.verbose,onComplete:function(){l.reset();t.call(k,g);b.onHidden.call(k,g)}}):l.error(ht.noTransition)}},change:{content:function(n){k.html(n)}},get:{html:function(){return d.removeData(tt.html),d.data(tt.html)||b.html},title:function(){return d.removeData(tt.title),d.data(tt.title)||b.title},content:function(){return d.removeData(tt.content),d.data(tt.content)||b.content||d.attr("title")},variation:function(){return d.removeData(tt.variation),d.data(tt.variation)||b.variation},popup:function(){return k},popupOffset:function(){return k.offset()},calculations:function(){var i,r=l.get.offsetParent(k),u=it[0],e=at[0]==t,s=b.inline||b.popup&&b.movePopup?it.position():it.offset(),h=e?{top:0,left:0}:at.offset(),n={},c=e?{top:o.scrollTop(),left:o.scrollLeft()}:{top:0,left:0},f;return(n={target:{element:it[0],width:it.outerWidth(),height:it.outerHeight(),top:s.top,left:s.left,margin:{}},popup:{width:k.outerWidth(),height:k.outerHeight()},parent:{width:rt.outerWidth(),height:rt.outerHeight()},screen:{top:h.top,left:h.left,scroll:{top:c.top,left:c.left},width:at.width(),height:at.height()}},r.get(0)!==rt.get(0))&&(f=r.offset(),n.target.top-=f.top,n.target.left-=f.left,n.parent.width=r.outerWidth(),n.parent.height=r.outerHeight()),b.setFluidWidth&&l.is.fluid()&&(n.container={width:k.parent().outerWidth()},n.popup.width=n.container.width),n.target.margin.top=b.inline?parseInt(t.getComputedStyle(u).getPropertyValue("margin-top"),10):0,n.target.margin.left=b.inline?l.is.rtl()?parseInt(t.getComputedStyle(u).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(u).getPropertyValue("margin-left"),10):0,i=n.screen,n.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},n},id:function(){return lt},startEvent:function(){return"hover"==b.on?"mouseenter":"focus"==b.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==b.on?"mouseleave":"focus"==b.on&&"blur"},distanceFromBoundary:function(n,t){var r,i,u={};return r=(t=t||l.get.calculations()).popup,i=t.boundary,n&&(u={top:n.top-i.top,left:n.left-i.left,right:i.right-(n.left+r.width),bottom:i.bottom-(n.top+r.height)},l.verbose("Distance from boundaries determined",n,u)),u},offsetParent:function(t){var u=(t!==r?t[0]:it[0]).parentNode,i=n(u);if(u)for(var f="none"===i.css("transform"),e="static"===i.css("position"),o=i.is("body");u&&!o&&e&&f;)u=u.parentNode,f="none"===(i=n(u)).css("transform"),e="static"===i.css("position"),o=i.is("body");return i&&0<i.length?i:n()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(n){var r=n.split(" "),i=r[0],u=r[1],o="top"==i||"bottom"==i,f=!1,e=!1,t=!1;return et||(l.verbose("All available positions available"),et=l.get.positions()),l.debug("Recording last position tried",n),et[n]=!0,"opposite"===b.prefer&&(t=(t=[{top:"bottom",bottom:"top",left:"right",right:"left"}[i],u]).join(" "),f=!0===et[t],l.debug("Trying opposite strategy",t)),"adjacent"===b.prefer&&o&&(t=(t=[i,{left:"center",center:"right",right:"left"}[u]]).join(" "),e=!0===et[t],l.debug("Trying adjacent strategy",t)),(e||f)&&(l.debug("Using backup position",t),t={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[n]),t}},set:{position:function(n,t){if(0!==it.length&&0!==k.length){var u,f,i,s,o,e,h,c;if(t=t||l.get.calculations(),n=n||d.data(tt.position)||b.position,u=d.data(tt.offset)||b.offset,f=b.distanceAway,i=t.target,s=t.popup,o=t.parent,l.should.centerArrow(t)&&(l.verbose("Adjusting offset to center arrow on small target element"),"top left"!=n&&"bottom left"!=n||(u+=i.width/2,u-=b.arrowPixelsFromEdge),"top right"!=n&&"bottom right"!=n||(u-=i.width/2,u+=b.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!l.is.svg(i.element))return l.debug("Popup target is hidden, no action taken"),!1;switch(b.inline&&(l.debug("Adding margin to calculation",i.margin),"left center"==n||"right center"==n?(u+=i.margin.top,f+=-i.margin.left):"top left"==n||"top center"==n||"top right"==n?(u+=i.margin.left,f-=i.margin.top):(u+=i.margin.left,f+=i.margin.top)),l.debug("Determining popup position from calculations",n,t),l.is.rtl()&&(n=n.replace(/left|right/g,function(n){return"left"==n?"right":"left"}),l.debug("RTL: Popup position updated",n)),vt==b.maxSearchDepth&&"string"==typeof b.lastResort&&(n=b.lastResort),n){case"top left":e={top:"auto",bottom:o.height-i.top+f,left:i.left+u,right:"auto"};break;case"top center":e={bottom:o.height-i.top+f,left:i.left+i.width/2-s.width/2+u,top:"auto",right:"auto"};break;case"top right":e={bottom:o.height-i.top+f,right:o.width-i.left-i.width-u,top:"auto",left:"auto"};break;case"left center":e={top:i.top+i.height/2-s.height/2+u,right:o.width-i.left+f,left:"auto",bottom:"auto"};break;case"right center":e={top:i.top+i.height/2-s.height/2+u,left:i.left+i.width+f,bottom:"auto",right:"auto"};break;case"bottom left":e={top:i.top+i.height+f,left:i.left+u,bottom:"auto",right:"auto"};break;case"bottom center":e={top:i.top+i.height+f,left:i.left+i.width/2-s.width/2+u,bottom:"auto",right:"auto"};break;case"bottom right":e={top:i.top+i.height+f,right:o.width-i.left-i.width-u,left:"auto",bottom:"auto"}}if(e===r&&l.error(ht.invalidPosition,n),l.debug("Calculated popup positioning values",e),k.css(e).removeClass(nt.position).addClass(n).addClass(nt.loading),h=l.get.popupOffset(),c=l.get.distanceFromBoundary(h,t),!b.forcePosition&&l.is.offstage(c,n)){if(l.debug("Position is outside viewport",n),vt<b.maxSearchDepth)return vt++,n=l.get.nextPosition(n),l.debug("Trying new position",n),!!k&&l.set.position(n,t);if(!b.lastResort)return l.debug("Popup could not find a position to display",k),l.error(ht.cannotPlace,g),l.remove.attempts(),l.remove.loading(),l.reset(),b.onUnplaceable.call(k,g),!1;l.debug("No position found, showing with last position")}return l.debug("Position is on stage",n),l.remove.attempts(),l.remove.loading(),b.setFluidWidth&&l.is.fluid()&&l.set.fluidWidth(t),!0}l.error(ht.notFound)},fluidWidth:function(n){n=n||l.get.calculations();l.debug("Automatically setting element width to parent width",n.parent.width);k.css("width",n.container.width)},variation:function(n){(n=n||l.get.variation())&&l.has.popup()&&(l.verbose("Adding variation to popup",n),k.addClass(n))},visible:function(){d.addClass(nt.visible)}},remove:{loading:function(){k.removeClass(nt.loading)},variation:function(n){(n=n||l.get.variation())&&(l.verbose("Removing variation",n),k.removeClass(n))},visible:function(){d.removeClass(nt.visible)},attempts:function(){l.verbose("Resetting all searched positions");vt=0;et=!1}},bind:{events:function(){l.debug("Binding popup events to module");"click"==b.on&&d.on(v+ft,l.toggle);"hover"==b.on&&d.on("touchstart"+ft,l.event.touchstart);l.get.startEvent()&&d.on(l.get.startEvent()+ft,l.event.start).on(l.get.endEvent()+ft,l.event.end);b.target&&l.debug("Target set to element",it);o.on("resize"+ut,l.event.resize)},popup:function(){l.verbose("Allowing hover events on popup to prevent closing");k&&l.has.popup()&&k.on("mouseenter"+ft,l.event.start).on("mouseleave"+ft,l.event.end)},close:function(){(!0===b.hideOnScroll||"auto"==b.hideOnScroll&&"click"!=b.on)&&l.bind.closeOnScroll();l.is.closable()?l.bind.clickaway():"hover"==b.on&&yt&&l.bind.touchClose()},closeOnScroll:function(){l.verbose("Binding scroll close event to document");bt.one(l.get.scrollEvent()+ut,l.event.hideGracefully)},touchClose:function(){l.verbose("Binding popup touchclose event to document");s.on("touchstart"+ut,function(n){l.verbose("Touched away from popup");l.event.hideGracefully.call(g,n)})},clickaway:function(){l.verbose("Binding popup close event to document");s.on(v+ut,function(n){l.verbose("Clicked away from popup");l.event.hideGracefully.call(g,n)})}},unbind:{events:function(){o.off(ut);d.off(ft)},close:function(){s.off(ut);bt.off(ut)}},has:{popup:function(){return k&&0<k.length}},should:{centerArrow:function(n){return!l.is.basic()&&n.target.width<=2*b.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==b.closable?"hover"!=b.on:b.closable},offstage:function(t,i){var r=[];return n.each(t,function(n,t){t<-b.jitter&&(l.debug("Position exceeds allowable distance from edge",n,t,i),r.push(n))}),0<r.length},svg:function(n){return l.supports.svg()&&n instanceof SVGGraphicsElement},basic:function(){return d.hasClass(nt.basic)},active:function(){return d.hasClass(nt.active)},animating:function(){return k!==r&&k.hasClass(nt.animating)},fluid:function(){return k!==r&&k.hasClass(nt.fluid)},visible:function(){return k!==r&&k.hasClass(nt.popupVisible)},dropdown:function(){return d.hasClass(nt.dropdown)},hidden:function(){return!l.is.visible()},rtl:function(){return"rtl"==d.css("direction")}},reset:function(){l.remove.visible();b.preserve?n.fn.transition!==r&&k.transition("remove transition"):l.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,b.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),l.verbose.apply(console,arguments)))},error:function(){b.silent||(l.error=Function.prototype.bind.call(console.error,console,b.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ot;return i=i||w,u=g||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};p?(ot===r&&l.initialize(),l.invoke(y)):(ot!==r&&ot.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return t[n]}):n},popup:function(t){var i="",u=n.fn.popup.settings.templates.escape;return typeof t!==r&&(typeof t.title!==r&&t.title&&(t.title=u(t.title),i+='<div class="header">'+t.title+"<\/div>"),typeof t.content!==r&&t.content&&(t.content=u(t.content),i+='<div class="content">'+t.content+"<\/div>")),i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.progress=function(t){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=t,c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var o,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.progress.settings,t):n.extend({},n.fn.progress.settings),y=a.className,g=a.metadata,it=a.namespace,nt=a.selector,k=a.error,rt="."+it,tt="module-"+it,v=n(this),w=n(this).find(nt.bar),ut=n(this).find(nt.progress),ft=n(this).find(nt.label),p=this,b=v.data(tt),d=!1;o={helper:{sum:function(n){return Array.isArray(n)?n.reduce(function(n,t){return n+Number(t)},0):0},derivePrecision:function(n,t){for(var r=0,i=1,u=n/t;r<10&&!(1<(u*=i));)i=Math.pow(10,r++);return i},forceArray:function(n){return Array.isArray(n)?n:isNaN(n)?"string"==typeof n?n.split(","):[]:[n]}},initialize:function(){o.set.duration();o.set.transitionEvent();o.debug(p);o.read.metadata();o.read.settings();o.instantiate()},instantiate:function(){o.verbose("Storing instance of progress",o);b=o;v.data(tt,o)},destroy:function(){o.verbose("Destroying previous progress for",v);clearInterval(b.interval);o.remove.state();v.removeData(tt);b=r},reset:function(){o.remove.nextValue();o.update.progress(0)},complete:function(){(o.percent===r||o.percent<100)&&(o.remove.progressPoll(),o.set.percent(100))},read:{metadata:function(){var n={percent:o.helper.forceArray(v.data(g.percent)),total:v.data(g.total),value:o.helper.forceArray(v.data(g.value))};n.total&&(o.debug("Total value set from metadata",n.total),o.set.total(n.total));0<n.value.length&&(o.debug("Current value set from metadata",n.value),o.set.value(n.value),o.set.progress(n.value));0<n.percent.length&&(o.debug("Current percent value set from metadata",n.percent),o.set.percent(n.percent))},settings:function(){!1!==a.total&&(o.debug("Current total set in settings",a.total),o.set.total(a.total));!1!==a.value&&(o.debug("Current value set in settings",a.value),o.set.value(a.value),o.set.progress(o.value));!1!==a.percent&&(o.debug("Current percent set in settings",a.percent),o.set.percent(a.percent))}},bind:{transitionEnd:function(n){var t=o.get.transitionEnd();w.one(t+rt,function(t){clearTimeout(o.failSafeTimer);n.call(this,t)});o.failSafeTimer=setTimeout(function(){w.triggerHandler(t)},a.duration+a.failSafeDelay);o.verbose("Adding fail safe timer",o.timer)}},increment:function(n){var i,t;n=o.has.total()?(i=o.get.value(),n||1):(i=o.get.percent(),n||o.get.randomValue());t=i+n;o.debug("Incrementing percentage by",i,t,n);t=o.get.normalizedValue(t);o.set.progress(t)},decrement:function(n){var i,t;o.get.total()?(t=(i=o.get.value())-(n=n||1),o.debug("Decrementing value by",n,i)):(t=(i=o.get.percent())-(n=n||o.get.randomValue()),o.debug("Decrementing percentage by",n,i));t=o.get.normalizedValue(t);o.set.progress(t)},has:{progressPoll:function(){return o.progressPoll},total:function(){return!1!==o.get.total()}},get:{text:function(n,t){var i=t||0,r=o.get.value(i),u=o.total||0,f=d?o.get.displayPercent(i):o.get.percent(i),e=0<o.total?u-r:100-f;return n=(n=n||"").replace("{value}",r).replace("{total}",u).replace("{left}",e).replace("{percent}",f).replace("{bar}",a.text.bars[i]||""),o.verbose("Adding variables to progress bar text",n),n},normalizedValue:function(n){if(n<0)return o.debug("Value cannot decrement below 0"),0;if(o.has.total()){if(n>o.total)return o.debug("Value cannot increment above total",o.total),o.total}else if(100<n)return o.debug("Value cannot increment above 100 percent"),100;return n},updateInterval:function(){return"auto"==a.updateInterval?a.duration:a.updateInterval},randomValue:function(){return o.debug("Generating random increment percentage"),Math.floor(Math.random()*a.random.max+a.random.min)},numericValue:function(n){return"string"==typeof n?""!==n.replace(/[^\d.]/g,"")&&+n.replace(/[^\d.]/g,""):n},transitionEnd:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]},displayPercent:function(t){var i=n(w[t]),r=i.width(),f=v.width(),u=parseInt(i.css("min-width"),10)<r?r/f*100:o.percent;return 0<a.precision?Math.round(u*10*a.precision)/(10*a.precision):Math.round(u)},percent:function(n){return o.percent&&o.percent[n||0]||0},value:function(n){return o.nextValue||o.value&&o.value[n||0]||0},total:function(){return o.total||!1}},create:{progressPoll:function(){o.progressPoll=setTimeout(function(){o.update.toNextValue();o.remove.progressPoll()},o.get.updateInterval())}},is:{complete:function(){return o.is.success()||o.is.warning()||o.is.error()},success:function(){return v.hasClass(y.success)},warning:function(){return v.hasClass(y.warning)},error:function(){return v.hasClass(y.error)},active:function(){return v.hasClass(y.active)},visible:function(){return v.is(":visible")}},remove:{progressPoll:function(){o.verbose("Removing progress poll timer");o.progressPoll&&(clearTimeout(o.progressPoll),delete o.progressPoll)},nextValue:function(){o.verbose("Removing progress value stored for next update");delete o.nextValue},state:function(){o.verbose("Removing stored state");delete o.total;delete o.percent;delete o.value},active:function(){o.verbose("Removing active state");v.removeClass(y.active)},success:function(){o.verbose("Removing success state");v.removeClass(y.success)},warning:function(){o.verbose("Removing warning state");v.removeClass(y.warning)},error:function(){o.verbose("Removing error state");v.removeClass(y.error)}},set:{barWidth:function(t){o.debug("set bar width with ",t);t=o.helper.forceArray(t);var i=-1,r=-1,e=o.helper.sum(t),u=w.length,f=1<u,s=t.map(function(t,o){var h=o===u-1&&0===e,s=n(w[o]);return 0===t&&f&&!h?s.css("display","none"):(f&&h&&s.css("background","transparent"),-1==i&&(i=o),r=o,s.css({display:"block",width:t+"%"})),parseInt(t,10)});t.forEach(function(t,u){n(w[u]).css({borderTopLeftRadius:u==i?"":0,borderBottomLeftRadius:u==i?"":0,borderTopRightRadius:u==r?"":0,borderBottomRightRadius:u==r?"":0})});v.attr("data-percent",s)},duration:function(n){n="number"==typeof(n=n||a.duration)?n+"ms":n;o.verbose("Setting progress bar transition duration",n);w.css({"transition-duration":n})},percent:function(n){var t;n=o.helper.forceArray(n).map(function(n){return"string"==typeof n?+n.replace("%",""):n});var f=o.has.total(),i=o.helper.sum(n),u=1<n.length&&f,e=o.helper.sum(o.helper.forceArray(o.value));u&&e>o.total?o.error(k.sumExceedsTotal,e,o.total):!u&&100<i?o.error(k.tooHigh,i):i<0?o.error(k.tooLow,i):(t=0<a.precision?a.precision:u?o.helper.derivePrecision(Math.min.apply(null,o.value),o.total):r,n=n.map(function(n){return 0<t?Math.round(n*10*t)/(10*t):Math.round(n)}),o.percent=n,f||(o.value=n.map(function(n){return 0<t?Math.round(n/100*o.total*10*t)/(10*t):Math.round(n/100*o.total*10)/10}),a.limitValues&&(o.value=o.value.map(function(n){return 100<n?100:o.value<0?0:o.value}))),o.set.barWidth(n),o.set.labelInterval(),o.set.labels());a.onChange.call(p,n,o.value,o.total)},labelInterval:function(){clearInterval(o.interval);o.bind.transitionEnd(function(){o.verbose("Bar finished animating, removing continuous label updates");clearInterval(o.interval);d=!1;o.set.labels()});d=!0;o.interval=setInterval(function(){n.contains(i.documentElement,p)||(clearInterval(o.interval),d=!1);o.set.labels()},a.framerate)},labels:function(){o.verbose("Setting both bar progress and outer label text");o.set.barLabel();o.set.state()},label:function(n){(n=n||"")&&(n=o.get.text(n),o.verbose("Setting label to text",n),ft.text(n))},state:function(n){100===(n=n!==r?n:o.helper.sum(o.percent))?a.autoSuccess&&1===w.length&&!(o.is.warning()||o.is.error()||o.is.success())?(o.set.success(),o.debug("Automatically triggering success at 100%")):(o.verbose("Reached 100% removing active state"),o.remove.active(),o.remove.progressPoll()):0<n?(o.verbose("Adjusting active progress bar label",n),o.set.active()):(o.remove.active(),o.set.label(a.text.active))},barLabel:function(t){ut.map(function(i,u){var f=n(u);t!==r?f.text(o.get.text(t,i)):"ratio"==a.label&&o.total?(o.verbose("Adding ratio to bar label"),f.text(o.get.text(a.text.ratio,i))):"percent"==a.label&&(o.verbose("Adding percentage to bar label"),f.text(o.get.text(a.text.percent,i)))})},active:function(n){n=n||a.text.active;o.debug("Setting active state");a.showActivity&&!o.is.active()&&v.addClass(y.active);o.remove.warning();o.remove.error();o.remove.success();(n=a.onLabelUpdate("active",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onActive.call(p,o.value,o.total)})},success:function(n){n=n||a.text.success||a.text.active;o.debug("Setting success state");v.addClass(y.success);o.remove.active();o.remove.warning();o.remove.error();o.complete();n=a.text.success?a.onLabelUpdate("success",n,o.value,o.total):a.onLabelUpdate("active",n,o.value,o.total);o.set.label(n);o.bind.transitionEnd(function(){a.onSuccess.call(p,o.total)})},warning:function(n){n=n||a.text.warning;o.debug("Setting warning state");v.addClass(y.warning);o.remove.active();o.remove.success();o.remove.error();o.complete();(n=a.onLabelUpdate("warning",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onWarning.call(p,o.value,o.total)})},error:function(n){n=n||a.text.error;o.debug("Setting error state");v.addClass(y.error);o.remove.active();o.remove.success();o.remove.warning();o.complete();(n=a.onLabelUpdate("error",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onError.call(p,o.value,o.total)})},transitionEvent:function(){o.get.transitionEnd()},total:function(n){o.total=n},value:function(n){o.value=o.helper.forceArray(n)},progress:function(n){o.has.progressPoll()?(o.debug("Updated within interval, setting next update to use new value",n),o.set.nextValue(n)):(o.debug("First update in progress update interval, immediately updating",n),o.update.progress(n),o.create.progressPoll())},nextValue:function(n){o.nextValue=n}},update:{toNextValue:function(){var n=o.nextValue;n&&(o.debug("Update interval complete using last updated value",n),o.update.progress(n),o.remove.nextValue())},progress:function(n){var t=o.has.total(),i;t&&o.set.value(n);i=o.helper.forceArray(n).map(function(n){var i;return!1===(n=o.get.numericValue(n))&&o.error(k.nonNumeric,n),n=o.get.normalizedValue(n),t?(i=n/o.total*100,o.debug("Calculating percent complete from total",i)):(i=n,o.debug("Setting value to exact percentage value",i)),i});o.set.percent(i)}},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:p,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=b;return i=i||l,f=p||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?s=e[u]:o.error(k.method,t),!1;e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),Array.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(b===r&&o.initialize(),o.invoke(h)):(b!==r&&b.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(n,t){return t},onChange:function(){},onSuccess:function(){},onActive:function(){},onError:function(){},onWarning:function(){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multple values exceed total"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.slider=function(t){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=t,c="string"==typeof h,l=[].slice.call(arguments,1),a=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],v=0;return o.each(function(){var rt,d,nt,tt,lt,ut,st,k,at,vt,ft,et,yt,o,y=n.isPlainObject(t)?n.extend(!0,{},n.fn.slider.settings,t):n.extend({},n.fn.slider.settings),kt=y.className,pt=y.metadata,wt=y.namespace,ot=y.error,b=y.keys,bt=y.interpretLabel,ht=!1,w="."+wt,ct="module-"+wt,p=n(this),g=this,it=p.data(ct);o={initialize:function(){o.debug("Initializing slider",y);st=v+=1;yt=o.setup.testOutTouch();o.setup.layout();o.setup.labels();o.is.disabled()||o.bind.events();o.read.metadata();o.read.settings();o.instantiate()},instantiate:function(){o.verbose("Storing instance of slider",o);it=o;p.data(ct,o)},destroy:function(){o.verbose("Destroying previous slider for",p);clearInterval(it.interval);o.unbind.events();o.unbind.slidingEvents();p.removeData(ct);it=r},setup:{layout:function(){p.attr("tabindex")===r&&p.attr("tabindex",0);0==p.find(".inner").length&&p.append("<div class='inner'><div class='track'><\/div><div class='track-fill'><\/div><div class='thumb'><\/div><\/div>");et=o.get.precision();d=p.find(".thumb:not(.second)");rt=d;o.is.range()&&(0==p.find(".thumb.second").length&&p.find(".inner").append("<div class='thumb second'><\/div>"),nt=p.find(".thumb.second"));tt=p.find(".track");lt=p.find(".track-fill");ft=d.width()/2},labels:function(){o.is.labeled()&&(0!=(ut=p.find(".labels:not(.auto)")).length?o.setup.customLabel():o.setup.autoLabel(),y.showLabelTicks&&p.addClass(kt.ticked))},testOutTouch:function(){try{return i.createEvent("TouchEvent"),!0}catch(n){return!1}},customLabel:function(){var r,u=ut.find(".label"),f=u.length,t=o.get.min(),i=o.get.max();u.each(function(u){var e=n(this).attr("data-value");r=e?((e=i<e?i:e<t?t:e)-t)/(i-t):(u+1)/(f+1);o.update.labelPosition(r,n(this))})},autoLabel:function(){var t,i;if(0!=o.get.step())for(0!=(ut=p.find(".labels")).length?ut.empty():ut=p.append('<ul class="auto labels"><\/ul>').find(".labels"),t=0,i=o.get.numLabels();t<=i;t++){var u=o.get.label(t),r=""!==u?n('<li class="label">'+u+"<\/li>"):null,f=t/i;r&&(o.update.labelPosition(f,r),ut.append(r))}}},bind:{events:function(){o.bind.globalKeyboardEvents();o.bind.keyboardEvents();o.bind.mouseEvents();o.is.touch()&&o.bind.touchEvents()},keyboardEvents:function(){o.verbose("Binding keyboard events");p.on("keydown"+w,o.event.keydown)},globalKeyboardEvents:function(){n(i).on("keydown"+w+st,o.event.activateFocus)},mouseEvents:function(){o.verbose("Binding mouse events");p.find(".track, .thumb, .inner").on("mousedown"+w,function(n){n.stopImmediatePropagation();n.preventDefault();o.event.down(n)});p.on("mousedown"+w,o.event.down);p.on("mouseenter"+w,function(){ht=!0});p.on("mouseleave"+w,function(){ht=!1})},touchEvents:function(){o.verbose("Binding touch events");p.find(".track, .thumb, .inner").on("touchstart"+w,function(n){n.stopImmediatePropagation();n.preventDefault();o.event.down(n)});p.on("touchstart"+w,o.event.down)},slidingEvents:function(){o.verbose("Binding page wide events while handle is being draged");o.is.touch()?(n(i).on("touchmove"+w,o.event.move),n(i).on("touchend"+w,o.event.up)):(n(i).on("mousemove"+w,o.event.move),n(i).on("mouseup"+w,o.event.up))}},unbind:{events:function(){p.find(".track, .thumb, .inner").off("mousedown"+w);p.find(".track, .thumb, .inner").off("touchstart"+w);p.off("mousedown"+w);p.off("mouseenter"+w);p.off("mouseleave"+w);p.off("touchstart"+w);p.off("keydown"+w);p.off("focusout"+w);n(i).off("keydown"+w+st,o.event.activateFocus)},slidingEvents:function(){o.is.touch()?(n(i).off("touchmove"+w),n(i).off("touchend"+w)):(n(i).off("mousemove"+w),n(i).off("mouseup"+w))}},event:{down:function(n,t){if(n.preventDefault(),o.is.range()){var i=o.determine.eventPos(n,t),r=o.determine.pos(i);rt=o.determine.closestThumb(r)}o.is.disabled()||o.bind.slidingEvents()},move:function(n,t){var i;if(n.preventDefault(),i=o.determine.valueFromEvent(n,t),0==o.get.step()||o.is.smooth()){var r=o.thumbVal,u=o.secondThumbVal,f=o.determine.smoothValueFromEvent(n,t);rt.hasClass("second")?u=i:r=i;i=Math.abs(r-(u||0));o.update.position(f);y.onMove.call(g,i,r,u)}else o.update.value(i,function(n,t,i){y.onMove.call(g,n,t,i)})},up:function(n,t){n.preventDefault();var i=o.determine.valueFromEvent(n,t);o.set.value(i);o.unbind.slidingEvents()},keydown:function(t,r){if(o.is.focused()&&n(i).trigger(t),r||o.is.focused()){var u=o.determine.keyMovement(t);if(0!=u)switch(t.preventDefault(),u){case 1:o.takeStep();break;case 2:o.takeStep(o.get.multiplier());break;case-1:o.backStep();break;case-2:o.backStep(o.get.multiplier())}}},activateFocus:function(n){!o.is.focused()&&o.is.hover()&&0!=o.determine.keyMovement(n)&&(n.preventDefault(),o.event.keydown(n,!0),p.focus())}},resync:function(){o.verbose("Resyncing thumb position based on value");o.is.range()&&o.update.position(o.secondThumbVal,nt);o.update.position(o.thumbVal,d);o.setup.labels()},takeStep:function(n){var t,u,i,f;n=n!=r?n:1;t=o.get.step();u=o.get.currentThumbValue();(o.verbose("Taking a step"),0<t)?o.set.value(u+t*n):0==t&&(i=o.get.precision(),f=u+n/i,o.set.value(Math.round(f*i)/i))},backStep:function(n){var t,u,i,f;n=n!=r?n:1;t=o.get.step();u=o.get.currentThumbValue();(o.verbose("Going back a step"),0<t)?o.set.value(u-t*n):0==t&&(i=o.get.precision(),f=u-n/i,o.set.value(Math.round(f*i)/i))},is:{range:function(){return p.hasClass(y.className.range)},hover:function(){return ht},focused:function(){return p.is(":focus")},disabled:function(){return p.hasClass(y.className.disabled)},labeled:function(){return p.hasClass(y.className.labeled)},reversed:function(){return p.hasClass(y.className.reversed)},vertical:function(){return p.hasClass(y.className.vertical)},smooth:function(){return y.smooth||p.hasClass(y.className.smooth)},touch:function(){return yt}},get:{trackOffset:function(){return o.is.vertical()?tt.offset().top:tt.offset().left},trackLength:function(){return o.is.vertical()?tt.height():tt.width()},trackLeft:function(){return o.is.vertical()?tt.position().top:tt.position().left},trackStartPos:function(){return o.is.reversed()?o.get.trackLeft()+o.get.trackLength():o.get.trackLeft()},trackEndPos:function(){return o.is.reversed()?o.get.trackLeft():o.get.trackLeft()+o.get.trackLength()},trackStartMargin:function(){return(o.is.vertical()?o.is.reversed()?p.css("padding-bottom"):p.css("padding-top"):o.is.reversed()?p.css("padding-right"):p.css("padding-left"))||"0px"},trackEndMargin:function(){return(o.is.vertical()?o.is.reversed()?p.css("padding-top"):p.css("padding-bottom"):o.is.reversed()?p.css("padding-left"):p.css("padding-right"))||"0px"},precision:function(){var n,r=o.get.step(),t,i;return 0!=r?(t=String(r).split("."),n=2==t.length?t[1].length:0):n=y.decimalPlaces,i=Math.pow(10,n),o.debug("Precision determined",i),i},min:function(){return y.min},max:function(){var n=o.get.step(),t=o.get.min(),i=0===n?0:Math.floor((y.max-t)/n);return 0==(0===n?0:(y.max-t)%n)?y.max:t+i*n},step:function(){return y.step},numLabels:function(){var n=Math.round((o.get.max()-o.get.min())/o.get.step());return o.debug("Determined that there should be "+n+" labels"),n},labelType:function(){return y.labelType},label:function(n){if(bt)return bt(n);switch(y.labelType){case y.labelTypes.number:return Math.round((n*o.get.step()+o.get.min())*et)/et;case y.labelTypes.letter:return a[n%26];default:return n}},value:function(){return k},currentThumbValue:function(){return rt.hasClass("second")?o.secondThumbVal:o.thumbVal},thumbValue:function(n){switch(n){case"second":if(o.is.range())return o.secondThumbVal;o.error(ot.notrange);break;case"first":default:return o.thumbVal}},multiplier:function(){return y.pageMultiplier},thumbPosition:function(n){switch(n){case"second":if(o.is.range())return vt;o.error(ot.notrange);break;case"first":default:return at}}},determine:{pos:function(n){return o.is.reversed()?o.get.trackStartPos()-n+o.get.trackOffset():n-o.get.trackOffset()-o.get.trackStartPos()},closestThumb:function(n){var t=parseFloat(o.determine.thumbPos(d)),i=Math.abs(n-t),r=parseFloat(o.determine.thumbPos(nt));return i<=Math.abs(n-r)?d:nt},closestThumbPos:function(n){var t=parseFloat(o.determine.thumbPos(d)),r=Math.abs(n-t),i=parseFloat(o.determine.thumbPos(nt));return r<=Math.abs(n-i)?t:i},thumbPos:function(n){return o.is.vertical()?o.is.reversed()?n.css("bottom"):n.css("top"):o.is.reversed()?n.css("right"):n.css("left")},positionFromValue:function(n){var t=o.get.min(),i=o.get.max(),u=(n=i<n?i:n<t?t:n,o.get.trackLength()),f=(n-t)/(i-t),r=Math.round(f*u);return o.verbose("Determined position: "+r+" from value: "+n),r},positionFromRatio:function(n){var r=o.get.trackLength(),t=o.get.step(),i=Math.round(n*r);return 0==t?i:Math.round(i/t)*t},valueFromEvent:function(n,t){var i=o.determine.eventPos(n,t),r=o.determine.pos(i);return i<o.get.trackOffset()?o.is.reversed()?o.get.max():o.get.min():i>o.get.trackOffset()+o.get.trackLength()?o.is.reversed()?o.get.min():o.get.max():o.determine.value(r)},smoothValueFromEvent:function(n,t){var i,f=o.get.min(),e=o.get.max(),u=o.get.trackLength(),r=o.determine.eventPos(n,t)-o.get.trackOffset();return i=(r=r<0?0:u<r?u:r)/u,o.is.reversed()&&(i=1-i),i*(e-f)+f},eventPos:function(n,t){var i,r,u,f;return o.is.touch()?(i=n.changedTouches[0].pageY||n.touches[0].pageY,r=n.changedTouches[0].pageX||n.touches[0].pageX,o.is.vertical()?i:r):(u=n.pageY||t.pageY,f=n.pageX||t.pageX,o.is.vertical()?u:f)},value:function(n){var u=o.is.reversed()?o.get.trackEndPos():o.get.trackStartPos(),f=(n-u)/((o.is.reversed()?o.get.trackStartPos():o.get.trackEndPos())-u),e=o.get.max()-o.get.min(),r=o.get.step(),i=f*e,t=0==r?i:Math.round(i/r)*r;return o.verbose("Determined value based upon position: "+n+" as: "+i),i!=t&&o.verbose("Rounding value to closest step: "+t),t=Math.round(t*et)/et,o.verbose("Cutting off additional decimal places"),t+o.get.min()},keyMovement:function(n){var t=n.which,i=o.is.vertical()?o.is.reversed()?b.downArrow:b.upArrow:b.downArrow,r=o.is.vertical()?o.is.reversed()?b.upArrow:b.downArrow:b.upArrow,u=o.is.vertical()?b.leftArrow:o.is.reversed()?b.rightArrow:b.leftArrow,f=o.is.vertical()?b.rightArrow:o.is.reversed()?b.leftArrow:b.rightArrow;return t==i||t==u?-1:t==r||t==f?1:t==b.pageDown?-2:t==b.pageUp?2:0}},handleNewValuePosition:function(n){var t=o.get.min(),i=o.get.max();return n<=t?n=t:i<=n&&(n=i),o.determine.positionFromValue(n)},set:{value:function(n){o.update.value(n,function(n,t,i){y.onChange.call(g,n,t,i);y.onMove.call(g,n,t,i)})},rangeValue:function(n,t){if(o.is.range()){var i=o.get.min(),r=o.get.max();n<=i?n=i:r<=n&&(n=r);t<=i?t=i:r<=t&&(t=r);o.thumbVal=n;o.secondThumbVal=t;k=Math.abs(o.thumbVal-o.secondThumbVal);o.update.position(o.thumbVal,d);o.update.position(o.secondThumbVal,nt);y.onChange.call(g,k,o.thumbVal,o.secondThumbVal);y.onMove.call(g,k,o.thumbVal,o.secondThumbVal)}else o.error(ot.notrange)},position:function(n,t){var i=o.determine.value(n);switch(t){case"second":o.secondThumbVal=i;o.update.position(i,nt);break;default:o.thumbVal=i;o.update.position(i,d)}k=Math.abs(o.thumbVal-(o.secondThumbVal||0));o.set.value(k)}},update:{value:function(n,t){var i=o.get.min(),r=o.get.max();n<=i?n=i:r<=n&&(n=r);o.is.range()?(rt.hasClass("second")?o.secondThumbVal=n:o.thumbVal=n,k=Math.abs(o.thumbVal-o.secondThumbVal)):(k=n,o.thumbVal=k);o.update.position(n);o.debug("Setting slider value to "+k);"function"==typeof t&&t(k,o.thumbVal,o.secondThumbVal)},position:function(n,t){var h=o.handleNewValuePosition(n),v=t!=r?t:rt,c=o.thumbVal||o.get.min(),l=o.secondThumbVal||o.get.min();o.is.range()&&v.hasClass("second")?(vt=h,l=n):(at=h,c=n);var y,u,i=o.get.min(),a=o.get.max(),f=100*(n-i)/(a-i),e=100*(Math.min(c,l)-i)/(a-i),s=100*(1-(Math.max(c,l)-i)/(a-i));y=o.is.vertical()?o.is.reversed()?(u={bottom:"calc("+f+"% - "+ft+"px)",top:"auto"},{bottom:e+"%",top:s+"%"}):(u={top:"calc("+f+"% - "+ft+"px)",bottom:"auto"},{top:e+"%",bottom:s+"%"}):o.is.reversed()?(u={right:"calc("+f+"% - "+ft+"px)",left:"auto"},{right:e+"%",left:s+"%"}):(u={left:"calc("+f+"% - "+ft+"px)",right:"auto"},{left:e+"%",right:s+"%"});v.css(u);lt.css(y);o.debug("Setting slider position to "+h)},labelPosition:function(n,t){var i=o.get.trackStartMargin(),r=o.get.trackEndMargin(),u=o.is.vertical()?o.is.reversed()?"bottom":"top":o.is.reversed()?"right":"left",f=o.is.reversed()&&!o.is.vertical()?" - ":" + ",e="(100% - "+i+" - "+r+") * "+n;t.css(u,"calc("+e+f+i+")")}},goto:{max:function(){o.set.value(o.get.max())},min:function(){o.set.value(o.get.min())}},read:{metadata:function(){var n={thumbVal:p.data(pt.thumbVal),secondThumbVal:p.data(pt.secondThumbVal)};n.thumbVal&&(o.is.range()&&n.secondThumbVal?(o.debug("Current value set from metadata",n.thumbVal,n.secondThumbVal),o.set.rangeValue(n.thumbVal,n.secondThumbVal)):(o.debug("Current value set from metadata",n.thumbVal),o.set.value(n.thumbVal)))},settings:function(){!1!==y.start&&(o.is.range()?(o.debug("Start position set from settings",y.start,y.end),o.set.rangeValue(y.start,y.end)):(o.debug("Start position set from settings",y.start),o.set.value(y.start)))}},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];n.isPlainObject(y[t])?n.extend(!0,y[t],i):y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,y.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),o.verbose.apply(console,arguments)))},error:function(){y.silent||(o.error=Function.prototype.bind.call(console.error,console,y.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=y.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=it;return i=i||l,f=g||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?s=e[u]:o.error(ot.method,t),!1;e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(it===r&&o.initialize(),o.invoke(h)):(it!==r&&it.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(){},onMove:function(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.rating=function(t){var i,f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=t,h="string"==typeof s,c=[].slice.call(arguments,1);return f.each(function(){var g,l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.rating.settings,t):n.extend({},n.fn.rating.settings),it=a.namespace,y=a.className,p=a.metadata,k=a.selector,d="."+it,nt="module-"+it,tt=this,b=n(this).data(nt),v=n(this),w=v.find(k.icon);l={initialize:function(){l.verbose("Initializing rating module",a);0===w.length&&l.setup.layout();a.interactive&&!l.is.disabled()?l.enable():l.disable();l.set.initialLoad();l.set.rating(l.get.initialRating());l.remove.initialLoad();l.instantiate()},instantiate:function(){l.verbose("Instantiating module",a);b=l;v.data(nt,l)},destroy:function(){l.verbose("Destroying previous instance",b);l.remove.events();v.removeData(nt)},refresh:function(){w=v.find(k.icon)},setup:{layout:function(){var t=l.get.maxRating(),i=l.get.icon(),r=n.fn.rating.settings.templates.icon(t,i);l.debug("Generating icon html dynamically");v.html(r);l.refresh()}},event:{mouseenter:function(){var t=n(this);t.nextAll().removeClass(y.selected);v.addClass(y.selected);t.addClass(y.selected).prevAll().addClass(y.selected)},mouseleave:function(){v.removeClass(y.selected);w.removeClass(y.selected)},click:function(){var i=n(this),r=l.get.rating(),t=w.index(i)+1;("auto"==a.clearable?1===w.length:a.clearable)&&r==t?l.clearRating():l.set.rating(t)}},clearRating:function(){l.debug("Clearing current rating");l.set.rating(0)},bind:{events:function(){l.verbose("Binding events");v.on("mouseenter"+d,k.icon,l.event.mouseenter).on("mouseleave"+d,k.icon,l.event.mouseleave).on("click"+d,k.icon,l.event.click)}},remove:{events:function(){l.verbose("Removing events");v.off(d)},initialLoad:function(){g=!1}},enable:function(){l.debug("Setting rating to interactive mode");l.bind.events();v.removeClass(y.disabled)},disable:function(){l.debug("Setting rating to read-only mode");l.remove.events();v.addClass(y.disabled)},is:{initialLoad:function(){return g},disabled:function(){return v.hasClass(y.disabled)}},get:{icon:function(){var n=v.data(p.icon);return n&&v.removeData(p.icon),n||a.icon},initialRating:function(){return v.data(p.rating)!==r?(v.removeData(p.rating),v.data(p.rating)):a.initialRating},maxRating:function(){return v.data(p.maxRating)!==r?(v.removeData(p.maxRating),v.data(p.maxRating)):a.maxRating},rating:function(){var n=w.filter("."+y.active).length;return l.verbose("Current rating retrieved",n),n}},set:{rating:function(n){var t=0<=n-1?n-1:0,i=w.eq(t);v.removeClass(y.selected);w.removeClass(y.selected).removeClass(y.active);0<n&&(l.verbose("Setting current rating to",n),i.prevAll().addBack().addClass(y.active));l.is.initialLoad()||a.onRate.call(tt,n)},initialLoad:function(){g=!0}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(l.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");1<f.length&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&0<u.length&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(t,u,f){var h,o,s,e=b;return u=u||c,f=tt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),Array.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(b===r&&l.initialize(),l.invoke(s)):(b!==r&&b.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.rating.settings={name:"Rating",namespace:"rating",icon:"star",silent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating",icon:"icon"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(n,t){for(var i=1,r="";i<=n;)r+='<i class="'+t+' icon"><\/i>',i++;return r}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.search=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=u,l="string"==typeof c,a=[].slice.call(arguments,1);return n(this).each(function(){var v,y=n.isPlainObject(u)?n.extend(!0,{},n.fn.search.settings,u):n.extend({},n.fn.search.settings),b=y.className,g=y.metadata,ct=y.regExp,d=y.fields,w=y.selector,tt=y.error,lt=y.namespace,nt="."+lt,ft=lt+"-module",p=n(this),it=p.find(w.prompt),et=p.find(w.searchButton),k=p.find(w.results),ot=p.find(w.result),rt=(p.find(w.category),this),ut=p.data(ft),st=!1,ht=!1;v={initialize:function(){v.verbose("Initializing module");v.get.settings();v.determine.searchFields();v.bind.events();v.set.type();v.create.results();v.instantiate()},instantiate:function(){v.verbose("Storing instance of module",v);ut=v;p.data(ft,v)},destroy:function(){v.verbose("Destroying instance");p.off(nt).removeData(ft)},refresh:function(){v.debug("Refreshing selector cache");it=p.find(w.prompt);et=p.find(w.searchButton);p.find(w.category);k=p.find(w.results);ot=p.find(w.result)},refreshResults:function(){k=p.find(w.results);ot=p.find(w.result)},bind:{events:function(){v.verbose("Binding events to search");y.automatic&&(p.on(v.get.inputEvent()+nt,w.prompt,v.event.input),it.attr("autocomplete","off"));p.on("focus"+nt,w.prompt,v.event.focus).on("blur"+nt,w.prompt,v.event.blur).on("keydown"+nt,w.prompt,v.handleKeyboard).on("click"+nt,w.searchButton,v.query).on("mousedown"+nt,w.results,v.event.result.mousedown).on("mouseup"+nt,w.results,v.event.result.mouseup).on("click"+nt,w.result,v.event.result.click)}},determine:{searchFields:function(){u&&u.searchFields!==r&&(y.searchFields=u.searchFields)}},event:{input:function(){y.searchDelay?(clearTimeout(v.timer),v.timer=setTimeout(function(){v.is.focused()&&v.query()},y.searchDelay)):v.query()},focus:function(){v.set.focus();y.searchOnFocus&&v.has.minimumCharacters()&&v.query(function(){v.can.show()&&v.showResults()})},blur:function(){function n(){v.cancel.query();v.remove.focus();v.timer=setTimeout(v.hideResults,y.hideDelay)}var t=i.activeElement===this;t||(ht=!1,v.resultsClicked?(v.debug("Determining if user action caused search to close"),p.one("click.close"+nt,w.results,function(t){v.is.inMessage(t)||st?it.focus():(st=!1,v.is.animating()||v.is.hidden()||n())})):(v.debug("Input blurred without user action, closing results"),n()))},result:{mousedown:function(){v.resultsClicked=!0},mouseup:function(){v.resultsClicked=!1},click:function(i){v.debug("Search result selected");var r=n(this),o=r.find(w.title).eq(0),u=r.is("a[href]")?r:r.find("a[href]").eq(0),f=u.attr("href")||!1,h=u.attr("target")||!1,e=0<o.length&&o.text(),s=v.get.results(),c=r.data(g.result)||v.get.result(e,s);if(e&&v.set.value(e),n.isFunction(y.onSelect)&&!1===y.onSelect.call(rt,c,s))return v.debug("Custom onSelect callback cancelled default select action"),void(st=!0);v.hideResults();f&&(v.verbose("Opening search link found in result",u),"_blank"==h||i.ctrlKey?t.open(f):t.location.href=f)}}},handleKeyboard:function(n){var u,t=p.find(w.result),f=p.find(w.category),e=t.filter("."+b.active),i=t.index(e),s=t.length,h=0<e.length,r=n.which,o=13;if(r==27&&(v.verbose("Escape key pressed, blurring search field"),v.hideResults(),ht=!0),v.is.visible())if(r==o){if(v.verbose("Enter key pressed, selecting active result"),0<t.filter("."+b.active).length)return v.event.result.click.call(t.filter("."+b.active),n),n.preventDefault(),!1}else r==38&&h?(v.verbose("Up key pressed, changing active result"),u=i-1<0?i:i-1,f.removeClass(b.active),t.removeClass(b.active).eq(u).addClass(b.active).closest(f).addClass(b.active),n.preventDefault()):r==40&&(v.verbose("Down key pressed, changing active result"),u=s<=i+1?i:i+1,f.removeClass(b.active),t.removeClass(b.active).eq(u).addClass(b.active).closest(f).addClass(b.active),n.preventDefault());else r==o&&(v.verbose("Enter key pressed, executing query"),v.query(),v.set.buttonPressed(),it.one("keyup",v.remove.buttonFocus))},setup:{api:function(t,i){var r={debug:y.debug,on:!1,cache:y.cache,action:"search",urlData:{query:t},onSuccess:function(n){v.parse.response.call(rt,n,t);i()},onFailure:function(){v.displayMessage(tt.serverError);i()},onAbort:function(){},onError:v.error};n.extend(!0,r,y.apiSettings);v.verbose("Setting up API request",r);p.api(r)}},can:{useAPI:function(){return n.fn.api!==r},show:function(){return v.is.focused()&&!v.is.visible()&&!v.is.empty()},transition:function(){return y.transition&&n.fn.transition!==r&&p.transition("is supported")}},is:{animating:function(){return k.hasClass(b.animating)},hidden:function(){return k.hasClass(b.hidden)},inMessage:function(t){if(t.target){var r=n(t.target);return n.contains(i.documentElement,t.target)&&0<r.closest(w.message).length}},empty:function(){return""===k.html()},visible:function(){return 0<k.filter(":visible").length},focused:function(){return 0<it.filter(":focus").length}},get:{settings:function(){n.isPlainObject(u)&&u.searchFullText&&(y.fullTextSearch=u.searchFullText,v.error(y.error.oldSearchSyntax,rt));y.ignoreDiacritics&&!String.prototype.normalize&&(y.ignoreDiacritics=!1,v.error(tt.noNormalize,rt))},inputEvent:function(){var n=it[0];return n!==r&&n.oninput!==r?"input":n!==r&&n.onpropertychange!==r?"propertychange":"keyup"},value:function(){return it.val()},results:function(){return p.data(g.results)},result:function(t,i){var u=!1;return t=t!==r?t:v.get.value(),i=i!==r?i:v.get.results(),"category"===y.type?(v.debug("Finding result that matches",t),n.each(i,function(n,i){if(Array.isArray(i.results)&&(u=v.search.object(t,i.results)[0]))return!1})):(v.debug("Finding result in results object",t),u=v.search.object(t,i)[0]),u||!1}},select:{firstResult:function(){v.verbose("Selecting first result");ot.first().addClass(b.active)}},set:{focus:function(){p.addClass(b.focus)},loading:function(){p.addClass(b.loading)},value:function(n){v.verbose("Setting search input value",n);it.val(n)},type:function(n){n=n||y.type;"category"==y.type&&p.addClass(y.type)},buttonPressed:function(){et.addClass(b.pressed)}},remove:{loading:function(){p.removeClass(b.loading)},focus:function(){p.removeClass(b.focus)},buttonPressed:function(){et.removeClass(b.pressed)},diacritics:function(n){return y.ignoreDiacritics?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n}},query:function(t){t=n.isFunction(t)?t:function(){};var i=v.get.value(),r=v.read.cache(i);t=t||function(){};v.has.minimumCharacters()?(r?(v.debug("Reading result from cache",i),v.save.results(r.results),v.addResults(r.html),v.inject.id(r.results),t()):(v.debug("Querying for",i),n.isPlainObject(y.source)||Array.isArray(y.source)?(v.search.local(i),t()):v.can.useAPI()?v.search.remote(i,t):(v.error(tt.source),t())),y.onSearchQuery.call(rt,i)):v.hideResults()},search:{local:function(n){var i,t=v.search.object(n,y.source);v.set.loading();v.save.results(t);v.debug("Returned full local search results",t);0<y.maxResults&&(v.debug("Using specified max results",t),t=t.slice(0,y.maxResults));"category"==y.type&&(t=v.create.categoryResults(t));i=v.generateResults({results:t});v.remove.loading();v.addResults(i);v.inject.id(t);v.write.cache(n,{html:i,results:t})},remote:function(t,i){i=n.isFunction(i)?i:function(){};p.api("is loading")&&p.api("abort");v.setup.api(t,i);p.api("query")},object:function(t,i,u){function o(t,i){var r=-1==n.inArray(i,f),u=-1==n.inArray(i,s),o=-1==n.inArray(i,e);r&&u&&o&&t.push(i)}t=v.remove.diacritics(String(t));var f=[],e=[],s=[],h=t.replace(ct.escape,"\\$&"),c=new RegExp(ct.beginsWith+h,"i");return i=i||y.source,u=u!==r?u:y.searchFields,Array.isArray(u)||(u=[u]),i===r||!1===i?(v.error(tt.source),[]):(n.each(u,function(r,u){n.each(i,function(n,i){var r;"string"!=typeof i[u]&&"number"!=typeof i[u]||(-1!==(r="string"==typeof i[u]?v.remove.diacritics(i[u]):i[u].toString()).search(c)?o(f,i):"exact"===y.fullTextSearch&&v.exactSearch(t,r)?o(e,i):1==y.fullTextSearch&&v.fuzzySearch(t,r)&&o(s,i))})}),n.merge(e,s),n.merge(f,e),f)}},exactSearch:function(n,t){return n=n.toLowerCase(),-1<(t=t.toLowerCase()).indexOf(n)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if("string"!=typeof n||(n=n.toLowerCase(),t=t.toLowerCase(),r<u))return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},parse:{response:function(n,t){var i,u;Array.isArray(n)&&(i={},i[d.results]=n,n=i);u=v.generateResults(n);v.verbose("Parsing server response",n);n!==r&&t!==r&&n[d.results]!==r&&(v.addResults(u),v.inject.id(n[d.results]),v.write.cache(t,{html:u,results:n[d.results]}),v.save.results(n[d.results]))}},cancel:{query:function(){v.can.useAPI()&&p.api("abort")}},has:{minimumCharacters:function(){return v.get.value().length>=y.minCharacters},results:function(){return 0!==k.length&&""!=k.html()}},clear:{cache:function(n){var t=p.data(g.cache);n?n&&t&&t[n]&&(v.debug("Removing value from cache",n),delete t[n],p.data(g.cache,t)):(v.debug("Clearing cache",n),p.removeData(g.cache))}},read:{cache:function(n){var t=p.data(g.cache);return!!y.cache&&(v.verbose("Checking cache for generated html for query",n),"object"==typeof t&&t[n]!==r&&t[n])}},create:{categoryResults:function(t){var i={};return n.each(t,function(n,t){t.category&&(i[t.category]===r?(v.verbose("Creating new category of results",t.category),i[t.category]={name:t.category,results:[t]}):i[t.category].results.push(t))}),i},id:function(n,t){var i,u=n+1;return t!==r?(i=String.fromCharCode(97+t)+u,v.verbose("Creating category result id",i)):(i=u,v.verbose("Creating result id",i)),i},results:function(){0===k.length&&(k=n("<div />").addClass(b.results).appendTo(p))}},inject:{result:function(n,t,i){v.verbose("Injecting result into results");var u=i!==r?k.children().eq(i).children(w.results).first().children(w.result).eq(t):k.children(w.result).eq(t);v.verbose("Injecting results metadata",u);u.data(g.result,n)},id:function(t){v.debug("Injecting unique ids into results");var u=0,i=0;return"category"===y.type?n.each(t,function(t,f){0<f.results.length&&(i=0,n.each(f.results,function(n,t){t.id===r&&(t.id=v.create.id(i,u));v.inject.result(t,i,u);i++}),u++)}):n.each(t,function(n,t){t.id===r&&(t.id=v.create.id(i));v.inject.result(t,i);i++}),t}},save:{results:function(n){v.verbose("Saving current search results to metadata",n);p.data(g.results,n)}},write:{cache:function(n,t){var i=p.data(g.cache)!==r?p.data(g.cache):{};y.cache&&(v.verbose("Writing generated html to cache",n,t),i[n]=t,p.data(g.cache,i))}},addResults:function(t){if(n.isFunction(y.onResultsAdd)&&!1===y.onResultsAdd.call(k,t))return v.debug("onResultsAdd callback cancelled default action"),!1;t?(k.html(t),v.refreshResults(),y.selectFirstResult&&v.select.firstResult(),v.showResults()):v.hideResults(function(){k.empty()})},showResults:function(t){t=n.isFunction(t)?t:function(){};ht||!v.is.visible()&&v.has.results()&&(v.can.transition()?(v.debug("Showing results with css animations"),k.transition({animation:y.transition+" in",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Showing results with javascript"),k.stop().fadeIn(y.duration,y.easing)),y.onResultsOpen.call(k))},hideResults:function(t){t=n.isFunction(t)?t:function(){};v.is.visible()&&(v.can.transition()?(v.debug("Hiding results with css animations"),k.transition({animation:y.transition+" out",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Hiding results with javascript"),k.stop().fadeOut(y.duration,y.easing)),y.onResultsClose.call(k))},generateResults:function(t){v.debug("Generating html from response",t);var r=y.templates[y.type],u=n.isPlainObject(t[d.results])&&!n.isEmptyObject(t[d.results]),f=Array.isArray(t[d.results])&&0<t[d.results].length,i="";return u||f?(0<y.maxResults&&(u?"standard"==y.type&&v.error(tt.maxResults):t[d.results]=t[d.results].slice(0,y.maxResults)),n.isFunction(r)?i=r(t,d,y.preserveHTML):v.error(tt.noTemplate,!1)):y.showNoResults&&(i=v.displayMessage(tt.noResults,"empty",tt.noResultsHeader)),y.onResults.call(rt,t),i},displayMessage:function(n,t,i){return t=t||"standard",v.debug("Displaying message",n,t,i),v.addResults(y.templates.message(n,t,i)),y.templates.message(n,t,i)},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:rt,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;s=!1;clearTimeout(v.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");1<o.length&&(t+=" ("+o.length+")");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||a,u=rt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(ut===r&&v.initialize(),v.invoke(c)):(ut!==r&&ut.invoke("destroy"),v.initialize())}),f!==r?f:this};n.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["id","title","description"],displayField:"",fullTextSearch:"exact",ignoreDiacritics:!1,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,preserveHTML:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResultsHeader:"No Results",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined.",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(n,t){if(t)return n;var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return i[n]}):n},message:function(n,t,i){var u="";return n!==r&&t!==r&&(u+='<div class="message '+t+'">',i&&(u+='<div class="header">'+i+"<\/div>"),u+=' <div class="description">'+n+"<\/div>",u+="<\/div>"),u},category:function(t,i,u){var f="",e=n.fn.search.settings.templates.escape;return t[i.categoryResults]!==r&&(n.each(t[i.categoryResults],function(t,o){o[i.results]!==r&&0<o.results.length&&(f+='<div class="category">',o[i.categoryName]!==r&&(f+='<div class="name">'+e(o[i.categoryName],u)+"<\/div>"),f+='<div class="results">',n.each(o.results,function(n,t){f+=t[i.url]?'<a class="result" href="'+t[i.url].replace(/"/g,"")+'">':'<a class="result">';t[i.image]!==r&&(f+='<div class="image"> <img src="'+t[i.image].replace(/"/g,"")+'"><\/div>');f+='<div class="content">';t[i.price]!==r&&(f+='<div class="price">'+e(t[i.price],u)+"<\/div>");t[i.title]!==r&&(f+='<div class="title">'+e(t[i.title],u)+"<\/div>");t[i.description]!==r&&(f+='<div class="description">'+e(t[i.description],u)+"<\/div>");f+="<\/div>";f+="<\/a>"}),f+="<\/div>",f+="<\/div>")}),t[i.action]&&(f+=!1===i.actionURL?'<div class="action">'+e(t[i.action][i.actionText],u)+"<\/div>":'<a href="'+t[i.action][i.actionURL].replace(/"/g,"")+'" class="action">'+e(t[i.action][i.actionText],u)+"<\/a>"),f)},standard:function(t,i,u){var f="",e=n.fn.search.settings.templates.escape;return t[i.results]!==r&&(n.each(t[i.results],function(n,t){f+=t[i.url]?'<a class="result" href="'+t[i.url].replace(/"/g,"")+'">':'<a class="result">';t[i.image]!==r&&(f+='<div class="image"> <img src="'+t[i.image].replace(/"/g,"")+'"><\/div>');f+='<div class="content">';t[i.price]!==r&&(f+='<div class="price">'+e(t[i.price],u)+"<\/div>");t[i.title]!==r&&(f+='<div class="title">'+e(t[i.title],u)+"<\/div>");t[i.description]!==r&&(f+='<div class="description">'+e(t[i.description],u)+"<\/div>");f+="<\/div>";f+="<\/a>"}),t[i.action]&&(f+=!1===i.actionURL?'<div class="action">'+e(t[i.action][i.actionText],u)+"<\/div>":'<a href="'+t[i.action][i.actionURL].replace(/"/g,"")+'" class="action">'+e(t[i.action][i.actionText],u)+"<\/a>"),f)}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.shape=function(u){var f,o=n(this),s=(new Date).getTime(),e=[],h=u,c="string"==typeof h,l=[].slice.call(arguments,1),a=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return o.each(function(){var p,y,t,ft=o.selector||"",v=n.isPlainObject(u)?n.extend(!0,{},n.fn.shape.settings,u):n.extend({},n.fn.shape.settings),et=v.namespace,k=v.selector,ot=v.error,b=v.className,st="."+et,rt="module-"+et,w=n(this),g=w.find(">"+k.sides),d=g.find(">"+k.side),it=!1,nt=this,tt=w.data(rt),ut;(t={initialize:function(){t.verbose("Initializing module for",nt);t.set.defaultSide();t.instantiate()},instantiate:function(){t.verbose("Storing instance of module",t);tt=t;w.data(rt,tt)},destroy:function(){t.verbose("Destroying previous module for",nt);w.removeData(rt).off(st)},refresh:function(){t.verbose("Refreshing selector cache for",nt);w=n(nt);g=n(this).find(k.sides);d=n(this).find(k.side)},repaint:function(){t.verbose("Forcing repaint event");(g[0]||i.createElement("div")).offsetWidth},animate:function(n,i){t.verbose("Animating box with properties",n);i=i||function(n){t.verbose("Executing animation callback");n!==r&&n.stopPropagation();t.reset();t.set.active()};v.beforeChange.call(y[0]);t.get.transitionEvent()?(t.verbose("Starting CSS animation"),w.addClass(b.animating),g.css(n).one(t.get.transitionEvent(),i),t.set.duration(v.duration),a(function(){w.addClass(b.animating);p.addClass(b.hidden)})):i()},queue:function(n){t.debug("Queueing animation of",n);g.one(t.get.transitionEvent(),function(){t.debug("Executing queued animation");setTimeout(function(){w.shape(n)},0)})},reset:function(){t.verbose("Animating states reset");w.removeClass(b.animating).attr("style","").removeAttr("style");g.attr("style","").removeAttr("style");d.attr("style","").removeAttr("style").removeClass(b.hidden);y.removeClass(b.animating).attr("style","").removeAttr("style")},is:{complete:function(){return d.filter("."+b.active)[0]==y[0]},animating:function(){return w.hasClass(b.animating)},hidden:function(){return 0<w.closest(":hidden").length}},set:{defaultSide:function(){p=d.filter("."+v.className.active);y=0<p.next(k.side).length?p.next(k.side):d.first();it=!1;t.verbose("Active side set to",p);t.verbose("Next side set to",y)},duration:function(n){n="number"==typeof(n=n||v.duration)?n+"ms":n;t.verbose("Setting animation duration",n);!v.duration&&0!==v.duration||g.add(d).css({"-webkit-transition-duration":n,"-moz-transition-duration":n,"-ms-transition-duration":n,"-o-transition-duration":n,"transition-duration":n})},currentStageSize:function(){var n=d.filter("."+v.className.active),t=n.outerWidth(!0),i=n.outerHeight(!0);w.css({width:t,height:i})},stageSize:function(){var n=w.clone().addClass(b.loading),i=n.find(">"+k.sides+">"+k.side),r=i.filter("."+v.className.active),u=it?i.eq(it):0<r.next(k.side).length?r.next(k.side):i.first(),f="next"===v.width?u.outerWidth(!0):"initial"===v.width?w.width():v.width,e="next"===v.height?u.outerHeight(!0):"initial"===v.height?w.height():v.height;r.removeClass(b.active);u.addClass(b.active);n.insertAfter(w);n.remove();"auto"!==v.width&&(w.css("width",f+v.jitter),t.verbose("Specifying width during animation",f));"auto"!==v.height&&(w.css("height",e+v.jitter),t.verbose("Specifying height during animation",e))},nextSide:function(n){it=n;y=d.filter(n);it=d.index(y);0===y.length&&(t.set.defaultSide(),t.error(ot.side));t.verbose("Next side manually set to",y)},active:function(){t.verbose("Setting new side to active",y);d.removeClass(b.active);y.addClass(b.active);v.onChange.call(y[0]);t.set.defaultSide()}},flip:{to:function(n,i){if(t.is.hidden())t.debug("Module not visible",y);else if(!t.is.complete()||t.is.animating()||v.allowRepeats){var r=t.get.transform[n]();t.is.animating()?t.queue("flip "+n):(t.debug("Flipping "+n,y),t.set.stageSize(),t.stage[i](),t.animate(r))}else t.debug("Side already visible",y)},up:function(){t.flip.to("up","above")},down:function(){t.flip.to("down","below")},left:function(){t.flip.to("left","left")},right:function(){t.flip.to("right","right")},over:function(){t.flip.to("over","behind")},back:function(){t.flip.to("back","behind")}},get:{transform:{up:function(){var n=p.outerHeight(!0)/2;return{transform:"translateY("+(y.outerHeight(!0)-n)+"px) translateZ(-"+n+"px) rotateX(-90deg)"}},down:function(){var n=p.outerHeight(!0)/2;return{transform:"translateY(-"+n+"px) translateZ(-"+n+"px) rotateX(90deg)"}},left:function(){var n=p.outerWidth(!0)/2;return{transform:"translateX("+(y.outerWidth(!0)-n)+"px) translateZ(-"+n+"px) rotateY(90deg)"}},right:function(){var n=p.outerWidth(!0)/2;return{transform:"translateX(-"+n+"px) translateZ(-"+n+"px) rotateY(-90deg)"}},over:function(){return{transform:"translateX("+-(p.outerWidth(!0)-y.outerWidth(!0))/2+"px) rotateY(180deg)"}},back:function(){return{transform:"translateX("+-(p.outerWidth(!0)-y.outerWidth(!0))/2+"px) rotateY(-180deg)"}}},transitionEvent:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]},nextSide:function(){return 0<p.next(k.side).length?p.next(k.side):d.first()}},stage:{above:function(){var n={origin:(p.outerHeight(!0)-y.outerHeight(!0))/2,depth:{active:y.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as above",y,n);p.css({transform:"rotateX(0deg)"});y.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(90deg) translateZ("+n.depth.next+"px) translateY(-"+n.depth.active+"px)"})},below:function(){var n={origin:(p.outerHeight(!0)-y.outerHeight(!0))/2,depth:{active:y.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as below",y,n);p.css({transform:"rotateX(0deg)"});y.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(-90deg) translateZ("+n.depth.next+"px) translateY("+n.depth.active+"px)"})},left:function(){var i=p.outerWidth(!0),r=y.outerWidth(!0),n={origin:(i-r)/2,depth:{active:r/2,next:i/2}};t.verbose("Setting the initial animation position as left",y,n);p.css({transform:"rotateY(0deg)"});y.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px) translateX(-"+n.depth.active+"px)"})},right:function(){var i=p.outerWidth(!0),r=y.outerWidth(!0),n={origin:(i-r)/2,depth:{active:r/2,next:i/2}};t.verbose("Setting the initial animation position as right",y,n);p.css({transform:"rotateY(0deg)"});y.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px) translateX("+n.depth.active+"px)"})},behind:function(){var n=p.outerWidth(!0),i=y.outerWidth(!0),r={origin:(n-i)/2,depth:{active:i/2,next:n/2}};t.verbose("Setting the initial animation position as behind",y,r);p.css({transform:"rotateY(0deg)"});y.addClass(b.animating).css({left:r.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(i,u){if(t.debug("Changing setting",i,u),n.isPlainObject(i))n.extend(!0,v,i);else{if(u===r)return v[i];n.isPlainObject(v[i])?n.extend(!0,v[i],u):v[i]=u}},internal:function(i,u){if(n.isPlainObject(i))n.extend(!0,t,i);else{if(u===r)return t[i];t[i]=u}},debug:function(){!v.silent&&v.debug&&(v.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,v.name+":"),t.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),t.verbose.apply(console,arguments)))},error:function(){v.silent||(t.error=Function.prototype.bind.call(console.error,console,v.name+":"),t.error.apply(console,arguments))},performance:{log:function(n){var i,r;v.performance&&(r=(i=(new Date).getTime())-(s||i),s=i,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":r}));clearTimeout(t.performance.timer);t.performance.timer=setTimeout(t.performance.display,500)},display:function(){var i=v.name+":",u=0;s=!1;clearTimeout(t.performance.timer);n.each(e,function(n,t){u+=t["Execution Time"]});i+=" "+u+"ms";ft&&(i+=" '"+ft+"'");1<o.length&&(i+=" ("+o.length+")");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(i),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=tt;return i=i||l,u=nt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}},c)?(tt===r&&t.initialize(),ut=w.find("input"),0<ut.length?(ut.blur(),setTimeout(function(){t.invoke(h)},150)):t.invoke(h)):(tt!==r&&tt.invoke("destroy"),t.initialize())}),f!==r?f:this};n.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.sidebar=function(u){var f,l=n(this),s=n(t),h=n(i),a=n("html"),p=n("head"),v=l.selector||"",c=(new Date).getTime(),e=[],y=u,w="string"==typeof y,b=[].slice.call(arguments,1),o=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return l.each(function(){var et,it,lt,yt,ft,l,k=n.isPlainObject(u)?n.extend(!0,{},n.fn.sidebar.settings,u):n.extend({},n.fn.sidebar.settings),rt=k.selector,g=k.className,pt=k.namespace,at=k.regExp,st=k.error,ht="."+pt,vt="module-"+pt,d=n(this),tt=n(k.context),ot=d.children(rt.sidebar),ut=(tt.children(rt.fixed),tt.children(rt.pusher)),nt=this,ct=d.data(vt);l={initialize:function(){l.debug("Initializing sidebar",u);l.create.id();ft=l.get.transitionEvent();k.delaySetup?o(l.setup.layout):l.setup.layout();o(function(){l.setup.cache()});l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);ct=l;d.data(vt,l)},create:{id:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);it="."+lt;l.verbose("Creating unique id for element",lt)}},destroy:function(){l.verbose("Destroying previous module for",d);d.off(ht).removeData(vt);l.is.ios()&&l.remove.ios();tt.off(it);s.off(it);h.off(it)},event:{clickaway:function(n){if(k.closable){var t=0<ut.find(n.target).length||ut.is(n.target),i=tt.is(n.target);t&&(l.verbose("User clicked on dimmed page"),l.hide());i&&(l.verbose("User clicked on dimmable context (scaled out page)"),l.hide())}},touch:function(){},containScroll:function(){nt.scrollTop<=0&&(nt.scrollTop=1);nt.scrollTop+nt.offsetHeight>=nt.scrollHeight&&(nt.scrollTop=nt.scrollHeight-nt.offsetHeight-1)},scroll:function(t){0===n(t.target).closest(rt.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){l.verbose("Adding clickaway events to context",tt);tt.on("click"+it,l.event.clickaway).on("touchend"+it,l.event.clickaway)},scrollLock:function(){k.scrollLock&&(l.debug("Disabling page scroll"),s.on("DOMMouseScroll"+it,l.event.scroll));l.verbose("Adding events to contain sidebar scroll");h.on("touchmove"+it,l.event.touch);d.on("scroll"+ht,l.event.containScroll)}},unbind:{clickaway:function(){l.verbose("Removing clickaway events from context",tt);tt.off(it)},scrollLock:function(){l.verbose("Removing scroll lock from page");h.off(it);s.off(it);d.off("scroll"+ht)}},add:{inlineCSS:function(){var r,u=l.cache.width||d.outerWidth(),f=l.cache.height||d.outerHeight(),e=l.is.rtl(),t=l.get.direction(),i={left:u,right:-u,top:f,bottom:-f};e&&(l.verbose("RTL detected, flipping widths"),i.left=-u,i.right=u);r="<style>";"left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }");l.is.ie()&&("left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }"),r+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, 0, 0);           transform: translate3d(0, 0, 0); }");et=n(r+="<\/style>").appendTo(p);l.debug("Adding sizing css to head",et)}},refresh:function(){l.verbose("Refreshing selector cache");tt=n(k.context);ot=tt.children(rt.sidebar);ut=tt.children(rt.pusher);tt.children(rt.fixed);l.clear.cache()},refreshSidebars:function(){l.verbose("Refreshing other sidebars");ot=tt.children(rt.sidebar)},repaint:function(){l.verbose("Forcing repaint event");nt.style.display="none";nt.offsetHeight;nt.scrollTop=nt.scrollTop;nt.style.display=""},setup:{cache:function(){l.cache={width:d.outerWidth(),height:d.outerHeight(),rtl:"rtl"==d.css("direction")}},layout:function(){0===tt.children(rt.pusher).length&&(l.debug("Adding wrapper element for sidebar"),l.error(st.pusher),ut=n('<div class="pusher" />'),tt.children().not(rt.omitted).not(ot).wrapAll(ut),l.refresh());0!==d.nextAll(rt.pusher).length&&d.nextAll(rt.pusher)[0]===ut[0]||(l.debug("Moved sidebar to correct parent element"),l.error(st.movedSidebar,nt),d.detach().prependTo(tt),l.refresh());l.clear.cache();l.set.pushable();l.set.direction()}},attachEvents:function(t,i){var r=n(t);i=n.isFunction(l[i])?l[i]:l.toggle;0<r.length?(l.debug("Attaching sidebar events to element",t,i),r.on("click"+ht,i)):l.error(st.notFound,t)},show:function(t){if(t=n.isFunction(t)?t:function(){},l.is.hidden()){if(l.refreshSidebars(),k.overlay&&(l.error(st.overlay),k.transition="overlay"),l.refresh(),l.othersActive())if(l.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void l.hideOthers(l.show);l.hideOthers()}else k.transition="overlay";l.pushPage(function(){t.call(nt);k.onShow.call(nt)});k.onChange.call(nt);k.onVisible.call(nt)}else l.debug("Sidebar is already visible")},hide:function(t){t=n.isFunction(t)?t:function(){};(l.is.visible()||l.is.animating())&&(l.debug("Hiding sidebar",t),l.refreshSidebars(),l.pullPage(function(){t.call(nt);k.onHidden.call(nt)}),k.onChange.call(nt),k.onHide.call(nt))},othersAnimating:function(){return 0<ot.not(d).filter("."+g.animating).length},othersVisible:function(){return 0<ot.not(d).filter("."+g.visible).length},othersActive:function(){return l.othersVisible()||l.othersAnimating()},hideOthers:function(n){var t=ot.not(d).filter("."+g.visible),i=t.length,r=0;n=n||function(){};t.sidebar("hide",function(){++r==i&&n()})},toggle:function(){l.verbose("Determining toggled direction");l.is.hidden()?l.show():l.hide()},pushPage:function(t){var u,f,r,e=l.get.transition(),i="overlay"===e||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};"scale down"==k.transition&&l.scrollToTop();l.set.transition(e);l.repaint();u=function(){l.bind.clickaway();l.add.inlineCSS();l.set.animating();l.set.visible()};f=function(){l.set.dimmed()};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.bind.scrollLock(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(u);k.dimPage&&!l.othersVisible()&&o(f)},pullPage:function(t){var f,r,u=l.get.transition(),i="overlay"==u||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};l.verbose("Removing context push state",l.get.direction());l.unbind.clickaway();l.unbind.scrollLock();f=function(){l.set.transition(u);l.set.animating();l.remove.visible();k.dimPage&&!l.othersVisible()&&ut.removeClass(g.dimmed)};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.remove.transition(),l.remove.inlineCSS(),("scale down"==u||k.returnScroll&&l.is.mobile())&&l.scrollBack(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(f)},scrollToTop:function(){l.verbose("Scrolling to top of page to avoid animation issues");yt=n(t).scrollTop();d.scrollTop(0);t.scrollTo(0,0)},scrollBack:function(){l.verbose("Scrolling back to original page position");t.scrollTo(0,yt)},clear:{cache:function(){l.verbose("Clearing cached dimensions");l.cache={}}},set:{ios:function(){a.addClass(g.ios)},pushed:function(){tt.addClass(g.pushed)},pushable:function(){tt.addClass(g.pushable)},dimmed:function(){ut.addClass(g.dimmed)},active:function(){d.addClass(g.active)},animating:function(){d.addClass(g.animating)},transition:function(n){n=n||l.get.transition();d.addClass(n)},direction:function(n){n=n||l.get.direction();d.addClass(g[n])},visible:function(){d.addClass(g.visible)},overlay:function(){d.addClass(g.overlay)}},remove:{inlineCSS:function(){l.debug("Removing inline css styles",et);et&&0<et.length&&et.remove()},ios:function(){a.removeClass(g.ios)},pushed:function(){tt.removeClass(g.pushed)},pushable:function(){tt.removeClass(g.pushable)},active:function(){d.removeClass(g.active)},animating:function(){d.removeClass(g.animating)},transition:function(n){n=n||l.get.transition();d.removeClass(n)},direction:function(n){n=n||l.get.direction();d.removeClass(g[n])},visible:function(){d.removeClass(g.visible)},overlay:function(){d.removeClass(g.overlay)}},get:{direction:function(){return d.hasClass(g.top)?g.top:d.hasClass(g.right)?g.right:d.hasClass(g.bottom)?g.bottom:g.left},transition:function(){var n,t=l.get.direction();return n=l.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,l.verbose("Determined transition",n),n},transitionEvent:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]}},is:{ie:function(){return!t.ActiveXObject&&"ActiveXObject"in t||"ActiveXObject"in t},ios:function(){var n=navigator.userAgent,t=n.match(at.ios),i=n.match(at.mobileChrome);return!(!t||i)&&(l.verbose("Browser was found to be iOS",n),!0)},mobile:function(){var n=navigator.userAgent;return n.match(at.mobile)?(l.verbose("Browser was found to be mobile",n),!0):(l.verbose("Browser is not mobile, using regular transition",n),!1)},hidden:function(){return!l.is.visible()},visible:function(){return d.hasClass(g.visible)},open:function(){return l.is.visible()},closed:function(){return l.is.hidden()},vertical:function(){return d.hasClass(g.top)},animating:function(){return tt.hasClass(g.animating)},rtl:function(){return l.cache.rtl===r&&(l.cache.rtl="rtl"==d.css("direction")),l.cache.rtl}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,k,t);else{if(i===r)return k[t];n.isPlainObject(k[t])?n.extend(!0,k[t],i):k[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!k.silent&&k.debug&&(k.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,k.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),l.verbose.apply(console,arguments)))},error:function(){k.silent||(l.error=Function.prototype.bind.call(console.error,console,k.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;k.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=k.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";v&&(t+=" '"+v+"'");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ct;return i=i||b,u=nt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:l.error(st.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};w?(ct===r&&l.initialize(),l.invoke(y)):(ct!==r&&l.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.sticky=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=u,l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var k,tt,it,g,s,v=n.isPlainObject(u)?n.extend(!0,{},n.fn.sticky.settings,u):n.extend({},n.fn.sticky.settings),p=v.className,et=v.namespace,rt=v.error,d="."+et,ut="module-"+et,y=n(this),ot=n(t),b=n(v.scrollContext),nt=y.data(ut),ft=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},w=this;s={initialize:function(){s.determineContainer();s.determineContext();s.verbose("Initializing sticky",v,k);s.save.positions();s.checkErrors();s.bind.events();v.observeChanges&&s.observeChanges();s.instantiate()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;y.data(ut,s)},destroy:function(){s.verbose("Destroying previous instance");s.reset();it&&it.disconnect();g&&g.disconnect();ot.off("load"+d,s.event.load).off("resize"+d,s.event.resize);b.off("scrollchange"+d,s.event.scrollchange);y.removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(s.event.documentChanged),g=new MutationObserver(s.event.changed),it.observe(i,{childList:!0,subtree:!0}),g.observe(w,{childList:!0,subtree:!0}),g.observe(tt[0],{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",g))},determineContainer:function(){k=v.container?n(v.container):y.offsetParent()},determineContext:function(){0!==(tt=v.context?n(v.context):k).length||s.error(rt.invalidContext,v.context,y)},checkErrors:function(){if(s.is.hidden()&&s.error(rt.visible,y),s.cache.element.height>s.cache.context.height)return s.reset(),void s.error(rt.elementSize,y)},bind:{events:function(){ot.on("load"+d,s.event.load).on("resize"+d,s.event.resize);b.off("scroll"+d).on("scroll"+d,s.event.scroll).on("scrollchange"+d,s.event.scrollchange)}},event:{changed:function(n){clearTimeout(s.timer);s.timer=setTimeout(function(){s.verbose("DOM tree modified, updating sticky menu",n);s.refresh()},100)},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==w||0<n(t).find(w).length)&&(s.debug("Element removed from DOM, tearing down events"),s.destroy())})})},load:function(){s.verbose("Page contents finished loading");ft(s.refresh)},resize:function(){s.verbose("Window resized");ft(s.refresh)},scroll:function(){ft(function(){b.triggerHandler("scrollchange"+d,b.scrollTop())})},scrollchange:function(n,t){s.stick(t);v.onScroll.call(w)}},refresh:function(n){s.reset();v.context||s.determineContext();n&&s.determineContainer();s.save.positions();s.stick();v.onReposition.call(w)},supports:{sticky:function(){var t=n("<div/>");return t.addClass(p.supported),t.css("position").match("sticky")}},save:{lastScroll:function(n){s.lastScroll=n},elementScroll:function(n){s.elementScroll=n},positions:function(){var t={height:b.height()},n={margin:{top:parseInt(y.css("margin-top"),10),bottom:parseInt(y.css("margin-bottom"),10)},offset:y.offset(),width:y.outerWidth(),height:y.outerHeight()},i={offset:tt.offset(),height:tt.outerHeight()};s.is.standardScroll()||(s.debug("Non-standard scroll. Removing scroll offset from element offset"),t.top=b.scrollTop(),t.left=b.scrollLeft(),n.offset.top+=t.top,i.offset.top+=t.top,n.offset.left+=t.left,i.offset.left+=t.left);s.cache={fits:n.height+v.offset<=t.height,sameHeight:n.height==i.height,scrollContext:{height:t.height},element:{margin:n.margin,top:n.offset.top-n.margin.top,left:n.offset.left,width:n.width,height:n.height,bottom:n.offset.top+n.height},context:{top:i.offset.top,height:i.height,bottom:i.offset.top+i.height}};s.set.containerSize();s.stick();s.debug("Caching element positions",s.cache)}},get:{direction:function(n){var t="down";return n=n||b.scrollTop(),s.lastScroll!==r&&(s.lastScroll<n?t="down":s.lastScroll>n&&(t="up")),t},scrollChange:function(n){return n=n||b.scrollTop(),s.lastScroll?n-s.lastScroll:0},currentElementScroll:function(){return s.elementScroll?s.elementScroll:s.is.top()?Math.abs(parseInt(y.css("top"),10))||0:Math.abs(parseInt(y.css("bottom"),10))||0},elementScroll:function(n){n=n||b.scrollTop();var r=s.cache.element,u=s.cache.scrollContext,f=s.get.scrollChange(n),i=r.height-u.height+v.offset,e=s.get.currentElementScroll(),t=e+f;return s.cache.fits||t<0?0:i<t?i:t}},remove:{lastScroll:function(){delete s.lastScroll},elementScroll:function(){delete s.elementScroll},minimumSize:function(){k.css("min-height","")},offset:function(){y.css("margin-top","")}},set:{offset:function(){s.verbose("Setting offset on element",v.offset);y.css("margin-top",v.offset)},containerSize:function(){var n=k.get(0).tagName;"HTML"===n||"body"==n?s.determineContainer():Math.abs(k.outerHeight()-s.cache.context.height)>v.jitter&&(s.debug("Context has padding, specifying exact height for container",s.cache.context.height),k.css({height:s.cache.context.height}))},minimumSize:function(){var n=s.cache.element;k.css("min-height",n.height)},scroll:function(n){s.debug("Setting scroll on element",n);s.elementScroll!=n&&(s.is.top()&&y.css("bottom","").css("top",-n),s.is.bottom()&&y.css("top","").css("bottom",n))},size:function(){0!==s.cache.element.height&&0!==s.cache.element.width&&(w.style.setProperty("width",s.cache.element.width+"px","important"),w.style.setProperty("height",s.cache.element.height+"px","important"))}},is:{standardScroll:function(){return b[0]==t},top:function(){return y.hasClass(p.top)},bottom:function(){return y.hasClass(p.bottom)},initialPosition:function(){return!s.is.fixed()&&!s.is.bound()},hidden:function(){return!y.is(":visible")},bound:function(){return y.hasClass(p.bound)},fixed:function(){return y.hasClass(p.fixed)}},stick:function(n){var f=n||b.scrollTop(),u=s.cache,e=u.fits,c=u.sameHeight,t=u.element,l=u.scrollContext,i=u.context,o=s.is.bottom()&&v.pushing?v.bottomOffset:v.offset,r=(n={top:f+o,bottom:f+o+l.height},e?0:s.get.elementScroll(n.top)),h=!e;0===t.height||c||(s.is.initialPosition()?n.top>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):n.top>t.top&&(t.height+n.top-r>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):(s.debug("Initial element position is fixed"),s.fixTop())):s.is.fixed()?s.is.top()?n.top<=t.top?(s.debug("Fixed element reached top of container"),s.setInitialPosition()):t.height+n.top-r>=i.bottom?(s.debug("Fixed element reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r)):s.is.bottom()&&(n.bottom-t.height<=t.top?(s.debug("Bottom fixed rail has reached top of container"),s.setInitialPosition()):n.bottom>=i.bottom?(s.debug("Bottom fixed rail has reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r))):s.is.bottom()&&(n.top<=t.top?(s.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),s.setInitialPosition()):v.pushing?s.is.bound()&&n.bottom<=i.bottom&&(s.debug("Fixing bottom attached element to bottom of browser."),s.fixBottom()):s.is.bound()&&n.top<=i.bottom-t.height&&(s.debug("Fixing bottom attached element to top of browser."),s.fixTop())))},bindTop:function(){s.debug("Binding element to top of parent container");s.remove.offset();y.css({left:"",top:"",marginBottom:""}).removeClass(p.fixed).removeClass(p.bottom).addClass(p.bound).addClass(p.top);v.onTop.call(w);v.onUnstick.call(w)},bindBottom:function(){s.debug("Binding element to bottom of parent container");s.remove.offset();y.css({left:"",top:""}).removeClass(p.fixed).removeClass(p.top).addClass(p.bound).addClass(p.bottom);v.onBottom.call(w);v.onUnstick.call(w)},setInitialPosition:function(){s.debug("Returning to initial position");s.unfix();s.unbind()},fixTop:function(){s.debug("Fixing element to top of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.bottom).addClass(p.fixed).addClass(p.top);v.onStick.call(w)},fixBottom:function(){s.debug("Sticking element to bottom of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.top).addClass(p.fixed).addClass(p.bottom);v.onStick.call(w)},unbind:function(){s.is.bound()&&(s.debug("Removing container bound position on element"),s.remove.offset(),y.removeClass(p.bound).removeClass(p.top).removeClass(p.bottom))},unfix:function(){s.is.fixed()&&(s.debug("Removing fixed position on element"),s.remove.minimumSize(),s.remove.offset(),y.removeClass(p.fixed).removeClass(p.top).removeClass(p.bottom),v.onUnstick.call(w))},reset:function(){s.debug("Resetting elements position");s.unbind();s.unfix();s.resetCSS();s.remove.offset();s.remove.lastScroll()},resetCSS:function(){y.css({width:"",height:""});k.css({height:""})},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else{if(i===r)return s[t];s[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,0)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=nt;return i=i||a,u=w||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isWindow=n.isWindow||function(n){return null!=n&&n===n.window};n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.tab=function(u){var f,e=n.isFunction(this)?n(t):n(this),h=e.selector||"",s=(new Date).getTime(),o=[],c=u,a="string"==typeof c,v=[].slice.call(arguments,1),l=!1;return e.each(function(){var g,b,k,nt,y,tt,p=n.isPlainObject(u)?n.extend(!0,{},n.fn.tab.settings,u):n.extend({},n.fn.tab.settings),w=p.className,it=p.metadata,ft=p.selector,rt=p.error,at=p.regExp,ct="."+p.namespace,et="module-"+p.namespace,d=n(this),ot={},lt=!0,st=0,ht=this,ut=d.data(et);y={initialize:function(){y.debug("Initializing tab menu item",d);y.fix.callbacks();y.determineTabs();y.debug("Determining tabs",p.context,b);p.auto&&y.set.auto();y.bind.events();p.history&&!l&&(y.initializeHistory(),l=!0);y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y);ut=y;d.data(et,y)},destroy:function(){y.debug("Destroying tabs",d);d.removeData(et).off(ct)},bind:{events:function(){n.isWindow(ht)||(y.debug("Attaching tab activation events to element",d),d.on("click"+ct,y.event.click))}},determineTabs:function(){var t;"parent"===p.context?(0<d.closest(ft.ui).length?(t=d.closest(ft.ui),y.verbose("Using closest UI element as parent",t)):t=d,g=t.parent(),y.verbose("Determined parent element for creating context",g)):p.context?(g=n(p.context),y.verbose("Using selector for tab context",p.context,g)):g=n("body");p.childrenOnly?(b=g.children(ft.tabs),y.debug("Searching tab context children for tabs",g,b)):(b=g.find(ft.tabs),y.debug("Searching tab context for tabs",g,b))},fix:{callbacks:function(){n.isPlainObject(u)&&(u.onTabLoad||u.onTabInit)&&(u.onTabLoad&&(u.onLoad=u.onTabLoad,delete u.onTabLoad,y.error(rt.legacyLoad,u.onLoad)),u.onTabInit&&(u.onFirstLoad=u.onTabInit,delete u.onTabInit,y.error(rt.legacyInit,u.onFirstLoad)),p=n.extend(!0,{},n.fn.tab.settings,u))}},initializeHistory:function(){if(y.debug("Initializing page state"),n.address===r)return y.error(rt.state),!1;if("state"==p.historyType){if(y.debug("Using HTML5 to manage state"),!1===p.path)return y.error(rt.path),!1;n.address.history(!0).state(p.path)}n.address.bind("change",y.event.history.change)},event:{click:function(t){var i=n(this).data(it.tab);i!==r?(p.history?(y.verbose("Updating page state",t),n.address.value(i)):(y.verbose("Changing tab",t),y.changeTab(i)),t.preventDefault()):y.debug("No tab specified")},history:{change:function(t){var i=t.pathNames.join("/")||y.get.initialPath(),u=p.templates.determineTitle(i)||!1;y.performance.display();y.debug("History change event",i,t);tt=t;i!==r&&y.changeTab(i);u&&n.address.title(u)}}},refresh:function(){k&&(y.debug("Refreshing tab",k),y.changeTab(k))},cache:{read:function(n){return n!==r&&ot[n]},add:function(n,t){n=n||k;y.debug("Adding cached content for",n);ot[n]=t},remove:function(n){n=n||k;y.debug("Removing cached content for",n);delete ot[n]}},escape:{string:function(n){return(n=String(n)).replace(at.escape,"\\$&")}},set:{auto:function(){var t="string"==typeof p.path?p.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";y.verbose("Setting up automatic tab retrieval from server",t);n.isPlainObject(p.apiSettings)?p.apiSettings.url=t:p.apiSettings={url:t}},loading:function(n){var t=y.get.tabElement(n);t.hasClass(w.loading)||(y.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(b).removeClass(w.active+" "+w.loading),0<t.length&&p.onRequest.call(t[0],n))},state:function(t){n.address.value(t)}},changeTab:function(i){var u=t.history&&t.history.pushState&&p.ignoreFirstLoad&&lt,f=p.auto||n.isPlainObject(p.apiSettings),r=f&&!u?y.utilities.pathToArray(i):y.get.defaultPathArray(i);i=y.utilities.arrayToPath(r);n.each(r,function(t,e){var h,c,a,l,v=r.slice(0,t+1),o=y.utilities.arrayToPath(v),b=y.is.tab(o),ut=t+1==r.length,s=y.get.tabElement(o);if(y.verbose("Looking for tab",e),b){if(y.verbose("Tab was found",e),k=o,nt=y.utilities.filterArray(r,v),ut?l=!0:(c=r.slice(0,t+2),a=y.utilities.arrayToPath(c),(l=!y.is.tab(a))&&y.verbose("Tab parameters found",c)),l&&f)return u?(y.debug("Ignoring remote content on first tab load",o),lt=!1,y.cache.add(i,s.html()),y.activate.all(o),p.onFirstLoad.call(s[0],o,nt,tt),p.onLoad.call(s[0],o,nt,tt)):(y.activate.navigation(o),y.fetch.content(o,i)),!1;y.debug("Opened local tab",o);y.activate.all(o);y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt));p.onLoad.call(s[0],o,nt,tt)}else{if(-1!=i.search("/")||""===i)return y.error(rt.missingTab,d,g,o),!1;if(i=y.escape.string(i),o=(h=n("#"+i+', a[name="'+i+'"]')).closest("[data-tab]").data(it.tab),s=y.get.tabElement(o),h&&0<h.length&&o)return y.debug("Anchor link used, opening parent tab",s,h),s.hasClass(w.active)||setTimeout(function(){y.scrollTo(h)},0),y.activate.all(o),y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt)),p.onLoad.call(s[0],o,nt,tt),!1}})},scrollTo:function(t){var r=!!(t&&0<t.length)&&t.offset().top;!1!==r&&(y.debug("Forcing scroll to an in-page link in a hidden tab",r,t),n(i).scrollTop(r))},update:{content:function(t,i,u){var f=y.get.tabElement(t),e=f[0];u=u!==r?u:p.evaluateScripts;"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&"string"!=typeof i?f.empty().append(n(i).clone(!0)):u?(y.debug("Updating HTML and evaluating inline scripts",t,i),f.html(i)):(y.debug("Updating HTML",t,i),e.innerHTML=i)}},fetch:{content:function(t,i){var e,f,u=y.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:p.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(n){"response"==p.cacheType&&y.cache.add(i,n);y.update.content(t,n);t==k?(y.debug("Content loaded",t),y.activate.tab(t)):y.debug("Content loaded in background",t);p.onFirstLoad.call(u[0],t,nt,tt);p.onLoad.call(u[0],t,nt,tt);p.loadOnce?y.cache.add(i,!0):"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&0<u.children().length?setTimeout(function(){var n=u.children().clone(!0);n=n.not("script");y.cache.add(i,n)},0):y.cache.add(i,u.html())},urlData:{tab:i}},o=u.api("get request")||!1,h=o&&"pending"===o.state();i=i||t;f=y.cache.read(i);p.cache&&f?(y.activate.tab(t),y.debug("Adding cached content",i),p.loadOnce||("once"==p.evaluateScripts?y.update.content(t,f,!1):y.update.content(t,f)),p.onLoad.call(u[0],t,nt,tt)):h?(y.set.loading(t),y.debug("Content is already loading",i)):n.api!==r?(e=n.extend(!0,{},p.apiSettings,s),y.debug("Retrieving remote content",i,e),y.set.loading(t),u.api(e)):y.error(rt.api)}},activate:{all:function(n){y.activate.tab(n);y.activate.navigation(n)},tab:function(n){var t=y.get.tabElement(n),i="siblings"==p.deactivate?t.siblings(b):b.not(t),r=t.hasClass(w.active);y.verbose("Showing tab content for",t);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading),0<t.length&&p.onVisible.call(t[0],n))},navigation:function(n){var t=y.get.navElement(n),i="siblings"==p.deactivate?t.siblings(e):e.not(t),r=t.hasClass(w.active);y.verbose("Activating tab navigation for",t,n);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading))}},deactivate:{all:function(){y.deactivate.navigation();y.deactivate.tabs()},navigation:function(){e.removeClass(w.active)},tabs:function(){b.removeClass(w.active+" "+w.loading)}},is:{tab:function(n){return n!==r&&0<y.get.tabElement(n).length}},get:{initialPath:function(){return e.eq(0).data(it.tab)||b.eq(0).data(it.tab)},path:function(){return n.address.value()},defaultPathArray:function(n){return y.utilities.pathToArray(y.get.defaultPath(n))},defaultPath:function(n){var t=e.filter("[data-"+it.tab+'^="'+y.escape.string(n)+'/"]').eq(0).data(it.tab)||!1;if(t){if(y.debug("Found default tab",t),st<p.maxDepth)return st++,y.get.defaultPath(t);y.error(rt.recursion)}else y.debug("No default tabs found for",n,b);return st=0,n},navElement:function(n){return n=n||k,e.filter("[data-"+it.tab+'="'+y.escape.string(n)+'"]')},tabElement:function(n){var t,i,r,u;return n=n||k,r=y.utilities.pathToArray(n),u=y.utilities.last(r),t=b.filter("[data-"+it.tab+'="'+y.escape.string(n)+'"]'),i=b.filter("[data-"+it.tab+'="'+y.escape.string(u)+'"]'),0<t.length?t:i},tab:function(){return k}},utilities:{filterArray:function(t,i){return n.grep(t,function(t){return-1==n.inArray(t,i)})},last:function(n){return!!Array.isArray(n)&&n[n.length-1]},pathToArray:function(n){return n===r&&(n=k),"string"==typeof n?n.split("/"):[n]},arrayToPath:function(n){return!!Array.isArray(n)&&n.join("/")}},setting:function(t,i){if(y.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];n.isPlainObject(p[t])?n.extend(!0,p[t],i):p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ht,"Execution Time":i}));clearTimeout(y.performance.timer);y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(y.performance.timer);n.each(o,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&0<o.length&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());o=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||v,u=ht||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:y.error(rt.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),Array.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};a?(ut===r&&y.initialize(),y.invoke(c)):(ut!==r&&ut.invoke("destroy"),y.initialize())}),f!==r?f:this};n.tab=function(){n(t).tab.apply(this,arguments)};n.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(){},onLoad:function(){},onVisible:function(){},onRequest:function(){},templates:{determineTitle:function(){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.toast=function(t){var i,e=n(this),o=e.selector||"",f=(new Date).getTime(),u=[],s=t,h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var l,e=n.isPlainObject(t)?n.extend(!0,{},n.fn.toast.settings,t):n.extend({},n.fn.toast.settings),y=e.className,tt=e.selector,k=e.error,it=e.namespace,rt="."+it,ft=it+"-module",d=n(this),ut=n("<div/>",{"class":e.className.box}),a=n("<div/>"),p=n("<div/>",{"class":e.className.progress+" "+e.class}),w=n("<div/>",{"class":"bar"}),g=n("<i/>",{"class":"close icon"}),nt=e.context?n(e.context):n("body"),v=this,b=d.data(ft);l={initialize:function(){l.verbose("Initializing element");"string"==typeof e.showProgress&&-1!==["top","bottom"].indexOf(e.showProgress)||(e.showProgress=!1);l.has.container()||l.create.container();l.create.toast();l.bind.events();0<e.displayTime&&(l.closeTimer=setTimeout(l.close,e.displayTime+(e.showProgress?300:0)));l.show()},destroy:function(){l.debug("Removing toast",a);a.remove();a=r;e.onRemove.call(a,v)},show:function(n){n=n||function(){};l.debug("Showing toast");!1!==e.onShow.call(a,v)?l.animate.show(n):l.debug("onShow callback returned false, cancelling toast animation")},close:function(n){l.closeTimer&&clearTimeout(l.closeTimer);n=n||function(){};l.remove.visible();l.unbind.events();l.animate.close(n)},create:{container:function(){l.verbose("Creating container");nt.append('<div class="ui '+e.position+" "+y.container+'"><\/div>')},toast:function(){var t=n("<div/>").addClass(y.content),i,r,u;l.verbose("Creating toast");e.closeIcon&&(a.append(g),a.css("cursor","default"));i="string"==typeof e.showIcon?e.showIcon:e.showIcon&&e.icons[e.class]?e.icons[e.class]:"";""!=i&&(r=n("<i/>").addClass(i+" "+y.icon),a.addClass(y.icon).append(r));""!==e.title&&(u=n("<div/>").addClass(y.title).text(e.title),t.append(u));t.append(n("<div/>").html(e.message));a.addClass(e.class+" "+y.toast).append(t);a.css("opacity",e.opacity);(e.compact||a.hasClass("compact"))&&ut.addClass("compact");a.hasClass("toast")&&!a.hasClass("inverted")?p.addClass("inverted"):p.removeClass("inverted");a=ut.append(a);e.showProgress&&0<e.displayTime&&(p.addClass(e.showProgress).append(w),p.hasClass("top")?a.prepend(p):a.append(p),w.css("transition","width "+e.displayTime/1e3+"s linear"),w.width(e.progressUp?"0%":"100%"),setTimeout(function(){void 0!==p&&w.width(e.progressUp?"100%":"0%")},300));e.newestOnTop?a.prependTo(l.get.container()):a.appendTo(l.get.container())}},bind:{events:function(){l.debug("Binding events to toast");(e.closeIcon?g:a).on("click"+rt,l.event.click)}},unbind:{events:function(){l.debug("Unbinding events to toast");(e.closeIcon?g:a).off("click"+rt)}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};e.transition&&n.fn.transition!==r&&d.transition("is supported")?(l.set.visible(),a.transition({animation:e.transition.showMethod+" in",queue:!1,debug:e.debug,verbose:e.verbose,duration:e.transition.showDuration,onComplete:function(){t.call(a,v);e.onVisible.call(a,v)}})):l.error(k.noTransition)},close:function(t){t=n.isFunction(t)?t:function(){};l.debug("Closing toast");!1!==e.onHide.call(a,v)?e.transition&&n.fn.transition!==r&&d.transition("is supported")?a.transition({animation:e.transition.hideMethod+" out",queue:!1,duration:e.transition.hideDuration,debug:e.debug,verbose:e.verbose,onBeforeHide:function(t){t=n.isFunction(t)?t:function(){};""!==e.transition.closeEasing?(a.css("opacity",0),a.wrap("<div/>").parent().slideUp(500,e.transition.closeEasing,function(){a.parent().remove();t.call(a)})):t.call(a)},onComplete:function(){l.destroy();t.call(a,v);e.onHidden.call(a,v)}}):l.error(k.noTransition):l.debug("onHide callback returned false, cancelling toast animation")}},has:{container:function(){return l.verbose("Determining if there is already a container"),0<nt.find(l.helpers.toClass(e.position)+tt.container).length}},get:{container:function(){return nt.find(l.helpers.toClass(e.position)+tt.container)[0]}},set:{visible:function(){a.addClass(y.visible)}},remove:{visible:function(){a.removeClass(y.visible)}},event:{click:function(){e.onClick.call(a,v);l.close()}},helpers:{toClass:function(n){var i=n.split(" "),t="";return i.forEach(function(n){t+="."+n}),t}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,e,t);else{if(i===r)return e[t];n.isPlainObject(e[t])?n.extend(!0,e[t],i):e[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!e.silent&&e.debug&&(e.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,e.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!e.silent&&e.verbose&&e.debug&&(e.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,e.name+":"),l.verbose.apply(console,arguments)))},error:function(){e.silent||(l.error=Function.prototype.bind.call(console.error,console,e.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;e.performance&&(i=(t=(new Date).getTime())-(f||t),f=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:v,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=e.name+":",i=0;f=!1;clearTimeout(l.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");(console.group!==r||console.table!==r)&&0<u.length&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(t,u,f){var h,o,s,e=b;return u=u||c,f=v||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:l.error(k.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),Array.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(b===r&&l.initialize(),l.invoke(s)):(b!==r&&b.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right","class":"info",title:"",message:"",displayTime:3e3,showIcon:!0,newestOnTop:!1,showProgress:!1,progressUp:!0,opacity:1,compact:!0,closeIcon:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutBounce"},error:{method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>"},className:{container:"toast-container",box:"toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"icon",visible:"visible",content:"content",title:"header"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".toast-container",box:".toast-box",toast:".ui.toast"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){}};n.extend(n.easing,{easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.transition=function(){var t,f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=arguments,h=s[0],l=[].slice.call(arguments,1),c="string"==typeof h;return f.each(function(a){var y,d,it,w,nt,k,tt,g,v,p=n(this),b=this;(v={initialize:function(){y=v.get.settings.apply(b,s);w=y.className;it=y.error;nt=y.metadata;g="."+y.namespace;tt="module-"+y.namespace;d=p.data(tt)||v;k=v.get.animationEndEvent();!1===(c=c&&v.invoke(h))&&(v.verbose("Converted arguments into settings object",y),y.interval?v.delay(y.animate):v.animate(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);d=v;p.data(tt,d)},destroy:function(){v.verbose("Destroying previous module for",b);p.removeData(tt)},refresh:function(){v.verbose("Refreshing display type on next animation");delete v.displayType},forceRepaint:function(){v.verbose("Forcing element repaint");var t=p.parent(),n=p.next();0===n.length?p.detach().appendTo(t):p.detach().insertBefore(n)},repaint:function(){v.verbose("Repainting element");b.offsetWidth},delay:function(n){var t,i=v.get.animationDirection();i=i||(v.can.transition()?v.get.direction():"static");n=n!==r?n:y.interval;t="auto"==y.reverse&&i==w.outward||1==y.reverse?(f.length-a)*y.interval:a*y.interval;v.debug("Delaying animation by",t);setTimeout(v.animate,t)},animate:function(n){if(y=n||y,!v.is.supported())return v.error(it.support),!1;if(v.debug("Preparing animation",y.animation),v.is.animating()){if(y.queue)return!y.allowRepeats&&v.has.direction()&&v.is.occurring()&&!0!==v.queuing?v.debug("Animation is currently occurring, preventing queueing same animation",y.animation):v.queue(y.animation),!1;if(!y.allowRepeats&&v.is.occurring())return v.debug("Animation is already occurring, will not execute repeated animation",y.animation),!1;v.debug("New animation started, completing previous early",y.animation);d.complete()}v.can.animate()?v.set.animating(y.animation):v.error(it.noAnimation,y.animation,b)},reset:function(){v.debug("Resetting animation to beginning conditions");v.remove.animationCallbacks();v.restore.conditions();v.remove.animating()},queue:function(n){v.debug("Queueing animation of",n);v.queuing=!0;p.one(k+".queue"+g,function(){v.queuing=!1;v.repaint();v.animate.apply(this,y)})},complete:function(n){n&&n.target===b&&n.stopPropagation();v.debug("Animation complete",y.animation);v.remove.completeCallback();v.remove.failSafe();v.is.looping()||(v.is.outward()?(v.verbose("Animation is outward, hiding element"),v.restore.conditions(),v.hide()):v.is.inward()?(v.verbose("Animation is outward, showing element"),v.restore.conditions(),v.show()):(v.verbose("Static animation completed"),v.restore.conditions(),y.onComplete.call(b)))},force:{visible:function(){var t=p.attr("style"),i=v.get.userStyle(t),n=v.get.displayType(),r=i+"display: "+n+" !important;",u=p[0].style.display;return!n||"none"===u&&y.skipInlineHidden||p[0].tagName.match(/(script|link|style)/i)?(v.remove.transition(),!1):(v.verbose("Overriding default display to show element",n),p.attr("style",r),!0)},hidden:function(){var n=p.attr("style"),t=p.css("display"),i=n===r||""===n;"none"===t||v.is.hidden()?i&&p.removeAttr("style"):(v.verbose("Overriding default display to hide element"),p.css("display","none"))}},has:{direction:function(t){var i=!1;return"string"==typeof(t=t||y.animation)&&(t=t.split(" "),n.each(t,function(n,t){t!==w.inward&&t!==w.outward||(i=!0)})),i},inlineDisplay:function(){var n=p.attr("style")||"";return Array.isArray(n.match(/display.*?;/,""))}},set:{animating:function(n){v.remove.completeCallback();n=n||y.animation;var t=v.get.animationClass(n);v.save.animation(t);v.force.visible()&&(v.remove.hidden(),v.remove.direction(),v.start.animation(t))},duration:function(n,t){((t="number"==typeof(t=t||y.duration)?t+"ms":t)||0===t)&&(v.verbose("Setting animation duration",t),p.css({"animation-duration":t}))},direction:function(n){(n=n||v.get.direction())==w.inward?v.set.inward():v.set.outward()},looping:function(){v.debug("Transition set to loop");p.addClass(w.looping)},hidden:function(){p.addClass(w.transition).addClass(w.hidden)},inward:function(){v.debug("Setting direction to inward");p.removeClass(w.outward).addClass(w.inward)},outward:function(){v.debug("Setting direction to outward");p.removeClass(w.inward).addClass(w.outward)},visible:function(){p.addClass(w.transition).addClass(w.visible)}},start:{animation:function(n){n=n||v.get.animationClass();v.debug("Starting tween",n);p.addClass(n).one(k+".complete"+g,v.complete);y.useFailSafe&&v.add.failSafe();v.set.duration(y.duration);y.onStart.call(b)}},save:{animation:function(n){v.cache||(v.cache={});v.cache.animation=n},displayType:function(n){"none"!==n&&p.data(nt.displayType,n)},transitionExists:function(t,i){n.fn.transition.exists[t]=i;v.verbose("Saving existence of transition",t,i)}},restore:{conditions:function(){var n=v.get.currentAnimation();n&&(p.removeClass(n),v.verbose("Removing animation class",v.cache));v.remove.duration()}},add:{failSafe:function(){var n=v.get.duration();v.timer=setTimeout(function(){p.triggerHandler(k)},n+y.failSafeDelay);v.verbose("Adding fail safe timer",v.timer)}},remove:{animating:function(){p.removeClass(w.animating)},animationCallbacks:function(){v.remove.queueCallback();v.remove.completeCallback()},queueCallback:function(){p.off(".queue"+g)},completeCallback:function(){p.off(".complete"+g)},display:function(){p.css("display","")},direction:function(){p.removeClass(w.inward).removeClass(w.outward)},duration:function(){p.css("animation-duration","")},failSafe:function(){v.verbose("Removing fail safe timer",v.timer);v.timer&&clearTimeout(v.timer)},hidden:function(){p.removeClass(w.hidden)},visible:function(){p.removeClass(w.visible)},looping:function(){v.debug("Transitions are no longer looping");v.is.looping()&&(v.reset(),p.removeClass(w.looping))},transition:function(){p.removeClass(w.transition).removeClass(w.visible).removeClass(w.hidden)}},get:{settings:function(t,i,r){return"object"==typeof t?n.extend(!0,{},n.fn.transition.settings,t):"function"==typeof r?n.extend({},n.fn.transition.settings,{animation:t,onComplete:r,duration:i}):"string"==typeof i||"number"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,duration:i}):"object"==typeof i?n.extend({},n.fn.transition.settings,i,{animation:t}):"function"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,onComplete:i}):n.extend({},n.fn.transition.settings,{animation:t})},animationClass:function(n){var t=n||y.animation,i=v.can.transition()&&!v.has.direction()?v.get.direction()+" ":"";return w.animating+" "+w.transition+" "+i+t},currentAnimation:function(){return!(!v.cache||v.cache.animation===r)&&v.cache.animation},currentDirection:function(){return v.is.inward()?w.inward:w.outward},direction:function(){return v.is.hidden()||!v.is.visible()?w.inward:w.outward},animationDirection:function(t){var i;return"string"==typeof(t=t||y.animation)&&(t=t.split(" "),n.each(t,function(n,t){t===w.inward?i=w.inward:t===w.outward&&(i=w.outward)})),i||!1},duration:function(n){return!1===(n=n||y.duration)&&(n=p.css("animation-duration")||0),"string"==typeof n?-1<n.indexOf("ms")?parseFloat(n):1e3*parseFloat(n):n},displayType:function(n){if(n=n===r||n,y.displayType)return y.displayType;if(n&&p.data(nt.displayType)===r){var t=p.css("display");""===t||"none"===t?v.can.transition(!0):v.save.displayType(t)}return p.data(nt.displayType)},userStyle:function(n){return(n=n||p.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(t){return n.fn.transition.exists[t]},animationStartEvent:function(){var n,u=i.createElement("div"),t={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(n in t)if(u.style[n]!==r)return t[n];return!1},animationEndEvent:function(){var n,u=i.createElement("div"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(n in t)if(u.style[n]!==r)return t[n];return!1}},can:{transition:function(t){var s,c,f,e,l,o,i=y.animation,h=v.get.transitionExists(i),u=v.get.displayType(!1);if(h===r||t){if(v.verbose("Determining whether animation exists"),s=p.attr("class"),c=p.prop("tagName"),e=(f=n("<"+c+" />").addClass(s).insertAfter(p)).addClass(i).removeClass(w.inward).removeClass(w.outward).addClass(w.animating).addClass(w.transition).css("animationName"),l=f.addClass(w.inward).css("animationName"),u||(u=f.attr("class",s).removeAttr("style").removeClass(w.hidden).removeClass(w.visible).show().css("display"),v.verbose("Determining final display state",u),v.save.displayType(u)),f.remove(),e!=l)v.debug("Direction exists for animation",i),o=!0;else{if("none"==e||!e)return void v.debug("No animation defined in css",i);v.debug("Static animation found",i,u);o=!1}v.save.transitionExists(i,o)}return h!==r?h:o},animate:function(){return v.can.transition()!==r}},is:{animating:function(){return p.hasClass(w.animating)},inward:function(){return p.hasClass(w.inward)},outward:function(){return p.hasClass(w.outward)},looping:function(){return p.hasClass(w.looping)},occurring:function(n){return n="."+(n=n||y.animation).replace(" ","."),0<p.filter(n).length},visible:function(){return p.is(":visible")},hidden:function(){return"hidden"===p.css("visibility")},supported:function(){return!1!==k}},hide:function(){v.verbose("Hiding element");v.is.animating()&&v.reset();b.blur();v.remove.display();v.remove.visible();n.isFunction(y.onBeforeHide)?y.onBeforeHide.call(b,function(){v.hideNow()}):v.hideNow()},hideNow:function(){v.set.hidden();v.force.hidden();y.onHide.call(b);y.onComplete.call(b)},show:function(n){v.verbose("Showing element",n);v.force.visible()&&(v.remove.hidden(),v.set.visible(),y.onShow.call(b),y.onComplete.call(b))},toggle:function(){v.is.visible()?v.hide():v.show()},stop:function(){v.debug("Stopping current animation");p.triggerHandler(k)},stopAll:function(){v.debug("Stopping all animation");v.remove.queueCallback();p.triggerHandler(k)},clear:{queue:function(){v.debug("Clearing animation queue");v.remove.queueCallback()}},enable:function(){v.verbose("Starting animation");p.removeClass(w.disabled)},disable:function(){v.debug("Stopping animation");p.addClass(w.disabled)},setting:function(t,i){if(v.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];n.isPlainObject(y[t])?n.extend(!0,y[t],i):y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:b,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;e=!1;clearTimeout(v.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");1<f.length&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&0<u.length&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(i,u,f){var h,o,s,e=d;return u=u||l,f=b||f,"string"==typeof i&&e!==r&&(i=i.split(/[\. ]/),h=i.length-1,n.each(i,function(t,u){var f=t!=h?u+i[t+1].charAt(0).toUpperCase()+i[t+1].slice(1):i;if(n.isPlainObject(e[f])&&t!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||t==h)return e[u]!==r&&(o=e[u]),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),Array.isArray(t)?t.push(s):t!==r?t=[t,s]:s!==r&&(t=s),o!==r&&o}}).initialize()}),t!==r?t:this};n.fn.transition.exists={};n.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isWindow=n.isWindow||function(n){return null!=n&&n===n.window};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.api=n.fn.api=function(i){var u,o=n.isFunction(this)?n(t):n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=i,c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var k,nt,y,tt,rt,o,a=n.isPlainObject(i)?n.extend(!0,{},n.fn.api.settings,i):n.extend({},n.fn.api.settings),ft=a.namespace,et=a.metadata,ot=a.selector,w=a.error,it=a.className,st="."+ft,ut="module-"+ft,v=n(this),ht=v.closest(ot.form),p=a.stateContext?n(a.stateContext):v,d=this,b=p[0],g=v.data(ut);o={initialize:function(){c||o.bind.events();o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o);g=o;v.data(ut,g)},destroy:function(){o.verbose("Destroying previous module for",d);v.removeData(ut).off(st)},bind:{events:function(){var n=o.get.event();n?(o.verbose("Attaching API events to element",n),v.on(n+st,o.event.trigger)):"now"==a.on&&(o.debug("Querying API endpoint immediately"),o.query())}},decode:{json:function(n){if(n!==r&&"string"==typeof n)try{n=JSON.parse(n)}catch(n){}return n}},read:{cachedResponse:function(n){var i;if(t.Storage!==r)return i=sessionStorage.getItem(n),o.debug("Using cached response",n,i),i=o.decode.json(i);o.error(w.noStorage)}},write:{cachedResponse:function(i,u){u&&""===u?o.debug("Response empty, not caching",u):t.Storage!==r?(n.isPlainObject(u)&&(u=JSON.stringify(u)),sessionStorage.setItem(i,u),o.verbose("Storing cached response for url",i,u)):o.error(w.noStorage)}},query:function(){if(o.is.disabled())o.debug("Element is disabled API request aborted");else{if(o.is.loading()){if(!a.interruptRequests)return void o.debug("Cancelling request, previous request is still pending");o.debug("Interrupting previous request");o.abort()}if(a.defaultData&&n.extend(!0,a.urlData,o.get.defaultData()),a.serializeForm&&(a.data=o.add.formData(a.data)),!1===(nt=o.get.settings()))return o.cancelled=!0,void o.error(w.beforeSend);if(o.cancelled=!1,(y=o.get.templatedURL())||o.is.mocked()){if((y=o.add.urlData(y))||o.is.mocked()){if(nt.url=a.base+y,k=n.extend(!0,{},a,{type:a.method||a.type,data:tt,url:a.base+y,beforeSend:a.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),o.debug("Querying URL",k.url),o.verbose("Using AJAX settings",k),"local"===a.cache&&o.read.cachedResponse(y))return o.debug("Response returned from local cache"),o.request=o.create.request(),void o.request.resolveWith(b,[o.read.cachedResponse(y)]);a.throttle?a.throttleFirstRequest||o.timer?(o.debug("Throttling request",a.throttle),clearTimeout(o.timer),o.timer=setTimeout(function(){o.timer&&delete o.timer;o.debug("Sending throttled request",tt,k.method);o.send.request()},a.throttle)):(o.debug("Sending request",tt,k.method),o.send.request(),o.timer=setTimeout(function(){},a.throttle)):(o.debug("Sending request",tt,k.method),o.send.request())}}else o.error(w.missingURL)}},should:{removeError:function(){return!0===a.hideError||"auto"===a.hideError&&!o.is.form()}},is:{disabled:function(){return 0<v.filter(ot.disabled).length},expectingJSON:function(){return"json"===a.dataType||"jsonp"===a.dataType},form:function(){return v.is("form")||p.is("form")},mocked:function(){return a.mockResponse||a.mockResponseAsync||a.response||a.responseAsync},input:function(){return v.is("input")},loading:function(){return!!o.request&&"pending"==o.request.state()},abortedRequest:function(n){return n&&n.readyState!==r&&0===n.readyState?(o.verbose("XHR request determined to be aborted"),!0):(o.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return o.is.expectingJSON()&&n.isFunction(a.successTest)?(o.debug("Checking JSON returned success",a.successTest,t),a.successTest(t)?(o.debug("Response passed success test",t),!0):(o.debug("Response failed success test",t),!1)):(o.verbose("Response is not JSON, skipping validation",a.successTest,t),!0)}},was:{cancelled:function(){return o.cancelled||!1},succesful:function(){return o.verbose('This behavior will be deleted due to typo. Use "was successful" instead.'),o.was.successful()},successful:function(){return o.request&&"resolved"==o.request.state()},failure:function(){return o.request&&"rejected"==o.request.state()},complete:function(){return o.request&&("resolved"==o.request.state()||"rejected"==o.request.state())}},add:{urlData:function(t,i){var u,f;return t&&(u=t.match(a.regExp.required),f=t.match(a.regExp.optional),i=i||a.urlData,u&&(o.debug("Looking for required URL variables",u),n.each(u,function(u,f){var e=-1!==f.indexOf("$")?f.substr(2,f.length-3):f.substr(1,f.length-2),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];if(s===r)return o.error(w.requiredParameter,e,t),t=!1;o.verbose("Found required variable",e,s);s=a.encodeParameters?o.get.urlEncodedValue(s):s;t=t.replace(f,s)})),f&&(o.debug("Looking for optional URL variables",u),n.each(f,function(u,f){var e=-1!==f.indexOf("$")?f.substr(3,f.length-4):f.substr(2,f.length-3),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];t=s!==r?(o.verbose("Optional variable Found",e,s),t.replace(f,s)):(o.verbose("Optional variable not found",e),-1!==t.indexOf("/"+f)?t.replace("/"+f,""):t.replace(f,""))}))),t},formData:function(t){var u=n.fn.serializeObject!==r,i=u?ht.serializeObject():ht.serialize();return t=t||a.data,t=n.isPlainObject(t)?u?(o.debug("Extending existing data with form data",t,i),n.extend(!0,{},t,i)):(o.error(w.missingSerialize),o.debug("Cant extend data. Replacing data with form data",t,i),i):(o.debug("Adding form data",i),i)}},send:{request:function(){o.set.loading();o.request=o.create.request();o.is.mocked()?o.mockedXHR=o.create.mockedXHR():o.xhr=o.create.xhr();a.onRequest.call(b,o.request,o.xhr)}},event:{trigger:function(n){o.query();"submit"!=n.type&&"click"!=n.type||n.preventDefault()},xhr:{always:function(){},done:function(t,i,r){var f=this,s=(new Date).getTime()-rt,u=a.loadingDuration-s,e=!!n.isFunction(a.onResponse)&&(o.is.expectingJSON()&&!a.rawResponse?a.onResponse.call(f,n.extend(!0,{},t)):a.onResponse.call(f,t));u=0<u?u:0;e&&(o.debug("Modified API response in onResponse callback",a.onResponse,e,t),t=e);0<u&&o.debug("Response completed early delaying state change by",u);setTimeout(function(){o.is.validResponse(t)?o.request.resolveWith(f,[t,r]):o.request.rejectWith(f,[r,"invalid"])},u)},fail:function(n,t,i){var u=this,f=(new Date).getTime()-rt,r=a.loadingDuration-f;0<(r=0<r?r:0)&&o.debug("Response completed early delaying state change by",r);setTimeout(function(){o.is.abortedRequest(n)?o.request.rejectWith(u,[n,"aborted",i]):o.request.rejectWith(u,[n,"error",t,i])},r)}},request:{done:function(n,t){o.debug("Successful API Response",n);"local"===a.cache&&y&&(o.write.cachedResponse(y,n),o.debug("Saving server response locally",o.cache));a.onSuccess.call(b,n,v,t)},complete:function(n,t){var i,r;o.was.successful()?(r=n,i=t):(i=n,r=o.get.responseFromXHR(i));o.remove.loading();a.onComplete.call(b,r,v,i)},fail:function(n,t,i){var u=o.get.responseFromXHR(n),f=o.get.errorFromRequest(u,t,i);if("aborted"==t)return o.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,i),a.onAbort.call(b,t,v,n),!0;"invalid"==t?o.debug("JSON did not pass success test. A server-side error has most likely occurred",u):"error"==t&&n!==r&&(o.debug("XHR produced a server error",t,i),(n.status<200||300<=n.status)&&i!==r&&""!==i&&o.error(w.statusMessage+i,k.url),a.onError.call(b,f,v,n));a.errorDuration&&"aborted"!==t&&(o.debug("Adding error state"),o.set.error(),o.should.removeError()&&setTimeout(o.remove.error,a.errorDuration));o.debug("API Request failed",f,n);a.onFailure.call(b,u,v,n)}}},create:{request:function(){return n.Deferred().always(o.event.request.complete).done(o.event.request.done).fail(o.event.request.fail)},mockedXHR:function(){var f,r,i,t=a.mockResponse||a.response,u=a.mockResponseAsync||a.responseAsync;return i=n.Deferred().always(o.event.xhr.complete).done(o.event.xhr.done).fail(o.event.xhr.fail),t?(r=n.isFunction(t)?(o.debug("Using specified synchronous callback",t),t.call(b,nt)):(o.debug("Using settings specified response",t),t),i.resolveWith(b,[r,!1,{responseText:r}])):n.isFunction(u)&&(f=function(n){o.debug("Async callback returned response",n);n?i.resolveWith(b,[n,!1,{responseText:n}]):i.rejectWith(b,[{responseText:n},!1,!1])},o.debug("Using specified async response callback",u),u.call(b,nt,f)),i},xhr:function(){var t;return t=n.ajax(k).always(o.event.xhr.always).done(o.event.xhr.done).fail(o.event.xhr.fail),o.verbose("Created server request",t,k),t}},set:{error:function(){o.verbose("Adding error state to element",p);p.addClass(it.error)},loading:function(){o.verbose("Adding loading state to element",p);p.addClass(it.loading);rt=(new Date).getTime()}},remove:{error:function(){o.verbose("Removing error state from element",p);p.removeClass(it.error)},loading:function(){o.verbose("Removing loading state from element",p);p.removeClass(it.loading)}},get:{responseFromXHR:function(t){return!!n.isPlainObject(t)&&(o.is.expectingJSON()?o.decode.json(t.responseText):t.responseText)},errorFromRequest:function(t,i,u){return n.isPlainObject(t)&&t.error!==r?t.error:a.error[i]!==r?a.error[i]:u},request:function(){return o.request||!1},xhr:function(){return o.xhr||!1},settings:function(){var t;return(t=a.beforeSend.call(b,a))&&(t.success!==r&&(o.debug("Legacy success callback detected",t),o.error(w.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==r&&(o.debug("Legacy failure callback detected",t),o.error(w.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==r&&(o.debug("Legacy complete callback detected",t),o.error(w.legacyParameters,t.complete),t.onComplete=t.complete)),t===r&&o.error(w.noReturnedValue),!1===t?t:t!==r?n.extend(!0,{},t):n.extend(!0,{},a)},urlEncodedValue:function(n){var r=t.decodeURIComponent(n),i=t.encodeURIComponent(n);return r!==n?(o.debug("URL value is already encoded, avoiding double encoding",n),n):(o.verbose("Encoding value using encodeURIComponent",n,i),i)},defaultData:function(){var t={};return n.isWindow(d)||(o.is.input()?t.value=v.val():o.is.form()||(t.text=v.text())),t},event:function(){return n.isWindow(d)||"now"==a.on?(o.debug("API called without element, no events attached"),!1):"auto"==a.on?v.is("input")?d.oninput!==r?"input":d.onpropertychange!==r?"propertychange":"keyup":v.is("form")?"submit":"click":a.on},templatedURL:function(n){if(n=n||v.data(et.action)||a.action||!1,y=v.data(et.url)||a.url||!1)return o.debug("Using specified url",y),y;if(n){if(o.debug("Looking up url for action",n,a.api),a.api[n]===r&&!o.is.mocked())return void o.error(w.missingAction,a.action,a.api);y=a.api[n]}else o.is.form()&&(y=v.attr("action")||p.attr("action")||!1,o.debug("No url or action specified, defaulting to form action",y));return y}},abort:function(){var n=o.get.xhr();n&&"resolved"!==n.state()&&(o.debug("Cancelling API request"),n.abort())},reset:function(){o.remove.error();o.remove.loading()},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=g;return i=i||l,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?s=e[u]:o.error(w.method,t),!1;e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),Array.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(g===r&&o.initialize(),o.invoke(h)):(g!==r&&g.invoke("destroy"),o.initialize())}),u!==r?u:this};n.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!1,beforeSend:function(n){return n},beforeXHR:function(){},onRequest:function(){},onResponse:!1,onSuccess:function(){},onComplete:function(){},onFailure:function(){},onError:function(){},onAbort:function(){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.state=function(t){var i,e=n(this),u=e.selector||"",o=(new Date).getTime(),f=[],s=t,h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.state.settings,t):n.extend({},n.fn.state.settings),it=a.error,d=a.metadata,p=a.className,tt=a.namespace,g=a.states,y=a.text,b="."+tt,nt=tt+"-module",v=n(this),w=this,k=v.data(nt);l={initialize:function(){l.verbose("Initializing module");a.automatic&&l.add.defaults();a.context&&""!==u?n(a.context).on(u,"mouseenter"+b,l.change.text).on(u,"mouseleave"+b,l.reset.text).on(u,"click"+b,l.toggle.state):v.on("mouseenter"+b,l.change.text).on("mouseleave"+b,l.reset.text).on("click"+b,l.toggle.state);l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);k=l;v.data(nt,l)},destroy:function(){l.verbose("Destroying previous module",k);v.off(b).removeData(nt)},refresh:function(){l.verbose("Refreshing selector cache");v=n(w)},add:{defaults:function(){var i=t&&n.isPlainObject(t.states)?t.states:{};n.each(a.defaults,function(t,u){l.is[t]!==r&&l.is[t]()&&(l.verbose("Adding default states",t,w),n.extend(a.states,u,i))})}},is:{active:function(){return v.hasClass(p.active)},loading:function(){return v.hasClass(p.loading)},inactive:function(){return!v.hasClass(p.active)},state:function(n){return p[n]!==r&&v.hasClass(p[n])},enabled:function(){return!v.is(a.filter.active)},disabled:function(){return v.is(a.filter.active)},textEnabled:function(){return!v.is(a.filter.text)},button:function(){return v.is(".button:not(a, .submit)")},input:function(){return v.is("input")},progress:function(){return v.is(".ui.progress")}},allow:function(n){l.debug("Now allowing state",n);g[n]=!0},disallow:function(n){l.debug("No longer allowing",n);g[n]=!1},allows:function(n){return g[n]||!1},enable:function(){v.removeClass(p.disabled)},disable:function(){v.addClass(p.disabled)},setState:function(n){l.allows(n)&&v.addClass(p[n])},removeState:function(n){l.allows(n)&&v.removeClass(p[n])},toggle:{state:function(){var t;if(l.allows("active")&&l.is.enabled()){if(l.refresh(),n.fn.api!==r)if(t=v.api("get request"),v.api("was cancelled"))l.debug("API Request cancelled by beforesend"),a.activateTest=function(){return!1},a.deactivateTest=function(){return!1};else if(t)return void l.listenTo(t);l.change.state()}}},listenTo:function(t){l.debug("API request detected, waiting for state signal",t);t&&(y.loading&&l.update.text(y.loading),n.when(t).then(function(){"resolved"==t.state()?(l.debug("API request succeeded"),a.activateTest=function(){return!0},a.deactivateTest=function(){return!0}):(l.debug("API request failed"),a.activateTest=function(){return!1},a.deactivateTest=function(){return!1});l.change.state()}))},change:{state:function(){l.debug("Determining state change direction");l.is.inactive()?l.activate():l.deactivate();a.sync&&l.sync();a.onChange.call(w)},text:function(){l.is.textEnabled()&&(l.is.disabled()?(l.verbose("Changing text to disabled text",y.hover),l.update.text(y.disabled)):l.is.active()?y.hover?(l.verbose("Changing text to hover text",y.hover),l.update.text(y.hover)):y.deactivate&&(l.verbose("Changing text to deactivating text",y.deactivate),l.update.text(y.deactivate)):y.hover?(l.verbose("Changing text to hover text",y.hover),l.update.text(y.hover)):y.activate&&(l.verbose("Changing text to activating text",y.activate),l.update.text(y.activate)))}},activate:function(){a.activateTest.call(w)&&(l.debug("Setting state to active"),v.addClass(p.active),l.update.text(y.active),a.onActivate.call(w))},deactivate:function(){a.deactivateTest.call(w)&&(l.debug("Setting state to inactive"),v.removeClass(p.active),l.update.text(y.inactive),a.onDeactivate.call(w))},sync:function(){l.verbose("Syncing other buttons to current state");l.is.active()?e.not(v).state("activate"):e.not(v).state("deactivate")},get:{text:function(){return a.selector.text?v.find(a.selector.text).text():v.html()},textFor:function(n){return y[n]||!1}},flash:{text:function(n,t,i){var r=l.get.text();l.debug("Flashing text message",n,t);n=n||a.text.flash;t=t||a.flashDuration;i=i||function(){};l.update.text(n);setTimeout(function(){l.update.text(r);i.call(w)},t)}},reset:{text:function(){var n=y.active||v.data(d.storedText),t=y.inactive||v.data(d.storedText);l.is.textEnabled()&&(l.is.active()&&n?(l.verbose("Resetting active text",n),l.update.text(n)):t&&(l.verbose("Resetting inactive text",n),l.update.text(t)))}},update:{text:function(n){var t=l.get.text();n&&n!==t?(l.debug("Updating text",n),a.selector.text?v.data(d.storedText,n).find(a.selector.text).text(n):v.data(d.storedText,n).html(n)):l.debug("Text is already set, ignoring update",n)}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";u&&(t+=" '"+u+"'");(console.group!==r||console.table!==r)&&0<f.length&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,u,f){var h,o,s,e=k;return u=u||c,f=w||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?o=e[u]:l.error(it.method,t),!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),Array.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(k===r&&l.initialize(),l.invoke(s)):(k!==r&&k.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.isFunction=n.isFunction||function(n){return"function"==typeof n&&"number"!=typeof n.nodeType};t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.visibility=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=u,l="string"==typeof c,a=[].slice.call(arguments,1),v=o.length,y=0;return o.each(function(){var nt,it,tt,o,p=n.isPlainObject(u)?n.extend(!0,{},n.fn.visibility.settings,u):n.extend({},n.fn.visibility.settings),rt=p.className,st=p.namespace,ht=p.error,ct=p.metadata,k="."+st,ut="module-"+st,ft=n(t),w=n(this),b=n(p.context),g=w.data(ut),et=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},d=this,ot=!1;o={initialize:function(){o.debug("Initializing",p);o.setup.cache();o.should.trackChanges()&&("image"==p.type&&o.setup.image(),"fixed"==p.type&&o.setup.fixed(),p.observeChanges&&o.observeChanges(),o.bind.events());o.save.position();o.is.visible()||o.error(ht.visible,w);p.initialCheck&&o.checkVisibility();o.instantiate()},instantiate:function(){o.debug("Storing instance",o);w.data(ut,o);g=o},destroy:function(){o.verbose("Destroying previous module");tt&&tt.disconnect();it&&it.disconnect();ft.off("load"+k,o.event.load).off("resize"+k,o.event.resize);b.off("scroll"+k,o.event.scroll).off("scrollchange"+k,o.event.scrollchange);"fixed"==p.type&&(o.resetFixed(),o.remove.placeholder());w.off(k).removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(o.event.contextChanged),tt=new MutationObserver(o.event.changed),it.observe(i,{childList:!0,subtree:!0}),tt.observe(d,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",tt))},bind:{events:function(){o.verbose("Binding visibility events to scroll and resize");p.refreshOnLoad&&ft.on("load"+k,o.event.load);ft.on("resize"+k,o.event.resize);b.off("scroll"+k).on("scroll"+k,o.event.scroll).on("scrollchange"+k,o.event.scrollchange)}},event:{changed:function(){o.verbose("DOM tree modified, updating visibility calculations");o.timer=setTimeout(function(){o.verbose("DOM tree modified, updating sticky menu");o.refresh()},100)},contextChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==d||0<n(t).find(d).length)&&(o.debug("Element removed from DOM, tearing down events"),o.destroy())})})},resize:function(){o.debug("Window resized");p.refreshOnResize&&et(o.refresh)},load:function(){o.debug("Page finished loading");et(o.refresh)},scroll:function(){p.throttle?(clearTimeout(o.timer),o.timer=setTimeout(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])},p.throttle)):et(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])})},scrollchange:function(n,t){o.checkVisibility(t)}},precache:function(t,r){t instanceof Array||(t=[t]);for(var f=t.length,o=0,s=[],u=i.createElement("img"),e=function(){++o>=t.length&&n.isFunction(r)&&r()};f--;)(u=i.createElement("img")).onload=e,u.onerror=e,u.src=t[f],s.push(u)},enableCallbacks:function(){o.debug("Allowing callbacks to occur");ot=!1},disableCallbacks:function(){o.debug("Disabling all callbacks temporarily");ot=!0},should:{trackChanges:function(){return l?(o.debug("One time query, no need to bind events"),!1):(o.debug("Callbacks being attached"),!0)}},setup:{cache:function(){o.cache={occurred:{},screen:{},element:{}}},image:function(){var n=w.data(ct.src);n&&(o.verbose("Lazy loading image",n),p.once=!0,p.observeChanges=!1,p.onOnScreen=function(){o.debug("Image on screen",d);o.precache(n,function(){o.set.image(n,function(){++y==v&&p.onAllLoaded.call(this);p.onLoad.call(this)})})})},fixed:function(){o.debug("Setting up fixed");p.once=!1;p.observeChanges=!1;p.initialCheck=!0;p.refreshOnLoad=!0;u.transition||(p.transition=!1);o.create.placeholder();o.debug("Added placeholder",nt);p.onTopPassed=function(){o.debug("Element passed, adding fixed position",w);o.show.placeholder();o.set.fixed();p.transition&&n.fn.transition!==r&&w.transition(p.transition,p.duration)};p.onTopPassedReverse=function(){o.debug("Element returned to position, removing fixed",w);o.hide.placeholder();o.remove.fixed()}}},create:{placeholder:function(){o.verbose("Creating fixed position placeholder");nt=w.clone(!1).css("display","none").addClass(rt.placeholder).insertAfter(w)}},show:{placeholder:function(){o.verbose("Showing placeholder");nt.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){o.verbose("Hiding placeholder");nt.css("display","none").css("visibility","")}},set:{fixed:function(){o.verbose("Setting element to fixed position");w.addClass(rt.fixed).css({position:"fixed",top:p.offset+"px",left:"auto",zIndex:p.zIndex});p.onFixed.call(d)},image:function(t,i){if(w.attr("src",t),p.transition)if(n.fn.transition!==r){if(w.hasClass(rt.visible))return void o.debug("Transition already occurred on this image, skipping animation");w.transition(p.transition,p.duration,i)}else w.fadeIn(p.duration,i);else w.show()}},is:{onScreen:function(){return o.get.elementCalculations().onScreen},offScreen:function(){return o.get.elementCalculations().offScreen},visible:function(){return!(!o.cache||!o.cache.element)&&!(0===o.cache.element.width&&0===o.cache.element.offset.top)},verticallyScrollableContext:function(){var n=b.get(0)!==t&&b.css("overflow-y");return"auto"==n||"scroll"==n},horizontallyScrollableContext:function(){var n=b.get(0)!==t&&b.css("overflow-x");return"auto"==n||"scroll"==n}},refresh:function(){o.debug("Refreshing constants (width/height)");"fixed"==p.type&&o.resetFixed();o.reset();o.save.position();p.checkOnRefresh&&o.checkVisibility();p.onRefresh.call(d)},resetFixed:function(){o.remove.fixed();o.remove.occurred()},reset:function(){o.verbose("Resetting all cached values");n.isPlainObject(o.cache)&&(o.cache.screen={},o.cache.element={})},checkVisibility:function(n){o.verbose("Checking visibility of element",o.cache.element);!ot&&o.is.visible()&&(o.save.scroll(n),o.save.calculations(),o.passed(),o.passingReverse(),o.topVisibleReverse(),o.bottomVisibleReverse(),o.topPassedReverse(),o.bottomPassedReverse(),o.onScreen(),o.offScreen(),o.passing(),o.topVisible(),o.bottomVisible(),o.topPassed(),o.bottomPassed(),p.onUpdate&&p.onUpdate.call(d,o.get.elementCalculations()))},passed:function(t,i){var u=o.get.elementCalculations();if(t&&i)p.onPassed[t]=i;else{if(t!==r)return o.get.pixelsPassed(t)>u.pixelsPassed;u.passing&&n.each(p.onPassed,function(n,t){u.bottomVisible||u.pixelsPassed>o.get.pixelsPassed(n)?o.execute(t,n):p.once||o.remove.occurred(t)})}},onScreen:function(n){var t=o.get.elementCalculations(),i=n||p.onOnScreen;if(n&&(o.debug("Adding callback for onScreen",n),p.onOnScreen=n),t.onScreen?o.execute(i,"onScreen"):p.once||o.remove.occurred("onScreen"),n!==r)return t.onOnScreen},offScreen:function(n){var t=o.get.elementCalculations(),i=n||p.onOffScreen;if(n&&(o.debug("Adding callback for offScreen",n),p.onOffScreen=n),t.offScreen?o.execute(i,"offScreen"):p.once||o.remove.occurred("offScreen"),n!==r)return t.onOffScreen},passing:function(n){var t=o.get.elementCalculations(),i=n||p.onPassing;if(n&&(o.debug("Adding callback for passing",n),p.onPassing=n),t.passing?o.execute(i,"passing"):p.once||o.remove.occurred("passing"),n!==r)return t.passing},topVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisible,i="topVisible";if(n&&(o.debug("Adding callback for top visible",n),p.onTopVisible=n),t.topVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.topVisible},bottomVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisible,i="bottomVisible";if(n&&(o.debug("Adding callback for bottom visible",n),p.onBottomVisible=n),t.bottomVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.bottomVisible},topPassed:function(n){var t=o.get.elementCalculations(),i=n||p.onTopPassed;if(n&&(o.debug("Adding callback for top passed",n),p.onTopPassed=n),t.topPassed?o.execute(i,"topPassed"):p.once||o.remove.occurred("topPassed"),n===r)return t.topPassed},bottomPassed:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassed,i="bottomPassed";if(n&&(o.debug("Adding callback for bottom passed",n),p.onBottomPassed=n),t.bottomPassed?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.bottomPassed},passingReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onPassingReverse,i="passingReverse";if(n&&(o.debug("Adding callback for passing reverse",n),p.onPassingReverse=n),t.passing?p.once||o.remove.occurred(i):o.get.occurred("passing")&&o.execute(u,i),n!==r)return!t.passing},topVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisibleReverse,i="topVisibleReverse";if(n&&(o.debug("Adding callback for top visible reverse",n),p.onTopVisibleReverse=n),t.topVisible?p.once||o.remove.occurred(i):o.get.occurred("topVisible")&&o.execute(u,i),n===r)return!t.topVisible},bottomVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisibleReverse,i="bottomVisibleReverse";if(n&&(o.debug("Adding callback for bottom visible reverse",n),p.onBottomVisibleReverse=n),t.bottomVisible?p.once||o.remove.occurred(i):o.get.occurred("bottomVisible")&&o.execute(u,i),n===r)return!t.bottomVisible},topPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopPassedReverse,i="topPassedReverse";if(n&&(o.debug("Adding callback for top passed reverse",n),p.onTopPassedReverse=n),t.topPassed?p.once||o.remove.occurred(i):o.get.occurred("topPassed")&&o.execute(u,i),n===r)return!t.onTopPassed},bottomPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassedReverse,i="bottomPassedReverse";if(n&&(o.debug("Adding callback for bottom passed reverse",n),p.onBottomPassedReverse=n),t.bottomPassed?p.once||o.remove.occurred(i):o.get.occurred("bottomPassed")&&o.execute(u,i),n===r)return!t.bottomPassed},execute:function(n,t){var i=o.get.elementCalculations(),r=o.get.screenCalculations();(n=n||!1)&&(p.continuous?(o.debug("Callback being called continuously",t,i),n.call(d,i,r)):o.get.occurred(t)||(o.debug("Conditions met",t,i),n.call(d,i,r)));o.save.occurred(t)},remove:{fixed:function(){o.debug("Removing fixed position");w.removeClass(rt.fixed).css({position:"",top:"",left:"",zIndex:""});p.onUnfixed.call(d)},placeholder:function(){o.debug("Removing placeholder content");nt&&nt.remove()},occurred:function(n){if(n){var t=o.cache.occurred;t[n]!==r&&!0===t[n]&&(o.debug("Callback can now be called again",n),o.cache.occurred[n]=!1)}else o.cache.occurred={}}},save:{calculations:function(){o.verbose("Saving all calculations necessary to determine positioning");o.save.direction();o.save.screenCalculations();o.save.elementCalculations()},occurred:function(n){n&&(o.cache.occurred[n]!==r&&!0===o.cache.occurred[n]||(o.verbose("Saving callback occurred",n),o.cache.occurred[n]=!0))},scroll:function(n){n=n+p.offset||b.scrollTop()+p.offset;o.cache.scroll=n},direction:function(){var t,i=o.get.scroll(),n=o.get.lastScroll();return t=n<i&&n?"down":i<n&&n?"up":"static",o.cache.direction=t,o.cache.direction},elementPosition:function(){var n=o.cache.element,t=o.get.screenSize();return o.verbose("Saving element position"),n.fits=n.height<t.height,n.offset=w.offset(),n.width=w.outerWidth(),n.height=w.outerHeight(),o.is.verticallyScrollableContext()&&(n.offset.top+=b.scrollTop()-b.offset().top),o.is.horizontallyScrollableContext()&&(n.offset.left+=b.scrollLeft-b.offset().left),o.cache.element=n},elementCalculations:function(){var t=o.get.screenCalculations(),n=o.get.elementPosition();return p.includeMargin?(n.margin={},n.margin.top=parseInt(w.css("margin-top"),10),n.margin.bottom=parseInt(w.css("margin-bottom"),10),n.top=n.offset.top-n.margin.top,n.bottom=n.offset.top+n.height+n.margin.bottom):(n.top=n.offset.top,n.bottom=n.offset.top+n.height),n.topPassed=t.top>=n.top,n.bottomPassed=t.top>=n.bottom,n.topVisible=t.bottom>=n.top&&!n.topPassed,n.bottomVisible=t.bottom>=n.bottom&&!n.bottomPassed,n.pixelsPassed=0,n.percentagePassed=0,n.onScreen=(n.topVisible||n.passing)&&!n.bottomPassed,n.passing=n.topPassed&&!n.bottomPassed,n.offScreen=!n.onScreen,n.passing&&(n.pixelsPassed=t.top-n.top,n.percentagePassed=(t.top-n.top)/n.height),o.cache.element=n,o.verbose("Updated element calculations",n),n},screenCalculations:function(){var n=o.get.scroll();return o.save.direction(),o.cache.screen.top=n,o.cache.screen.bottom=n+o.cache.screen.height,o.cache.screen},screenSize:function(){o.verbose("Saving window position");o.cache.screen={height:b.height()}},position:function(){o.save.screenSize();o.save.elementPosition()}},get:{pixelsPassed:function(n){var t=o.get.elementCalculations();return-1<n.search("%")?t.height*(parseInt(n,10)/100):parseInt(n,10)},occurred:function(n){return o.cache.occurred!==r&&o.cache.occurred[n]||!1},direction:function(){return o.cache.direction===r&&o.save.direction(),o.cache.direction},elementPosition:function(){return o.cache.element===r&&o.save.elementPosition(),o.cache.element},elementCalculations:function(){return o.cache.element===r&&o.save.elementCalculations(),o.cache.element},screenCalculations:function(){return o.cache.screen===r&&o.save.screenCalculations(),o.cache.screen},screenSize:function(){return o.cache.screen===r&&o.save.screenSize(),o.cache.screen},scroll:function(){return o.cache.scroll===r&&o.save.scroll(),o.cache.scroll},lastScroll:function(){return o.cache.screen===r?(o.debug("First scroll event, no last scroll could be found"),!1):o.cache.screen.top}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){p.silent||(o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(o.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&0<e.length&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var c,s,h,e=g;return i=i||a,u=d||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?s=e[u]:o.error(ht.method,t),!1;e=e[u]}})),n.isFunction(s)?h=s.apply(u,i):s!==r&&(h=s),Array.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),s}};l?(g===r&&o.initialize(),g.save.scroll(),g.save.calculations(),o.invoke(c)):(g!==r&&g.invoke("destroy"),o.initialize())}),f!==r?f:this};n.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"constraint",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document)