!function(n,t,i,r){n.site=n.fn.site=function(u){var f,o,l=(new Date).getTime(),h=[],y=arguments[0],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,d=n(i),c=d,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());("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(f.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){});"undefined"==typeof 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, normailizing 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:!0;n.each(u,function(r,u){var e,s=f.moduleExists(u)?n.fn[u].settings.namespace||!1:!0;f.moduleExists(u)&&(f.verbose("Changing default setting",t,i,u),n.fn[u].settings[t]=i,o&&s&&(e=n(":data(module-"+s+")"),e.length>0&&(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:!0;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&&(e=n(":data(module-"+a+")"),e.length>0&&(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,r;e.performance&&(t=(new Date).getTime(),r=l||t,i=t-r,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)&&h.length>0&&(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],!1):(f.error(p.method,t),!1);e=e[u]}})),n.isFunction(h)?c=h.apply(u,i):h!==r&&(c=h),n.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","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],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.fn.form=function(t){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c=arguments[1],l="string"==typeof h,a=[].slice.call(arguments,1);return e.each(function(){var b,nt,ht,lt,ct,at,vt,y,g,tt,p,d,ot,st,ft,k,rt,v,w=n(this),it=this,ut=[],et=!1;v={initialize:function(){v.get.settings();l?(rt===r&&v.instantiate(),v.invoke(h)):(v.verbose("Initializing form validation",w,y),v.bindEvents(),v.set.defaults(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);rt=v;w.data(ft,v)},destroy:function(){v.verbose("Destroying previous module",rt);v.removeEvents();w.removeData(ft)},refresh:function(){v.verbose("Refreshing selector cache");b=w.find(p.field);nt=w.find(p.group);ht=w.find(p.message);lt=w.find(p.prompt);ct=w.find(p.submit);at=w.find(p.clear);vt=w.find(p.reset)},submit:function(){v.verbose("Submitting form",w);w.submit()},attachEvents:function(t,i){i=i||"submit";n(t).on("click"+k,function(n){v[i]();n.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events");w.on("submit"+k,v.validate.form).on("blur"+k,p.field,v.event.field.blur).on("click"+k,p.submit,v.submit).on("click"+k,p.reset,v.reset).on("click"+k,p.clear,v.clear);y.keyboardShortcuts&&w.on("keydown"+k,p.field,v.event.field.keydown);b.each(function(){var t=n(this),i=t.prop("type"),r=v.get.changeEvent(i,t);n(this).on(r+k,v.event.field.change)})},clear:function(){b.each(function(){var t=n(this),i=t.parent(),r=t.closest(nt),f=r.find(p.prompt),u=t.data(tt.defaultValue)||"",e=i.is(p.uiCheckbox),o=i.is(p.uiDropdown),s=r.hasClass(d.error);s&&(v.verbose("Resetting error on field",r),r.removeClass(d.error),f.remove());o?(v.verbose("Resetting dropdown value",i,u),i.dropdown("clear")):e?t.prop("checked",!1):(v.verbose("Resetting field value",t,u),t.val(""))})},reset:function(){b.each(function(){var t=n(this),u=t.parent(),f=t.closest(nt),e=f.find(p.prompt),i=t.data(tt.defaultValue),o=u.is(p.uiCheckbox),s=u.is(p.uiDropdown),h=f.hasClass(d.error);i!==r&&(h&&(v.verbose("Resetting error on field",f),f.removeClass(d.error),e.remove()),s?(v.verbose("Resetting dropdown value",u,i),u.dropdown("restore defaults")):o?(v.verbose("Resetting checkbox value",u,i),t.prop("checked",i)):(v.verbose("Resetting field value",t,i),t.val(i)))})},is:{valid:function(){var t=!0;return v.verbose("Checking if form is valid"),n.each(g,function(n,i){v.validate.field(i)||(t=!1)}),t}},removeEvents:function(){w.off(k);b.off(k);ct.off(k);b.off(k)},event:{field:{keydown:function(t){var i=n(this),r=t.which,u={enter:13,escape:27};r==u.escape&&(v.verbose("Escape key pressed blurring field"),i.blur());!t.ctrlKey&&r==u.enter&&i.is(p.input)&&i.not(p.checkbox).length>0&&(et||(i.one("keyup"+k,v.event.field.keyup),v.submit(),v.debug("Enter pressed on input submitting form")),et=!0)},keyup:function(){et=!1},blur:function(){var t=n(this),r=t.closest(nt),i=v.get.validation(t);r.hasClass(d.error)?(v.debug("Revalidating field",t,i),v.validate.field(i)):("blur"==y.on||"change"==y.on)&&v.validate.field(i)},change:function(){var t=n(this),i=t.closest(nt);("change"==y.on||i.hasClass(d.error)&&y.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,v.get.validation(t));v.validate.field(v.get.validation(t))},y.delay))}}},get:{changeEvent:function(n,t){return"checkbox"==n||"radio"==n||"hidden"==n||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return i.createElement("input").oninput!==r?"input":i.createElement("input").onpropertychange!==r?"propertychange":"keyup"},settings:function(){if(n.isPlainObject(t)){var i=Object.keys(t),u=i.length>0?t[i[0]].identifier!==r:!1;u?(y=n.extend(!0,{},n.fn.form.settings,c),g=n.extend({},n.fn.form.settings.defaults,t),v.error(y.error.oldSyntax,it),v.verbose("Extending settings from legacy parameters",g,y)):(y=n.extend(!0,{},n.fn.form.settings,t),g=n.extend({},n.fn.form.settings.defaults,y.fields),v.verbose("Extending settings",g,y))}else y=n.fn.form.settings,g=n.fn.form.settings.defaults,v.verbose("Using default form validation",g,y);st=y.namespace;tt=y.metadata;p=y.selector;d=y.className;ot=y.error;ft="module-"+st;k="."+st;rt=w.data(ft);v.refresh()},field:function(t){return v.verbose("Finding field with identifier",t),b.filter("#"+t).length>0?b.filter("#"+t):b.filter('[name="'+t+'"]').length>0?b.filter('[name="'+t+'"]'):b.filter('[name="'+t+'[]"]').length>0?b.filter('[name="'+t+'[]"]'):b.filter("[data-"+tt.validate+'="'+t+'"]').length>0?b.filter("[data-"+tt.validate+'="'+t+'"]'):n("<input/>")},fields:function(t){var i=n();return n.each(t,function(n,t){i=i.add(v.get.field(t))}),i},validation:function(t){var i;return g?(n.each(g,function(n,r){v.get.field(r.identifier)[0]==t[0]&&(i=r)}),i||!1):!1},value:function(n){var t,i=[];return i.push(n),t=v.get.values.call(it,i),t[n]},values:function(t){var r=n.isArray(t)?v.get.fields(t):b,i={};return r.each(function(t,r){var f=n(r),u=(f.prop("type"),f.prop("name")),e=f.val(),o=f.is(p.checkbox),h=f.is(p.radio),c=-1!==u.indexOf("[]"),s=o?f.is(":checked"):!1;if(u)if(c)if(u=u.replace("[]",""),i[u]||(i[u]=[]),o){if(!s)return v.debug("Omitted unchecked checkbox",f),!0;i[u].push(e)}else i[u].push(e);else if(h)s&&(i[u]=e);else if(o){if(!s)return v.debug("Omitted unchecked checkbox",f),!0;i[u]=!0}else i[u]=e}),i}},has:{field:function(n){return v.verbose("Checking for existence of a field with identifier",n),b.filter("#"+n).length>0?!0:b.filter('[name="'+n+'"]').length>0?!0:b.filter("[data-"+tt.validate+'="'+n+'"]').length>0?!0:!1}},add:{prompt:function(t,i){var o=v.get.field(t),f=o.closest(nt),u=f.children(p.prompt),e=0!==u.length;i="string"==typeof i?[i]:i;v.verbose("Adding field error state",t);f.addClass(d.error);y.inline&&(e||(u=y.templates.prompt(i),u.appendTo(f)),u.html(i[0]),e?v.verbose("Inline errors are disabled, no inline error added",t):y.transition&&n.fn.transition!==r&&w.transition("is supported")?(v.verbose("Displaying error with css transition",y.transition),u.transition(y.transition+" in",y.duration)):(v.verbose("Displaying error with fallback javascript animation"),u.fadeIn(y.duration)))},errors:function(n){v.debug("Adding form error messages",n);ht.html(y.templates.error(n))}},remove:{prompt:function(t){var f=v.get.field(t.identifier),u=f.closest(nt),i=u.children(p.prompt);u.removeClass(d.error);y.inline&&i.is(":visible")&&(v.verbose("Removing prompt for field",t),y.transition&&n.fn.transition!==r&&w.transition("is supported")?i.transition(y.transition+" out",y.duration,function(){i.remove()}):i.fadeOut(y.duration,function(){i.remove()}))}},set:{success:function(){w.removeClass(d.error).addClass(d.success)},defaults:function(){b.each(function(){var t=n(this),i=t.filter(p.checkbox).length>0,r=i?t.is(":checked"):t.val();t.data(tt.defaultValue,r)})},error:function(){w.removeClass(d.success).addClass(d.error)},value:function(n,t){var i={};return i[n]=t,v.set.values.call(it,i)},values:function(t){n.isEmptyObject(t)||n.each(t,function(t,i){var f,r=v.get.field(t),u=r.parent(),o=n.isArray(i),e=u.is(p.uiCheckbox),s=u.is(p.uiDropdown),h=r.is(p.radio)&&e,c=r.length>0;c&&(o&&e?(v.verbose("Selecting multiple",i,r),u.checkbox("uncheck"),n.each(i,function(n,t){f=r.filter('[value="'+t+'"]');u=f.parent();f.length>0&&u.checkbox("check")})):h?(v.verbose("Selecting radio value",i,r),r.filter('[value="'+i+'"]').parent(p.uiCheckbox).checkbox("check")):e?(v.verbose("Setting checkbox value",i,u),u.checkbox(i===!0?"check":"uncheck")):s?(v.verbose("Setting dropdown value",i,u),u.dropdown("set selected",i)):(v.verbose("Setting field value",i,r),r.val(i)))})}},validate:{form:function(n){return et?!1:(ut=[],v.is.valid()?(v.debug("Form has no validation errors, submitting"),v.set.success(),y.onSuccess.call(it,n)):(v.debug("Form has errors"),v.set.error(),y.inline||v.add.errors(ut),w.data("moduleApi")!==r&&n.stopImmediatePropagation(),y.onFailure.call(it,ut)))},field:function(t){var u=v.get.field(t.identifier),f=!0,i=[];return u.prop("disabled")?(v.debug("Field is disabled. Skipping",t.identifier),f=!0):t.optional&&""===n.trim(u.val())?(v.debug("Field is optional and empty. Skipping",t.identifier),f=!0):t.rules!==r&&n.each(t.rules,function(n,r){v.has.field(t.identifier)&&!v.validate.rule(t,r)&&(v.debug("Field is invalid",t.identifier,r.type),i.push(r.prompt),f=!1)}),f?(v.remove.prompt(t,i),y.onValid.call(u),!0):(ut=ut.concat(i),v.add.prompt(t.identifier,i),y.onInvalid.call(u,i),!1)},rule:function(t,i){var r,c,e,u=v.get.field(t.identifier),f=i.type,o=u.val(),s=f.match(y.regExp.bracket),h=!0;if(o=n.trim(u.val()+""),s){if(c=""+s[1],e=f.replace(s[0],""),r=y.rules[e],!n.isFunction(r))return void v.error(ot.noRule,e);h=r.call(u,o,c)}else{if(r=y.rules[f],!n.isFunction(r))return void v.error(ot.noRule,f);h=r.call(u,o)}return h}},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.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.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(){v.error=Function.prototype.bind.call(console.error,console,y.name+":");v.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:it,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(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=rt;return i=i||a,f=it||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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};v.initialize()}),u!==r?u: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,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{bracket:/\[(.*)\]/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,email:"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",integer:/^\-?\d+$/,flags:/^\/(.*)\/(.*)?/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},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"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noRule:"There is no rule matching the one you specified",method:"The method you called is not defined."},templates:{error:function(t){var i='<ul class="list">';return n.each(t,function(n,t){i+="<li>"+t+"<\/li>"}),i+="<\/ul>",n(i)},prompt:function(t){return n("<div/>").addClass("ui red pointing prompt label").html(t[0])}},rules:{checked:function(){return n(this).filter(":checked").length>0},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))},email:function(t){var i=new RegExp(n.fn.form.settings.regExp.email,"i");return i.test(t)},empty:function(t){return!(t===r||""===t||n.isArray(t)&&0===t.length)},integer:function(t,i){var f,e,u,o=n.fn.form.settings.regExp.integer;return i===r||""===i||".."===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||t>=f)&&(e===r||e>=t)},is:function(n,t){return t="string"==typeof t?t.toLowerCase():t,n="string"==typeof n?n.toLowerCase():n,n==t},isExactly:function(n,t){return n==t},length:function(n,t){return n!==r?n.length>=t:!1},different:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r?t.toString()!==u.toString():!1},match:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r?t.toString()==u.toString():!1},maxCount:function(t,i){return t=t.split(","),n.isArray(t)&&t.length<=i},exactCount:function(t,i){return t=t.split(","),n.isArray(t)&&t.length==i},minCount:function(t,i){return t=t.split(","),n.isArray(t)&&t.length>=i},regExp:function(t,i){var u,r=i.match(n.fn.form.settings.regExp.flags);return r&&(i=r.length>=2?r[1]:i,u=r.length>=3?r[2]:""),t.match(new RegExp(i,u))},maxLength:function(n,t){return n!==r?n.length<=t:!1},not:function(n,t){return n="string"==typeof n?n.toLowerCase():n,t="string"==typeof t?t.toLowerCase():t,n!=t},notExactly:function(n,t){return n!=t},url:function(t){return n.fn.form.settings.regExp.url.test(t)}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.accordion=function(i){var u,o=n(this),e=(new Date).getTime(),f=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},o.each(function(){var d,l,a=n.isPlainObject(i)?n.extend(!0,{},n.fn.accordion.settings,i):n.extend({},n.fn.accordion.settings),v=a.className,tt=a.namespace,y=a.selector,ut=a.error,it="."+tt,g="module-"+tt,rt=o.selector||"",p=n(this),b=p.find(y.title),w=p.find(y.content),nt=this,k=p.data(g);l={initialize:function(){l.debug("Initializing",p);l.bind.events();l.observeChanges();l.instantiate()},instantiate:function(){k=l;p.data(g,l)},destroy:function(){l.debug("Destroying previous instance",p);p.off(it).removeData(g)},refresh:function(){b=p.find(y.title);w=p.find(y.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(){l.debug("DOM tree modified, updating selector cache");l.refresh()}),d.observe(nt,{childList:!0,subtree:!0}),l.debug("Setting up mutation observer",d))},bind:{events:function(){l.debug("Binding delegated events");p.on(a.on+it,y.trigger,l.event.click)}},event:{click:function(){l.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;l.debug("Toggling visibility of content",i);o||s?a.collapsible?l.close.call(i):l.debug("Cannot close accordion content collapsing is disabled"):l.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),e=i.hasClass(v.active),o=e||f;return o?void l.debug("Accordion already open, skipping",i):(l.debug("Opening accordion content",u),a.onOpening.call(i),a.exclusive&&l.closeOthers.call(u),u.addClass(v.active),i.stop(!0,!0).addClass(v.animating),a.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration}):i.children().stop(!0,!0).animate({opacity:1},a.duration,l.resetOpacity)),void i.slideDown(a.duration,a.easing,function(){i.removeClass(v.animating).addClass(v.active);l.reset.display.call(this);a.onOpen.call(this);a.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),o=!u&&e,s=u&&e;(u||o)&&!s&&(l.debug("Closing accordion content",i),a.onClosing.call(i),f.removeClass(v.active),i.stop(!0,!0).addClass(v.animating),a.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration}):i.children().stop(!0,!0).animate({opacity:0},a.duration,l.resetOpacity)),i.slideUp(a.duration,a.easing,function(){i.removeClass(v.animating).removeClass(v.active);l.reset.display.call(this);a.onClose.call(this);a.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";a.closeNested?(i=e.find(o).not(f),u=i.next(w)):(i=e.find(o).not(f),s=e.find(c).find(o).not(f),i=i.not(s),u=i.next(w));i.length>0&&(l.debug("Exclusive enabled, closing other content",i),i.removeClass(v.active),u.removeClass(v.animating).stop(!0,!0),a.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?u.children().transition({animation:"fade out",useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration}):u.children().stop(!0,!0).animate({opacity:0},a.duration,l.resetOpacity)),u.slideUp(a.duration,a.easing,function(){n(this).removeClass(v.active);l.reset.display.call(this)}))},reset:{display:function(){l.verbose("Removing inline display from element",this);n(this).css("display","");""===n(this).attr("style")&&n(this).attr("style","").removeAttr("style")},opacity:function(){l.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(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];a[t]=i}},internal:function(t,i){return l.debug("Changing internal",t,i),i===r?l[t]:void(n.isPlainObject(t)?n.extend(!0,l,t):l[t]=i)},debug:function(){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.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(){l.error=Function.prototype.bind.call(console.error,console,a.name+":");l.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.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=a.name+":",i=0;e=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";rt&&(t+=" '"+rt+"'");(console.group!==r||console.table!==r)&&f.length>0&&(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=nt||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):(l.error(ut.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};h?(k===r&&l.initialize(),l.invoke(s)):(k!==r&&k.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!1,performance:!0,on:"click",exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onOpen:function(){},onClosing:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},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.fn.checkbox=function(i){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var g,o,v=n.extend(!0,{},n.fn.checkbox.settings,i),p=v.className,it=v.namespace,w=v.selector,rt=v.error,d="."+it,nt="module-"+it,y=n(this),b=n(this).children(w.label),a=n(this).children(w.input),k=y.data(nt),tt=this;o={initialize:function(){o.verbose("Initializing checkbox",v);o.create.label();o.bind.events();o.set.tabbable();o.hide.input();o.observeChanges();o.instantiate();o.setup()},instantiate:function(){o.verbose("Storing instance of module",o);k=o;y.data(nt,o)},destroy:function(){o.verbose("Destroying module");o.unbind.events();o.show.input();y.removeData(nt)},fix:{reference:function(){y.is(w.input)&&(o.debug("Behavior called on <input> adjusting invoked element"),y=y.closest(w.checkbox),o.refresh())}},setup:function(){o.is.indeterminate()?(o.debug("Initial value is indeterminate"),o.set.indeterminate(),v.fireOnInit&&(v.onIndeterminate.call(a[0]),v.onChange.call(a[0]))):o.is.checked()?(o.debug("Initial value is checked"),o.set.checked(),v.fireOnInit&&(v.onChecked.call(a[0]),v.onChange.call(a[0]))):(o.debug("Initial value is unchecked"),o.set.unchecked(),v.fireOnInit&&(v.onUnchecked.call(a[0]),v.onChange.call(a[0])))},refresh:function(){b=y.children(w.label);a=y.children(w.input)},hide:{input:function(){o.verbose("Modfying <input> z-index to be unselectable");a.addClass(p.hidden)}},show:{input:function(){o.verbose("Modfying <input> z-index to be selectable");a.removeClass(p.hidden)}},observeChanges:function(){"MutationObserver"in t&&(g=new MutationObserver(function(){o.debug("DOM tree modified, updating selector cache");o.refresh()}),g.observe(tt,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",g))},attachEvents:function(t,i){var r=n(t);i=n.isFunction(o[i])?o[i]:o.toggle;r.length>0?(o.debug("Attaching checkbox events to element",t,i),r.on("click"+d,i)):o.error(rt.notFound)},event:{click:function(t){return n(t.target).is(w.input)?void o.verbose("Using default check action on initialized checkbox"):(o.toggle(),void t.preventDefault())},keydown:function(n){var t=n.which,i={enter:13,space:32,escape:27};t==i.escape&&(o.verbose("Escape key pressed blurring field"),a.blur(),n.preventDefault());n.ctrlKey||t!=i.enter&&t!=i.space||(o.verbose("Enter key pressed, toggling checkbox"),o.toggle(),n.preventDefault())}},check:function(){return!o.is.indeterminate()&&o.is.checked()?void o.debug("Checkbox is already checked"):(o.debug("Checking checkbox",a),o.set.checked(),v.onChecked.call(a[0]),void v.onChange.call(a[0]))},uncheck:function(){return!o.is.indeterminate()&&o.is.unchecked()?void o.debug("Checkbox is already unchecked"):(o.debug("Unchecking checkbox"),o.set.unchecked(),v.onUnchecked.call(a[0]),void v.onChange.call(a[0]))},indeterminate:function(){return o.is.indeterminate()?void o.debug("Checkbox is already indeterminate"):(o.debug("Making checkbox indeterminate"),o.set.indeterminate(),v.onIndeterminate.call(a[0]),void v.onChange.call(a[0]))},determinate:function(){return o.is.determinate()?void o.debug("Checkbox is already determinate"):(o.debug("Making checkbox determinate"),o.set.determinate(),v.onDeterminate.call(a[0]),void v.onChange.call(a[0]))},enable:function(){return o.is.enabled()?void o.debug("Checkbox is already enabled"):(o.debug("Enabling checkbox"),o.set.enabled(),void v.onEnable.call(a[0]))},disable:function(){return o.is.disabled()?void o.debug("Checkbox is already disabled"):(o.debug("Disabling checkbox"),o.set.disabled(),void v.onDisable.call(a[0]))},get:{radios:function(){var t=o.get.name();return n('input[name="'+t+'"]').closest(w.checkbox)},otherRadios:function(){return o.get.radios().not(y)},name:function(){return a.attr("name")}},is:{radio:function(){return a.hasClass(p.radio)||"radio"==a.attr("type")},indeterminate:function(){return a.prop("indeterminate")!==r&&a.prop("indeterminate")},checked:function(){return a.prop("checked")!==r&&a.prop("checked")},disabled:function(){return a.prop("disabled")!==r&&a.prop("disabled")},enabled:function(){return!o.is.disabled()},determinate:function(){return!o.is.indeterminate()},unchecked:function(){return!o.is.checked()}},can:{change:function(){return!(y.hasClass(p.disabled)||y.hasClass(p.readOnly)||a.prop("disabled")||a.prop("readonly"))},uncheck:function(){return"boolean"==typeof v.uncheckable?v.uncheckable:!o.is.radio()}},set:{checked:function(){return o.verbose("Setting class to checked"),y.removeClass(p.indeterminate).addClass(p.checked),o.is.radio()&&o.uncheckOthers(),!o.is.indeterminate()&&o.is.checked()?void o.debug("Input is already checked, skipping input property change"):(o.verbose("Setting state to checked",a[0]),a.prop("indeterminate",!1).prop("checked",!0),void o.trigger.change())},unchecked:function(){return o.verbose("Removing checked class"),y.removeClass(p.indeterminate).removeClass(p.checked),!o.is.indeterminate()&&o.is.unchecked()?void o.debug("Input is already unchecked"):(o.debug("Setting state to unchecked"),a.prop("indeterminate",!1).prop("checked",!1),void o.trigger.change())},indeterminate:function(){return o.verbose("Setting class to indeterminate"),y.addClass(p.indeterminate),o.is.indeterminate()?void o.debug("Input is already indeterminate, skipping input property change"):(o.debug("Setting state to indeterminate"),a.prop("indeterminate",!0),void o.trigger.change())},determinate:function(){return o.verbose("Removing indeterminate class"),y.removeClass(p.indeterminate),o.is.determinate()?void o.debug("Input is already determinate, skipping input property change"):(o.debug("Setting state to determinate"),void a.prop("indeterminate",!1))},disabled:function(){return o.verbose("Setting class to disabled"),y.addClass(p.disabled),o.is.disabled()?void o.debug("Input is already disabled, skipping input property change"):(o.debug("Setting state to disabled"),a.prop("disabled","disabled"),void o.trigger.change())},enabled:function(){return o.verbose("Removing disabled class"),y.removeClass(p.disabled),o.is.enabled()?void o.debug("Input is already enabled, skipping input property change"):(o.debug("Setting state to enabled"),a.prop("disabled",!1),void o.trigger.change())},tabbable:function(){o.verbose("Adding tabindex to checkbox");a.attr("tabindex")===r&&a.attr("tabindex",0)}},trigger:{change:function(){o.verbose("Triggering change event from programmatic change");a.trigger("change")}},create:{label:function(){a.prevAll(w.label).length>0?(a.prev(w.label).detach().insertAfter(a),o.debug("Moving existing label",b)):o.has.label()||(b=n("<label>").insertAfter(a),o.debug("Creating label",b))}},has:{label:function(){return b.length>0}},bind:{events:function(){o.verbose("Attaching checkbox events");y.on("click"+d,o.event.click).on("keydown"+d,w.input,o.event.keydown)}},unbind:{events:function(){o.debug("Removing events");y.off(d)}},uncheckOthers:function(){var n=o.get.otherRadios();o.debug("Unchecking other radios",n);n.removeClass(p.checked)},toggle:function(){return o.can.change()?void(o.is.indeterminate()||o.is.unchecked()?(o.debug("Currently unchecked"),o.check()):o.is.checked()&&o.can.uncheck()&&(o.debug("Currently checked"),o.uncheck())):void(o.is.radio()||o.debug("Checkbox is read-only or disabled, ignoring toggle"))},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];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.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.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(){o.error=Function.prototype.bind.call(console.error,console,v.name+":");o.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,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)&&f.length>0&&(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=k;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],!1):(o.error(rt.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?(k===r&&o.initialize(),o.invoke(h)):(k!==r&&k.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate: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"]'}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.dimmer=function(t){var u,e=n(this),o=(new Date).getTime(),f=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var v,y,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,p=a.className,ut=a.error,g="."+tt,nt="module-"+tt,it=e.selector||"",rt="ontouchstart"in i.documentElement?"touchstart":"click",w=n(this),k=this,d=w.data(nt);l={preinitialize:function(){l.is.dimmer()?(y=w.parent(),v=w):(y=w,v=l.has.dimmer()?a.dimmerName?y.find(b.dimmer).filter("."+a.dimmerName):y.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);d=l;w.data(nt,d)},destroy:function(){l.verbose("Destroying previous module",v);l.unbind.events();l.remove.variation();y.off(g)},bind:{events:function(){"hover"==a.on?y.on("mouseenter"+g,l.show).on("mouseleave"+g,l.hide):"click"==a.on&&y.on(rt+g,l.toggle);l.is.page()&&(l.debug("Setting as a page dimmer",y),l.set.pageDimmer());l.is.closable()&&(l.verbose("Adding dimmer close event",v),y.on(rt+g,b.dimmer,l.event.click))}},unbind:{events:function(){w.removeData(nt)}},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());return a.variation&&(l.debug("Creating dimmer with variation",a.variation),t.addClass(a.variation)),a.dimmerName&&(l.debug("Creating named dimmer",a.dimmerName),t.addClass(a.dimmerName)),t.appendTo(y),t},show:function(t){t=n.isFunction(t)?t:function(){};l.debug("Showing dimmer",v,a);l.is.dimmed()&&!l.is.animating()||!l.is.enabled()?l.debug("Dimmer is already shown or disabled"):(l.animate.show(t),a.onShow.call(k),a.onChange.call(k))},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(k),a.onChange.call(k)):l.debug("Dimmer is not visible")},toggle:function(){l.verbose("Toggling dimmer visibility",v);l.is.dimmed()?l.hide():l.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?("auto"!==a.opacity&&l.set.opacity(),v.transition({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({animation:a.transition+" out",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.remove.dimmed()},onComplete:function(){l.remove.active();t()}})):(l.verbose("Hiding dimmer with javascript"),l.remove.dimmed(),v.stop().fadeOut(l.get.duration(),function(){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?w.find(b.dimmer).filter("."+a.dimmerName).length>0:w.find(b.dimmer).length>0}},is:{active:function(){return v.hasClass(p.active)},animating:function(){return v.is(":animated")||v.hasClass(p.animating)},closable:function(){return"auto"==a.closable?"hover"==a.on?!1:!0:a.closable},dimmer:function(){return w.hasClass(p.dimmer)},dimmable:function(){return w.hasClass(p.dimmable)},dimmed:function(){return y.hasClass(p.dimmed)},disabled:function(){return y.hasClass(p.disabled)},enabled:function(){return!l.is.disabled()},page:function(){return y.is("body")},pageDimmer:function(){return v.hasClass(p.pageDimmer)}},can:{show:function(){return!v.hasClass(p.disabled)}},set:{opacity:function(n){var t=v.css("background-color"),i=t.split(","),r=i&&4==i.length;n=a.opacity||n;r?(i[3]=n+")",t=i.join(",")):t="rgba(0, 0, 0, "+n+")";l.debug("Setting opacity to",n);v.css("background-color",t)},active:function(){v.addClass(p.active)},dimmable:function(){y.addClass(p.dimmable)},dimmed:function(){y.addClass(p.dimmed)},pageDimmer:function(){v.addClass(p.pageDimmer)},disabled:function(){v.addClass(p.disabled)},variation:function(n){n=n||a.variation;n&&v.addClass(n)}},remove:{active:function(){v.removeClass(p.active)},dimmed:function(){y.removeClass(p.dimmed)},disabled:function(){v.removeClass(p.disabled)},variation:function(n){n=n||a.variation;n&&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];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.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.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(){l.error=Function.prototype.bind.call(console.error,console,a.name+":");l.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.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;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";it&&(t+=" '"+it+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(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=d;return i=i||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],!1):(l.error(ut.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};l.preinitialize();h?(d===r&&l.initialize(),l.invoke(s)):(d!==r&&d.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},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",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return n("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.dropdown=function(u){var f,e=n(this),o=n(i),a=e.selector||"",h="ontouchstart"in i.documentElement,c=(new Date).getTime(),s=[],l=arguments[0],v="string"==typeof l,y=[].slice.call(arguments,1);return e.each(function(p){var kt,yt,st,wt,ht,pt,w,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.dropdown.settings,u):n.extend({},n.fn.dropdown.settings),k=b.className,lt=b.message,ut=b.metadata,ti=b.namespace,ri=b.regExp,g=b.selector,ct=b.error,dt=b.templates,it="."+ti,gt="module-"+ti,d=n(this),ii=n(b.context),ot=d.find(g.text),ft=d.find(g.search),rt=d.find(g.input),ui=d.find(g.icon),bt=d.prev().find(g.text).length>0?d.prev().find(g.text):d.prev(),nt=d.children(g.menu),tt=nt.find(g.item),at=!1,ni=!1,et=this,vt=d.data(gt);w={initialize:function(){w.debug("Initializing dropdown",b);w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),w.refreshData(),w.save.defaults(),w.restore.selected(),w.create.id(),h&&w.bind.touchEvents(),w.bind.mouseEvents(),w.bind.keyboardEvents(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w);vt=w;d.data(gt,w)},destroy:function(){w.verbose("Destroying previous dropdown",d);w.remove.tabbable();d.off(it).removeData(gt);nt.off(it);o.off(st);ht&&ht.disconnect();pt&&pt.disconnect()},observeChanges:function(){"MutationObserver"in t&&(ht=new MutationObserver(function(){w.debug("<select> modified, recreating menu");w.setup.select()}),pt=new MutationObserver(function(){w.debug("Menu modified, updating selector cache");w.refresh()}),w.has.input()&&ht.observe(rt[0],{childList:!0,subtree:!0}),w.has.menu()&&pt.observe(nt[0],{childList:!0,subtree:!0}),w.debug("Setting up mutation observer",ht,pt))},create:{id:function(){wt=(Math.random().toString(16)+"000000000").substr(2,8);st="."+wt;w.verbose("Creating unique id for element",wt)},userChoice:function(t){var i,u,f;return(t=t||w.get.userValues())?(t=n.isArray(t)?t:[t],n.each(t,function(t,e){w.get.item(e)===!1&&(f=b.templates.addition(e),u=n("<div />").html(f).data(ut.value,e).addClass(k.addition).addClass(k.item),i=i===r?u:i.add(u),w.verbose("Creating user choices for value",e,u))}),i):!1},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)}))}},search:function(n){n=n!==r?n:w.get.query();w.verbose("Searching for query",n);w.filter(n)},select:{firstUnfiltered:function(){w.verbose("Selecting first non-filtered element");w.remove.selectedItem();tt.not(g.unselectable).eq(0).addClass(k.selected)},nextAvailable:function(n){n=n.eq(0);var t=n.nextAll(g.item).not(g.unselectable).eq(0),i=n.prevAll(g.item).not(g.unselectable).eq(0),r=t.length>0;r?(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,on:!1};w.verbose("First request, initializing API");d.api(n)},layout:function(){d.is("select")&&(w.setup.select(),w.setup.returnedObject());w.is.search()&&!w.has.search()&&(w.verbose("Adding search input"),ft=n("<input />").addClass(k.search).insertBefore(ot));b.allowTab&&w.set.tabbable();0===nt.length&&(nt=n("<div />").addClass(k.menu).appendTo(d))},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t);d.is("select")&&(rt=d);rt.parent(g.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),d=rt.closest(g.dropdown),nt=d.children(g.menu),w.setup.menu(t)):(w.debug("Creating entire dropdown from select"),d=n("<div />").attr("class",rt.attr("class")).addClass(k.selection).addClass(k.dropdown).html(dt.dropdown(t)).insertBefore(rt),rt.removeAttr("class").detach().prependTo(d));rt.is("[multiple]")&&w.set.multiple();w.refresh()},menu:function(n){nt.html(dt.menu(n));tt=nt.find(g.item)},reference:function(){w.debug("Dropdown behavior was called on select, replacing with closest dropdown");d=d.parent(g.dropdown);w.refresh();w.setup.returnedObject();v&&(vt=w,w.invoke(l))},returnedObject:function(){var n=e.slice(0,p),t=e.slice(p+1);e=n.add(d).add(t)}},refresh:function(){w.refreshSelectors();w.refreshData()},refreshSelectors:function(){w.verbose("Refreshing selector cache");ot=d.find(g.text);ft=d.find(g.search);rt=d.find(g.input);ui=d.find(g.icon);bt=d.prev().find(g.text).length>0?d.prev().find(g.text):d.prev();nt=d.children(g.menu);tt=nt.find(g.item)},refreshData:function(){w.verbose("Refreshing cached metadata");tt.removeData(ut.text).removeData(ut.value);d.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.active()){if(w.debug("Showing dropdown"),w.is.multiple()&&!w.has.search()&&w.is.allFiltered())return!0;w.animate.show(function(){w.can.click()&&w.bind.intent();w.set.visible();t.call(et)});b.onShow.call(et)}},hide:function(t){t=n.isFunction(t)?t:function(){};w.is.active()&&(w.debug("Hiding dropdown"),w.animate.hide(function(){w.remove.visible();t.call(et)}),b.onHide.call(et))},hideOthers:function(){w.verbose("Finding other dropdowns to hide");e.not(d).has(g.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(g.item).find(g.menu);w.verbose("Hiding sub menus",n);n.transition("hide")},bind:{keyboardEvents:function(){w.debug("Binding keyboard events");d.on("keydown"+it,w.event.keydown);w.has.search()&&d.on(w.get.inputEvent()+it,g.search,w.event.input);w.is.multiple()&&o.on("keydown"+st,w.event.document.keydown)},touchEvents:function(){w.debug("Touch device detected binding additional touch events");w.is.searchSelection()||w.is.single()&&d.on("touchstart"+it,w.event.test.toggle);nt.on("touchstart"+it,g.item,w.event.item.mouseenter)},mouseEvents:function(){w.debug("Mouse detected binding mouse events");w.is.multiple()&&d.on("click"+it,g.label,w.event.label.click).on("click"+it,g.remove,w.event.remove.click);w.is.searchSelection()?(d.on("mousedown"+it,g.menu,w.event.menu.mousedown).on("mouseup"+it,g.menu,w.event.menu.mouseup).on("click"+it,g.icon,w.event.icon.click).on("click"+it,g.search,w.show).on("focus"+it,g.search,w.event.search.focus).on("blur"+it,g.search,w.event.search.blur).on("click"+it,g.text,w.event.text.focus),w.is.multiple()&&d.on("click"+it,w.event.click)):("click"==b.on?d.on("click"+it,g.icon,w.event.icon.click).on("click"+it,w.event.test.toggle):"hover"==b.on?d.on("mouseenter"+it,w.delay.show).on("mouseleave"+it,w.delay.hide):d.on(b.on+it,w.toggle),d.on("mousedown"+it,w.event.mousedown).on("mouseup"+it,w.event.mouseup).on("focus"+it,w.event.focus).on("blur"+it,w.event.blur));nt.on("mouseenter"+it,g.item,w.event.item.mouseenter).on("mouseleave"+it,g.item,w.event.item.mouseleave).on("click"+it,g.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document");h&&o.on("touchstart"+st,w.event.test.touch).on("touchmove"+st,w.event.test.touch);o.on("click"+st,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document");h&&o.off("touchstart"+st).off("touchmove"+st);o.off("click"+st)}},filter:function(n){var t=n!==r?n:w.get.query(),i=function(){w.is.multiple()&&w.filterActive();w.select.firstUnfiltered();w.has.allResultsFiltered()?b.onNoResults.call(et,t)?b.allowAdditions||(w.verbose("All items filtered, showing message",t),w.add.message(lt.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):w.remove.message();b.allowAdditions&&w.add.userSuggestion(n);w.is.searchSelection()&&w.can.show()&&w.is.focusedOnSearch()&&w.show()};w.has.maxSelections()||(b.apiSettings?w.can.useAPI()?w.queryRemote(t,function(){i()}):w.error(ct.noAPI):(w.filterItems(t),i()))},queryRemote:function(t,i){var r={errorDuration:!1,throttle:b.throttle,cache:"local",urlData:{query:t},onError:function(){w.add.message(lt.serverError);i()},onFailure:function(){w.add.message(lt.serverError);i()},onSuccess:function(n){w.remove.message();w.setup.menu({values:n.results});i()}};d.api("get request")||w.setup.api();r=n.extend(!0,{},r,b.apiSettings);d.api("setting",r).api("query")},filterItems:function(t){var u=t!==r?t:w.get.query(),i=n(),e=w.escape.regExp(u),f=new RegExp("^"+e,"igm");""===u?i=tt:(w.verbose("Searching for matching values",u),tt.each(function(){var t,e,r=n(this);return("both"==b.match||"text"==b.match)&&((t=String(w.get.choiceText(r,!1)),-1!==t.search(f))||b.fullTextSearch&&w.fuzzySearch(u,t))?(i=i.add(r),!0):("both"==b.match||"value"==b.match)&&((e=String(w.get.choiceValue(r,t)),-1!==e.search(f))||b.fullTextSearch&&w.fuzzySearch(u,e))?(i=i.add(r),!0):void 0}));w.debug("Showing only matched items",u);w.remove.filteredItem();tt.not(i).addClass(k.filtered)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),u>r)return!1;if(u===r)return n===t;n:for(i=0,f=0;u>i;i++){for(e=n.charCodeAt(i);r>f;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},filterActive:function(){b.useLabels&&tt.filter("."+k.active).addClass(k.filtered)},focusSearch:function(){w.is.search()&&!w.is.focusedOnSearch()&&ft[0].focus()},forceSelection:function(){var t=tt.not(k.filtered).filter("."+k.selected).eq(0),i=tt.not(k.filtered).filter("."+k.active).eq(0),n=t.length>0?t:i,r=n.size()>0;r?(w.debug("Forcing partial selection to selected item",n),w.event.item.click.call(n)):w.hide()},event:{focus:function(){b.showOnFocus&&!at&&w.is.hidden()&&!yt&&w.show()},click:function(t){var i=n(t.target);i.is(d)&&!w.is.focusedOnSearch()&&w.focusSearch()},blur:function(){yt=i.activeElement===this;at||yt||(w.remove.activeLabel(),w.hide())},mousedown:function(){at=!0},mouseup:function(){at=!1},search:{focus:function(){at=!0;w.is.multiple()&&w.remove.activeLabel();b.showOnFocus&&w.show()},blur:function(){yt=i.activeElement===this;ni||yt||(w.is.multiple()?(w.remove.activeLabel(),w.hide()):b.forceSelection?w.forceSelection():w.hide())}},icon:{click:function(n){w.toggle();n.stopPropagation()}},text:{focus:function(){at=!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=d.find(g.label),r=u.filter("."+k.active),f=i.nextAll("."+k.active),e=i.prevAll("."+k.active),o=f.length>0?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.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){w.determine.eventOnElement(n,function(){"touchstart"==n.type?w.timer=setTimeout(w.hide,b.delay.touch):"touchmove"==n.type&&clearTimeout(w.timer)});n.stopPropagation()},hide:function(n){w.determine.eventInModule(n,w.hide)}},menu:{mousedown:function(){ni=!0},mouseup:function(){ni=!1}},item:{mouseenter:function(t){var i=n(this).children(g.menu),r=n(this).siblings(g.item).children(g.menu);i.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",i);n.each(r,function(){w.animate.hide(!1,n(this))});w.animate.show(!1,i)},b.delay.show),t.preventDefault())},mouseleave:function(){var t=n(this).children(g.menu);t.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t);w.animate.hide(!1,t)},b.delay.hide))},click:function(t){var i=n(this),f=n(t?t.target:""),r=i.find(g.menu),u=w.get.choiceText(i),e=w.get.choiceValue(i,u),o=r.length>0,s=r.find(f).length>0;s||o&&!b.allowCategorySelection||(b.useLabels||(w.remove.filteredItem(),w.remove.searchTerm(),w.set.scrollPosition(i)),w.determine.selectAction.call(this,u,e))}},document:{keydown:function(n){var u=n.which,f=w.get.shortcutKeys(),v=w.is.inObject(u,f);if(v){var i=d.find(g.label),t=i.filter("."+k.active),s=(t.data("value"),i.index(t)),y=i.length,r=t.length>0,h=t.length>1,p=0===s,c=s+1==y,o=w.is.searchSelection(),e=w.is.focusedOnSearch(),l=w.is.focused(),a=e&&0===w.get.caretPosition();if(o&&!r&&!e)return;u==f.leftArrow?!l&&!a||r?r&&(n.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),i.removeClass(k.active)),p&&!h?t.addClass(k.active):t.prev(g.siblingLabel).addClass(k.active).end(),n.preventDefault()):(w.verbose("Selecting previous label"),i.last().addClass(k.active)):u==f.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?o?e?i.removeClass(k.active):w.focusSearch():h?t.next(g.siblingLabel).addClass(k.active):t.addClass(k.active):t.next(g.siblingLabel).addClass(k.active),n.preventDefault())):u==f.deleteKey||u==f.backspace?r?(w.verbose("Removing active labels"),c&&o&&!e&&w.focusSearch(),t.last().next(g.siblingLabel).addClass(k.active),w.remove.activeLabels(t),n.preventDefault()):a&&!r&&u==f.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,i=w.get.shortcutKeys(),a=w.is.inObject(t,i);if(a){var u,s,h=tt.not(g.unselectable).filter("."+k.selected).eq(0),v=nt.children("."+k.active).eq(0),r=h.length>0?h:v,y=r.length>0?r.siblings(":not(."+k.filtered+")").andSelf():nt.children(":not(."+k.filtered+")"),e=r.children(g.menu),f=r.closest(g.menu),c=f.hasClass(k.visible)||f.hasClass(k.animating)||f.parent(g.menu).length>0,l=e.length>0,o=r.length>0,p=r.not(g.unselectable).length>0;if(w.is.visible()){if((t==i.enter||t==i.delimiter)&&(t==i.enter&&o&&l&&!b.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=i.rightArrow):p&&(w.verbose("Selecting item from keyboard shortcut",r),w.event.item.click.call(r,n),w.is.searchSelection()&&w.remove.searchTerm()),n.preventDefault()),t==i.leftArrow&&(s=f[0]!==nt[0],s&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,f),r.removeClass(k.selected),f.closest(g.item).addClass(k.selected),n.preventDefault())),t==i.rightArrow&&l&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,e),r.removeClass(k.selected),e.find(g.item).eq(0).addClass(k.selected),n.preventDefault()),t==i.upArrow){if(u=o&&c?r.prevAll(g.item+":not("+g.unselectable+")").eq(0):tt.eq(0),y.index(u)<0)return w.verbose("Up key pressed but reached top of current menu"),void n.preventDefault();w.verbose("Up key pressed, changing active item");r.removeClass(k.selected);u.addClass(k.selected);w.set.scrollPosition(u);n.preventDefault()}if(t==i.downArrow){if(u=o&&c?u=r.nextAll(g.item+":not("+g.unselectable+")").eq(0):tt.eq(0),0===u.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);u.addClass(k.selected);w.set.scrollPosition(u);n.preventDefault()}t==i.pageUp&&(w.scrollPage("up"),n.preventDefault());t==i.pageDown&&(w.scrollPage("down"),n.preventDefault());t==i.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else t==i.delimiter&&n.preventDefault(),t==i.downArrow&&(w.verbose("Down key pressed, showing dropdown"),w.show(),n.preventDefault())}else w.is.selection()&&!w.is.search()&&w.set.selectedLetter(String.fromCharCode(t))}},determine:{selectAction:function(t,i){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(this,t,i)):n.isFunction(b.action)?(w.verbose("Triggering user action",b.action,t,i),b.action.call(this,t,i)):w.error(ct.action,b.action)},eventInModule:function(t,r){var u=n(t.target),f=u.closest(i.documentElement).length>0,e=u.closest(d).length>0;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,i){var r=n(t.target),u=0===r.closest(g.siblingLabel).length,f=0===r.closest(nt).length;return i=n.isFunction(i)?i:function(){},u&&f?(w.verbose("Triggering event",i),i(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i){i=i!==r?i:t;w.set.selected(i,n(this));(!w.is.multiple()||w.is.allFiltered())&&w.hideAndClear()},select:function(){w.action.activate.call(this)},combo:function(t,i){i=i!==r?i:t;w.set.selected(i,n(this));w.hideAndClear()},hide:function(){w.hideAndClear()}},get:{id:function(){return wt},text:function(){return ot.text()},query:function(){return n.trim(ft.val())},searchWidth:function(n){return n*b.glyphWidth+"em"},selectionCount:function(){var t=w.get.values();return w.is.multiple()?n.isArray(t)?t.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=n.isArray(t)?t:[t],n.grep(t,function(n){return w.get.item(n)===!1})):!1},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(){var n,r,t=ft.get(0);return"selectionStart"in t?t.selectionStart:i.selection?(t.focus(),n=i.selection.createRange(),r=n.text.length,n.moveStart("character",-t.value.length),n.text.length-r):void 0},shortcutKeys:function(){return{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40}},value:function(){return rt.length>0?rt.val():d.data(ut.value)},values:function(){var n=w.get.value();return""===n?"":!rt.is("select")&&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]),i={},n.each(t,function(n,t){var r=w.read.remoteData(t);w.verbose("Restoring value from session data",r,t);i[t]=r?r:t})),i},choiceText:function(n,t){return t=t!==r?t:b.preserveHTML,n?(n.find(g.menu).length>0&&(w.verbose("Retreiving text of element with sub-menu"),n=n.clone(),n.find(g.menu).remove(),n.find(g.menuIcon).remove()),n.data(ut.text)!==r?n.data(ut.text):t?n.html().trim():n.text().trim()):void 0},choiceValue:function(n,t){return t=t||w.get.choiceText(n),n?n.data(ut.value)!==r?n.data(ut.value):"string"==typeof t?t.toLowerCase().trim():t:!1},inputEvent:function(){var n=ft[0];return n?n.oninput!==r?"input":n.onpropertychange!==r?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],d.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?(t.values.sort(function(n,t){return n.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retreived values from select",t),t},activeItem:function(){return tt.filter("."+k.active)},selectedItem:function(){var n=tt.not(g.unselectable).filter("."+k.selected);return n.length>0?n:tt.eq(0)},itemWithAdditions:function(n){var t=w.get.item(n),i=w.create.userChoice(n),r=i&&i.length>0;return r&&(t=t.length>0?t.add(i):i),t},item:function(t,i){var e,f,u=!1;return t=t!==r?t:w.get.values()!==r?w.get.values():w.get.text(),e=f?t.length>0:t!==r&&""!==t&&null!==t,f=w.is.multiple()&&n.isArray(t),i=""===t||0===t?!0:i||!1,e&&tt.each(function(){var e=n(this),s=w.get.choiceText(e),o=w.get.choiceValue(e,s);if(null!==o&&o!==r)if(f)(-1!==n.inArray(o.toString(),t)||-1!==n.inArray(s,t))&&(u=u?u.add(e):e);else if(i){if(w.verbose("Ambiguous dropdown value using strict type check",e,t),o===t||s===t)return u=e,!0}else if(o.toString()==t.toString()||s==t)return w.verbose("Found select item by value",o,t),u=e,!0}),u}},check:{maxSelections:function(n){return b.maxSelections?(n=n!==r?n:w.get.selectionCount(),n>=b.maxSelections?(w.debug("Maximum selection count reached"),tt.addClass(k.filtered),w.add.message(lt.maxSelections),!0):(w.verbose("No longer at maximum selection count"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filterItems(),!1)):!0}},restore:{defaults:function(){w.clear();w.restore.defaultText();w.restore.defaultValue()},defaultText:function(){var n=d.data(ut.defaultText);w.debug("Restoring default text",n);w.set.text(n);ot.addClass(k.placeholder)},defaultValue:function(){var n=d.data(ut.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(ct.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.restore.remoteValues():w.clearValue():w.set.selected();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;return t.Storage===r?void w.error(ct.noStorage):(i=sessionStorage.getItem(n),i!==r?i:!1)}},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);d.data(ut.defaultValue,n)},defaultText:function(){var n=w.get.text();w.verbose("Saving default text as",n);d.data(ut.defaultText,n)},placeholderText:function(){var n;ot.hasClass(k.placeholder)&&(n=w.get.text(),w.verbose("Saving placeholder text as",n),d.data(ut.placeholderText,n))},remoteData:function(n,i){return t.Storage===r?void w.error(ct.noStorage):(w.verbose("Saving remote data to session storage",i,n),void sessionStorage.setItem(i,n))}},clear:function(){w.is.multiple()?w.remove.labels():(w.remove.activeItem(),w.remove.selectedItem());w.set.placeholderText();w.clearValue()},clearValue:function(){w.set.value("")},scrollPage:function(n,t){var s,r,u,t=t||w.get.selectedItem(),f=t.closest(g.menu),c=f.outerHeight(),h=f.scrollTop(),o=tt.eq(0).outerHeight(),e=Math.floor(c/o),l=(f.prop("scrollHeight"),"up"==n?h-o*e:h+o*e),i=tt.not(g.unselectable);u="up"==n?i.index(t)-e:i.index(t)+e;s="up"==n?u>=0:u<i.length;r=s?i.eq(u):"up"==n?i.first():i.last();r.length>0&&(w.debug("Scrolling page",n,r),t.removeClass(k.selected),r.addClass(k.selected),f.scrollTop(l))},set:{filtered:function(){var t=w.is.multiple(),i=w.is.searchSelection(),r=t&&i,n=i?w.get.query():"",u="string"==typeof n&&n.length>0,f=w.get.searchWidth(n.length),e=""!==n;t&&u&&(w.verbose("Adjusting input width",f,b.glyphWidth),ft.css("width",f));u||r&&e?(w.verbose("Hiding placeholder text"),ot.addClass(k.filtered)):(!t||r&&!e)&&(w.verbose("Showing placeholder text"),ot.removeClass(k.filtered))},loading:function(){d.addClass(k.loading)},placeholderText:function(n){n=n||d.data(ut.placeholderText);n&&(w.debug("Restoring placeholder text"),w.set.text(n),ot.addClass(k.placeholder))},tabbable:function(){w.has.search()?(w.debug("Added tabindex to searchable dropdown"),ft.val("").attr("tabindex",0),nt.attr("tabindex",-1)):(w.debug("Added tabindex to dropdown"),d.attr("tabindex")||(d.attr("tabindex",0),nt.attr("tabindex",-1)))},initialLoad:function(){w.verbose("Setting initial load");kt=!0},scrollPosition:function(n,t){var i,o,u,e,s,f,h,c,l,a=5;n=n||w.get.selectedItem();i=n.closest(g.menu);o=n&&n.length>0;t=t!==r?t:!1;n&&i.length>0&&o&&(e=n.position().top,i.addClass(k.loading),f=i.scrollTop(),s=i.offset().top,e=n.offset().top,u=f-s+e,t||(h=i.height(),l=u+a>f+h,c=f>u-a),w.debug("Scrolling to active item",u),(t||c||l)&&i.scrollTop(u),i.removeClass(k.loading))},text:function(n){"select"!==b.action&&("combo"==b.action?(w.debug("Changing combo button text",n,bt),b.preserveHTML?bt.html(n):bt.text(n)):(w.debug("Changing text",n,ot),ot.removeClass(k.filtered).removeClass(k.placeholder),b.preserveHTML?ot.html(n):ot.text(n)))},selectedLetter:function(t){var u,r=tt.filter("."+k.selected),f=r.length>0&&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))},direction:function(n){"auto"==b.direction?w.is.onScreen(n)?w.remove.upward(n):w.set.upward(n):"upward"==b.direction&&w.set.upward(n)},upward:function(n){var t=n||d;t.addClass(k.upward)},value:function(n,t,i){var u=rt.length>0,r=(!w.has.value(n),w.get.values()),f="number"==typeof n?n.toString():n;if(u){if(f==r&&(w.verbose("Skipping value update already same value",n,r),!w.is.initialLoad()))return;rt.is("select")&&(b.allowAdditions||b.apiSettings)&&(w.debug("Adding an option to the select before setting the value",n),w.add.optionValue(n));w.debug("Updating input value",n,r);rt.val(n).trigger("change")}else w.verbose("Storing value in metadata",n,rt),n!==r&&d.data(ut.value,n);b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onChange):b.onChange.call(et,n,t,i)},active:function(){d.addClass(k.active)},multiple:function(){d.addClass(k.multiple)},visible:function(){d.addClass(k.visible)},selected:function(t,i){var r=w.is.multiple();i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t);i&&(w.debug("Setting selected menu item to",i),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.value(f,u,t),w.add.label(f,u,h),t.addClass(k.active),w.filterActive(),w.select.nextAvailable(i)):(w.set.text(w.add.variables(lt.count)),w.add.value(f,u,t),t.addClass(k.active))):e||(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,f=w.is.searchSelection()?ft:ot;return u=n("<a />").addClass(k.label).attr("data-value",t).html(dt.label(t,i)),u=b.onLabelCreate.call(u,t,i),w.has.label(t)?void w.debug("Label already exists, skipping",t):(b.label.variation&&u.addClass(b.label.variation),void(r===!0?(w.debug("Animating in label",u),u.addClass(k.hidden).insertBefore(f).transition(b.label.transition,b.label.duration)):(w.debug("Adding selection label",u),u.insertBefore(f))))},message:function(t){var i=nt.children(g.message),r=b.templates.message(w.add.variables(t));i.length>0?i.html(r):i=n("<div/>").html(r).addClass(k.message).appendTo(nt)},optionValue:function(t){var i=rt.find('option[value="'+t+'"]'),r=i.length>0;r||(ht&&(ht.disconnect(),w.verbose("Temporarily disconnecting mutation observer",t)),n("<option/>").prop("value",t).html(t).appendTo(rt),w.verbose("Adding user addition as an <option>",t),ht&&ht.observe(rt[0],{childList:!0,subtree:!0}))},userSuggestion:function(n){var i,t=nt.children(g.addition),r=w.get.item(n),u=t.length>0;if(!w.has.maxSelections()){if(""===n||r)return void t.remove();tt.removeClass(k.selected);u?(i=b.templates.addition(n),t.html(i).data(ut.value,n).removeClass(k.filtered).addClass(k.selected),w.verbose("Replacing user suggestion with new value",t)):(t=w.create.userChoice(n),t.prependTo(nt).addClass(k.selected),w.verbose("Adding item choice to menu corresponding with user choice addition",t))}},variables:function(n){var t,i,r=-1!==n.search("{count}"),u=-1!==n.search("{maxCount}"),f=-1!==n.search("{term}");return w.verbose("Adding templated variables to message",n),r&&(t=w.get.selectionCount(),n=n.replace("{count}",t)),u&&(t=w.get.selectionCount(),n=n.replace("{maxCount}",b.maxSelections)),f&&(i=w.get.query(),n=n.replace("{term}",i)),n},value:function(t,i,r){var u,f=w.get.values();return""===t?void w.debug("Cannot select blank values from multiselect"):(n.isArray(f)?(u=f.concat([t]),u=w.get.uniqueArray(u)):u=[t],rt.is("select")?(b.allowAdditions||b.apiSettings)&&(w.debug("Adding value to select",t,u,rt),w.add.optionValue(t)):(u=u.join(b.delimiter),w.debug("Setting hidden input to delimited value",u,rt)),b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onAdd):b.onAdd.call(et,t,i,r),w.set.value(u,t,i,r),void w.check.maxSelections())}},remove:{active:function(){d.removeClass(k.active)},activeLabel:function(){d.find(g.label).removeClass(k.active)},loading:function(){d.removeClass(k.loading)},initialLoad:function(){kt=!1},upward:function(n){var t=n||d;t.removeClass(k.upward)},visible:function(){d.removeClass(k.visible)},activeItem:function(){tt.removeClass(k.active)},filteredItem:function(){w.has.maxSelections()||(b.useLabels?tt.not("."+k.active).removeClass(k.filtered):tt.removeClass(k.filtered))},message:function(){nt.children(g.message).remove()},searchTerm:function(){w.verbose("Cleared search term");ft.val("");w.set.filtered()},selected:function(t,i){return(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t))?void 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),w.set.text(w.add.variables(lt.count))):w.remove.value(r,i,t);t.removeClass(k.filtered).removeClass(k.active);b.useLabels&&t.removeClass(k.selected)}):!1},selectedItem:function(){tt.removeClass(k.selected)},value:function(n,t,i){var r,u=rt.val();rt.is("select")?(w.verbose("Input is <select> removing selected option",n),r=w.remove.arrayValue(n,u)):(w.verbose("Removing from delimited values",n),u=u.split(b.delimiter),r=w.remove.arrayValue(n,u),r=r.join(b.delimiter));b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onRemove):b.onRemove.call(et,n,t,i);w.set.value(r,t,i);w.check.maxSelections()},arrayValue:function(t,i){return i=n.grep(i,function(n){return t!=n}),w.verbose("Removed value from delimited string",t,i),i},label:function(n){var i=d.find(g.label),t=i.filter('[data-value="'+n+'"]'),r=i.length,u=i.index(t)+1==r,f=(!w.is.searchSelection()||!w.is.focusedOnSearch())&&u;f?(w.verbose("Animating and removing label",t),t.transition(b.label.transition,b.label.duration,function(){t.remove()})):(w.verbose("Removing label",t),t.remove())},activeLabels:function(n){n=n||d.find(g.label).filter("."+k.active);w.verbose("Removing active label selections",n);w.remove.labels(n)},labels:function(t){t=t||d.find(g.label);w.verbose("Removing labels",t);t.each(function(){var t=n(this).data("value"),i=w.is.userValue(t);i?(w.remove.value(t),w.remove.label(t)):w.remove.selected(t)})},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),ft.attr("tabindex","-1"),nt.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),d.attr("tabindex","-1"),nt.attr("tabindex","-1"))}},has:{search:function(){return ft.length>0},firstLetter:function(n,t){var i,r;return n&&0!==n.length&&"string"==typeof t?(i=w.get.choiceText(n,!1),t=t.toLowerCase(),r=String(i).charAt(0).toLowerCase(),t==r):!1},input:function(){return rt.length>0},items:function(){return tt.length>0},menu:function(){return nt.length>0},message:function(){return 0!==nt.children(g.message).length},label:function(n){var t=d.find(g.label);return t.filter('[data-value="'+n+'"]').length>0},maxSelections:function(){return b.maxSelections&&w.get.selectionCount()>=b.maxSelections},allResultsFiltered:function(){return tt.filter(g.unselectable).length===tt.length},value:function(t){var i=w.get.values(),r=n.isArray(i)?i&&-1!==n.inArray(t,i):i==t;return r?!0:!1}},is:{active:function(){return d.hasClass(k.active)},alreadySetup:function(){return d.is("select")&&d.parent(g.dropdown).length>0&&0===d.prev().length},animating:function(n){return n?n.transition&&n.transition("is animating"):nt.transition&&nt.transition("is animating")},disabled:function(){d.hasClass(k.disabled)},focused:function(){return i.activeElement===d[0]},focusedOnSearch:function(){return i.activeElement===ft[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(n){return!w.is.visible(n)},initialLoad:function(){return kt},onScreen:function(n){var t,r=n||nt,u=!0,i={};return r.addClass(k.loading),t={context:{scrollTop:ii.scrollTop(),height:ii.outerHeight()},menu:{offset:r.offset(),height:r.outerHeight()}},i={above:t.context.scrollTop<=t.menu.offset.top-t.menu.height,below:t.context.scrollTop+t.context.height>=t.menu.offset.top+t.menu.height},i.below?(w.verbose("Dropdown can fit in context downward",i),u=!0):i.below||i.above?(w.verbose("Dropdown cannot fit below, opening upward",i),u=!1):(w.verbose("Dropdown cannot fit in either direction, favoring downward",i),u=!0),r.removeClass(k.loading),u},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return(r=!0,!0)}),r},multiple:function(){return d.hasClass(k.multiple)},single:function(){return!w.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(r.target&&n(r.target).is("select"))return(i=!0,!0)}),i},search:function(){return d.hasClass(k.search)},searchSelection:function(){return w.has.search()&&0===ft.closest(g.menu).length},selection:function(){return d.hasClass(k.selection)},userValue:function(t){return-1!==n.inArray(t,w.get.userValues())},upward:function(n){var t=n||d;return t.hasClass(k.upward)},visible:function(n){return n?n.hasClass(k.visible):nt.hasClass(k.visible)}},can:{click:function(){return h||"click"==b.on},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(et)):n.fn.transition!==r&&d.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(et)}}):w.error(ct.noTransition,f))},hide:function(t,i){var u=i||nt,f=(i?.9*b.duration:b.duration,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(et)):n.fn.transition!==r&&d.transition("is supported")?u.transition({animation:e+" out",duration:b.duration,debug:b.debug,verbose:b.verbose,queue:!0,onStart:f,onComplete:function(){"auto"==b.direction&&w.remove.upward(i);t.call(et)}}):w.error(ct.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:{regExp:function(n){return n=String(n),n.replace(ri.escape,"\\$&")}},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];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.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.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(){w.error=Function.prototype.bind.call(console.error,console,b.name+":");w.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;b.performance&&(t=(new Date).getTime(),r=c||t,i=t-r,c=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:et,"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";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&s.length>0&&(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=vt;return i=i||y,u=et||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):(w.error(ct.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};v?(vt===r&&w.initialize(),w.invoke(l)):(vt!==r&&vt.invoke("destroy"),w.initialize())}),f!==r?f:e};n.fn.dropdown.settings={debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",apiSettings:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.0714,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)},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.",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>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},selector:{addition:".addition",dropdown:".ui.dropdown",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",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}};n.fn.dropdown.settings.templates={dropdown:function(t){var r=t.placeholder||!1,i=(t.values||{},"");return i+='<i class="dropdown icon"><\/i>',i+=t.placeholder?'<div class="default text">'+r+"<\/div>":'<div class="text"><\/div>',i+='<div class="menu">',n.each(t.values,function(n,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"<\/div>":'<div class="item" data-value="'+t.value+'">'+t.name+"<\/div>"}),i+="<\/div>"},menu:function(t){var i=(t.values||{},"");return n.each(t.values,function(n,t){i+='<div class="item" data-value="'+t.value+'">'+t.name+"<\/div>"}),i},label:function(n,t){return t+'<i class="delete icon"><\/i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.embed=function(i){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return e.each(function(){var a,v=n.isPlainObject(i)?n.extend(!0,{},n.fn.embed.settings,i):n.extend({},n.fn.embed.settings),b=v.selector,nt=v.className,w=v.sources,rt=v.error,p=v.metadata,ut=v.namespace,ft=v.templates,tt="."+ut,it="module-"+ut,y=(n(t),n(this)),et=y.find(b.placeholder),ot=y.find(b.icon),g=y.find(b.embed),k=this,d=y.data(it);a={initialize:function(){a.debug("Initializing embed");a.determine.autoplay();a.create();a.bind.events();a.instantiate()},instantiate:function(){a.verbose("Storing instance of module",a);d=a;y.data(it,a)},destroy:function(){a.verbose("Destroying previous instance of embed");a.reset();y.removeData(it).off(tt)},refresh:function(){a.verbose("Refreshing selector cache");et=y.find(b.placeholder);ot=y.find(b.icon);g=y.find(b.embed)},bind:{events:function(){a.has.placeholder()&&(a.debug("Adding placeholder events"),console.log(y,b.placeholder),y.on("click"+tt,b.placeholder,a.createAndShow).on("click"+tt,b.icon,a.createAndShow))}},create:function(){var n=a.get.placeholder();n?a.createPlaceholder():a.createAndShow()},createPlaceholder:function(n){var t=a.get.icon(),i=a.get.url();a.generate.embed(i);n=n||a.get.placeholder();y.html(ft.placeholder(n,t));a.debug("Creating placeholder for embed",n,t)},createEmbed:function(t){a.refresh();t=t||a.get.url();console.log(t);g=n("<div/>").addClass(nt.embed).html(a.generate.embed(t)).appendTo(y);v.onCreate.call(k,t);a.debug("Creating embed object",g)},createAndShow:function(){console.log("cands");a.createEmbed();a.show()},change:function(n,t,i){a.debug("Changing video to ",n,t,i);y.data(p.source,n).data(p.id,t).data(p.url,i);a.create()},reset:function(){a.debug("Clearing embed and showing placeholder");a.remove.active();a.remove.embed();a.showPlaceholder();v.onReset.call(k)},show:function(){a.debug("Showing embed");a.set.active();v.onDisplay.call(k)},hide:function(){a.debug("Hiding embed");a.showPlaceholder()},showPlaceholder:function(){a.debug("Showing placeholder image");a.remove.active();v.onPlaceholderDisplay.call(k)},get:{id:function(){return v.id||y.data(p.id)},placeholder:function(){return v.placeholder||y.data(p.placeholder)},icon:function(){return v.icon?v.icon:y.data(p.icon)!==r?y.data(p.icon):a.determine.icon()},source:function(){return v.source?v.source:y.data(p.source)!==r?y.data(p.source):a.determine.source()},type:function(){var n=a.get.source();return w[n]!==r?w[n].type:!1},url:function(){return v.url?v.url:y.data(p.url)!==r?y.data(p.url):a.determine.url()}},determine:{autoplay:function(){a.should.autoplay()&&(v.autoplay=!0)},source:function(t){var i=!1;return t=t||a.get.url(),t&&n.each(w,function(n,r){if(-1!==t.search(r.domain))return(i=n,!1)}),i},icon:function(){var n=a.get.source();return w[n]!==r?w[n].icon:!1},url:function(){var n,i=v.id||y.data(p.id),t=v.source||y.data(p.source);return n=w[t]!==r?w[t].url.replace("{id}",i):!1,n&&y.data(p.url,n),n}},set:{active:function(){y.addClass(nt.active)}},remove:{active:function(){y.removeClass(nt.active)},embed:function(){g.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){a.debug("Generating embed html");var t,i,r=a.get.source();return n=a.get.url(n),n?(i=a.generate.parameters(r),t=ft.iframe(n,i)):a.error(rt.noURL,y),t},parameters:function(t,i){var u=w[t]&&w[t].parameters!==r?w[t].parameters(v):{};return i=i||v.parameters,i&&(u=n.extend({},u,i)),u=v.onEmbed(u),a.encode.parameters(u)}},has:{placeholder:function(){return v.placeholder||y.data(p.placeholder)}},should:{autoplay:function(){return"auto"===v.autoplay?v.placeholder||y.data(p.placeholder)!==r:v.autoplay}},is:{video:function(){return"video"==a.get.type()}},setting:function(t,i){if(a.debug("Changing setting",t,i),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,a,t);else{if(i===r)return a[t];a[t]=i}},debug:function(){v.debug&&(v.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,v.name+":"),a.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,v.name+":");a.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:k,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(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=d;return i=i||l,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],!1):(a.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(d===r&&a.initialize(),a.invoke(h)):(d!==r&&d.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.embed.settings={name:"Embed",namespace:"embed",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.colors||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.colors||r,portrait:n.brandedUI,title:n.brandedUI}}}},templates:{iframe:function(n,t){return'<iframe src="'+n+"?="+t+'" width="100%" height="100%" frameborder="0" scrolling="no" 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:!0,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.modal=function(u){var f,c=n(this),l=n(t),s=n(i),o=n("body"),a=c.selector||"",h=(new Date).getTime(),e=[],v=arguments[0],y="string"==typeof v,p=[].slice.call(arguments,1),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return c.each(function(){var vt,it,et,d,st,ft,ht,ct,c,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.modal.settings,u):n.extend({},n.fn.modal.settings),rt=b.selector,g=b.className,yt=b.namespace,ot=b.error,nt="."+yt,lt="module-"+yt,k=n(this),at=n(b.context),pt=k.find(rt.close),tt=this,ut=k.data(lt);c={initialize:function(){c.verbose("Initializing dimmer",at);c.create.id();c.create.dimmer();c.refreshModals();c.bind.events();b.observeChanges&&c.observeChanges();c.instantiate()},instantiate:function(){c.verbose("Storing instance of modal");ut=c;k.data(lt,ut)},create:{dimmer:function(){var i={debug:b.debug,dimmerName:"modals",duration:{show:b.duration,hide:b.duration}},t=n.extend(!0,i,b.dimmerSettings);return b.inverted&&(t.variation=t.variation!==r?t.variation+" inverted":"inverted"),n.fn.dimmer===r?void c.error(ot.dimmer):(c.debug("Creating dimmer with settings",t),d=at.dimmer(t),b.detachable?(c.verbose("Modal is detachable, moving content into dimmer"),d.dimmer("add content",k)):c.set.undetached(),b.blurring&&d.addClass(g.blurring),void(st=d.dimmer("get dimmer")))},id:function(){ht=(Math.random().toString(16)+"000000000").substr(2,8);ft="."+ht;c.verbose("Creating unique id for element",ht)}},destroy:function(){c.verbose("Destroying previous modal");k.removeData(lt).off(nt);l.off(ft);pt.off(nt);at.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(ct=new MutationObserver(function(){c.debug("DOM tree modified, refreshing");c.refresh()}),ct.observe(tt,{childList:!0,subtree:!0}),c.debug("Setting up mutation observer",ct))},refresh:function(){c.remove.scrolling();c.cacheSizes();c.set.screenHeight();c.set.type();c.set.position()},refreshModals:function(){it=k.siblings(rt.modal);vt=it.add(k)},attachEvents:function(t,i){var r=n(t);i=n.isFunction(c[i])?c[i]:c.toggle;r.length>0?(c.debug("Attaching modal events to element",t,i),r.off(nt).on("click"+nt,i)):c.error(ot.notFound,t)},bind:{events:function(){c.verbose("Attaching events");k.on("click"+nt,rt.close,c.event.close).on("click"+nt,rt.approve,c.event.approve).on("click"+nt,rt.deny,c.event.deny);l.on("resize"+ft,c.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){return b.onApprove.call(tt,n(this))===!1?void c.verbose("Approve callback returned false cancelling hide"):void c.hide()},deny:function(){return b.onDeny.call(tt,n(this))===!1?void c.verbose("Deny callback returned false cancelling hide"):void c.hide()},close:function(){c.hide()},click:function(t){var r=n(t.target),u=r.closest(rt.modal).length>0,f=n.contains(i.documentElement,t.target);!u&&f&&(c.debug("Dimmer clicked, hiding all modals"),c.is.active()&&(c.remove.clickaway(),b.allowMultiple?c.hide():c.hideAll()))},debounce:function(n,t){clearTimeout(c.timer);c.timer=setTimeout(n,t)},keyboard:function(n){var t=n.which;t==27&&(b.closable?(c.debug("Escape key pressed hiding modal"),c.hide()):c.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){d.dimmer("is active")&&w(c.refresh)}},toggle:function(){c.is.active()||c.is.animating()?c.hide():c.show()},show:function(t){t=n.isFunction(t)?t:function(){};c.refreshModals();c.showModal(t)},hide:function(t){t=n.isFunction(t)?t:function(){};c.refreshModals();c.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){};c.is.animating()||!c.is.active()?(c.showDimmer(),c.cacheSizes(),c.set.position(),c.set.screenHeight(),c.set.type(),c.set.clickaway(),!b.allowMultiple&&c.others.active()?c.hideOthers(c.showModal):(b.onShow.call(tt),b.transition&&n.fn.transition!==r&&k.transition("is supported")?(c.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(tt);c.add.keyboardShortcuts();c.save.focus();c.set.active();c.set.autofocus();t()}})):c.error(ot.noTransition))):c.debug("Modal is already visible")},hideModal:function(t,i){t=n.isFunction(t)?t:function(){};c.debug("Hiding modal");b.onHide.call(tt);(c.is.animating()||c.is.active())&&(b.transition&&n.fn.transition!==r&&k.transition("is supported")?(c.remove.active(),k.transition({debug:b.debug,animation:b.transition+" out",queue:b.queue,duration:b.duration,useFailSafe:!0,onStart:function(){c.others.active()||i||c.hideDimmer();c.remove.keyboardShortcuts()},onComplete:function(){b.onHidden.call(tt);c.restore.focus();t()}})):c.error(ot.noTransition))},showDimmer:function(){d.dimmer("is animating")||!d.dimmer("is active")?(c.debug("Showing dimmer"),d.dimmer("show")):c.debug("Dimmer already visible")},hideDimmer:function(){return d.dimmer("is animating")||d.dimmer("is active")?void d.dimmer("hide",function(){c.remove.clickaway();c.remove.screenHeight()}):void c.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var i=vt.filter("."+g.active+", ."+g.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(c.debug("Hiding all visible modals"),c.hideDimmer(),i.modal("hide modal",t))},hideOthers:function(t){var i=it.filter("."+g.active+", ."+g.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(c.debug("Hiding other modals",it),i.modal("hide modal",t,!0))},others:{active:function(){return it.filter("."+g.active).length>0},animating:function(){return it.filter("."+g.animating).length>0}},add:{keyboardShortcuts:function(){c.verbose("Adding keyboard shortcuts");s.on("keyup"+nt,c.event.keyboard)}},save:{focus:function(){et=n(i.activeElement).blur()}},restore:{focus:function(){et&&et.length>0&&et.focus()}},remove:{active:function(){k.removeClass(g.active)},clickaway:function(){b.closable&&st.off("click"+ft)},bodyStyle:function(){""===o.attr("style")&&(c.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){c.debug("Removing page height");o.css("height","")},keyboardShortcuts:function(){c.verbose("Removing keyboard shortcuts");s.off("keyup"+nt)},scrolling:function(){d.removeClass(g.scrolling);k.removeClass(g.scrolling)}},cacheSizes:function(){var u=k.outerHeight();(c.cache===r||0!==u)&&(c.cache={pageHeight:n(i).outerHeight(),height:u+b.offset,contextHeight:"body"==b.context?n(t).height():d.height()});c.debug("Caching modal and container sizes",c.cache)},can:{fit:function(){return c.cache.height+2*b.padding<c.cache.contextHeight}},is:{active:function(){return k.hasClass(g.active)},animating:function(){return k.transition("is supported")?k.transition("is animating"):k.is(":visible")},scrolling:function(){return d.hasClass(g.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){if(b.autofocus){var n=k.filter(":input").filter(":visible"),t=n.filter("[autofocus]"),i=t.length>0?t.first():n.first();i.length>0&&i.focus()}},clickaway:function(){b.closable&&st.on("click"+ft,c.event.click)},screenHeight:function(){c.can.fit()?o.css("height",""):(c.debug("Modal is taller than page content, resizing page height"),o.css("height",c.cache.height+2*b.padding))},active:function(){k.addClass(g.active)},scrolling:function(){d.addClass(g.scrolling);k.addClass(g.scrolling)},type:function(){c.can.fit()?(c.verbose("Modal fits on screen"),c.others.active()||c.others.animating()||c.remove.scrolling()):(c.verbose("Modal cannot fit on screen setting to scrolling"),c.set.scrolling())},position:function(){c.verbose("Centering modal on page",c.cache);k.css(c.can.fit()?{top:"",marginTop:-(c.cache.height/2)}:{marginTop:"",top:s.scrollTop()})},undetached:function(){d.addClass(g.undetached)}},setting:function(t,i){if(c.debug("Changing setting",t,i),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,c,t);else{if(i===r)return c[t];c[t]=i}},debug:function(){b.debug&&(b.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,b.name+":"),c.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,b.name+":");c.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;b.performance&&(t=(new Date).getTime(),r=h||t,i=t-r,h=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(c.performance.timer);c.performance.timer=setTimeout(c.performance.display,500)},display:function(){var t=b.name+":",i=0;h=!1;clearTimeout(c.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(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||p,u=tt||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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(ut===r&&c.initialize(),c.invoke(v)):(ut!==r&&ut.invoke("destroy"),c.initialize())}),f!==r?f:this};n.fn.modal.settings={name:"Modal",namespace:"modal",debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,dimmerSettings:{closable:!1,useCSS:!0},context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){},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"},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",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.nag=function(i){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],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),b=(o.className,o.selector),y=o.error,k=o.namespace,d="."+k,w=k+"-module",v=n(this),g=(v.find(b.close),n(o.context?o.context:"body")),nt=this,p=v.data(w);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};a={initialize:function(){a.verbose("Initializing element");v.on("click"+d,b.close,a.dismiss).data(w,a);o.detachable&&v.parent()[0]!==g[0]&&v.detach().prependTo(g);o.displayTime>0&&setTimeout(a.hide,o.displayTime);a.show()},destroy:function(){a.verbose("Destroying instance");v.removeData(w).off(d)},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(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):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();"local"==o.storageMethod&&t.store!==r?t.localStorage.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];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.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.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(){a.error=Function.prototype.bind.call(console.error,console,o.name+":");a.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;o.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"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)&&f.length>0&&(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=nt||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):(a.error(y.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.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",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(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.popup=function(u){var f,c=n(this),e=n(i),o=n(t),l=n("body"),a=c.selector||"",y="ontouchstart"in i.documentElement,h=(new Date).getTime(),s=[],v=arguments[0],p="string"==typeof v,w=[].slice.call(arguments,1);return c.each(function(){var b,rt,it,st,i,c=n.isPlainObject(u)?n.extend(!0,{},n.fn.popup.settings,u):n.extend({},n.fn.popup.settings),ot=c.selector,d=c.className,ht=c.error,g=c.metadata,yt=c.namespace,ut="."+c.namespace,vt="module-"+yt,k=n(this),ct=n(c.context),tt=c.target?n(c.target):k,lt=0,ft=!1,at=!1,nt=this,et=k.data(vt);i={initialize:function(){i.debug("Initializing",k);i.createID();i.bind.events();!i.exists()&&c.preserve&&i.create();i.instantiate()},instantiate:function(){i.verbose("Storing instance",i);et=i;k.data(vt,et)},refresh:function(){c.popup?b=n(c.popup).eq(0):c.inline&&(b=tt.next(ot.popup).eq(0),c.popup=b);c.popup?(b.addClass(d.loading),rt=i.get.offsetParent(),b.removeClass(d.loading),c.movePopup&&i.has.popup()&&i.get.offsetParent(b)[0]!==rt[0]&&(i.debug("Moving popup to the same offset parent as activating element"),b.detach().appendTo(rt))):rt=c.inline?i.get.offsetParent(tt):i.has.popup()?i.get.offsetParent(b):l;rt.is("html")&&(i.debug("Setting page as offset parent"),rt=l)},reposition:function(){i.refresh();i.set.position()},destroy:function(){i.debug("Destroying previous module");b&&!c.preserve&&i.removePopup();clearTimeout(i.hideTimer);clearTimeout(i.showTimer);o.off(it);k.off(ut).removeData(vt)},event:{start:function(){var t=n.isPlainObject(c.delay)?c.delay.show:c.delay;clearTimeout(i.hideTimer);i.showTimer=setTimeout(i.show,t)},end:function(){var t=n.isPlainObject(c.delay)?c.delay.hide:c.delay;clearTimeout(i.showTimer);i.hideTimer=setTimeout(i.hide,t)},touchstart:function(){at=!0;i.event.start()},resize:function(){i.is.visible()&&i.set.position()},hideGracefully:function(t){t&&0===n(t.target).closest(ot.popup).length?(i.debug("Click occurred outside popup hiding popup"),i.hide()):i.debug("Click was inside popup, keeping popup open")}},create:function(){var t=i.get.html(),r=i.get.variation(),u=i.get.title(),f=i.get.content();t||f||u?(i.debug("Creating pop-up html"),t||(t=c.templates.popup({title:u,content:f})),b=n("<div/>").addClass(d.popup).addClass(r).data(g.activator,k).html(t),r&&b.addClass(r),c.inline?(i.verbose("Inserting popup element inline",b),b.insertAfter(k)):(i.verbose("Appending popup element to body",b),b.appendTo(ct)),i.refresh(),c.hoverable&&i.bind.popup(),c.onCreate.call(b,nt)):0!==tt.next(ot.popup).length?(i.verbose("Pre-existing popup found"),c.inline=!0,c.popups=tt.next(ot.popup).data(g.activator,k),i.refresh(),c.hoverable&&i.bind.popup()):c.popup?(n(c.popup).data(g.activator,k),i.verbose("Used popup specified in settings"),i.refresh(),c.hoverable&&i.bind.popup()):i.debug("No content specified skipping display",nt)},createID:function(){st=(Math.random().toString(16)+"000000000").substr(2,8);it="."+st;i.verbose("Creating unique id for element",st)},toggle:function(){i.debug("Toggling pop-up");i.is.hidden()?(i.debug("Popup is hidden, showing pop-up"),i.unbind.close(),i.show()):(i.debug("Popup is visible, hiding pop-up"),i.hide())},show:function(n){if(n=n||function(){},i.debug("Showing pop-up",c.transition),i.is.hidden()&&(!i.is.active()||!i.is.dropdown())){if(i.exists()||i.create(),c.onShow.call(b,nt)===!1)return void i.debug("onShow callback returned false, cancelling popup animation");c.preserve||c.popup||i.refresh();b&&i.set.position()&&(i.save.conditions(),c.exclusive&&i.hideAll(),i.animate.show(n))}},hide:function(n){if(n=n||function(){},i.is.visible()||i.is.animating()){if(c.onHide.call(b,nt)===!1)return void i.debug("onHide callback returned false, cancelling popup animation");i.remove.visible();i.unbind.close();i.restore.conditions();i.animate.hide(n)}},hideAll:function(){n(ot.popup).filter("."+d.visible).each(function(){n(this).data(g.activator).popup("hide")})},exists:function(){return b?c.inline||c.popup?i.has.popup():b.closest(ct).length>=1?!0:!1:!1},removePopup:function(){i.debug("Removing popup",b);i.has.popup()&&!c.popup&&(b.remove(),b=r);c.onRemove.call(b,nt)},save:{conditions:function(){i.cache={title:k.attr("title")};i.cache.title&&k.removeAttr("title");i.verbose("Saving original attributes",i.cache.title)}},restore:{conditions:function(){return i.cache&&i.cache.title&&(k.attr("title",i.cache.title),i.verbose("Restoring original attributes",i.cache.title)),!0}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};c.transition&&n.fn.transition!==r&&k.transition("is supported")?(i.set.visible(),b.transition({animation:c.transition+" in",queue:!1,debug:c.debug,verbose:c.verbose,duration:c.duration,onComplete:function(){i.bind.close();t.call(b,nt);c.onVisible.call(b,nt)}})):i.error(ht.noTransition)},hide:function(t){return t=n.isFunction(t)?t:function(){},i.debug("Hiding pop-up"),c.onShow.call(b,nt)===!1?void i.debug("onShow callback returned false, cancelling popup animation"):void(c.transition&&n.fn.transition!==r&&k.transition("is supported")?b.transition({animation:c.transition+" out",queue:!1,duration:c.duration,debug:c.debug,verbose:c.verbose,onComplete:function(){i.reset();t.call(b,nt);c.onHidden.call(b,nt)}}):i.error(ht.noTransition))}},get:{html:function(){return k.removeData(g.html),k.data(g.html)||c.html},title:function(){return k.removeData(g.title),k.data(g.title)||c.title},content:function(){return k.removeData(g.content),k.data(g.content)||k.attr("title")||c.content},variation:function(){return k.removeData(g.variation),k.data(g.variation)||c.variation},calculations:function(){var n,u=tt[0],f=c.inline||c.popup?tt.position():tt.offset(),r={};return r={target:{element:tt[0],width:tt.outerWidth(),height:tt.outerHeight(),top:f.top,left:f.left,margin:{}},popup:{width:b.outerWidth(),height:b.outerHeight()},parent:{width:rt.outerWidth(),height:rt.outerHeight()},screen:{scroll:{top:o.scrollTop(),left:o.scrollLeft()},width:o.width(),height:o.height()}},r.target.margin.top=c.inline?parseInt(t.getComputedStyle(u).getPropertyValue("margin-top"),10):0,r.target.margin.left=c.inline?i.is.rtl()?parseInt(t.getComputedStyle(u).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(u).getPropertyValue("margin-left"),10):0,n=r.screen,r.boundary={top:n.scroll.top,bottom:n.scroll.top+n.height,left:n.scroll.left,right:n.scroll.left+n.width},r},id:function(){return st},startEvent:function(){return"hover"==c.on?"mouseenter":"focus"==c.on?"focus":!1},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==c.on?"mouseleave":"focus"==c.on?"blur":!1},offsetParent:function(t){var s=t!==r?t[0]:k[0],u=s.parentNode,i=n(u);if(u)for(var f="none"===i.css("transform"),e="static"===i.css("position"),o=i.is("html");u&&!o&&e&&f;)u=u.parentNode,i=n(u),f="none"===i.css("transform"),e="static"===i.css("position"),o=i.is("html");return i&&i.length>0?i:n()},offstagePosition:function(t,r){var e,f,u=b.offset(),o={},s=[];return t=t||!1,r=r||i.get.calculations(),e=r.popup,f=r.boundary,u&&t&&(o={top:u.top<f.top,bottom:u.top+e.height>f.bottom,right:u.left+e.width>f.right,left:u.left<f.left},i.verbose("Offstage positions determined",u,o)),n.each(o,function(n,t){t&&s.push(n)}),s.length>0?s.join(" "):!1},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 u=n.split(" "),r=u[0],f=u[1],s="top"==r||"bottom"==r,e=!1,o=!1,t=!1;return ft||(i.verbose("All available positions available"),ft=i.get.positions()),i.debug("Recording last position tried",n),ft[n]=!0,"opposite"===c.prefer&&(t=[{top:"bottom",bottom:"top",left:"right",right:"left"}[r],f],t=t.join(" "),e=ft[t]===!0,i.debug("Trying opposite strategy",t)),"adjacent"===c.prefer&&s&&(t=[r,{left:"center",center:"right",right:"left"}[f]],t=t.join(" "),o=ft[t]===!0,i.debug("Trying adjacent strategy",t)),(o||e)&&(i.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===tt.length||0===b.length)return void i.error(ht.notFound);var f,e,u,h,s,o,l;if(t=t||i.get.calculations(),n=n||k.data(g.position)||c.position,f=k.data(g.offset)||c.offset,e=c.distanceAway,u=t.target,h=t.popup,s=t.parent,0===u.width&&0===u.height)return i.debug("Popup target is hidden, no action taken"),!1;switch(c.inline&&(i.debug("Adding margin to calculation",u.margin),"left center"==n||"right center"==n?(f+=u.margin.top,e+=-u.margin.left):"top left"==n||"top center"==n||"top right"==n?(f+=u.margin.left,e-=u.margin.top):(f+=u.margin.left,e+=u.margin.top)),i.debug("Determining popup position from calculations",n,t),i.is.rtl()&&(n=n.replace(/left|right/g,function(n){return"left"==n?"right":"left"}),i.debug("RTL: Popup position updated",n)),lt==c.maxSearchDepth&&c.lastResort&&(i.debug('Using "last resort" position to display',c.lastResort),n=c.lastResort),n){case"top left":o={top:"auto",bottom:s.height-u.top+e,left:u.left+f,right:"auto"};break;case"top center":o={bottom:s.height-u.top+e,left:u.left+u.width/2-h.width/2+f,top:"auto",right:"auto"};break;case"top right":o={bottom:s.height-u.top+e,right:s.width-u.left-u.width-f,top:"auto",left:"auto"};break;case"left center":o={top:u.top+u.height/2-h.height/2+f,right:s.width-u.left+e,left:"auto",bottom:"auto"};break;case"right center":o={top:u.top+u.height/2-h.height/2+f,left:u.left+u.width+e,bottom:"auto",right:"auto"};break;case"bottom left":o={top:u.top+u.height+e,left:u.left+f,bottom:"auto",right:"auto"};break;case"bottom center":o={top:u.top+u.height+e,left:u.left+u.width/2-h.width/2+f,bottom:"auto",right:"auto"};break;case"bottom right":o={top:u.top+u.height+e,right:s.width-u.left-u.width-f,left:"auto",bottom:"auto"}}if(o===r&&i.error(ht.invalidPosition,n),i.debug("Calculated popup positioning values",o),b.css(o).removeClass(d.position).addClass(n).addClass(d.loading),l=i.get.offstagePosition(n,t)){if(i.debug("Popup cant fit into viewport",n,l),lt<c.maxSearchDepth)return lt++,n=i.get.nextPosition(n),i.debug("Trying new position",n),b?i.set.position(n,t):!1;if(!c.lastResort)return i.debug("Popup could not find a position in view",b),i.remove.attempts(),i.remove.loading(),i.reset(),!1}return i.debug("Position is on stage",n),i.remove.attempts(),i.set.fluidWidth(t),i.remove.loading(),!0},fluidWidth:function(n){n=n||i.get.calculations();c.setFluidWidth&&b.hasClass(d.fluid)&&b.css("width",n.parent.width)},visible:function(){k.addClass(d.visible)}},remove:{loading:function(){b.removeClass(d.loading)},visible:function(){k.removeClass(d.visible)},attempts:function(){i.verbose("Resetting all searched positions");lt=0;ft=!1}},bind:{events:function(){i.debug("Binding popup events to module");"click"==c.on&&k.on("click"+ut,i.toggle);"hover"==c.on&&y?k.on("touchstart"+ut,i.event.touchstart):i.get.startEvent()&&k.on(i.get.startEvent()+ut,i.event.start).on(i.get.endEvent()+ut,i.event.end);c.target&&i.debug("Target set to element",tt);o.on("resize"+it,i.event.resize)},popup:function(){i.verbose("Allowing hover events on popup to prevent closing");b&&i.has.popup()&&b.on("mouseenter"+ut,i.event.start).on("mouseleave"+ut,i.event.end)},close:function(){(c.hideOnScroll===!0||"auto"==c.hideOnScroll&&"click"!=c.on)&&(e.one(i.get.scrollEvent()+it,i.event.hideGracefully),ct.one(i.get.scrollEvent()+it,i.event.hideGracefully));"hover"==c.on&&at&&(i.verbose("Binding popup close event to document"),e.on("touchstart"+it,function(n){i.verbose("Touched away from popup");i.event.hideGracefully.call(nt,n)}));"click"==c.on&&c.closable&&(i.verbose("Binding popup close event to document"),e.on("click"+it,function(n){i.verbose("Clicked away from popup");i.event.hideGracefully.call(nt,n)}))}},unbind:{close:function(){(c.hideOnScroll===!0||"auto"==c.hideOnScroll&&"click"!=c.on)&&(e.off("scroll"+it,i.hide),ct.off("scroll"+it,i.hide));"hover"==c.on&&at&&(e.off("touchstart"+it),at=!1);"click"==c.on&&c.closable&&(i.verbose("Removing close event from document"),e.off("click"+it))}},has:{popup:function(){return b&&b.length>0}},is:{active:function(){return k.hasClass(d.active)},animating:function(){return b&&b.hasClass(d.animating)},visible:function(){return b&&b.hasClass(d.visible)},dropdown:function(){return k.hasClass(d.dropdown)},hidden:function(){return!i.is.visible()},rtl:function(){return"rtl"==k.css("direction")}},reset:function(){i.remove.visible();c.preserve?n.fn.transition!==r&&b.transition("remove transition"):i.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,c,t);else{if(i===r)return c[t];c[t]=i}},internal:function(t,u){if(n.isPlainObject(t))n.extend(!0,i,t);else{if(u===r)return i[t];i[t]=u}},debug:function(){c.debug&&(c.performance?i.performance.log(arguments):(i.debug=Function.prototype.bind.call(console.info,console,c.name+":"),i.debug.apply(console,arguments)))},verbose:function(){c.verbose&&c.debug&&(c.performance?i.performance.log(arguments):(i.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),i.verbose.apply(console,arguments)))},error:function(){i.error=Function.prototype.bind.call(console.error,console,c.name+":");i.error.apply(console,arguments)},performance:{log:function(n){var t,r,u;c.performance&&(t=(new Date).getTime(),u=h||t,r=t-u,h=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":r}));clearTimeout(i.performance.timer);i.performance.timer=setTimeout(i.performance.display,500)},display:function(){var t=c.name+":",u=0;h=!1;clearTimeout(i.performance.timer);n.each(s,function(n,t){u+=t["Execution Time"]});t+=" "+u+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&s.length>0&&(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=et;return i=i||w,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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};p?(et===r&&i.initialize(),i.invoke(v)):(et!==r&&et.invoke("destroy"),i.initialize())}),f!==r?f:this};n.fn.popup.settings={name:"Popup",debug:!1,verbose:!1,performance:!0,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},on:"hover",addTouchEvents:!0,position:"top left",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",prefer:"opposite",lastResort:!1,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,offset:0,maxSearchDepth:20,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"No visible position could be found for the popup",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",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=function(n){return t[n]};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,i):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.fn.progress=function(t){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var rt,o,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.progress.settings,t):n.extend({},n.fn.progress.settings),y=a.className,d=a.metadata,ut=a.namespace,g=a.selector,k=a.error,ft="."+ut,nt="module-"+ut,v=n(this),b=n(this).find(g.bar),tt=n(this).find(g.progress),et=n(this).find(g.label),p=this,w=v.data(nt),it=!1;o={initialize:function(){o.debug("Initializing progress bar",a);o.set.duration();o.set.transitionEvent();o.read.metadata();o.read.settings();o.instantiate()},instantiate:function(){o.verbose("Storing instance of progress",o);w=o;v.data(nt,o)},destroy:function(){o.verbose("Destroying previous progress for",v);clearInterval(w.interval);o.remove.state();v.removeData(nt);w=r},reset:function(){o.set.percent(0)},complete:function(){(o.percent===r||o.percent<100)&&o.set.percent(100)},read:{metadata:function(){var n={percent:v.data(d.percent),total:v.data(d.total),value:v.data(d.value)};n.percent&&(o.debug("Current percent value set from metadata",n.percent),o.set.percent(n.percent));n.total&&(o.debug("Total value set from metadata",n.total),o.set.total(n.total));n.value&&(o.debug("Current value set from metadata",n.value),o.set.value(n.value),o.set.progress(n.value))},settings:function(){a.total!==!1&&(o.debug("Current total set in settings",a.total),o.set.total(a.total));a.value!==!1&&(o.debug("Current value set in settings",a.value),o.set.value(a.value),o.set.progress(o.value));a.percent!==!1&&(o.debug("Current percent set in settings",a.percent),o.set.percent(a.percent))}},increment:function(n){var i,r,t;o.has.total()?(r=o.get.value(),n=n||1,t=r+n,i=o.get.total(),o.debug("Incrementing value",r,t,i),t>i&&(o.debug("Value cannot increment above total",i),t=i)):(r=o.get.percent(),n=n||o.get.randomValue(),t=r+n,i=100,o.debug("Incrementing percentage by",r,t),t>i&&(o.debug("Value cannot increment above 100 percent"),t=i));o.set.progress(t)},decrement:function(n){var t,i,r=o.get.total();r?(t=o.get.value(),n=n||1,i=t-n,o.debug("Decrementing value by",n,t)):(t=o.get.percent(),n=n||o.get.randomValue(),i=t-n,o.debug("Decrementing percentage by",n,t));0>i&&(o.debug("Value cannot decrement below 0"),i=0);o.set.progress(i)},has:{total:function(){return o.get.total()!==!1}},get:{text:function(n){var t=o.value||0,i=o.total||0,r=it?o.get.displayPercent():o.percent||0,u=o.total>0?i-t:100-r;return n=n||"",n=n.replace("{value}",t).replace("{total}",i).replace("{left}",u).replace("{percent}",r),o.debug("Adding variables to progress bar text",n),n},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,""):!1: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(){var n=b.width(),i=v.width(),r=parseInt(b.css("min-width"),10),t=n>r?n/i*100:o.percent;return a.precision>0?Math.round(10*t*a.precision)/(10*a.precision):Math.round(t)},percent:function(){return o.percent||0},value:function(){return o.value||0},total:function(){return o.total||!1}},is:{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:{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(n){n>100?o.error(k.tooHigh,n):0>n?o.error(k.tooLow,n):(b.css("width",n+"%"),v.attr("data-percent",parseInt(n,10)))},duration:function(n){n=n||a.duration;n="number"==typeof n?n+"ms":n;o.verbose("Setting progress bar transition duration",n);b.css({"transition-duration":n})},percent:function(n){n="string"==typeof n?+n.replace("%",""):n;n=a.precision>0?Math.round(10*n*a.precision)/(10*a.precision):Math.round(n);o.percent=n;o.has.total()||(o.value=a.precision>0?Math.round(n/100*o.total*10*a.precision)/(10*a.precision):Math.round(n/100*o.total*10)/10,a.limitValues&&(o.value=o.value>100?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(){var n=function(){o.verbose("Bar finished animating, removing continuous label updates");clearInterval(o.interval);it=!1;o.set.labels()};clearInterval(o.interval);b.one(rt+ft,n);o.timer=setTimeout(n,a.duration+100);it=!0;o.interval=setInterval(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&&(n=o.get.text(n),o.debug("Setting label to text",n),et.text(n))},state:function(n){n=n!==r?n:o.percent;100===n?!a.autoSuccess||o.is.warning()||o.is.error()?(o.verbose("Reached 100% removing active state"),o.remove.active()):(o.set.success(),o.debug("Automatically triggering success at 100%")):n>0?(o.verbose("Adjusting active progress bar label",n),o.set.active()):(o.remove.active(),o.set.label(a.text.active))},barLabel:function(n){n!==r?tt.text(o.get.text(n)):"ratio"==a.label&&o.total?(o.debug("Adding ratio to bar label"),tt.text(o.get.text(a.text.ratio))):"percent"==a.label&&(o.debug("Adding percentage to bar label"),tt.text(o.get.text(a.text.percent)))},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&&o.set.label(n);a.onActive.call(p,o.value,o.total)},success:function(n){n=n||a.text.success;o.debug("Setting success state");v.addClass(y.success);o.remove.active();o.remove.warning();o.remove.error();o.complete();n&&o.set.label(n);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&&o.set.label(n);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&&o.set.label(n);a.onError.call(p,o.value,o.total)},transitionEvent:function(){rt=o.get.transitionEnd()},total:function(n){o.total=n},value:function(n){o.value=n},progress:function(n){var t,i=o.get.numericValue(n);i===!1&&o.error(k.nonNumeric,n);o.has.total()?(o.set.value(i),t=i/o.total*100,o.debug("Calculating percent complete from total",t),o.set.percent(t)):(t=i,o.debug("Setting value to exact percentage value",t),o.set.percent(t))}},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];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.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.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(){o.error=Function.prototype.bind.call(console.error,console,a.name+":");o.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,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)&&f.length>0&&(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=w;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],!1):(o.error(k.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?(w===r&&o.initialize(),o.invoke(h)):(w!==r&&w.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.progress.settings={name:"Progress",namespace:"progress",debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,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%"},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}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.rating=function(t){var i,f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return f.each(function(){var l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.rating.settings,t):n.extend({},n.fn.rating.settings),tt=a.namespace,y=a.className,w=a.metadata,k=a.selector,d=(a.error,"."+tt),g="module-"+tt,nt=this,b=n(this).data(g),v=n(this),p=v.find(k.icon);l={initialize:function(){l.verbose("Initializing rating module",a);0===p.length&&l.setup.layout();a.interactive?l.enable():l.disable();l.set.rating(l.get.initialRating());l.instantiate()},instantiate:function(){l.verbose("Instantiating module",a);b=l;v.data(g,l)},destroy:function(){l.verbose("Destroying previous instance",b);l.remove.events();v.removeData(g)},refresh:function(){p=v.find(k.icon)},setup:{layout:function(){var t=l.get.maxRating(),i=n.fn.rating.settings.templates.icon(t);l.debug("Generating icon html dynamically");v.html(i);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);p.removeClass(y.selected)},click:function(){var i=n(this),r=l.get.rating(),t=p.index(i)+1,u="auto"==a.clearable?1===p.length:a.clearable;u&&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)}},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)},get:{initialRating:function(){return v.data(w.rating)!==r?(v.removeData(w.rating),v.data(w.rating)):a.initialRating},maxRating:function(){return v.data(w.maxRating)!==r?(v.removeData(w.maxRating),v.data(w.maxRating)):a.maxRating},rating:function(){var n=p.filter("."+y.active).length;return l.verbose("Current rating retrieved",n),n}},set:{rating:function(n){var t=n-1>=0?n-1:0,i=p.eq(t);v.removeClass(y.selected);p.removeClass(y.selected).removeClass(y.active);n>0&&(l.verbose("Setting current rating to",n),i.prevAll().andSelf().addClass(y.active));a.onRate.call(nt,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];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.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.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(){l.error=Function.prototype.bind.call(console.error,console,a.name+":");l.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,u.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=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+"'");f.length>1&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&u.length>0&&(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=nt||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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),n.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",debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",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"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(n){for(var t=1,i="";n>=t;)i+='<i class="icon"><\/i>',t++;return i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.search=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=arguments[0],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),w=y.className,d=y.metadata,ft=y.regExp,b=y.selector,tt=y.error,et=y.namespace,g="."+et,ut=et+"-module",p=n(this),nt=p.find(b.prompt),ot=p.find(b.searchButton),k=p.find(b.results),it=(p.find(b.result),p.find(b.category),this),rt=p.data(ut);v={initialize:function(){v.verbose("Initializing module");v.determine.searchFields();v.bind.events();v.set.type();v.create.results();v.instantiate()},instantiate:function(){v.verbose("Storing instance of module",v);rt=v;p.data(ut,v)},destroy:function(){v.verbose("Destroying instance");p.off(g).removeData(ut)},bind:{events:function(){v.verbose("Binding events to search");y.automatic&&(p.on(v.get.inputEvent()+g,b.prompt,v.event.input),nt.attr("autocomplete","off"));p.on("focus"+g,b.prompt,v.event.focus).on("blur"+g,b.prompt,v.event.blur).on("keydown"+g,b.prompt,v.handleKeyboard).on("click"+g,b.searchButton,v.query).on("mousedown"+g,b.results,v.event.result.mousedown).on("mouseup"+g,b.results,v.event.result.mouseup).on("click"+g,b.result,v.event.result.click)}},determine:{searchFields:function(){u&&u.searchFields!==r&&(y.searchFields=u.searchFields)}},event:{input:function(){clearTimeout(v.timer);v.timer=setTimeout(v.query,y.searchDelay)},focus:function(){v.set.focus();v.has.minimumCharacters()&&(v.query(),v.showResults())},blur:function(){var n=i.activeElement===this;n||v.resultsClicked||(v.cancel.query(),v.remove.focus(),v.timer=setTimeout(v.hideResults,y.hideDelay))},result:{mousedown:function(){v.resultsClicked=!0},mouseup:function(){v.resultsClicked=!1},click:function(i){v.debug("Search result selected");var r=n(this),u=r.find(b.title).eq(0),f=r.find("a[href]").eq(0),e=f.attr("href")||!1,h=f.attr("target")||!1,o=(u.html(),u.length>0?u.text():!1),s=v.get.results(),c=r.data(d.result)||v.get.result(o,s);return n.isFunction(y.onSelect)&&y.onSelect.call(it,c,s)===!1?void v.debug("Custom onSelect callback cancelled default select action"):(v.hideResults(),o&&v.set.value(o),void(e&&(v.verbose("Opening search link found in result",f),"_blank"==h||i.ctrlKey?t.open(e):t.location.href=e)))}}},handleKeyboard:function(n){var f,t=p.find(b.result),e=p.find(b.category),i=t.index(t.filter("."+w.active)),o=t.length,r=n.which,u={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(r==u.escape&&(v.verbose("Escape key pressed, blurring search field"),nt.trigger("blur")),v.is.visible())if(r==u.enter){if(v.verbose("Enter key pressed, selecting active result"),t.filter("."+w.active).length>0)return v.event.result.click.call(t.filter("."+w.active),n),n.preventDefault(),!1}else r==u.upArrow?(v.verbose("Up key pressed, changing active result"),f=0>i-1?i:i-1,e.removeClass(w.active),t.removeClass(w.active).eq(f).addClass(w.active).closest(e).addClass(w.active),n.preventDefault()):r==u.downArrow&&(v.verbose("Down key pressed, changing active result"),f=i+1>=o?i:i+1,e.removeClass(w.active),t.removeClass(w.active).eq(f).addClass(w.active).closest(e).addClass(w.active),n.preventDefault());else r==u.enter&&(v.verbose("Enter key pressed, executing query"),v.query(),v.set.buttonPressed(),nt.one("keyup",v.remove.buttonFocus))},setup:{api:function(){var n={debug:y.debug,on:!1,cache:"local",action:"search",onError:v.error};v.verbose("First request, initializing API");p.api(n)}},can:{useAPI:function(){return n.fn.api!==r},transition:function(){return y.transition&&n.fn.transition!==r&&p.transition("is supported")}},is:{empty:function(){return""===k.html()},visible:function(){return k.filter(":visible").length>0},focused:function(){return nt.filter(":focus").length>0}},get:{inputEvent:function(){var n=nt[0];return n!==r&&n.oninput!==r?"input":n!==r&&n.onpropertychange!==r?"propertychange":"keyup"},value:function(){return nt.val()},results:function(){return p.data(d.results)},result:function(t,i){var f=["title","id"],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(i,r){if(n.isArray(r.results)&&(u=v.search.object(t,r.results,f)[0]))return!1})):(v.debug("Finding result in results object",t),u=v.search.object(t,i,f)[0]),u||!1}},set:{focus:function(){p.addClass(w.focus)},loading:function(){p.addClass(w.loading)},value:function(n){v.verbose("Setting search input value",n);nt.val(n)},type:function(n){n=n||y.type;"category"==y.type&&p.addClass(y.type)},buttonPressed:function(){ot.addClass(w.pressed)}},remove:{loading:function(){p.removeClass(w.loading)},focus:function(){p.removeClass(w.focus)},buttonPressed:function(){ot.removeClass(w.pressed)}},query:function(){var t=v.get.value(),i=v.read.cache(t);v.has.minimumCharacters()?i?(v.debug("Reading result from cache",t),v.save.results(i.results),v.addResults(i.html),v.inject.id(i.results)):(v.debug("Querying for",t),n.isPlainObject(y.source)||n.isArray(y.source)?v.search.local(t):v.can.useAPI()?v.search.remote(t):v.error(tt.source),y.onSearchQuery.call(it,t)):v.hideResults()},search:{local:function(n){var i,t=v.search.object(n,y.content);v.set.loading();v.save.results(t);v.debug("Returned local search results",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){var i={onSuccess:function(n){v.parse.response.call(it,n,t)},onFailure:function(){v.displayMessage(tt.serverError)},urlData:{query:t}};p.api("get request")||v.setup.api();n.extend(!0,i,y.apiSettings);v.debug("Executing search",i);v.cancel.query();p.api("setting",i).api("query")},object:function(t,i,u){var f=[],e=[],s=t.toString().replace(ft.escape,"\\$&"),h=new RegExp(ft.beginsWith+s,"i"),o=function(t,i){var r=-1==n.inArray(i,f),u=-1==n.inArray(i,e);r&&u&&t.push(i)};return i=i||y.source,u=u!==r?u:y.searchFields,n.isArray(u)||(u=[u]),i===r||i===!1?(v.error(tt.source),[]):(n.each(u,function(r,u){n.each(i,function(n,i){var r="string"==typeof i[u];r&&(-1!==i[u].search(h)?o(f,i):y.searchFullText&&v.fuzzySearch(t,i[u])&&o(e,i))})}),n.merge(f,e))}},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if("string"!=typeof n||(n=n.toLowerCase(),t=t.toLowerCase(),u>r))return!1;if(u===r)return n===t;n:for(i=0,f=0;u>i;i++){for(e=n.charCodeAt(i);r>f;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},parse:{response:function(n,t){var i=v.generateResults(n);v.verbose("Parsing server response",n);n!==r&&t!==r&&n.results!==r&&(v.addResults(i),v.inject.id(n.results),v.write.cache(t,{html:i,results:n.results}),v.save.results(n.results))}},cancel:{query:function(){v.can.useAPI()&&p.api("abort")}},has:{minimumCharacters:function(){var n=v.get.value(),t=n.length;return t>=y.minCharacters}},clear:{cache:function(n){var t=p.data(d.cache);n?n&&t&&t[n]&&(v.debug("Removing value from cache",n),delete t[n],p.data(d.cache,t)):(v.debug("Clearing cache",n),p.removeData(d.cache))}},read:{cache:function(n){var t=p.data(d.cache);return y.cache?(v.verbose("Checking cache for generated html for query",n),"object"==typeof t&&t[n]!==r?t[n]:!1):!1}},create:{id:function(n,t){var u,i,f=n+1;return t!==r?(u=String.fromCharCode(97+t),i=u+f,v.verbose("Creating category result id",i)):(i=f,v.verbose("Creating result id",i)),i},results:function(){0===k.length&&(k=n("<div />").addClass(w.results).appendTo(p))}},inject:{result:function(n,t,i){v.verbose("Injecting result into results");var u=i!==r?k.children().eq(i).children(b.result).eq(t):k.children(b.result).eq(t);v.verbose("Injecting results metadata",u);u.data(d.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){i=0;n.each(f.results,function(n){var t=f.results[n];t.id===r&&(t.id=v.create.id(i,u));v.inject.result(t,i,u);i++});u++}):n.each(t,function(n){var u=t[n];u.id===r&&(u.id=v.create.id(i));v.inject.result(u,i);i++}),t}},save:{results:function(n){v.verbose("Saving current search results to metadata",n);p.data(d.results,n)}},write:{cache:function(n,t){var i=p.data(d.cache)!==r?p.data(d.cache):{};y.cache&&(v.verbose("Writing generated html to cache",n,t),i[n]=t,p.data(d.cache,i))}},addResults:function(t){return n.isFunction(y.onResultsAdd)&&y.onResultsAdd.call(k,t)===!1?(v.debug("onResultsAdd callback cancelled default action"),!1):(k.html(t),void v.showResults())},showResults:function(){v.is.visible()||!v.is.focused()||v.is.empty()||(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,queue:!0})):(v.debug("Showing results with javascript"),k.stop().fadeIn(y.duration,y.easing)),y.onResultsOpen.call(k))},hideResults: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,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.results)&&!n.isEmptyObject(t.results),f=n.isArray(t.results)&&t.results.length>0,i="";return u||f?(y.maxResults>0&&(u?"standard"==y.type&&v.error(tt.maxResults):t.results=t.results.slice(0,y.maxResults)),n.isFunction(r)?i=r(t):v.error(tt.noTemplate,!1)):i=v.displayMessage(tt.noResults,"empty"),y.onResults.call(it,t),i},displayMessage:function(n,t){return t=t||"standard",v.debug("Displaying message",n,t),v.addResults(y.templates.message(n,t)),y.templates.message(n,t)},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.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.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(){v.error=Function.prototype.bind.call(console.error,console,y.name+":");v.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:it,"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+"'");o.length>1&&(t+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(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=rt;return i=i||a,u=it||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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(rt===r&&v.initialize(),v.invoke(c)):(rt!==r&&rt.invoke("destroy"),v.initialize())}),f!==r?f:this};n.fn.search.settings={name:"Search",namespace:"search",debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,apiSettings:!1,source:!1,searchFields:["title","description"],searchFullText:!0,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},className:{active:"active",empty:"empty",focus:"focus",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",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.",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."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",category:".category",result:".result",title:".title, .name"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=function(n){return t[n]};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,i):n},message:function(n,t){var i="";return n!==r&&t!==r&&(i+='<div class="message '+t+'">',i+="empty"==t?'<div class="header">No Results<\/div class="header"><div class="description">'+n+'<\/div class="description">':' <div class="description">'+n+"<\/div>",i+="<\/div>"),i},category:function(t){var i="",u=n.fn.search.settings.templates.escape;return t.results!==r?(n.each(t.results,function(t,f){f.results!==r&&f.results.length>0&&(i+='<div class="category"><div class="name">'+f.name+"<\/div>",n.each(f.results,function(n,t){i+='<div class="result">';t.url&&(i+='<a href="'+t.url+'"><\/a>');t.image!==r&&(t.image=u(t.image),i+='<div class="image"> <img src="'+t.image+'" alt=""><\/div>');i+='<div class="content">';t.price!==r&&(t.price=u(t.price),i+='<div class="price">'+t.price+"<\/div>");t.title!==r&&(t.title=u(t.title),i+='<div class="title">'+t.title+"<\/div>");t.description!==r&&(i+='<div class="description">'+t.description+"<\/div>");i+="<\/div><\/div>"}),i+="<\/div>")}),t.action&&(i+='<a href="'+t.action.url+'" class="action">'+t.action.text+"<\/a>"),i):!1},standard:function(t){var i="";return t.results!==r?(n.each(t.results,function(n,t){i+=t.url?'<a class="result" href="'+t.url+'">':'<a class="result">';t.image!==r&&(i+='<div class="image"> <img src="'+t.image+'"><\/div>');i+='<div class="content">';t.price!==r&&(i+='<div class="price">'+t.price+"<\/div>");t.title!==r&&(i+='<div class="title">'+t.title+"<\/div>");t.description!==r&&(i+='<div class="description">'+t.description+"<\/div>");i+="<\/div>";i+="<\/a>"}),t.action&&(i+='<a href="'+t.action.url+'" class="action">'+t.action.text+"<\/a>"),i):!1}}}}(jQuery,window,document),function(n,t,i,r){"use strict";n.fn.shape=function(u){var f,o=n(this),s=(n("body"),(new Date).getTime()),e=[],h=arguments[0],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,v,t,ut=o.selector||"",y=n.isPlainObject(u)?n.extend(!0,{},n.fn.shape.settings,u):n.extend({},n.fn.shape.settings),ft=y.namespace,k=y.selector,et=y.error,b=y.className,ot="."+ft,rt="module-"+ft,w=n(this),d=w.find(k.sides),g=w.find(k.side),it=!1,nt=this,tt=w.data(rt);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(ot)},refresh:function(){t.verbose("Refreshing selector cache for",nt);w=n(nt);d=n(this).find(k.shape);g=n(this).find(k.side)},repaint:function(){t.verbose("Forcing repaint event");var n=d[0]||i.createElement("div");n.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()};y.beforeChange.call(v[0]);t.get.transitionEvent()?(t.verbose("Starting CSS animation"),w.addClass(b.animating),d.css(n).one(t.get.transitionEvent(),i),t.set.duration(y.duration),a(function(){w.addClass(b.animating);p.addClass(b.hidden)})):i()},queue:function(n){t.debug("Queueing animation of",n);d.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");d.attr("style","").removeAttr("style");g.attr("style","").removeAttr("style").removeClass(b.hidden);v.removeClass(b.animating).attr("style","").removeAttr("style")},is:{complete:function(){return g.filter("."+b.active)[0]==v[0]},animating:function(){return w.hasClass(b.animating)}},set:{defaultSide:function(){p=w.find("."+y.className.active);v=p.next(k.side).length>0?p.next(k.side):w.find(k.side).first();it=!1;t.verbose("Active side set to",p);t.verbose("Next side set to",v)},duration:function(n){n=n||y.duration;n="number"==typeof n?n+"ms":n;t.verbose("Setting animation duration",n);(y.duration||0===y.duration)&&d.add(g).css({"-webkit-transition-duration":n,"-moz-transition-duration":n,"-ms-transition-duration":n,"-o-transition-duration":n,"transition-duration":n})},currentStageSize:function(){var n=w.find("."+y.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("."+y.className.active),r=it?n.find(k.side).eq(it):i.next(k.side).length>0?i.next(k.side):n.find(k.side).first(),u={};t.set.currentStageSize();i.removeClass(b.active);r.addClass(b.active);n.insertAfter(w);u={width:r.outerWidth(!0),height:r.outerHeight(!0)};n.remove();w.css(u);t.verbose("Resizing stage to fit new content",u)},nextSide:function(n){it=n;v=g.filter(n);it=g.index(v);0===v.length&&(t.set.defaultSide(),t.error(et.side));t.verbose("Next side manually set to",v)},active:function(){t.verbose("Setting new side to active",v);g.removeClass(b.active);v.addClass(b.active);y.onChange.call(v[0]);t.set.defaultSide()}},flip:{up:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip up"):(t.debug("Flipping up",v),t.set.stageSize(),t.stage.above(),t.animate(t.get.transform.up()))):void t.debug("Side already visible",v)},down:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip down"):(t.debug("Flipping down",v),t.set.stageSize(),t.stage.below(),t.animate(t.get.transform.down()))):void t.debug("Side already visible",v)},left:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip left"):(t.debug("Flipping left",v),t.set.stageSize(),t.stage.left(),t.animate(t.get.transform.left()))):void t.debug("Side already visible",v)},right:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip right"):(t.debug("Flipping right",v),t.set.stageSize(),t.stage.right(),t.animate(t.get.transform.right()))):void t.debug("Side already visible",v)},over:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip over"):(t.debug("Flipping over",v),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.over()))):void t.debug("Side already visible",v)},back:function(){return!t.is.complete()||t.is.animating()||y.allowRepeats?void(t.is.animating()?t.queue("flip back"):(t.debug("Flipping back",v),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.back()))):void t.debug("Side already visible",v)}},get:{transform:{up:function(){var n={y:-((p.outerHeight(!0)-v.outerHeight(!0))/2),z:-(p.outerHeight(!0)/2)};return{transform:"translateY("+n.y+"px) translateZ("+n.z+"px) rotateX(-90deg)"}},down:function(){var n={y:-((p.outerHeight(!0)-v.outerHeight(!0))/2),z:-(p.outerHeight(!0)/2)};return{transform:"translateY("+n.y+"px) translateZ("+n.z+"px) rotateX(90deg)"}},left:function(){var n={x:-((p.outerWidth(!0)-v.outerWidth(!0))/2),z:-(p.outerWidth(!0)/2)};return{transform:"translateX("+n.x+"px) translateZ("+n.z+"px) rotateY(90deg)"}},right:function(){var n={x:-((p.outerWidth(!0)-v.outerWidth(!0))/2),z:-(p.outerWidth(!0)/2)};return{transform:"translateX("+n.x+"px) translateZ("+n.z+"px) rotateY(-90deg)"}},over:function(){var n={x:-((p.outerWidth(!0)-v.outerWidth(!0))/2)};return{transform:"translateX("+n.x+"px) rotateY(180deg)"}},back:function(){var n={x:-((p.outerWidth(!0)-v.outerWidth(!0))/2)};return{transform:"translateX("+n.x+"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 p.next(k.side).length>0?p.next(k.side):w.find(k.side).first()}},stage:{above:function(){var n={origin:(p.outerHeight(!0)-v.outerHeight(!0))/2,depth:{active:v.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as above",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(90deg) translateZ("+n.depth.next+"px)"})},below:function(){var n={origin:(p.outerHeight(!0)-v.outerHeight(!0))/2,depth:{active:v.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as below",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(-90deg) translateZ("+n.depth.next+"px)"})},left:function(){var i={active:p.outerWidth(!0),next:v.outerWidth(!0)},n={origin:(i.active-i.next)/2,depth:{active:i.next/2,next:i.active/2}};t.verbose("Setting the initial animation position as left",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px)"})},right:function(){var i={active:p.outerWidth(!0),next:v.outerWidth(!0)},n={origin:(i.active-i.next)/2,depth:{active:i.next/2,next:i.active/2}};t.verbose("Setting the initial animation position as left",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px)"})},behind:function(){var n={active:p.outerWidth(!0),next:v.outerWidth(!0)},i={origin:(n.active-n.next)/2,depth:{active:n.next/2,next:n.active/2}};t.verbose("Setting the initial animation position as behind",v,i);p.css({transform:"rotateY(0deg)"});v.addClass(b.animating).css({left:i.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(i,u){if(t.debug("Changing setting",i,u),n.isPlainObject(i))n.extend(!0,y,i);else{if(u===r)return y[i];y[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(){y.debug&&(y.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,y.name+":"),t.debug.apply(console,arguments)))},verbose:function(){y.verbose&&y.debug&&(y.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),t.verbose.apply(console,arguments)))},error:function(){t.error=Function.prototype.bind.call(console.error,console,y.name+":");t.error.apply(console,arguments)},performance:{log:function(n){var i,r,u;y.performance&&(i=(new Date).getTime(),u=s||i,r=i-u,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=y.name+":",u=0;s=!1;clearTimeout(t.performance.timer);n.each(e,function(n,t){u+=t["Execution Time"]});i+=" "+u+"ms";ut&&(i+=" '"+ut+"'");o.length>1&&(i+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};c?(tt===r&&t.initialize(),t.invoke(h)):(tt!==r&&tt.invoke("destroy"),t.initialize())}),f!==r?f:this};n.fn.shape.settings={name:"Shape",debug:!1,verbose:!1,performance:!0,namespace:"shape",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.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=arguments[0],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),wt=tt.children(rt.fixed),ut=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();l.is.ios()&&l.set.ios();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);l.remove.direction();d.off(ht).removeData(vt);l.is.ios()&&l.remove.ios();tt.off(it);s.off(it);h.off(it)},event:{clickaway:function(n){var t=ut.find(n.target).length>0||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);k.closable&&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(0px, 0, 0);           transform: translate3d(0px, 0, 0); }");r+="<\/style>";et=n(r).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);wt=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;r.length>0?(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 ot.not(d).filter("."+g.animating).length>0},othersVisible:function(){return ot.not(d).filter("."+g.visible).length>0},othersActive:function(){return l.othersVisible()||l.othersAnimating()},hideOthers:function(n){var t=ot.not(d).filter("."+g.visible),r=t.length,i=0;n=n||function(){};t.sidebar("hide",function(){i++;i==r&&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&&et.length>0&&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(){var n=!t.ActiveXObject&&"ActiveXObject"in t,i="ActiveXObject"in t;return n||i},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):!1},mobile:function(){var n=navigator.userAgent,t=n.match(at.mobile);return t?(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];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.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.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(){l.error=Function.prototype.bind.call(console.error,console,k.name+":");l.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;k.performance&&(t=(new Date).getTime(),r=c||t,i=t-r,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)&&e.length>0&&(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],!1):(l.error(st.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.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",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.fn.sticky=function(i){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var w,d,g,o,a=n.isPlainObject(i)?n.extend(!0,{},n.fn.sticky.settings,i):n.extend({},n.fn.sticky.settings),y=a.className,ft=a.namespace,tt=a.error,b="."+ft,it="module-"+ft,v=n(this),rt=n(t),k=n(a.scrollContext),nt=(v.selector||"",v.data(it)),ut=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},p=this;o={initialize:function(){o.determineContainer();o.determineContext();o.verbose("Initializing sticky",a,w);o.save.positions();o.checkErrors();o.bind.events();a.observeChanges&&o.observeChanges();o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o);nt=o;v.data(it,o)},destroy:function(){o.verbose("Destroying previous instance");o.reset();g&&g.disconnect();rt.off("load"+b,o.event.load).off("resize"+b,o.event.resize);k.off("scrollchange"+b,o.event.scrollchange);v.removeData(it)},observeChanges:function(){var n=d[0];"MutationObserver"in t&&(g=new MutationObserver(function(n){clearTimeout(o.timer);o.timer=setTimeout(function(){o.verbose("DOM tree modified, updating sticky menu",n);o.refresh()},100)}),g.observe(p,{childList:!0,subtree:!0}),g.observe(n,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",g))},determineContainer:function(){w=v.offsetParent()},determineContext:function(){return d=a.context?n(a.context):w,0===d.length?void o.error(tt.invalidContext,a.context,v):void 0},checkErrors:function(){return o.is.hidden()&&o.error(tt.visible,v),o.cache.element.height>o.cache.context.height?(o.reset(),void o.error(tt.elementSize,v)):void 0},bind:{events:function(){rt.on("load"+b,o.event.load).on("resize"+b,o.event.resize);k.off("scroll"+b).on("scroll"+b,o.event.scroll).on("scrollchange"+b,o.event.scrollchange)}},event:{load:function(){o.verbose("Page contents finished loading");ut(o.refresh)},resize:function(){o.verbose("Window resized");ut(o.refresh)},scroll:function(){ut(function(){k.triggerHandler("scrollchange"+b,k.scrollTop())})},scrollchange:function(n,t){o.stick(t);a.onScroll.call(p)}},refresh:function(n){o.reset();a.context||o.determineContext();n&&o.determineContainer();o.save.positions();o.stick();a.onReposition.call(p)},supports:{sticky:function(){var t=n("<div/>");return t[0],t.addClass(y.supported),t.css("position").match("sticky")}},save:{lastScroll:function(n){o.lastScroll=n},elementScroll:function(n){o.elementScroll=n},positions:function(){var i={height:rt.height()},n={margin:{top:parseInt(v.css("margin-top"),10),bottom:parseInt(v.css("margin-bottom"),10)},offset:v.offset(),width:v.outerWidth(),height:v.outerHeight()},t={offset:d.offset(),height:d.outerHeight(),bottomPadding:parseInt(d.css("padding-bottom"),10)};({height:w.outerHeight()});o.cache={fits:n.height<i.height,window:{height:i.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:t.offset.top,height:t.height,bottomPadding:t.bottomPadding,bottom:t.offset.top+t.height-t.bottomPadding}};o.set.containerSize();o.set.size();o.stick();o.debug("Caching element positions",o.cache)}},get:{direction:function(n){var t="down";return n=n||k.scrollTop(),o.lastScroll!==r&&(o.lastScroll<n?t="down":o.lastScroll>n&&(t="up")),t},scrollChange:function(n){return n=n||k.scrollTop(),o.lastScroll?n-o.lastScroll:0},currentElementScroll:function(){return o.elementScroll?o.elementScroll:o.is.top()?Math.abs(parseInt(v.css("top"),10))||0:Math.abs(parseInt(v.css("bottom"),10))||0},elementScroll:function(n){n=n||k.scrollTop();var r=o.cache.element,u=o.cache.window,f=o.get.scrollChange(n),i=r.height-u.height+a.offset,e=o.get.currentElementScroll(),t=e+f;return o.cache.fits||0>t?0:t>i?i:t}},remove:{lastScroll:function(){delete o.lastScroll},elementScroll:function(){delete o.elementScroll},offset:function(){v.css("margin-top","")}},set:{offset:function(){o.verbose("Setting offset on element",a.offset);v.css("margin-top",a.offset)},containerSize:function(){var n=w.get(0).tagName;"HTML"===n||"body"==n?o.determineContainer():Math.abs(w.outerHeight()-o.cache.context.height)>a.jitter&&(o.debug("Context has padding, specifying exact height for container",o.cache.context.height),w.css({height:o.cache.context.height}))},minimumSize:function(){var n=o.cache.element;w.css("min-height",n.height)},scroll:function(n){o.debug("Setting scroll on element",n);o.elementScroll!=n&&(o.is.top()&&v.css("bottom","").css("top",-n),o.is.bottom()&&v.css("top","").css("bottom",n))},size:function(){0!==o.cache.element.height&&0!==o.cache.element.width&&v.css({width:o.cache.element.width,height:o.cache.element.height})}},is:{top:function(){return v.hasClass(y.top)},bottom:function(){return v.hasClass(y.bottom)},initialPosition:function(){return!o.is.fixed()&&!o.is.bound()},hidden:function(){return!v.is(":visible")},bound:function(){return v.hasClass(y.bound)},fixed:function(){return v.hasClass(y.fixed)}},stick:function(n){var f=n||k.scrollTop(),r=o.cache,e=r.fits,t=r.element,c=r.window,i=r.context,s=o.is.bottom()&&a.pushing?a.bottomOffset:a.offset,n={top:f+s,bottom:f+s+c.height},u=(o.get.direction(n.top),e?0:o.get.elementScroll(n.top)),h=!e,l=0!==t.height;l&&(o.is.initialPosition()?n.top>i.bottom?(o.debug("Element bottom of container"),o.bindBottom()):n.top>t.top&&(o.debug("Element passed, fixing element to page"),o.fixTop()):o.is.fixed()?o.is.top()?n.top<t.top?(o.debug("Fixed element reached top of container"),o.setInitialPosition()):t.height+n.top-u>i.bottom?(o.debug("Fixed element reached bottom of container"),o.bindBottom()):h&&o.set.scroll(u):o.is.bottom()&&(n.bottom-t.height<t.top?(o.debug("Bottom fixed rail has reached top of container"),o.setInitialPosition()):n.bottom>i.bottom?(o.debug("Bottom fixed rail has reached bottom of container"),o.bindBottom()):h&&o.set.scroll(u)):o.is.bottom()&&(a.pushing?o.is.bound()&&n.bottom<i.bottom&&(o.debug("Fixing bottom attached element to bottom of browser."),o.fixBottom()):o.is.bound()&&n.top<i.bottom-t.height&&(o.debug("Fixing bottom attached element to top of browser."),o.fixTop())));o.save.lastScroll(n.top);o.save.elementScroll(u)},bindTop:function(){o.debug("Binding element to top of parent container");o.remove.offset();v.css({left:"",top:"",marginBottom:""}).removeClass(y.fixed).removeClass(y.bottom).addClass(y.bound).addClass(y.top);a.onTop.call(p);a.onUnstick.call(p)},bindBottom:function(){o.debug("Binding element to bottom of parent container");o.remove.offset();v.css({left:"",top:"",marginBottom:o.cache.context.bottomPadding}).removeClass(y.fixed).removeClass(y.top).addClass(y.bound).addClass(y.bottom);a.onBottom.call(p);a.onUnstick.call(p)},setInitialPosition:function(){o.unfix();o.unbind()},fixTop:function(){o.debug("Fixing element to top of page");o.set.minimumSize();o.set.offset();v.css({left:o.cache.element.left,bottom:"",marginBottom:""}).removeClass(y.bound).removeClass(y.bottom).addClass(y.fixed).addClass(y.top);a.onStick.call(p)},fixBottom:function(){o.debug("Sticking element to bottom of page");o.set.minimumSize();o.set.offset();v.css({left:o.cache.element.left,bottom:"",marginBottom:""}).removeClass(y.bound).removeClass(y.top).addClass(y.fixed).addClass(y.bottom);a.onStick.call(p)},unbind:function(){o.debug("Removing absolute position on element");o.remove.offset();v.removeClass(y.bound).removeClass(y.top).removeClass(y.bottom)},unfix:function(){o.debug("Removing fixed position on element");o.remove.offset();v.removeClass(y.fixed).removeClass(y.top).removeClass(y.bottom);a.onUnstick.call(p)},reset:function(){o.debug("Reseting elements position");o.unbind();o.unfix();o.resetCSS();o.remove.offset();o.remove.lastScroll()},resetCSS:function(){v.css({width:"",height:""});w.css({height:""})},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];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.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.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(){o.error=Function.prototype.bind.call(console.error,console,a.name+":");o.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,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,0)},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)&&f.length>0&&(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=nt;return i=i||l,f=p||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):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(nt===r&&o.initialize(),o.invoke(h)):(nt!==r&&nt.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,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",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.fn.tab=function(u){var f,e=n(n.isFunction(this)?t:this),h=e.selector||"",s=(new Date).getTime(),o=[],c=arguments[0],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,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?(d.closest(ft.ui).length>0?(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"),p.path===!1)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]:!1},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]}},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),i=t.hasClass(w.loading);i||(y.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(b).removeClass(w.active+" "+w.loading),t.length>0&&p.onRequest.call(t[0],n))},state:function(t){n.address.value(t)}},changeTab:function(i){var e=t.history&&t.history.pushState,u=e&&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,l,a,c,v=r.slice(0,t+1),o=y.utilities.arrayToPath(v),b=y.is.tab(o),it=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),it?c=!0:(l=r.slice(0,t+2),a=y.utilities.arrayToPath(l),c=!y.is.tab(a),c&&y.verbose("Tab parameters found",l)),c&&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(h=n("#"+i+', a[name="'+i+'"]'),o=h.closest("[data-tab]").data("tab"),s=y.get.tabElement(o),h&&h.length>0&&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&&t.length>0?t.offset().top:!1;r!==!1&&(y.debug("Forcing scroll to an in-page link in a hidden tab",r,t),n(i).scrollTop(r))},update:{content:function(n,t,i){var u=y.get.tabElement(n),f=u[0];i=i!==r?i:p.evaluateScripts;i?(y.debug("Updating HTML and evaluating inline scripts",n,t),u.html(t)):(y.debug("Updating HTML",n,t),f.innerHTML=t)}},fetch:{content:function(t,i){var e,f,u=y.get.tabElement(t),s={dataType:"html",on:"now",cache:p.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(n){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)},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),"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=t.hasClass(w.active);y.verbose("Showing tab content for",t);i||(t.addClass(w.active).siblings(b).removeClass(w.active+" "+w.loading),t.length>0&&p.onVisible.call(t[0],n))},navigation:function(n){var t=y.get.navElement(n),i=t.hasClass(w.active);y.verbose("Activating tab navigation for",t,n);i||t.addClass(w.active).siblings(e).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?y.get.tabElement(n).length>0:!1}},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 i=e.filter("[data-"+it.tab+'^="'+n+'/"]').eq(0),t=i.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+'="'+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+'="'+u+'"]'),i=b.filter("[data-"+it.tab+'="'+n+'"]'),t.length>0?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(t){return n.isArray(t)?t[t.length-1]:!1},pathToArray:function(n){return n===r&&(n=k),"string"==typeof n?n.split("/"):[n]},arrayToPath:function(t){return n.isArray(t)?t.join("/"):!1}},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];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.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.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(){y.error=Function.prototype.bind.call(console.error,console,p.name+":");y.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;p.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,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)&&o.length>0&&(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],!1):(y.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.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",debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,alwaysRefresh:!1,cache:!0,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>"},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.fn.transition=function(){var u,e=n(this),h=e.selector||"",o=(new Date).getTime(),f=[],c=arguments,l=c[0],a=[].slice.call(arguments,1),s="string"==typeof l;return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},e.each(function(t){var y,d,it,w,nt,b,tt,g,v,p=n(this),k=this;v={initialize:function(){y=v.get.settings.apply(k,c);w=y.className;it=y.error;nt=y.metadata;g="."+y.namespace;tt="module-"+y.namespace;d=p.data(tt)||v;b=v.get.animationEndEvent();s&&(s=v.invoke(l));s===!1&&(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",k);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");k.offsetWidth},delay:function(n){var f,i,u=v.get.animationDirection();u||(u=v.can.transition()?v.get.direction():"static");n=n!==r?n:y.interval;f="auto"==y.reverse&&u==w.outward;i=f||1==y.reverse?(e.length-t)*y.interval:t*y.interval;v.debug("Delaying animation by",i);setTimeout(v.animate,i)},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()&&v.queuing!==!0?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,k)},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(b+".queue"+g,function(){v.queuing=!1;v.repaint();v.animate.apply(this,y)})},complete:function(){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.restore.conditions())},force:{visible:function(){var t=p.attr("style"),i=v.get.userStyle(),n=v.get.displayType(),u=i+"display: "+n+" !important;",f=p.css("display"),e=t===r||""===t;f!==n?(v.verbose("Overriding default display to show element",n),p.attr("style",u)):e&&p.removeAttr("style")},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 t=t||y.animation,"string"==typeof t&&(t=t.split(" "),n.each(t,function(n,t){(t===w.inward||t===w.outward)&&(i=!0)})),i},inlineDisplay:function(){var t=p.attr("style")||"";return n.isArray(t.match(/display.*?;/,""))}},set:{animating:function(n){var t;v.remove.completeCallback();n=n||y.animation;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=t||y.duration;t="number"==typeof t?t+"ms":t;(t||0===t)&&(v.verbose("Setting animation duration",t),p.css({"animation-duration":t}))},direction:function(n){n=n||v.get.direction();n==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(b+".complete"+g,v.complete);y.useFailSafe&&v.add.failSafe();v.set.duration(y.duration);y.onStart.call(this)}},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(b)},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.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:!1},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 t=t||y.animation,"string"==typeof t&&(t=t.split(" "),n.each(t,function(n,t){t===w.inward?i=w.inward:t===w.outward&&(i=w.outward)})),i?i:!1},duration:function(n){return n=n||y.duration,n===!1&&(n=p.css("animation-duration")||0),"string"==typeof n?n.indexOf("ms")>-1?parseFloat(n):1e3*parseFloat(n):n},displayType:function(){return y.displayType?y.displayType:(p.data(nt.displayType)===r&&v.can.transition(!0),p.data(nt.displayType))},userStyle:function(n){return n=n||p.attr("style")||"",n.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,u,f,l,e,o,i=y.animation,h=v.get.transitionExists(i);if(h===r||t){if(v.verbose("Determining whether animation exists"),s=p.attr("class"),c=p.prop("tagName"),u=n("<"+c+" />").addClass(s).insertAfter(p),f=u.addClass(i).removeClass(w.inward).removeClass(w.outward).addClass(w.animating).addClass(w.transition).css("animationName"),l=u.addClass(w.inward).css("animationName"),o=u.attr("class",s).removeAttr("style").removeClass(w.hidden).removeClass(w.visible).show().css("display"),v.verbose("Determining final display state",o),v.save.displayType(o),u.remove(),f!=l)v.debug("Direction exists for animation",i),e=!0;else{if("none"==f||!f)return void v.debug("No animation defined in css",i);v.debug("Static animation found",i,o);e=!1}v.save.transitionExists(i,e)}return h!==r?h:e},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||y.animation,n="."+n.replace(" ","."),p.filter(n).length>0},visible:function(){return p.is(":visible")},hidden:function(){return"hidden"===p.css("visibility")},supported:function(){return b!==!1}},hide:function(){v.verbose("Hiding element");v.is.animating()&&v.reset();k.blur();v.remove.display();v.remove.visible();v.set.hidden();y.onHide.call(this);y.onComplete.call(this);v.force.hidden()},show:function(n){v.verbose("Showing element",n);v.remove.hidden();v.set.visible();y.onShow.call(this);y.onComplete.call(this);v.force.visible()},toggle:function(){v.is.visible()?v.hide():v.show()},stop:function(){v.debug("Stopping current animation");p.triggerHandler(b)},stopAll:function(){v.debug("Stopping all animation");v.remove.queueCallback();p.triggerHandler(b)},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];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.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.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(){v.error=Function.prototype.bind.call(console.error,console,y.name+":");v.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:k,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(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=d;return i=i||a,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],!1):!1;e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o!==r?o:!1}};v.initialize()}),u!==r?u:this};n.fn.transition.exists={};n.fn.transition.settings={name:"Transition",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,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"There is no css animation matching the one you specified. Please make sure your css is vendor prefixed, and you have included transition css.",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.api=n.fn.api=function(i){var u,o=n(n.isFunction(this)?t:this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var k,ut,y,nt,it,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,p=a.error,tt=a.className,st="."+ft,rt="module-"+ft,v=n(this),ht=v.closest(ot.form),w=a.stateContext?n(a.stateContext):v,d=this,b=w[0],g=v.data(rt);o={initialize:function(){c||o.bind.events();o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o);g=o;v.data(rt,g)},destroy:function(){o.verbose("Destroying previous module for",d);v.removeData(rt).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 now",n),o.query())}},read:{cachedResponse:function(n){var i;if(t.Storage===r)return void o.error(p.noStorage);if(i=sessionStorage.getItem(n),o.debug("Using cached response",n,i),i!==r){try{i=JSON.parse(i)}catch(u){}return i}return!1}},write:{cachedResponse:function(i,u){return u&&""===u?void o.debug("Response empty, not caching",u):t.Storage===r?void o.error(p.noStorage):(n.isPlainObject(u)&&(u=JSON.stringify(u)),sessionStorage.setItem(i,u),void o.verbose("Storing cached response for url",i,u))}},query:function(){if(o.is.disabled())return void o.debug("Element is disabled API request aborted");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()}return a.defaultData&&n.extend(!0,a.urlData,o.get.defaultData()),a.serializeForm&&(a.data=o.add.formData(a.data)),ut=o.get.settings(),ut===!1?(o.cancelled=!0,void o.error(p.beforeSend)):(o.cancelled=!1,y=o.get.templatedURL(),y||o.is.mocked()?(y=o.add.urlData(y),y||o.is.mocked()?(k=n.extend(!0,{},a,{type:a.method||a.type,data:nt,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)?(o.debug("Response returned from local cache"),o.request=o.create.request(),void o.request.resolveWith(b,[o.read.cachedResponse(y)])):void(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",nt,k.method);o.send.request()},a.throttle)):(o.debug("Sending request",nt,k.method),o.send.request(),o.timer=setTimeout(function(){},a.throttle)):(o.debug("Sending request",nt,k.method),o.send.request()))):void 0):void o.error(p.missingURL))},is:{disabled:function(){return v.filter(ot.disabled).length>0},form:function(){return v.is("form")},mocked:function(){return a.mockResponse||a.mockResponseAsync},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"json"===a.dataType&&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.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):w.data(e)!==r?w.data(e):i[e];return s===r?(o.error(p.requiredParameter,e,t),t=!1,!1):(o.verbose("Found required variable",e,s),void(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):w.data(e)!==r?w.data(e):i[e];s!==r?(o.verbose("Optional variable Found",e,s),t=t.replace(f,s)):(o.verbose("Optional variable not found",e),t=-1!==t.indexOf("/"+f)?t.replace("/"+f,""):t.replace(f,""))}))),t},formData:function(t){var u,f=n.fn.serializeObject!==r,i=f?ht.serializeObject():ht.serialize();return t=t||a.data,u=n.isPlainObject(t),u?f?(o.debug("Extending existing data with form data",t,i),t=n.extend(!0,{},t,i)):(o.error(p.missingSerialize),o.debug("Cant extend data. Replacing data with form data",t,i),t=i):(o.debug("Adding form data",i),t=i),t}},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()-it,u=a.loadingDuration-s,e=n.isFunction(a.onResponse)?a.onResponse.call(f,n.extend(!0,{},t)):!1;u=u>0?u:0;e&&(o.debug("Modified API response in onResponse callback",a.onResponse,e,t),t=e);u>0&&o.debug("Response completed early delaying state change by",u);setTimeout(function(){o.is.validResponse(t)?o.request.resolveWith(f,[t]):o.request.rejectWith(f,[r,"invalid"])},u)},fail:function(n,t,i){var u=this,f=(new Date).getTime()-it,r=a.loadingDuration-f;r=r>0?r:0;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:{complete:function(n){o.remove.loading();a.onComplete.call(b,n,v)},done:function(n){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)},fail:function(t,i,u){var f=n.isPlainObject(t)?t.responseText:!1,e=n.isPlainObject(f)&&f.error!==r?f.error:a.error[i]!==r?a.error[i]:u;"aborted"==i?(o.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",i,u),a.onAbort.call(b,i,v)):"invalid"==i?o.debug("JSON did not pass success test. A server-side error has most likely occurred",f):"error"==i&&t!==r&&(o.debug("XHR produced a server error",i,u),200!=t.status&&u!==r&&""!==u&&o.error(p.statusMessage+u,k.url),a.onError.call(b,e,v));a.errorDuration&&"aborted"!==i&&(o.debug("Adding error state"),o.set.error(),setTimeout(o.remove.error,a.errorDuration));o.debug("API Request failed",e,t);a.onFailure.call(b,f,v)}}},create:{request:function(){return n.Deferred().always(o.event.request.complete).done(o.event.request.done).fail(o.event.request.fail)},mockedXHR:function(){var r,i,t,u=!1,f=!1,e=!1;return t=n.Deferred().always(o.event.xhr.complete).done(o.event.xhr.done).fail(o.event.xhr.fail),a.mockResponse?(n.isFunction(a.mockResponse)?(o.debug("Using mocked callback returning response",a.mockResponse),i=a.mockResponse.call(b,a)):(o.debug("Using specified response",a.mockResponse),i=a.mockResponse),t.resolveWith(b,[i,u,{responseText:i}])):n.isFunction(a.mockResponseAsync)&&(r=function(n){o.debug("Async callback returned response",n);n?t.resolveWith(b,[n,u,{responseText:n}]):t.rejectWith(b,[{responseText:n},f,e])},o.debug("Using async mocked response",a.mockResponseAsync),a.mockResponseAsync.call(b,a,r)),t},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),t}},set:{error:function(){o.verbose("Adding error state to element",w);w.addClass(tt.error)},loading:function(){o.verbose("Adding loading state to element",w);w.addClass(tt.loading);it=(new Date).getTime()}},remove:{error:function(){o.verbose("Removing error state from element",w);w.removeClass(tt.error)},loading:function(){o.verbose("Removing loading state from element",w);w.removeClass(tt.loading)}},get:{request:function(){return o.request||!1},xhr:function(){return o.xhr||!1},settings:function(){var n;return n=a.beforeSend.call(b,a),n&&(n.success!==r&&(o.debug("Legacy success callback detected",n),o.error(p.legacyParameters,n.success),n.onSuccess=n.success),n.failure!==r&&(o.debug("Legacy failure callback detected",n),o.error(p.legacyParameters,n.failure),n.onFailure=n.failure),n.complete!==r&&(o.debug("Legacy complete callback detected",n),o.error(p.legacyParameters,n.complete),n.onComplete=n.complete)),n===r&&o.error(p.noReturnedValue),n!==r?n:a},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(p.missingAction,a.action,a.api);y=a.api[n]}else o.is.form()&&(y=v.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];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.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.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(){o.error=Function.prototype.bind.call(console.error,console,a.name+":");o.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,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)&&f.length>0&&(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],!1):(o.error(p.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?(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:!0,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,errorDuration:2e3,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!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 respopnses 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.fn.state=function(t){var u,o=n(this),f=o.selector||"",s=("ontouchstart"in i.documentElement,(new Date).getTime()),e=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var i,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);i={initialize:function(){i.verbose("Initializing module");a.automatic&&i.add.defaults();a.context&&""!==f?n(a.context).on(f,"mouseenter"+b,i.change.text).on(f,"mouseleave"+b,i.reset.text).on(f,"click"+b,i.toggle.state):v.on("mouseenter"+b,i.change.text).on("mouseleave"+b,i.reset.text).on("click"+b,i.toggle.state);i.instantiate()},instantiate:function(){i.verbose("Storing instance of module",i);k=i;v.data(nt,i)},destroy:function(){i.verbose("Destroying previous module",k);v.off(b).removeData(nt)},refresh:function(){i.verbose("Refreshing selector cache");v=n(w)},add:{defaults:function(){var u=t&&n.isPlainObject(t.states)?t.states:{};n.each(a.defaults,function(t,f){i.is[t]!==r&&i.is[t]()&&(i.verbose("Adding default states",t,w),n.extend(a.states,f,u))})}},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?!1: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){i.debug("Now allowing state",n);g[n]=!0},disallow:function(n){i.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){i.allows(n)&&v.addClass(p[n])},removeState:function(n){i.allows(n)&&v.removeClass(p[n])},toggle:{state:function(){var t,u;if(i.allows("active")&&i.is.enabled()){if(i.refresh(),n.fn.api!==r)if(t=v.api("get request"),u=v.api("was cancelled"))i.debug("API Request cancelled by beforesend"),a.activateTest=function(){return!1},a.deactivateTest=function(){return!1};else if(t)return void i.listenTo(t);i.change.state()}}},listenTo:function(t){i.debug("API request detected, waiting for state signal",t);t&&(y.loading&&i.update.text(y.loading),n.when(t).then(function(){"resolved"==t.state()?(i.debug("API request succeeded"),a.activateTest=function(){return!0},a.deactivateTest=function(){return!0}):(i.debug("API request failed"),a.activateTest=function(){return!1},a.deactivateTest=function(){return!1});i.change.state()}))},change:{state:function(){i.debug("Determining state change direction");i.is.inactive()?i.activate():i.deactivate();a.sync&&i.sync();a.onChange.call(w)},text:function(){i.is.textEnabled()&&(i.is.disabled()?(i.verbose("Changing text to disabled text",y.hover),i.update.text(y.disabled)):i.is.active()?y.hover?(i.verbose("Changing text to hover text",y.hover),i.update.text(y.hover)):y.deactivate&&(i.verbose("Changing text to deactivating text",y.deactivate),i.update.text(y.deactivate)):y.hover?(i.verbose("Changing text to hover text",y.hover),i.update.text(y.hover)):y.activate&&(i.verbose("Changing text to activating text",y.activate),i.update.text(y.activate)))}},activate:function(){a.activateTest.call(w)&&(i.debug("Setting state to active"),v.addClass(p.active),i.update.text(y.active),a.onActivate.call(w))},deactivate:function(){a.deactivateTest.call(w)&&(i.debug("Setting state to inactive"),v.removeClass(p.active),i.update.text(y.inactive),a.onDeactivate.call(w))},sync:function(){i.verbose("Syncing other buttons to current state");o.not(v).state(i.is.active()?"activate":"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,r){var u=i.get.text();i.debug("Flashing text message",n,t);n=n||a.text.flash;t=t||a.flashDuration;r=r||function(){};i.update.text(n);setTimeout(function(){i.update.text(u);r.call(w)},t)}},reset:{text:function(){var n=y.active||v.data(d.storedText),t=y.inactive||v.data(d.storedText);i.is.textEnabled()&&(i.is.active()&&n?(i.verbose("Resetting active text",n),i.update.text(n)):t&&(i.verbose("Resetting inactive text",n),i.update.text(t)))}},update:{text:function(n){var t=i.get.text();n&&n!==t?(i.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)):i.debug("Text is already set, ignoring update",n)}},setting:function(t,u){if(i.debug("Changing setting",t,u),n.isPlainObject(t))n.extend(!0,a,t);else{if(u===r)return a[t];a[t]=u}},internal:function(t,u){if(n.isPlainObject(t))n.extend(!0,i,t);else{if(u===r)return i[t];i[t]=u}},debug:function(){a.debug&&(a.performance?i.performance.log(arguments):(i.debug=Function.prototype.bind.call(console.info,console,a.name+":"),i.debug.apply(console,arguments)))},verbose:function(){a.verbose&&a.debug&&(a.performance?i.performance.log(arguments):(i.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),i.verbose.apply(console,arguments)))},error:function(){i.error=Function.prototype.bind.call(console.error,console,a.name+":");i.error.apply(console,arguments)},performance:{log:function(n){var t,r,u;a.performance&&(t=(new Date).getTime(),u=s||t,r=t-u,s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":r}));clearTimeout(i.performance.timer);i.performance.timer=setTimeout(i.performance.display,500)},display:function(){var t=a.name+":",u=0;s=!1;clearTimeout(i.performance.timer);n.each(e,function(n,t){u+=t["Execution Time"]});t+=" "+u+"ms";f&&(t+=" '"+f+"'");(console.group!==r||console.table!==r)&&e.length>0&&(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,f,e){var c,s,h,o=k;return f=f||l,e=w||e,"string"==typeof t&&o!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(u,f){var e=u!=c?f+t[u+1].charAt(0).toUpperCase()+t[u+1].slice(1):t;if(n.isPlainObject(o[e])&&u!=c)o=o[e];else{if(o[e]!==r)return s=o[e],!1;if(!n.isPlainObject(o[f])||u==c)return o[f]!==r?(s=o[f],!1):(i.error(it.method,t),!1);o=o[f]}})),n.isFunction(s)?h=s.apply(e,f):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(k===r&&i.initialize(),i.invoke(h)):(k!==r&&k.invoke("destroy"),i.initialize())}),u!==r?u: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.fn.visibility=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var g,d,s,v=n.isPlainObject(u)?n.extend(!0,{},n.fn.visibility.settings,u):n.extend({},n.fn.visibility.settings),nt=v.className,ft=v.namespace,et=v.error,ot=v.metadata,p="."+ft,tt="module-"+ft,it=n(t),y=n(this),w=n(v.context),k=(y.selector||"",y.data(tt)),rt=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},b=this,ut=!1;s={initialize:function(){s.debug("Initializing",v);s.setup.cache();s.should.trackChanges()&&("image"==v.type&&s.setup.image(),"fixed"==v.type&&s.setup.fixed(),v.observeChanges&&s.observeChanges(),s.bind.events());s.save.position();s.is.visible()||s.error(et.visible,y);v.initialCheck&&s.checkVisibility();s.instantiate()},instantiate:function(){s.debug("Storing instance",s);y.data(tt,s);k=s},destroy:function(){s.verbose("Destroying previous module");d&&d.disconnect();it.off("load"+p,s.event.load).off("resize"+p,s.event.resize);w.off("scrollchange"+p,s.event.scrollchange);y.off(p).removeData(tt)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(){s.verbose("DOM tree modified, updating visibility calculations");s.timer=setTimeout(function(){s.verbose("DOM tree modified, updating sticky menu");s.refresh()},100)}),d.observe(b,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",d))},bind:{events:function(){s.verbose("Binding visibility events to scroll and resize");v.refreshOnLoad&&it.on("load"+p,s.event.load);it.on("resize"+p,s.event.resize);w.off("scroll"+p).on("scroll"+p,s.event.scroll).on("scrollchange"+p,s.event.scrollchange)}},event:{resize:function(){s.debug("Window resized");v.refreshOnResize&&rt(s.refresh)},load:function(){s.debug("Page finished loading");rt(s.refresh)},scroll:function(){v.throttle?(clearTimeout(s.timer),s.timer=setTimeout(function(){w.triggerHandler("scrollchange"+p,[w.scrollTop()])},v.throttle)):rt(function(){w.triggerHandler("scrollchange"+p,[w.scrollTop()])})},scrollchange:function(n,t){s.checkVisibility(t)}},precache:function(t,r){t instanceof Array||(t=[t]);for(var f=t.length,e=0,s=[],u=i.createElement("img"),o=function(){e++;e>=t.length&&n.isFunction(r)&&r()};f--;)u=i.createElement("img"),u.onload=o,u.onerror=o,u.src=t[f],s.push(u)},enableCallbacks:function(){s.debug("Allowing callbacks to occur");ut=!1},disableCallbacks:function(){s.debug("Disabling all callbacks temporarily");ut=!0},should:{trackChanges:function(){return l?(s.debug("One time query, no need to bind events"),!1):(s.debug("Callbacks being attached"),!0)}},setup:{cache:function(){s.cache={occurred:{},screen:{},element:{}}},image:function(){var n=y.data(ot.src);n&&(s.verbose("Lazy loading image",n),v.once=!0,v.observeChanges=!1,v.onOnScreen=function(){s.debug("Image on screen",b);s.precache(n,function(){s.set.image(n)})})},fixed:function(){s.debug("Setting up fixed");v.once=!1;v.observeChanges=!1;v.initialCheck=!0;v.refreshOnLoad=!0;u.transition||(v.transition=!1);s.create.placeholder();s.debug("Added placeholder",g);v.onTopPassed=function(){s.debug("Element passed, adding fixed position",y);s.show.placeholder();s.set.fixed();v.transition&&n.fn.transition!==r&&y.transition(v.transition,v.duration)};v.onTopPassedReverse=function(){s.debug("Element returned to position, removing fixed",y);s.hide.placeholder();s.remove.fixed()}}},create:{placeholder:function(){s.verbose("Creating fixed position placeholder");g=y.clone(!1).css("display","none").addClass(nt.placeholder).insertAfter(y)}},show:{placeholder:function(){s.verbose("Showing placeholder");g.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){s.verbose("Hiding placeholder");g.css("display","none").css("visibility","")}},set:{fixed:function(){s.verbose("Setting element to fixed position");y.addClass(nt.fixed).css({position:"fixed",top:v.offset+"px",left:"auto",zIndex:"1"})},image:function(t){y.attr("src",t);v.transition?n.fn.transition!==r?y.transition(v.transition,v.duration):y.fadeIn(v.duration):y.show()}},is:{onScreen:function(){var n=s.get.elementCalculations();return n.onScreen},offScreen:function(){var n=s.get.elementCalculations();return n.offScreen},visible:function(){return s.cache&&s.cache.element?!(0===s.cache.element.width&&0===s.cache.element.offset.top):!1}},refresh:function(){s.debug("Refreshing constants (width/height)");"fixed"==v.type&&(s.remove.fixed(),s.remove.occurred());s.reset();s.save.position();v.checkOnRefresh&&s.checkVisibility();v.onRefresh.call(b)},reset:function(){s.verbose("Reseting all cached values");n.isPlainObject(s.cache)&&(s.cache.screen={},s.cache.element={})},checkVisibility:function(n){s.verbose("Checking visibility of element",s.cache.element);!ut&&s.is.visible()&&(s.save.scroll(n),s.save.calculations(),s.passed(),s.passingReverse(),s.topVisibleReverse(),s.bottomVisibleReverse(),s.topPassedReverse(),s.bottomPassedReverse(),s.onScreen(),s.offScreen(),s.passing(),s.topVisible(),s.bottomVisible(),s.topPassed(),s.bottomPassed(),v.onUpdate&&v.onUpdate.call(b,s.get.elementCalculations()))},passed:function(t,i){var u=s.get.elementCalculations();if(t&&i)v.onPassed[t]=i;else{if(t!==r)return s.get.pixelsPassed(t)>u.pixelsPassed;u.passing&&n.each(v.onPassed,function(n,t){u.bottomVisible||u.pixelsPassed>s.get.pixelsPassed(n)?s.execute(t,n):v.once||s.remove.occurred(t)})}},onScreen:function(n){var t=s.get.elementCalculations(),u=n||v.onOnScreen,i="onScreen";return n&&(s.debug("Adding callback for onScreen",n),v.onOnScreen=n),t.onScreen?s.execute(u,i):v.once||s.remove.occurred(i),n!==r?t.onOnScreen:void 0},offScreen:function(n){var t=s.get.elementCalculations(),u=n||v.onOffScreen,i="offScreen";return n&&(s.debug("Adding callback for offScreen",n),v.onOffScreen=n),t.offScreen?s.execute(u,i):v.once||s.remove.occurred(i),n!==r?t.onOffScreen:void 0},passing:function(n){var t=s.get.elementCalculations(),u=n||v.onPassing,i="passing";return n&&(s.debug("Adding callback for passing",n),v.onPassing=n),t.passing?s.execute(u,i):v.once||s.remove.occurred(i),n!==r?t.passing:void 0},topVisible:function(n){var t=s.get.elementCalculations(),u=n||v.onTopVisible,i="topVisible";return n&&(s.debug("Adding callback for top visible",n),v.onTopVisible=n),t.topVisible?s.execute(u,i):v.once||s.remove.occurred(i),n===r?t.topVisible:void 0},bottomVisible:function(n){var t=s.get.elementCalculations(),u=n||v.onBottomVisible,i="bottomVisible";return n&&(s.debug("Adding callback for bottom visible",n),v.onBottomVisible=n),t.bottomVisible?s.execute(u,i):v.once||s.remove.occurred(i),n===r?t.bottomVisible:void 0},topPassed:function(n){var t=s.get.elementCalculations(),u=n||v.onTopPassed,i="topPassed";return n&&(s.debug("Adding callback for top passed",n),v.onTopPassed=n),t.topPassed?s.execute(u,i):v.once||s.remove.occurred(i),n===r?t.topPassed:void 0},bottomPassed:function(n){var t=s.get.elementCalculations(),u=n||v.onBottomPassed,i="bottomPassed";return n&&(s.debug("Adding callback for bottom passed",n),v.onBottomPassed=n),t.bottomPassed?s.execute(u,i):v.once||s.remove.occurred(i),n===r?t.bottomPassed:void 0},passingReverse:function(n){var t=s.get.elementCalculations(),u=n||v.onPassingReverse,i="passingReverse";return n&&(s.debug("Adding callback for passing reverse",n),v.onPassingReverse=n),t.passing?v.once||s.remove.occurred(i):s.get.occurred("passing")&&s.execute(u,i),n!==r?!t.passing:void 0},topVisibleReverse:function(n){var t=s.get.elementCalculations(),u=n||v.onTopVisibleReverse,i="topVisibleReverse";return n&&(s.debug("Adding callback for top visible reverse",n),v.onTopVisibleReverse=n),t.topVisible?v.once||s.remove.occurred(i):s.get.occurred("topVisible")&&s.execute(u,i),n===r?!t.topVisible:void 0},bottomVisibleReverse:function(n){var t=s.get.elementCalculations(),u=n||v.onBottomVisibleReverse,i="bottomVisibleReverse";return n&&(s.debug("Adding callback for bottom visible reverse",n),v.onBottomVisibleReverse=n),t.bottomVisible?v.once||s.remove.occurred(i):s.get.occurred("bottomVisible")&&s.execute(u,i),n===r?!t.bottomVisible:void 0},topPassedReverse:function(n){var t=s.get.elementCalculations(),u=n||v.onTopPassedReverse,i="topPassedReverse";return n&&(s.debug("Adding callback for top passed reverse",n),v.onTopPassedReverse=n),t.topPassed?v.once||s.remove.occurred(i):s.get.occurred("topPassed")&&s.execute(u,i),n===r?!t.onTopPassed:void 0},bottomPassedReverse:function(n){var t=s.get.elementCalculations(),u=n||v.onBottomPassedReverse,i="bottomPassedReverse";return n&&(s.debug("Adding callback for bottom passed reverse",n),v.onBottomPassedReverse=n),t.bottomPassed?v.once||s.remove.occurred(i):s.get.occurred("bottomPassed")&&s.execute(u,i),n===r?!t.bottomPassed:void 0},execute:function(n,t){var i=s.get.elementCalculations(),r=s.get.screenCalculations();n=n||!1;n&&(v.continuous?(s.debug("Callback being called continuously",t,i),n.call(b,i,r)):s.get.occurred(t)||(s.debug("Conditions met",t,i),n.call(b,i,r)));s.save.occurred(t)},remove:{fixed:function(){s.debug("Removing fixed position");y.removeClass(nt.fixed).css({position:"",top:"",left:"",zIndex:""})},occurred:function(n){if(n){var t=s.cache.occurred;t[n]!==r&&t[n]===!0&&(s.debug("Callback can now be called again",n),s.cache.occurred[n]=!1)}else s.cache.occurred={}}},save:{calculations:function(){s.verbose("Saving all calculations necessary to determine positioning");s.save.direction();s.save.screenCalculations();s.save.elementCalculations()},occurred:function(n){n&&(s.cache.occurred[n]===r||s.cache.occurred[n]!==!0)&&(s.verbose("Saving callback occurred",n),s.cache.occurred[n]=!0)},scroll:function(n){n=n+v.offset||w.scrollTop()+v.offset;s.cache.scroll=n},direction:function(){var t,i=s.get.scroll(),n=s.get.lastScroll();return t=i>n&&n?"down":n>i&&n?"up":"static",s.cache.direction=t,s.cache.direction},elementPosition:function(){var n=s.cache.element,t=s.get.screenSize();return s.verbose("Saving element position"),n.fits=n.height<t.height,n.offset=y.offset(),n.width=y.outerWidth(),n.height=y.outerHeight(),s.cache.element=n,n},elementCalculations:function(){var t=s.get.screenCalculations(),n=s.get.elementPosition();return v.includeMargin?(n.margin={},n.margin.top=parseInt(y.css("margin-top"),10),n.margin.bottom=parseInt(y.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.topVisible=t.bottom>=n.top,n.topPassed=t.top>=n.top,n.bottomVisible=t.bottom>=n.bottom,n.bottomPassed=t.top>=n.bottom,n.pixelsPassed=0,n.percentagePassed=0,n.onScreen=n.topVisible&&!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),s.cache.element=n,s.verbose("Updated element calculations",n),n},screenCalculations:function(){var n=s.get.scroll();return s.save.direction(),s.cache.screen.top=n,s.cache.screen.bottom=n+s.cache.screen.height,s.cache.screen},screenSize:function(){s.verbose("Saving window position");s.cache.screen={height:w.height()}},position:function(){s.save.screenSize();s.save.elementPosition()}},get:{pixelsPassed:function(n){var t=s.get.elementCalculations();return n.search("%")>-1?t.height*(parseInt(n,10)/100):parseInt(n,10)},occurred:function(n){return s.cache.occurred!==r?s.cache.occurred[n]||!1:!1},direction:function(){return s.cache.direction===r&&s.save.direction(),s.cache.direction},elementPosition:function(){return s.cache.element===r&&s.save.elementPosition(),s.cache.element},elementCalculations:function(){return s.cache.element===r&&s.save.elementCalculations(),s.cache.element},screenCalculations:function(){return s.cache.screen===r&&s.save.screenCalculations(),s.cache.screen},screenSize:function(){return s.cache.screen===r&&s.save.screenSize(),s.cache.screen},scroll:function(){return s.cache.scroll===r&&s.save.scroll(),s.cache.scroll},lastScroll:function(){return s.cache.screen===r?(s.debug("First scroll event, no last scroll could be found"),!1):s.cache.screen.top}},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.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.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(){s.error=Function.prototype.bind.call(console.error,console,v.name+":");s.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:b,"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)&&e.length>0&&(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=k;return i=i||a,u=b||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],!1):(s.error(et.method,t),!1);e=e[u]}})),n.isFunction(o)?h=o.apply(u,i):o!==r&&(h=o),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),o}};l?(k===r&&s.initialize(),k.save.scroll(),k.save.calculations(),s.invoke(c)):(k!==r&&k.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,refreshOnLoad:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,initialCheck:!0,throttle:!1,type:!1,transition:"fade in",duration:1e3,onPassed:{},checkOnRefresh:!0,onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document)