/*
* # Semantic UI - 2.0.0
* https://github.com/Semantic-Org/Semantic-UI
* http://www.semantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(e,t,n,i){e.site=e.fn.site=function(o){var a,r,s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),f=m.namespace,g=m.error,p="module-"+f,v=e(n),h=v,b=this,y=h.data(p);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),y=a,h.data(p,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),(console===i||console.log===i)&&(a.verbose("Console not available, normalizing events"),a.disable.console()),("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(a.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(a.debug("RequestAnimationFrame not available, normailizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,r){o="string"==typeof o?"all"===o?m.modules:[o]:o||m.modules,r=r!==i?r:!0,e.each(o,function(i,o){var s,c=a.moduleExists(o)?e.fn[o].settings.namespace||!1:!0;a.moduleExists(o)&&(a.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,r&&c&&(s=e(":data(module-"+c+")"),s.length>0&&(a.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||m.modules,o=o!==i?o:!0,e.each(n,function(n,i){var r;a.moduleExists(i)&&(a.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&f&&(r=e(":data(module-"+f+")"),r.length>0&&(a.verbose("Modifying existing settings",r),r[i]("setting",t))))})}},enable:{console:function(){a.console(!0)},debug:function(e,t){e=e||m.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,t)}},disable:{console:function(){a.console(!1)},debug:function(e,t){e=e||m.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void a.error(g.console);a.debug("Restoring console function"),t.console=y.cache.console}else a.debug("Disabling console function"),y.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(){a.verbose("Destroying previous site for",h),h.removeData(p)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Element:b,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var s,c,l,u=y;return n=n||d,o=b||o,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(o,n):c!==i&&(l=c),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),c}},u?(y===i&&a.initialize(),a.invoke(l)):(y!==i&&a.destroy(),a.initialize()),r!==i?r:this},e.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","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","video","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.form=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u=arguments[1],d="string"==typeof l,m=[].slice.call(arguments,1);return a.each(function(){var f,g,p,v,h,b,y,x,C,w,k,T,S,A,P,R,E,F,O=e(this),D=this,q=[],z=!1;F={initialize:function(){F.get.settings(),d?(E===i&&F.instantiate(),F.invoke(l)):(F.verbose("Initializing form validation",O,x),F.bindEvents(),F.set.defaults(),F.instantiate())},instantiate:function(){F.verbose("Storing instance of module",F),E=F,O.data(P,F)},destroy:function(){F.verbose("Destroying previous module",E),F.removeEvents(),O.removeData(P)},refresh:function(){F.verbose("Refreshing selector cache"),f=O.find(k.field),g=O.find(k.group),p=O.find(k.message),v=O.find(k.prompt),h=O.find(k.submit),b=O.find(k.clear),y=O.find(k.reset)},submit:function(){F.verbose("Submitting form",O),O.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+R,function(e){F[n](),e.preventDefault()})},bindEvents:function(){F.verbose("Attaching form events"),O.on("submit"+R,F.validate.form).on("blur"+R,k.field,F.event.field.blur).on("click"+R,k.submit,F.submit).on("click"+R,k.reset,F.reset).on("click"+R,k.clear,F.clear),x.keyboardShortcuts&&O.on("keydown"+R,k.field,F.event.field.keydown),f.each(function(){var t=e(this),n=t.prop("type"),i=F.get.changeEvent(n,t);e(this).on(i+R,F.event.field.change)})},clear:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(g),o=i.find(k.prompt),a=t.data(w.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),c=i.hasClass(T.error);c&&(F.verbose("Resetting error on field",i),i.removeClass(T.error),o.remove()),s?(F.verbose("Resetting dropdown value",n,a),n.dropdown("clear")):r?t.prop("checked",!1):(F.verbose("Resetting field value",t,a),t.val(""))})},reset:function(){f.each(function(){var t=e(this),n=t.parent(),o=t.closest(g),a=o.find(k.prompt),r=t.data(w.defaultValue),s=n.is(k.uiCheckbox),c=n.is(k.uiDropdown),l=o.hasClass(T.error);r===i&&(r=""),l&&(F.verbose("Resetting error on field",o),o.removeClass(T.error),a.remove()),c?(F.verbose("Resetting dropdown value",n,r),n.dropdown("restore defaults")):s?(F.verbose("Resetting checkbox value",n,r),t.prop("checked",r)):(F.verbose("Resetting field value",t,r),t.val(r))})},removeEvents:function(){O.off(R),f.off(R),h.off(R),f.off(R)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o={enter:13,escape:27};i==o.escape&&(F.verbose("Escape key pressed blurring field"),n.blur()),!t.ctrlKey&&i==o.enter&&n.is(k.input)&&n.not(k.checkbox).length>0&&(z||(n.one("keyup"+R,F.event.field.keyup),F.submit(),F.debug("Enter pressed on input submitting form")),z=!0)},keyup:function(){z=!1},blur:function(){var t=e(this),n=t.closest(g);n.hasClass(T.error)?(F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))):("blur"==x.on||"change"==x.on)&&F.validate.field(F.get.validation(t))},change:function(){var t=e(this),n=t.closest(g);("change"==x.on||n.hasClass(T.error)&&x.revalidate)&&(clearTimeout(F.timer),F.timer=setTimeout(function(){F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))},x.delay))}}},get:{changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":F.get.inputEvent()},inputEvent:function(){return n.createElement("input").oninput!==i?"input":n.createElement("input").onpropertychange!==i?"propertychange":"keyup"},settings:function(){if(e.isPlainObject(t)){var n=Object.keys(t),o=n.length>0?t[n[0]].identifier!==i:!1;o?(x=e.extend(!0,{},e.fn.form.settings,u),C=e.extend({},e.fn.form.settings.defaults,t),F.error(x.error.oldSyntax,D),F.verbose("Extending settings from legacy parameters",C,x)):(x=e.extend(!0,{},e.fn.form.settings,t),C=e.extend({},e.fn.form.settings.defaults,x.fields),F.verbose("Extending settings",C,x))}else x=e.fn.form.settings,C=e.fn.form.settings.defaults,F.verbose("Using default form validation",C,x);A=x.namespace,w=x.metadata,k=x.selector,T=x.className,S=x.error,P="module-"+A,R="."+A,E=O.data(P),F.refresh()},field:function(t){return F.verbose("Finding field with identifier",t),f.filter("#"+t).length>0?f.filter("#"+t):f.filter('[name="'+t+'"]').length>0?f.filter('[name="'+t+'"]'):f.filter('[name="'+t+'[]"]').length>0?f.filter('[name="'+t+'[]"]'):f.filter("[data-"+w.validate+'="'+t+'"]').length>0?f.filter("[data-"+w.validate+'="'+t+'"]'):e(" ")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(F.get.field(t))}),n},validation:function(t){var n;return e.each(C,function(e,i){F.get.field(i.identifier)[0]==t[0]&&(n=i)}),n||!1},value:function(e){var t,n=[];return n.push(e),t=F.get.values.call(D,n),t[e]},values:function(t){var n=e.isArray(t)?F.get.fields(t):f,i={};return n.each(function(t,n){var o=e(n),a=(o.prop("type"),o.prop("name")),r=o.val(),s=o.is(k.checkbox),c=o.is(k.radio),l=-1!==a.indexOf("[]"),u=s?o.is(":checked"):!1;if(a)if(l)if(a=a.replace("[]",""),i[a]||(i[a]=[]),s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a].push(r)}else i[a].push(r);else if(c)u&&(i[a]=r);else if(s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a]=!0}else i[a]=r}),i}},has:{field:function(e){return F.verbose("Checking for existence of a field with identifier",e),f.filter("#"+e).length>0?!0:f.filter('[name="'+e+'"]').length>0?!0:f.filter("[data-"+w.validate+'="'+e+'"]').length>0?!0:!1}},add:{prompt:function(t,n){var o=F.get.field(t),a=o.closest(g),r=a.children(k.prompt),s=0!==r.length;n="string"==typeof n?[n]:n,F.verbose("Adding field error state",t),a.addClass(T.error),x.inline&&(s||(r=x.templates.prompt(n),r.appendTo(a)),r.html(n[0]),s?F.verbose("Inline errors are disabled, no inline error added",t):x.transition&&e.fn.transition!==i&&O.transition("is supported")?(F.verbose("Displaying error with css transition",x.transition),r.transition(x.transition+" in",x.duration)):(F.verbose("Displaying error with fallback javascript animation"),r.fadeIn(x.duration)))},errors:function(e){F.debug("Adding form error messages",e),p.html(x.templates.error(e))}},remove:{prompt:function(t){var n=F.get.field(t.identifier),o=n.closest(g),a=o.children(k.prompt);o.removeClass(T.error),x.inline&&a.is(":visible")&&(F.verbose("Removing prompt for field",t),x.transition&&e.fn.transition!==i&&O.transition("is supported")?a.transition(x.transition+" out",x.duration,function(){a.remove()}):a.fadeOut(x.duration,function(){a.remove()}))}},set:{success:function(){O.removeClass(T.error).addClass(T.success)},defaults:function(){f.each(function(){var t=e(this),n=t.filter(k.checkbox).length>0,i=n?t.is(":checked"):t.val();t.data(w.defaultValue,i)})},error:function(){O.removeClass(T.success).addClass(T.error)},value:function(e,t){var n={};return n[e]=t,F.set.values.call(D,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=F.get.field(t),a=o.parent(),r=e.isArray(n),s=a.is(k.uiCheckbox),c=a.is(k.uiDropdown),l=o.is(k.radio)&&s,u=o.length>0;u&&(r&&s?(F.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):l?(F.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(k.uiCheckbox).checkbox("check")):s?(F.verbose("Setting checkbox value",n,a),a.checkbox(n===!0?"check":"uncheck")):c?(F.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):(F.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(t){var n=!0;return z?!1:(q=[],e.each(C,function(e,t){F.validate.field(t)||(n=!1)}),n?(F.debug("Form has no validation errors, submitting"),F.set.success(),x.onSuccess.call(D,t)):(F.debug("Form has errors"),F.set.error(),x.inline||F.add.errors(q),O.data("moduleApi")!==i&&t.stopImmediatePropagation(),x.onFailure.call(D,q)))},field:function(t){var n=F.get.field(t.identifier),o=!0,a=[];return n.prop("disabled")?(F.debug("Field is disabled. Skipping",t.identifier),o=!0):t.optional&&""===e.trim(n.val())?(F.debug("Field is optional and empty. Skipping",t.identifier),o=!0):t.rules!==i&&e.each(t.rules,function(e,n){F.has.field(t.identifier)&&!F.validate.rule(t,n)&&(F.debug("Field is invalid",t.identifier,n.type),a.push(n.prompt),o=!1)}),o?(F.remove.prompt(t,a),x.onValid.call(n),!0):(q=q.concat(a),F.add.prompt(t.identifier,a),x.onInvalid.call(n,a),!1)},rule:function(t,n){var i,o,a,r=F.get.field(t.identifier),s=n.type,c=r.val(),l=s.match(x.regExp.bracket),u=!0;if(c=e.trim(r.val()+""),l){if(o=""+l[1],a=s.replace(l[0],""),i=x.rules[a],!e.isFunction(i))return void F.error(S.noRule,a);u=i.call(r,c,o)}else{if(i=x.rules[s],!e.isFunction(i))return void F.error(S.noRule,s);u=i.call(r,c)}return u}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,F,t);else{if(n===i)return F[t];F[t]=n}},debug:function(){x.debug&&(x.performance?F.performance.log(arguments):(F.debug=Function.prototype.bind.call(console.info,console,x.name+":"),F.debug.apply(console,arguments)))},verbose:function(){x.verbose&&x.debug&&(x.performance?F.performance.log(arguments):(F.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),F.verbose.apply(console,arguments)))},error:function(){F.error=Function.prototype.bind.call(console.error,console,x.name+":"),F.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(F.performance.timer),F.performance.timer=setTimeout(F.performance.display,500)},display:function(){var t=x.name+":",n=0;s=!1,clearTimeout(F.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=E;return n=n||m,a=D||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},F.initialize()}),o!==i?o:this},e.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:/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/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 n='
';return e.each(t,function(e,t){n+=""+t+" "}),n+=" ",e(n)},prompt:function(t){return e("
").addClass("ui red pointing prompt label").html(t[0])}},rules:{checked:function(){return e(this).filter(":checked").length>0},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},email:function(t){var n=new RegExp(e.fn.form.settings.regExp.email,"i");return n.test(t)},empty:function(t){return!(t===i||""===t||e.isArray(t)&&0===t.length)},integer:function(t,n){var o,a,r,s=e.fn.form.settings.regExp.integer;return n===i||""===n||".."===n||(-1==n.indexOf("..")?s.test(n)&&(o=a=n-0):(r=n.split("..",2),s.test(r[0])&&(o=r[0]-0),s.test(r[1])&&(a=r[1]-0))),s.test(t)&&(o===i||t>=o)&&(a===i||a>=t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,e==t},isExactly:function(e,t){return e==t},length:function(e,t){return e!==i?e.length>=t:!1},different:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()!==o.toString():!1},match:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()==o.toString():!1},maxCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length<=n},exactCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length==n},minCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length>=n},regExp:function(t,n){var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},maxLength:function(e,t){return e!==i?e.length<=t:!1},not:function(e,t){return e="string"==typeof e?e.toLowerCase():e,t="string"==typeof t?t.toLowerCase():t,e!=t},notExactly:function(e,t){return e!=t},url:function(t){return e.fn.form.settings.regExp.url.match(t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.accordion=function(n){{var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=a.selector||"",C=e(this),w=C.find(v.title),k=C.find(v.content),T=this,S=C.data(y);m={initialize:function(){m.debug("Initializing",C),m.bind.events(),m.observeChanges(),m.instantiate()},instantiate:function(){S=m,C.data(y,m)},destroy:function(){m.debug("Destroying previous instance",C),C.off(b).removeData(y)},refresh:function(){w=C.find(v.title),k=C.find(v.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),d.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",d))},bind:{events:function(){m.debug("Binding delegated events"),C.on(f.on+b,v.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r&&!a,c=!r&&a;m.debug("Toggling visibility of content",n),s||c?f.collapsible?m.close.call(n):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(n)},open:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r||a;return s?void m.debug("Accordion already open, skipping",o):(m.debug("Opening accordion content",n),f.onOpening.call(o),f.exclusive&&m.closeOthers.call(n),n.addClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:1},f.duration,m.resetOpacity)),void o.slideDown(f.duration,f.easing,function(){o.removeClass(g.animating).addClass(g.active),m.reset.display.call(this),f.onOpen.call(this),f.onChange.call(this)}))},close:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=!r&&a,c=r&&a;!r&&!s||c||(m.debug("Closing accordion content",o),f.onClosing.call(o),n.removeClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),o.slideUp(f.duration,f.easing,function(){o.removeClass(g.animating).removeClass(g.active),m.reset.display.call(this),f.onClose.call(this),f.onChange.call(this)}))},closeOthers:function(t){var n,o,a,r=t!==i?w.eq(t):e(this).closest(v.title),s=r.parents(v.content).prev(v.title),c=r.closest(v.accordion),l=v.title+"."+g.active+":visible",u=v.content+"."+g.active+":visible";f.closeNested?(n=c.find(l).not(s),a=n.next(k)):(n=c.find(l).not(s),o=c.find(u).find(l).not(s),n=n.not(o),a=n.next(k)),n.length>0&&(m.debug("Exclusive enabled, closing other content",n),n.removeClass(g.active),a.removeClass(g.animating).stop(!0,!0),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):a.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),a.slideUp(f.duration,f.easing,function(){e(this).removeClass(g.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){return m.debug("Changing internal",t,n),n===i?m[t]:void(e.isPlainObject(t)?e.extend(!0,m,t):m[t]=n)},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;r=!1,clearTimeout(m.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,c,l=S;return n=n||u,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},l?(S===i&&m.initialize(),m.invoke(c)):(S!==i&&S.invoke("destroy"),m.initialize())}),o!==i?o:this},e.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"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.checkbox=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f=e.extend(!0,{},e.fn.checkbox.settings,n),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=e(this),C=e(this).find(v.label),w=e(this).find(v.input),k=x.data(y),T=this;m={initialize:function(){m.verbose("Initializing checkbox",f),m.create.label(),m.add.events(),m.set.tabbable(),m.setup(),m.observeChanges(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),k=m,x.data(y,m)},destroy:function(){m.verbose("Destroying module"),m.remove.events(),x.removeData(y)},setup:function(){m.is.checked()?(m.debug("Setting initial value to checked"),m.set.checked(),f.fireOnInit&&f.onChecked.call(w[0])):(m.debug("Setting initial value to unchecked"),m.remove.checked(),f.fireOnInit&&f.onUnchecked.call(w[0]))},refresh:function(){C=x.find(v.label),w=x.find(v.input)},observeChanges:function(){"MutationObserver"in t&&(a=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),a.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",a))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(m[n])?m[n]:m.toggle,i.length>0?(m.debug("Attaching checkbox events to element",t,n),i.on("click"+b,n)):m.error(h.notFound)},event:{keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape&&(m.verbose("Escape key pressed blurring field"),w.blur(),e.preventDefault()),e.ctrlKey||t!=n.enter&&t!=n.space||(m.verbose("Enter key pressed, toggling checkbox"),m.toggle(),e.preventDefault())}},get:{radios:function(){return e('input[name="'+m.get.name()+'"]').closest(v.checkbox)},name:function(){return w.attr("name")}},is:{radio:function(){return w.hasClass(g.radio)||"radio"==w.attr("type")},checked:function(){return w.prop("checked")!==i&&w.prop("checked")},unchecked:function(){return!m.is.checked()}},can:{change:function(){return!(x.hasClass(g.disabled)||x.hasClass(g.readOnly)||w.prop("disabled"))},uncheck:function(){return"boolean"==typeof f.uncheckable?f.uncheckable:!m.is.radio()}},set:{checked:function(){var e;m.is.radio()&&(e=m.get.radios(),m.debug("Unchecking other radios",e),e.removeClass(g.checked)),x.addClass(g.checked)},tabbable:function(){w.attr("tabindex")===i&&w.attr("tabindex",0)}},create:{label:function(){w.prevAll(v.label).length>0?(w.prev(v.label).detach().insertAfter(w),m.debug("Moving existing label",C)):m.has.label()||(C=e("").insertAfter(w),m.debug("Creating label",C))}},has:{label:function(){return C.length>0}},add:{events:function(){m.verbose("Attaching checkbox events"),x.on("click"+b,m.toggle).on("keydown"+b,v.input,m.event.keydown)}},remove:{checked:function(){x.removeClass(g.checked)},events:function(){m.debug("Removing events"),x.off(b).removeData(y),C.off(b)}},enable:function(){m.debug("Enabling checkbox functionality"),x.removeClass(g.disabled),w.prop("disabled",!1),f.onEnabled.call(w[0])},disable:function(){m.debug("Disabling checkbox functionality"),x.addClass(g.disabled),w.prop("disabled","disabled"),f.onDisabled.call(w[0])},check:function(){m.debug("Enabling checkbox",w),w.prop("checked",!0).trigger("change"),m.set.checked(),f.onChange.call(w[0]),f.onChecked.call(w[0])},uncheck:function(){m.debug("Disabling checkbox"),w.prop("checked",!1).trigger("change"),m.remove.checked(),f.onChange.call(w[0]),f.onUnchecked.call(w[0])},toggle:function(){return m.can.change()?(m.verbose("Determining new checkbox state"),void(m.is.unchecked()?m.check():m.is.checked()&&m.can.uncheck()&&m.uncheck())):void(m.is.radio()||m.debug("Checkbox is read-only or disabled, ignoring toggle"))},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n
})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=k;return n=n||d,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(k===i&&m.initialize(),m.invoke(l)):(k!==i&&k.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!0,onChange:function(){},onChecked:function(){},onUnchecked:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",disabled:"disabled",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",input:'> input[type="checkbox"], > input[type="radio"]',label:"> label"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.dimmer=function(t){var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);return a.each(function(){var d,m,f,g=e.isPlainObject(t)?e.extend(!0,{},e.fn.dimmer.settings,t):e.extend({},e.fn.dimmer.settings),p=g.selector,v=g.namespace,h=g.className,b=g.error,y="."+v,x="module-"+v,C=a.selector||"",w="ontouchstart"in n.documentElement?"touchstart":"click",k=e(this),T=this,S=k.data(x);f={preinitialize:function(){f.is.dimmer()?(m=k.parent(),d=k):(m=k,d=f.has.dimmer()?g.dimmerName?m.find(p.dimmer).filter("."+g.dimmerName):m.find(p.dimmer):f.create())},initialize:function(){f.debug("Initializing dimmer",g),"hover"==g.on?m.on("mouseenter"+y,f.show).on("mouseleave"+y,f.hide):"click"==g.on&&m.on(w+y,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",m),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",d),m.on(w+y,p.dimmer,f.event.click)),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),S=f,k.data(x,S)},destroy:function(){f.verbose("Destroying previous module",d),k.removeData(x),m.off(y)},event:{click:function(t){f.verbose("Determining if event occured on dimmer",t),(0===d.find(t.target).length||e(t.target).is(p.content))&&(f.hide(),t.stopImmediatePropagation())}},addContent:function(t){var n=e(t);f.debug("Add content to dimmer",n),n.parent()[0]!==d[0]&&n.detach().appendTo(d)},create:function(){var t=e(g.template.dimmer());return g.variation&&(f.debug("Creating dimmer with variation",g.variation),t.addClass(g.variation)),g.dimmerName&&(f.debug("Creating named dimmer",g.dimmerName),t.addClass(g.dimmerName)),t.appendTo(m),t},show:function(t){t=e.isFunction(t)?t:function(){},f.debug("Showing dimmer",d,g),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(t),g.onShow.call(T),g.onChange.call(T))},hide:function(t){t=e.isFunction(t)?t:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",d),f.animate.hide(t),g.onHide.call(T),g.onChange.call(T)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",d),f.is.dimmed()?f.hide():f.show()},animate:{show:function(t){t=e.isFunction(t)?t:function(){},g.useCSS&&e.fn.transition!==i&&d.transition("is supported")?("auto"!==g.opacity&&f.set.opacity(),d.transition({animation:g.transition+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimmed()},onComplete:function(){f.set.active(),t()}})):(f.verbose("Showing dimmer animation with javascript"),f.set.dimmed(),"auto"==g.opacity&&(g.opacity=.8),d.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(f.get.duration(),g.opacity,function(){d.removeAttr("style"),f.set.active(),t()}))},hide:function(t){t=e.isFunction(t)?t:function(){},g.useCSS&&e.fn.transition!==i&&d.transition("is supported")?(f.verbose("Hiding dimmer with css"),d.transition({animation:g.transition+" out",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.remove.dimmed()},onComplete:function(){f.remove.active(),t()}})):(f.verbose("Hiding dimmer with javascript"),f.remove.dimmed(),d.stop().fadeOut(f.get.duration(),function(){f.remove.active(),d.removeAttr("style"),t()}))}},get:{dimmer:function(){return d},duration:function(){return"object"==typeof g.duration?f.is.active()?g.duration.hide:g.duration.show:g.duration}},has:{dimmer:function(){return g.dimmerName?k.find(p.dimmer).filter("."+g.dimmerName).length>0:k.find(p.dimmer).length>0}},is:{active:function(){return d.hasClass(h.active)},animating:function(){return d.is(":animated")||d.hasClass(h.animating)},closable:function(){return"auto"==g.closable?"hover"==g.on?!1:!0:g.closable},dimmer:function(){return k.hasClass(h.dimmer)},dimmable:function(){return k.hasClass(h.dimmable)},dimmed:function(){return m.hasClass(h.dimmed)},disabled:function(){return m.hasClass(h.disabled)},enabled:function(){return!f.is.disabled()},page:function(){return m.is("body")},pageDimmer:function(){return d.hasClass(h.pageDimmer)}},can:{show:function(){return!d.hasClass(h.disabled)}},set:{opacity:function(e){var e=g.opacity||e,t=d.css("background-color"),n=t.split(","),i=n&&4==n.length;i?(n[3]=e+")",t=n.join(",")):t="rgba(0, 0, 0, "+e+")",f.debug("Setting opacity to",e),d.css("background-color",t)},active:function(){d.addClass(h.active)},dimmable:function(){m.addClass(h.dimmable)},dimmed:function(){m.addClass(h.dimmed)},pageDimmer:function(){d.addClass(h.pageDimmer)},disabled:function(){d.addClass(h.disabled)}},remove:{active:function(){d.removeClass(h.active)},dimmed:function(){m.removeClass(h.dimmed)},disabled:function(){d.removeClass(h.disabled)}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=g.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",C&&(t+=" '"+C+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,c,l=S;return n=n||u,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(f.error(b.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},f.preinitialize(),l?(S===i&&f.initialize(),f.invoke(c)):(S!==i&&S.invoke("destroy"),f.initialize())}),o!==i?o:this},e.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 e("
").attr("class","ui dimmer")}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.dropdown=function(o){var a,r=e(this),s=e(n),c=r.selector||"",l="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return r.each(function(){var p,v,h,b,y,x,C,w=e.isPlainObject(o)?e.extend(!0,{},e.fn.dropdown.settings,o):e.extend({},e.fn.dropdown.settings),k=w.className,T=w.message,S=w.metadata,A=w.namespace,P=w.regExp,R=w.selector,E=w.error,F=w.templates,O="."+A,D="module-"+A,q=e(this),z=q.find(R.text),j=q.find(R.search),I=q.find(R.input),N=q.find(R.icon),L=q.prev().find(R.text).length>0?q.prev().find(R.text):q.prev(),M=q.children(R.menu),V=M.find(R.item),H=!1,U=!1,W=this,B=q.data(D);C={initialize:function(){C.debug("Initializing dropdown",w),C.is.alreadySetup()?C.setup.reference():(C.setup.layout(),C.save.defaults(),C.restore.selected(),C.create.id(),l&&C.bind.touchEvents(),C.bind.mouseEvents(),C.bind.keyboardEvents(),C.observeChanges(),C.instantiate())},instantiate:function(){C.verbose("Storing instance of dropdown",C),B=C,q.data(D,C)},destroy:function(){C.verbose("Destroying previous dropdown for",q),C.remove.tabbable(),q.off(O).removeData(D),M.off(O),s.off(h),y&&y.disconnect(),x&&x.disconnect()},observeChanges:function(){"MutationObserver"in t&&(y=new MutationObserver(function(e){C.debug(" modified, recreating menu"),C.setup.select()}),x=new MutationObserver(function(e){C.debug("Menu modified, updating selector cache"),C.refresh()}),C.has.input()&&y.observe(I[0],{childList:!0,subtree:!0}),C.has.menu()&&x.observe(M[0],{childList:!0,subtree:!0}),C.debug("Setting up mutation observer",y,x))},create:{id:function(){b=(Math.random().toString(16)+"000000000").substr(2,8),h="."+b,C.verbose("Creating unique id for element",b)},userLabels:function(){var t=C.get.userValues();t&&(C.debug("Adding user labels",t),e.each(t,function(e,t){C.verbose("Adding custom user value"),C.add.label(t,t)}))}},search:function(e){e=e!==i?e:C.get.query(),C.verbose("Searching for query",e),C.filter(e)},select:{firstUnfiltered:function(){C.verbose("Selecting first non-filtered element"),C.remove.selectedItem(),V.not(R.unselectable).eq(0).addClass(k.selected)},nextAvailable:function(e){e=e.eq(0);var t=e.nextAll(R.item).not(R.unselectable).eq(0),n=e.prevAll(R.item).not(R.unselectable).eq(0),i=t.length>0;i?(C.verbose("Moving selection to",t),t.addClass(k.selected)):(C.verbose("Moving selection to",n),n.addClass(k.selected))}},setup:{api:function(){var e={debug:w.debug,on:!1};C.verbose("First request, initializing API"),q.api(e)},layout:function(){q.is("select")&&C.setup.select(),C.is.search()&&!C.has.search()&&(C.verbose("Adding search input"),j=e(" ").addClass(k.search).insertBefore(z)),w.allowTab&&C.set.tabbable(),0===M.length&&(M=e("
").addClass(k.menu).appendTo(q))},select:function(){var t=C.get.selectValues();C.debug("Dropdown initialized on a select",t),q.is("select")&&(I=q),I.parent(R.dropdown).length>0?(C.debug("UI dropdown already exists. Creating dropdown menu only"),q=I.closest(R.dropdown),M=q.children(R.menu),C.setup.menu(t)):(C.debug("Creating entire dropdown from select"),q=e("
").attr("class",I.attr("class")).addClass(k.selection).addClass(k.dropdown).html(F.dropdown(t)).insertBefore(I),I.removeAttr("class").detach().prependTo(q)),I.is("[multiple]")&&C.set.multiple(),C.refresh()},menu:function(e){M.html(F.menu(e)),V=M.find(R.item)},reference:function(){var e,t,n=r.index(q);C.debug("Dropdown behavior was called on select, replacing with closest dropdown"),q=q.parent(R.dropdown),C.refresh(),e=r.slice(0,n),t=r.slice(n+1),r=e.add(q).add(t),f&&(B=C,C.invoke(m))}},refresh:function(){C.verbose("Refreshing selector cache"),z=q.find(R.text),j=q.find(R.search),I=q.find(R.input),N=q.find(R.icon),L=q.prev().find(R.text).length>0?q.prev().find(R.text):q.prev(),M=q.children(R.menu),V=M.find(R.item)},toggle:function(){C.verbose("Toggling menu visibility"),C.is.active()?C.hide():C.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},C.can.show()&&!C.is.active()){if(C.debug("Showing dropdown"),C.is.multiple()&&!C.has.search()&&C.is.allFiltered())return!0;C.animate.show(function(){C.can.click()&&C.bind.intent(),C.set.visible(),t.call(W)}),w.onShow.call(W)}},hide:function(t){t=e.isFunction(t)?t:function(){},C.is.active()&&(C.debug("Hiding dropdown"),C.animate.hide(function(){C.remove.visible(),t.call(W)}),w.onHide.call(W))},hideOthers:function(){C.verbose("Finding other dropdowns to hide"),r.not(q).has(R.menu+"."+k.visible).dropdown("hide")},hideMenu:function(){C.verbose("Hiding menu instantaneously"),C.remove.active(),C.remove.visible(),M.transition("hide")},hideSubMenus:function(){var e=M.children(R.item).find(R.menu);C.verbose("Hiding sub menus",e),e.transition("hide")},bind:{keyboardEvents:function(){C.debug("Binding keyboard events"),q.on("keydown"+O,C.event.keydown),C.has.search()&&q.on(C.get.inputEvent()+O,R.search,C.event.input),C.is.multiple()&&s.on("keydown"+h,C.event.document.keydown)},touchEvents:function(){C.debug("Touch device detected binding additional touch events"),C.is.searchSelection()||q.on("touchstart"+O,C.event.test.toggle),M.on("touchstart"+O,R.item,C.event.item.mouseenter)},mouseEvents:function(){C.debug("Mouse detected binding mouse events"),C.is.multiple()&&q.on("click"+O,R.label,C.event.label.click).on("click"+O,R.remove,C.event.remove.click),C.is.searchSelection()?(q.on("mousedown"+O,R.menu,C.event.menu.mousedown).on("mouseup"+O,R.menu,C.event.menu.mouseup).on("click"+O,R.search,C.show).on("focus"+O,R.search,C.event.search.focus).on("blur"+O,R.search,C.event.search.blur).on("click"+O,R.text,C.event.text.focus),C.is.multiple()&&q.on("click"+O,C.event.click)):("click"==w.on?q.on("click"+O,C.event.test.toggle):"hover"==w.on?q.on("mouseenter"+O,C.delay.show).on("mouseleave"+O,C.delay.hide):q.on(w.on+O,C.toggle),q.on("mousedown"+O,C.event.mousedown).on("mouseup"+O,C.event.mouseup).on("focus"+O,C.event.focus).on("blur"+O,C.event.blur)),M.on("mouseenter"+O,R.item,C.event.item.mouseenter).on("mouseleave"+O,R.item,C.event.item.mouseleave).on("click"+O,R.item,C.event.item.click)},intent:function(){C.verbose("Binding hide intent event to document"),l&&s.on("touchstart"+h,C.event.test.touch).on("touchmove"+h,C.event.test.touch),s.on("click"+h,C.event.test.hide)}},unbind:{intent:function(){C.verbose("Removing hide intent event from document"),l&&s.off("touchstart"+h).off("touchmove"+h),s.off("click"+h)}},filter:function(e){var t=e!==i?e:C.get.query(),n=function(){C.is.multiple()&&C.filterActive(),C.select.firstUnfiltered(),C.has.allResultsFiltered()?w.onNoResults.call(W,t)?w.allowAdditions||(C.verbose("All items filtered, showing message",t),C.add.message(T.noResults)):(C.verbose("All items filtered, hiding dropdown",t),C.hideMenu()):C.remove.message(),w.allowAdditions&&C.add.userChoice(e),C.is.searchSelection()&&C.can.show()&&C.is.focusedOnSearch()&&C.show()};C.has.maxSelections()||(w.apiSettings?C.can.useAPI()?C.queryRemote(t,function(){n()}):C.error(E.noAPI):(C.filterItems(t),n()))},queryRemote:function(t,n){var i={errorDuration:!1,throttle:w.throttle,cache:"local",urlData:{query:t},onError:function(){C.add.message(T.serverError),n()},onFailure:function(){C.add.message(T.serverError),n()},onSuccess:function(e){C.remove.message(),C.setup.menu({values:e.results}),n()}};q.api("get request")||C.setup.api(),i=e.extend(!0,{},i,w.apiSettings),q.api("setting",i).api("query")},filterItems:function(t){var n=t!==i?t:C.get.query(),o=e(),a=C.escape.regExp(n),r=new RegExp("^"+a,"igm");""===n?o=V:(C.verbose("Searching for matching values",n),V.each(function(){var t,i,a=e(this);if("both"==w.match||"text"==w.match){if(t=String(C.get.choiceText(a,!1)),-1!==t.search(r))return o=o.add(a),!0;if(w.fullTextSearch&&C.fuzzySearch(n,t))return o=o.add(a),!0}if("both"==w.match||"value"==w.match){if(i=String(C.get.choiceValue(a,t)),-1!==i.search(r))return o=o.add(a),!0;if(w.fullTextSearch&&C.fuzzySearch(n,i))return o=o.add(a),!0}})),C.debug("Showing only matched items",n),C.remove.filteredItem(),V.not(o).addClass(k.filtered)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var r=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},filterActive:function(){w.useLabels&&V.filter("."+k.active).addClass(k.filtered)},focusSearch:function(){C.is.search()&&!C.is.focusedOnSearch()&&j[0].focus()},forceSelection:function(){var e=V.not(k.filtered).filter("."+k.selected).eq(0),t=V.not(k.filtered).filter("."+k.active).eq(0),n=e.length>0?e:t,i=n.size()>0;i?(C.debug("Forcing partial selection to selected item",n),C.event.item.click.call(n)):C.hide()},event:{focus:function(){w.showOnFocus&&!H&&C.is.hidden()&&!v&&C.show()},click:function(t){var n=e(t.target);!n.is(q)&&!n.is(N)||C.is.focusedOnSearch()||C.focusSearch()},blur:function(e){v=n.activeElement===this,H||v||(C.remove.activeLabel(),C.hide())},mousedown:function(){H=!0},mouseup:function(){H=!1},search:{focus:function(){H=!0,C.is.multiple()&&C.remove.activeLabel(),w.showOnFocus&&C.show()},blur:function(e){v=n.activeElement===this,U||v||(C.is.multiple()?(C.remove.activeLabel(),C.hide()):w.forceSelection?C.forceSelection():C.hide())}},text:{focus:function(e){H=!0,C.focusSearch()}},input:function(e){(C.is.multiple()||C.is.searchSelection())&&C.set.filtered(),clearTimeout(C.timer),C.timer=setTimeout(C.search,w.delay.search)},label:{click:function(t){var n=e(this),i=q.find(R.label),o=i.filter("."+k.active),a=n.nextAll("."+k.active),r=n.prevAll("."+k.active),s=a.length>0?n.nextUntil(a).add(o).add(n):n.prevUntil(r).add(o).add(n);t.shiftKey?(o.removeClass(k.active),s.addClass(k.active)):t.ctrlKey?n.toggleClass(k.active):(o.removeClass(k.active),n.addClass(k.active)),w.onLabelSelect.apply(this,i.filter("."+k.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(k.active)?C.remove.activeLabels():C.remove.activeLabels(t)}},test:{toggle:function(e){var t=C.is.multiple()?C.show:C.toggle;C.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){C.determine.eventOnElement(e,function(){"touchstart"==e.type?C.timer=setTimeout(C.hide,w.delay.touch):"touchmove"==e.type&&clearTimeout(C.timer)}),e.stopPropagation()},hide:function(e){C.determine.eventInModule(e,C.hide)}},menu:{mousedown:function(){U=!0},mouseup:function(){U=!1}},item:{mouseenter:function(t){var n=e(this).children(R.menu),i=e(this).siblings(R.item).children(R.menu);n.length>0&&(clearTimeout(C.itemTimer),C.itemTimer=setTimeout(function(){C.verbose("Showing sub-menu",n),e.each(i,function(){C.animate.hide(!1,e(this))}),C.animate.show(!1,n)},w.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(R.menu);n.length>0&&(clearTimeout(C.itemTimer),C.itemTimer=setTimeout(function(){C.verbose("Hiding sub-menu",n),C.animate.hide(!1,n)},w.delay.hide))},click:function(t){var n=e(this),i=e(t?t.target:""),o=n.find(R.menu),a=C.get.choiceText(n),r=C.get.choiceValue(n,a),s=o.length>0,c=o.find(i).length>0;c||s&&!w.allowCategorySelection||(w.useLabels||C.remove.searchTerm(),C.determine.selectAction.call(this,a,r))}},document:{keydown:function(e){var t=e.which,n=C.get.shortcutKeys(),i=C.is.inObject(t,n);if(i){var o=q.find(R.label),a=o.filter("."+k.active),r=(a.data("value"),o.index(a)),s=o.length,c=a.length>0,l=a.length>1,u=0===r,d=r+1==s,m=C.is.searchSelection(),f=C.is.focusedOnSearch(),g=C.is.focused(),p=f&&0===C.get.caretPosition();if(m&&!c&&!f)return;t==n.leftArrow?!g&&!p||c?c&&(e.shiftKey?C.verbose("Adding previous label to selection"):(C.verbose("Selecting previous label"),o.removeClass(k.active)),u&&!l?a.addClass(k.active):a.prev(R.siblingLabel).addClass(k.active).end(),e.preventDefault()):(C.verbose("Selecting previous label"),o.last().addClass(k.active)):t==n.rightArrow?(g&&!c&&o.first().addClass(k.active),c&&(e.shiftKey?C.verbose("Adding next label to selection"):(C.verbose("Selecting next label"),o.removeClass(k.active)),d?m?f?o.removeClass(k.active):C.focusSearch():l?a.next(R.siblingLabel).addClass(k.active):a.addClass(k.active):a.next(R.siblingLabel).addClass(k.active),e.preventDefault())):t==n.deleteKey||t==n.backspace?c?(C.verbose("Removing active labels"),d&&m&&!f&&C.focusSearch(),a.last().next(R.siblingLabel).addClass(k.active),C.remove.activeLabels(a),e.preventDefault()):p&&!c&&t==n.backspace&&(C.verbose("Removing last label on input backspace"),a=o.last().addClass(k.active),C.remove.activeLabels(a)):a.removeClass(k.active)}}},keydown:function(e){var t=e.which,n=C.get.shortcutKeys(),i=C.is.inObject(t,n);if(i){var o,a,r=V.not(R.unselectable).filter("."+k.selected).eq(0),s=M.children("."+k.active).eq(0),c=r.length>0?r:s,l=c.length>0?c.siblings(":not(."+k.filtered+")").andSelf():M.children(":not(."+k.filtered+")"),u=c.children(R.menu),d=c.closest(R.menu),m=d.hasClass(k.visible)||d.hasClass(k.animating)||d.parent(R.menu).length>0,f=u.length>0,g=c.length>0,p=c.not(R.unselectable).length>0;if(C.is.visible()){if((t==n.enter||t==n.delimiter)&&(t==n.enter&&g&&f&&!w.allowCategorySelection?(C.verbose("Pressed enter on unselectable category, opening sub menu"),t=n.rightArrow):p&&(C.verbose("Selecting item from keyboard shortcut",c),C.event.item.click.call(c,e),w.useLabels&&C.is.searchSelection()?C.hideAndClear():C.remove.searchTerm()),e.preventDefault()),t==n.leftArrow&&(a=d[0]!==M[0],a&&(C.verbose("Left key pressed, closing sub-menu"),C.animate.hide(!1,d),c.removeClass(k.selected),d.closest(R.item).addClass(k.selected),e.preventDefault())),t==n.rightArrow&&f&&(C.verbose("Right key pressed, opening sub-menu"),C.animate.show(!1,u),c.removeClass(k.selected),u.find(R.item).eq(0).addClass(k.selected),e.preventDefault()),t==n.upArrow){if(o=g&&m?c.prevAll(R.item+":not("+R.unselectable+")").eq(0):V.eq(0),l.index(o)<0)return C.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();C.verbose("Up key pressed, changing active item"),c.removeClass(k.selected),o.addClass(k.selected),C.set.scrollPosition(o),e.preventDefault()}if(t==n.downArrow){if(o=g&&m?o=c.nextAll(R.item+":not("+R.unselectable+")").eq(0):V.eq(0),0===o.length)return C.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();C.verbose("Down key pressed, changing active item"),V.removeClass(k.selected),o.addClass(k.selected),C.set.scrollPosition(o),e.preventDefault()}t==n.pageUp&&(C.scrollPage("up"),e.preventDefault()),t==n.pageDown&&(C.scrollPage("down"),e.preventDefault()),t==n.escape&&(C.verbose("Escape key pressed, closing dropdown"),C.hide())}else t==n.delimiter&&e.preventDefault(),t==n.downArrow&&(C.verbose("Down key pressed, showing dropdown"),C.show(),e.preventDefault())}else C.is.selection()&&!C.is.search()&&C.set.selectedLetter(String.fromCharCode(t))}},determine:{selectAction:function(t,n){C.verbose("Determining action",w.action),e.isFunction(C.action[w.action])?(C.verbose("Triggering preset action",w.action,t,n),C.action[w.action].call(this,t,n)):e.isFunction(w.action)?(C.verbose("Triggering user action",w.action,t,n),w.action.call(this,t,n)):C.error(E.action,w.action)},eventInModule:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(q).length?(C.verbose("Triggering event",n),n(),!0):(C.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,n){var i=e(t.target);return n=e.isFunction(n)?n:function(){},0===i.closest(M).length?(C.verbose("Triggering event",n),n(),!0):(C.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,n){n=n!==i?n:t,C.set.selected(n,e(this)),(!C.is.multiple()||C.is.allFiltered())&&C.hideAndClear()},select:function(e,t){C.action.activate.call(this)},combo:function(t,n){n=n!==i?n:t,C.set.selected(n,e(this)),C.hideAndClear()},hide:function(){C.hideAndClear()}},get:{id:function(){return b},text:function(){return z.text()},query:function(){return e.trim(j.val())},searchWidth:function(e){return e*w.glyphWidth+"em"},selectionCount:function(){var t=C.get.values();return C.is.multiple()?e.isArray(t)?t.length:0:""!==C.get.value()?1:0},transition:function(e){return"auto"==w.transition?C.is.upward(e)?"slide up":"slide down":w.transition},userValues:function(){var t=C.get.values();return t?e.grep(t,function(e){return C.get.item(e)===!1}):!1},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},caretPosition:function(){var e,t,i=j.get(0);return"selectionStart"in i?i.selectionStart:n.selection?(i.focus(),e=n.selection.createRange(),t=e.text.length,e.moveStart("character",-i.value.length),e.text.length-t):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 I.length>0?I.val():q.data(S.value)},values:function(){var e=C.get.value();return""===e?"":!I.is("select")&&C.is.multiple()?"string"==typeof e?e.split(w.delimiter):"":e},remoteValues:function(){var t=C.get.values(),n=!1;return t&&("string"==typeof t&&(t=[t]),n={},e.each(t,function(e,t){var i=C.read.remoteData(t);C.verbose("Restoring value from session data",i,t),n[t]=i?i:t})),n},choiceText:function(e,t){return t=t!==i?t:w.preserveHTML,e?(e.find(R.menu).length>0&&(C.verbose("Retreiving text of element with sub-menu"),e=e.clone(),e.find(R.menu).remove(),e.find(R.menuIcon).remove()),e.data(S.text)!==i?e.data(S.text):t?e.html().trim():e.text().trim()):void 0},choiceValue:function(e,t){return t=t||C.get.choiceText(e),e?e.data(S.value)!==i?e.data(S.value):"string"==typeof t?t.toLowerCase().trim():t:!1},inputEvent:function(){var e=j[0];return e?e.oninput!==i?"input":e.onpropertychange!==i?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],q.find("option").each(function(){var n=e(this).html(),o=e(this).attr("value")!==i?e(this).attr("value"):n;"auto"===w.placeholder&&""===o?t.placeholder=n:t.values.push({name:n,value:o})}),w.placeholder&&"auto"!==w.placeholder&&(C.debug("Setting placeholder value to",w.placeholder),t.placeholder=w.placeholder),w.sortSelect?(t.values.sort(function(e,t){return e.name>t.name?1:-1}),C.debug("Retrieved and sorted values from select",t)):C.debug("Retreived values from select",t),t},activeItem:function(){return V.filter("."+k.active)},selectedItem:function(){var e=V.not(R.unselectable).filter("."+k.selected);return e.length>0?e:V.eq(0)},item:function(t,n){var o,a=!1;return t=t!==i?t:C.get.values()!==i?C.get.values():C.get.text(),o=C.is.multiple()&&e.isArray(t),n=""===t||0===t?!0:n||!1,t!==i&&null!==t&&V.each(function(){var r=e(this),s=C.get.choiceText(r),c=C.get.choiceValue(r,s);if(null!==c&&c!==i)if(o)(-1!==e.inArray(c.toString(),t)||-1!==e.inArray(s,t))&&(a=a?a.add(r):r);else if(n){if(C.verbose("Ambiguous dropdown value using strict type check",r,t),c===t||s===t)return a=r,!0}else if(c.toString()==t.toString()||s==t)return C.verbose("Found select item by value",c,t),a=r,!0}),a}},check:{maxSelections:function(e){return w.maxSelections?(e=e!==i?e:C.get.selectionCount(),e>=w.maxSelections?(C.debug("Maximum selection count reached"),V.addClass(k.filtered),C.add.message(T.maxSelections),!0):(C.verbose("No longer at maximum selection count"),C.remove.message(),C.remove.filteredItem(),C.is.searchSelection()&&C.filterItems(),!1)):!0}},restore:{defaults:function(){C.restore.defaultText(),C.restore.defaultValue()},defaultText:function(){var e=q.data(S.defaultText);C.debug("Restoring default text",e),C.set.text(e),z.addClass(k.placeholder)},defaultValue:function(){var e=q.data(S.defaultValue);e!==i&&(C.debug("Restoring default value",e),""!==e?(C.set.value(e),C.set.selected()):(C.remove.activeItem(),C.remove.selectedItem()))},labels:function(){w.allowAdditions&&(w.useLabels||(C.error(E.labels),w.useLabels=!0),C.debug("Restoring selected values"),C.create.userLabels()),C.check.maxSelections()},selected:function(){C.restore.values(),C.is.multiple()?(C.debug("Restoring previously selected values and labels"),C.restore.labels()):C.debug("Restoring previously selected values")},values:function(){C.set.initialLoad(),w.apiSettings?w.saveRemoteData?C.restore.remoteValues():C.clearValue():C.set.selected(),C.remove.initialLoad()},remoteValues:function(){var t=C.get.remoteValues();C.debug("Recreating selected from session data",t),t&&(C.is.single()?e.each(t,function(e,t){C.set.text(t)}):e.each(t,function(e,t){C.add.label(e,t)}))}},read:{remoteData:function(e){var n;return t.Storage===i?void C.error(E.noStorage):(n=sessionStorage.getItem(e),n!==i?n:!1)}},save:{defaults:function(){C.save.defaultText(),C.save.placeholderText(),C.save.defaultValue()},defaultValue:function(){q.data(S.defaultValue,C.get.value())},defaultText:function(){q.data(S.defaultText,z.text())},placeholderText:function(){z.hasClass(k.placeholder)&&q.data(S.placeholderText,z.text())},remoteData:function(e,n){return t.Storage===i?void C.error(E.noStorage):void sessionStorage.setItem(n,e)}},clear:function(){C.is.multiple()?C.remove.labels():(C.remove.activeItem(),C.remove.selectedItem()),C.set.placeholderText(),C.clearValue()},clearValue:function(){C.set.value("")},scrollPage:function(e,t){var n,i,o,t=t||C.get.selectedItem(),a=t.closest(R.menu),r=a.outerHeight(),s=a.scrollTop(),c=V.eq(0).outerHeight(),l=Math.floor(r/c),u=(a.prop("scrollHeight"),"up"==e?s-c*l:s+c*l),d=V.not(R.unselectable);o="up"==e?d.index(t)-l:d.index(t)+l,n="up"==e?o>=0:o0&&(C.debug("Scrolling page",e,i),t.removeClass(k.selected),i.addClass(k.selected),a.scrollTop(u))},set:{filtered:function(){var e=C.is.multiple(),t=C.is.searchSelection(),n=e&&t,i=t?C.get.query():"",o="string"==typeof i&&i.length>0,a=C.get.searchWidth(i.length),r=""!==i;e&&o&&(C.verbose("Adjusting input width",a,w.glyphWidth),j.css("width",a)),o||n&&r?(C.verbose("Hiding placeholder text"),z.addClass(k.filtered)):(!e||n&&!r)&&(C.verbose("Showing placeholder text"),z.removeClass(k.filtered))},loading:function(){q.addClass(k.loading)},placeholderText:function(e){C.debug("Restoring placeholder text"),e=e||q.data(S.placeholderText),C.set.text(e),z.addClass(k.placeholder)},tabbable:function(){C.has.search()?(C.debug("Added tabindex to searchable dropdown"),j.val("").attr("tabindex",0),M.attr("tabindex",-1)):(C.debug("Added tabindex to dropdown"),q.attr("tabindex")||(q.attr("tabindex",0),M.attr("tabindex",-1)))},initialLoad:function(){C.verbose("Setting initial load"),p=!0},scrollPosition:function(e,t){var n,o,a,r,s,c,l,u,d,m=5;e=e||C.get.selectedItem(),n=e.closest(R.menu),o=e&&e.length>0,t=t!==i?t:!1,e&&n.length>0&&o&&(r=e.position().top,n.addClass(k.loading),c=n.scrollTop(),s=n.offset().top,r=e.offset().top,a=c-s+r,t||(l=n.height(),d=a+m>c+l,u=c>a-m),C.debug("Scrolling to active item",a),(t||u||d)&&n.scrollTop(a),n.removeClass(k.loading))},text:function(e){"select"!==w.action&&("combo"==w.action?(C.debug("Changing combo button text",e,L),w.preserveHTML?L.html(e):L.text(e)):(C.debug("Changing text",e,z),z.removeClass(k.filtered).removeClass(k.placeholder),
w.preserveHTML?z.html(e):z.text(e)))},selectedLetter:function(t){var n=V.filter("."+k.selected),i=!1;V.each(function(){var n=e(this),o=C.get.choiceText(n,!1),a=String(o).charAt(0).toLowerCase(),r=t.toLowerCase();return a==r?(i=n,!1):void 0}),i&&(C.verbose("Scrolling to next value with letter",t),C.set.scrollPosition(i),n.removeClass(k.selected),i.addClass(k.selected))},direction:function(e){"auto"==w.direction?C.is.onScreen(e)?C.remove.upward(e):C.set.upward(e):"upward"==w.direction&&C.set.upward(e)},upward:function(e){var t=e||q;t.addClass(k.upward)},value:function(e,t,n){var i=I.length>0,o=(!C.has.value(e),C.get.values());if(i){if(e==o)return void C.verbose("Skipping value update already same value",e,o);C.debug("Updating input value",e,o),I.val(e).trigger("change")}else C.verbose("Storing value in metadata",e,I),e!==o&&q.data(S.value,e);w.fireOnInit===!1&&C.is.initialLoad()?C.verbose("No callback on initial load",w.onChange):w.onChange.call(W,e,t,n)},active:function(){q.addClass(k.active)},multiple:function(){q.addClass(k.multiple)},visible:function(){q.addClass(k.visible)},selected:function(t,n){var i=C.is.multiple();return(n=n||C.get.item(t))?(C.debug("Setting selected menu item to",n),C.is.single()?(C.remove.activeItem(),C.remove.selectedItem()):w.useLabels&&C.remove.selectedItem(),void n.each(function(){var t=e(this),o=C.get.choiceText(t),a=C.get.choiceValue(t,o),r=t.hasClass(k.filtered),s=t.hasClass(k.active),c=t.hasClass(k.addition),l=i&&1==n.length;i?!s||c?(w.apiSettings&&w.saveRemoteData&&C.save.remoteData(o,a),w.useLabels?(C.add.value(a,o,t),C.add.label(a,o,l),t.addClass(k.active),C.filterActive(),C.select.nextAvailable(n)):(C.add.value(a,o,t),C.set.text(C.add.variables(T.count)),t.addClass(k.active))):r||(C.debug("Selected active value, removing label"),C.remove.selected(a)):(C.set.value(a,o,t),C.set.text(o),t.addClass(k.active).addClass(k.selected))})):!1}},add:{label:function(t,n,i){var o,a=C.is.searchSelection()?j:z;return o=e(" ").addClass(k.label).attr("data-value",t).html(F.label(t,n)),o=w.onLabelCreate.call(o,t,n),C.has.label(t)?void C.debug("Label already exists, skipping",t):(w.label.variation&&o.addClass(w.label.variation),void(i===!0?(C.debug("Animating in label",o),o.addClass(k.hidden).insertBefore(a).transition(w.label.transition,w.label.duration)):(C.debug("Adding selection label",o),o.insertBefore(a))))},message:function(t){var n=M.children(R.message),i=w.templates.message(C.add.variables(t));n.length>0?n.html(i):n=e("
").html(i).addClass(k.message).appendTo(M)},optionValue:function(t){var n=I.find('option[value="'+t+'"]'),i=n.length>0;i||(y&&(y.disconnect(),C.verbose("Temporarily disconnecting mutation observer",t)),e(" ").prop("value",t).html(t).appendTo(I),C.verbose("Adding user addition as an ",t),y&&y.observe(I[0],{childList:!0,subtree:!0}))},userChoice:function(t){var n,i=C.get.item(t),o=M.children(R.addition);if(!C.has.maxSelections()){if(""===t||i)return void o.remove();n=w.templates.addition(t),V.removeClass(k.selected),o.length>0?o.html(n).data(S.value,t).removeClass(k.filtered).addClass(k.selected):o=e("
").html(n).data(S.value,t).addClass(k.addition).addClass(k.item).prependTo(M).addClass(k.selected)}},variables:function(e){var t,n,i=-1!==e.search("{count}"),o=-1!==e.search("{maxCount}"),a=-1!==e.search("{term}");return i&&(t=C.get.selectionCount(),e=e.replace("{count}",t)),o&&(t=C.get.selectionCount(),e=e.replace("{maxCount}",w.maxSelections)),a&&(n=C.get.query(),e=e.replace("{term}",n)),e},value:function(t,n,i){var o,a=C.get.values();return""===t?void C.debug("Cannot select blank values from multiselect"):(e.isArray(a)?(o=a.concat([t]),o=C.get.uniqueArray(o)):o=[t],I.is("select")?w.allowAdditions&&(C.add.optionValue(t),C.debug("Adding value to select",t,o,I)):(o=o.join(w.delimiter),C.debug("Setting hidden input to delimited value",o,I)),w.fireOnInit===!1&&C.is.initialLoad()?C.verbose("No callback on initial load",w.onAdd):w.onAdd.call(W,t,n,i),C.set.value(o,t,n,i),void C.check.maxSelections())}},remove:{active:function(){q.removeClass(k.active)},activeLabel:function(){q.find(R.label).removeClass(k.active)},loading:function(){q.removeClass(k.loading)},initialLoad:function(){p=!1},upward:function(e){var t=e||q;t.removeClass(k.upward)},visible:function(){q.removeClass(k.visible)},activeItem:function(){V.removeClass(k.active)},filteredItem:function(){C.has.maxSelections()||(w.useLabels?V.not("."+k.active).removeClass(k.filtered):V.removeClass(k.filtered))},message:function(){M.children(R.message).remove()},searchTerm:function(){C.verbose("Cleared search term"),j.val(""),C.set.filtered()},selected:function(e){var t=C.get.item(e),n=C.get.choiceText(t),i=C.get.choiceValue(t,n);return t?(C.is.multiple()?w.useLabels?(C.remove.value(i,n,t),C.remove.label(i)):(C.remove.value(i,n,t),C.set.text(C.add.variables(T.count))):C.remove.value(i,n,t),t.removeClass(k.filtered).removeClass(k.active),void(w.useLabels&&t.removeClass(k.selected))):!1},selectedItem:function(){V.removeClass(k.selected)},value:function(e,t,n){var i,o=I.val();I.is("select")?(C.verbose("Input is removing selected option",e),i=C.remove.arrayValue(e,o)):(C.verbose("Removing from delimited values",e),o=o.split(w.delimiter),i=C.remove.arrayValue(e,o),i=i.join(w.delimiter)),w.fireOnInit===!1&&C.is.initialLoad()?C.verbose("No callback on initial load",w.onRemove):w.onRemove.call(W,e,t,n),C.set.value(i,t,n),C.check.maxSelections()},arrayValue:function(t,n){return n=e.grep(n,function(e){return t!=e}),C.verbose("Removed value from delimited string",t,n),n},label:function(e){var t=q.find(R.label),n=t.filter('[data-value="'+e+'"]'),i=t.length,o=t.index(n)+1==i,a=(!C.is.searchSelection()||!C.is.focusedOnSearch())&&o;a?(C.verbose("Animating and removing label",n),n.transition(w.label.transition,w.label.duration,function(){n.remove()})):(C.verbose("Removing label",n),n.remove())},activeLabels:function(e){e=e||q.find(R.label).filter("."+k.active),C.verbose("Removing active label selections",e),C.remove.labels(e)},labels:function(t){t=t||q.find(R.label),C.verbose("Removing labels",t),t.each(function(){var t=e(this).data("value"),n=C.is.userValue(t);n?(C.remove.value(t),C.remove.label(t)):C.remove.selected(t)})},tabbable:function(){C.has.search()?(C.debug("Searchable dropdown initialized"),j.attr("tabindex","-1"),M.attr("tabindex","-1")):(C.debug("Simple selection dropdown initialized"),q.attr("tabindex","-1"),M.attr("tabindex","-1"))}},has:{search:function(){return j.length>0},input:function(){return I.length>0},menu:function(){return M.length>0},message:function(){return 0!==M.children(R.message).length},label:function(e){var t=q.find(R.label);return t.filter('[data-value="'+e+'"]').length>0},maxSelections:function(){return w.maxSelections&&C.get.selectionCount()>=w.maxSelections},allResultsFiltered:function(){return V.filter(R.unselectable).length===V.length},value:function(t){var n=C.get.values(),i=e.isArray(n)?n&&-1!==e.inArray(t,n):n==t;return i?!0:!1}},is:{active:function(){return q.hasClass(k.active)},alreadySetup:function(){return q.is("select")&&q.parent(R.dropdown).length>0&&0===q.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):M.transition&&M.transition("is animating")},focused:function(){return n.activeElement===q[0]},focusedOnSearch:function(){return n.activeElement===j[0]},allFiltered:function(){return(C.is.multiple()||C.has.search())&&!C.has.message()&&C.has.allResultsFiltered()},hidden:function(e){return!C.is.visible(e)},initialLoad:function(){return p},onScreen:function(n){var o,a=n||M;return a.addClass(k.loading),o=e.fn.visibility!==i?a.visibility("bottom visible"):e(t).scrollTop()+e(t).height()>=a.offset().top+a.height(),C.debug("Checking if menu can fit on screen",o,M),a.removeClass(k.loading),o},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){return n==t?(i=!0,!0):void 0}),i},multiple:function(){return q.hasClass(k.multiple)},single:function(){return!C.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){return i.target&&e(i.target).is("select")?(n=!0,!0):void 0}),n},search:function(){return q.hasClass(k.search)},searchSelection:function(){return C.has.search()&&0===j.closest(R.menu).length},selection:function(){return q.hasClass(k.selection)},userValue:function(t){return-1!==e.inArray(t,C.get.userValues())},upward:function(e){var t=e||q;return t.hasClass(k.upward)},visible:function(e){return e?e.hasClass(k.visible):M.hasClass(k.visible)}},can:{click:function(){return l||"click"==w.on},show:function(){return!q.hasClass(k.disabled)&&V.length>0},useAPI:function(){return e.fn.api!==i}},animate:{show:function(t,n){var o,a=n||M,r=n?function(){}:function(){C.hideSubMenus(),C.hideOthers(),C.set.active()};t=e.isFunction(t)?t:function(){},C.verbose("Doing menu show animation",a),C.set.direction(n),o=C.get.transition(n),C.is.selection()&&C.set.scrollPosition(C.get.selectedItem(),!0),(C.is.hidden(a)||C.is.animating(a))&&("none"==o?(r(),a.transition("show"),t.call(W)):e.fn.transition!==i&&q.transition("is supported")?a.transition({animation:o+" in",debug:w.debug,verbose:w.verbose,duration:w.duration,queue:!0,onStart:r,onComplete:function(){t.call(W)}}):C.error(E.noTransition,o))},hide:function(t,n){var o=n||M,a=(n?.9*w.duration:w.duration,n?function(){}:function(){C.can.click()&&C.unbind.intent(),C.remove.active()}),r=C.get.transition(n);t=e.isFunction(t)?t:function(){},(C.is.visible(o)||C.is.animating(o))&&(C.verbose("Doing menu hide animation",o),"none"==r?(a(),o.transition("hide"),t.call(W)):e.fn.transition!==i&&q.transition("is supported")?o.transition({animation:r+" out",duration:w.duration,debug:w.debug,verbose:w.verbose,queue:!0,onStart:a,onComplete:function(){"auto"==w.direction&&C.remove.upward(n),t.call(W)}}):C.error(E.transition))}},hideAndClear:function(){C.has.search()?(C.remove.searchTerm(),C.hide(function(){C.remove.filteredItem()})):C.hide()},delay:{show:function(){C.verbose("Delaying show event to ensure user intent"),clearTimeout(C.timer),C.timer=setTimeout(C.show,w.delay.show)},hide:function(){C.verbose("Delaying hide event to ensure user intent"),clearTimeout(C.timer),C.timer=setTimeout(C.hide,w.delay.hide)}},escape:{regExp:function(e){return e=String(e),e.replace(P.escape,"\\$&")}},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){w.debug&&(w.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,w.name+":"),C.debug.apply(console,arguments)))},verbose:function(){w.verbose&&w.debug&&(w.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),C.verbose.apply(console,arguments)))},error:function(){C.error=Function.prototype.bind.call(console.error,console,w.name+":"),C.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;w.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:W,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=w.name+":",n=0;u=!1,clearTimeout(C.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var r,s,c,l=B;return n=n||g,o=W||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(C.error(E.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},f?(B===i&&C.initialize(),C.invoke(m)):(B!==i&&B.invoke("destroy"),C.initialize())}),a!==i?a:r},e.fn.dropdown.settings={debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",apiSettings:!1,saveRemoteData:!0,throttle:100,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(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term} ",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 local storage",noTransition:"This module requires ui transitions "},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"}},e.fn.dropdown.settings.templates={dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+=' ',i+=t.placeholder?''+n+"
":'
',i+='"},menu:function(t){var n=(t.values||{},"");return e.each(t.values,function(e,t){n+=''+t.name+"
"}),n},label:function(e,t){return t+' '},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.embed=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.embed.settings,n):e.extend({},e.fn.embed.settings),g=f.selector,p=f.className,v=f.sources,h=f.error,b=f.metadata,y=f.namespace,x=f.templates,C="."+y,w="module-"+y,k=(e(t),e(this)),T=k.find(g.placeholder),S=k.find(g.play),A=k.find(g.embed),P=this,R=k.data(w);m={initialize:function(){m.debug("Initializing embed"),m.create(),m.bind.events(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),R=m,k.data(w,m)},destroy:function(){m.verbose("Destroying previous instance of embed"),m.reset(),k.removeData(w).off(C)},refresh:function(){m.verbose("Refreshing selector cache"),T=k.find(g.placeholder),S=k.find(g.play),A=k.find(g.embed)},bind:{events:function(){m.is.video()&&(m.debug("Adding placeholder events"),k.on("click"+C,g.placeholder,m.createAndShow).on("click"+C,g.play,m.createAndShow))}},create:function(){var e=m.get.placeholder();e?m.createPlaceholder():m.createAndShow()},createPlaceholder:function(e){{var t=m.get.icon(),n=m.get.url();m.generate.embed(n)}e=e||m.get.placeholder(),k.html(x.placeholder(e,t)),m.debug("Creating placeholder for embed",e,t)},createEmbed:function(t){m.refresh(),t=t||m.get.url(),A=e("
").addClass(p.embed).html(m.generate.embed(t)).appendTo(k),m.debug("Creating embed object",A)},createAndShow:function(){m.createEmbed(),m.show()},change:function(e,t,n){m.debug("Changing video to ",e,t,n),k.data(b.source,e).data(b.id,t).data(b.url,n),m.create(),f.onChange.call(P)},reset:function(){m.debug("Clearing embed and showing placeholder"),m.remove.active(),m.remove.embed(),m.showPlaceholder(),f.onReset.call(P)},show:function(){m.debug("Showing embed"),m.set.active(),f.onDisplay.call(P)},hide:function(){m.debug("Hiding embed"),m.showPlaceholder()},showPlaceholder:function(){m.debug("Showing placeholder image"),m.remove.active(),f.onPlaceholderDisplay.call(P)},get:{id:function(){return f.id||k.data(b.id)},placeholder:function(){return f.placeholder||k.data(b.placeholder)},icon:function(){return f.icon?f.icon:k.data(b.icon)!==i?k.data(b.icon):m.determine.icon()},source:function(e){return f.source?f.source:k.data(b.source)!==i?k.data(b.source):m.determine.source()},type:function(){var e=m.get.source();return v[e]!==i?v[e].type:!1},url:function(){return f.url?f.url:k.data(b.url)!==i?k.data(b.url):m.determine.url()}},determine:{source:function(t){var n=!1;return t=t||m.get.url(),t&&e.each(v,function(e,i){return-1!==t.search(i.domain)?(n=e,!1):void 0}),n},icon:function(){var e=m.get.source();return v[e]!==i?v[e].icon:!1},url:function(){var e,t=f.id||k.data(b.id),n=f.source||k.data(b.source);return e=v[n]!==i?v[n].url.replace("{id}",t):!1,e&&k.data(b.url,e),e}},set:{active:function(){k.addClass(p.active)}},remove:{active:function(){k.removeClass(p.active)},embed:function(){A.empty()}},encode:{parameters:function(e){var t,n=[];for(t in e)n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.join("&")}},generate:{embed:function(e){m.debug("Generating embed html");var t,n,i=m.get.source();return e=m.get.url(e),e?(n=m.generate.parameters(i),t=x.iframe(e,n)):m.error(h.noURL,k),t},parameters:function(t,n){var o,a=v[t].parameters!==i?v[t].parameters(f):{};return n&&(o=e.extend({},a,n)),o=f.onEmbed(o),m.encode.parameters(o)}},has:{placeholder:function(){return f.placeholder||k.data(b.placeholder)}},is:{autoplay:function(){return"auto"===f.autoplay?k.data("image")!==i:f.autoplay},video:function(){return"video"==m.get.type()}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=R;return n=n||d,a=P||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(R===i&&m.initialize(),m.invoke(l)):(R!==i&&R.invoke("destroy"),m.initialize())}),o!==i?o:this},e.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,showUI:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onChange:function(){},onEmbed:function(e){return e},width:"auto",height:"auto",parameters:!1,api:!0,onPause:function(){},onStop:function(){},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",play:".play"}},e.fn.embed.settings.sources={youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.showUI,autoplay:e.autoplay,color:e.colors||i,hq:e.hd,jsapi:e.api,modestbranding:1}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.showUI,color:e.colors||i,portrait:e.showUI,title:e.showUI}}}},e.fn.embed.settings.templates={iframe:function(e,t){return''},placeholder:function(e,t){var n="";return t&&(n+=' '),e&&(n+=' '),n}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.modal=function(o){var a,r=e(this),s=e(t),c=e(n),l=e("body"),u=r.selector||"",d=(new Date).getTime(),m=[],f=arguments[0],g="string"==typeof f,p=[].slice.call(arguments,1),v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,h,b,y,x,C,w,k,T,S=e.isPlainObject(o)?e.extend(!0,{},e.fn.modal.settings,o):e.extend({},e.fn.modal.settings),A=S.selector,P=S.className,R=S.namespace,E=S.error,F="."+R,O="module-"+R,D=e(this),q=e(S.context),z=D.find(A.close),j=this,I=D.data(O);T={initialize:function(){T.verbose("Initializing dimmer",q),T.create.id(),T.create.dimmer(),T.refreshModals(),T.bind.events(),S.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance of modal"),I=T,D.data(O,I)},create:{dimmer:function(){var t={debug:S.debug,dimmerName:"modals",duration:{show:S.duration,hide:S.duration}},n=e.extend(!0,t,S.dimmerSettings);return S.inverted&&(n.variation=n.variation!==i?n.variation+" inverted":"inverted"),e.fn.dimmer===i?void T.error(E.dimmer):(T.debug("Creating dimmer with settings",n),y=q.dimmer(n),S.detachable?(T.verbose("Modal is detachable, moving content into dimmer"),y.dimmer("add content",D)):T.set.undetached(),S.blurring&&y.addClass(P.blurring),void(x=y.dimmer("get dimmer")))},id:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),C="."+w,T.verbose("Creating unique id for element",w)}},destroy:function(){T.verbose("Destroying previous modal"),D.removeData(O).off(F),s.off(C),z.off(F),q.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(k=new MutationObserver(function(e){T.debug("DOM tree modified, refreshing"),T.refresh()}),k.observe(j,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",k))},refresh:function(){T.remove.scrolling(),T.cacheSizes(),T.set.screenHeight(),T.set.type(),T.set.position()},refreshModals:function(){h=D.siblings(A.modal),r=h.add(D)},attachEvents:function(t,n){var i=e(t);n=e.isFunction(T[n])?T[n]:T.toggle,i.length>0?(T.debug("Attaching modal events to element",t,n),i.off(F).on("click"+F,n)):T.error(E.notFound,t)},bind:{events:function(){T.verbose("Attaching events"),D.on("click"+F,A.close,T.event.close).on("click"+F,A.approve,T.event.approve).on("click"+F,A.deny,T.event.deny),s.on("resize"+C,T.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){return S.onApprove.call(j,e(this))===!1?void T.verbose("Approve callback returned false cancelling hide"):void T.hide()},deny:function(){return S.onDeny.call(j,e(this))===!1?void T.verbose("Deny callback returned false cancelling hide"):void T.hide()},close:function(){T.hide()},click:function(t){var i=e(t.target),o=i.closest(A.modal).length>0,a=e.contains(n.documentElement,t.target);!o&&a&&(T.debug("Dimmer clicked, hiding all modals"),T.is.active()&&(T.remove.clickaway(),S.allowMultiple?T.hide():T.hideAll()))},debounce:function(e,t){clearTimeout(T.timer),T.timer=setTimeout(e,t)},keyboard:function(e){var t=e.which,n=27;t==n&&(S.closable?(T.debug("Escape key pressed hiding modal"),T.hide()):T.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){y.dimmer("is active")&&v(T.refresh)}},toggle:function(){T.is.active()||T.is.animating()?T.hide():T.show()},show:function(t){t=e.isFunction(t)?t:function(){},T.refreshModals(),T.showModal(t)},hide:function(t){t=e.isFunction(t)?t:function(){},T.refreshModals(),T.hideModal(t)},showModal:function(t){t=e.isFunction(t)?t:function(){},T.is.animating()||!T.is.active()?(T.showDimmer(),T.cacheSizes(),T.set.position(),T.set.screenHeight(),T.set.type(),T.set.clickaway(),!S.allowMultiple&&h.filter("."+P.active).length>0?(T.debug("Other modals visible, queueing show animation"),T.hideOthers(T.showModal)):(S.onShow.call(j),S.transition&&e.fn.transition!==i&&D.transition("is supported")?(T.debug("Showing modal with css animations"),D.transition({debug:S.debug,animation:S.transition+" in",queue:S.queue,duration:S.duration,useFailSafe:!0,onComplete:function(){S.onVisible.apply(j),T.add.keyboardShortcuts(),T.save.focus(),T.set.active(),T.set.autofocus(),t()}})):T.error(E.noTransition))):T.debug("Modal is already visible")},hideModal:function(t,n){t=e.isFunction(t)?t:function(){},T.debug("Hiding modal"),S.onHide.call(j),(T.is.animating()||T.is.active())&&(S.transition&&e.fn.transition!==i&&D.transition("is supported")?(T.remove.active(),D.transition({debug:S.debug,animation:S.transition+" out",queue:S.queue,duration:S.duration,useFailSafe:!0,onStart:function(){T.othersActive()||n||T.hideDimmer(),T.remove.keyboardShortcuts()},onComplete:function(){S.onHidden.call(j),T.restore.focus(),t()}})):T.error(E.noTransition))},showDimmer:function(){y.dimmer("is animating")||!y.dimmer("is active")?(T.debug("Showing dimmer"),y.dimmer("show")):T.debug("Dimmer already visible")},hideDimmer:function(){return y.dimmer("is animating")||y.dimmer("is active")?void y.dimmer("hide",function(){S.transition&&e.fn.transition!==i&&D.transition("is supported")&&(T.remove.clickaway(),T.remove.screenHeight())}):void T.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var n=r.filter(":visible");t=e.isFunction(t)?t:function(){},n.length>0&&(T.debug("Hiding all visible modals"),T.hideDimmer(),n.modal("hide modal",t))},hideOthers:function(t){var n=h.filter(":visible");t=e.isFunction(t)?t:function(){},n.length>0&&(T.debug("Hiding other modals",h),n.modal("hide modal",t,!0))},othersActive:function(){return h.filter("."+P.active+", ."+P.animating).length>0},add:{keyboardShortcuts:function(){T.verbose("Adding keyboard shortcuts"),c.on("keyup"+F,T.event.keyboard)}},save:{focus:function(){b=e(n.activeElement).blur()}},restore:{focus:function(){b&&b.length>0&&b.focus()}},remove:{active:function(){D.removeClass(P.active)},clickaway:function(){S.closable&&x.off("click"+C)},screenHeight:function(){T.cache.height>T.cache.pageHeight&&(T.debug("Removing page height"),l.css("height",""))},keyboardShortcuts:function(){T.verbose("Removing keyboard shortcuts"),c.off("keyup"+F)},scrolling:function(){y.removeClass(P.scrolling),D.removeClass(P.scrolling)}},cacheSizes:function(){var o=D.outerHeight();(T.cache===i||0!==o)&&(T.cache={pageHeight:e(n).outerHeight(),height:o+S.offset,contextHeight:"body"==S.context?e(t).height():y.height()}),T.debug("Caching modal and container sizes",T.cache)},can:{fit:function(){return T.cache.height+2*S.padding0?t:e;n.first().focus()}},clickaway:function(){S.closable&&x.on("click"+C,T.event.click)},screenHeight:function(){T.can.fit()?l.css("height",""):(T.debug("Modal is taller than page content, resizing page height"),l.css("height",T.cache.height+2*S.padding))},active:function(){D.addClass(P.active)},scrolling:function(){y.addClass(P.scrolling),D.addClass(P.scrolling)},type:function(){T.can.fit()?(T.verbose("Modal fits on screen"),T.othersActive()||T.remove.scrolling()):(T.verbose("Modal cannot fit on screen setting to scrolling"),T.set.scrolling())},position:function(){T.verbose("Centering modal on page",T.cache),D.css(T.can.fit()?{top:"",marginTop:-(T.cache.height/2)}:{marginTop:"",top:c.scrollTop()})},undetached:function(){y.addClass(P.undetached)}},setting:function(t,n){if(T.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,S,t);else{if(n===i)return S[t];S[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,T,t);else{if(n===i)return T[t];T[t]=n}},debug:function(){S.debug&&(S.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,S.name+":"),T.debug.apply(console,arguments)))},verbose:function(){S.verbose&&S.debug&&(S.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,S.name+":"),T.verbose.apply(console,arguments)))},error:function(){T.error=Function.prototype.bind.call(console.error,console,S.name+":"),T.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;S.performance&&(t=(new Date).getTime(),i=d||t,n=t-i,d=t,m.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:j,"Execution Time":n})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var t=S.name+":",n=0;d=!1,clearTimeout(T.performance.timer),e.each(m,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",u&&(t+=" '"+u+"'"),(console.group!==i||console.table!==i)&&m.length>0&&(console.groupCollapsed(t),console.table?console.table(m):e.each(m,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(t,n,o){var r,s,c,l=I;return n=n||p,o=j||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),
s}},g?(I===i&&T.initialize(),T.invoke(f)):(I!==i&&I.invoke("destroy"),T.initialize())}),a!==i?a:this},e.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,easing:"easeOutExpo",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(e,t,n,i){"use strict";e.fn.nag=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){{var a,m=e.isPlainObject(n)?e.extend(!0,{},e.fn.nag.settings,n):e.extend({},e.fn.nag.settings),f=(m.className,m.selector),g=m.error,p=m.namespace,v="."+p,h=p+"-module",b=e(this),y=(b.find(f.close),e(m.context?m.context:"body")),x=this,C=b.data(h);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}a={initialize:function(){a.verbose("Initializing element"),b.on("click"+v,f.close,a.dismiss).data(h,a),m.detachable&&b.parent()[0]!==y[0]&&b.detach().prependTo(y),m.displayTime>0&&setTimeout(a.hide,m.displayTime),a.show()},destroy:function(){a.verbose("Destroying instance"),b.removeData(h).off(v)},show:function(){a.should.show()&&!b.is(":visible")&&(a.debug("Showing nag",m.animation.show),"fade"==m.animation.show?b.fadeIn(m.duration,m.easing):b.slideDown(m.duration,m.easing))},hide:function(){a.debug("Showing nag",m.animation.hide),"fade"==m.animation.show?b.fadeIn(m.duration,m.easing):b.slideUp(m.duration,m.easing)},onHide:function(){a.debug("Removing nag",m.animation.hide),b.remove(),m.onHide&&m.onHide()},dismiss:function(e){m.storageMethod&&a.storage.set(m.key,m.value),a.hide(),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return m.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(m.key)!=m.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(m.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(m.key)),!1)}},get:{storageOptions:function(){var e={};return m.expires&&(e.expires=m.expires),m.domain&&(e.domain=m.domain),m.path&&(e.path=m.path),e}},clear:function(){a.storage.remove(m.key)},storage:{set:function(n,o){var r=a.get.storageOptions();if("localstorage"==m.storageMethod&&t.localStorage!==i)t.localStorage.setItem(n,o),a.debug("Value stored using local storage",n,o);else{if(e.cookie===i)return void a.error(g.noCookieStorage);e.cookie(n,o,r),a.debug("Value stored using cookie",n,o,r)}},get:function(n,o){var r;return"localstorage"==m.storageMethod&&t.localStorage!==i?r=t.localStorage.getItem(n):e.cookie!==i?r=e.cookie(n):a.error(g.noCookieStorage),("undefined"==r||"null"==r||r===i||null===r)&&(r=i),r},remove:function(n){var o=a.get.storageOptions();"local"==m.storageMethod&&t.store!==i?t.localStorage.removeItem(n):e.cookie!==i?e.removeCookie(n,o):a.error(g.noStorage)}},setting:function(t,n){if(a.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,r){var s,c,l,u=C;return n=n||d,r=x||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(r,n):c!==i&&(l=c),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),c}},u?(C===i&&a.initialize(),a.invoke(l)):(C!==i&&C.invoke("destroy"),a.initialize())}),o!==i?o:this},e.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(e,t,n,i){"use strict";e.fn.popup=function(o){var a,r=e(this),s=e(n),c=r.selector||"",l="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return r.each(function(){var n,r,p,v,h,b=e.isPlainObject(o)?e.extend(!0,{},e.fn.popup.settings,o):e.extend({},e.fn.popup.settings),y=b.selector,x=b.className,C=b.error,w=b.metadata,k=b.namespace,T="."+b.namespace,S="module-"+k,A=e(this),P=e(b.context),R=b.target?e(b.target):A,E=e(t),F=e("body"),O=0,D=!1,q=this,z=A.data(S);h={initialize:function(){h.debug("Initializing",A),h.createID(),h.bind.events(),!h.exists()&&b.preserve&&h.create(),h.instantiate()},instantiate:function(){h.verbose("Storing instance",h),z=h,A.data(S,z)},refresh:function(){b.popup?n=e(b.popup).eq(0):b.inline&&(n=R.next(y.popup).eq(0),b.popup=n),b.popup?(n.addClass(x.loading),r=h.get.offsetParent(),n.removeClass(x.loading),b.movePopup&&h.has.popup()&&h.get.offsetParent(n)[0]!==r[0]&&(h.debug("Moving popup to the same offset parent as activating element"),n.detach().appendTo(r))):r=b.inline?h.get.offsetParent(R):h.has.popup()?h.get.offsetParent(n):F,r.is("html")&&(h.debug("Setting page as offset parent"),r=F)},reposition:function(){h.refresh(),h.set.position()},destroy:function(){h.debug("Destroying previous module"),n&&!b.preserve&&h.removePopup(),clearTimeout(h.hideTimer),clearTimeout(h.showTimer),E.off(p),A.off(T).removeData(S)},event:{start:function(t){var n=e.isPlainObject(b.delay)?b.delay.show:b.delay;clearTimeout(h.hideTimer),h.showTimer=setTimeout(h.show,n)},end:function(){var t=e.isPlainObject(b.delay)?b.delay.hide:b.delay;clearTimeout(h.showTimer),h.hideTimer=setTimeout(h.hide,t)},resize:function(){h.is.visible()&&h.set.position()}},create:function(){var t=h.get.html(),i=h.get.variation(),o=h.get.title(),a=h.get.content();t||a||o?(h.debug("Creating pop-up html"),t||(t=b.templates.popup({title:o,content:a})),n=e("
").addClass(x.popup).addClass(i).data(w.activator,A).html(t),i&&n.addClass(i),b.inline?(h.verbose("Inserting popup element inline",n),n.insertAfter(A)):(h.verbose("Appending popup element to body",n),n.appendTo(P)),h.refresh(),b.hoverable&&h.bind.popup(),b.onCreate.call(n,q)):0!==R.next(y.popup).length?(h.verbose("Pre-existing popup found"),b.inline=!0,b.popups=R.next(y.popup).data(w.activator,A),h.refresh(),b.hoverable&&h.bind.popup()):b.popup?(e(b.popup).data(w.activator,A),h.verbose("Used popup specified in settings"),h.refresh(),b.hoverable&&h.bind.popup()):h.debug("No content specified skipping display",q)},createID:function(){v=(Math.random().toString(16)+"000000000").substr(2,8),p="."+v,h.verbose("Creating unique id for element",v)},toggle:function(){h.debug("Toggling pop-up"),h.is.hidden()?(h.debug("Popup is hidden, showing pop-up"),h.unbind.close(),h.show()):(h.debug("Popup is visible, hiding pop-up"),h.hide())},show:function(t){if(t=e.isFunction(t)?t:function(){},h.debug("Showing pop-up",b.transition),h.is.hidden()&&(!h.is.active()||!h.is.dropdown())){if(h.exists()||h.create(),b.onShow.call(n,q)===!1)return void h.debug("onShow callback returned false, cancelling popup animation");b.preserve||b.popup||h.refresh(),n&&h.set.position()&&(h.save.conditions(),b.exclusive&&h.hideAll(),h.animate.show(t))}},hide:function(t){if(t=e.isFunction(t)?t:function(){},h.is.visible()||h.is.animating()){if(b.onHide.call(n,q)===!1)return void h.debug("onHide callback returned false, cancelling popup animation");h.remove.visible(),h.unbind.close(),h.restore.conditions(),h.animate.hide(t)}},hideAll:function(){e(y.popup).filter("."+x.visible).each(function(){e(this).data(w.activator).popup("hide")})},hideGracefully:function(t){t&&0===e(t.target).closest(y.popup).length?(h.debug("Click occurred outside popup hiding popup"),h.hide()):h.debug("Click was inside popup, keeping popup open")},exists:function(){return n?b.inline||b.popup?h.has.popup():n.closest(P).length>=1?!0:!1:!1},removePopup:function(){h.debug("Removing popup",n),h.has.popup()&&!b.popup&&(n.remove(),n=i),b.onRemove.call(n,q)},save:{conditions:function(){h.cache={title:A.attr("title")},h.cache.title&&A.removeAttr("title"),h.verbose("Saving original attributes",h.cache.title)}},restore:{conditions:function(){return h.cache&&h.cache.title&&(A.attr("title",h.cache.title),h.verbose("Restoring original attributes",h.cache.title)),!0}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},b.transition&&e.fn.transition!==i&&A.transition("is supported")?(h.set.visible(),n.transition({animation:b.transition+" in",queue:!1,debug:b.debug,verbose:b.verbose,duration:b.duration,onComplete:function(){h.bind.close(),t.call(n,q),b.onVisible.call(n,q)}})):h.error(C.noTransition)},hide:function(t){return t=e.isFunction(t)?t:function(){},h.debug("Hiding pop-up"),b.onShow.call(n,q)===!1?void h.debug("onShow callback returned false, cancelling popup animation"):void(b.transition&&e.fn.transition!==i&&A.transition("is supported")?n.transition({animation:b.transition+" out",queue:!1,duration:b.duration,debug:b.debug,verbose:b.verbose,onComplete:function(){h.reset(),t.call(n,q),b.onHidden.call(n,q)}}):h.error(C.noTransition))}},get:{html:function(){return A.removeData(w.html),A.data(w.html)||b.html},title:function(){return A.removeData(w.title),A.data(w.title)||b.title},content:function(){return A.removeData(w.content),A.data(w.content)||A.attr("title")||b.content},variation:function(){return A.removeData(w.variation),A.data(w.variation)||b.variation},id:function(){return v},startEvent:function(){return"hover"==b.on?l&&b.addTouchEvents?"touchstart mouseenter":"mouseenter":"focus"==b.on?"focus":!1},scrollEvent:function(){return l&&b.addTouchEvents?"touchmove scroll":"scroll"},endEvent:function(){return"hover"==b.on?"mouseleave":"focus"==b.on?"blur":!1},offsetParent:function(t){var n=t!==i?t[0]:A[0],o=n.parentNode,a=e(o);if(o)for(var r="none"===a.css("transform"),s="static"===a.css("position"),c=a.is("html");o&&!c&&s&&r;)o=o.parentNode,a=e(o),r="none"===a.css("transform"),s="static"===a.css("position"),c=a.is("html");return a&&a.length>0?a:e()},offstagePosition:function(i){var o={top:e(t).scrollTop(),left:e(t).scrollLeft(),width:e(t).width(),height:e(t).height()},a={top:o.top,bottom:o.top+o.height,left:o.left,right:o.left+o.width},r={width:n.width(),height:n.height(),offset:n.offset()},s={},c=[];return i=i||!1,r.offset&&i&&(h.verbose("Checking if outside viewable area",r.offset),s={top:r.offset.topa.bottom,right:r.offset.left+r.width>a.right,left:r.offset.left0?c.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(e){var t=e.split(" "),n=t[0],i=t[1],o={top:"bottom",bottom:"top",left:"right",right:"left"},a={left:"center",center:"right",right:"left"},r={"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"},s="top"==n||"bottom"==n,c=!1,l=!1,u=!1;return D||(h.verbose("All available positions available"),D=h.get.positions()),h.debug("Recording last position tried",e),D[e]=!0,"opposite"===b.prefer&&(u=[o[n],i],u=u.join(" "),c=D[u]===!0,h.debug("Trying opposite strategy",u)),"adjacent"===b.prefer&&s&&(u=[n,a[i]],u=u.join(" "),l=D[u]===!0,h.debug("Trying adjacent strategy",u)),(l||c)&&(h.debug("Using backup position",u),u=r[e]),u}},set:{position:function(o,a){if(0===R.length||0===n.length)return void h.error(C.notFound);var s,c,l,u=(e(t).width(),e(t).height(),R.outerWidth()),d=R.outerHeight(),m=n.outerWidth(),f=n.outerHeight(),g=r.outerWidth(),p=r.outerHeight(),v=b.distanceAway,y=R[0],k=b.inline?parseInt(t.getComputedStyle(y).getPropertyValue("margin-top"),10):0,T=b.inline?h.is.rtl()?parseInt(t.getComputedStyle(y).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(y).getPropertyValue("margin-left"),10):0,S=b.inline||b.popup?R.position():R.offset();if(o=o||A.data(w.position)||b.position,a=a||A.data(w.offset)||b.offset,0===S.top&&0===S.left)return h.debug("Popup target is hidden, no action taken"),!1;switch(O==b.maxSearchDepth&&b.lastResort&&(h.debug("Using last resort position to display",b.lastResort),o=b.lastResort),b.inline&&(h.debug("Adding targets margin to calculation"),"left center"==o||"right center"==o?(a+=k,v+=-T):"top left"==o||"top center"==o||"top right"==o?(a+=T,v-=k):(a+=T,v+=k)),h.debug("Calculating popup positioning",o),s=o,h.is.rtl()&&(s=s.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),h.debug("RTL: Popup positioning updated",s)),s){case"top left":c={top:"auto",bottom:p-S.top+v,left:S.left+a,right:"auto"};break;case"top center":c={bottom:p-S.top+v,left:S.left+u/2-m/2+a,top:"auto",right:"auto"};break;case"top right":c={bottom:p-S.top+v,right:g-S.left-u-a,top:"auto",left:"auto"};break;case"left center":c={top:S.top+d/2-f/2+a,right:g-S.left+v,left:"auto",bottom:"auto"};break;case"right center":c={top:S.top+d/2-f/2+a,left:S.left+u+v,bottom:"auto",right:"auto"};break;case"bottom left":c={top:S.top+d+v,left:S.left+a,bottom:"auto",right:"auto"};break;case"bottom center":c={top:S.top+d+v,left:S.left+u/2-m/2+a,bottom:"auto",right:"auto"};break;case"bottom right":c={top:S.top+d+v,right:g-S.left-u-a,left:"auto",bottom:"auto"}}if(c===i&&h.error(C.invalidPosition,o),h.debug("Calculated popup positioning values",c),n.css(c).removeClass(x.position).addClass(o).addClass(x.loading),l=h.get.offstagePosition(o)){if(h.debug("Popup cant fit into viewport",o,l),O0}},is:{active:function(){return A.hasClass(x.active)},animating:function(){return n&&n.hasClass(x.animating)},visible:function(){return n&&n.hasClass(x.visible)},dropdown:function(){return A.hasClass(x.dropdown)},hidden:function(){return!h.is.visible()},rtl:function(){return"rtl"==A.css("direction")}},reset:function(){h.remove.visible(),b.preserve?e.fn.transition!==i&&n.transition("remove transition"):h.removePopup()},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];h[t]=n}},debug:function(){b.debug&&(b.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,b.name+":"),h.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),h.verbose.apply(console,arguments)))},error:function(){h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;b.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:q,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",n=0;u=!1,clearTimeout(h.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var r,s,c,l=z;return n=n||g,o=q||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},f?(z===i&&h.initialize(),h.invoke(m)):(z!==i&&z.invoke("destroy"),h.initialize())}),a!==i?a:this},e.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 ",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(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},popup:function(t){var n="",o=e.fn.popup.settings.templates.escape;return typeof t!==i&&(typeof t.title!==i&&t.title&&(t.title=o(t.title),n+='"),typeof t.content!==i&&t.content&&(t.content=o(t.content),n+=''+t.content+"
")),n}}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.progress=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f=e.isPlainObject(t)?e.extend(!0,{},e.fn.progress.settings,t):e.extend({},e.fn.progress.settings),g=f.className,p=f.metadata,v=f.namespace,h=f.selector,b=f.error,y="."+v,x="module-"+v,C=e(this),w=e(this).find(h.bar),k=e(this).find(h.progress),T=e(this).find(h.label),S=this,A=C.data(x),P=!1;m={initialize:function(){m.debug("Initializing progress bar",f),a=m.get.transitionEnd(),m.read.metadata(),m.set.duration(),m.set.initials(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of progress",m),A=m,C.data(x,m)},destroy:function(){m.verbose("Destroying previous progress for",C),clearInterval(A.interval),m.remove.state(),C.removeData(x),A=i},reset:function(){m.set.percent(0)},complete:function(){(m.percent===i||m.percent<100)&&m.set.percent(100)},read:{metadata:function(){C.data(p.percent)&&(m.verbose("Current percent value set from metadata"),m.percent=C.data(p.percent)),C.data(p.total)&&(m.verbose("Total value set from metadata"),m.total=C.data(p.total)),C.data(p.value)&&(m.verbose("Current value set from metadata"),m.value=C.data(p.value))},currentValue:function(){return m.value!==i?m.value:!1}},increment:function(e){var t,n,i,o=m.total||!1;o?(n=m.value||0,e=e||1,i=n+e,t=m.total,m.debug("Incrementing value by",e,n,t),i>t&&(m.debug("Value cannot increment above total",t),i=t),m.set.progress(i)):(n=m.percent||0,e=e||m.get.randomValue(),i=n+e,t=100,m.debug("Incrementing percentage by",e,n),i>t&&(m.debug("Value cannot increment above 100 percent"),i=t),m.set.progress(i))},decrement:function(e){var t,n,i=m.total||!1,o=0;i?(t=m.value||0,e=e||1,n=t-e,m.debug("Decrementing value by",e,t)):(t=m.percent||0,e=e||m.get.randomValue(),n=t-e,m.debug("Decrementing percentage by",e,t)),o>n&&(m.debug("Value cannot decrement below 0"),n=0),m.set.progress(n)},get:{text:function(e){var t=m.value||0,n=m.total||0,i=P?m.get.displayPercent():m.percent||0,o=m.total>0?n-t:100-i;return e=e||"",e=e.replace("{value}",t).replace("{total}",n).replace("{left}",o).replace("{percent}",i),m.debug("Adding variables to progress bar text",e),e},randomValue:function(){return m.debug("Generating random increment percentage"),Math.floor(Math.random()*f.random.max+f.random.min)},transitionEnd:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},displayPercent:function(){var e=w.width(),t=C.width(),n=parseInt(w.css("min-width"),10),i=e>n?e/t*100:m.percent;return f.precision>0?Math.round(10*i*f.precision)/(10*f.precision):Math.round(i)},percent:function(){return m.percent||0},value:function(){return m.value||!1},total:function(){return m.total||!1}},is:{success:function(){return C.hasClass(g.success)},warning:function(){return C.hasClass(g.warning)},error:function(){return C.hasClass(g.error)},active:function(){return C.hasClass(g.active)},visible:function(){return C.is(":visible")}},remove:{state:function(){m.verbose("Removing stored state"),delete m.total,delete m.percent,delete m.value},active:function(){m.verbose("Removing active state"),C.removeClass(g.active)},success:function(){m.verbose("Removing success state"),C.removeClass(g.success)},warning:function(){m.verbose("Removing warning state"),C.removeClass(g.warning)},error:function(){m.verbose("Removing error state"),C.removeClass(g.error)}},set:{barWidth:function(e){e>100?m.error(b.tooHigh,e):0>e?m.error(b.tooLow,e):(w.css("width",e+"%"),C.attr("data-percent",parseInt(e,10)))},duration:function(e){e=e||f.duration,e="number"==typeof e?e+"ms":e,m.verbose("Setting progress bar transition duration",e),w.css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},initials:function(){f.total!==!1&&(m.verbose("Current total set in settings",f.total),m.total=f.total),f.value!==!1&&(m.verbose("Current value set in settings",f.value),m.value=f.value),f.percent!==!1&&(m.verbose("Current percent set in settings",f.percent),m.percent=f.percent),m.percent!==i?m.set.percent(m.percent):m.value!==i&&m.set.progress(m.value)},percent:function(e){e="string"==typeof e?+e.replace("%",""):e,e>0&&1>e&&(m.verbose("Module percentage passed as decimal, converting"),e=100*e),e=f.precision>0?Math.round(10*e*f.precision)/(10*f.precision):Math.round(e),m.percent=e,m.total?m.value=f.precision>0?Math.round(e/100*m.total*10*f.precision)/(10*f.precision):Math.round(e/100*m.total*10)/10:f.limitValues&&(m.value=m.value>100?100:m.value<0?0:m.value),m.set.barWidth(e),m.set.labelInterval(),m.set.labels(),f.onChange.call(S,e,m.value,m.total)},labelInterval:function(){var e=function(){m.verbose("Bar finished animating, removing continuous label updates"),clearInterval(m.interval),P=!1,m.set.labels()};clearInterval(m.interval),w.one(a+y,e),m.timer=setTimeout(e,f.duration+100),P=!0,m.interval=setInterval(m.set.labels,f.framerate)},labels:function(){m.verbose("Setting both bar progress and outer label text"),m.set.barLabel(),m.set.state()},label:function(e){e=e||"",e&&(e=m.get.text(e),m.debug("Setting label to text",e),T.text(e))},state:function(e){e=e!==i?e:m.percent,100===e?!f.autoSuccess||m.is.warning()||m.is.error()?(m.verbose("Reached 100% removing active state"),m.remove.active()):(m.set.success(),m.debug("Automatically triggering success at 100%")):e>0?(m.verbose("Adjusting active progress bar label",e),m.set.active()):(m.remove.active(),m.set.label(f.text.active))},barLabel:function(e){e!==i?k.text(m.get.text(e)):"ratio"==f.label&&m.total?(m.debug("Adding ratio to bar label"),k.text(m.get.text(f.text.ratio))):"percent"==f.label&&(m.debug("Adding percentage to bar label"),k.text(m.get.text(f.text.percent)))},active:function(e){e=e||f.text.active,m.debug("Setting active state"),f.showActivity&&!m.is.active()&&C.addClass(g.active),m.remove.warning(),m.remove.error(),m.remove.success(),e&&m.set.label(e),f.onActive.call(S,m.value,m.total)},success:function(e){e=e||f.text.success,m.debug("Setting success state"),C.addClass(g.success),m.remove.active(),m.remove.warning(),m.remove.error(),m.complete(),e&&m.set.label(e),f.onSuccess.call(S,m.total)},warning:function(e){e=e||f.text.warning,m.debug("Setting warning state"),C.addClass(g.warning),m.remove.active(),m.remove.success(),m.remove.error(),m.complete(),e&&m.set.label(e),f.onWarning.call(S,m.value,m.total)},error:function(e){e=e||f.text.error,m.debug("Setting error state"),C.addClass(g.error),m.remove.active(),m.remove.success(),m.remove.warning(),m.complete(),e&&m.set.label(e),f.onError.call(S,m.value,m.total)},total:function(e){m.total=e},progress:function(e){var t,n="string"==typeof e?""!==e.replace(/[^\d.]/g,"")?+e.replace(/[^\d.]/g,""):!1:e;n===!1&&m.error(b.nonNumeric,e),m.total?(m.value=n,t=n/m.total*100,m.debug("Calculating percent complete from total",t),m.set.percent(t)):(t=n,m.debug("Setting value to exact percentage value",t),m.set.percent(t))}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=A;return n=n||d,a=S||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(b.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(A===i&&m.initialize(),m.invoke(l)):(A!==i&&A.invoke("destroy"),m.initialize())}),o!==i?o:this},e.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(e,t,n){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},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(e,t,n,i){"use strict";e.fn.rating=function(t){var n,o=e(this),a=o.selector||"",r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);
return o.each(function(){var d,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.rating.settings,t):e.extend({},e.fn.rating.settings),f=m.namespace,g=m.className,p=m.metadata,v=m.selector,h=(m.error,"."+f),b="module-"+f,y=this,x=e(this).data(b),C=e(this),w=C.find(v.icon);d={initialize:function(){d.verbose("Initializing rating module",m),0===w.length&&d.setup.layout(),m.interactive?d.enable():d.disable(),d.set.rating(d.get.initialRating()),d.instantiate()},instantiate:function(){d.verbose("Instantiating module",m),x=d,C.data(b,d)},destroy:function(){d.verbose("Destroying previous instance",x),d.remove.events(),C.removeData(b)},refresh:function(){w=C.find(v.icon)},setup:{layout:function(){var t=d.get.maxRating(),n=e.fn.rating.settings.templates.icon(t);d.debug("Generating icon html dynamically"),C.html(n),d.refresh()}},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(g.selected),C.addClass(g.selected),t.addClass(g.selected).prevAll().addClass(g.selected)},mouseleave:function(){C.removeClass(g.selected),w.removeClass(g.selected)},click:function(){var t=e(this),n=d.get.rating(),i=w.index(t)+1,o="auto"==m.clearable?1===w.length:m.clearable;o&&n==i?d.clearRating():d.set.rating(i)}},clearRating:function(){d.debug("Clearing current rating"),d.set.rating(0)},bind:{events:function(){d.verbose("Binding events"),C.on("mouseenter"+h,v.icon,d.event.mouseenter).on("mouseleave"+h,v.icon,d.event.mouseleave).on("click"+h,v.icon,d.event.click)}},remove:{events:function(){d.verbose("Removing events"),C.off(h)}},enable:function(){d.debug("Setting rating to interactive mode"),d.bind.events(),C.removeClass(g.disabled)},disable:function(){d.debug("Setting rating to read-only mode"),d.remove.events(),C.addClass(g.disabled)},get:{initialRating:function(){return C.data(p.rating)!==i?(C.removeData(p.rating),C.data(p.rating)):m.initialRating},maxRating:function(){return C.data(p.maxRating)!==i?(C.removeData(p.maxRating),C.data(p.maxRating)):m.maxRating},rating:function(){var e=w.filter("."+g.active).length;return d.verbose("Current rating retrieved",e),e}},set:{rating:function(e){var t=e-1>=0?e-1:0,n=w.eq(t);C.removeClass(g.selected),w.removeClass(g.selected).removeClass(g.active),e>0&&(d.verbose("Setting current rating to",e),n.prevAll().andSelf().addClass(g.active)),m.onRate.call(y,e)}},setting:function(t,n){if(d.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(n===i)return d[t];d[t]=n}},debug:function(){m.debug&&(m.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,m.name+":"),d.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),d.verbose.apply(console,arguments)))},error:function(){d.error=Function.prototype.bind.call(console.error,console,m.name+":"),d.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,500)},display:function(){var t=m.name+":",n=0;r=!1,clearTimeout(d.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),o.length>1&&(t+=" ("+o.length+")"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,o,a){var r,s,c,l=x;return o=o||u,a=y||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,o):s!==i&&(c=s),e.isArray(n)?n.push(c):n!==i?n=[n,c]:c!==i&&(n=c),s}},l?(x===i&&d.initialize(),d.invoke(c)):(x!==i&&x.invoke("destroy"),d.initialize())}),n!==i?n:this},e.fn.rating.settings={name:"Rating",namespace:"rating",debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",onRate:function(e){},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(e){for(var t=1,n="";e>=t;)n+=' ',t++;return n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.search=function(o){var a,r=e(this),s=r.selector||"",c=(new Date).getTime(),l=[],u=arguments[0],d="string"==typeof u,m=[].slice.call(arguments,1);return e(this).each(function(){var f,g=e.isPlainObject(o)?e.extend(!0,{},e.fn.search.settings,o):e.extend({},e.fn.search.settings),p=g.className,v=g.metadata,h=g.regExp,b=g.selector,y=g.error,x=g.namespace,C="."+x,w=x+"-module",k=e(this),T=k.find(b.prompt),S=k.find(b.searchButton),A=k.find(b.results),P=(k.find(b.result),k.find(b.category),this),R=k.data(w);f={initialize:function(){f.verbose("Initializing module"),f.determine.searchFields(),f.bind.events(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),R=f,k.data(w,f)},destroy:function(){f.verbose("Destroying instance"),k.off(C).removeData(w)},bind:{events:function(){f.verbose("Binding events to search"),g.automatic&&(k.on(f.get.inputEvent()+C,b.prompt,f.event.input),T.attr("autocomplete","off")),k.on("focus"+C,b.prompt,f.event.focus).on("blur"+C,b.prompt,f.event.blur).on("keydown"+C,b.prompt,f.handleKeyboard).on("click"+C,b.searchButton,f.query).on("mousedown"+C,b.results,f.event.result.mousedown).on("mouseup"+C,b.results,f.event.result.mouseup).on("click"+C,b.result,f.event.result.click)}},determine:{searchFields:function(){o&&o.searchFields!==i&&(g.searchFields=o.searchFields)}},event:{input:function(){clearTimeout(f.timer),f.timer=setTimeout(f.query,g.searchDelay)},focus:function(){f.set.focus(),f.has.minimumCharacters()&&(f.query(),f.showResults())},blur:function(e){var t=n.activeElement===this;t||f.resultsClicked||(f.cancel.query(),f.remove.focus(),f.timer=setTimeout(f.hideResults,g.hideDelay))},result:{mousedown:function(){f.resultsClicked=!0},mouseup:function(){f.resultsClicked=!1},click:function(n){f.debug("Search result selected");var i=e(this),o=i.find(b.title).eq(0),a=i.find("a[href]").eq(0),r=a.attr("href")||!1,s=a.attr("target")||!1,c=(o.html(),o.length>0?o.text():!1),l=f.get.results(),u=i.data(v.result)||f.get.result(c,l);return e.isFunction(g.onSelect)&&g.onSelect.call(P,u,l)===!1?void f.debug("Custom onSelect callback cancelled default select action"):(f.hideResults(),c&&f.set.value(c),void(r&&(f.verbose("Opening search link found in result",a),"_blank"==s||n.ctrlKey?t.open(r):t.location.href=r)))}}},handleKeyboard:function(e){var t,n=k.find(b.result),i=k.find(b.category),o=n.index(n.filter("."+p.active)),a=n.length,r=e.which,s={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(r==s.escape&&(f.verbose("Escape key pressed, blurring search field"),T.trigger("blur")),f.is.visible())if(r==s.enter){if(f.verbose("Enter key pressed, selecting active result"),n.filter("."+p.active).length>0)return f.event.result.click.call(n.filter("."+p.active),e),e.preventDefault(),!1}else r==s.upArrow?(f.verbose("Up key pressed, changing active result"),t=0>o-1?o:o-1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault()):r==s.downArrow&&(f.verbose("Down key pressed, changing active result"),t=o+1>=a?o:o+1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault());else r==s.enter&&(f.verbose("Enter key pressed, executing query"),f.query(),f.set.buttonPressed(),T.one("keyup",f.remove.buttonFocus))},setup:{api:function(){var e={debug:g.debug,on:!1,action:"search",onFailure:f.error};f.verbose("First request, initializing API"),k.api(e)}},can:{useAPI:function(){return e.fn.api!==i},transition:function(){return g.transition&&e.fn.transition!==i&&k.transition("is supported")}},is:{empty:function(){return""===A.html()},visible:function(){return A.filter(":visible").length>0},focused:function(){return T.filter(":focus").length>0}},get:{inputEvent:function(){var e=T[0],t=e!==i&&e.oninput!==i?"input":e!==i&&e.onpropertychange!==i?"propertychange":"keyup";return t},value:function(){return T.val()},results:function(){var e=k.data(v.results);return e},result:function(t,n){var o=["title","id"],a=!1;return t=t!==i?t:f.get.value(),n=n!==i?n:f.get.results(),"category"===g.type?(f.debug("Finding result that matches",t),e.each(n,function(n,i){return e.isArray(i.results)&&(a=f.search.object(t,i.results,o)[0])?!1:void 0})):(f.debug("Finding result in results object",t),a=f.search.object(t,n,o)[0]),a||!1}},set:{focus:function(){k.addClass(p.focus)},loading:function(){k.addClass(p.loading)},value:function(e){f.verbose("Setting search input value",e),T.val(e)},buttonPressed:function(){S.addClass(p.pressed)}},remove:{loading:function(){k.removeClass(p.loading)},focus:function(){k.removeClass(p.focus)},buttonPressed:function(){S.removeClass(p.pressed)}},query:function(){var t=f.get.value(),n=f.read.cache(t);f.has.minimumCharacters()?n?(f.debug("Reading result from cache",t),f.save.results(n.results),f.addResults(n.html),f.inject.id(n.results)):(f.debug("Querying for",t),e.isPlainObject(g.source)||e.isArray(g.source)?f.search.local(t):f.can.useAPI()?f.search.remote(t):f.error(y.source),g.onSearchQuery.call(P,t)):f.hideResults()},search:{local:function(e){var t,n=f.search.object(e,g.content);f.set.loading(),f.save.results(n),f.debug("Returned local search results",n),t=f.generateResults({results:n}),f.remove.loading(),f.addResults(t),f.inject.id(n),f.write.cache(e,{html:t,results:n})},remote:function(t){var n={onSuccess:function(e){f.parse.response.call(P,e,t)},urlData:{query:t}};k.api("get request")||f.setup.api(),e.extend(!0,n,g.apiSettings),f.debug("Executing search",n),f.cancel.query(),k.api("setting",n).api("query")},object:function(t,n,o){var a=[],r=[],s=t.toString().replace(h.escape,"\\$&"),c=new RegExp(h.beginsWith+s,"i"),l=function(t,n){var i=-1==e.inArray(n,a),o=-1==e.inArray(n,r);i&&o&&t.push(n)};return n=n||g.source,o=o!==i?o:g.searchFields,e.isArray(o)||(o=[o]),n===i?(f.error(y.source),[]):(e.each(o,function(i,o){e.each(n,function(e,n){var i="string"==typeof n[o];i&&(-1!==n[o].search(c)?l(a,n):g.searchFullText&&f.fuzzySearch(t,n[o])&&l(r,n))})}),e.merge(a,r))}},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var r=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},parse:{response:function(e,t){var n=f.generateResults(e);f.verbose("Parsing server response",e),e!==i&&t!==i&&e.results!==i&&(f.addResults(n),f.inject.id(e.results),f.write.cache(t,{html:n,results:e.results}),f.save.results(e.results))}},cancel:{query:function(){f.can.useAPI()&&k.api("abort")}},has:{minimumCharacters:function(){var e=f.get.value(),t=e.length;return t>=g.minCharacters}},clear:{cache:function(e){var t=k.data(v.cache);e?e&&t&&t[e]&&(f.debug("Removing value from cache",e),delete t[e],k.data(v.cache,t)):(f.debug("Clearing cache",e),k.removeData(v.cache))}},read:{cache:function(e){var t=k.data(v.cache);return g.cache?(f.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==i?t[e]:!1):!1}},create:{id:function(e,t){var n=97,o=t!==i?String.fromCharCode(n+t):"",a=e,r=o+a;return f.verbose("Creating unique id",r),r}},inject:{result:function(e,t,n){f.verbose("Injecting result into results");var o=t-1,a=n-1,r=n!==i?A.children().eq(a).children().eq(o):A.children().eq(o);f.verbose("Injecting results metadata",r),r.data(v.result,e)},id:function(t){f.debug("Injecting unique ids into results");var n=1,o=1;return"category"===g.type?(o=1,e.each(t,function(t,a){e.each(a.results,function(e,t){var r=a.results[e];r.id===i&&(r.id=f.create.id(o,n)),f.inject.result(r,o,n),o++}),n++})):e.each(t,function(e,n){var a=t[e];a.id===i&&(a.id=f.create.id(o)),f.inject.result(a,o),o++}),t}},save:{results:function(e){f.verbose("Saving current search results to metadata",e),k.data(v.results,e)}},write:{cache:function(e,t){var n=k.data(v.cache)!==i?k.data(v.cache):{};g.cache&&(f.verbose("Writing generated html to cache",e,t),n[e]=t,k.data(v.cache,n))}},addResults:function(t){return e.isFunction(g.onResultsAdd)&&g.onResultsAdd.call(A,t)===!1?(f.debug("onResultsAdd callback cancelled default action"),!1):(A.html(t),void f.showResults())},showResults:function(){f.is.visible()||!f.is.focused()||f.is.empty()||(f.can.transition()?(f.debug("Showing results with css animations"),A.transition({animation:g.transition+" in",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(f.debug("Showing results with javascript"),A.stop().fadeIn(g.duration,g.easing)),g.onResultsOpen.call(A))},hideResults:function(){f.is.visible()&&(f.can.transition()?(f.debug("Hiding results with css animations"),A.transition({animation:g.transition+" out",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(f.debug("Hiding results with javascript"),A.stop().fadeOut(g.duration,g.easing)),g.onResultsClose.call(A))},generateResults:function(t){f.debug("Generating html from response",t);var n=g.templates[g.type],i=e.isPlainObject(t.results)&&!e.isEmptyObject(t.results),o=e.isArray(t.results)&&t.results.length>0,a="";return i||o?(g.maxResults>0&&(i?"standard"==g.type&&f.error(y.maxResults):t.results=t.results.slice(0,g.maxResults)),e.isFunction(n)?a=n(t):f.error(y.noTemplate,!1)):a=f.displayMessage(y.noResults,"empty"),g.onResults.call(P,t),a},displayMessage:function(e,t){return t=t||"standard",f.debug("Displaying message",e,t),f.addResults(g.templates.message(e,t)),g.templates.message(e,t)},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=c||t,n=t-i,c=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=g.name+":",n=0;c=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var r,s,c,l=R;return n=n||m,o=P||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},d?(R===i&&f.initialize(),f.invoke(u)):(R!==i&&R.invoke("destroy"),f.initialize())}),a!==i?a:this},e.fn.search.settings={name:"Search Module",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:300,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{active:"active",empty:"empty",focus:"focus",loading:"loading",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 with 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(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},message:function(e,t){var n="";return e!==i&&t!==i&&(n+='',n+="empty"==t?'
'+e+'
':'
'+e+"
",n+="
"),n},category:function(t){var n="",o=e.fn.search.settings.templates.escape;return t.results!==i?(e.each(t.results,function(t,a){a.results!==i&&a.results.length>0&&(n+=''+a.name+"
",e.each(a.results,function(e,t){n+='
',t.url&&(n+='
'),t.image!==i&&(t.image=o(t.image),n+='
'),n+='
',t.price!==i&&(t.price=o(t.price),n+='
'+t.price+"
"),t.title!==i&&(t.title=o(t.title),n+='
'+t.title+"
"),t.description!==i&&(n+='
'+t.description+"
"),n+="
"}),n+="
")}),t.action&&(n+=''+t.action.text+" "),n):!1},standard:function(t){var n="";return t.results!==i?(e.each(t.results,function(e,t){n+=t.url?'':' ',t.image!==i&&(n+=''),n+='',t.price!==i&&(n+='
'+t.price+"
"),t.title!==i&&(n+='
'+t.title+"
"),t.description!==i&&(n+='
'+t.description+"
"),n+="
",n+=" "}),t.action&&(n+=''+t.action.text+" "),n):!1}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.shape=function(o){var a,r=e(this),s=(e("body"),(new Date).getTime()),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var t,f,g,p=r.selector||"",v=e.isPlainObject(o)?e.extend(!0,{},e.fn.shape.settings,o):e.extend({},e.fn.shape.settings),h=v.namespace,b=v.selector,y=v.error,x=v.className,C="."+h,w="module-"+h,k=e(this),T=k.find(b.sides),S=k.find(b.side),A=!1,P=this,R=k.data(w);g={initialize:function(){g.verbose("Initializing module for",P),g.set.defaultSide(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),R=g,k.data(w,R)},destroy:function(){g.verbose("Destroying previous module for",P),k.removeData(w).off(C)},refresh:function(){g.verbose("Refreshing selector cache for",P),k=e(P),T=e(this).find(b.shape),S=e(this).find(b.side)},repaint:function(){g.verbose("Forcing repaint event");{var e=T[0]||n.createElement("div");e.offsetWidth}},animate:function(e,n){g.verbose("Animating box with properties",e),n=n||function(e){g.verbose("Executing animation callback"),e!==i&&e.stopPropagation(),g.reset(),g.set.active()},v.beforeChange.call(f[0]),g.get.transitionEvent()?(g.verbose("Starting CSS animation"),k.addClass(x.animating),T.css(e).one(g.get.transitionEvent(),n),g.set.duration(v.duration),m(function(){k.addClass(x.animating),t.addClass(x.hidden)})):n()},queue:function(e){g.debug("Queueing animation of",e),T.one(g.get.transitionEvent(),function(){g.debug("Executing queued animation"),setTimeout(function(){k.shape(e)},0)})},reset:function(){g.verbose("Animating states reset"),k.removeClass(x.animating).attr("style","").removeAttr("style"),T.attr("style","").removeAttr("style"),S.attr("style","").removeAttr("style").removeClass(x.hidden),f.removeClass(x.animating).attr("style","").removeAttr("style")},is:{complete:function(){return S.filter("."+x.active)[0]==f[0]},animating:function(){return k.hasClass(x.animating)}},set:{defaultSide:function(){t=k.find("."+v.className.active),f=t.next(b.side).length>0?t.next(b.side):k.find(b.side).first(),A=!1,g.verbose("Active side set to",t),g.verbose("Next side set to",f)},duration:function(e){e=e||v.duration,e="number"==typeof e?e+"ms":e,g.verbose("Setting animation duration",e),(v.duration||0===v.duration)&&T.add(S).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=k.find("."+v.className.active),t=e.outerWidth(!0),n=e.outerHeight(!0);k.css({width:t,height:n})},stageSize:function(){var e=k.clone().addClass(x.loading),t=e.find("."+v.className.active),n=A?e.find(b.side).eq(A):t.next(b.side).length>0?t.next(b.side):e.find(b.side).first(),i={};g.set.currentStageSize(),t.removeClass(x.active),n.addClass(x.active),e.insertAfter(k),i={width:n.outerWidth(!0),height:n.outerHeight(!0)},e.remove(),k.css(i),g.verbose("Resizing stage to fit new content",i)},nextSide:function(e){A=e,f=S.filter(e),A=S.index(f),0===f.length&&(g.set.defaultSide(),g.error(y.side)),g.verbose("Next side manually set to",f)},active:function(){g.verbose("Setting new side to active",f),S.removeClass(x.active),f.addClass(x.active),v.onChange.call(f[0]),g.set.defaultSide()}},flip:{up:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip up"):(g.debug("Flipping up",f),g.set.stageSize(),g.stage.above(),g.animate(g.get.transform.up()))):void g.debug("Side already visible",f)},down:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip down"):(g.debug("Flipping down",f),g.set.stageSize(),g.stage.below(),g.animate(g.get.transform.down()))):void g.debug("Side already visible",f)},left:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip left"):(g.debug("Flipping left",f),g.set.stageSize(),g.stage.left(),g.animate(g.get.transform.left()))):void g.debug("Side already visible",f)},right:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip right"):(g.debug("Flipping right",f),g.set.stageSize(),g.stage.right(),g.animate(g.get.transform.right()))):void g.debug("Side already visible",f)},over:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip over"):(g.debug("Flipping over",f),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.over()))):void g.debug("Side already visible",f)},back:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip back"):(g.debug("Flipping back",f),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.back()))):void g.debug("Side already visible",f)}},get:{transform:{up:function(){var e={y:-((t.outerHeight(!0)-f.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight(!0)-f.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},over:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}},back:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},nextSide:function(){return t.next(b.side).length>0?t.next(b.side):k.find(b.side).first()}},stage:{above:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as above",f,e),T.css({transform:"translateZ(-"+e.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as below",f,e),T.css({transform:"translateZ(-"+e.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={active:t.outerWidth(!0),next:f.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as left",f,n),T.css({transform:"translateZ(-"+n.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"}),f.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px)"})},right:function(){var e={active:t.outerWidth(!0),next:f.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as left",f,n),T.css({transform:"translateZ(-"+n.depth.active+"px)"}),t.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"}),f.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px)"})},behind:function(){var e={active:t.outerWidth(!0),next:f.outerWidth(!0)},n={origin:(e.active-e.next)/2,depth:{active:e.next/2,next:e.active/2}};g.verbose("Setting the initial animation position as behind",f,n),t.css({transform:"rotateY(0deg)"}),f.addClass(x.animating).css({left:n.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){if(g.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},debug:function(){v.debug&&(v.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,v.name+":"),g.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,v.name+":"),g.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(g.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",p&&(t+=" '"+p+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,c,l=R;return n=n||d,o=P||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},u?(R===i&&g.initialize(),g.invoke(l)):(R!==i&&R.invoke("destroy"),g.initialize())}),a!==i?a:this},e.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(e,t,n,i){"use strict";e.fn.sidebar=function(o){var a,r=e(this),s=e(t),c=e(n),l=e("html"),u=e("head"),d=r.selector||"",m=(new Date).getTime(),f=[],g=arguments[0],p="string"==typeof g,v=[].slice.call(arguments,1),h=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,b,y,x,C,w,k=e.isPlainObject(o)?e.extend(!0,{},e.fn.sidebar.settings,o):e.extend({},e.fn.sidebar.settings),T=k.selector,S=k.className,A=k.namespace,P=k.regExp,R=k.error,E="."+A,F="module-"+A,O=e(this),D=e(k.context),q=O.children(T.sidebar),z=D.children(T.fixed),j=D.children(T.pusher),I=this,N=O.data(F);w={initialize:function(){w.debug("Initializing sidebar",o),w.create.id(),C=w.get.transitionEvent(),("auto"==k.useLegacy&&w.is.legacy()||k.useLegacy===!0)&&(k.transition="overlay",k.useLegacy=!0),w.is.ios()&&w.set.ios(),k.delaySetup?h(w.setup.layout):w.setup.layout(),h(function(){w.setup.cache()}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of module",w),N=w,O.data(F,w)},create:{id:function(){y=(Math.random().toString(16)+"000000000").substr(2,8),b="."+y,w.verbose("Creating unique id for element",y)}},destroy:function(){w.verbose("Destroying previous module for",O),w.remove.direction(),O.off(E).removeData(F),D.off(b),s.off(b),c.off(b)},event:{clickaway:function(e){var t=j.find(e.target).length>0||j.is(e.target),n=D.is(e.target);t&&(w.verbose("User clicked on dimmed page"),w.hide()),n&&(w.verbose("User clicked on dimmable context (scaled out page)"),w.hide())},touch:function(e){},containScroll:function(e){I.scrollTop<=0&&(I.scrollTop=1),I.scrollTop+I.offsetHeight>=I.scrollHeight&&(I.scrollTop=I.scrollHeight-I.offsetHeight-1)},scroll:function(t){0===e(t.target).closest(T.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){w.verbose("Adding clickaway events to context",D),k.closable&&D.on("click"+b,w.event.clickaway).on("touchend"+b,w.event.clickaway)},scrollLock:function(){k.scrollLock&&(w.debug("Disabling page scroll"),
s.on("DOMMouseScroll"+b,w.event.scroll)),w.verbose("Adding events to contain sidebar scroll"),c.on("touchmove"+b,w.event.touch),O.on("scroll"+E,w.event.containScroll)}},unbind:{clickaway:function(){w.verbose("Removing clickaway events from context",D),D.off(b)},scrollLock:function(){w.verbose("Removing scroll lock from page"),c.off(b),s.off(b),O.off("scroll"+E)}},add:{bodyCSS:function(){var t,n=w.cache.width||O.outerWidth(),i=w.cache.height||O.outerHeight(),o=w.is.rtl(),a=w.get.direction(),s={left:n,right:-n,top:i,bottom:-i};o&&(w.verbose("RTL detected, flipping widths"),s.left=-n,s.right=n),t="",r=e(t).appendTo(u),w.debug("Adding sizing css to head",r)}},refresh:function(){w.verbose("Refreshing selector cache"),D=e(k.context),q=D.children(T.sidebar),j=D.children(T.pusher),z=D.children(T.fixed),w.clear.cache()},refreshSidebars:function(){w.verbose("Refreshing other sidebars"),q=D.children(T.sidebar)},repaint:function(){w.verbose("Forcing repaint event"),I.style.display="none";I.offsetHeight;I.scrollTop=I.scrollTop,I.style.display=""},setup:{cache:function(){w.cache={width:O.outerWidth(),height:O.outerHeight(),rtl:"rtl"==O.css("direction")}},layout:function(){0===D.children(T.pusher).length&&(w.debug("Adding wrapper element for sidebar"),w.error(R.pusher),j=e('
'),D.children().not(T.omitted).not(q).wrapAll(j),w.refresh()),(0===O.nextAll(T.pusher).length||O.nextAll(T.pusher)[0]!==j[0])&&(w.debug("Moved sidebar to correct parent element"),w.error(R.movedSidebar,I),O.detach().prependTo(D),w.refresh()),w.clear.cache(),w.set.pushable(),w.set.direction()}},attachEvents:function(t,n){var i=e(t);n=e.isFunction(w[n])?w[n]:w.toggle,i.length>0?(w.debug("Attaching sidebar events to element",t,n),i.on("click"+E,n)):w.error(R.notFound,t)},show:function(t){var n=k.useLegacy===!0?w.legacyPushPage:w.pushPage;if(t=e.isFunction(t)?t:function(){},w.is.hidden()){if(w.refreshSidebars(),k.overlay&&(w.error(R.overlay),k.transition="overlay"),w.refresh(),w.othersActive())if(w.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void w.hideOthers(w.show);w.hideOthers()}else k.transition="overlay";n(function(){t.call(I),k.onShow.call(I)}),k.onChange.call(I),k.onVisible.call(I)}else w.debug("Sidebar is already visible")},hide:function(t){var n=k.useLegacy===!0?w.legacyPullPage:w.pullPage;t=e.isFunction(t)?t:function(){},(w.is.visible()||w.is.animating())&&(w.debug("Hiding sidebar",t),w.refreshSidebars(),n(function(){t.call(I),k.onHidden.call(I)}),k.onChange.call(I),k.onHide.call(I))},othersAnimating:function(){return q.not(O).filter("."+S.animating).length>0},othersVisible:function(){return q.not(O).filter("."+S.visible).length>0},othersActive:function(){return w.othersVisible()||w.othersAnimating()},hideOthers:function(e){var t=q.not(O).filter("."+S.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){w.verbose("Determining toggled direction"),w.is.hidden()?w.show():w.hide()},pushPage:function(t){var n,i,o,a=w.get.transition(),r="safe"==a?D:"overlay"===a||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},"scale down"==k.transition&&w.scrollToTop(),w.set.transition(a),w.repaint(),n=function(){w.bind.clickaway(),w.add.bodyCSS(),w.set.animating(),w.set.visible()},i=function(){w.set.dimmed()},o=function(e){e.target==r[0]&&(r.off(C+b,o),w.remove.animating(),w.bind.scrollLock(),t.call(I))},r.off(C+b),r.on(C+b,o),h(n),k.dimPage&&!w.othersVisible()&&h(i)},pullPage:function(t){var n,i,o=w.get.transition(),a="safe"==o?D:"overlay"==o||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},w.verbose("Removing context push state",w.get.direction()),w.unbind.clickaway(),w.unbind.scrollLock(),n=function(){w.set.transition(o),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersVisible()&&j.removeClass(S.dimmed)},i=function(e){e.target==a[0]&&(a.off(C+b,i),w.remove.animating(),w.remove.transition(),w.remove.bodyCSS(),("scale down"==o||k.returnScroll&&w.is.mobile())&&w.scrollBack(),t.call(I))},a.off(C+b),a.on(C+b,i),h(n)},legacyPushPage:function(t){var n=O.width(),i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]=n,w.debug("Using javascript to push context",o),w.set.visible(),w.set.transition(),w.set.animating(),k.dimPage&&j.addClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),w.bind.clickaway(),t.call(I)})},legacyPullPage:function(t){var n=0,i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]="0px",w.debug("Using javascript to pull context",o),w.unbind.clickaway(),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersActive()&&j.removeClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),t.call(I)})},scrollToTop:function(){w.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),O.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){w.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},clear:{cache:function(){w.verbose("Clearing cached dimensions"),w.cache={}}},set:{ios:function(){l.addClass(S.ios)},pushed:function(){D.addClass(S.pushed)},pushable:function(){D.addClass(S.pushable)},dimmed:function(){j.addClass(S.dimmed)},active:function(){O.addClass(S.active)},animating:function(){O.addClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.addClass(e)},direction:function(e){e=e||w.get.direction(),O.addClass(S[e])},visible:function(){O.addClass(S.visible)},overlay:function(){O.addClass(S.overlay)}},remove:{bodyCSS:function(){w.debug("Removing body css styles",r),r&&r.length>0&&r.remove()},pushed:function(){D.removeClass(S.pushed)},pushable:function(){D.removeClass(S.pushable)},active:function(){O.removeClass(S.active)},animating:function(){O.removeClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.removeClass(e)},direction:function(e){e=e||w.get.direction(),O.removeClass(S[e])},visible:function(){O.removeClass(S.visible)},overlay:function(){O.removeClass(S.overlay)}},get:{direction:function(){return O.hasClass(S.top)?S.top:O.hasClass(S.right)?S.right:O.hasClass(S.bottom)?S.bottom:S.left},transition:function(){var e,t=w.get.direction();return e=w.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,w.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]}},is:{ie:function(){var e=!t.ActiveXObject&&"ActiveXObject"in t,n="ActiveXObject"in t;return e||n},legacy:function(){var e,o=n.createElement("div"),a={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};n.body.insertBefore(o,null);for(var r in a)o.style[r]!==i&&(o.style[r]="translate3d(1px,1px,1px)",e=t.getComputedStyle(o).getPropertyValue(a[r]));return n.body.removeChild(o),!(e!==i&&e.length>0&&"none"!==e)},ios:function(){var e=navigator.userAgent,t=e.match(P.ios);return t?(w.verbose("Browser was found to be iOS",e),!0):!1},mobile:function(){var e=navigator.userAgent,t=e.match(P.mobile);return t?(w.verbose("Browser was found to be mobile",e),!0):(w.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!w.is.visible()},visible:function(){return O.hasClass(S.visible)},open:function(){return w.is.visible()},closed:function(){return w.is.hidden()},vertical:function(){return O.hasClass(S.top)},animating:function(){return D.hasClass(S.animating)},rtl:function(){return w.cache.rtl===i&&(w.cache.rtl="rtl"==O.css("direction")),w.cache.rtl}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,k,t);else{if(n===i)return k[t];k[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){k.debug&&(k.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,k.name+":"),w.debug.apply(console,arguments)))},verbose:function(){k.verbose&&k.debug&&(k.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,k.name+":"),w.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;k.performance&&(t=(new Date).getTime(),i=m||t,n=t-i,m=t,f.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:I,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=k.name+":",n=0;m=!1,clearTimeout(w.performance.timer),e.each(f,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",d&&(t+=" '"+d+"'"),(console.group!==i||console.table!==i)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):e.each(f,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,n,o){var r,s,c,l=N;return n=n||v,o=I||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(w.error(R.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},p?(N===i&&w.initialize(),w.invoke(g)):(N!==i&&w.invoke("destroy"),w.initialize())}),a!==i?a:this},e.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,useLegacy:!1,duration:500,easing:"easeInOutQuint",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,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"}},e.extend(e.easing,{easeInOutQuint:function(e,t,n,i,o){return(t/=o/2)<1?i/2*t*t*t*t*t+n:i/2*((t-=2)*t*t*t*t+2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.sticky=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f,g=e.isPlainObject(n)?e.extend(!0,{},e.fn.sticky.settings,n):e.extend({},e.fn.sticky.settings),p=g.className,v=g.namespace,h=g.error,b="."+v,y="module-"+v,x=e(this),C=e(t),w=x.offsetParent(),k=e(g.scrollContext),T=(x.selector||"",x.data(y)),S=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},A=this;f={initialize:function(){f.determineContext(),f.verbose("Initializing sticky",g,w),f.save.positions(),f.checkErrors(),f.bind.events(),g.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),T=f,x.data(y,f)},destroy:function(){f.verbose("Destroying previous instance"),f.reset(),m&&m.disconnect(),C.off("load"+b,f.event.load).off("resize"+b,f.event.resize),k.off("scrollchange"+b,f.event.scrollchange),x.removeData(y)},observeChanges:function(){var e=a[0];"MutationObserver"in t&&(m=new MutationObserver(function(e){clearTimeout(f.timer),f.timer=setTimeout(function(){f.verbose("DOM tree modified, updating sticky menu",e),f.refresh()},100)}),m.observe(A,{childList:!0,subtree:!0}),m.observe(e,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",m))},determineContext:function(){return a=g.context?e(g.context):w,0===a.length?void f.error(h.invalidContext,g.context,x):void 0},checkErrors:function(){return f.is.hidden()&&f.error(h.visible,x),f.cache.element.height>f.cache.context.height?(f.reset(),void f.error(h.elementSize,x)):void 0},bind:{events:function(){C.on("load"+b,f.event.load).on("resize"+b,f.event.resize),k.off("scroll"+b).on("scroll"+b,f.event.scroll).on("scrollchange"+b,f.event.scrollchange)}},event:{load:function(){f.verbose("Page contents finished loading"),S(f.refresh)},resize:function(){f.verbose("Window resized"),S(f.refresh)},scroll:function(){S(function(){k.triggerHandler("scrollchange"+b,k.scrollTop())})},scrollchange:function(e,t){f.stick(t),g.onScroll.call(A)}},refresh:function(e){f.reset(),e&&(w=x.offsetParent()),f.save.positions(),f.stick(),g.onReposition.call(A)},supports:{sticky:function(){{var t=e("
");t[0]}return t.addClass(p.supported),t.css("position").match("sticky")}},save:{lastScroll:function(e){f.lastScroll=e},elementScroll:function(e){f.elementScroll=e},positions:function(){var e={height:C.height()},t={margin:{top:parseInt(x.css("margin-top"),10),bottom:parseInt(x.css("margin-bottom"),10)},offset:x.offset(),width:x.outerWidth(),height:x.outerHeight()},n={offset:a.offset(),height:a.outerHeight(),bottomPadding:parseInt(a.css("padding-bottom"),10)};f.cache={fits:t.heighte&&(t="up")),t},scrollChange:function(e){return e=e||k.scrollTop(),f.lastScroll?e-f.lastScroll:0},currentElementScroll:function(){return f.elementScroll?f.elementScroll:f.is.top()?Math.abs(parseInt(x.css("top"),10))||0:Math.abs(parseInt(x.css("bottom"),10))||0},elementScroll:function(e){e=e||k.scrollTop();var t=f.cache.element,n=f.cache.window,i=f.get.scrollChange(e),o=t.height-n.height+g.offset,a=f.get.currentElementScroll(),r=a+i;return a=f.cache.fits||0>r?0:r>o?o:r}},remove:{offset:function(){x.css("margin-top","")}},set:{offset:function(){f.verbose("Setting offset on element",g.offset),x.css("margin-top",g.offset)},containerSize:function(){var e=w.get(0).tagName;"HTML"===e||"body"==e?w=x.offsetParent():Math.abs(w.height()-f.cache.context.height)>5&&(f.debug("Context has padding, specifying exact height for container",f.cache.context.height),w.css({height:f.cache.context.height}))},scroll:function(e){f.debug("Setting scroll on element",e),f.elementScroll!=e&&(f.is.top()&&x.css("bottom","").css("top",-e),f.is.bottom()&&x.css("top","").css("bottom",e))},size:function(){0!==f.cache.element.height&&0!==f.cache.element.width&&x.css({width:f.cache.element.width,height:f.cache.element.height})}},is:{top:function(){return x.hasClass(p.top)},bottom:function(){return x.hasClass(p.bottom)},initialPosition:function(){return!f.is.fixed()&&!f.is.bound()},hidden:function(){return!x.is(":visible")},bound:function(){return x.hasClass(p.bound)},fixed:function(){return x.hasClass(p.fixed)}},stick:function(e){var t=e||k.scrollTop(),n=f.cache,i=n.fits,o=n.element,a=n.window,r=n.context,s=f.is.bottom()&&g.pushing?g.bottomOffset:g.offset,e={top:t+s,bottom:t+s+a.height},c=(f.get.direction(e.top),i?0:f.get.elementScroll(e.top)),l=!i,u=0!==o.height;u&&(f.is.initialPosition()?e.top>=r.bottom?(f.debug("Element bottom of container"),f.bindBottom()):e.top>=o.top&&(f.debug("Element passed, fixing element to page"),f.fixTop()):f.is.fixed()?f.is.top()?e.topr.bottom?(f.debug("Fixed element reached bottom of container"),f.bindBottom()):l&&f.set.scroll(c):f.is.bottom()&&(e.bottom-o.heightr.bottom?(f.debug("Bottom fixed rail has reached bottom of container"),f.bindBottom()):l&&f.set.scroll(c)):f.is.bottom()&&(g.pushing?f.is.bound()&&e.bottom0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=T;return n=n||d,a=A||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(T===i&&f.initialize(),f.invoke(l)):(T!==i&&T.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible",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(e,t,n,i){"use strict";e.fn.tab=function(n){var o,a,r=e(e.isFunction(this)?t:this),s=e.isPlainObject(n)?e.extend(!0,{},e.fn.tab.settings,n):e.extend({},e.fn.tab.settings),c=r.selector||"",l=(new Date).getTime(),u=[],d=arguments[0],m="string"==typeof d,f=[].slice.call(arguments,1);return r.each(function(){var n,g,p,v,h,b=s.className,y=s.metadata,x=s.selector,C=s.error,w="."+s.namespace,k="module-"+s.namespace,T=e(this),S={},A=!0,P=0,R=this,E=T.data(k);o={initialize:function(){o.debug("Initializing tab menu item",T),o.determineTabs(),o.debug("Determining tabs",s.context,g),s.auto&&o.set.auto(),e.isWindow(R)||(o.debug("Attaching tab activation events to element",T),T.on("click"+w,o.event.click)),o.instantiate()},determineTabs:function(){var t;"parent"===s.context?(T.closest(x.ui).length>0?(t=T.closest(x.ui),o.verbose("Using closest UI element for determining parent",t)):t=T,n=t.parent(),o.verbose("Determined parent element for creating context",n)):s.context?(n=e(s.context),o.verbose("Using selector for tab context",s.context,n)):n=e("body"),s.childrenOnly?(g=n.children(x.tabs),o.debug("Searching tab context children for tabs",n,g)):(g=n.find(x.tabs),o.debug("Searching tab context for tabs",n,g))},initializeHistory:function(){if(s.history){if(o.debug("Initializing page state"),e.address===i)return o.error(C.state),!1;if("state"==s.historyType){if(o.debug("Using HTML5 to manage state"),s.path===!1)return o.error(C.path),!1;e.address.history(!0).state(s.path)}e.address.bind("change",o.event.history.change)}},instantiate:function(){o.verbose("Storing instance of module",o),E=o,T.data(k,o)},destroy:function(){o.debug("Destroying tabs",T),T.removeData(k).off(w)},event:{click:function(t){var n=e(this).data(y.tab);n!==i?(s.history?(o.verbose("Updating page state",t),e.address.value(n)):(o.verbose("Changing tab",t),o.changeTab(n)),t.preventDefault()):o.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||o.get.initialPath(),a=s.templates.determineTitle(n)||!1;o.performance.display(),o.debug("History change event",n,t),h=t,n!==i&&o.changeTab(n),a&&e.address.title(a)}}},refresh:function(){p&&(o.debug("Refreshing tab",p),o.changeTab(p))},cache:{read:function(e){return e!==i?S[e]:!1},add:function(e,t){e=e||p,o.debug("Adding cached content for",e),S[e]=t},remove:function(e){e=e||p,o.debug("Removing cached content for",e),delete S[e]}},set:{auto:function(){var t="string"==typeof s.path?s.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";o.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(s.apiSettings)?s.apiSettings.url=t:s.apiSettings={url:t}},state:function(t){e.address.value(t)}},changeTab:function(i){var i="string"==typeof i?i.toLowerCase():i,a=t.history&&t.history.pushState,r=a&&s.ignoreFirstLoad&&A,c=s.auto||e.isPlainObject(s.apiSettings),l=c&&!r?o.utilities.pathToArray(i):o.get.defaultPathArray(i);i=o.utilities.arrayToPath(l),e.each(l,function(t,a){var u,d,m,f,g=l.slice(0,t+1),b=o.utilities.arrayToPath(g),y=o.is.tab(b),x=t+1==l.length,w=o.get.tabElement(b);if(o.verbose("Looking for tab",a),y){if(o.verbose("Tab was found",a),p=b,v=o.utilities.filterArray(l,g),x?f=!0:(d=l.slice(0,t+2),m=o.utilities.arrayToPath(d),f=!o.is.tab(m),f&&o.verbose("Tab parameters found",d)),f&&c)return r?(o.debug("Ignoring remote content on first tab load",b),A=!1,o.cache.add(i,w.html()),o.activate.all(b),s.onTabInit.call(w,b,v,h),s.onTabLoad.call(w,b,v,h)):(o.activate.navigation(b),o.content.fetch(b,i)),!1;o.debug("Opened local tab",b),o.activate.all(b),o.cache.read(b)||(o.cache.add(b,!0),o.debug("First time tab loaded calling tab init"),s.onTabInit.call(w,b,v,h)),s.onTabLoad.call(w,b,v,h)}else{if(-1!=i.search("/")||""===i)return o.error(C.missingTab,T,n,b),!1;if(u=e("#"+i+', a[name="'+i+'"]'),b=u.closest("[data-tab]").data("tab"),w=o.get.tabElement(b),u&&u.length>0&&b)return o.debug("No tab found, but deep anchor link present, opening parent tab"),o.activate.all(b),o.cache.read(b)||(o.cache.add(b,!0),o.debug("First time tab loaded calling tab init"),s.onTabInit.call(w,b,v,h)),!1}})},content:{fetch:function(t,n){var a,r,c=o.get.tabElement(t),l={dataType:"html",on:"now",onSuccess:function(e){o.cache.add(n,e),o.content.update(t,e),t==p?(o.debug("Content loaded",t),o.activate.tab(t)):o.debug("Content loaded in background",t),s.onTabInit.call(c,t,v,h),s.onTabLoad.call(c,t,v,h)},urlData:{tab:n}},u=c.api("get request")||!1,d=u&&"pending"===u.state();n=n||t,r=o.cache.read(n),o.activate.tab(t),s.cache&&r?(o.debug("Adding cached content",n),"once"==s.evaluateScripts?o.content.update(t,r,!1):o.content.update(t,r),s.onTabLoad.call(c,t,v,h)):d?(o.debug("Content is already loading",n),c.addClass(b.loading)):e.api!==i?(a=e.extend(!0,{headers:{"X-Remote":!0}},s.apiSettings,l),o.debug("Retrieving remote content",n,a),c.api(a)):o.error(C.api)},update:function(e,t,n){var a=o.get.tabElement(e),r=a[0];n=n!==i?n:s.evaluateScripts,n?(o.debug("Updating HTML and evaluating inline scripts",e,t),a.html(t)):(o.debug("Updating HTML",e,t),r.innerHTML=t)}},activate:{all:function(e){o.activate.tab(e),o.activate.navigation(e)},tab:function(e){var t=o.get.tabElement(e);o.verbose("Showing tab content for",t),t.addClass(b.active).siblings(g).removeClass(b.active+" "+b.loading)},navigation:function(e){var t=o.get.navElement(e);o.verbose("Activating tab navigation for",t,e),t.addClass(b.active).siblings(r).removeClass(b.active+" "+b.loading)}},deactivate:{all:function(){o.deactivate.navigation(),o.deactivate.tabs()},navigation:function(){r.removeClass(b.active)},tabs:function(){g.removeClass(b.active+" "+b.loading)}},is:{tab:function(e){return e!==i?o.get.tabElement(e).length>0:!1}},get:{initialPath:function(){return r.eq(0).data(y.tab)||g.eq(0).data(y.tab)},path:function(){return e.address.value()},defaultPathArray:function(e){return o.utilities.pathToArray(o.get.defaultPath(e))},defaultPath:function(e){var t=r.filter("[data-"+y.tab+'^="'+e+'/"]').eq(0),n=t.data(y.tab)||!1;if(n){if(o.debug("Found default tab",n),P0?t:n},tab:function(){return p}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===i&&(e=p),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(t,n){if(o.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,s,t);else{if(n===i)return s[t];s[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,o,t);else{if(n===i)return o[t];o[t]=n}},debug:function(){s.debug&&(s.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,s.name+":"),o.debug.apply(console,arguments)))},verbose:function(){s.verbose&&s.debug&&(s.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,s.name+":"),o.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;s.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,u.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:R,"Execution Time":n})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=s.name+":",n=0;l=!1,clearTimeout(o.performance.timer),e.each(u,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):e.each(u,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(t,n,r){var s,c,l,u=E;return n=n||f,r=R||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,a){var r=n!=s?a+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[a])||n==s)return u[a]!==i?(c=u[a],!1):(o.error(C.method,t),!1);u=u[a]}})),e.isFunction(c)?l=c.apply(r,n):c!==i&&(l=c),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),c}},m?(E===i&&o.initialize(),o.invoke(d)):(E!==i&&E.invoke("destroy"),o.initialize())}),o&&!m&&o.initializeHistory(),a!==i?a:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.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",onTabInit:function(e,t,n){},onTabLoad:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",
method:"The method you called is not defined",missingTab:"Activated tab cannot be found for this context.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library "},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.transition=function(){{var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments,u=l[0],d=[].slice.call(arguments,1),m="string"==typeof u;t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(t){var f,g,p,v,h,b,y,x,C,w=e(this),k=this;C={initialize:function(){f=C.get.settings.apply(k,l),v=f.className,p=f.error,h=f.metadata,x="."+f.namespace,y="module-"+f.namespace,g=w.data(y)||C,b=C.get.animationEndEvent(),m&&(m=C.invoke(u)),m===!1&&(C.verbose("Converted arguments into settings object",f),f.interval?C.delay(f.animate):C.animate(),C.instantiate())},instantiate:function(){C.verbose("Storing instance of module",C),g=C,w.data(y,g)},destroy:function(){C.verbose("Destroying previous module for",k),w.removeData(y)},refresh:function(){C.verbose("Refreshing display type on next animation"),delete C.displayType},forceRepaint:function(){C.verbose("Forcing element repaint");var e=w.parent(),t=w.next();0===t.length?w.detach().appendTo(e):w.detach().insertBefore(t)},repaint:function(){C.verbose("Repainting element");k.offsetWidth},delay:function(e){var n,o=f.reverse===!0,r="auto"==f.reverse&&C.get.direction()==v.outward;e=typeof e!==i?e:f.interval,n=o||r?(a.length-t)*f.interval:t*f.interval,C.debug("Delaying animation by",n),setTimeout(C.animate,n)},animate:function(e){if(f=e||f,!C.is.supported())return C.error(p.support),!1;if(C.debug("Preparing animation",f.animation),C.is.animating()){if(f.queue)return!f.allowRepeats&&C.has.direction()&&C.is.occurring()&&C.queuing!==!0?C.debug("Animation is currently occurring, preventing queueing same animation",f.animation):C.queue(f.animation),!1;if(!f.allowRepeats&&C.is.occurring())return C.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1;C.debug("New animation started, completing previous early",f.animation),g.complete()}C.can.animate()?C.set.animating(f.animation):C.error(p.noAnimation,f.animation,k)},reset:function(){C.debug("Resetting animation to beginning conditions"),C.remove.animationCallbacks(),C.restore.conditions(),C.remove.animating()},queue:function(e){C.debug("Queueing animation of",e),C.queuing=!0,w.one(b+".queue"+x,function(){C.queuing=!1,C.repaint(),C.animate.apply(this,f)})},complete:function(e){C.debug("Animation complete",f.animation),C.remove.completeCallback(),C.remove.failSafe(),C.is.looping()||(C.is.outward()?(C.verbose("Animation is outward, hiding element"),C.restore.conditions(),C.hide(),f.onHide.call(this)):C.is.inward()?(C.verbose("Animation is outward, showing element"),C.restore.conditions(),C.show(),f.onShow.call(this)):(C.restore.conditions(),C.show()),C.remove.animation(),C.remove.animating()),f.onComplete.call(this)},has:{direction:function(t){var n=!1;return t=t||f.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){(t===v.inward||t===v.outward)&&(n=!0)})),n},inlineDisplay:function(){var t=w.attr("style")||"";return e.isArray(t.match(/display.*?;/,""))}},set:{animating:function(e){e=e||f.animation,C.is.animating()||C.save.conditions(),C.remove.direction(),C.remove.completeCallback(),C.can.transition()&&!C.has.direction()&&C.set.direction(),C.remove.hidden(),C.set.display(),w.addClass(v.animating+" "+v.transition+" "+e).one(b+".complete"+x,C.complete),f.useFailSafe&&C.add.failSafe(),C.set.duration(f.duration),f.onStart.call(this),C.debug("Starting tween",e)},duration:function(e,t){t=t||f.duration,t="number"==typeof t?t+"ms":t,(t||0===t)&&(C.verbose("Setting animation duration",t),w.css({"animation-duration":t}))},display:function(){var e=C.get.style(),t=C.get.displayType(),n=e+"display: "+t+" !important;";w.css("display",""),C.refresh(),w.css("display")!==t&&(C.verbose("Setting inline visibility to",t),w.attr("style",n))},direction:function(){w.is(":visible")&&!C.is.hidden()?(C.debug("Automatically determining the direction of animation","Outward"),w.removeClass(v.inward).addClass(v.outward)):(C.debug("Automatically determining the direction of animation","Inward"),w.removeClass(v.outward).addClass(v.inward))},looping:function(){C.debug("Transition set to loop"),w.addClass(v.looping)},hidden:function(){C.is.hidden()||w.addClass(v.transition).addClass(v.hidden),"none"!==w.css("display")&&(C.verbose("Overriding default display to hide element"),w.css("display","none"))},visible:function(){w.addClass(v.transition).addClass(v.visible)}},save:{displayType:function(e){"none"!==e&&w.data(h.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,C.verbose("Saving existence of transition",t,n)},conditions:function(){w.removeClass(f.animation),C.remove.direction(),C.cache={className:w.attr("class"),style:C.get.style()},C.verbose("Saving original attributes",C.cache)}},restore:{conditions:function(){return C.cache===i?!1:(C.cache.className?w.attr("class",C.cache.className):w.removeAttr("class"),C.cache.style?(C.verbose("Restoring original style attribute",C.cache.style),w.attr("style",C.cache.style)):(C.verbose("Clearing style attribute"),w.removeAttr("style")),void C.verbose("Restoring original attributes",C.cache))}},add:{failSafe:function(){var e=C.get.duration();C.timer=setTimeout(function(){w.triggerHandler(b)},e+f.failSafeDelay),C.verbose("Adding fail safe timer",C.timer)}},remove:{animating:function(){w.removeClass(v.animating)},animation:function(){w.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationCallbacks:function(){C.remove.queueCallback(),C.remove.completeCallback()},queueCallback:function(){w.off(".queue"+x)},completeCallback:function(){w.off(".complete"+x)},display:function(){w.css("display","")},direction:function(){w.removeClass(v.inward).removeClass(v.outward)},failSafe:function(){C.verbose("Removing fail safe timer",C.timer),C.timer&&clearTimeout(C.timer)},hidden:function(){w.removeClass(v.hidden)},visible:function(){w.removeClass(v.visible)},looping:function(){C.debug("Transitions are no longer looping"),C.is.looping()&&(C.reset(),w.removeClass(v.looping))},transition:function(){w.removeClass(v.visible).removeClass(v.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},direction:function(t){return t=t||f.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){return t===v.inward?v.inward:t===v.outward?v.outward:void 0})),C.can.transition()?w.is(":visible")&&!C.is.hidden()?v.outward:v.inward:"static"},duration:function(e){return e=e||f.duration,e===!1&&(e=w.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(){return f.displayType?f.displayType:(w.data(h.displayType)===i&&C.can.transition(!0),w.data(h.displayType))},style:function(){var e=w.attr("style")||"";return e.replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in o)if(t.style[e]!==i)return o[e];return!1},animationEndEvent:function(){var e,t=n.createElement("div"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in o)if(t.style[e]!==i)return o[e];return!1}},can:{transition:function(t){var n,o,a,r,s,c,l,u=f.animation,d=C.get.transitionExists(u);if(d===i||t){if(C.verbose("Determining whether animation exists"),n=w.attr("class"),o=w.prop("tagName"),a=e("<"+o+" />").addClass(n).insertAfter(w),r=a.addClass(u).removeClass(v.inward).removeClass(v.outward).addClass(v.animating).addClass(v.transition).css("animationName"),s=a.addClass(v.inward).css("animationName"),l=a.attr("class",n).removeAttr("style").removeClass(v.hidden).removeClass(v.visible).show().css("display"),C.verbose("Determining final display state",l),C.save.displayType(l),a.remove(),r!=s)C.debug("Direction exists for animation",u),c=!0;else{if("none"==r||!r)return void C.debug("No animation defined in css",u);C.debug("Static animation found",u,l),c=!1}C.save.transitionExists(u,c)}return d!==i?d:c},animate:function(){return C.can.transition()!==i}},is:{animating:function(){return w.hasClass(v.animating)},inward:function(){return w.hasClass(v.inward)},outward:function(){return w.hasClass(v.outward)},looping:function(){return w.hasClass(v.looping)},occurring:function(e){return e=e||f.animation,e="."+e.replace(" ","."),w.filter(e).length>0},visible:function(){return w.is(":visible")},hidden:function(){return"hidden"===w.css("visibility")},supported:function(){return b!==!1}},hide:function(){C.verbose("Hiding element"),C.is.animating()&&C.reset(),C.remove.display(),C.remove.visible(),C.set.hidden(),C.repaint()},show:function(e){C.verbose("Showing element",e),C.remove.hidden(),C.set.visible(),C.set.display(),C.repaint()},toggle:function(){C.is.visible()?C.hide():C.show()},stop:function(){C.debug("Stopping current animation"),w.triggerHandler(b)},stopAll:function(){C.debug("Stopping all animation"),C.remove.queueCallback(),w.triggerHandler(b)},clear:{queue:function(){C.debug("Clearing animation queue"),C.remove.queueCallback()}},enable:function(){C.verbose("Starting animation"),w.removeClass(v.disabled)},disable:function(){C.debug("Stopping animation"),w.addClass(v.disabled)},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){f.debug&&(f.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,f.name+":"),C.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),C.verbose.apply(console,arguments)))},error:function(){C.error=Function.prototype.bind.call(console.error,console,f.name+":"),C.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(C.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=g;return n=n||d,a=k||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s!==i?s:!1}},C.initialize()}),o!==i?o:this},e.fn.transition.exists={},e.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(e,t,n,i){"use strict";e.api=e.fn.api=function(n){var o,a=e(e.isFunction(this)?t:this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var t,a,m,f,g,p,v=e.isPlainObject(n)?e.extend(!0,{},e.fn.api.settings,n):e.extend({},e.fn.api.settings),h=v.namespace,b=v.metadata,y=v.selector,x=v.error,C=v.className,w="."+h,k="module-"+h,T=e(this),S=T.closest(y.form),A=v.stateContext?e(v.stateContext):T,P=this,R=A[0],E=T.data(k);p={initialize:function(){u||(p.create.cache(),p.bind.events()),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),E=p,T.data(k,E)},destroy:function(){p.verbose("Destroying previous module for",P),T.removeData(k).off(w)},bind:{events:function(){var e=p.get.event();e?(p.debug("Attaching API events to element",e),T.on(e+w,p.event.trigger)):"now"==v.on&&(p.debug("Querying API now",e),p.query())}},read:{cachedResponse:function(e){var t;return p.cache||p.create.cache(),t=p.cache.response[e]!==i?p.cache.response[e]:!1,p.debug("Using cached response",e,t),t}},write:{cachedResponse:function(e,t){return p.cache||p.create.cache(),t&&""===t?void p.debug("Response empty, not caching",t):(p.verbose("Storing cached response for url",e,t),void(p.cache.response[e]=t))}},query:function(){if(p.is.disabled())return void p.debug("Element is disabled API request aborted");if(p.is.loading()){if(!v.interruptRequests)return void p.debug("Cancelling request, previous request is still pending");p.debug("Interrupting previous request"),p.abort()}if(v.defaultData&&e.extend(!0,v.urlData,p.get.defaultData()),(v.serializeForm!==!1||A.is("form"))&&("json"==v.serializeForm?e.extend(!0,v.data,p.get.formData()):v.data=p.get.formData()),a=p.get.settings(),a===!1)return p.cancelled=!0,void p.error(x.beforeSend);if(p.cancelled=!1,v.url?(p.debug("Using specified url",m),m=p.add.urlData(v.url)):(m=p.add.urlData(p.get.templateURL()),p.debug("Added URL Data to url",m)),!m&&!p.is.mocked()){if(!p.is.form())return void p.error(x.missingURL,v.action);m=T.attr("action")||"",p.debug("No url or action specified, defaulting to form action",m)}return t=e.extend(!0,{},v,{type:v.method||v.type,data:f,url:v.base+m,beforeSend:v.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),p.debug("Querying URL",t.url),p.verbose("Using AJAX settings",t),"local"===v.cache&&p.read.cachedResponse(m)?(p.debug("Response returned from local cache"),p.request=p.create.request(),void p.request.resolveWith(R,[p.read.cachedResponse(m)])):void(v.throttle?v.throttleFirstRequest||p.timer?(p.debug("Throttling request",v.throttle),clearTimeout(p.timer),p.timer=setTimeout(function(){p.timer&&delete p.timer,p.debug("Sending throttled request",f,t.method),p.send.request()},v.throttle)):(p.debug("Sending data",f,t.method),p.send.request(),p.timer=setTimeout(function(){},v.throttle)):(p.debug("Sending data",f,t.method),p.send.request()))},is:{disabled:function(){return T.filter(v.filter).length>0},form:function(){return T.is("form")},mocked:function(){return v.mockResponse||v.mockResponseAsync},input:function(){return T.is("input")},loading:function(){return p.request&&"pending"==p.request.state()}},was:{cancelled:function(){return p.cancelled||!1},succesful:function(){return p.request&&"resolved"==p.request.state()},failure:function(){return p.request&&"rejected"==p.request.state()},complete:function(){return p.request&&("resolved"==p.request.state()||"rejected"==p.request.state())}},add:{urlData:function(t,n){var o,a;return t&&(o=t.match(v.regExp.required),a=t.match(v.regExp.optional),n=n||v.urlData,o&&(p.debug("Looking for required URL variables",o),e.each(o,function(o,a){var r=-1!==a.indexOf("$")?a.substr(2,a.length-3):a.substr(1,a.length-2),s=e.isPlainObject(n)&&n[r]!==i?n[r]:T.data(r)!==i?T.data(r):A.data(r)!==i?A.data(r):n[r];return s===i?(p.error(x.requiredParameter,r,t),t=!1,!1):(p.verbose("Found required variable",r,s),void(t=t.replace(a,s)))})),a&&(p.debug("Looking for optional URL variables",o),e.each(a,function(o,a){var r=-1!==a.indexOf("$")?a.substr(3,a.length-4):a.substr(2,a.length-3),s=e.isPlainObject(n)&&n[r]!==i?n[r]:T.data(r)!==i?T.data(r):A.data(r)!==i?A.data(r):n[r];s!==i?(p.verbose("Optional variable Found",r,s),t=t.replace(a,s)):(p.verbose("Optional variable not found",r),t=-1!==t.indexOf("/"+a)?t.replace("/"+a,""):t.replace(a,""))}))),t}},send:{request:function(){p.set.loading(),p.request=p.create.request(),p.xhr=p.create.xhr(),v.onRequest.call(R,p.request,p.xhr)}},event:{trigger:function(e){p.query(),("submit"==e.type||"click"==e.type)&&e.preventDefault()},xhr:{always:function(){},done:function(e){var t=this,n=(new Date).getTime()-g,i=v.loadingDuration-n;i=i>0?i:0,setTimeout(function(){p.request.resolveWith(t,[e])},i)},fail:function(e,t,n){var o=this,a=(new Date).getTime()-g,r=v.loadingDuration-a;r=r>0?r:0,setTimeout(function(){e.readyState!==i&&0===e.readyState?p.request.rejectWith(o,[e,"aborted",n]):p.request.rejectWith(o,[e,t,n])},r)}},request:{complete:function(e){p.remove.loading(),v.onComplete.call(R,e,T)},done:function(t){var n=e.isFunction(v.onResponse)?v.onResponse.call(R,e.extend(!0,{},t)):!1;p.debug("API Response Received",t),"local"===v.cache&&m&&(p.write.cachedResponse(m,t),p.debug("Adding url to local cache",p.cache)),n&&(p.debug("Modified API response in onResponse callback",v.onResponse,n,t),t=n),"json"==v.dataType&&e.isFunction(v.successTest)?(p.debug("Checking JSON returned success",v.successTest,t),v.successTest(t)?v.onSuccess.call(R,t,T):(p.debug("JSON test specified by user and response failed",t),v.onFailure.call(R,t,T))):v.onSuccess.call(R,t,T)},fail:function(n,o,a){var r,s=v.error[o]!==i?v.error[o]:a;if("aborted"==o)return p.debug("Request Aborted (Most likely caused by page navigation or CORS Policy)",o,a),p.reset(),void v.onAbort.call(R,o,T);if(n!==i){if(200!=n.status&&a!==i&&""!==a)p.error(x.statusMessage+a,t.url);else if("error"==o&&"json"==v.dataType)try{r=e.parseJSON(n.responseText),r&&r.error!==i&&(s=r.error)}catch(c){p.error(x.JSONParse)}p.remove.loading(),v.errorDuration!==!1&&(p.set.error(),setTimeout(p.remove.error,v.errorDuration)),p.debug("API Request error:",s),v.onError.call(R,s,T)}}}},create:{cache:function(){p.verbose("Creating local response cache"),p.cache={response:{}}},request:function(){return e.Deferred().always(p.event.request.complete).done(p.event.request.done).fail(p.event.request.fail)},xhr:function(){var n;return p.is.mocked()?void(v.mockResponse?e.isFunction(v.mockResponse)?(p.debug("Using sync mocked response callback",v.mockResponse),p.request.resolveWith(R,[v.mockResponse.call(R,v)])):(p.debug("Using mocked response",v.mockResponse),p.request.resolveWith(R,[v.mockResponse])):e.isFunction(v.mockResponseAsync)&&(n=function(e){p.verbose("Async callback returned response",e),p.request.resolveWith(R,[e])},p.debug("Using async mocked response",v.mockResponseAsync),v.mockResponseAsync.call(R,v,n))):e.ajax(t).always(p.event.xhr.always).done(p.event.xhr.done).fail(p.event.xhr.fail)}},set:{error:function(){p.verbose("Adding error state to element",A),A.addClass(C.error)},loading:function(){p.verbose("Adding loading state to element",A),A.addClass(C.loading),g=(new Date).getTime()}},remove:{error:function(){p.verbose("Removing error state from element",A),A.removeClass(C.error)},loading:function(){p.verbose("Removing loading state from element",A),A.removeClass(C.loading)}},get:{request:function(){return p.request||!1},xhr:function(){return p.xhr||!1},settings:function(){var e;return e=v.beforeSend.call(R,v),e&&(e.success!==i&&(p.debug("Legacy success callback detected",e),p.error(x.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==i&&(p.debug("Legacy failure callback detected",e),p.error(x.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==i&&(p.debug("Legacy complete callback detected",e),p.error(x.legacyParameters,e.complete),e.onComplete=e.complete)),e===i&&p.error(x.noReturnedValue),e!==i?e:v},defaultData:function(){var t={};return e.isWindow(P)||(p.is.input()?t.value=T.val():p.is.form()&&(t.text=T.text())),t},event:function(){return e.isWindow(P)||"now"==v.on?(p.debug("API called without element, no events attached"),!1):"auto"==v.on?T.is("input")?P.oninput!==i?"input":P.onpropertychange!==i?"propertychange":"keyup":T.is("form")?"submit":"click":v.on},formData:function(){var e;return T.serializeObject!==i?e=S.serializeObject():(p.error(x.missingSerialize),e=S.serialize()),p.debug("Retrieved form data",e),e},templateURL:function(e){var t;return e=e||T.data(b.action)||v.action||!1,e&&(p.debug("Looking up url for action",e,v.api),v.api[e]!==i?(t=v.api[e],p.debug("Found template url",t)):p.is.form()||p.is.mocked()||p.error(x.missingAction,v.action,v.api)),t}},abort:function(){var e=p.get.xhr();e&&"resolved"!==e.state()&&(p.debug("Cancelling API request"),e.abort())},reset:function(){p.remove.error(),p.remove.loading()},setting:function(t,n){if(p.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,p,t);else{if(n===i)return p[t];p[t]=n}},debug:function(){v.debug&&(v.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,v.name+":"),p.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),p.verbose.apply(console,arguments)))},error:function(){p.error=Function.prototype.bind.call(console.error,console,v.name+":"),p.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(p.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=E;return n=n||d,a=P||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(p.error(x.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(E===i&&p.initialize(),p.invoke(l)):(E!==i&&E.invoke("destroy"),p.initialize())}),o!==i?o:this},e.api.settings={name:"API",namespace:"api",debug:!0,verbose:!1,performance:!0,cache:!0,interruptRequests:!0,on:"auto",filter:".disabled",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(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},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:"Required dependency jquery-serialize-object missing, using basic serialize",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",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:{form:"form"},metadata:{action:"action"}},e.api.settings.api={}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.state=function(t){var o,a=e(this),r=a.selector||"",s=("ontouchstart"in n.documentElement,(new Date).getTime()),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var n,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.state.settings,t):e.extend({},e.fn.state.settings),f=m.error,g=m.metadata,p=m.className,v=m.namespace,h=m.states,b=m.text,y="."+v,x=v+"-module",C=e(this),w=this,k=C.data(x);n={initialize:function(){n.verbose("Initializing module"),m.automatic&&n.add.defaults(),m.context&&""!==r?e(m.context).on(r,"mouseenter"+y,n.change.text).on(r,"mouseleave"+y,n.reset.text).on(r,"click"+y,n.toggle.state):C.on("mouseenter"+y,n.change.text).on("mouseleave"+y,n.reset.text).on("click"+y,n.toggle.state),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),k=n,C.data(x,n)},destroy:function(){n.verbose("Destroying previous module",k),C.off(y).removeData(x)},refresh:function(){n.verbose("Refreshing selector cache"),C=e(w)},add:{defaults:function(){var o=t&&e.isPlainObject(t.states)?t.states:{};e.each(m.defaults,function(t,a){n.is[t]!==i&&n.is[t]()&&(n.verbose("Adding default states",t,w),e.extend(m.states,a,o))})}},is:{active:function(){return C.hasClass(p.active)},loading:function(){return C.hasClass(p.loading)},inactive:function(){return!C.hasClass(p.active)},state:function(e){return p[e]===i?!1:C.hasClass(p[e])},enabled:function(){return!C.is(m.filter.active)},disabled:function(){return C.is(m.filter.active)},textEnabled:function(){return!C.is(m.filter.text)},button:function(){return C.is(".button:not(a, .submit)")},input:function(){return C.is("input")},progress:function(){return C.is(".ui.progress")}},allow:function(e){n.debug("Now allowing state",e),h[e]=!0},disallow:function(e){n.debug("No longer allowing",e),h[e]=!1},allows:function(e){return h[e]||!1},enable:function(){C.removeClass(p.disabled)},disable:function(){C.addClass(p.disabled)},setState:function(e){n.allows(e)&&C.addClass(p[e])},removeState:function(e){n.allows(e)&&C.removeClass(p[e])},toggle:{state:function(){var t,o;if(n.allows("active")&&n.is.enabled()){if(n.refresh(),e.fn.api!==i)if(t=C.api("get request"),o=C.api("was cancelled"))n.debug("API Request cancelled by beforesend"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1};else if(t)return void n.listenTo(t);n.change.state()}}},listenTo:function(t){n.debug("API request detected, waiting for state signal",t),t&&(b.loading&&n.update.text(b.loading),e.when(t).then(function(){"resolved"==t.state()?(n.debug("API request succeeded"),m.activateTest=function(){return!0},m.deactivateTest=function(){return!0}):(n.debug("API request failed"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1}),n.change.state()}))},change:{state:function(){n.debug("Determining state change direction"),n.is.inactive()?n.activate():n.deactivate(),m.sync&&n.sync(),m.onChange.call(w)},text:function(){n.is.textEnabled()&&(n.is.disabled()?(n.verbose("Changing text to disabled text",b.hover),n.update.text(b.disabled)):n.is.active()?b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.deactivate&&(n.verbose("Changing text to deactivating text",b.deactivate),n.update.text(b.deactivate)):b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.activate&&(n.verbose("Changing text to activating text",b.activate),n.update.text(b.activate)))}},activate:function(){m.activateTest.call(w)&&(n.debug("Setting state to active"),C.addClass(p.active),n.update.text(b.active),m.onActivate.call(w))},deactivate:function(){m.deactivateTest.call(w)&&(n.debug("Setting state to inactive"),C.removeClass(p.active),n.update.text(b.inactive),m.onDeactivate.call(w))},sync:function(){n.verbose("Syncing other buttons to current state"),a.not(C).state(n.is.active()?"activate":"deactivate")},get:{text:function(){return m.selector.text?C.find(m.selector.text).text():C.html()},textFor:function(e){return b[e]||!1}},flash:{text:function(e,t,i){var o=n.get.text();n.debug("Flashing text message",e,t),e=e||m.text.flash,t=t||m.flashDuration,i=i||function(){},n.update.text(e),setTimeout(function(){n.update.text(o),i.call(w)},t)}},reset:{text:function(){var e=b.active||C.data(g.storedText),t=b.inactive||C.data(g.storedText);n.is.textEnabled()&&(n.is.active()&&e?(n.verbose("Resetting active text",e),n.update.text(e)):t&&(n.verbose("Resetting inactive text",e),n.update.text(t)))}},update:{text:function(e){var t=n.get.text();e&&e!==t?(n.debug("Updating text",e),m.selector.text?C.data(g.storedText,e).find(m.selector.text).text(e):C.data(g.storedText,e).html(e)):n.debug("Text is already set, ignoring update",e)}},setting:function(t,o){if(n.debug("Changing setting",t,o),e.isPlainObject(t))e.extend(!0,m,t);else{if(o===i)return m[t];m[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,n,t);else{if(o===i)return n[t];n[t]=o}},debug:function(){m.debug&&(m.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,m.name+":"),n.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,m.name+":"),n.error.apply(console,arguments)},performance:{log:function(e){var t,i,o;m.performance&&(t=(new Date).getTime(),o=s||t,i=t-o,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":i})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var t=m.name+":",o=0;s=!1,clearTimeout(n.performance.timer),e.each(c,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,a,r){var s,c,l,u=k;return a=a||d,r=w||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(o,a){var r=o!=s?a+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;
if(e.isPlainObject(u[r])&&o!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[a])||o==s)return u[a]!==i?(c=u[a],!1):(n.error(f.method,t),!1);u=u[a]}})),e.isFunction(c)?l=c.apply(r,a):c!==i&&(l=c),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),c}},u?(k===i&&n.initialize(),n.invoke(l)):(k!==i&&k.invoke("destroy"),n.initialize())}),o!==i?o:this},e.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(e,t,n,i){"use strict";e.fn.visibility=function(o){var a,r=e(this),s=r.selector||"",c=(new Date).getTime(),l=[],u=arguments[0],d="string"==typeof u,m=[].slice.call(arguments,1);return r.each(function(){var r,f,g,p=e.isPlainObject(o)?e.extend(!0,{},e.fn.visibility.settings,o):e.extend({},e.fn.visibility.settings),v=p.className,h=p.namespace,b=p.error,y=p.metadata,x="."+h,C="module-"+h,w=e(t),k=e(this),T=e(p.context),S=(k.selector||"",k.data(C)),A=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},P=this;g={initialize:function(){g.debug("Initializing",p),g.setup.cache(),g.should.trackChanges()&&("image"==p.type&&g.setup.image(),"fixed"==p.type&&g.setup.fixed(),p.observeChanges&&g.observeChanges(),g.bind.events()),g.save.position(),g.is.visible()||g.error(b.visible,k),p.initialCheck&&g.checkVisibility(),g.instantiate()},instantiate:function(){g.debug("Storing instance",g),k.data(C,g),S=g},destroy:function(){g.verbose("Destroying previous module"),f&&f.disconnect(),w.off("load"+x,g.event.load).off("resize"+x,g.event.resize),T.off("scrollchange"+x,g.event.scrollchange),k.off(x).removeData(C)},observeChanges:function(){T[0];"MutationObserver"in t&&(f=new MutationObserver(function(e){g.verbose("DOM tree modified, updating visibility calculations"),g.timer=setTimeout(function(){g.verbose("DOM tree modified, updating sticky menu"),g.refresh()},100)}),f.observe(P,{childList:!0,subtree:!0}),g.debug("Setting up mutation observer",f))},bind:{events:function(){g.verbose("Binding visibility events to scroll and resize"),p.refreshOnLoad&&w.on("load"+x,g.event.load),w.on("resize"+x,g.event.resize),T.off("scroll"+x).on("scroll"+x,g.event.scroll).on("scrollchange"+x,g.event.scrollchange)}},event:{resize:function(){g.debug("Window resized"),A(g.refresh)},load:function(){g.debug("Page finished loading"),A(g.refresh)},scroll:function(){p.throttle?(clearTimeout(g.timer),g.timer=setTimeout(function(){T.triggerHandler("scrollchange"+x,[T.scrollTop()])},p.throttle)):A(function(){T.triggerHandler("scrollchange"+x,[T.scrollTop()])})},scrollchange:function(e,t){g.checkVisibility(t)}},precache:function(t,i){t instanceof Array||(t=[t]);for(var o=t.length,a=0,r=[],s=n.createElement("img"),c=function(){a++,a>=t.length&&e.isFunction(i)&&i()};o--;)s=n.createElement("img"),s.onload=c,s.onerror=c,s.src=t[o],r.push(s)},should:{trackChanges:function(){return d?(g.debug("One time query, no need to bind events"),!1):(g.debug("Callbacks being attached"),!0)}},setup:{cache:function(){g.cache={occurred:{},screen:{},element:{}}},image:function(){var e=k.data(y.src);e&&(g.verbose("Lazy loading image",e),p.once=!0,p.observeChanges=!1,p.onOnScreen=function(){g.debug("Image on screen",P),g.precache(e,function(){g.set.image(e)})})},fixed:function(){g.debug("Setting up fixed"),p.once=!1,p.observeChanges=!1,p.initialCheck=!0,p.refreshOnLoad=!0,o.transition||(p.transition=!1),g.create.placeholder(),g.debug("Added placeholder",r),p.onTopPassed=function(){g.debug("Element passed, adding fixed position",k),g.show.placeholder(),g.set.fixed(),p.transition&&e.fn.transition!==i&&k.transition(p.transition,p.duration)},p.onTopPassedReverse=function(){g.debug("Element returned to position, removing fixed",k),g.hide.placeholder(),g.remove.fixed()}}},create:{placeholder:function(){g.verbose("Creating fixed position placeholder"),r=k.clone(!1).css("display","none").addClass(v.placeholder).insertAfter(k)}},show:{placeholder:function(){g.verbose("Showing placeholder"),r.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){g.verbose("Hiding placeholder"),r.css("display","none").css("visibility","")}},set:{fixed:function(){g.verbose("Setting element to fixed position"),k.addClass(v.fixed).css({position:"fixed",top:p.offset+"px",left:"auto",zIndex:"1"})},image:function(t){k.attr("src",t),p.transition?e.fn.transition!==i?k.transition(p.transition,p.duration):k.fadeIn(p.duration):k.show()}},is:{onScreen:function(){var e=g.get.elementCalculations();return e.onScreen},offScreen:function(){var e=g.get.elementCalculations();return e.offScreen},visible:function(){return g.cache&&g.cache.element?!(0===g.cache.element.width&&0===g.cache.element.offset.top):!1}},refresh:function(){g.debug("Refreshing constants (width/height)"),"fixed"==p.type&&(g.remove.fixed(),g.remove.occurred()),g.reset(),g.save.position(),g.checkVisibility(),p.onRefresh.call(P)},reset:function(){g.verbose("Reseting all cached values"),e.isPlainObject(g.cache)&&(g.cache.screen={},g.cache.element={})},checkVisibility:function(e){g.verbose("Checking visibility of element",g.cache.element),g.is.visible()&&(g.save.scroll(e),g.save.calculations(),g.passed(),g.passingReverse(),g.topVisibleReverse(),g.bottomVisibleReverse(),g.topPassedReverse(),g.bottomPassedReverse(),g.onScreen(),g.offScreen(),g.passing(),g.topVisible(),g.bottomVisible(),g.topPassed(),g.bottomPassed(),p.onUpdate&&p.onUpdate.call(P,g.get.elementCalculations()))},passed:function(t,n){var o=g.get.elementCalculations();if(t&&n)p.onPassed[t]=n;else{if(t!==i)return g.get.pixelsPassed(t)>o.pixelsPassed;o.passing&&e.each(p.onPassed,function(e,t){o.bottomVisible||o.pixelsPassed>g.get.pixelsPassed(e)?g.execute(t,e):p.once||g.remove.occurred(t)})}},onScreen:function(e){var t=g.get.elementCalculations(),n=e||p.onOnScreen,o="onScreen";return e&&(g.debug("Adding callback for onScreen",e),p.onOnScreen=e),t.onScreen?g.execute(n,o):p.once||g.remove.occurred(o),e!==i?t.onOnScreen:void 0},offScreen:function(e){var t=g.get.elementCalculations(),n=e||p.onOffScreen,o="offScreen";return e&&(g.debug("Adding callback for offScreen",e),p.onOffScreen=e),t.offScreen?g.execute(n,o):p.once||g.remove.occurred(o),e!==i?t.onOffScreen:void 0},passing:function(e){var t=g.get.elementCalculations(),n=e||p.onPassing,o="passing";return e&&(g.debug("Adding callback for passing",e),p.onPassing=e),t.passing?g.execute(n,o):p.once||g.remove.occurred(o),e!==i?t.passing:void 0},topVisible:function(e){var t=g.get.elementCalculations(),n=e||p.onTopVisible,o="topVisible";return e&&(g.debug("Adding callback for top visible",e),p.onTopVisible=e),t.topVisible?g.execute(n,o):p.once||g.remove.occurred(o),e===i?t.topVisible:void 0},bottomVisible:function(e){var t=g.get.elementCalculations(),n=e||p.onBottomVisible,o="bottomVisible";return e&&(g.debug("Adding callback for bottom visible",e),p.onBottomVisible=e),t.bottomVisible?g.execute(n,o):p.once||g.remove.occurred(o),e===i?t.bottomVisible:void 0},topPassed:function(e){var t=g.get.elementCalculations(),n=e||p.onTopPassed,o="topPassed";return e&&(g.debug("Adding callback for top passed",e),p.onTopPassed=e),t.topPassed?g.execute(n,o):p.once||g.remove.occurred(o),e===i?t.topPassed:void 0},bottomPassed:function(e){var t=g.get.elementCalculations(),n=e||p.onBottomPassed,o="bottomPassed";return e&&(g.debug("Adding callback for bottom passed",e),p.onBottomPassed=e),t.bottomPassed?g.execute(n,o):p.once||g.remove.occurred(o),e===i?t.bottomPassed:void 0},passingReverse:function(e){var t=g.get.elementCalculations(),n=e||p.onPassingReverse,o="passingReverse";return e&&(g.debug("Adding callback for passing reverse",e),p.onPassingReverse=e),t.passing?p.once||g.remove.occurred(o):g.get.occurred("passing")&&g.execute(n,o),e!==i?!t.passing:void 0},topVisibleReverse:function(e){var t=g.get.elementCalculations(),n=e||p.onTopVisibleReverse,o="topVisibleReverse";return e&&(g.debug("Adding callback for top visible reverse",e),p.onTopVisibleReverse=e),t.topVisible?p.once||g.remove.occurred(o):g.get.occurred("topVisible")&&g.execute(n,o),e===i?!t.topVisible:void 0},bottomVisibleReverse:function(e){var t=g.get.elementCalculations(),n=e||p.onBottomVisibleReverse,o="bottomVisibleReverse";return e&&(g.debug("Adding callback for bottom visible reverse",e),p.onBottomVisibleReverse=e),t.bottomVisible?p.once||g.remove.occurred(o):g.get.occurred("bottomVisible")&&g.execute(n,o),e===i?!t.bottomVisible:void 0},topPassedReverse:function(e){var t=g.get.elementCalculations(),n=e||p.onTopPassedReverse,o="topPassedReverse";return e&&(g.debug("Adding callback for top passed reverse",e),p.onTopPassedReverse=e),t.topPassed?p.once||g.remove.occurred(o):g.get.occurred("topPassed")&&g.execute(n,o),e===i?!t.onTopPassed:void 0},bottomPassedReverse:function(e){var t=g.get.elementCalculations(),n=e||p.onBottomPassedReverse,o="bottomPassedReverse";return e&&(g.debug("Adding callback for bottom passed reverse",e),p.onBottomPassedReverse=e),t.bottomPassed?p.once||g.remove.occurred(o):g.get.occurred("bottomPassed")&&g.execute(n,o),e===i?!t.bottomPassed:void 0},execute:function(e,t){var n=g.get.elementCalculations(),i=g.get.screenCalculations();e=e||!1,e&&(p.continuous?(g.debug("Callback being called continuously",t,n),e.call(P,n,i)):g.get.occurred(t)||(g.debug("Conditions met",t,n),e.call(P,n,i))),g.save.occurred(t)},remove:{fixed:function(){g.debug("Removing fixed position"),k.removeClass(v.fixed).css({position:"",top:"",left:"",zIndex:""})},occurred:function(e){if(e){var t=g.cache.occurred;t[e]!==i&&t[e]===!0&&(g.debug("Callback can now be called again",e),g.cache.occurred[e]=!1)}else g.cache.occurred={}}},save:{calculations:function(){g.verbose("Saving all calculations necessary to determine positioning"),g.save.direction(),g.save.screenCalculations(),g.save.elementCalculations()},occurred:function(e){e&&(g.cache.occurred[e]===i||g.cache.occurred[e]!==!0)&&(g.verbose("Saving callback occurred",e),g.cache.occurred[e]=!0)},scroll:function(e){e=e+p.offset||T.scrollTop()+p.offset,g.cache.scroll=e},direction:function(){var e,t=g.get.scroll(),n=g.get.lastScroll();return e=t>n&&n?"down":n>t&&n?"up":"static",g.cache.direction=e,g.cache.direction},elementPosition:function(){var e=g.cache.element,t=g.get.screenSize();return g.verbose("Saving element position"),e.fits=e.height=t.top,t.topPassed=e.top>=t.top,t.bottomVisible=e.bottom>=t.bottom,t.bottomPassed=e.top>=t.bottom,t.pixelsPassed=0,t.percentagePassed=0,t.onScreen=t.topVisible&&!t.bottomPassed,t.passing=t.topPassed&&!t.bottomPassed,t.offScreen=!t.onScreen,t.passing&&(t.pixelsPassed=e.top-t.top,t.percentagePassed=(e.top-t.top)/t.height),g.cache.element=t,g.verbose("Updated element calculations",t),t},screenCalculations:function(){var e=g.get.scroll();return g.save.direction(),g.cache.screen.top=e,g.cache.screen.bottom=e+g.cache.screen.height,g.cache.screen},screenSize:function(){g.verbose("Saving window position"),g.cache.screen={height:T.height()}},position:function(){g.save.screenSize(),g.save.elementPosition()}},get:{pixelsPassed:function(e){var t=g.get.elementCalculations();return e.search("%")>-1?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return g.cache.occurred!==i?g.cache.occurred[e]||!1:!1},direction:function(){return g.cache.direction===i&&g.save.direction(),g.cache.direction},elementPosition:function(){return g.cache.element===i&&g.save.elementPosition(),g.cache.element},elementCalculations:function(){return g.cache.element===i&&g.save.elementCalculations(),g.cache.element},screenCalculations:function(){return g.cache.screen===i&&g.save.screenCalculations(),g.cache.screen},screenSize:function(){return g.cache.screen===i&&g.save.screenSize(),g.cache.screen},scroll:function(){return g.cache.scroll===i&&g.save.scroll(),g.cache.scroll},lastScroll:function(){return g.cache.screen===i?(g.debug("First scroll event, no last scroll could be found"),!1):g.cache.screen.top}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,p,t);else{if(n===i)return p[t];p[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},debug:function(){p.debug&&(p.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,p.name+":"),g.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,p.name+":"),g.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;p.performance&&(t=(new Date).getTime(),i=c||t,n=t-i,c=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=p.name+":",n=0;c=!1,clearTimeout(g.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var r,s,c,l=S;return n=n||m,o=P||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(g.error(b.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},d?(S===i&&g.initialize(),S.save.scroll(),S.save.calculations(),g.invoke(u)):(S!==i&&S.invoke("destroy"),g.initialize())}),a!==i?a:this},e.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:{},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);