!function(a,b,c,d){a.site=a.fn.site=function(e){var f,g,h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=a.isPlainObject(e)?a.extend(!0,{},a.site.settings,e):a.extend({},a.site.settings),n=m.namespace,o=m.error,p="module-"+n,q=a(c),r=q,s=this,t=r.data(p);return f={initialize:function(){f.instantiate()},instantiate:function(){f.verbose("Storing instance of site",f),t=f,r.data(p,f)},normalize:function(){f.fix.console(),f.fix.requestAnimationFrame()},fix:{console:function(){f.debug("Normalizing window.console"),console!==d&&console.log!==d||(f.verbose("Console not available, normalizing events"),f.disable.console()),"undefined"!=typeof console.group&&"undefined"!=typeof console.groupEnd&&"undefined"!=typeof console.groupCollapsed||(f.verbose("Console group not available, normalizing events"),b.console.group=function(){},b.console.groupEnd=function(){},b.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(f.verbose("Mark timeline not available, normalizing events"),b.console.markTimeline=function(){})},consoleClear:function(){f.debug("Disabling programmatic console clearing"),b.console.clear=function(){}},requestAnimationFrame:function(){f.debug("Normalizing requestAnimationFrame"),b.requestAnimationFrame===d&&(f.debug("RequestAnimationFrame not available, normalizing event"),b.requestAnimationFrame=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)})}},moduleExists:function(b){return a.fn[b]!==d&&a.fn[b].settings!==d},enabled:{modules:function(b){var c=[];return b=b||m.modules,a.each(b,function(a,b){f.moduleExists(b)&&c.push(b)}),c}},disabled:{modules:function(b){var c=[];return b=b||m.modules,a.each(b,function(a,b){f.moduleExists(b)||c.push(b)}),c}},change:{setting:function(b,c,e,g){e="string"==typeof e?"all"===e?m.modules:[e]:e||m.modules,g=g===d||g,a.each(e,function(d,e){var h,i=!f.moduleExists(e)||a.fn[e].settings.namespace||!1;f.moduleExists(e)&&(f.verbose("Changing default setting",b,c,e),a.fn[e].settings[b]=c,g&&i&&(h=a(":data(module-"+i+")"),h.length>0&&(f.verbose("Modifying existing settings",h),h[e]("setting",b,c))))})},settings:function(b,c,e){c="string"==typeof c?[c]:c||m.modules,e=e===d||e,a.each(c,function(c,d){var g;f.moduleExists(d)&&(f.verbose("Changing default setting",b,d),a.extend(!0,a.fn[d].settings,b),e&&n&&(g=a(":data(module-"+n+")"),g.length>0&&(f.verbose("Modifying existing settings",g),g[d]("setting",b))))})}},enable:{console:function(){f.console(!0)},debug:function(a,b){a=a||m.modules,f.debug("Enabling debug for modules",a),f.change.setting("debug",!0,a,b)},verbose:function(a,b){a=a||m.modules,f.debug("Enabling verbose debug for modules",a),f.change.setting("verbose",!0,a,b)}},disable:{console:function(){f.console(!1)},debug:function(a,b){a=a||m.modules,f.debug("Disabling debug for modules",a),f.change.setting("debug",!1,a,b)},verbose:function(a,b){a=a||m.modules,f.debug("Disabling verbose debug for modules",a),f.change.setting("verbose",!1,a,b)}},console:function(a){if(a){if(t.cache.console===d)return void f.error(o.console);f.debug("Restoring console function"),b.console=t.cache.console}else f.debug("Disabling console function"),t.cache.console=b.console,b.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){f.verbose("Destroying previous site for",r),r.removeData(p)},cache:{},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];m[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,f,b);else{if(c===d)return f[b];f[b]=c}},debug:function(){m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;m.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:s,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var b=m.name+":",c=0;h=!1,clearTimeout(f.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,e){var h,i,j,k=t;return c=c||l,e=s||e,"string"==typeof b&&k!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,e){var g=c!=h?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(k[g])&&c!=h)k=k[g];else{if(k[g]!==d)return i=k[g],!1;if(!a.isPlainObject(k[e])||c==h)return k[e]!==d?(i=k[e],!1):(f.error(o.method,b),!1);k=k[e]}})),a.isFunction(i)?j=i.apply(e,c):i!==d&&(j=i),a.isArray(g)?g.push(j):g!==d?g=[g,j]:j!==d&&(g=j),i}},k?(t===d&&f.initialize(),f.invoke(j)):(t!==d&&f.destroy(),f.initialize()),g!==d?g:this},a.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])}})}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.form=function(b){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k=arguments[1],l="string"==typeof j,m=[].slice.call(arguments,1);return f.each(function(){var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a(this),G=this,H=[],I=!1;E={initialize:function(){E.get.settings(),l?(D===d&&E.instantiate(),E.invoke(j)):(D!==d&&D.invoke("destroy"),E.verbose("Initializing form validation",F,u),E.bindEvents(),E.set.defaults(),E.instantiate())},instantiate:function(){E.verbose("Storing instance of module",E),D=E,F.data(B,E)},destroy:function(){E.verbose("Destroying previous module",D),E.removeEvents(),F.removeData(B)},refresh:function(){E.verbose("Refreshing selector cache"),n=F.find(x.field),o=F.find(x.group),p=F.find(x.message),q=F.find(x.prompt),r=F.find(x.submit),s=F.find(x.clear),t=F.find(x.reset)},submit:function(){E.verbose("Submitting form",F),F.submit()},attachEvents:function(b,c){c=c||"submit",a(b).on("click"+C,function(a){E[c](),a.preventDefault()})},bindEvents:function(){E.verbose("Attaching form events"),F.on("submit"+C,E.validate.form).on("blur"+C,x.field,E.event.field.blur).on("click"+C,x.submit,E.submit).on("click"+C,x.reset,E.reset).on("click"+C,x.clear,E.clear),u.keyboardShortcuts&&F.on("keydown"+C,x.field,E.event.field.keydown),n.each(function(){var b=a(this),c=b.prop("type"),d=E.get.changeEvent(c,b);a(this).on(d+C,E.event.field.change)})},clear:function(){n.each(function(){var b=a(this),c=b.parent(),d=b.closest(o),e=d.find(x.prompt),f=b.data(w.defaultValue)||"",g=c.is(x.uiCheckbox),h=c.is(x.uiDropdown),i=d.hasClass(y.error);i&&(E.verbose("Resetting error on field",d),d.removeClass(y.error),e.remove()),h?(E.verbose("Resetting dropdown value",c,f),c.dropdown("clear")):g?b.prop("checked",!1):(E.verbose("Resetting field value",b,f),b.val(""))})},reset:function(){n.each(function(){var b=a(this),c=b.parent(),e=b.closest(o),f=e.find(x.prompt),g=b.data(w.defaultValue),h=c.is(x.uiCheckbox),i=c.is(x.uiDropdown),j=e.hasClass(y.error);g!==d&&(j&&(E.verbose("Resetting error on field",e),e.removeClass(y.error),f.remove()),i?(E.verbose("Resetting dropdown value",c,g),c.dropdown("restore defaults")):h?(E.verbose("Resetting checkbox value",c,g),b.prop("checked",g)):(E.verbose("Resetting field value",b,g),b.val(g)))})},is:{bracketedRule:function(a){return a.type&&a.type.match(u.regExp.bracket)},empty:function(a){return!a||0===a.length||(a.is('input[type="checkbox"]')?!a.is(":checked"):E.is.blank(a))},blank:function(b){return""===a.trim(b.val())},valid:function(){var b=!0;return E.verbose("Checking if form is valid"),a.each(v,function(a,c){E.validate.field(c,a)||(b=!1)}),b}},removeEvents:function(){F.off(C),n.off(C),r.off(C),n.off(C)},event:{field:{keydown:function(b){var c=a(this),d=b.which,e=c.is(x.input),f=c.is(x.checkbox),g=c.closest(x.uiDropdown).length>0,h={enter:13,escape:27};d==h.escape&&(E.verbose("Escape key pressed blurring field"),c.blur()),b.ctrlKey||d!=h.enter||!e||g||f||(I||(c.one("keyup"+C,E.event.field.keyup),E.submit(),E.debug("Enter pressed on input submitting form")),I=!0)},keyup:function(){I=!1},blur:function(b){var c=a(this),d=c.closest(o),e=E.get.validation(c);d.hasClass(y.error)?(E.debug("Revalidating field",c,e),e&&E.validate.field(e)):"blur"!=u.on&&"change"!=u.on||e&&E.validate.field(e)},change:function(b){var c=a(this),d=c.closest(o),e=E.get.validation(c);("change"==u.on||d.hasClass(y.error)&&u.revalidate)&&(clearTimeout(E.timer),E.timer=setTimeout(function(){E.debug("Revalidating field",c,E.get.validation(c)),E.validate.field(e)},u.delay))}}},get:{ancillaryValue:function(a){return!(!a.type||!a.value&&!E.is.bracketedRule(a))&&(a.value!==d?a.value:a.type.match(u.regExp.bracket)[1]+"")},ruleName:function(a){return E.is.bracketedRule(a)?a.type.replace(a.type.match(u.regExp.bracket)[0],""):a.type},changeEvent:function(a,b){return"checkbox"==a||"radio"==a||"hidden"==a||b.is("select")?"change":E.get.inputEvent()},inputEvent:function(){return c.createElement("input").oninput!==d?"input":c.createElement("input").onpropertychange!==d?"propertychange":"keyup"},prompt:function(a,b){var c,d,e,f=E.get.ruleName(a),g=E.get.ancillaryValue(a),h=a.prompt||u.prompt[f]||u.text.unspecifiedRule,i=h.search("{value}")!==-1,j=h.search("{name}")!==-1;return(j||i)&&(d=E.get.field(b.identifier)),i&&(h=h.replace("{value}",d.val())),j&&(c=d.closest(x.group).find("label").eq(0),e=1==c.length?c.text():d.prop("placeholder")||u.text.unspecifiedField,h=h.replace("{name}",e)),h=h.replace("{identifier}",b.identifier),h=h.replace("{ruleValue}",g),a.prompt||E.verbose("Using default validation prompt for type",h,f),h},settings:function(){if(a.isPlainObject(b)){var c,e=Object.keys(b),f=e.length>0&&b[e[0]].identifier!==d&&b[e[0]].rules!==d;f?(u=a.extend(!0,{},a.fn.form.settings,k),v=a.extend({},a.fn.form.settings.defaults,b),E.error(u.error.oldSyntax,G),E.verbose("Extending settings from legacy parameters",v,u)):(b.fields&&(c=Object.keys(b.fields),("string"==typeof b.fields[c[0]]||a.isArray(b.fields[c[0]]))&&a.each(b.fields,function(c,d){"string"==typeof d&&(d=[d]),b.fields[c]={rules:[]},a.each(d,function(a,d){b.fields[c].rules.push({type:d})})})),u=a.extend(!0,{},a.fn.form.settings,b),v=a.extend({},a.fn.form.settings.defaults,u.fields),E.verbose("Extending settings",v,u))}else u=a.fn.form.settings,v=a.fn.form.settings.defaults,E.verbose("Using default form validation",v,u);A=u.namespace,w=u.metadata,x=u.selector,y=u.className,z=u.error,B="module-"+A,C="."+A,D=F.data(B),E.refresh()},field:function(b){return E.verbose("Finding field with identifier",b),n.filter("#"+b).length>0?n.filter("#"+b):n.filter('[name="'+b+'"]').length>0?n.filter('[name="'+b+'"]'):n.filter('[name="'+b+'[]"]').length>0?n.filter('[name="'+b+'[]"]'):n.filter("[data-"+w.validate+'="'+b+'"]').length>0?n.filter("[data-"+w.validate+'="'+b+'"]'):a("")},fields:function(b){var c=a();return a.each(b,function(a,b){c=c.add(E.get.field(b))}),c},validation:function(b){var c,d;return!!v&&(a.each(v,function(a,e){d=e.identifier||a,E.get.field(d)[0]==b[0]&&(e.identifier=d,c=e)}),c||!1)},value:function(a){var b,c=[];return c.push(a),b=E.get.values.call(G,c),b[a]},values:function(b){var c=a.isArray(b)?E.get.fields(b):n,d={};return c.each(function(b,c){var e=a(c),f=(e.prop("type"),e.prop("name")),g=e.val(),h=e.is(x.checkbox),i=e.is(x.radio),j=f.indexOf("[]")!==-1,k=!!h&&e.is(":checked");f&&(j?(f=f.replace("[]",""),d[f]||(d[f]=[]),h?k?d[f].push(g||!0):d[f].push(!1):d[f].push(g)):i?k&&(d[f]=g):h?k?d[f]=g||!0:d[f]=!1:d[f]=g)}),d}},has:{field:function(a){return E.verbose("Checking for existence of a field with identifier",a),"string"!=typeof a&&E.error(z.identifier,a),n.filter("#"+a).length>0||n.filter('[name="'+a+'"]').length>0||n.filter("[data-"+w.validate+'="'+a+'"]').length>0}},add:{prompt:function(b,c){var e=E.get.field(b),f=e.closest(o),g=f.children(x.prompt),h=0!==g.length;c="string"==typeof c?[c]:c,E.verbose("Adding field error state",b),f.addClass(y.error),u.inline&&(h||(g=u.templates.prompt(c),g.appendTo(f)),g.html(c[0]),h?E.verbose("Inline errors are disabled, no inline error added",b):u.transition&&a.fn.transition!==d&&F.transition("is supported")?(E.verbose("Displaying error with css transition",u.transition),g.transition(u.transition+" in",u.duration)):(E.verbose("Displaying error with fallback javascript animation"),g.fadeIn(u.duration)))},errors:function(a){E.debug("Adding form error messages",a),E.set.error(),p.html(u.templates.error(a))}},remove:{prompt:function(b){var c=E.get.field(b),e=c.closest(o),f=e.children(x.prompt);e.removeClass(y.error),u.inline&&f.is(":visible")&&(E.verbose("Removing prompt for field",b),u.transition&&a.fn.transition!==d&&F.transition("is supported")?f.transition(u.transition+" out",u.duration,function(){f.remove()}):f.fadeOut(u.duration,function(){f.remove()}))}},set:{success:function(){F.removeClass(y.error).addClass(y.success)},defaults:function(){n.each(function(){var b=a(this),c=b.filter(x.checkbox).length>0,d=c?b.is(":checked"):b.val();b.data(w.defaultValue,d)})},error:function(){F.removeClass(y.success).addClass(y.error)},value:function(a,b){var c={};return c[a]=b,E.set.values.call(G,c)},values:function(b){a.isEmptyObject(b)||a.each(b,function(b,c){var d,e=E.get.field(b),f=e.parent(),g=a.isArray(c),h=f.is(x.uiCheckbox),i=f.is(x.uiDropdown),j=e.is(x.radio)&&h,k=e.length>0;k&&(g&&h?(E.verbose("Selecting multiple",c,e),f.checkbox("uncheck"),a.each(c,function(a,b){d=e.filter('[value="'+b+'"]'),f=d.parent(),d.length>0&&f.checkbox("check")})):j?(E.verbose("Selecting radio value",c,e),e.filter('[value="'+c+'"]').parent(x.uiCheckbox).checkbox("check")):h?(E.verbose("Setting checkbox value",c,f),c===!0?f.checkbox("check"):f.checkbox("uncheck")):i?(E.verbose("Setting dropdown value",c,f),f.dropdown("set selected",c)):(E.verbose("Setting field value",c,e),e.val(c)))})}},validate:{form:function(a,b){var c=E.get.values();if(I)return!1;if(H=[],E.is.valid()){if(E.debug("Form has no validation errors, submitting"),E.set.success(),b!==!0)return u.onSuccess.call(G,a,c)}else if(E.debug("Form has errors"),E.set.error(),u.inline||E.add.errors(H),F.data("moduleApi")!==d&&a.stopImmediatePropagation(),b!==!0)return u.onFailure.call(G,H,c)},field:function(b,c){var e=b.identifier||c,f=E.get.field(e),g=!!b.depends&&E.get.field(b.depends),h=!0,i=[];return b.identifier||(E.debug("Using field name as identifier",e),b.identifier=e),f.prop("disabled")?(E.debug("Field is disabled. Skipping",e),h=!0):b.optional&&E.is.blank(f)?(E.debug("Field is optional and blank. Skipping",e),h=!0):b.depends&&E.is.empty(g)?(E.debug("Field depends on another value that is not present or empty. Skipping",g),h=!0):b.rules!==d&&a.each(b.rules,function(a,c){E.has.field(e)&&!E.validate.rule(b,c)&&(E.debug("Field is invalid",e,c.type),i.push(E.get.prompt(c,b)),h=!1)}),h?(E.remove.prompt(e,i),u.onValid.call(f),!0):(H=H.concat(i),E.add.prompt(e,i),u.onInvalid.call(f,i),!1)},rule:function(b,c){var e=E.get.field(b.identifier),f=(c.type,e.val()),g=E.get.ancillaryValue(c),h=E.get.ruleName(c),i=u.rules[h];return a.isFunction(i)?(f=f===d||""===f||null===f?"":a.trim(f+""),i.call(e,f,g)):void E.error(z.noRule,h)}},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,u,b);else{if(c===d)return u[b];u[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,E,b);else{if(c===d)return E[b];E[b]=c}},debug:function(){!u.silent&&u.debug&&(u.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,u.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),E.verbose.apply(console,arguments)))},error:function(){u.silent||(E.error=Function.prototype.bind.call(console.error,console,u.name+":"),E.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;u.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:G,"Execution Time":c})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var b=u.name+":",c=0;h=!1,clearTimeout(E.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.length>1&&(b+=" ("+f.length+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=D;return c=c||m,f=G||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d&&(h=j[e],!1);j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},E.initialize()}),e!==d?e:this},a.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,decimal:/^\d*(\.)\d+/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} cannot contain "{ruleValue}"',containExactly:'{name} cannot contain exactly "{ruleValue}"',doesntContain:'{name} must contain "{ruleValue}"',doesntContainExactly:'{name} must contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(b){var c='",a(c)},prompt:function(b){return a("
").addClass("ui basic red pointing prompt label").html(b[0])}},rules:{empty:function(b){return!(b===d||""===b||a.isArray(b)&&0===b.length)},checked:function(){return a(this).filter(":checked").length>0},email:function(b){return a.fn.form.settings.regExp.email.test(b)},url:function(b){return a.fn.form.settings.regExp.url.test(b)},regExp:function(b,c){if(c instanceof RegExp)return b.match(c);var d,e=c.match(a.fn.form.settings.regExp.flags);return e&&(c=e.length>=2?e[1]:c,d=e.length>=3?e[2]:""),b.match(new RegExp(c,d))},integer:function(b,c){var e,f,g,h=a.fn.form.settings.regExp.integer;return c&&["",".."].indexOf(c)===-1&&(c.indexOf("..")==-1?h.test(c)&&(e=f=c-0):(g=c.split("..",2),h.test(g[0])&&(e=g[0]-0),h.test(g[1])&&(f=g[1]-0))),h.test(b)&&(e===d||b>=e)&&(f===d||b<=f)},decimal:function(b){return a.fn.form.settings.regExp.decimal.test(b)},number:function(b){return a.fn.form.settings.regExp.number.test(b)},is:function(a,b){return b="string"==typeof b?b.toLowerCase():b,a="string"==typeof a?a.toLowerCase():a,a==b},isExactly:function(a,b){return a==b},not:function(a,b){return a="string"==typeof a?a.toLowerCase():a,b="string"==typeof b?b.toLowerCase():b,a!=b},notExactly:function(a,b){return a!=b},contains:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c,"i"))!==-1},containsExactly:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c))!==-1},doesntContain:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c,"i"))===-1},doesntContainExactly:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c))===-1},minLength:function(a,b){return a!==d&&a.length>=b},length:function(a,b){return a!==d&&a.length>=b},exactLength:function(a,b){return a!==d&&a.length==b},maxLength:function(a,b){return a!==d&&a.length<=b},match:function(b,c){var e;return a(this),a('[data-validate="'+c+'"]').length>0?e=a('[data-validate="'+c+'"]').val():a("#"+c).length>0?e=a("#"+c).val():a('[name="'+c+'"]').length>0?e=a('[name="'+c+'"]').val():a('[name="'+c+'[]"]').length>0&&(e=a('[name="'+c+'[]"]')),e!==d&&b.toString()==e.toString()},different:function(b,c){var e;return a(this),a('[data-validate="'+c+'"]').length>0?e=a('[data-validate="'+c+'"]').val():a("#"+c).length>0?e=a("#"+c).val():a('[name="'+c+'"]').length>0?e=a('[name="'+c+'"]').val():a('[name="'+c+'[]"]').length>0&&(e=a('[name="'+c+'[]"]')),e!==d&&b.toString()!==e.toString()},creditCard:function(b,c){var d,e,f={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},g={},h=!1,i="string"==typeof c&&c.split(",");if("string"==typeof b&&0!==b.length){if(i&&(a.each(i,function(c,d){e=f[d],e&&(g={length:a.inArray(b.length,e.length)!==-1,pattern:b.search(e.pattern)!==-1},g.length&&g.pattern&&(h=!0))}),!h))return!1;if(d={number:a.inArray(b.length,f.unionPay.length)!==-1,pattern:b.search(f.unionPay.pattern)!==-1},d.number&&d.pattern)return!0;for(var j=b.length,k=0,l=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],m=0;j--;)m+=l[k][parseInt(b.charAt(j),10)],k^=1;return m%10===0&&m>0}},minCount:function(a,b){return 0==b||(1==b?""!==a:a.split(",").length>=b)},exactCount:function(a,b){return 0==b?""===a:1==b?""!==a&&a.search(",")===-1:a.split(",").length==b},maxCount:function(a,b){return 0!=b&&(1==b?a.search(",")===-1:a.split(",").length<=b)}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.accordion=function(c){var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var l,m,n=a.isPlainObject(c)?a.extend(!0,{},a.fn.accordion.settings,c):a.extend({},a.fn.accordion.settings),o=n.className,p=n.namespace,q=n.selector,r=n.error,s="."+p,t="module-"+p,u=f.selector||"",v=a(this),w=v.find(q.title),x=v.find(q.content),y=this,z=v.data(t);m={initialize:function(){m.debug("Initializing",v),m.bind.events(),n.observeChanges&&m.observeChanges(),m.instantiate()},instantiate:function(){z=m,v.data(t,m)},destroy:function(){m.debug("Destroying previous instance",v),v.off(s).removeData(t)},refresh:function(){w=v.find(q.title),x=v.find(q.content)},observeChanges:function(){"MutationObserver"in b&&(l=new MutationObserver(function(a){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),l.observe(y,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",l))},bind:{events:function(){m.debug("Binding delegated events"),v.on(n.on+s,q.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=g&&!f,i=!g&&f;m.debug("Toggling visibility of content",c),h||i?n.collapsible?m.close.call(c):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(c)},open:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=g||f;return h?void m.debug("Accordion already open, skipping",e):(m.debug("Opening accordion content",c),n.onOpening.call(e),n.exclusive&&m.closeOthers.call(c),c.addClass(o.active),e.stop(!0,!0).addClass(o.animating),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?e.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):e.children().stop(!0,!0).animate({opacity:1},n.duration,m.resetOpacity)),void e.slideDown(n.duration,n.easing,function(){e.removeClass(o.animating).addClass(o.active),m.reset.display.call(this),n.onOpen.call(this),n.onChange.call(this)}))},close:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=!g&&f,i=g&&f;!g&&!h||i||(m.debug("Closing accordion content",e),n.onClosing.call(e),c.removeClass(o.active),e.stop(!0,!0).addClass(o.animating),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?e.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):e.children().stop(!0,!0).animate({opacity:0},n.duration,m.resetOpacity)),e.slideUp(n.duration,n.easing,function(){e.removeClass(o.animating).removeClass(o.active),m.reset.display.call(this),n.onClose.call(this),n.onChange.call(this)}))},closeOthers:function(b){var c,e,f,g=b!==d?w.eq(b):a(this).closest(q.title),h=g.parents(q.content).prev(q.title),i=g.closest(q.accordion),j=q.title+"."+o.active+":visible",k=q.content+"."+o.active+":visible";n.closeNested?(c=i.find(j).not(h),f=c.next(x)):(c=i.find(j).not(h),e=i.find(k).find(j).not(h),c=c.not(e),f=c.next(x)),c.length>0&&(m.debug("Exclusive enabled, closing other content",c),c.removeClass(o.active),f.removeClass(o.animating).stop(!0,!0),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?f.children().transition({animation:"fade out",useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):f.children().stop(!0,!0).animate({opacity:0},n.duration,m.resetOpacity)),f.slideUp(n.duration,n.easing,function(){a(this).removeClass(o.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),a(this).css("display",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),a(this).css("opacity",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")}},setting:function(b,c){if(m.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];a.isPlainObject(n[b])?a.extend(!0,n[b],c):n[b]=c}},internal:function(b,c){return m.debug("Changing internal",b,c),c===d?m[b]:void(a.isPlainObject(b)?a.extend(!0,m,b):m[b]=c)},debug:function(){!n.silent&&n.debug&&(n.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,n.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!n.silent&&n.verbose&&n.debug&&(n.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),m.verbose.apply(console,arguments)))},error:function(){n.silent||(m.error=Function.prototype.bind.call(console.error,console,n.name+":"),m.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:y,"Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var b=n.name+":",c=0;g=!1,clearTimeout(m.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",u&&(b+=" '"+u+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,f){var g,h,i,j=z;return c=c||k,f=y||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):(m.error(r.method,b),!1);j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},j?(z===d&&m.initialize(),m.invoke(i)):(z!==d&&z.invoke("destroy"),m.initialize())}),e!==d?e:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},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"}},a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}})}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.checkbox=function(e){var f,g=a(this),h=g.selector||"",i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1);return g.each(function(){var g,n,o=a.extend(!0,{},a.fn.checkbox.settings,e),p=o.className,q=o.namespace,r=o.selector,s=o.error,t="."+q,u="module-"+q,v=a(this),w=a(this).children(r.label),x=a(this).children(r.input),y=x[0],z=!1,A=!1,B=v.data(u),C=this;n={initialize:function(){n.verbose("Initializing checkbox",o),n.create.label(),n.bind.events(),n.set.tabbable(),n.hide.input(),n.observeChanges(),n.instantiate(),n.setup()},instantiate:function(){n.verbose("Storing instance of module",n),B=n,v.data(u,n)},destroy:function(){n.verbose("Destroying module"),n.unbind.events(),n.show.input(),v.removeData(u)},fix:{reference:function(){v.is(r.input)&&(n.debug("Behavior called on adjusting invoked element"),v=v.closest(r.checkbox),n.refresh())}},setup:function(){n.set.initialLoad(),n.is.indeterminate()?(n.debug("Initial value is indeterminate"),n.indeterminate()):n.is.checked()?(n.debug("Initial value is checked"),n.check()):(n.debug("Initial value is unchecked"),n.uncheck()),n.remove.initialLoad()},refresh:function(){w=v.children(r.label),x=v.children(r.input),y=x[0]},hide:{input:function(){n.verbose("Modifying z-index to be unselectable"),x.addClass(p.hidden)}},show:{input:function(){n.verbose("Modifying z-index to be selectable"),x.removeClass(p.hidden)}},observeChanges:function(){"MutationObserver"in b&&(g=new MutationObserver(function(a){n.debug("DOM tree modified, updating selector cache"),n.refresh()}),g.observe(C,{childList:!0,subtree:!0}),n.debug("Setting up mutation observer",g))},attachEvents:function(b,c){var d=a(b);c=a.isFunction(n[c])?n[c]:n.toggle,d.length>0?(n.debug("Attaching checkbox events to element",b,c),d.on("click"+t,c)):n.error(s.notFound)},event:{click:function(b){var c=a(b.target);return c.is(r.input)?void n.verbose("Using default check action on initialized checkbox"):c.is(r.link)?void n.debug("Clicking link inside checkbox, skipping toggle"):(n.toggle(),x.focus(),void b.preventDefault())},keydown:function(a){var b=a.which,c={enter:13,space:32,escape:27};b==c.escape?(n.verbose("Escape key pressed blurring field"),x.blur(),A=!0):a.ctrlKey||b!=c.space&&b!=c.enter?A=!1:(n.verbose("Enter/space key pressed, toggling checkbox"),n.toggle(),A=!0)},keyup:function(a){A&&a.preventDefault()}},check:function(){n.should.allowCheck()&&(n.debug("Checking checkbox",x),n.set.checked(),n.should.ignoreCallbacks()||(o.onChecked.call(y),o.onChange.call(y)))},uncheck:function(){n.should.allowUncheck()&&(n.debug("Unchecking checkbox"),n.set.unchecked(),n.should.ignoreCallbacks()||(o.onUnchecked.call(y),o.onChange.call(y)))},indeterminate:function(){return n.should.allowIndeterminate()?void n.debug("Checkbox is already indeterminate"):(n.debug("Making checkbox indeterminate"),n.set.indeterminate(),void(n.should.ignoreCallbacks()||(o.onIndeterminate.call(y),o.onChange.call(y))))},determinate:function(){return n.should.allowDeterminate()?void n.debug("Checkbox is already determinate"):(n.debug("Making checkbox determinate"),n.set.determinate(),void(n.should.ignoreCallbacks()||(o.onDeterminate.call(y),o.onChange.call(y))))},enable:function(){return n.is.enabled()?void n.debug("Checkbox is already enabled"):(n.debug("Enabling checkbox"),n.set.enabled(),o.onEnable.call(y),void o.onEnabled.call(y))},disable:function(){return n.is.disabled()?void n.debug("Checkbox is already disabled"):(n.debug("Disabling checkbox"),n.set.disabled(),o.onDisable.call(y),void o.onDisabled.call(y))},get:{radios:function(){var b=n.get.name();return a('input[name="'+b+'"]').closest(r.checkbox)},otherRadios:function(){return n.get.radios().not(v)},name:function(){return x.attr("name")}},is:{initialLoad:function(){return z},radio:function(){return x.hasClass(p.radio)||"radio"==x.attr("type")},indeterminate:function(){return x.prop("indeterminate")!==d&&x.prop("indeterminate")},checked:function(){return x.prop("checked")!==d&&x.prop("checked")},disabled:function(){return x.prop("disabled")!==d&&x.prop("disabled")},enabled:function(){return!n.is.disabled()},determinate:function(){return!n.is.indeterminate()},unchecked:function(){return!n.is.checked()}},should:{allowCheck:function(){return n.is.determinate()&&n.is.checked()&&!n.should.forceCallbacks()?(n.debug("Should not allow check, checkbox is already checked"),!1):o.beforeChecked.apply(y)!==!1||(n.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return n.is.determinate()&&n.is.unchecked()&&!n.should.forceCallbacks()?(n.debug("Should not allow uncheck, checkbox is already unchecked"),!1):o.beforeUnchecked.apply(y)!==!1||(n.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return n.is.indeterminate()&&!n.should.forceCallbacks()?(n.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):o.beforeIndeterminate.apply(y)!==!1||(n.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return n.is.determinate()&&!n.should.forceCallbacks()?(n.debug("Should not allow determinate, checkbox is already determinate"),!1):o.beforeDeterminate.apply(y)!==!1||(n.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return n.is.initialLoad()&&o.fireOnInit},ignoreCallbacks:function(){return z&&!o.fireOnInit}},can:{change:function(){return!(v.hasClass(p.disabled)||v.hasClass(p.readOnly)||x.prop("disabled")||x.prop("readonly"))},uncheck:function(){return"boolean"==typeof o.uncheckable?o.uncheckable:!n.is.radio()}},set:{initialLoad:function(){z=!0},checked:function(){return n.verbose("Setting class to checked"),v.removeClass(p.indeterminate).addClass(p.checked),n.is.radio()&&n.uncheckOthers(),!n.is.indeterminate()&&n.is.checked()?void n.debug("Input is already checked, skipping input property change"):(n.verbose("Setting state to checked",y),x.prop("indeterminate",!1).prop("checked",!0),void n.trigger.change())},unchecked:function(){return n.verbose("Removing checked class"),v.removeClass(p.indeterminate).removeClass(p.checked),!n.is.indeterminate()&&n.is.unchecked()?void n.debug("Input is already unchecked"):(n.debug("Setting state to unchecked"),x.prop("indeterminate",!1).prop("checked",!1),void n.trigger.change())},indeterminate:function(){return n.verbose("Setting class to indeterminate"),v.addClass(p.indeterminate),n.is.indeterminate()?void n.debug("Input is already indeterminate, skipping input property change"):(n.debug("Setting state to indeterminate"),x.prop("indeterminate",!0),void n.trigger.change())},determinate:function(){return n.verbose("Removing indeterminate class"),v.removeClass(p.indeterminate),n.is.determinate()?void n.debug("Input is already determinate, skipping input property change"):(n.debug("Setting state to determinate"),void x.prop("indeterminate",!1))},disabled:function(){return n.verbose("Setting class to disabled"),v.addClass(p.disabled),n.is.disabled()?void n.debug("Input is already disabled, skipping input property change"):(n.debug("Setting state to disabled"),x.prop("disabled","disabled"),void n.trigger.change())},enabled:function(){return n.verbose("Removing disabled class"),v.removeClass(p.disabled),n.is.enabled()?void n.debug("Input is already enabled, skipping input property change"):(n.debug("Setting state to enabled"),x.prop("disabled",!1),void n.trigger.change())},tabbable:function(){n.verbose("Adding tabindex to checkbox"),x.attr("tabindex")===d&&x.attr("tabindex",0)}},remove:{initialLoad:function(){z=!1}},trigger:{change:function(){var a=c.createEvent("HTMLEvents"),b=x[0];b&&(n.verbose("Triggering native change event"),a.initEvent("change",!0,!1),b.dispatchEvent(a))}},create:{label:function(){x.prevAll(r.label).length>0?(x.prev(r.label).detach().insertAfter(x),n.debug("Moving existing label",w)):n.has.label()||(w=a("