wishthis/semantic/dist/semantic.min.js
2022-08-05 11:25:53 +02:00

11 lines
No EOL
260 KiB
JavaScript

/*
* # Fomantic UI - 2.9.0-beta.301+42e68bc
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
* Copyright 2022 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(g,h,v,b){g.isFunction=g.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g.site=g.fn.site=function(e){var s,i=(new Date).getTime(),a=[],t=e,n="string"==typeof t,l=[].slice.call(arguments,1),r=g.isPlainObject(e)?g.extend(!0,{},g.site.settings,e):g.extend({},g.site.settings),o=r.namespace,c=r.error,u="module-"+o,d=g(v),f=this,p=d.data(u),m={initialize:function(){m.instantiate()},instantiate:function(){m.verbose("Storing instance of site",m),p=m,d.data(u,m)},normalize:function(){m.fix.console(),m.fix.requestAnimationFrame()},fix:{console:function(){m.debug("Normalizing window.console"),console!==b&&console.log!==b||(m.verbose("Console not available, normalizing events"),m.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(m.verbose("Console group not available, normalizing events"),h.console.group=function(){},h.console.groupEnd=function(){},h.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(m.verbose("Mark timeline not available, normalizing events"),h.console.markTimeline=function(){})},consoleClear:function(){m.debug("Disabling programmatic console clearing"),h.console.clear=function(){}},requestAnimationFrame:function(){m.debug("Normalizing requestAnimationFrame"),h.requestAnimationFrame===b&&(m.debug("RequestAnimationFrame not available, normalizing event"),h.requestAnimationFrame=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(e){return g.fn[e]!==b&&g.fn[e].settings!==b},enabled:{modules:function(e){var n=[];return e=e||r.modules,g.each(e,function(e,t){m.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(e){var n=[];return e=e||r.modules,g.each(e,function(e,t){m.moduleExists(t)||n.push(t)}),n}},change:{setting:function(i,a,e,o){e="string"==typeof e?"all"===e?r.modules:[e]:e||r.modules,o=o===b||o,g.each(e,function(e,t){var n=!m.moduleExists(t)||(g.fn[t].settings.namespace||!1);m.moduleExists(t)&&(m.verbose("Changing default setting",i,a,t),g.fn[t].settings[i]=a,o&&n&&0<(n=g(":data(module-"+n+")")).length&&(m.verbose("Modifying existing settings",n),n[t]("setting",i,a)))})},settings:function(i,e,a){e="string"==typeof e?[e]:e||r.modules,a=a===b||a,g.each(e,function(e,t){var n;m.moduleExists(t)&&(m.verbose("Changing default setting",i,t),g.extend(!0,g.fn[t].settings,i),a&&o&&0<(n=g(":data(module-"+o+")")).length&&(m.verbose("Modifying existing settings",n),n[t]("setting",i)))})}},enable:{console:function(){m.console(!0)},debug:function(e,t){e=e||r.modules,m.debug("Enabling debug for modules",e),m.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||r.modules,m.debug("Enabling verbose debug for modules",e),m.change.setting("verbose",!0,e,t)}},disable:{console:function(){m.console(!1)},debug:function(e,t){e=e||r.modules,m.debug("Disabling debug for modules",e),m.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||r.modules,m.debug("Disabling verbose debug for modules",e),m.change.setting("verbose",!1,e,t)}},console:function(e){e?p.cache.console===b?m.error(c.console):(m.debug("Restoring console function"),h.console=p.cache.console):(m.debug("Disabling console function"),p.cache.console=h.console,h.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}})},destroy:function(){m.verbose("Destroying previous site for",d),d.removeData(u)},cache:{},setting:function(e,t){if(g.isPlainObject(e))g.extend(!0,r,e);else{if(t===b)return r[e];r[e]=t}},internal:function(e,t){if(g.isPlainObject(e))g.extend(!0,m,e);else{if(t===b)return m[e];m[e]=t}},debug:function(){r.debug&&(r.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,r.name+":"),m.debug.apply(console,arguments)))},verbose:function(){r.verbose&&r.debug&&(r.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,r.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n;r.performance&&(n=(t=(new Date).getTime())-(i||t),i=t,a.push({Element:f,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=r.name+":",n=0;i=!1,clearTimeout(m.performance.timer),g.each(a,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",(console.group!==b||console.table!==b)&&0<a.length&&(console.groupCollapsed(e),console.table?console.table(a):g.each(a,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),a=[]}},invoke:function(i,e,t){var a,o,n,r=p;return e=e||l,t=f||t,"string"==typeof i&&r!==b&&(i=i.split(/[\. ]/),a=i.length-1,g.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(g.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==b)return o=r[n],!1;{if(!g.isPlainObject(r[t])||e==a)return r[t]!==b?o=r[t]:m.error(c.method,i),!1;r=r[t]}}})),g.isFunction(o)?n=o.apply(t,e):o!==b&&(n=o),Array.isArray(s)?s.push(n):s!==b?s=[s,n]:n!==b&&(s=n),o}};return n?(p===b&&m.initialize(),m.invoke(t)):(p!==b&&m.destroy(),m.initialize()),s!==b?s:this},g.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","calendar","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","slider","rating","shape","sidebar","state","sticky","tab","toast","transition","visibility","visit"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},g.extend(g.expr[":"],{data:g.expr.createPseudo?g.expr.createPseudo(function(t){return function(e){return!!g.data(e,t)}}):function(e,t,n){return!!g.data(e,n[3])}})}(jQuery,window,document),function(ae,D,S,oe){"use strict";ae.isFunction=ae.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},D=void 0!==D&&D.Math==Math?D:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),ae.fn.calendar=function(h){var v,e=ae(this),b=e.selector||"",y=(new Date).getTime(),x=[],w=h,C="string"==typeof w,k=[].slice.call(arguments,1),T={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},ie=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var d,e,G=ae.isPlainObject(h)?ae.extend(!0,{},ae.fn.calendar.settings,h):ae.extend({},ae.fn.calendar.settings),X=G.className,t=G.namespace,n=G.selector,J=G.formatter,i=G.parser,_=G.metadata,Z=T[G.minTimeGap],s=G.error,a="."+t,o="module-"+t,r=ae(this),l=r.find(n.input),ee=r.find(n.popup),c=r.find(n.activator),u=this,f=r.data(o),p=!1,te=r.hasClass(X.inverted),m=!1,g=!1,ne={initialize:function(){ne.debug("Initializing calendar for",u,r),d=ne.get.isTouch(),ne.setup.config(),ne.setup.popup(),ne.setup.inline(),ne.setup.input(),ne.setup.date(),ne.create.calendar(),ne.bind.events(),ne.observeChanges(),ne.instantiate()},instantiate:function(){ne.verbose("Storing instance of calendar"),f=ne,r.data(o,f)},destroy:function(){ne.verbose("Destroying previous calendar for",u),r.removeData(o),ne.unbind.events(),ne.disconnect.classObserver()},setup:{config:function(){null!==ne.get.minDate()&&ne.set.minDate(r.data(_.minDate)),null!==ne.get.maxDate()&&ne.set.maxDate(r.data(_.maxDate)),ne.setting("type",ne.get.type()),ne.setting("on",G.on||"click")},popup:function(){var e,t;G.inline||(c.length||(c=r.children().first()).length)&&(ae.fn.popup===oe?ne.error(s.popup):(ee.length||(e=0!==(t=c.parent()).closest(n.append).length?"appendTo":"prependTo",ee=ae("<div/>").addClass(X.popup)[e](t)),ee.addClass(X.calendar),te&&ee.addClass(X.inverted),e=function(){return ne.refreshTooltips(),G.onVisible.apply(ee,arguments)},l.length||(ee.attr("tabindex","0"),e=function(){return ne.refreshTooltips(),ne.focus(),G.onVisible.apply(ee,arguments)}),t=ne.setting("on"),t=ae.extend({},G.popupOptions,{popup:ee,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ne.set.focusDate(ne.get.date()),ne.set.mode(ne.get.validatedMode(G.startMode)),G.onShow.apply(ee,arguments)},onVisible:e,onHide:G.onHide,onHidden:function(){return ne.blur(),G.onHidden.apply(ee,arguments)}}),ne.popup(t)))},inline:function(){c.length&&!G.inline||(G.inline=!0,ee=ae("<div/>").addClass(X.calendar).appendTo(r),l.length||ee.attr("tabindex","0"))},input:function(){G.touchReadonly&&l.length&&d&&l.prop("readonly",!0),ne.check.disabled()},date:function(){var e;G.initialDate?e=i.date(G.initialDate,G):r.data(_.date)!==oe?e=i.date(r.data(_.date),G):l.length&&(e=i.date(l.val(),G)),ne.set.date(e,G.formatInput,!1),ne.set.mode(ne.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=S.createEvent("HTMLEvents"),ne.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,L,n=ne.get.mode(),i=new Date,j=ne.get.date(),a=ne.get.focusDate(),o=ne.helper.dateInRange(a||j||G.initialDate||i),r=(a||ne.set.focusDate(a=o,!1,!1),"year"===n),s="month"===n,l="day"===n,c="hour"===n,u="minute"===n,H="time"===G.type,N=Math.max(G.multiMonth,1),V=l?ne.get.monthOffset():0,d=o.getMinutes(),f=o.getHours(),p=o.getDate(),z=o.getMonth()+V,m=o.getFullYear(),g=l?G.showWeekNumbers?8:7:c?4:Z.column,U=l||c?6:Z.row,h=l?N:1,v=(b=ee).hasClass("left")?"right center":"left center";for(b.empty(),1<h&&(L=ae("<div/>").addClass(X.grid).appendTo(b)),t=0;t<h;t++){1<h&&(b=ae("<div/>").addClass(X.column).appendTo(L));var b,y=z+t,Y=(new Date(m,y,1).getDay()-G.firstDayOfWeek%7+7)%7,x=(!G.constantHeight&&l&&(x=new Date(m,y+1,0).getDate()+Y,U=Math.ceil(x/7)),r?10:s?1:0),w=l?1:0,C=c||u?1:0,k=c||u?p:1,T=new Date(m-x,y-w,k-C,f),w=new Date(m+x,y+w,k+C,f),k=r?new Date(10*Math.ceil(m/10)-9,0,0):s?new Date(m,0,0):l?new Date(m,y,0):new Date(m,y,p,-1),C=r?new Date(10*Math.ceil(m/10)+1,0,1):s?new Date(m+1,0,1):l?new Date(m,y+1,1):new Date(m,y,p+1),D=n,D=(l&&G.showWeekNumbers&&(D+=" andweek"),ae("<table/>").addClass(X.table).addClass(D).addClass(ie[g]+" column").appendTo(b)),W=(te&&D.addClass(X.inverted),g);if(!H){var B=ae("<thead/>").appendTo(D),S=ae("<tr/>").appendTo(B),A=ae("<th/>").attr("colspan",""+g).appendTo(S),E=r||s?new Date(m,0,1):l?new Date(m,y,1):new Date(m,y,p,f,d),F=ae("<span/>").addClass(X.link).appendTo(A),E=(F.text(ne.helper.dateFormat(J[n+"Header"],E)),s?G.disableYear?"day":"year":l?G.disableMonth?"year":"month":"day");if(F.data(_.mode,E),0===t&&((F=ae("<span/>").addClass(X.prev).appendTo(A)).data(_.focusDate,T),F.toggleClass(X.disabledCell,!ne.helper.isDateInRange(k,n)),ae("<i/>").addClass(X.prevIcon).appendTo(F)),t===h-1&&((E=ae("<span/>").addClass(X.next).appendTo(A)).data(_.focusDate,w),E.toggleClass(X.disabledCell,!ne.helper.isDateInRange(C,n)),ae("<i/>").addClass(X.nextIcon).appendTo(E)),l)for(S=ae("<tr/>").appendTo(B),G.showWeekNumbers&&((A=ae("<th/>").appendTo(S)).text(G.text.weekNo),A.addClass(X.weekCell),W--),M=0;M<W;M++)(A=ae("<th/>").appendTo(S)).text(J.dayColumnHeader((M+G.firstDayOfWeek)%7,G))}for(var $=ae("<tbody/>").appendTo(D),M=r?10*Math.ceil(m/10)-9:l?1-Y:0,K=0;K<U;K++)for(S=ae("<tr/>").appendTo($),l&&G.showWeekNumbers&&((A=ae("<th/>").appendTo(S)).text(ne.get.weekOfYear(m,y,M+1-G.firstDayOfWeek)),A.addClass(X.weekCell)),e=0;e<W;e++,M++){var O,P=r?new Date(M,y,1,f,d):s?new Date(m,M,1,f,d):l?new Date(m,y,M,f,d):c?new Date(m,y,p,M):new Date(m,y,p,f,M*G.minTimeGap),R=r?M:s?G.text.monthsShort[M]:l?P.getDate():ne.helper.dateFormat(J.cellTime,P),R=((A=ae("<td/>").addClass(X.cell).appendTo(S)).text(R),A.data(_.date,P),l&&P.getMonth()!==(y+12)%12),I=!G.selectAdjacentDays&&R||!ne.helper.isDateInRange(P,n)||G.isDisabled(P,n)||ne.helper.isDisabled(P,n)||!ne.helper.isEnabled(P,n),q=(I?(null!==(q=ne.helper.findDayAsObject(P,n,G.disabledDates))&&q[_.message]&&(A.attr("data-tooltip",q[_.message]),A.attr("data-position",q[_.position]||v),(q[_.inverted]||te&&q[_.inverted]===oe)&&A.attr("data-inverted",""),q[_.variation]&&A.attr("data-variation",q[_.variation])),"hour"===n&&null!==(q=ne.helper.findHourAsObject(P,n,G.disabledHours))&&q[_.message]&&(A.attr("data-tooltip",q[_.message]),A.attr("data-position",q[_.position]||v),(q[_.inverted]||te&&q[_.inverted]===oe)&&A.attr("data-inverted",""),q[_.variation]&&A.attr("data-variation",q[_.variation]))):null!==(O=ne.helper.findDayAsObject(P,n,G.eventDates))&&(A.addClass(O[_.class]||G.eventClass),O[_.message]&&(A.attr("data-tooltip",O[_.message]),A.attr("data-position",O[_.position]||v),(O[_.inverted]||te&&O[_.inverted]===oe)&&A.attr("data-inverted",""),O[_.variation]&&A.attr("data-variation",O[_.variation]))),ne.helper.dateEqual(P,j,n)),Q=ne.helper.dateEqual(P,i,n),R=(A.toggleClass(X.adjacentCell,R&&!O),A.toggleClass(X.disabledCell,I),A.toggleClass(X.activeCell,q&&!(R&&I)),c||u||A.toggleClass(X.todayCell,!R&&Q),{mode:n,adjacent:R,disabled:I,active:q,today:Q});J.cell(A,P,R),ne.helper.dateEqual(P,a,n)&&ne.set.focusDate(P,!1,!1)}G.today&&(T=ae("<tr/>").appendTo($),(k=ae("<td/>").attr("colspan",""+g).addClass(X.today).appendTo(T)).text(J.today(G)),k.data(_.date,i)),ne.update.focus(!1,D),G.inline&&ne.refreshTooltips()}}},update:{focus:function(e,t){t=t||ee;var r=ne.get.mode(),n=ne.get.date(),s=ne.get.focusDate(),l=ne.get.startDate(),c=ne.get.endDate(),u=(e?s:null)||n||(d?null:s);t.find("td").each(function(){var e,t,n,i,a=ae(this),o=a.data(_.date);o&&(e=a.hasClass(X.disabledCell),t=a.hasClass(X.activeCell),n=a.hasClass(X.adjacentCell),i=ne.helper.dateEqual(o,s,r),o=!!u&&(!!l&&ne.helper.isDateInRange(o,r,l,u)||!!c&&ne.helper.isDateInRange(o,r,u,c)),a.toggleClass(X.focusCell,i&&(!d||p)&&(!n||G.selectAdjacentDays&&n)&&!e),ne.helper.isTodayButton(a)||a.toggleClass(X.rangeCell,o&&!t&&!e))})}},refresh:function(){ne.create.calendar()},refreshTooltips:function(){var i=ae(D).width();ee.find("td[data-position]").each(function(){var e=ae(this),t=D.getComputedStyle(e[0],"::after").width.replace(/[^0-9\.]/g,""),n=e.attr("data-position"),t=i-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===n.indexOf(t)&&e.attr("data-position",n.replace(/(left|right)/,t))})},bind:{events:function(){ne.debug("Binding events"),ee.on("mousedown"+a,ne.event.mousedown),ee.on("touchstart"+a,ne.event.mousedown),ee.on("mouseup"+a,ne.event.mouseup),ee.on("touchend"+a,ne.event.mouseup),ee.on("mouseover"+a,ne.event.mouseover),l.length?(l.on("input"+a,ne.event.inputChange),l.on("focus"+a,ne.event.inputFocus),l.on("blur"+a,ne.event.inputBlur),l.on("keydown"+a,ne.event.keydown)):ee.on("keydown"+a,ne.event.keydown)}},unbind:{events:function(){ne.debug("Unbinding events"),ee.off(a),l.length&&l.off(a)}},event:{mouseover:function(e){var t=ae(e.target).data(_.date),e=1===e.buttons;t&&ne.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),p=0<=e.type.indexOf("touch");e=ae(e.target).data(_.date);e&&ne.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ne.focus(),e.preventDefault(),e.stopPropagation(),p=!1;var t,n,i,e=ae(e.target);e.hasClass("disabled")||(t=(e=(t=e.parent()).data(_.date)||t.data(_.focusDate)||t.data(_.mode)?t:e).data(_.date),n=e.data(_.focusDate),i=e.data(_.mode),t&&!1!==G.onSelect.call(u,t,ne.get.mode())?(e=e.hasClass(X.today),ne.selectDate(t,e)):n?ne.set.focusDate(n):i&&ne.set.mode(i))},keydown:function(e){var t,n,i,a,o,r,s,l=e.which;27!==l&&9!==l||ne.popup("hide"),ne.popup("is visible")&&(37===l||38===l||39===l||40===l?(a="day"===(r=ne.get.mode())?7:"hour"===r?4:"minute"===r?Z.column:3,a=37===l?-1:38===l?-a:39==l?1:a,a*="minute"===r?G.minTimeGap:1,o=(t=ne.get.focusDate()||ne.get.date()||new Date).getFullYear()+("year"===r?a:0),s=t.getMonth()+("month"===r?a:0),n=t.getDate()+("day"===r?a:0),i=t.getHours()+("hour"===r?a:0),a=t.getMinutes()+("minute"===r?a:0),o=new Date(o,s,n,i,a),"time"===G.type&&(o=ne.helper.mergeDateTime(t,o)),ne.helper.isDateInRange(o,r)&&ne.set.focusDate(o)):13===l&&(r=ne.get.mode(),(s=ne.get.focusDate())&&!G.isDisabled(s,r)&&!ne.helper.isDisabled(s,r)&&ne.helper.isEnabled(s,r)&&!1!==G.onSelect.call(u,s,ne.get.mode())&&ne.selectDate(s),e.preventDefault(),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ne.popup("show"))},inputChange:function(){var e=l.val(),e=i.date(e,G);ne.set.date(e,!1)},inputFocus:function(){ee.addClass(X.active)},inputBlur:function(){var e;ee.removeClass(X.active),G.formatInput&&(e=ne.get.date(),e=ne.helper.dateFormat(J[G.type],e),l.val(e)),g&&(ne.trigger.change(),g=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ne.check.disabled()})}}},observeChanges:function(){"MutationObserver"in D&&(e=new MutationObserver(ne.event.class.mutation),ne.debug("Setting up mutation observer",e),ne.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(r[0],{attributes:!0})}},is:{disabled:function(){return r.hasClass(X.disabled)}},check:{disabled:function(){l.attr("tabindex",ne.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,n){return e=Date.UTC(e,t,n+3)/864e5,e=Math.floor(e/7),t=new Date(6048e5*e).getUTCFullYear(),e-Math.floor(Date.UTC(t,0,7)/6048e5)+1},formattedDate:function(e,t){return ne.helper.dateFormat(e||J[G.type],t||ne.get.date())},date:function(){return ne.helper.sanitiseDate(r.data(_.date))||null},inputDate:function(){return l.val()},focusDate:function(){return r.data(_.focusDate)||null},startDate:function(){var e=ne.get.calendarModule(G.startCalendar);return(e?e.get.date():r.data(_.startDate))||null},endDate:function(){var e=ne.get.calendarModule(G.endCalendar);return(e?e.get.date():r.data(_.endDate))||null},minDate:function(){return r.data(_.minDate)||null},maxDate:function(){return r.data(_.maxDate)||null},monthOffset:function(){return r.data(_.monthOffset)||G.monthOffset||0},mode:function(){var e=r.data(_.mode)||G.startMode;return ne.get.validatedMode(e)},validatedMode:function(e){var t=ne.get.validModes();return 0<=ae.inArray(e,t)?e:"time"===G.type?"hour":"month"===G.type?"month":"year"===G.type?"year":"day"},type:function(){return r.data(_.type)||G.type},validModes:function(){var e=[];return"time"!==G.type&&(G.disableYear&&"year"!==G.type||e.push("year"),(G.disableMonth||"year"===G.type)&&"month"!==G.type||e.push("month"),0<=G.type.indexOf("date")&&e.push("day")),0<=G.type.indexOf("time")&&(e.push("hour"),G.disableMinute||e.push("minute")),e},isTouch:function(){try{return S.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=e instanceof ae?e:ae(S).find(e).first()).data(o):null}},set:{date:function(e,t,n){t=!1!==t,n=!1!==n,e=ne.helper.sanitiseDate(e),e=ne.helper.dateInRange(e);var i=ne.get.mode(),a=ne.helper.dateFormat(J[G.type],e);if(n&&!1===G.onBeforeChange.call(u,e,a,i))return!1;if(ne.set.focusDate(e),G.isDisabled(e,i))return!1;var o=ne.get.endDate();o&&e&&o<e&&ne.set.endDate(oe),ne.set.dataKeyValue(_.date,e),t&&l.length&&l.val(a),n&&G.onChange.call(u,e,a,i)},startDate:function(e,t){e=ne.helper.sanitiseDate(e);var n=ne.get.calendarModule(G.startCalendar);n&&n.set.date(e),ne.set.dataKeyValue(_.startDate,e,t)},endDate:function(e,t){e=ne.helper.sanitiseDate(e);var n=ne.get.calendarModule(G.endCalendar);n&&n.set.date(e),ne.set.dataKeyValue(_.endDate,e,t)},focusDate:function(e,t,n,i){e=ne.helper.sanitiseDate(e),e=ne.helper.dateInRange(e);var a="day"===ne.get.mode(),o=ne.get.focusDate(),a=(a&&e&&o&&((a=12*(e.getFullYear()-o.getFullYear())+e.getMonth()-o.getMonth())&&(o=ne.get.monthOffset()-a,ne.set.monthOffset(o,!1))),ne.set.dataKeyValue(_.focusDate,e,!!e&&t));n=!1!==n&&a&&!1===t||m!=i,m=i,n&&ne.update.focus(i)},minDate:function(e){e=ne.helper.sanitiseDate(e),null!==G.maxDate&&G.maxDate<=e?ne.verbose("Unable to set minDate variable bigger that maxDate variable",e,G.maxDate):(ne.setting("minDate",e),ne.set.dataKeyValue(_.minDate,e))},maxDate:function(e){e=ne.helper.sanitiseDate(e),null!==G.minDate&&G.minDate>=e?ne.verbose("Unable to set maxDate variable lower that minDate variable",e,G.minDate):(ne.setting("maxDate",e),ne.set.dataKeyValue(_.maxDate,e))},monthOffset:function(e,t){var n=Math.max(G.multiMonth,1);e=Math.max(1-n,Math.min(0,e)),ne.set.dataKeyValue(_.monthOffset,e,t)},mode:function(e,t){ne.set.dataKeyValue(_.mode,e,t)},dataKeyValue:function(e,t,n){var i=r.data(e),i=i===t||i<=t&&t<=i;return t?r.data(e,t):r.removeData(e),(n=!1!==n&&!i)&&ne.refresh(),!i}},selectDate:function(e,t){ne.verbose("New date selection",e);var n=ne.get.mode();t||"minute"===n||G.disableMinute&&"hour"===n||"date"===G.type&&"day"===n||"month"===G.type&&"month"===n||"year"===G.type&&"year"===n?!1!==ne.set.date(e)&&(g=!0,G.closable&&(ne.popup("hide"),(t=ne.get.calendarModule(G.endCalendar))&&(t.refresh(),"focus"!==t.setting("on")&&t.popup("show"),t.focus()))):(t="year"===n?G.disableMonth?"day":"month":"month"===n?"day":"day"===n?"hour":"minute",ne.set.mode(t),"hour"===n||"day"===n&&ne.get.date()?ne.set.date(e,!0,!1):ne.set.focusDate(e))},changeDate:function(e){ne.set.date(e)},clear:function(){ne.set.date(oe)},popup:function(){return c.popup.apply(c,arguments)},focus:function(){(l.length?l:ee).focus()},blur:function(){(l.length?l:ee).blur()},helper:{dateFormat:function(e,t){if(!(t instanceof Date))return"";if("function"==typeof e)return e.call(ne,t,G);var n=t.getDate(),i=t.getMonth(),a=t.getFullYear(),o=t.getDay(),r=t.getHours(),s=t.getMinutes(),t=t.getSeconds(),l=ne.get.weekOfYear(a,i,n+1-G.firstDayOfWeek),c=r%12||12,u=(r<12?G.text.am:G.text.pm).toLowerCase(),d={D:n,DD:("0"+n).slice(-2),M:i+1,MM:("0"+(i+1)).slice(-2),MMM:G.text.monthsShort[i],MMMM:G.text.months[i],Y:a,YY:String(a).slice(2),YYYY:a,d:o,dd:G.text.dayNamesShort[o].slice(0,2),ddd:G.text.dayNamesShort[o],dddd:G.text.dayNames[o],h:c,hh:("0"+c).slice(-2),H:r,HH:("0"+r).slice(-2),m:s,mm:("0"+s).slice(-2),s:t,ss:("0"+t).slice(-2),a:u,A:u.toUpperCase(),S:["th","st","nd","rd"][3<n%10?0:(n%100-n%10!=10)*n%10],w:l,ww:("0"+l).slice(-2)};return e.replace(G.regExp.token,function(e){return e in d?d[e]:e.slice(1,e.length-1)})},isDisabled:function(n,i){return("day"===i||"month"===i||"year"===i||"hour"===i)&&("day"===i&&-1!==G.disabledDaysOfWeek.indexOf(n.getDay())||G.disabledDates.some(function(e){return(e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date?ne.helper.dateEqual(n,e,i):null!==e&&"object"==typeof e?e[_.year]?"number"==typeof e[_.year]?n.getFullYear()==e[_.year]:Array.isArray(e[_.year])?-1<e[_.year].indexOf(n.getFullYear()):void 0:e[_.month]?"number"==typeof e[_.month]?n.getMonth()==e[_.month]:Array.isArray(e[_.month])?-1<e[_.month].indexOf(n.getMonth()):e[_.month]instanceof Date?(t=ne.helper.sanitiseDate(e[_.month]),n.getMonth()==t.getMonth()&&n.getFullYear()==t.getFullYear()):void 0:e[_.date]&&"day"===i?e[_.date]instanceof Date?ne.helper.dateEqual(n,ne.helper.sanitiseDate(e[_.date]),i):Array.isArray(e[_.date])?e[_.date].some(function(e){return ne.helper.dateEqual(n,e,i)}):void 0:void 0:void 0;var t})||"hour"===i&&G.disabledHours.some(function(e){if((e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date)return ne.helper.dateEqual(n,e,i);if("number"==typeof e)return n.getHours()===e;if(null!==e&&"object"==typeof e){var t=!0;if(e[_.date])if(e[_.date]instanceof Date)t=ne.helper.dateEqual(n,ne.helper.sanitiseDate(e[_.date]));else if(Array.isArray(e[_.date]))return e[_.date].some(function(e){t=ne.helper.dateEqual(n,e,i)});if(e[_.days]&&("number"==typeof e[_.days]?t=n.getDay()==e[_.days]:Array.isArray(e[_.days])&&(t=-1<e[_.days].indexOf(n.getDay()))),e[_.hours])return"number"==typeof e[_.hours]?t&&n.getHours()==e[_.hours]:Array.isArray(e[_.hours])?t&&-1<e[_.hours].indexOf(n.getHours()):void 0}}))},isEnabled:function(t,n){return"day"!==n||(0===G.enabledDates.length||G.enabledDates.some(function(e){return(e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date?ne.helper.dateEqual(t,e,n):null!==e&&"object"==typeof e&&e[_.date]?ne.helper.dateEqual(t,ne.helper.sanitiseDate(e[_.date]),n):void 0}))},findDayAsObject:function(t,n,e){if("day"===n||"month"===n||"year"===n)for(var i,a=0;a<e.length;a++){if((i="string"==typeof(i=e[a])?ne.helper.sanitiseDate(i):i)instanceof Date&&ne.helper.dateEqual(t,i,n))return(o={})[_.date]=i,o;if(null!==i&&"object"==typeof i)if(i[_.year]){if("number"==typeof i[_.year]&&t.getFullYear()==i[_.year])return i;if(Array.isArray(i[_.year])&&-1<i[_.year].indexOf(t.getFullYear()))return i}else if(i[_.month]){if("number"==typeof i[_.month]&&t.getMonth()==i[_.month])return i;if(Array.isArray(i[_.month])){if(-1<i[_.month].indexOf(t.getMonth()))return i}else if(i[_.month]instanceof Date){var o=ne.helper.sanitiseDate(i[_.month]);if(t.getMonth()==o.getMonth()&&t.getFullYear()==o.getFullYear())return i}}else if(i[_.date]&&"day"===n){if(i[_.date]instanceof Date&&ne.helper.dateEqual(t,ne.helper.sanitiseDate(i[_.date]),n))return i;if(Array.isArray(i[_.date])&&i[_.date].some(function(e){return ne.helper.dateEqual(t,e,n)}))return i}}return null},findHourAsObject:function(t,n,e){if("hour"===n)for(var i,a=function(e,t){if(t[_.hours])return"number"==typeof t[_.hours]&&e.getHours()==t[_.hours]||Array.isArray(t[_.hours])&&-1<t[_.hours].indexOf(e.getHours())?t:void 0},o=0;o<e.length;o++){if("number"==typeof(i=e[o])&&t.getHours()==i)return null;if(null!==i&&"object"==typeof i)if(i[_.days]&&a(t,i)){if("number"==typeof i[_.days]&&t.getDay()==i[_.days])return i;if(Array.isArray(i[_.days])&&-1<i[_.days].indexOf(t.getDay()))return i}else if(i[_.date]&&a(t,i)){if(i[_.date]instanceof Date&&ne.helper.dateEqual(t,ne.helper.sanitiseDate(i[_.date])))return i;if(Array.isArray(i[_.date])&&i[_.date].some(function(e){return ne.helper.dateEqual(t,e,n)}))return i}else if(a(t,i))return i}return null},sanitiseDate:function(e){return!(e=e instanceof Date?e:i.date(""+e,G))||isNaN(e.getTime())?null:e},dateDiff:function(e,t,n){var i="time"===G.type,a="year"===(n=n||"day"),o=a||"month"===n,r="minute"===n,n=r||"hour"===n;return e=new Date(i?2e3:e.getFullYear(),i||a?0:e.getMonth(),i||o?1:e.getDate(),n?e.getHours():0,r?G.minTimeGap*Math.floor(e.getMinutes()/G.minTimeGap):0),(t=new Date(i?2e3:t.getFullYear(),i||a?0:t.getMonth(),i||o?1:t.getDate(),n?t.getHours():0,r?G.minTimeGap*Math.floor(t.getMinutes()/G.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,n){return!!e&&!!t&&0===ne.helper.dateDiff(e,t,n)},isDateInRange:function(e,t,n,i){var a;return n||i||(n=(a=ne.get.startDate())&&G.minDate?new Date(Math.max(a,G.minDate)):a||G.minDate,i=G.maxDate),n=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),G.minTimeGap*Math.ceil(n.getMinutes()/G.minTimeGap)),!(!e||n&&0<ne.helper.dateDiff(e,n,t)||i&&0<ne.helper.dateDiff(i,e,t))},dateInRange:function(e,t,n){t||n||(t=(i=ne.get.startDate())&&G.minDate?new Date(Math.max(i,G.minDate)):i||G.minDate,n=G.maxDate),t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),G.minTimeGap*Math.ceil(t.getMinutes()/G.minTimeGap));var i="time"===G.type;return e&&(t&&0<ne.helper.dateDiff(e,t,"minute")?i?ne.helper.mergeDateTime(e,t):t:n&&0<ne.helper.dateDiff(n,e,"minute")?i?ne.helper.mergeDateTime(e,n):n:e)},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===G.text.today}},setting:function(e,t){if(ne.debug("Changing setting",e,t),ae.isPlainObject(e))ae.extend(!0,G,e);else{if(t===oe)return G[e];ae.isPlainObject(G[e])?ae.extend(!0,G[e],t):G[e]=t}},internal:function(e,t){if(ae.isPlainObject(e))ae.extend(!0,ne,e);else{if(t===oe)return ne[e];ne[e]=t}},debug:function(){!G.silent&&G.debug&&(G.performance?ne.performance.log(arguments):(ne.debug=Function.prototype.bind.call(console.info,console,G.name+":"),ne.debug.apply(console,arguments)))},verbose:function(){!G.silent&&G.verbose&&G.debug&&(G.performance?ne.performance.log(arguments):(ne.verbose=Function.prototype.bind.call(console.info,console,G.name+":"),ne.verbose.apply(console,arguments)))},error:function(){G.silent||(ne.error=Function.prototype.bind.call(console.error,console,G.name+":"),ne.error.apply(console,arguments))},performance:{log:function(e){var t,n;G.performance&&(n=(t=(new Date).getTime())-(y||t),y=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":n})),clearTimeout(ne.performance.timer),ne.performance.timer=setTimeout(ne.performance.display,500)},display:function(){var e=G.name+":",n=0;y=!1,clearTimeout(ne.performance.timer),ae.each(x,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",b&&(e+=" '"+b+"'"),(console.group!==oe||console.table!==oe)&&0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):ae.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(i,e,t){var a,o,n,r=f;return e=e||k,t=u||t,"string"==typeof i&&r!==oe&&(i=i.split(/[\. ]/),a=i.length-1,ae.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(ae.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==oe)return o=r[n],!1;{if(!ae.isPlainObject(r[t])||e==a)return r[t]!==oe?o=r[t]:ne.error(s.method,i),!1;r=r[t]}}})),ae.isFunction(o)?n=o.apply(t,e):o!==oe&&(n=o),Array.isArray(v)?v.push(n):v!==oe?v=[v,n]:n!==oe&&(v=n),o}};C?(f===oe&&ne.initialize(),ne.invoke(w)):(f!==oe&&f.invoke("destroy"),ne.initialize())}),v!==oe?v:this},ae.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,monthOffset:0,minTimeGap:5,showWeekNumbers:!1,disabledHours:[],disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",observeChanges:!1,hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{yearHeader:function(e,t){e=10*Math.ceil(e.getFullYear()/10);return e-9+" - "+(2+e)},monthHeader:"YYYY",dayHeader:"MMMM YYYY",hourHeader:"MMMM D, YYYY",minuteHeader:"MMMM D, YYYY",dayColumnHeader:function(e,t){return t.text.days[e]},datetime:"MMMM D, YYYY h:mm A",date:"MMMM D, YYYY",time:"h:mm A",cellTime:"h:mm A",month:"MMMM YYYY",year:"YYYY",today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,n){}},parser:{date:function(e,t){if(e instanceof Date)return e;if(!e)return null;if(0===(e=String(e).trim().replace(/([.:\/\-])\s+/g,"$1").replace(/\s+([.:\/-])/g,"$1").replace(/\s+/g," ")).length)return null;e.match(/^[0-9]{4}[\/\-\.][0-9]{1,2}[\/\-\.][0-9]{1,2}$/)&&(e=e.replace(/[\/\-\.]/g,"/")+" 00:00:00"),e=t.monthFirst||!e.match(/^[0-9]{1,2}[\/\-\.]/)?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var n,i,a,o=new Date(e);if(!(null!==e.match(/^[0-9]+$/))&&!isNaN(o.getDate()))return o;e=e.toLowerCase();var r,s,l,c=-1,u=-1,d=-1,f=-1,p=-1,o=oe,m="time"===t.type,g=t.type.indexOf("time")<0,h=e.split(t.regExp.dateWords),v=e.split(t.regExp.dateNumbers);if(!g)for(o=0<=ae.inArray(t.text.am.toLowerCase(),h)||!(0<=ae.inArray(t.text.pm.toLowerCase(),h))&&oe,n=0;n<v.length;n++)if(0<=(s=v[n]).indexOf(":")){if(u<0||c<0)for(l=s.split(":"),a=0;a<Math.min(2,l.length);a++)i=parseInt(l[a]),isNaN(i)&&(i=0),0===a?u=i%24:c=i%60;v.splice(n,1)}if(!m){for(n=0;n<h.length;n++)if(!((r=h[n]).length<=0)){for(i=0;i<t.text.months.length;i++)if(t.text.months[i].substring(0,r.length).toLowerCase()===r){f=i+1;break}if(0<=f)break}for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&i>=t.centuryBreak&&n===v.length-1){i<=99&&(i+=t.currentCentury-100),p=i,v.splice(n,1);break}if(f<0)for(n=0;n<v.length;n++)if(a=1<n||t.monthFirst?n:1===n?0:1,i=parseInt(v[a]),!isNaN(i)&&1<=i&&i<=12){f=i,v.splice(a,1);break}for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&1<=i&&i<=31){d=i,v.splice(n,1);break}if(p<0)for(n=v.length-1;0<=n;n--)if(i=parseInt(v[n]),!isNaN(i)){i<=99&&(i+=t.currentCentury),p=i,v.splice(n,1);break}}if(!g){if(u<0)for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&0<=i&&i<=23){u=i,v.splice(n,1);break}if(c<0)for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&0<=i&&i<=59){c=i,v.splice(n,1);break}}if(c<0&&u<0&&d<0&&f<0&&p<0)return null;c<0&&(c=0),u<0&&(u=0),d<0&&(d=1),f<0&&(f=1),p<0&&(p=(new Date).getFullYear()),o!==oe&&(o?12===u&&(u=0):u<12&&(u+=12));e=new Date(p,f-1,d,u,c);return e.getMonth()===f-1&&e.getFullYear()===p||(e=new Date(p,f,0,u,c)),isNaN(e.getTime())?null:e}},onBeforeChange:function(e,t,n){return!0},onChange:function(e,t,n){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g,token:/d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[SAaY]|"[^"]*"|'[^']*'/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",inverted:"inverted",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year",hours:"hours",days:"days"},eventClass:"blue"}}(jQuery,window,document),function(D,S,A,E){"use strict";D.isFunction=D.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},S=void 0!==S&&S.Math==Math?S:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),D.fn.checkbox=function(u){var d,e=D(this),f=e.selector||"",x=(new Date).getTime(),w=[],C=u,k="string"==typeof C,T=[].slice.call(arguments,1);return e.each(function(){var e,p=D.extend(!0,{},D.fn.checkbox.settings,u),t=p.className,n=p.namespace,m=p.selector,s=p.error,i="."+n,a="module-"+n,g=D(this),o=D(this).children(m.label),h=D(this).children(m.input),v=h[0],r=!1,b=!1,l=g.data(a),c=this,y={initialize:function(){y.verbose("Initializing checkbox",p),y.create.label(),y.bind.events(),y.set.tabbable(),y.hide.input(),y.observeChanges(),y.instantiate(),y.setup()},instantiate:function(){y.verbose("Storing instance of module",y),l=y,g.data(a,y)},destroy:function(){y.verbose("Destroying module"),y.unbind.events(),y.show.input(),g.removeData(a)},fix:{reference:function(){g.is(m.input)&&(y.debug("Behavior called on <input> adjusting invoked element"),g=g.closest(m.checkbox),y.refresh())}},setup:function(){y.set.initialLoad(),y.is.indeterminate()?(y.debug("Initial value is indeterminate"),y.indeterminate()):y.is.checked()?(y.debug("Initial value is checked"),y.check()):(y.debug("Initial value is unchecked"),y.uncheck()),y.remove.initialLoad()},refresh:function(){o=g.children(m.label),h=g.children(m.input),v=h[0]},hide:{input:function(){y.verbose("Modifying <input> z-index to be unselectable"),h.addClass(t.hidden)}},show:{input:function(){y.verbose("Modifying <input> z-index to be selectable"),h.removeClass(t.hidden)}},observeChanges:function(){"MutationObserver"in S&&((e=new MutationObserver(function(e){y.debug("DOM tree modified, updating selector cache"),y.refresh()})).observe(c,{childList:!0,subtree:!0}),y.debug("Setting up mutation observer",e))},attachEvents:function(e,t){var n=D(e);t=D.isFunction(y[t])?y[t]:y.toggle,0<n.length?(y.debug("Attaching checkbox events to element",e,t),n.on("click"+i,t)):y.error(s.notFound)},preventDefaultOnInputTarget:function(){"undefined"!=typeof event&&null!==event&&D(event.target).is(m.input)&&(y.verbose("Preventing default check action after manual check action"),event.preventDefault())},event:{change:function(e){y.should.ignoreCallbacks()||p.onChange.call(v)},click:function(e){var t=D(e.target);t.is(m.input)?y.verbose("Using default check action on initialized checkbox"):t.is(m.link)?y.debug("Clicking link inside checkbox, skipping toggle"):(y.toggle(),h.focus(),e.preventDefault())},keydown:function(e){var t=e.which,n=13,i=32,a=27,o=37,r=38,s=39,l=40,c=y.get.radios(),u=c.index(g),d=c.length,f=!1;if(t==o||t==r?f=(0===u?d:u)-1:t!=s&&t!=l||(f=u===d-1?0:u+1),!y.should.ignoreCallbacks()&&!1!==f){if(!1===p.beforeUnchecked.apply(v))return y.verbose("Option not allowed to be unchecked, cancelling key navigation"),!1;if(!1===p.beforeChecked.apply(D(c[f]).children(m.input)[0]))return y.verbose("Next option should not allow check, cancelling key navigation"),!1}b=!1,t==a?(y.verbose("Escape key pressed blurring field"),h.blur(),b=!0):!e.ctrlKey&&y.can.change()&&(t==i||t==n&&p.enableEnterKey?(y.verbose("Enter/space key pressed, toggling checkbox"),y.toggle(),b=!0):g.is(".toggle, .slider")&&!y.is.radio()&&(t==o&&y.is.checked()?(y.uncheck(),b=!0):t==s&&y.is.unchecked()&&(y.check(),b=!0)))},keyup:function(e){b&&e.preventDefault()}},check:function(){y.should.allowCheck()&&(y.debug("Checking checkbox",h),y.set.checked(),y.should.ignoreCallbacks()||(p.onChecked.call(v),y.trigger.change()),y.preventDefaultOnInputTarget())},uncheck:function(){y.should.allowUncheck()&&(y.debug("Unchecking checkbox"),y.set.unchecked(),y.should.ignoreCallbacks()||(p.onUnchecked.call(v),y.trigger.change()),y.preventDefaultOnInputTarget())},indeterminate:function(){y.should.allowIndeterminate()?y.debug("Checkbox is already indeterminate"):(y.debug("Making checkbox indeterminate"),y.set.indeterminate(),y.should.ignoreCallbacks()||(p.onIndeterminate.call(v),y.trigger.change()))},determinate:function(){y.should.allowDeterminate()?y.debug("Checkbox is already determinate"):(y.debug("Making checkbox determinate"),y.set.determinate(),y.should.ignoreCallbacks()||(p.onDeterminate.call(v),y.trigger.change()))},enable:function(){y.is.enabled()?y.debug("Checkbox is already enabled"):(y.debug("Enabling checkbox"),y.set.enabled(),y.should.ignoreCallbacks()||(p.onEnable.call(v),p.onEnabled.call(v)))},disable:function(){y.is.disabled()?y.debug("Checkbox is already disabled"):(y.debug("Disabling checkbox"),y.set.disabled(),y.should.ignoreCallbacks()||(p.onDisable.call(v),p.onDisabled.call(v)))},get:{radios:function(){var e=y.get.name();return D('input[name="'+e+'"]').closest(m.checkbox)},otherRadios:function(){return y.get.radios().not(g)},name:function(){return h.attr("name")}},is:{initialLoad:function(){return r},radio:function(){return h.hasClass(t.radio)||"radio"==h.attr("type")},indeterminate:function(){return h.prop("indeterminate")!==E&&h.prop("indeterminate")},checked:function(){return h.prop("checked")!==E&&h.prop("checked")},disabled:function(){return h.prop("disabled")!==E&&h.prop("disabled")},enabled:function(){return!y.is.disabled()},determinate:function(){return!y.is.indeterminate()},unchecked:function(){return!y.is.checked()}},should:{allowCheck:function(){return y.is.determinate()&&y.is.checked()&&!y.is.initialLoad()?(y.debug("Should not allow check, checkbox is already checked"),!1):!(!y.should.ignoreCallbacks()&&!1===p.beforeChecked.apply(v))||(y.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return y.is.determinate()&&y.is.unchecked()&&!y.is.initialLoad()?(y.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!(!y.should.ignoreCallbacks()&&!1===p.beforeUnchecked.apply(v))||(y.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return y.is.indeterminate()&&!y.is.initialLoad()?(y.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!(!y.should.ignoreCallbacks()&&!1===p.beforeIndeterminate.apply(v))||(y.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return y.is.determinate()&&!y.is.initialLoad()?(y.debug("Should not allow determinate, checkbox is already determinate"),!1):!(!y.should.ignoreCallbacks()&&!1===p.beforeDeterminate.apply(v))||(y.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},ignoreCallbacks:function(){return r&&!p.fireOnInit}},can:{change:function(){return!(g.hasClass(t.disabled)||g.hasClass(t.readOnly)||h.prop("disabled")||h.prop("readonly"))},uncheck:function(){return"boolean"==typeof p.uncheckable?p.uncheckable:!y.is.radio()}},set:{initialLoad:function(){r=!0},checked:function(){y.verbose("Setting class to checked"),g.removeClass(t.indeterminate).addClass(t.checked),y.is.radio()&&y.uncheckOthers(),!y.is.indeterminate()&&y.is.checked()?y.debug("Input is already checked, skipping input property change"):(y.verbose("Setting state to checked",v),h.prop("indeterminate",!1).prop("checked",!0))},unchecked:function(){y.verbose("Removing checked class"),g.removeClass(t.indeterminate).removeClass(t.checked),!y.is.indeterminate()&&y.is.unchecked()?y.debug("Input is already unchecked"):(y.debug("Setting state to unchecked"),h.prop("indeterminate",!1).prop("checked",!1))},indeterminate:function(){y.verbose("Setting class to indeterminate"),g.addClass(t.indeterminate),y.is.indeterminate()?y.debug("Input is already indeterminate, skipping input property change"):(y.debug("Setting state to indeterminate"),h.prop("indeterminate",!0))},determinate:function(){y.verbose("Removing indeterminate class"),g.removeClass(t.indeterminate),y.is.determinate()?y.debug("Input is already determinate, skipping input property change"):(y.debug("Setting state to determinate"),h.prop("indeterminate",!1))},disabled:function(){y.verbose("Setting class to disabled"),g.addClass(t.disabled),y.is.disabled()?y.debug("Input is already disabled, skipping input property change"):(y.debug("Setting state to disabled"),h.prop("disabled","disabled"))},enabled:function(){y.verbose("Removing disabled class"),g.removeClass(t.disabled),y.is.enabled()?y.debug("Input is already enabled, skipping input property change"):(y.debug("Setting state to enabled"),h.prop("disabled",!1))},tabbable:function(){y.verbose("Adding tabindex to checkbox"),h.attr("tabindex")===E&&h.attr("tabindex",0)}},remove:{initialLoad:function(){r=!1}},trigger:{change:function(){var e,t=h[0];t&&(e=A.createEvent("HTMLEvents"),y.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{label:function(){0<h.prevAll(m.label).length?(h.prev(m.label).detach().insertAfter(h),y.debug("Moving existing label",o)):y.has.label()||(o=D("<label>").insertAfter(h),y.debug("Creating label",o))}},has:{label:function(){return 0<o.length}},bind:{events:function(){y.verbose("Attaching checkbox events"),g.on("click"+i,y.event.click).on("change"+i,y.event.change).on("keydown"+i,m.input,y.event.keydown).on("keyup"+i,m.input,y.event.keyup)}},unbind:{events:function(){y.debug("Removing events"),g.off(i)}},uncheckOthers:function(){var e=y.get.otherRadios();y.debug("Unchecking other radios",e),e.removeClass(t.checked)},toggle:function(){y.can.change()?y.is.indeterminate()||y.is.unchecked()?(y.debug("Currently unchecked"),y.check()):y.is.checked()&&y.can.uncheck()&&(y.debug("Currently checked"),y.uncheck()):y.is.radio()||y.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(e,t){if(y.debug("Changing setting",e,t),D.isPlainObject(e))D.extend(!0,p,e);else{if(t===E)return p[e];D.isPlainObject(p[e])?D.extend(!0,p[e],t):p[e]=t}},internal:function(e,t){if(D.isPlainObject(e))D.extend(!0,y,e);else{if(t===E)return y[e];y[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(x||t),x=t,w.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=p.name+":",n=0;x=!1,clearTimeout(y.performance.timer),D.each(w,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",f&&(e+=" '"+f+"'"),(console.group!==E||console.table!==E)&&0<w.length&&(console.groupCollapsed(e),console.table?console.table(w):D.each(w,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),w=[]}},invoke:function(i,e,t){var a,o,n,r=l;return e=e||T,t=c||t,"string"==typeof i&&r!==E&&(i=i.split(/[\. ]/),a=i.length-1,D.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(D.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==E)return o=r[n],!1;{if(!D.isPlainObject(r[t])||e==a)return r[t]!==E?o=r[t]:y.error(s.method,i),!1;r=r[t]}}})),D.isFunction(o)?n=o.apply(t,e):o!==E&&(n=o),Array.isArray(d)?d.push(n):d!==E?d=[d,n]:n!==E&&(d=n),o}};k?(l===E&&y.initialize(),y.invoke(C)):(l!==E&&l.invoke("destroy"),y.initialize())}),d!==E?d:this},D.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,enableEnterKey:!0,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(k,e,T,D){"use strict";k.isFunction=k.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k.fn.dimmer=function(g){var h,v=k(this),b=(new Date).getTime(),y=[],x=g,w="string"==typeof x,C=[].slice.call(arguments,1);return v.each(function(){var a,t,o=k.isPlainObject(g)?k.extend(!0,{},k.fn.dimmer.settings,g):k.extend({},k.fn.dimmer.settings),n=o.selector,e=o.namespace,i=o.className,s=o.error,r="."+e,l="module-"+e,c=v.selector||"",u="ontouchstart"in T.documentElement?"touchstart":"click",d=k(this),f=this,p=d.data(l),m={preinitialize:function(){a=m.is.dimmer()?(t=d.parent(),d):(t=d,m.has.dimmer()?o.dimmerName?t.find(n.dimmer).filter("."+o.dimmerName):t.find(n.dimmer):m.create())},initialize:function(){m.debug("Initializing dimmer",o),m.bind.events(),m.set.dimmable(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),p=m,d.data(l,p)},destroy:function(){m.verbose("Destroying previous module",a),m.unbind.events(),m.remove.variation(),t.off(r)},bind:{events:function(){"hover"==o.on?t.on("mouseenter"+r,m.show).on("mouseleave"+r,m.hide):"click"==o.on&&t.on(u+r,m.toggle),m.is.page()&&(m.debug("Setting as a page dimmer",t),m.set.pageDimmer()),m.is.closable()&&(m.verbose("Adding dimmer close event",a),t.on(u+r,n.dimmer,m.event.click))}},unbind:{events:function(){d.removeData(l),t.off(r)}},event:{click:function(e){m.verbose("Determining if event occurred on dimmer",e),0!==a.find(e.target).length&&!k(e.target).is(n.content)||(m.hide(),e.stopImmediatePropagation())}},addContent:function(e){e=k(e);m.debug("Add content to dimmer",e),e.parent()[0]!==a[0]&&e.detach().appendTo(a)},create:function(){var e=k(o.template.dimmer(o));return o.dimmerName&&(m.debug("Creating named dimmer",o.dimmerName),e.addClass(o.dimmerName)),e.appendTo(t),e},show:function(e){e=k.isFunction(e)?e:function(){},m.is.dimmed()&&!m.is.animating()||!m.is.enabled()?m.debug("Dimmer is already shown or disabled"):!1===o.onShow.call(f)?m.verbose("Show callback returned false cancelling dimmer show"):(m.debug("Showing dimmer",a,o),m.set.variation(),m.animate.show(e),o.onChange.call(f))},hide:function(e){e=k.isFunction(e)?e:function(){},m.is.dimmed()||m.is.animating()?!1===o.onHide.call(f)?m.verbose("Hide callback returned false cancelling dimmer hide"):(m.debug("Hiding dimmer",a),m.animate.hide(e),o.onChange.call(f)):m.debug("Dimmer is not visible")},toggle:function(){m.verbose("Toggling dimmer visibility",a),m.is.dimmed()?m.is.closable()&&m.hide():m.show()},animate:{show:function(e){e=k.isFunction(e)?e:function(){},o.useCSS&&k.fn.transition!==D&&a.transition("is supported")?(o.useFlex?(m.debug("Using flex dimmer"),m.remove.legacy()):(m.debug("Using legacy non-flex dimmer"),m.set.legacy()),"auto"!==o.opacity&&m.set.opacity(),a.transition({displayType:o.useFlex?"flex":"block",animation:(o.transition.showMethod||o.transition)+" in",queue:!1,duration:m.get.duration(),useFailSafe:!0,onStart:function(){m.set.dimmed()},onComplete:function(){m.set.active(),o.onVisible.call(a),e()}})):(m.verbose("Showing dimmer animation with javascript"),m.set.dimmed(),"auto"==o.opacity&&(o.opacity=.8),a.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(m.get.duration(),o.opacity,function(){a.removeAttr("style"),m.set.active(),o.onVisible.call(a),e()}))},hide:function(e){e=k.isFunction(e)?e:function(){},o.useCSS&&k.fn.transition!==D&&a.transition("is supported")?(m.verbose("Hiding dimmer with css"),a.transition({displayType:o.useFlex?"flex":"block",animation:(o.transition.hideMethod||o.transition)+" out",queue:!1,duration:m.get.duration(),useFailSafe:!0,onComplete:function(){m.remove.dimmed(),m.remove.variation(),m.remove.active(),o.onHidden.call(a),e()}})):(m.verbose("Hiding dimmer with javascript"),a.stop().fadeOut(m.get.duration(),function(){m.remove.dimmed(),m.remove.active(),a.removeAttr("style"),o.onHidden.call(a),e()}))}},get:{dimmer:function(){return a},duration:function(){return m.is.active()?o.transition.hideDuration||o.duration.hide||o.duration:o.transition.showDuration||o.duration.show||o.duration}},has:{dimmer:function(){return o.dimmerName?0<d.find(n.dimmer).filter("."+o.dimmerName).length:0<d.find(n.dimmer).length}},is:{active:function(){return a.hasClass(i.active)},animating:function(){return a.is(":animated")||a.hasClass(i.animating)},closable:function(){return"auto"==o.closable?"hover"!=o.on:o.closable},dimmer:function(){return d.hasClass(i.dimmer)},dimmable:function(){return d.hasClass(i.dimmable)},dimmed:function(){return t.hasClass(i.dimmed)},disabled:function(){return t.hasClass(i.disabled)},enabled:function(){return!m.is.disabled()},page:function(){return t.is("body")},pageDimmer:function(){return a.hasClass(i.pageDimmer)}},can:{show:function(){return!a.hasClass(i.disabled)}},set:{opacity:function(e){var t=a.css("background-color"),n=t.split(","),i=n&&3<=n.length;e=0===o.opacity?0:o.opacity||e,t=i?(n[2]=n[2].replace(")",""),n[3]=e+")",n.join(",")):"rgba(0, 0, 0, "+e+")",m.debug("Setting opacity to",e),a.css("background-color",t)},legacy:function(){a.addClass(i.legacy)},active:function(){a.addClass(i.active)},dimmable:function(){t.addClass(i.dimmable)},dimmed:function(){t.addClass(i.dimmed)},pageDimmer:function(){a.addClass(i.pageDimmer)},disabled:function(){a.addClass(i.disabled)},variation:function(e){(e=e||o.variation)&&a.addClass(e)}},remove:{active:function(){a.removeClass(i.active)},legacy:function(){a.removeClass(i.legacy)},dimmed:function(){t.removeClass(i.dimmed)},disabled:function(){a.removeClass(i.disabled)},variation:function(e){(e=e||o.variation)&&a.removeClass(e)}},setting:function(e,t){if(m.debug("Changing setting",e,t),k.isPlainObject(e))k.extend(!0,o,e);else{if(t===D)return o[e];k.isPlainObject(o[e])?k.extend(!0,o[e],t):o[e]=t}},internal:function(e,t){if(k.isPlainObject(e))k.extend(!0,m,e);else{if(t===D)return m[e];m[e]=t}},debug:function(){!o.silent&&o.debug&&(o.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,o.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),m.verbose.apply(console,arguments)))},error:function(){o.silent||(m.error=Function.prototype.bind.call(console.error,console,o.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var t,n;o.performance&&(n=(t=(new Date).getTime())-(b||t),b=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=o.name+":",n=0;b=!1,clearTimeout(m.performance.timer),k.each(y,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",c&&(e+=" '"+c+"'"),1<v.length&&(e+=" ("+v.length+")"),(console.group!==D||console.table!==D)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,t){var a,o,n,r=p;return e=e||C,t=f||t,"string"==typeof i&&r!==D&&(i=i.split(/[\. ]/),a=i.length-1,k.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(k.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==D)return o=r[n],!1;{if(!k.isPlainObject(r[t])||e==a)return r[t]!==D?o=r[t]:m.error(s.method,i),!1;r=r[t]}}})),k.isFunction(o)?n=o.apply(t,e):o!==D&&(n=o),Array.isArray(h)?h.push(n):h!==D?h=[h,n]:n!==D&&(h=n),o}};m.preinitialize(),w?(p===D&&m.initialize(),m.invoke(x)):(p!==D&&p.invoke("destroy"),m.initialize())}),h!==D?h:this},k.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},displayLoader:!1,loaderText:!1,loaderVariation:"",onChange:function(){},onShow:function(){},onHide:function(){},onVisible:function(){},onHidden:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show",loader:"ui loader"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(e){var t,n=k("<div/>").addClass("ui dimmer");return e.displayLoader&&(t=k("<div/>").addClass(e.className.loader).addClass(e.loaderVariation),e.loaderText&&(t.text(e.loaderText),t.addClass("text")),n.append(t)),n}}}}(jQuery,window,document),function(Z,ee,te,ne){"use strict";Z.isFunction=Z.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},ee=void 0!==ee&&ee.Math==Math?ee:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),Z.fn.dropdown=function(Y){var W,B=Z(this),$=Z(te),K=B.selector||"",Q=(new Date).getTime(),G=[],X=Y,J="string"==typeof X,_=[].slice.call(arguments,1);return B.each(function(L){var f,e,t,n,i,a,o,r,s,p=Z.isPlainObject(Y)?Z.extend(!0,{},Z.fn.dropdown.settings,Y):Z.extend({},Z.fn.dropdown.settings),m=p.className,g=p.message,l=p.fields,h=p.keys,v=p.metadata,j=p.namespace,c=p.regExp,b=p.selector,u=p.error,H=p.templates,d="."+j,y="module-"+j,x=Z(this),w=[ee,te].indexOf(p.context)<0?Z(te).find(p.context):Z(p.context),C=x.find(b.text),k=x.find(b.search),T=x.find(b.sizer),D=x.find(b.input),N=x.find(b.icon),V=x.find(b.clearIcon),S=0<x.prev().find(b.text).length?x.prev().find(b.text):x.prev(),A=x.children(b.menu),E=A.find(b.item),F=p.hideDividers?E.parent().children(b.divider):Z(),M=!1,z=!1,U=!1,O=!1,P=this,R=!1,I=x.data(y),q={initialize:function(){q.debug("Initializing dropdown",p),q.is.alreadySetup()?q.setup.reference():(p.ignoreDiacritics&&!String.prototype.normalize&&(p.ignoreDiacritics=!1,q.error(u.noNormalize,P)),q.setup.layout(),p.values&&(q.set.initialLoad(),q.change.values(p.values),q.remove.initialLoad()),q.refreshData(),q.save.defaults(),q.restore.selected(),q.create.id(),q.bind.events(),q.observeChanges(),q.instantiate())},instantiate:function(){q.verbose("Storing instance of dropdown",q),I=q,x.data(y,q)},destroy:function(){q.verbose("Destroying previous dropdown",x),q.remove.tabbable(),q.remove.active(),A.transition("stop all"),A.removeClass(m.visible).addClass(m.hidden),x.off(d).removeData(y),A.off(d),$.off(i),q.disconnect.menuObserver(),q.disconnect.selectObserver(),q.disconnect.classObserver()},observeChanges:function(){"MutationObserver"in ee&&(o=new MutationObserver(q.event.select.mutation),r=new MutationObserver(q.event.menu.mutation),s=new MutationObserver(q.event.class.mutation),q.debug("Setting up mutation observer",o,r,s),q.observe.select(),q.observe.menu(),q.observe.class())},disconnect:{menuObserver:function(){r&&r.disconnect()},selectObserver:function(){o&&o.disconnect()},classObserver:function(){s&&s.disconnect()}},observe:{select:function(){q.has.input()&&o&&o.observe(x[0],{attributes:!0,childList:!0,subtree:!0})},menu:function(){q.has.menu()&&r&&r.observe(A[0],{childList:!0,subtree:!0})},class:function(){q.has.search()&&s&&s.observe(x[0],{attributes:!0})}},create:{id:function(){a=(Math.random().toString(16)+"000000000").slice(2,10),i="."+a,q.verbose("Creating unique id for element",a)},userChoice:function(e){var n,i;return!!(e=e||q.get.userValues())&&(e=Array.isArray(e)?e:[e],Z.each(e,function(e,t){!1===q.get.item(t)&&(i=p.templates.addition(q.add.variables(g.addResult,t)),i=Z("<div />").html(i).attr("data-"+v.value,t).attr("data-"+v.text,t).addClass(m.addition).addClass(m.item),p.hideAdditions&&i.addClass(m.hidden),n=n===ne?i:n.add(i),q.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=q.get.userValues();t&&(q.debug("Adding user labels",t),Z.each(t,function(e,t){q.verbose("Adding custom user value"),q.add.label(t,t)}))},menu:function(){A=Z("<div />").addClass(m.menu).appendTo(x)},sizer:function(){T=Z("<span />").addClass(m.sizer).insertAfter(k)}},search:function(e){e=e!==ne?e:q.get.query(),q.verbose("Searching for query",e),!1===p.fireOnInit&&q.is.initialLoad()?q.verbose("Skipping callback on initial load",p.onSearch):q.has.minCharacters(e)&&!1!==p.onSearch.call(P,e)?q.filter(e):q.hide(null,!0)},select:{firstUnfiltered:function(){q.verbose("Selecting first non-filtered element"),q.remove.selectedItem(),E.not(b.unselectable).not(b.addition+b.hidden).eq(0).addClass(m.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(b.item).not(b.unselectable).eq(0),e=e.prevAll(b.item).not(b.unselectable).eq(0);0<t.length?(q.verbose("Moving selection to",t),t.addClass(m.selected)):(q.verbose("Moving selection to",e),e.addClass(m.selected))}},setup:{api:function(){var e={debug:p.debug,urlData:{value:q.get.value(),query:q.get.query()},on:!1};q.verbose("First request, initializing API"),x.api(e)},layout:function(){x.is("select")&&(q.setup.select(),q.setup.returnedObject()),q.has.menu()||q.create.menu(),q.is.clearable()&&!q.has.clearItem()&&(q.verbose("Adding clear icon"),V=Z("<i />").addClass("remove icon").insertBefore(C)),q.is.search()&&!q.has.search()&&(q.verbose("Adding search input"),k=Z("<input />").addClass(m.search).prop("autocomplete",q.is.chrome()?"fomantic-search":"off").insertBefore(C)),q.is.multiple()&&q.is.searchSelection()&&!q.has.sizer()&&q.create.sizer(),p.allowTab&&q.set.tabbable()},select:function(){var e=q.get.selectValues();q.debug("Dropdown initialized on a select",e),0<(D=x.is("select")?x:D).parent(b.dropdown).length?(q.debug("UI dropdown already exists. Creating dropdown menu only"),x=D.closest(b.dropdown),q.has.menu()||q.create.menu(),A=x.children(b.menu),q.setup.menu(e)):(q.debug("Creating entire dropdown from select"),x=Z("<div />").attr("class",D.attr("class")).addClass(m.selection).addClass(m.dropdown).html(H.dropdown(e,l,p.preserveHTML,p.className)).insertBefore(D),D.hasClass(m.multiple)&&!1===D.prop("multiple")&&(q.error(u.missingMultiple),D.prop("multiple",!0)),D.is("[multiple]")&&q.set.multiple(),D.prop("disabled")&&(q.debug("Disabling dropdown"),x.addClass(m.disabled)),D.is("[required]")&&(p.forceSelection=!0),D.removeAttr("required").removeAttr("class").detach().prependTo(x)),q.refresh()},menu:function(e){A.html(H.menu(e,l,p.preserveHTML,p.className)),E=A.find(b.item),F=p.hideDividers?E.parent().children(b.divider):Z()},reference:function(){q.debug("Dropdown behavior was called on select, replacing with closest dropdown"),x=x.parent(b.dropdown),I=x.data(y),P=x.get(0),q.refresh(),q.setup.returnedObject()},returnedObject:function(){var e=B.slice(0,L),t=B.slice(L+1);B=e.add(x).add(t)}},refresh:function(){q.refreshSelectors(),q.refreshData()},refreshItems:function(){E=A.find(b.item),F=p.hideDividers?E.parent().children(b.divider):Z()},refreshSelectors:function(){q.verbose("Refreshing selector cache"),C=x.find(b.text),k=x.find(b.search),D=x.find(b.input),N=x.find(b.icon),S=0<x.prev().find(b.text).length?x.prev().find(b.text):x.prev(),A=x.children(b.menu),E=A.find(b.item),F=p.hideDividers?E.parent().children(b.divider):Z()},refreshData:function(){q.verbose("Refreshing cached metadata"),E.removeData(v.text).removeData(v.value)},clearData:function(){q.verbose("Clearing metadata"),E.removeData(v.text).removeData(v.value),x.removeData(v.defaultText).removeData(v.defaultValue).removeData(v.placeholderText)},clearItems:function(){A.empty(),q.refreshItems()},toggle:function(){q.verbose("Toggling menu visibility"),q.is.active()?q.hide():q.show()},show:function(e,t){if(e=Z.isFunction(e)?e:function(){},(R||O)&&q.is.remote()&&q.is.noApiCache()&&q.clearItems(),!q.can.show()&&q.is.remote()&&(q.debug("No API results retrieved, searching before show"),q.queryRemote(q.get.query(),q.show,[e,t])),q.can.show()&&!q.is.active()){if(q.debug("Showing dropdown"),!q.has.message()||q.has.maxSelections()||q.has.allResultsFiltered()||q.remove.message(),q.is.allFiltered())return!0;!1!==p.onShow.call(P)&&q.animate.show(function(){q.bind.intent(),q.has.search()&&!t&&q.focusSearch(),q.set.visible(),e.call(P)})}},hide:function(e,t){var n;e=Z.isFunction(e)?e:function(){},q.is.active()&&!q.is.animatingOutward()?(q.debug("Hiding dropdown"),!1!==p.onHide.call(P)&&(q.animate.hide(function(){q.remove.visible(),q.is.focusedOnSearch()&&!0!==t&&k.blur(),e.call(P)}),0<(n=x.find(b.menu)).length&&(q.verbose("Hiding sub-menu",n),n.each(function(){q.animate.hide(!1,Z(this))})))):q.unbind.intent(),R=O=!1},hideOthers:function(){q.verbose("Finding other dropdowns to hide"),B.not(x).has(b.menu+"."+m.visible).dropdown("hide")},hideMenu:function(){q.verbose("Hiding menu instantaneously"),q.remove.active(),q.remove.visible(),A.transition("hide")},hideSubMenus:function(){var e=A.children(b.item).find(b.menu);q.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){q.bind.keyboardEvents(),q.bind.inputEvents(),q.bind.mouseEvents()},keyboardEvents:function(){q.verbose("Binding keyboard events"),x.on("keydown"+d,q.event.keydown),q.has.search()&&x.on(q.get.inputEvent()+d,b.search,q.event.input),q.is.multiple()&&$.on("keydown"+i,q.event.document.keydown)},inputEvents:function(){q.verbose("Binding input change events"),x.on("change"+d,b.input,q.event.change),q.is.multiple()&&q.is.searchSelection()&&x.on("paste"+d,b.search,q.event.paste)},mouseEvents:function(){q.verbose("Binding mouse events"),q.is.multiple()&&x.on("click"+d,b.label,q.event.label.click).on("click"+d,b.remove,q.event.remove.click),q.is.searchSelection()?(x.on("mousedown"+d,q.event.mousedown).on("mouseup"+d,q.event.mouseup).on("mousedown"+d,b.menu,q.event.menu.mousedown).on("mouseup"+d,b.menu,q.event.menu.mouseup).on("click"+d,b.icon,q.event.icon.click).on("click"+d,b.clearIcon,q.event.clearIcon.click).on("focus"+d,b.search,q.event.search.focus).on("click"+d,b.search,q.event.search.focus).on("blur"+d,b.search,q.event.search.blur).on("click"+d,b.text,q.event.text.focus),q.is.multiple()&&x.on("click"+d,q.event.click).on("click"+d,q.event.search.focus)):("click"==p.on?x.on("click"+d,b.icon,q.event.icon.click).on("click"+d,q.event.test.toggle):"hover"==p.on?x.on("mouseenter"+d,q.delay.show).on("mouseleave"+d,q.delay.hide).on("touchstart"+d,q.event.test.toggle).on("touchstart"+d,b.icon,q.event.icon.click):x.on(p.on+d,q.toggle),x.on("mousedown"+d,q.event.mousedown).on("mouseup"+d,q.event.mouseup).on("focus"+d,q.event.focus).on("click"+d,b.clearIcon,q.event.clearIcon.click),q.has.menuSearch()?x.on("blur"+d,b.search,q.event.search.blur):x.on("blur"+d,q.event.blur)),A.on("mouseenter"+d,b.item,q.event.item.mouseenter).on("touchstart"+d,b.item,q.event.item.mouseenter).on("mouseleave"+d,b.item,q.event.item.mouseleave).on("click"+d,b.item,q.event.item.click)},intent:function(){q.verbose("Binding hide intent event to document"),$.on("click"+i,q.event.test.hide)}},unbind:{intent:function(){q.verbose("Removing hide intent event from document"),$.off("click"+i)}},filter:function(e){function t(){q.is.multiple()&&q.filterActive(),(e||!e&&0==q.get.activeItem().length)&&q.select.firstUnfiltered(),q.has.allResultsFiltered()?p.onNoResults.call(P,n)?p.allowAdditions?p.hideAdditions&&(q.verbose("User addition with no menu, setting empty style"),q.set.empty(),q.hideMenu()):(q.verbose("All items filtered, showing message",n),q.add.message(g.noResults)):(q.verbose("All items filtered, hiding dropdown",n),q.hideMenu()):(q.remove.empty(),q.remove.message()),p.allowAdditions&&q.add.userSuggestion(q.escape.htmlEntities(e)),q.is.searchSelection()&&q.can.show()&&q.is.focusedOnSearch()&&q.show()}var n=e!==ne?e:q.get.query();p.useLabels&&q.has.maxSelections()||(p.apiSettings?q.can.useAPI()?q.queryRemote(n,function(){p.filterRemoteData&&q.filterItems(n);var e=D.val();Array.isArray(e)||(e=e&&""!==e?e.split(p.delimiter):[]),q.is.multiple()&&Z.each(e,function(e,t){E.filter('[data-value="'+t+'"]').addClass(m.filtered)}),q.focusSearch(!0),t()}):q.error(u.noAPI):(q.filterItems(n),t()))},queryRemote:function(e,o,r){Array.isArray(r)||(r=[r]);var e={errorDuration:!1,cache:"local",throttle:p.throttle,urlData:{query:e}},t={onError:function(e,t,n){q.add.message(g.serverError),R=O=!1,o.apply(null,r),"function"==typeof p.apiSettings.onError&&p.apiSettings.onError.call(this,e,t,n)},onFailure:function(e,t,n){q.add.message(g.serverError),R=O=!1,o.apply(null,r),"function"==typeof p.apiSettings.onFailure&&p.apiSettings.onFailure.call(this,e,t,n)},onSuccess:function(e,t,n){var i=e[l.remoteValues],a=(Array.isArray(i)||(i=[]),q.remove.message(),{});a[l.values]=i,q.setup.menu(a),0!==i.length||p.allowAdditions?""!==(a=q.is.multiple()?q.get.values():q.get.value())&&(q.verbose("Value(s) present after click icon, select value(s) in items"),q.set.selected(a,null,!0,!0)):q.add.message(g.noResults),R=O=!1,o.apply(null,r),"function"==typeof p.apiSettings.onSuccess&&p.apiSettings.onSuccess.call(this,e,t,n)}};x.api("get request")||q.setup.api(),e=Z.extend(!0,{},e,p.apiSettings,t),x.api("setting",e).api("query")},filterItems:function(e){var n=q.remove.diacritics(e!==ne?e:q.get.query()),i=null,e=q.escape.string(n),t=(p.ignoreSearchCase?"i":"")+"gm",a=new RegExp("^"+e,t);q.has.query()&&(i=[],q.verbose("Searching for matching values",n),E.each(function(){var e,t=Z(this);if(t.hasClass(m.unfilterable))return i.push(this),!0;if("both"===p.match||"text"===p.match){if(-1!==(e=q.remove.diacritics(String(q.get.choiceText(t,!1)))).search(a))return i.push(this),!0;if("exact"===p.fullTextSearch&&q.exactSearch(n,e))return i.push(this),!0;if(!0===p.fullTextSearch&&q.fuzzySearch(n,e))return i.push(this),!0}return("both"===p.match||"value"===p.match)&&(-1!==(t=q.remove.diacritics(String(q.get.choiceValue(t,e)))).search(a)||"exact"===p.fullTextSearch&&q.exactSearch(n,t)||!0===p.fullTextSearch&&q.fuzzySearch(n,t))?(i.push(this),!0):void 0})),q.debug("Showing only matched items",n),q.remove.filteredItem(),i&&E.not(i).addClass(m.filtered),q.has.query()?!0===p.hideDividers?F.addClass(m.hidden):"empty"===p.hideDividers&&F.removeClass(m.hidden).filter(function(){var e=Z(this).nextUntil(b.item);return 0===(e.length?e:Z(this)).nextUntil(b.divider).filter(b.item+":not(."+m.filtered+")").length}).addClass(m.hidden):F.removeClass(m.hidden)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=p.ignoreSearchCase?e.toLowerCase():e,t=p.ignoreSearchCase?t.toLowerCase():t,n<i)return!1;if(i===n)return e===t;e:for(var a=0,o=0;a<i;a++){for(var r=e.charCodeAt(a);o<n;)if(t.charCodeAt(o++)===r)continue e;return!1}return!0},exactSearch:function(e,t){return e=p.ignoreSearchCase?e.toLowerCase():e,-1<(t=p.ignoreSearchCase?t.toLowerCase():t).indexOf(e)},filterActive:function(){p.useLabels&&E.filter("."+m.active).addClass(m.filtered)},focusSearch:function(e){q.has.search()&&!q.is.focusedOnSearch()&&(e?(x.off("focus"+d,b.search),k.focus(),x.on("focus"+d,b.search,q.event.search.focus)):k.focus())},blurSearch:function(){q.has.search()&&k.blur()},forceSelection:function(){var e=E.not(m.filtered).filter("."+m.selected).eq(0),t=E.not(m.filtered).filter("."+m.active).eq(0),e=0<e.length?e:t,t=0<e.length;p.allowAdditions||t&&!q.is.multiple()?(q.debug("Forcing partial selection to selected item",e),q.event.item.click.call(e,{},!0)):q.remove.searchTerm()},change:{values:function(e){p.allowAdditions||q.clear(),q.debug("Creating dropdown with specified values",e);var t={};t[l.values]=e,q.setup.menu(t),Z.each(e,function(e,t){if(!0===t.selected&&(q.debug("Setting initial selection to",t[l.value]),q.set.selected(t[l.value]),!q.is.multiple()))return!1}),q.has.selectInput()&&(q.disconnect.selectObserver(),D.html(""),D.append("<option disabled selected value></option>"),Z.each(e,function(e,t){var n=p.templates.deQuote(t[l.value]),i=p.templates.escape(t[l.name]||"",p.preserveHTML);D.append('<option value="'+n+'"'+(!0===t.selected?" selected":"")+">"+i+"</option>")}),q.observe.select())}},event:{paste:function(e){(e.originalEvent.clipboardData||ee.clipboardData).getData("text").split(p.delimiter).forEach(function(e){q.set.selected(q.escape.htmlEntities(e.trim()),null,!0,!0)}),e.preventDefault()},change:function(){U||(q.debug("Input changed, updating selection"),q.set.selected())},focus:function(){p.showOnFocus&&!M&&q.is.hidden()&&!t&&(R=!0,q.show())},blur:function(e){t=te.activeElement===this,M||t||(q.remove.activeLabel(),q.hide())},mousedown:function(){q.is.searchSelection()?n=!0:M=!0},mouseup:function(){q.is.searchSelection()?n=!1:M=!1},click:function(e){Z(e.target).is(x)&&(q.is.focusedOnSearch()?q.show():q.focusSearch())},search:{focus:function(e){M=!0,q.is.multiple()&&q.remove.activeLabel(),R||q.is.active()||!(p.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)||"touchstart"===e.type||(R=!0,q.search())},blur:function(e){t=te.activeElement===this,!q.is.searchSelection()||n||z||t||(p.forceSelection?q.forceSelection():p.allowAdditions||q.remove.searchTerm(),q.hide()),n=!1}},clearIcon:{click:function(e){q.clear(),q.is.searchSelection()&&q.remove.searchTerm(),q.hide(),e.stopPropagation()}},icon:{click:function(e){O=!0,q.has.search()?q.is.active()?q.blurSearch():p.showOnFocus?q.focusSearch():q.toggle():q.toggle(),e.stopPropagation()}},text:{focus:function(e){M=!0,q.focusSearch()}},input:function(e){(q.is.multiple()||q.is.searchSelection())&&q.set.filtered(),clearTimeout(q.timer),q.timer=setTimeout(q.search,p.delay.search)},label:{click:function(e){var t=Z(this),n=x.find(b.label),i=n.filter("."+m.active),a=t.nextAll("."+m.active),o=t.prevAll("."+m.active),a=(0<a.length?t.nextUntil(a):t.prevUntil(o)).add(i).add(t);e.shiftKey?(i.removeClass(m.active),a.addClass(m.active)):e.ctrlKey?t.toggleClass(m.active):(i.removeClass(m.active),t.addClass(m.active)),p.onLabelSelect.apply(this,n.filter("."+m.active)),e.stopPropagation()}},remove:{click:function(e){var t=Z(this).parent();t.hasClass(m.active)?q.remove.activeLabels():q.remove.activeLabels(t),e.stopPropagation()}},test:{toggle:function(e){var t=q.is.multiple()?q.show:q.toggle;q.is.bubbledLabelClick(e)||q.is.bubbledIconClick(e)||(q.is.multiple()&&(!q.is.multiple()||q.is.active())||(R=!0),q.determine.eventOnElement(e,t)&&"touchstart"!==e.type&&e.preventDefault())},hide:function(e){q.determine.eventInModule(e,q.hide)&&P.id&&Z(e.target).attr("for")===P.id&&e.preventDefault()}},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&q.check.disabled()})}},select:{mutation:function(e){q.is.selectMutation(e)&&(q.debug("<select> modified, recreating menu"),q.disconnect.selectObserver(),q.refresh(),q.setup.select(),q.set.selected(),q.observe.select())}},menu:{mutation:function(e){var e=e[0],t=e.addedNodes?Z(e.addedNodes[0]):Z(!1),e=e.removedNodes?Z(e.removedNodes[0]):Z(!1),t=t.add(e),e=t.is(b.addition)||0<t.closest(b.addition).length,t=t.is(b.message)||0<t.closest(b.message).length;e||t?(q.debug("Updating item selector cache"),q.refreshItems()):(q.debug("Menu modified, updating selector cache"),q.refresh())},mousedown:function(){z=!0},mouseup:function(){z=!1}},item:{mouseenter:function(e){var t=Z(e.target),n=Z(this),i=n.children(b.menu),a=n.siblings(b.item).children(b.menu),n=0<i.length;0<i.find(t).length||!n||(clearTimeout(q.itemTimer),q.itemTimer=setTimeout(function(){q.verbose("Showing sub-menu",i),Z.each(a,function(){q.animate.hide(!1,Z(this))}),q.animate.show(!1,i)},p.delay.show),e.preventDefault())},mouseleave:function(e){var t=Z(this).find(b.menu);0<t.length&&(clearTimeout(q.itemTimer),q.itemTimer=setTimeout(function(){q.verbose("Hiding sub-menu",t),t.each(function(){q.animate.hide(!1,Z(this))})},p.delay.hide))},click:function(e,t){var n=Z(this),e=Z(e?e.target:""),i=n.find(b.menu),a=q.get.choiceText(n),o=q.get.choiceValue(n,a),r=0<i.length,i=0<i.find(e).length;"input"!==te.activeElement.tagName.toLowerCase()&&Z(te.activeElement).blur(),i||r&&!p.allowCategorySelection||(q.is.searchSelection()&&(p.allowAdditions&&q.remove.userAddition(),q.remove.searchTerm(),q.is.focusedOnSearch()||!0===t||q.focusSearch(!0)),p.useLabels||(q.remove.filteredItem(),q.set.scrollPosition(n)),q.determine.selectAction.call(this,a,o))}},document:{keydown:function(e){var t,n,i,a,o,r,s,l,c,u,d,f=e.which;q.is.inObject(f,h)&&((n=(t=x.find(b.label)).filter("."+m.active)).data(v.value),r=t.index(n),s=t.length,i=0<n.length,a=1<n.length,o=0===r,r=r+1==s,s=q.is.searchSelection(),l=q.is.focusedOnSearch(),c=q.is.focused(),d=(u=l&&0===q.get.caretPosition(!1))&&0!==q.get.caretPosition(!0),s&&!i&&!l||(f==h.leftArrow?!c&&!u||i?i&&(e.shiftKey?q.verbose("Adding previous label to selection"):(q.verbose("Selecting previous label"),t.removeClass(m.active)),o&&!a?n.addClass(m.active):n.prev(b.siblingLabel).addClass(m.active).end(),e.preventDefault()):(q.verbose("Selecting previous label"),t.last().addClass(m.active)):f==h.rightArrow?(c&&!i&&t.first().addClass(m.active),i&&(e.shiftKey?q.verbose("Adding next label to selection"):(q.verbose("Selecting next label"),t.removeClass(m.active)),r?s?l?t.removeClass(m.active):q.focusSearch():(a?n.next(b.siblingLabel):n).addClass(m.active):n.next(b.siblingLabel).addClass(m.active),e.preventDefault())):f==h.deleteKey||f==h.backspace?i?(q.verbose("Removing active labels"),r&&s&&!l&&q.focusSearch(),n.last().next(b.siblingLabel).addClass(m.active),q.remove.activeLabels(n),e.preventDefault()):!u||d||i||f!=h.backspace||(q.verbose("Removing last label on input backspace"),n=t.last().addClass(m.active),q.remove.activeLabels(n)):n.removeClass(m.active)))}},keydown:function(e){var t=e.which;if(q.is.inObject(t,h)||e.key===p.delimiter){var n,i=E.not(b.unselectable).filter("."+m.selected).eq(0),a=A.children("."+m.active).eq(0),i=0<i.length?i:a,a=0<i.length?i.siblings(":not(."+m.filtered+")").addBack():A.children(":not(."+m.filtered+")"),o=i.children(b.menu),r=i.closest(b.menu),s=r.hasClass(m.visible)||r.hasClass(m.animating)||0<r.parent(b.menu).length,l=0<o.length,c=0<i.length,u=0<i.not(b.unselectable).length,d=e.key===p.delimiter&&q.is.multiple();if(p.allowAdditions&&p.hideAdditions&&(t==h.enter||d)&&u&&(q.verbose("Selecting item from keyboard shortcut",i),q.event.item.click.call(i,e),q.is.searchSelection()&&q.remove.searchTerm(),q.is.multiple()&&e.preventDefault()),q.is.visible()){if(t!=h.enter&&!d||(t==h.enter&&c&&l&&!p.allowCategorySelection?(q.verbose("Pressed enter on unselectable category, opening sub menu"),t=h.rightArrow):u&&(q.verbose("Selecting item from keyboard shortcut",i),q.event.item.click.call(i,e),q.is.searchSelection()&&(q.remove.searchTerm(),q.is.multiple()&&k.focus())),e.preventDefault()),c&&(t==h.leftArrow&&r[0]!==A[0]&&(q.verbose("Left key pressed, closing sub-menu"),q.animate.hide(!1,r),i.removeClass(m.selected),r.closest(b.item).addClass(m.selected),e.preventDefault()),t==h.rightArrow&&l&&(q.verbose("Right key pressed, opening sub-menu"),q.animate.show(!1,o),i.removeClass(m.selected),o.find(b.item).eq(0).addClass(m.selected),e.preventDefault())),t==h.upArrow){if(n=(c&&s?i.prevAll(b.item+":not("+b.unselectable+")"):E).eq(0),a.index(n)<0)return q.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();q.verbose("Up key pressed, changing active item"),i.removeClass(m.selected),n.addClass(m.selected),q.set.scrollPosition(n),p.selectOnKeydown&&q.is.single()&&!n.hasClass(m.actionable)&&q.set.selectedItem(n),e.preventDefault()}if(t==h.downArrow){if(0===(n=(c&&s?i.nextAll(b.item+":not("+b.unselectable+")"):E).eq(0)).length)return q.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();q.verbose("Down key pressed, changing active item"),E.removeClass(m.selected),n.addClass(m.selected),q.set.scrollPosition(n),p.selectOnKeydown&&q.is.single()&&!n.hasClass(m.actionable)&&q.set.selectedItem(n),e.preventDefault()}t==h.pageUp&&(q.scrollPage("up"),e.preventDefault()),t==h.pageDown&&(q.scrollPage("down"),e.preventDefault()),t==h.escape&&(q.verbose("Escape key pressed, closing dropdown"),q.hide())}else d&&e.preventDefault(),t!=h.downArrow||q.is.visible()||(q.verbose("Down key pressed, showing dropdown"),q.show(),e.preventDefault())}else q.has.search()||q.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var e,t=D[0];t&&(e=te.createEvent("HTMLEvents"),q.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},determine:{selectAction:function(e,t){f=!0,q.verbose("Determining action",p.action),Z.isFunction(q.action[p.action])?(q.verbose("Triggering preset action",p.action,e,t),q.action[p.action].call(P,e,t,this)):Z.isFunction(p.action)?(q.verbose("Triggering user action",p.action,e,t),p.action.call(P,e,t,this)):q.error(u.action,p.action),f=!1},eventInModule:function(e,t){var e=Z(e.target),n=0<e.closest(te.documentElement).length,e=0<e.closest(x).length;return t=Z.isFunction(t)?t:function(){},n&&!e?(q.verbose("Triggering event",t),t(),!0):(q.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(e,t){var n=Z(e.target),i=n.closest(b.siblingLabel),e=te.body.contains(e.target),i=0===x.find(i).length||!(q.is.multiple()&&p.useLabels),n=0===n.closest(A).length;return t=Z.isFunction(t)?t:function(){},e&&i&&n?(q.verbose("Triggering event",t),t(),!0):(q.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(e,t,n){t=t!==ne?t:e,q.can.activate(Z(n))&&(q.set.selected(t,Z(n)),q.is.multiple()||!p.collapseOnActionable&&Z(n).hasClass(m.actionable)||q.hideAndClear())},select:function(e,t,n){t=t!==ne?t:e,q.can.activate(Z(n))&&(q.set.value(t,e,Z(n)),q.is.multiple()||!p.collapseOnActionable&&Z(n).hasClass(m.actionable)||q.hideAndClear())},combo:function(e,t,n){q.set.selected(t=t!==ne?t:e,Z(n)),q.hideAndClear()},hide:function(e,t,n){q.set.value(t,e,Z(n)),q.hideAndClear()}},get:{id:function(){return a},defaultText:function(){return x.data(v.defaultText)},defaultValue:function(){return x.data(v.defaultValue)},placeholderText:function(){return"auto"!=p.placeholder&&"string"==typeof p.placeholder?p.placeholder:x.data(v.placeholderText)||""},text:function(){return p.preserveHTML?C.html():C.text()},query:function(){return String(k.val()).trim()},searchWidth:function(e){return e=e!==ne?e:k.val(),T.text(e),Math.ceil(T.width()+(q.is.edge()?3:1))},selectionCount:function(){var e=q.get.values();return q.is.multiple()?Array.isArray(e)?e.length:0:""!==q.get.value()?1:0},transition:function(e){return"auto"===p.transition?q.is.upward(e)?"slide up":"slide down":p.transition},userValues:function(){var e=q.get.values();return!!e&&(e=Array.isArray(e)?e:[e],Z.grep(e,function(e){return!1===q.get.item(e)}))},uniqueArray:function(n){return Z.grep(n,function(e,t){return Z.inArray(e,n)===t})},caretPosition:function(e){var t,n,i=k.get(0);return e&&"selectionEnd"in i?i.selectionEnd:!e&&"selectionStart"in i?i.selectionStart:te.selection?(i.focus(),n=(t=te.selection.createRange()).text.length,e?n:(t.moveStart("character",-i.value.length),t.text.length-n)):void 0},value:function(){var e=0<D.length?D.val():x.data(v.value),t=Array.isArray(e)&&1===e.length&&""===e[0];return e===ne||t?"":e},values:function(e){var t=q.get.value();return""===t?"":!q.has.selectInput()&&q.is.multiple()?"string"==typeof t?(e?t:q.escape.htmlEntities(t)).split(p.delimiter):"":t},remoteValues:function(){var e=q.get.values(),i=!1;return e&&Z.each(e="string"==typeof e?[e]:e,function(e,t){var n=q.read.remoteData(t);q.verbose("Restoring value from session data",n,t),n&&((i=i||{})[t]=n)}),i},choiceText:function(e,t){if(t=t!==ne?t:p.preserveHTML,e)return 0<e.find(b.menu).length&&(q.verbose("Retrieving text of element with sub-menu"),(e=e.clone()).find(b.menu).remove(),e.find(b.menuIcon).remove()),e.data(v.text)!==ne?e.data(v.text):t?e.html()&&e.html().trim():e.text()&&e.text().trim()},choiceValue:function(e,t){return t=t||q.get.choiceText(e),!!e&&(e.data(v.value)!==ne?String(e.data(v.value)):"string"==typeof t?String(p.ignoreSearchCase?t.toLowerCase():t).trim():String(t))},inputEvent:function(){var e=k[0];return!!e&&(e.oninput!==ne?"input":e.onpropertychange!==ne?"propertychange":"keyup")},selectValues:function(){var o={},r=[],s=[];return x.find("option").each(function(){var e=Z(this),t=e.html(),n=e.attr("disabled"),i=e.attr("value")!==ne?e.attr("value"):t,a=e.data(v.text)!==ne?e.data(v.text):t,e=e.parent("optgroup");"auto"===p.placeholder&&""===i?o.placeholder=t:(e.length===r.length&&e[0]===r[0]||(s.push({type:"header",divider:p.headerDivider,name:e.attr("label")||""}),r=e),s.push({name:t,value:i,text:a,disabled:n}))}),p.placeholder&&"auto"!==p.placeholder&&(q.debug("Setting placeholder value to",p.placeholder),o.placeholder=p.placeholder),p.sortSelect?(!0===p.sortSelect?s.sort(function(e,t){return e.name.localeCompare(t.name)}):"natural"===p.sortSelect?s.sort(function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}):Z.isFunction(p.sortSelect)&&s.sort(p.sortSelect),o[l.values]=s,q.debug("Retrieved and sorted values from select",o)):(o[l.values]=s,q.debug("Retrieved values from select",o)),o},activeItem:function(){return E.filter("."+m.active)},selectedItem:function(){var e=E.not(b.unselectable).filter("."+m.selected);return 0<e.length?e:E.eq(0)},itemWithAdditions:function(e){var t=q.get.item(e),e=q.create.userChoice(e);return t=e&&0<e.length?0<t.length?t.add(e):e:t},item:function(n,i){var e,a,o=!1;return n=n!==ne?n:q.get.values()!==ne?q.get.values():q.get.text(),e=(a=q.is.multiple()&&Array.isArray(n))?0<n.length:n!==ne&&null!==n,i=""===n||!1===n||!0===n||(i||!1),e&&E.each(function(){var e=Z(this),t=q.get.choiceText(e),t=q.get.choiceValue(e,t);if(null!==t&&t!==ne)if(a)-1!==Z.inArray(q.escape.htmlEntities(String(t)),n.map(function(e){return String(e)}))&&(o=o?o.add(e):e);else if(i){if(q.verbose("Ambiguous dropdown value using strict type check",e,n),t===n)return o=e,!0}else if(p.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase()),q.escape.htmlEntities(String(t))===q.escape.htmlEntities(String(n)))return q.verbose("Found select item by value",t,n),o=e,!0}),o},displayType:function(){return x.hasClass("column")?"flex":p.displayType}},check:{maxSelections:function(e){return!p.maxSelections||((e=e!==ne?e:q.get.selectionCount())>=p.maxSelections?(q.debug("Maximum selection count reached"),p.useLabels&&(E.addClass(m.filtered),q.add.message(g.maxSelections)),!0):(q.verbose("No longer at maximum selection count"),q.remove.message(),q.remove.filteredItem(),q.is.searchSelection()&&q.filterItems(),!1))},disabled:function(){k.attr("tabindex",q.is.disabled()?-1:0)}},restore:{defaults:function(e){q.clear(e),q.restore.defaultText(),q.restore.defaultValue()},defaultText:function(){var e=q.get.defaultText();e===q.get.placeholderText?(q.debug("Restoring default placeholder text",e),q.set.placeholderText(e)):(q.debug("Restoring default text",e),q.set.text(e))},placeholderText:function(){q.set.placeholderText()},defaultValue:function(){var e=q.get.defaultValue();e!==ne&&(q.debug("Restoring default value",e),""!==e?(q.set.value(e),q.set.selected()):(q.remove.activeItem(),q.remove.selectedItem()))},labels:function(){p.allowAdditions&&(p.useLabels||(q.error(u.labels),p.useLabels=!0),q.debug("Restoring selected values"),q.create.userLabels()),q.check.maxSelections()},selected:function(){q.restore.values(),q.is.multiple()?(q.debug("Restoring previously selected values and labels"),q.restore.labels()):q.debug("Restoring previously selected values")},values:function(){q.set.initialLoad(),p.apiSettings&&p.saveRemoteData&&q.get.remoteValues()?q.restore.remoteValues():q.set.selected();var e=q.get.value();!e||""===e||Array.isArray(e)&&0===e.length?D.addClass(m.noselection):D.removeClass(m.noselection),q.remove.initialLoad()},remoteValues:function(){var e=q.get.remoteValues();q.debug("Recreating selected from session data",e),e&&(q.is.single()?Z.each(e,function(e,t){q.set.text(t)}):Z.each(e,function(e,t){q.add.label(e,t)}))}},read:{remoteData:function(e){if(ee.Storage!==ne)return(e=sessionStorage.getItem(e+i))!==ne&&e;q.error(u.noStorage)}},save:{defaults:function(){q.save.defaultText(),q.save.placeholderText(),q.save.defaultValue()},defaultValue:function(){var e=q.get.value();q.verbose("Saving default value as",e),x.data(v.defaultValue,e)},defaultText:function(){var e=q.get.text();q.verbose("Saving default text as",e),x.data(v.defaultText,e)},placeholderText:function(){var e;!1!==p.placeholder&&C.hasClass(m.placeholder)&&(e=q.get.text(),q.verbose("Saving placeholder text as",e),x.data(v.placeholderText,e))},remoteData:function(e,t){ee.Storage===ne?q.error(u.noStorage):(q.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t+i,e))}},clear:function(e){q.is.multiple()&&p.useLabels?q.remove.labels(x.find(b.label),e):(q.remove.activeItem(),q.remove.selectedItem(),q.remove.filteredItem()),q.set.placeholderText(),q.clearValue(e)},clearValue:function(e){q.set.value("",null,null,e)},scrollPage:function(e,t){var t=t||q.get.selectedItem(),n=t.closest(b.menu),i=n.outerHeight(),a=n.scrollTop(),o=E.eq(0).outerHeight(),i=Math.floor(i/o),a=(n.prop("scrollHeight"),"up"==e?a-o*i:a+o*i),o=E.not(b.unselectable),i="up"==e?o.index(t)-i:o.index(t)+i,i=("up"==e?0<=i:i<o.length)?o.eq(i):"up"==e?o.first():o.last();0<i.length&&(q.debug("Scrolling page",e,i),t.removeClass(m.selected),i.addClass(m.selected),p.selectOnKeydown&&q.is.single()&&!$nextItem.hasClass(m.actionable)&&q.set.selectedItem(i),n.scrollTop(a))},set:{filtered:function(){var e=q.is.multiple(),t=q.is.searchSelection(),n=e&&t,t=t?q.get.query():"",i="string"==typeof t&&0<t.length,a=q.get.searchWidth(),t=""!==t;e&&i&&(q.verbose("Adjusting input width",a,p.glyphWidth),k.css("width",a)),i||n&&t?(q.verbose("Hiding placeholder text"),C.addClass(m.filtered)):e&&(!n||t)||(q.verbose("Showing placeholder text"),C.removeClass(m.filtered))},empty:function(){x.addClass(m.empty)},loading:function(){x.addClass(m.loading)},placeholderText:function(e){e=e||q.get.placeholderText(),q.debug("Setting placeholder text",e),q.set.text(e),C.addClass(m.placeholder)},tabbable:function(){q.is.searchSelection()?(q.debug("Added tabindex to searchable dropdown"),k.val(""),q.check.disabled(),A.attr("tabindex",-1)):(q.debug("Added tabindex to dropdown"),x.attr("tabindex")===ne&&(x.attr("tabindex",0),A.attr("tabindex",-1)))},initialLoad:function(){q.verbose("Setting initial load"),e=!0},activeItem:function(e){p.allowAdditions&&0<e.filter(b.addition).length?e.addClass(m.filtered):e.addClass(m.active)},partialSearch:function(e){var t=q.get.query().length;k.val(e.slice(0,t))},scrollPosition:function(e,t){var n,i,a=(e=e||q.get.selectedItem()).closest(b.menu),o=e&&0<e.length;t=t!==ne&&t,0===q.get.activeItem().length&&(t=!1),e&&0<a.length&&o&&(e.position().top,a.addClass(m.loading),e=(o=a.scrollTop())-a.offset().top+e.offset().top,t||(i=o+a.height()<e+5,n=e-5<o),q.debug("Scrolling to active item",e),(t||n||i)&&a.scrollTop(e),a.removeClass(m.loading))},text:function(e){"combo"===p.action?(q.debug("Changing combo button text",e,S),p.preserveHTML?S.html(e):S.text(e)):"activate"===p.action&&(e!==q.get.placeholderText()&&C.removeClass(m.placeholder),q.debug("Changing text",e,C),C.removeClass(m.filtered),p.preserveHTML?C.html(e):C.text(e))},selectedItem:function(e){var t=q.get.choiceValue(e),n=q.get.choiceText(e,!1),i=q.get.choiceText(e,!0);q.debug("Setting user selection to item",e),q.remove.activeItem(),q.set.partialSearch(n),q.set.activeItem(e),q.set.selected(t,e),q.set.text(i)},selectedLetter:function(e){var t,n=E.filter("."+m.selected),i=0<n.length&&q.has.firstLetter(n,e),a=!1;i&&(t=n.nextAll(E).eq(0),q.has.firstLetter(t,e)&&(a=t)),a||E.each(function(){if(q.has.firstLetter(Z(this),e))return a=Z(this),!1}),a&&(q.verbose("Scrolling to next value with letter",e),q.set.scrollPosition(a),n.removeClass(m.selected),a.addClass(m.selected),p.selectOnKeydown&&q.is.single()&&!t.hasClass(m.actionable)&&q.set.selectedItem(a))},direction:function(e){"auto"===p.direction?(e?q.is.upward(e)&&q.remove.upward(e):q.remove.upward(),(q.can.openDownward(e)?q.remove:q.set).upward(e),q.is.leftward(e)||q.can.openRightward(e)||q.set.leftward(e)):"upward"===p.direction&&q.set.upward(e)},upward:function(e){(e||x).addClass(m.upward)},leftward:function(e){(e||A).addClass(m.leftward)},value:function(e,t,n,i){"boolean"==typeof t&&(i=t,t=n=ne),e===ne||""===e||Array.isArray(e)&&0===e.length?D.addClass(m.noselection):D.removeClass(m.noselection);var a=q.escape.value(e),o=0<D.length,r=q.get.values(),s=e!==ne?String(e):e;if(o){if(!p.allowReselection&&s==r&&(q.verbose("Skipping value update already same value",e,r),!q.is.initialLoad()))return;q.is.single()&&q.has.selectInput()&&q.can.extendSelect()&&(q.debug("Adding user option",e),q.add.optionValue(e)),q.debug("Updating input value",a,r),U=!0,D.val(a),!1===p.fireOnInit&&q.is.initialLoad()?q.debug("Input native change event ignored on initial load"):!0!==i&&q.trigger.change(),U=!1}else q.verbose("Storing value in metadata",a,D),a!==r&&x.data(v.value,s);!1===p.fireOnInit&&q.is.initialLoad()?q.verbose("No callback on initial load",p.onChange):!0!==i&&p.onChange.call(P,e,t,n)},active:function(){x.addClass(m.active)},multiple:function(){x.addClass(m.multiple)},visible:function(){x.addClass(m.visible)},exactly:function(e,t,n){"boolean"==typeof t&&(n=t,t=ne),q.debug("Setting selected to exact values"),q.clear(),q.set.selected(e,t,n)},selected:function(e,l,c,u){"boolean"==typeof l&&(u=c,c=l,l=ne);var d=q.is.multiple();(l=p.allowAdditions?l||q.get.itemWithAdditions(e):l||q.get.item(e))&&(q.debug("Setting selected menu item to",l),q.is.multiple()&&q.remove.searchWidth(),q.is.single()?(q.remove.activeItem(),q.remove.selectedItem()):p.useLabels&&q.remove.selectedItem(),l.each(function(){var e=Z(this),t=q.get.choiceText(e),n=q.get.choiceValue(e,t),i=e.hasClass(m.filtered),a=e.hasClass(m.active),o=e.hasClass(m.actionable),r=e.hasClass(m.addition),s=d&&l&&1===l.length;o?(d&&a&&!r||!p.apiSettings||!p.saveRemoteData||q.save.remoteData(t,n),p.onActionable.call(P,n,t,e)):d?!a||r?(p.apiSettings&&p.saveRemoteData&&q.save.remoteData(t,n),p.useLabels?(q.add.value(n,t,e,c),q.add.label(n,t,s),q.set.activeItem(e),q.filterActive(),q.select.nextAvailable(l)):(q.add.value(n,t,e,c),q.set.text(q.add.variables(g.count)),q.set.activeItem(e))):i||!p.useLabels&&!f||(q.debug("Selected active value, removing label"),q.remove.selected(n)):(p.apiSettings&&p.saveRemoteData&&q.save.remoteData(t,n),u||e.hasClass(m.actionable)||q.set.text(t),q.set.value(n,t,e,c),e.addClass(m.active).addClass(m.selected))}),u||q.remove.searchTerm())}},add:{label:function(e,t,n){var i,a=q.is.searchSelection()?k:C,o=q.escape.value(e);p.ignoreCase&&(o=o.toLowerCase()),i=Z("<a />").addClass(m.label).attr("data-"+v.value,o).html(H.label(o,t,p.preserveHTML,p.className)),i=p.onLabelCreate.call(i,o,t),q.has.label(e)?q.debug("User selection already exists, skipping",o):(p.label.variation&&i.addClass(p.label.variation),!0===n?(q.debug("Animating in label",i),i.addClass(m.hidden).insertBefore(a).transition({animation:p.label.transition,debug:p.debug,verbose:p.verbose,duration:p.label.duration})):(q.debug("Adding selection label",i),i.insertBefore(a)))},message:function(e){var t=A.children(b.message),e=p.templates.message(q.add.variables(e));0<t.length?t.html(e):Z("<div/>").html(e).addClass(m.message).appendTo(A)},optionValue:function(e){var t=q.escape.value(e);0<D.find('option[value="'+q.escape.string(t)+'"]').length||(q.disconnect.selectObserver(),q.is.single()&&(q.verbose("Removing previous user addition"),D.find("option."+m.addition).remove()),Z("<option/>").prop("value",t).addClass(m.addition).text(e).appendTo(D),q.verbose("Adding user addition as an <option>",e),q.observe.select())},userSuggestion:function(e){var t=A.children(b.addition),n=q.get.item(e),n=n&&n.not(b.addition).length,i=0<t.length;p.useLabels&&q.has.maxSelections()||(""===e||n?t.remove():(i?(t.data(v.value,e).data(v.text,e).attr("data-"+v.value,e).attr("data-"+v.text,e).removeClass(m.filtered),p.hideAdditions||(n=p.templates.addition(q.add.variables(g.addResult,e)),t.html(n)),q.verbose("Replacing user suggestion with new value",t)):((t=q.create.userChoice(e)).prependTo(A),q.verbose("Adding item choice to menu corresponding with user choice addition",t)),p.hideAdditions&&!q.is.allFiltered()||t.addClass(m.selected).siblings().removeClass(m.selected),q.refreshItems()))},variables:function(e,t){var n,i=-1!==e.search("{count}"),a=-1!==e.search("{maxCount}"),o=-1!==e.search("{term}");return q.verbose("Adding templated variables to message",e),i&&(n=q.get.selectionCount(),e=e.replace("{count}",n)),a&&(n=q.get.selectionCount(),e=e.replace("{maxCount}",p.maxSelections)),o&&(i=t||q.get.query(),e=e.replace("{term}",i)),e},value:function(e,t,n,i){"boolean"==typeof t&&(i=t,t=n=ne);var a,o=q.get.values(!0);q.has.value(e)?q.debug("Value already selected"):""===e?q.debug("Cannot select blank values from multiselect"):(a=Array.isArray(o)?(a=n&&n.hasClass(m.actionable)?o:o.concat([e]),q.get.uniqueArray(a)):[e],q.has.selectInput()?q.can.extendSelect()&&(q.debug("Adding value to select",e,a,D),q.add.optionValue(e)):(a=a.join(p.delimiter),q.debug("Setting hidden input to delimited value",a,D)),!1===p.fireOnInit&&q.is.initialLoad()?q.verbose("Skipping onadd callback on initial load",p.onAdd):p.onAdd.call(P,e,t,n),q.set.value(a,t,n,i),q.check.maxSelections())}},remove:{active:function(){x.removeClass(m.active)},activeLabel:function(){x.find(b.label).removeClass(m.active)},empty:function(){x.removeClass(m.empty)},loading:function(){x.removeClass(m.loading)},initialLoad:function(){e=!1},upward:function(e){(e||x).removeClass(m.upward)},leftward:function(e){(e||A).removeClass(m.leftward)},visible:function(){x.removeClass(m.visible)},activeItem:function(){E.removeClass(m.active)},filteredItem:function(){p.useLabels&&q.has.maxSelections()||((p.useLabels&&q.is.multiple()?E.not("."+m.active):E).removeClass(m.filtered),p.hideDividers&&F.removeClass(m.hidden),q.remove.empty())},optionValue:function(e){var e=q.escape.value(e),t=D.find('option[value="'+q.escape.string(e)+'"]');0<t.length&&t.hasClass(m.addition)&&(q.disconnect.selectObserver(),t.remove(),q.verbose("Removing user addition as an <option>",e),q.observe.select())},message:function(){A.children(b.message).remove()},searchWidth:function(){k.css("width","")},searchTerm:function(){q.verbose("Cleared search term"),k.val(""),q.set.filtered()},userAddition:function(){E.filter(b.addition).remove()},selected:function(e,t,i){if(!(t=p.allowAdditions?t||q.get.itemWithAdditions(e):t||q.get.item(e)))return!1;t.each(function(){var e=Z(this),t=q.get.choiceText(e),n=q.get.choiceValue(e,t);q.is.multiple()?p.useLabels?(q.remove.value(n,t,e,i),q.remove.label(n)):(q.remove.value(n,t,e,i),0===q.get.selectionCount()?q.set.placeholderText():q.set.text(q.add.variables(g.count))):q.remove.value(n,t,e,i),e.removeClass(m.filtered).removeClass(m.active),p.useLabels&&e.removeClass(m.selected)})},selectedItem:function(){E.removeClass(m.selected)},value:function(e,t,n,i){var a,o=q.get.values();e=q.escape.htmlEntities(e),q.has.selectInput()?(q.verbose("Input is <select> removing selected option",e),a=q.remove.arrayValue(e,o),q.remove.optionValue(e)):(q.verbose("Removing from delimited values",e),a=(a=q.remove.arrayValue(e,o)).join(p.delimiter)),!1===p.fireOnInit&&q.is.initialLoad()?q.verbose("No callback on initial load",p.onRemove):p.onRemove.call(P,e,t,n),q.set.value(a,t,n,i),q.check.maxSelections()},arrayValue:function(t,e){return Array.isArray(e)||(e=[e]),e=Z.grep(e,function(e){return t!=e}),q.verbose("Removed value from delimited string",t,e),e},label:function(e,t){e=q.escape.value(e),e=x.find(b.label).filter("[data-"+v.value+'="'+q.escape.string(p.ignoreCase?e.toLowerCase():e)+'"]');q.verbose("Removing label",e),e.remove()},activeLabels:function(e){e=e||x.find(b.label).filter("."+m.active),q.verbose("Removing active label selections",e),q.remove.labels(e)},labels:function(e,a){e=e||x.find(b.label),q.verbose("Removing labels",e),e.each(function(){var e=Z(this),t=e.data(v.value),n=t!==ne?String(t):t,i=q.is.userValue(n);!1===p.onLabelRemove.call(e,t)?q.debug("Label remove callback cancelled removal"):(q.remove.message(),i?(q.remove.value(n,n,q.get.item(n),a),q.remove.label(n)):q.remove.selected(n,!1,a))})},tabbable:function(){q.is.searchSelection()?(q.debug("Searchable dropdown initialized"),k.removeAttr("tabindex")):(q.debug("Simple selection dropdown initialized"),x.removeAttr("tabindex")),A.removeAttr("tabindex")},diacritics:function(e){return p.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},has:{menuSearch:function(){return q.has.search()&&0<k.closest(A).length},clearItem:function(){return 0<V.length},search:function(){return 0<k.length},sizer:function(){return 0<T.length},selectInput:function(){return D.is("select")},minCharacters:function(e){return p.minCharacters&&!O?(e=e!==ne?String(e):String(q.get.query())).length>=p.minCharacters:!(O=!1)},firstLetter:function(e,t){return!(!e||0===e.length||"string"!=typeof t)&&(e=q.get.choiceText(e,!1),(t=t.toLowerCase())==String(e).charAt(0).toLowerCase())},input:function(){return 0<D.length},items:function(){return 0<E.length},menu:function(){return 0<A.length},subMenu:function(e){return 0<(e||A).find(b.menu).length},message:function(){return 0!==A.children(b.message).length},label:function(e){var e=q.escape.value(e),t=x.find(b.label);return p.ignoreCase&&(e=e.toLowerCase()),0<t.filter("[data-"+v.value+'="'+q.escape.string(e)+'"]').length},maxSelections:function(){return p.maxSelections&&q.get.selectionCount()>=p.maxSelections},allResultsFiltered:function(){var e=E.not(b.addition);return e.filter(b.unselectable).length===e.length},userSuggestion:function(){return 0<A.children(b.addition).length},query:function(){return""!==q.get.query()},value:function(e){return p.ignoreCase?q.has.valueIgnoringCase(e):q.has.valueMatchingCase(e)},valueMatchingCase:function(e){var t=q.get.values(!0);return!!(Array.isArray(t)?t&&-1!==Z.inArray(e,t):t==e)},valueIgnoringCase:function(n){var e=q.get.values(!0),i=!1;return Array.isArray(e)||(e=[e]),Z.each(e,function(e,t){if(String(n).toLowerCase()==String(t).toLowerCase())return!(i=!0)}),i}},is:{active:function(){return x.hasClass(m.active)},animatingInward:function(){return A.transition("is inward")},animatingOutward:function(){return A.transition("is outward")},bubbledLabelClick:function(e){return Z(e.target).is("select, input")&&0<x.closest("label").length},bubbledIconClick:function(e){return 0<Z(e.target).closest(N).length},edge:function(){return!!ee.chrome&&!!ee.StyleMedia},chrome:function(){return!!ee.chrome&&!ee.StyleMedia},alreadySetup:function(){return x.is("select")&&x.parent(b.dropdown).data(y)!==ne&&0===x.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):A.transition&&A.transition("is animating")},leftward:function(e){return(e||A).hasClass(m.leftward)},clearable:function(){return x.hasClass(m.clearable)||p.clearable},disabled:function(){return x.hasClass(m.disabled)},focused:function(){return te.activeElement===x[0]},focusedOnSearch:function(){return te.activeElement===k[0]},allFiltered:function(){return(q.is.multiple()||q.has.search())&&!(0==p.hideAdditions&&q.has.userSuggestion())&&!q.has.message()&&q.has.allResultsFiltered()},hidden:function(e){return!q.is.visible(e)},initialLoad:function(){return e},inObject:function(n,e){var i=!1;return Z.each(e,function(e,t){if(t==n)return i=!0}),i},multiple:function(){return x.hasClass(m.multiple)},remote:function(){return p.apiSettings&&q.can.useAPI()},noApiCache:function(){return p.apiSettings&&!p.apiSettings.cache},single:function(){return!q.is.multiple()},selectMutation:function(e){var n=!1;return Z.each(e,function(e,t){if(Z(t.target).is("select, option, optgroup")||Z(t.addedNodes).is("select"))return!(n=!0)}),n},search:function(){return x.hasClass(m.search)},searchSelection:function(){return q.has.search()&&1===k.parent(b.dropdown).length},selection:function(){return x.hasClass(m.selection)},userValue:function(e){return-1!==Z.inArray(e,q.get.userValues())},upward:function(e){return(e||x).hasClass(m.upward)},visible:function(e){return(e||A).hasClass(m.visible)},verticallyScrollableContext:function(){var e=w.get(0)!==ee&&w.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=w.get(0)!==ee&&w.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!p.useLabels||(!q.has.maxSelections()||!(!q.has.maxSelections()||!e.hasClass(m.active)))},openDownward:function(e){var t,e=e||A,n=!0;return e.addClass(m.loading),t={context:{offset:w.get(0)===ee?{top:0,left:0}:w.offset(),scrollTop:w.scrollTop(),height:w.outerHeight()},menu:{offset:e.offset(),height:e.outerHeight()}},q.is.verticallyScrollableContext()&&(t.menu.offset.top+=t.context.scrollTop),q.has.subMenu(e)&&(t.menu.height+=e.find(b.menu).first().outerHeight()),n=(t={above:t.context.scrollTop<=t.menu.offset.top-t.context.offset.top-t.menu.height,below:t.context.scrollTop+t.context.height>=t.menu.offset.top-t.context.offset.top+t.menu.height}).below?(q.verbose("Dropdown can fit in context downward",t),!0):t.above?(q.verbose("Dropdown cannot fit below, opening upward",t),!1):(q.verbose("Dropdown cannot fit in either direction, favoring downward",t),!0),e.removeClass(m.loading),n},openRightward:function(e){var t,e=e||A,n=!0;return e.addClass(m.loading),t={context:{offset:w.get(0)===ee?{top:0,left:0}:w.offset(),scrollLeft:w.scrollLeft(),width:w.outerWidth()},menu:{offset:e.offset(),width:e.outerWidth()}},q.is.horizontallyScrollableContext()&&(t.menu.offset.left+=t.context.scrollLeft),(t=t.menu.offset.left-t.context.offset.left+t.menu.width>=t.context.scrollLeft+t.context.width)&&(q.verbose("Dropdown cannot fit in context rightward",t),n=!1),e.removeClass(m.loading),n},extendSelect:function(){return p.allowAdditions||p.apiSettings},show:function(){return!q.is.disabled()&&(q.has.items()||q.has.message())},useAPI:function(){return Z.fn.api!==ne}},animate:{show:function(e,t){var n=t||A,i=t?function(){}:function(){q.hideSubMenus(),q.hideOthers(),q.set.active()};e=Z.isFunction(e)?e:function(){},q.verbose("Doing menu show animation",n),q.set.direction(t),t=p.transition.showMethod||q.get.transition(t),q.is.selection()&&q.set.scrollPosition(q.get.selectedItem(),!0),(q.is.hidden(n)||q.is.animating(n))&&("none"===t?(i(),n.transition({displayType:q.get.displayType()}).transition("show"),e.call(P)):Z.fn.transition!==ne&&x.transition("is supported")?n.transition({animation:t+" in",debug:p.debug,verbose:p.verbose,duration:p.transition.showDuration||p.duration,queue:!0,onStart:i,displayType:q.get.displayType(),onComplete:function(){e.call(P)}}):q.error(u.noTransition,t))},hide:function(e,t){var n=t||A,i=t?function(){}:function(){q.unbind.intent(),q.remove.active()},t=p.transition.hideMethod||q.get.transition(t);e=Z.isFunction(e)?e:function(){},(q.is.visible(n)||q.is.animating(n))&&(q.verbose("Doing menu hide animation",n),"none"===t?(i(),n.transition({displayType:q.get.displayType()}).transition("hide"),e.call(P)):Z.fn.transition!==ne&&x.transition("is supported")?n.transition({animation:t+" out",duration:p.transition.hideDuration||p.duration,debug:p.debug,verbose:p.verbose,queue:!1,onStart:i,displayType:q.get.displayType(),onComplete:function(){e.call(P)}}):q.error(u.transition))}},hideAndClear:function(){q.remove.searchTerm(),q.has.maxSelections()||(q.has.search()?q.hide(function(){q.remove.filteredItem()}):q.hide())},delay:{show:function(){q.verbose("Delaying show event to ensure user intent"),clearTimeout(q.timer),q.timer=setTimeout(q.show,p.delay.show)},hide:function(){q.verbose("Delaying hide event to ensure user intent"),clearTimeout(q.timer),q.timer=setTimeout(q.hide,p.delay.hide)}},escape:{value:function(e){var t=Array.isArray(e),n="string"==typeof e,i=!n&&!t,n=n&&-1!==e.search(c.quote),a=[];return i||!n?e:(q.debug("Encoding quote values for use in select",e),t?(Z.each(e,function(e,t){a.push(t.replace(c.quote,"&quot;"))}),a):e.replace(c.quote,"&quot;"))},string:function(e){return(e=String(e)).replace(c.escape,"\\$&")},htmlEntities:function(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return t[e]}):e}},setting:function(e,t){if(q.debug("Changing setting",e,t),Z.isPlainObject(e))Z.extend(!0,p,e);else{if(t===ne)return p[e];Z.isPlainObject(p[e])?Z.extend(!0,p[e],t):p[e]=t}},internal:function(e,t){if(Z.isPlainObject(e))Z.extend(!0,q,e);else{if(t===ne)return q[e];q[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?q.performance.log(arguments):(q.debug=Function.prototype.bind.call(console.info,console,p.name+":"),q.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?q.performance.log(arguments):(q.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),q.verbose.apply(console,arguments)))},error:function(){p.silent||(q.error=Function.prototype.bind.call(console.error,console,p.name+":"),q.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(Q||t),Q=t,G.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(q.performance.timer),q.performance.timer=setTimeout(q.performance.display,500)},display:function(){var e=p.name+":",n=0;Q=!1,clearTimeout(q.performance.timer),Z.each(G,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",K&&(e+=" '"+K+"'"),(console.group!==ne||console.table!==ne)&&0<G.length&&(console.groupCollapsed(e),console.table?console.table(G):Z.each(G,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),G=[]}},invoke:function(i,e,t){var a,o,n,r=I;return e=e||_,t=P||t,"string"==typeof i&&r!==ne&&(i=i.split(/[\. ]/),a=i.length-1,Z.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Z.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==ne)return o=r[n],!1;{if(!Z.isPlainObject(r[t])||e==a)return r[t]!==ne?o=r[t]:q.error(u.method,i),!1;r=r[t]}}})),Z.isFunction(o)?n=o.apply(t,e):o!==ne&&(n=o),Array.isArray(W)?W.push(n):W!==ne?W=[W,n]:n!==ne&&(W=n),o}};J?(I===ne&&q.initialize(),q.invoke(X)):(I!==ne&&I.invoke("destroy"),q.initialize())}),W!==ne?W:B},Z.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:ee,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:"exact",ignoreDiacritics:!1,hideDividers:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!1,allowAdditions:!1,ignoreCase:!1,ignoreSearchCase:!0,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!1,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,displayType:!1,glyphWidth:1.037,headerDivider:!0,collapseOnActionable:!0,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onActionable:function(e,t,n){},onSearch:function(e){},onLabelSelect:function(e){},onLabelCreate:function(e,t){return Z(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",description:"description",descriptionVertical:"descriptionVertical",value:"value",text:"text",type:"type",image:"image",imageClass:"imageClass",icon:"icon",iconClass:"iconClass",class:"class",divider:"divider",actionable:"actionable"},keys:{backspace:8,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",divider:".divider, .header",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> span.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered",clearIcon:"> .remove.icon"},className:{active:"active",addition:"addition",animating:"animating",description:"description",descriptionVertical:"vertical",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",icon:"icon",image:"image",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",text:"text",upward:"upward",leftward:"left",visible:"visible",clearable:"clearable",noselection:"noselection",delete:"delete",header:"header",divider:"divider",groupIcon:"",unfilterable:"unfilterable",actionable:"actionable"}},Z.fn.dropdown.settings.templates={deQuote:function(e,t){return String(e).replace(/"/g,t?"&quot;":"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e},dropdown:function(e,t,n,i){var a=e.placeholder||!1,o="",r=Z.fn.dropdown.settings.templates.escape;return o=(o=(o=(o+='<i class="dropdown icon"></i>')+(a?'<div class="default text">'+r(a,n)+"</div>":'<div class="text"></div>'))+('<div class="'+i.menu+'">'))+Z.fn.dropdown.settings.templates.menu(e,t,n,i)+"</div>"},menu:function(e,c,u,d){var e=e[c.values]||[],f="",p=Z.fn.dropdown.settings.templates.escape,m=Z.fn.dropdown.settings.templates.deQuote;return Z.each(e,function(e,t){var n,i,a,o,r,s=t[c.type]||"item",l=-1!==s.indexOf("menu");"item"===s||l?(n=t[c.text]?' data-text="'+m(t[c.text],!0)+'"':"",o=t[c.actionable]?d.actionable+" ":"",r=t[c.disabled]?d.disabled+" ":"",i=t[c.descriptionVertical]?d.descriptionVertical+" ":"",a=""!=p(t[c.description]||"",u),f+='<div class="'+o+r+i+(t[c.class]?m(t[c.class]):d.item)+'" data-value="'+m(t[c.value],!0)+'"'+n+">",l&&(f+='<i class="'+(-1!==s.indexOf("left")?"left":"")+' dropdown icon"></i>'),t[c.image]&&(f+='<img class="'+(t[c.imageClass]?m(t[c.imageClass]):d.image)+'" src="'+m(t[c.image])+'">'),t[c.icon]&&(f+='<i class="'+m(t[c.icon])+" "+(t[c.iconClass]?m(t[c.iconClass]):d.icon)+'"></i>'),a&&(f=(f+='<span class="'+d.description+'">'+p(t[c.description]||"",u)+"</span>")+(l?"":'<span class="'+d.text+'">')),l&&(f+='<span class="'+d.text+'">'),f+=p(t[c.name]||"",u),l?f=(f=f+'</span><div class="'+s+'">')+Z.fn.dropdown.settings.templates.menu(t,c,u,d)+"</div>":a&&(f+="</span>"),f+="</div>"):"header"===s&&(o=p(t[c.name]||"",u),r=t[c.icon]?m(t[c.icon]):d.groupIcon,""===o&&""===r||(f+='<div class="'+(t[c.class]?m(t[c.class]):d.header)+'">',""!==r&&(f+='<i class="'+r+" "+(t[c.iconClass]?m(t[c.iconClass]):d.icon)+'"></i>'),f=f+o+"</div>"),t[c.divider]&&(f+='<div class="'+d.divider+'"></div>'))}),f},label:function(e,t,n,i){return(0,Z.fn.dropdown.settings.templates.escape)(t,n)+'<i class="'+i.delete+' icon"></i>'},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(R,I,q,L){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},I=void 0!==I&&I.Math==Math?I:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.form=function(k){var T,D=R(this),S=D.selector||"",A=(new Date).getTime(),E=[],F=k,M=arguments[1],O="string"==typeof F,P=[].slice.call(arguments,1);return D.each(function(){var n,d,t,e,f,l,p,m,g,i,c,a,o,s,u,h=R(this),v=this,b=[],y=!1,r=!1,x=!1,w=["clean","clean"],C={initialize:function(){C.get.settings(),O?(u===L&&C.instantiate(),C.invoke(F)):(u!==L&&(u.invoke("destroy"),C.refresh()),C.verbose("Initializing form validation",h,f),C.bindEvents(),C.set.defaults(),f.autoCheckRequired&&C.set.autoCheck(),C.instantiate())},instantiate:function(){C.verbose("Storing instance of module",C),u=C,h.data(o,C)},destroy:function(){C.verbose("Destroying previous module",u),C.removeEvents(),h.removeData(o)},refresh:function(){C.verbose("Refreshing selector cache"),n=h.find(m.field),d=h.find(m.group),t=h.find(m.message),h.find(m.prompt),e=h.find(m.submit),h.find(m.clear),h.find(m.reset)},refreshEvents:function(){C.removeEvents(),C.bindEvents()},submit:function(){C.verbose("Submitting form",h),r=!0,h.submit()},attachEvents:function(e,t){t=t||"submit",R(e).on("click"+s,function(e){C[t](),e.preventDefault()})},bindEvents:function(){C.verbose("Attaching form events"),h.on("submit"+s,C.validate.form).on("blur"+s,m.field,C.event.field.blur).on("click"+s,m.submit,C.submit).on("click"+s,m.reset,C.reset).on("click"+s,m.clear,C.clear),f.keyboardShortcuts&&h.on("keydown"+s,m.field,C.event.field.keydown),n.each(function(e,t){var t=R(t),n=t.prop("type"),n=C.get.changeEvent(n,t);t.on(n+s,C.event.field.change)}),f.preventLeaving&&R(I).on("beforeunload"+s,C.event.beforeUnload),n.on("change click keyup keydown blur",function(e){C.determine.isDirty()}),h.on("dirty"+s,function(e){f.onDirty.call()}),h.on("clean"+s,function(e){f.onClean.call()})},clear:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=t.closest(d),a=i.find(m.prompt),o=t.closest(m.uiCalendar),r=t.data(p.defaultValue)||"",s=n.is(m.uiCheckbox),l=n.is(m.uiDropdown)&&C.can.useElement("dropdown"),c=0<o.length&&C.can.useElement("calendar");i.hasClass(g.error)&&(C.verbose("Resetting error on field",i),i.removeClass(g.error),a.remove()),l?(C.verbose("Resetting dropdown value",n,r),n.dropdown("clear",!0)):s?t.prop("checked",!1):c?o.calendar("clear"):(C.verbose("Resetting field value",t,r),t.val(""))}),C.remove.states()},reset:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=t.closest(d),a=t.closest(m.uiCalendar),o=i.find(m.prompt),r=t.data(p.defaultValue),s=n.is(m.uiCheckbox),l=n.is(m.uiDropdown)&&C.can.useElement("dropdown"),c=0<a.length&&C.can.useElement("calendar"),u=i.hasClass(g.error);r!==L&&(u&&(C.verbose("Resetting error on field",i),i.removeClass(g.error),o.remove()),l?(C.verbose("Resetting dropdown value",n,r),n.dropdown("restore defaults",!0)):s?(C.verbose("Resetting checkbox value",n,r),t.prop("checked",r)):c?a.calendar("set date",r):(C.verbose("Resetting field value",t,r),t.val(r)))}),C.remove.states()},determine:{isValid:function(){var n=!0;return R.each(l,function(e,t){C.validate.field(t,e,!0)||(n=!1)}),n},isDirty:function(e){var i=!1;n.each(function(e,t){var t=R(t),n=0<t.filter(m.checkbox).length?C.is.checkboxDirty(t):C.is.fieldDirty(t);t.data(f.metadata.isDirty,n),i|=n}),i?C.set.dirty():C.set.clean()}},is:{bracketedRule:function(e){return e.type&&e.type.match(f.regExp.bracket)},shorthandRules:function(e){return"string"==typeof e||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(m.checkbox)?!e.is(":checked"):C.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){var i=!0;return e?(C.verbose("Checking if field is valid",e),C.validate.field(l[e],e,!!n)):(C.verbose("Checking if form is valid"),R.each(l,function(e,t){C.is.valid(e,n)||(i=!1)}),i)},dirty:function(){return x},clean:function(){return!x},fieldDirty:function(e){var t=e.data(p.defaultValue),e=(null==t?t="":Array.isArray(t)&&(t=t.toString()),e.val()),n=(null==e?e="":Array.isArray(e)&&(e=e.toString()),/^(true|false)$/i);return n.test(t)&&n.test(e)?!new RegExp("^"+t+"$","i").test(e):e!==t},checkboxDirty:function(e){return e.data(p.defaultValue)!==e.is(":checked")},justDirty:function(){return"dirty"===w[0]},justClean:function(){return"clean"===w[0]}},removeEvents:function(){h.off(s),n.off(s),e.off(s)},event:{field:{keydown:function(e){var t=R(this),n=e.which,i=t.is(m.input),a=t.is(m.checkbox),o=0<t.closest(m.uiDropdown).length,r=13;n==27&&(C.verbose("Escape key pressed blurring field"),t[0].blur()),e.ctrlKey||n!=r||!i||o||a||(y||(t.one("keyup"+s,C.event.field.keyup),C.submit(),C.debug("Enter pressed on input submitting form"),e.preventDefault()),y=!0)},keyup:function(){y=!1},blur:function(e){var t=R(this),n=t.closest(d),i=C.get.validation(t);i&&("blur"==f.on||n.hasClass(g.error)&&f.revalidate)&&(C.debug("Revalidating field",t,i),C.validate.field(i),f.inline||C.validate.form(!1,!0))},change:function(e){var t=R(this),n=t.closest(d),i=C.get.validation(t);i&&("change"==f.on||n.hasClass(g.error)&&f.revalidate)&&(clearTimeout(C.timer),C.timer=setTimeout(function(){C.debug("Revalidating field",t,i),C.validate.field(i),f.inline||C.validate.form(!1,!0)},f.delay))}},beforeUnload:function(e){if(C.is.dirty()&&!r)return(e=e||I.event)&&(e.returnValue=f.text.leavingMessage),f.text.leavingMessage}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!C.is.bracketedRule(e))&&(e.value!==L?e.value:e.type.match(f.regExp.bracket)[1]+"")},ruleName:function(e){return C.is.bracketedRule(e)?e.type.replace(e.type.match(f.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":C.get.inputEvent()},inputEvent:function(){return q.createElement("input").oninput!==L?"input":q.createElement("input").onpropertychange!==L?"propertychange":"keyup"},fieldsFromShorthand:function(e){var i={};return R.each(e,function(n,e){Array.isArray(e)||"object"!=typeof e?("string"==typeof e&&(e=[e]),i[n]={rules:[]},R.each(e,function(e,t){i[n].rules.push({type:t})})):i[n]=e}),i},prompt:function(e,t){var n,i=C.get.ruleName(e),a=C.get.ancillaryValue(e),o=C.get.field(t.identifier),r=o.val(),r=R.isFunction(e.prompt)?e.prompt(r):e.prompt||f.prompt[i]||f.text.unspecifiedRule,s=-1!==r.search("{value}"),l=-1!==r.search("{name}");return a&&0<=["integer","decimal","number"].indexOf(i)&&0<=a.indexOf("..")&&(n=a.split("..",2),e.prompt||(r+=(""===n[0]?f.prompt.maxValue.replace(/\{ruleValue\}/g,"{max}"):""===n[1]?f.prompt.minValue.replace(/\{ruleValue\}/g,"{min}"):f.prompt.range).replace(/\{name\}/g," "+f.text.and)),r=(r=r.replace(/\{min\}/g,n[0])).replace(/\{max\}/g,n[1])),s&&(r=r.replace(/\{value\}/g,o.val())),l&&(s=1==(n=o.closest(m.group).find("label").eq(0)).length?n.text():o.prop("placeholder")||f.text.unspecifiedField,r=r.replace(/\{name\}/g,s)),r=(r=r.replace(/\{identifier\}/g,t.identifier)).replace(/\{ruleValue\}/g,a),e.prompt||C.verbose("Using default validation prompt for type",r,i),r},settings:function(){var e;R.isPlainObject(k)?0<(e=Object.keys(k)).length&&(k[e[0]].identifier!==L&&k[e[0]].rules!==L)?(f=R.extend(!0,{},R.fn.form.settings,M),l=R.extend(!0,{},R.fn.form.settings.defaults,k),C.error(f.error.oldSyntax,v),C.verbose("Extending settings from legacy parameters",l,f)):(k.fields&&(k.fields=C.get.fieldsFromShorthand(k.fields)),f=R.extend(!0,{},R.fn.form.settings,k),l=R.extend(!0,{},R.fn.form.settings.defaults,f.fields),C.verbose("Extending settings",l,f)):(f=R.extend(!0,{},R.fn.form.settings),l=R.extend(!0,{},R.fn.form.settings.defaults),C.verbose("Using default form validation",l,f)),a=f.namespace,p=f.metadata,m=f.selector,g=f.className,i=f.regExp,c=f.error,o="module-"+a,s="."+a,((u=h.data(o))||C).refresh()},field:function(e){var t;return C.verbose("Finding field with identifier",e),e=C.escape.string(e),0<(t=n.filter("#"+e)).length||0<(t=n.filter('[name="'+e+'"]')).length||0<(t=n.filter('[name="'+e+'[]"]')).length||0<(t=n.filter("[data-"+p.validate+'="'+e+'"]')).length?t:R("<input/>")},fields:function(e){var n=R();return R.each(e,function(e,t){n=n.add(C.get.field(t))}),n},validation:function(i){var a,o;return!!l&&(R.each(l,function(e,n){o=n.identifier||e,R.each(C.get.field(o),function(e,t){if(t==i[0])return n.identifier=o,a=n,!1})}),a||!1)},value:function(e){var t=[];return t.push(e),C.get.values.call(v,t)[e]},values:function(e){var e=Array.isArray(e)?C.get.fields(e):n,d={};return e.each(function(e,t){var t=R(t),n=t.closest(m.uiCalendar),i=t.prop("name"),a=t.val(),o=t.is(m.checkbox),r=t.is(m.radio),s=-1!==i.indexOf("[]"),l=0<n.length&&C.can.useElement("calendar"),t=!!o&&t.is(":checked");if(i)if(s)i=i.replace("[]",""),d[i]||(d[i]=[]),o?t?d[i].push(a||!0):d[i].push(!1):d[i].push(a);else if(r)d[i]!==L&&!1!==d[i]||(d[i]=!!t&&(a||!0));else if(o)d[i]=!!t&&(a||!0);else if(l){var c=n.calendar("get date");if(null!==c){if("date"==f.dateHandling)d[i]=c;else if("input"==f.dateHandling)d[i]=n.calendar("get input date");else if("formatter"==f.dateHandling){var u=n.calendar("setting","type");switch(u){case"date":d[i]=f.formatter.date(c);break;case"datetime":d[i]=f.formatter.datetime(c);break;case"time":d[i]=f.formatter.time(c);break;case"month":d[i]=f.formatter.month(c);break;case"year":d[i]=f.formatter.year(c);break;default:C.debug("Wrong calendar mode",n,u),d[i]=""}}}else d[i]=""}else d[i]=a}),d},dirtyFields:function(){return n.filter(function(e,t){return R(t).data(p.isDirty)})}},has:{field:function(e){return C.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=C.escape.string(e))&&C.error(c.identifier,e),0<n.filter("#"+e).length||(0<n.filter('[name="'+e+'"]').length||0<n.filter("[data-"+p.validate+'="'+e+'"]').length)}},can:{useElement:function(e){return R.fn[e]!==L||(C.error(c.noElement.replace("{element}",e)),!1)}},escape:{string:function(e){return(e=String(e)).replace(i.escape,"\\$&")}},add:{rule:function(e,t){C.add.field(e,t)},field:function(n,e){l[n]!==L&&l[n].rules!==L||(l[n]={rules:[]});var i={rules:[]};C.is.shorthandRules(e)?(e=Array.isArray(e)?e:[e],R.each(e,function(e,t){i.rules.push({type:t})})):i.rules=e.rules,R.each(i.rules,function(e,t){0==R.grep(l[n].rules,function(e){return e.type==t.type}).length&&l[n].rules.push(t)}),C.debug("Adding rules",i.rules,l),C.refreshEvents()},fields:function(e){l=R.extend(!0,{},l,C.get.fieldsFromShorthand(e)),C.refreshEvents()},prompt:function(e,t,n){var i=C.get.field(e).closest(d),a=i.children(m.prompt),o=0!==a.length;t="string"==typeof t?[t]:t,C.verbose("Adding field error state",e),n||i.addClass(g.error),f.inline&&(o||(a=R("<div/>").addClass(g.label)).appendTo(i),a.html(f.templates.prompt(t)),o?C.verbose("Inline errors are disabled, no inline error added",e):f.transition&&C.can.useElement("transition")&&h.transition("is supported")?(C.verbose("Displaying error with css transition",f.transition),a.transition(f.transition+" in",f.duration)):(C.verbose("Displaying error with fallback javascript animation"),a.fadeIn(f.duration)))},errors:function(e){C.debug("Adding form error messages",e),C.set.error(),t.html(f.templates.error(e))}},remove:{errors:function(){C.debug("Removing form error messages"),t.empty()},states:function(){h.removeClass(g.error).removeClass(g.success),f.inline||C.remove.errors(),C.determine.isDirty()},rule:function(n,e){var i=Array.isArray(e)?e:[e];l[n]!==L&&Array.isArray(l[n].rules)&&(e===L?(C.debug("Removed all rules"),l[n].rules=[]):R.each(l[n].rules,function(e,t){t&&-1!==i.indexOf(t.type)&&(C.debug("Removed rule",t.type),l[n].rules.splice(e,1))}))},field:function(e){e=Array.isArray(e)?e:[e];R.each(e,function(e,t){C.remove.rule(t)}),C.refreshEvents()},rules:function(e,n){Array.isArray(e)?R.each(e,function(e,t){C.remove.rule(t,n)}):C.remove.rule(e,n)},fields:function(e){C.remove.field(e)},prompt:function(e){var t=C.get.field(e).closest(d),n=t.children(m.prompt);t.removeClass(g.error),f.inline&&n.is(":visible")&&(C.verbose("Removing prompt for field",e),f.transition&&C.can.useElement("transition")&&h.transition("is supported")?n.transition(f.transition+" out",f.duration,function(){n.remove()}):n.fadeOut(f.duration,function(){n.remove()}))}},set:{success:function(){h.removeClass(g.error).addClass(g.success)},defaults:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=0<t.filter(m.checkbox).length,a=n.is(m.uiDropdown)&&C.can.useElement("dropdown"),o=t.closest(m.uiCalendar),r=0<o.length&&C.can.useElement("calendar"),i=i?t.is(":checked"):t.val();a?n.dropdown("save defaults"):r&&o.calendar("refresh"),t.data(p.defaultValue,i),t.data(p.isDirty,!1)})},error:function(){h.removeClass(g.success).addClass(g.error)},value:function(e,t){var n={};return n[e]=t,C.set.values.call(v,n)},values:function(e){R.isEmptyObject(e)||R.each(e,function(e,t){var n,i=C.get.field(e),a=i.parent(),e=i.closest(m.uiCalendar),o=Array.isArray(t),r=a.is(m.uiCheckbox)&&C.can.useElement("checkbox"),s=a.is(m.uiDropdown)&&C.can.useElement("dropdown"),l=i.is(m.radio)&&r,c=0<e.length&&C.can.useElement("calendar");0<i.length&&(o&&r?(C.verbose("Selecting multiple",t,i),a.checkbox("uncheck"),R.each(t,function(e,t){n=i.filter('[value="'+t+'"]'),a=n.parent(),0<n.length&&a.checkbox("check")})):l?(C.verbose("Selecting radio value",t,i),i.filter('[value="'+t+'"]').parent(m.uiCheckbox).checkbox("check")):r?(C.verbose("Setting checkbox value",t,a),!0===t||1===t||"on"===t?a.checkbox("check"):a.checkbox("uncheck"),"string"==typeof t&&i.val(t)):s?(C.verbose("Setting dropdown value",t,a),a.dropdown("set selected",t)):c?e.calendar("set date",t):(C.verbose("Setting field value",t,i),i.val(t)))})},dirty:function(){C.verbose("Setting state dirty"),x=!0,w[0]=w[1],w[1]="dirty",C.is.justClean()&&h.trigger("dirty")},clean:function(){C.verbose("Setting state clean"),x=!1,w[0]=w[1],w[1]="clean",C.is.justDirty()&&h.trigger("clean")},asClean:function(){C.set.defaults(),C.set.clean()},asDirty:function(){C.set.defaults(),C.set.dirty()},autoCheck:function(){C.debug("Enabling auto check on required fields"),n.each(function(e,t){var n=R(t),t=R(t).closest(d),i=0<n.filter(m.checkbox).length,a=n.prop("required")||t.hasClass(g.required)||t.parent().hasClass(g.required),t=n.is(":disabled")||t.hasClass(g.disabled)||t.parent().hasClass(g.disabled),o=C.get.validation(n),r=!!o&&0!==R.grep(o.rules,function(e){return"empty"==e.type}),o=o.identifier||n.attr("id")||n.attr("name")||n.data(p.validate);!a||t||r||o===L||(i?(C.verbose("Adding 'checked' rule on field",o),C.add.rule(o,"checked")):(C.verbose("Adding 'empty' rule on field",o),C.add.rule(o,"empty")))})},optional:function(n,i){i=!1!==i,R.each(l,function(e,t){n!=e&&n!=t.identifier||(t.optional=i)})}},validate:{form:function(e,t){var n,i=C.get.values();if(y)return!1;if(b=[],C.determine.isValid()){if(C.debug("Form has no validation errors, submitting"),C.set.success(),f.inline||C.remove.errors(),!0!==t)return f.onSuccess.call(v,e,i)}else if(C.debug("Form has errors"),r=!1,C.set.error(),f.inline||C.add.errors(b),e&&h.data("moduleApi")!==L&&e.stopImmediatePropagation(),f.errorFocus&&!0!==t&&(e=!0,"string"==typeof f.errorFocus?(e=(n=R(q).find(f.errorFocus)).is("[tabindex]"))||n.attr("tabindex",-1):n=d.filter("."+g.error).first().find(m.field),n.focus(),e||n.removeAttr("tabindex")),!0!==t)return f.onFailure.call(v,b,i)},field:function(i,e,a){a=a===L||a,"string"==typeof i&&(C.verbose("Validating field",i),i=l[e=i]);var o=i.identifier||e,e=C.get.field(o),t=!!i.depends&&C.get.field(i.depends),r=!0,s=[];return i.identifier||(C.debug("Using field name as identifier",o),i.identifier=o),!e.filter(":not(:disabled)").length?C.debug("Field is disabled. Skipping",o):i.optional&&C.is.blank(e)?C.debug("Field is optional and blank. Skipping",o):i.depends&&C.is.empty(t)?C.debug("Field depends on another value that is not present or empty. Skipping",t):i.rules!==L&&(a&&e.closest(d).removeClass(g.error),R.each(i.rules,function(e,t){var n;C.has.field(o)&&0<(n=C.validate.rule(i,t,!0)||[]).length&&(C.debug("Field is invalid",o,t.type),s.push(C.get.prompt(t,i)),r=!1,a&&R(n).closest(d).addClass(g.error))})),r?(a&&(C.remove.prompt(o,s),f.onValid.call(e)),!0):(a&&(b=b.concat(s),C.add.prompt(o,s,!0),f.onInvalid.call(e,s)),!1)},rule:function(e,n,t){function i(e){var t=(t=(l?R(e).filter(":checked"):R(e)).val())===L||""===t||null===t?"":f.shouldTrim&&!1!==n.shouldTrim||n.shouldTrim?String(t+"").trim():String(t+"");return r.call(e,t,a,h)}var e=C.get.field(e.identifier),a=C.get.ancillaryValue(n),o=C.get.ruleName(n),r=f.rules[o],s=[],l=e.is(m.checkbox);if(R.isFunction(r))return l?i(e)||(s=e):R.each(e,function(e,t){i(t)||s.push(t)}),t?s:!(0<s.length);C.error(c.noRule,o)}},setting:function(e,t){if(R.isPlainObject(e))R.extend(!0,f,e);else{if(t===L)return f[e];f[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,C,e);else{if(t===L)return C[e];C[e]=t}},debug:function(){!f.silent&&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.silent&&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(){f.silent||(C.error=Function.prototype.bind.call(console.error,console,f.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(A||t),A=t,E.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var e=f.name+":",n=0;A=!1,clearTimeout(C.performance.timer),R.each(E,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",S&&(e+=" '"+S+"'"),1<D.length&&(e+=" ("+D.length+")"),(console.group!==L||console.table!==L)&&0<E.length&&(console.groupCollapsed(e),console.table?console.table(E):R.each(E,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),E=[]}},invoke:function(i,e,t){var a,o,n,r=u;return e=e||P,t=v||t,"string"==typeof i&&r!==L&&(i=i.split(/[\. ]/),a=i.length-1,R.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==L)return o=r[n],!1;{if(!R.isPlainObject(r[t])||e==a)return r[t]!==L&&(o=r[t]),!1;r=r[t]}}})),R.isFunction(o)?n=o.apply(t,e):o!==L&&(n=o),Array.isArray(T)?T.push(n):T!==L?T=[T,n]:n!==L&&(T=n),o}};C.initialize()}),T!==L?T:this},R.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,shouldTrim:!0,transition:"scale",duration:200,autoCheckRequired:!1,preventLeaving:!1,errorFocus:!0,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{and:"and",unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{range:"{name} must be in a range from {min} to {max}",maxValue:"{name} must have a maximum value of {ruleValue}",minValue:"{name} must have a minimum value of {ruleValue}",empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",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:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',group:".field",input:'input:not([type="file"])',message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success",required:"required",disabled:"disabled"},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.",noElement:"This module requires ui {element}"},templates:{error:function(e){var n='<ul class="list">';return R.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"},prompt:function(e){if(1===e.length)return e[0];var n='<ul class="ui list">';return R.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(e===L||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return 0<R(this).filter(":checked").length},email:function(e){return R.fn.form.settings.regExp.email.test(e)},url:function(e){return R.fn.form.settings.regExp.url.test(e)},regExp:function(e,t){if(t instanceof RegExp)return e.match(t);var n,i=t.match(R.fn.form.settings.regExp.flags);return i&&(t=2<=i.length?i[1]:t,n=3<=i.length?i[2]:""),e.match(new RegExp(t,n))},minValue:function(e,t){return R.fn.form.settings.rules.range(e,t+"..","number")},maxValue:function(e,t){return R.fn.form.settings.rules.range(e,".."+t,"number")},integer:function(e,t){return R.fn.form.settings.rules.range(e,t,"integer")},range:function(e,t,n){var i,a;return(n="string"==typeof n?R.fn.form.settings.regExp[n]:n)instanceof RegExp||(n=R.fn.form.settings.regExp.integer),t&&-1===["",".."].indexOf(t)&&(-1==t.indexOf("..")?n.test(t)&&(i=a=+t):(t=t.split("..",2),n.test(t[0])&&(i=+t[0]),n.test(t[1])&&(a=+t[1]))),n.test(e)&&(i===L||i<=e)&&(a===L||e<=a)},decimal:function(e,t){return R.fn.form.settings.rules.range(e,t,"decimal")},number:function(e,t){return R.fn.form.settings.rules.range(e,t,"number")},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t,"i"))},containsExactly:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t))},doesntContain:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t,"i"))},doesntContainExactly:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t))},minLength:function(e,t){return e!==L&&e.length>=t},exactLength:function(e,t){return e!==L&&e.length==t},maxLength:function(e,t){return e!==L&&e.length<=t},match:function(e,t,n){var i,a;return 0<(a=n.find('[data-validate="'+t+'"]')).length||0<(a=n.find("#"+t)).length||0<(a=n.find('[name="'+t+'"]')).length?i=a.val():0<(a=n.find('[name="'+t+'[]"]')).length&&(i=a),i!==L&&e.toString()==i.toString()},different:function(e,t,n){var i,a;return 0<(a=n.find('[data-validate="'+t+'"]')).length||0<(a=n.find("#"+t)).length||0<(a=n.find('[name="'+t+'"]')).length?i=a.val():0<(a=n.find('[name="'+t+'[]"]')).length&&(i=a),i!==L&&e.toString()!==i.toString()},creditCard:function(n,e){var i,a={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},o=!1,e="string"==typeof e&&e.split(",");if("string"==typeof n&&0!==n.length){if(n=n.replace(/[\s\-]/g,""),e&&(R.each(e,function(e,t){(i=a[t])&&(i={length:-1!==R.inArray(n.length,i.length),pattern:-1!==n.search(i.pattern)}).length&&i.pattern&&(o=!0)}),!o))return!1;if((e={number:-1!==R.inArray(n.length,a.unionPay.length),pattern:-1!==n.search(a.unionPay.pattern)}).number&&e.pattern)return!0;for(var t=n.length,r=0,s=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],l=0;t--;)l+=s[r][parseInt(n.charAt(t),10)],r^=1;return l%10==0&&0<l}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(V,z,U,Y){"use strict";V.isFunction=V.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},z=void 0!==z&&z.Math==Math?z:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),V.fn.modal=function(E){var F,e=V(this),M=V(z),O=V(U),P=V("body"),R=e.selector||"",I=(new Date).getTime(),q=[],L=E,j="string"==typeof L,H=[].slice.call(arguments,1),N=z.requestAnimationFrame||z.mozRequestAnimationFrame||z.webkitRequestAnimationFrame||z.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,a,o,e,i,n,r,s,l,c,u,d=V.isPlainObject(E)?V.extend(!0,{},V.fn.modal.settings,E):V.extend({},V.fn.modal.settings),f=d.selector,p=d.className,m=d.namespace,g=d.fields,h=d.error,v="."+m,b="module-"+m,y=V(this),x=[z,U].indexOf(d.context)<0?V(U).find(d.context):V(d.context),w=y.find(f.closeIcon),C=this,k=y.hasClass("modal")?y.data(b):Y,T=!1,D="",S="",A={initialize:function(){var o;A.create.id(),y.hasClass("modal")||(A.create.modal(),V.isFunction(d.onHidden)||(d.onHidden=function(){A.destroy(),y.remove()})),y.addClass(d.class),""!==d.title&&y.find(f.title).html(A.helpers.escape(d.title,d.preserveHTML)).addClass(d.classTitle),""!==d.content&&y.find(f.content).html(A.helpers.escape(d.content,d.preserveHTML)).addClass(d.classContent),A.has.configActions()&&(0===(o=y.find(f.actions).addClass(d.classActions)).length?o=V("<div/>",{class:p.actions+" "+(d.classActions||"")}).appendTo(y):o.empty(),d.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+A.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=A.helpers.escape(e[g.text]||"",d.preserveHTML),i=A.helpers.deQuote(e[g.class]||""),a=e[g.click]&&V.isFunction(e[g.click])?e[g.click]:function(){};o.append(V("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:p.button+" "+i,click:function(){var e=V(this);e.is(f.approve)||e.is(f.deny)||!1===a.call(C,y)||A.hide()}}))})),A.cache={},A.verbose("Initializing dimmer",x),A.create.dimmer(),d.allowMultiple&&A.create.innerDimmer(),d.centered||y.addClass("top aligned"),A.refreshModals(),A.refreshInputs(),A.bind.events(),A.observeChanges(),A.instantiate(),d.autoShow&&A.show()},instantiate:function(){A.verbose("Storing instance of modal"),k=A,y.data(b,k)},create:{modal:function(){var e;y=V("<div/>",{class:p.modal,role:"dialog","aria-modal":!0}),d.closeIcon&&(w=V("<i/>",{class:p.close,role:"button",tabindex:0,"aria-label":d.text.close}),y.append(w)),""!==d.title&&(e="_"+A.get.id()+"title",y.attr("aria-labelledby",e),V("<div/>",{class:p.title,id:e}).appendTo(y)),""!==d.content&&(e="_"+A.get.id()+"desc",y.attr("aria-describedby",e),V("<div/>",{class:p.content,id:e}).appendTo(y)),A.has.configActions()&&V("<div/>",{class:p.actions}).appendTo(y),x.append(y)},dimmer:function(){var e={debug:d.debug,dimmerName:"modals"},e=V.extend(!0,e,d.dimmerSettings);V.fn.dimmer===Y?A.error(h.dimmer):(A.debug("Creating dimmer"),i=x.dimmer(e),d.detachable?(A.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):A.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){c=(Math.random().toString(16)+"000000000").slice(2,10),l="."+c,A.verbose("Creating unique id for element",c)},innerDimmer:function(){0===y.find(f.dimmer).length&&V("<div/>",{class:p.innerDimmer}).prependTo(y)}},destroy:function(){u&&u.disconnect(),A.verbose("Destroying previous modal"),y.removeData(b).off(v),M.off(l),n.off(l),w.off(l),t&&t.off(l),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in z&&((u=new MutationObserver(function(e){d.observeChanges&&(A.debug("DOM tree modified, refreshing"),A.refresh()),A.refreshInputs()})).observe(C,{childList:!0,subtree:!0}),A.debug("Setting up mutation observer",u))},refresh:function(){A.remove.scrolling(),A.cacheSizes(),A.can.useFlex()||A.set.modalOffset(),A.set.screenHeight(),A.set.type()},refreshModals:function(){o=y.siblings(f.modal),a=o.add(y)},refreshInputs:function(){t&&t.off("keydown"+l),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===V(this).closest(".disabled").length})).first().on("keydown"+l,A.event.inputKeyDown.first),t.last().on("keydown"+l,A.event.inputKeyDown.last)},attachEvents:function(e,t){var n=V(e);t=V.isFunction(A[t])?A[t]:A.toggle,0<n.length?(A.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):A.error(h.notFound,e)},bind:{events:function(){A.verbose("Attaching events"),y.on("click"+v,f.close,A.event.close).on("click"+v,f.approve,A.event.approve).on("click"+v,f.deny,A.event.deny),w.on("keyup"+l,A.event.closeKeyUp),M.on("resize"+l,A.event.resize)},scrollLock:function(){i.get(0).addEventListener("touchmove",A.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i.get(0).removeEventListener("touchmove",A.event.preventScroll,{passive:!1})}},get:{id:function(){return c},element:function(){return y},settings:function(){return d}},event:{approve:function(){T||!1===d.onApprove.call(C,V(this))?A.verbose("Approve callback returned false cancelling hide"):(T=!0,A.hide(function(){T=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){T||!1===d.onDeny.call(C,V(this))?A.verbose("Deny callback returned false cancelling hide"):(T=!0,A.hide(function(){T=!1}))},close:function(){A.hide()},closeKeyUp:function(e){e=e.which;e!==d.keys.enter&&e!==d.keys.space||!y.hasClass(p.front)||A.hide()},inputKeyDown:{first:function(e){e.which===d.keys.tab&&e.shiftKey&&(t.last().focus(),e.preventDefault())},last:function(e){e.which!==d.keys.tab||e.shiftKey||(t.first().focus(),e.preventDefault())}},mousedown:function(e){var t=V(e.target),n=A.is.rtl();(r=0<t.closest(f.modal).length)&&A.verbose("Mouse down event registered inside the modal"),(s=A.is.scrolling()&&(!n&&V(z).outerWidth()-d.scrollbarWidth<=e.clientX||n&&d.scrollbarWidth>=e.clientX))&&A.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(d.closable)if(r)A.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(s)A.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<V(e.target).closest(f.modal).length,e=V.contains(U.documentElement,e.target);if(!t&&e&&A.is.active()&&y.hasClass(p.front)){if(A.debug("Dimmer clicked, hiding all modals"),d.allowMultiple){if(!A.hideAll())return}else if(!A.hide())return;A.remove.clickaway()}}else A.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(A.timer),A.timer=setTimeout(e,t)},keyboard:function(e){e.which===d.keys.escape&&(d.closable?(A.debug("Escape key pressed hiding modal"),y.hasClass(p.front)&&A.hide()):A.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(A.is.animating()||A.is.active())&&N(A.refresh)}},toggle:function(){A.is.active()||A.is.animating()?A.hide():A.show()},show:function(e){e=V.isFunction(e)?e:function(){},A.refreshModals(),A.set.dimmerSettings(),A.set.dimmerStyles(),A.showModal(e)},hide:function(e){return e=V.isFunction(e)?e:function(){},A.refreshModals(),A.hideModal(e)},showModal:function(e){e=V.isFunction(e)?e:function(){},A.is.animating()||!A.is.active()?!1===d.onShow.call(C)?A.verbose("Show callback returned false cancelling show"):(A.showDimmer(),A.cacheSizes(),A.set.bodyMargin(),A.can.useFlex()?A.remove.legacy():(A.set.legacy(),A.set.modalOffset(),A.debug("Using non-flex legacy modal positioning.")),A.set.screenHeight(),A.set.type(),A.set.clickaway(),!d.allowMultiple&&A.others.active()?A.hideOthers(A.showModal):(T=!1,d.allowMultiple&&(A.others.active()&&o.filter("."+p.active).find(f.dimmer).addClass("active"),d.detachable&&y.detach().appendTo(n)),d.transition&&V.fn.transition!==Y&&y.transition("is supported")?(A.debug("Showing modal with css animations"),y.transition({debug:d.debug,animation:(d.transition.showMethod||d.transition)+" in",queue:d.queue,duration:d.transition.showDuration||d.duration,useFailSafe:!0,onComplete:function(){d.onVisible.apply(C),d.keyboardShortcuts&&A.add.keyboardShortcuts(),A.save.focus(),A.set.active(),d.autofocus&&A.set.autofocus(),e()}})):A.error(h.noTransition))):A.debug("Modal is already visible")},hideModal:function(e,t,n){var i=o.filter("."+p.active).last();if(e=V.isFunction(e)?e:function(){},!1===d.onHide.call(C,V(this)))return A.verbose("Hide callback returned false cancelling hide"),T=!1;(A.is.animating()||A.is.active())&&(A.debug("Hiding modal"),d.transition&&V.fn.transition!==Y&&y.transition("is supported")?(A.remove.active(),y.transition({debug:d.debug,animation:(d.transition.hideMethod||d.transition)+" out",queue:d.queue,duration:d.transition.hideDuration||d.duration,useFailSafe:!0,onStart:function(){A.others.active()||A.others.animating()||t||A.hideDimmer(),d.keyboardShortcuts&&!A.others.active()&&A.remove.keyboardShortcuts()},onComplete:function(){A.unbind.scrollLock(),d.allowMultiple&&(i.addClass(p.front),y.removeClass(p.front),(n?a:i).find(f.dimmer).removeClass("active")),V.isFunction(d.onHidden)&&d.onHidden.call(C),A.remove.dimmerStyles(),A.restore.focus(),e()}})):A.error(h.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(A.save.bodyMargin(),A.debug("Showing dimmer"),i.dimmer("show")):A.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(A.unbind.scrollLock(),i.dimmer("hide",function(){A.restore.bodyMargin(),A.remove.clickaway(),A.remove.screenHeight()})):A.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=a.filter("."+p.active+", ."+p.animating);if(n=V.isFunction(n)?n:function(){},0<e.length)return A.debug("Hiding all visible modals"),i=!0,V(e.get().reverse()).each(function(e,t){i=i&&V(t).modal("hide modal",n,!1,!0)}),i&&A.hideDimmer(),i},hideOthers:function(e){var t=o.filter("."+p.active+", ."+p.animating);e=V.isFunction(e)?e:function(){},0<t.length&&(A.debug("Hiding other modals",o),t.modal("hide modal",e,!0))},others:{active:function(){return 0<o.filter("."+p.active).length},animating:function(){return 0<o.filter("."+p.animating).length}},add:{keyboardShortcuts:function(){A.verbose("Adding keyboard shortcuts"),O.on("keyup"+v,A.event.keyboard)}},save:{focus:function(){0<V(U.activeElement).closest(y).length||(e=V(U.activeElement).blur())},bodyMargin:function(){D=P.css("margin-"+(A.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,"")),t=z.innerWidth-U.documentElement.clientWidth;S=e+t}},restore:{focus:function(){e&&0<e.length&&d.restoreFocus&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";P.css("margin-"+n,D),P.find(f.bodyFixed.replace("right",n)).each(function(){var e=V(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){y.removeClass(p.active)},legacy:function(){y.removeClass(p.legacy)},clickaway:function(){d.detachable||y.off("mousedown"+l),n.off("mousedown"+l),n.off("mouseup"+l)},dimmerStyles:function(){n.removeClass(p.inverted),i.removeClass(p.blurring)},bodyStyle:function(){""===P.attr("style")&&(A.verbose("Removing style attribute"),P.removeAttr("style"))},screenHeight:function(){A.debug("Removing page height"),P.css("height","")},keyboardShortcuts:function(){A.verbose("Removing keyboard shortcuts"),O.off("keyup"+v)},scrolling:function(){i.removeClass(p.scrolling),y.removeClass(p.scrolling)}},cacheSizes:function(){y.addClass(p.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();A.cache.pageHeight!==Y&&0===n||(V.extend(A.cache,{pageHeight:V(U).outerHeight(),width:t,height:n+d.offset,scrollHeight:e+d.offset,contextHeight:("body"==d.context?V(z):i).height()}),A.cache.topOffset=-A.cache.height/2),y.removeClass(p.loading),A.debug("Caching modal and container sizes",A.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return A.cache.leftBodyScrollbar===Y&&(A.cache.leftBodyScrollbar=A.is.rtl()&&(A.is.iframe&&!A.is.firefox()||A.is.safari()||A.is.edge()||A.is.ie())),A.cache.leftBodyScrollbar},useFlex:function(){return"auto"===d.useFlex?d.detachable&&!A.is.ie():(d.useFlex&&A.is.ie()?A.debug("useFlex true is not supported in IE"):d.useFlex&&!d.detachable&&A.debug("useFlex true in combination with detachable false is not supported"),d.useFlex)},fit:function(){var e=A.cache.contextHeight,t=A.cache.contextHeight/2,n=A.cache.topOffset,i=A.cache.scrollHeight,a=A.cache.height,o=d.padding;return a<i?t+n+i+o<e:a+2*o<e}},has:{configActions:function(){return Array.isArray(d.actions)&&0<d.actions.length}},is:{active:function(){return y.hasClass(p.active)},ie:function(){var e,t;return A.cache.isIE===Y&&(e=!z.ActiveXObject&&"ActiveXObject"in z,t="ActiveXObject"in z,A.cache.isIE=e||t),A.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(p.scrolling)},modernBrowser:function(){return!(z.ActiveXObject||"ActiveXObject"in z)},rtl:function(){return A.cache.isRTL===Y&&(A.cache.isRTL="rtl"===P.attr("dir")||"rtl"===P.css("direction")),A.cache.isRTL},safari:function(){return A.cache.isSafari===Y&&(A.cache.isSafari=/constructor/i.test(z.HTMLElement)||!!z.ApplePaySession),A.cache.isSafari},edge:function(){return A.cache.isEdge===Y&&(A.cache.isEdge=!!z.setImmediate&&!A.is.ie()),A.cache.isEdge},firefox:function(){return A.cache.isFirefox===Y&&(A.cache.isFirefox=!!z.InstallTrigger),A.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";(d.detachable||A.can.fit())&&P.css("margin-"+n,S+"px"),P.find(f.bodyFixed.replace("right",n)).each(function(){var e=V(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+S+"px)")})},clickaway:function(){d.detachable||y.on("mousedown"+l,A.event.mousedown),n.on("mousedown"+l,A.event.mousedown),n.on("mouseup"+l,A.event.mouseup)},dimmerSettings:function(){var e;V.fn.dimmer===Y?A.error(h.dimmer):(e={debug:d.debug,dimmerName:"modals",closable:"auto",useFlex:A.can.useFlex(),duration:{show:d.transition.showDuration||d.duration,hide:d.transition.hideDuration||d.duration}},e=V.extend(!0,e,d.dimmerSettings),d.inverted&&(e.variation=e.variation!==Y?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){d.inverted?n.addClass(p.inverted):n.removeClass(p.inverted),d.blurring?i.addClass(p.blurring):i.removeClass(p.blurring)},modalOffset:function(){var e;d.detachable?y.css({marginTop:!y.hasClass("aligned")&&A.can.fit()?-A.cache.height/2:d.padding/2,marginLeft:-A.cache.width/2}):(e=A.can.fit(),y.css({top:!y.hasClass("aligned")&&e?V(U).scrollTop()+(A.cache.contextHeight-A.cache.height)/2:!e||y.hasClass("top")?V(U).scrollTop()+d.padding:V(U).scrollTop()+(A.cache.contextHeight-A.cache.height-d.padding),marginLeft:-A.cache.width/2})),A.verbose("Setting modal offset for legacy mode")},screenHeight:function(){A.can.fit()?P.css("height",""):y.hasClass("bottom")||(A.debug("Modal is taller than page content, resizing page height"),P.css("height",A.cache.height+2*d.padding))},active:function(){y.addClass(p.active+" "+p.front),o.filter("."+p.active).removeClass(p.front)},scrolling:function(){i.addClass(p.scrolling),y.addClass(p.scrolling),A.unbind.scrollLock()},legacy:function(){y.addClass(p.legacy)},type:function(){A.can.fit()?(A.verbose("Modal fits on screen"),A.others.active()||A.others.animating()||(A.remove.scrolling(),A.bind.scrollLock())):y.hasClass("bottom")?A.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(A.verbose("Modal cannot fit on screen setting to scrolling"),A.set.scrolling())},undetached:function(){i.addClass(p.undetached)}},setting:function(e,t){if(A.debug("Changing setting",e,t),V.isPlainObject(e))V.extend(!0,d,e);else{if(t===Y)return d[e];V.isPlainObject(d[e])?V.extend(!0,d[e],t):d[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.extend(!0,A,e);else{if(t===Y)return A[e];A[e]=t}},debug:function(){!d.silent&&d.debug&&(d.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,d.name+":"),A.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),A.verbose.apply(console,arguments)))},error:function(){d.silent||(A.error=Function.prototype.bind.call(console.error,console,d.name+":"),A.error.apply(console,arguments))},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(I||t),I=t,q.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":n})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(A.performance.display,500)},display:function(){var e=d.name+":",n=0;I=!1,clearTimeout(A.performance.timer),V.each(q,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",R&&(e+=" '"+R+"'"),(console.group!==Y||console.table!==Y)&&0<q.length&&(console.groupCollapsed(e),console.table?console.table(q):V.each(q,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),q=[]}},invoke:function(i,e,t){var a,o,n,r=k;return e=e||H,t=C||t,"string"==typeof i&&r!==Y&&(i=i.split(/[\. ]/),a=i.length-1,V.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(V.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==Y)return o=r[n],!1;{if(!V.isPlainObject(r[t])||e==a)return r[t]!==Y&&(o=r[t]),!1;r=r[t]}}})),V.isFunction(o)?n=o.apply(t,e):o!==Y&&(n=o),Array.isArray(F)?F.push(n):F!==Y?F=[F,n]:n!==Y&&(F=n),o}};j?(k===Y&&(V.isFunction(d.templates[L])&&(d.autoShow=!0,d.className.modal=d.className.template,d=V.extend(!0,{},d,d.templates[L].apply(A,H)),p=d.className,d.namespace,g=d.fields,h=d.error),A.initialize()),V.isFunction(d.templates[L])||A.invoke(L)):(k!==Y&&k.invoke("destroy"),A.initialize(),F=y)}),F!==Y?F:this},V.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},V.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return V.isPlainObject(e[0])?V.extend({handler:function(){},content:"",title:""},e[0]):(V.isFunction(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];a.handler(V(e).val())}function t(){a.handler(null)}var n=this,i=this.get.settings(),a=i.templates.getArguments(arguments);return 0===V(V.parseHTML(a.content)).filter(".ui.input").length&&(a.content+='<p><div class="'+i.className.prompt+'"><input placeholder="'+this.helpers.deQuote(a.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(a.defaultValue||"")+'"></div></p>'),{title:a.title,content:a.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document),function(L,j,H,N){"use strict";L.isFunction=L.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},j=void 0!==j&&j.Math==Math?j:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),L.fn.popup=function(T){var D,e=L(this),S=L(H),A=L(j),E=L("body"),F=e.selector||"",M="ontouchstart"in H.documentElement?"touchstart":"click",O=(new Date).getTime(),P=[],R=T,I="string"==typeof R,q=[].slice.call(arguments,1);return e.each(function(){var c,s,e,t,n,u=L.isPlainObject(T)?L.extend(!0,{},L.fn.popup.settings,T):L.extend({},L.fn.popup.settings),i=u.selector,d=u.className,f=u.error,p=u.metadata,a=u.namespace,o="."+u.namespace,r="module-"+a,m=L(this),l=[j,H].indexOf(u.context)<0?L(H).find(u.context):L(u.context),g=[j,H].indexOf(u.scrollContext)<0?L(H).find(u.scrollContext):L(u.scrollContext),h=[j,H].indexOf(u.boundary)<0?L(H).find(u.boundary):L(u.boundary),v=u.target?[j,H].indexOf(u.target)<0?L(H).find(u.target):L(u.target):m,b=0,y=!1,x=!1,w=this,C=m.data(r),k={initialize:function(){k.debug("Initializing",m),k.createID(),k.bind.events(),!k.exists()&&u.preserve&&k.create(),u.observeChanges&&k.observeChanges(),k.instantiate()},instantiate:function(){k.verbose("Storing instance",k),C=k,m.data(r,C)},observeChanges:function(){"MutationObserver"in j&&((e=new MutationObserver(k.event.documentChanged)).observe(H,{childList:!0,subtree:!0}),k.debug("Setting up mutation observer",e))},refresh:function(){u.popup&&"string"==typeof u.popup?c=L(H).find(u.popup).eq(0):u.inline&&(c=v.nextAll(i.popup).eq(0),u.popup=c),u.popup?(c.addClass(d.loading),s=k.get.offsetParent(),c.removeClass(d.loading),u.movePopup&&k.has.popup()&&k.get.offsetParent(c)[0]!==s[0]&&(k.debug("Moving popup to the same offset parent as target"),c.detach().appendTo(s))):s=u.inline?k.get.offsetParent(v):k.has.popup()?k.get.offsetParent(c):E,s.is("html")&&s[0]!==E[0]&&(k.debug("Setting page as offset parent"),s=E),k.get.variation()&&k.set.variation()},reposition:function(){k.refresh(),k.set.position()},destroy:function(){k.debug("Destroying previous module"),e&&e.disconnect(),c&&!u.preserve&&k.removePopup(),clearTimeout(k.hideTimer),clearTimeout(k.showTimer),k.unbind.close(),k.unbind.events(),m.removeData(r)},event:{start:function(e){var t=L.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(k.hideTimer),x&&!u.addTouchEvents||(k.showTimer=setTimeout(k.show,t))},end:function(){var e=L.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(k.showTimer),k.hideTimer=setTimeout(k.hide,e)},touchstart:function(e){x=!0,u.addTouchEvents&&k.show()},resize:function(){k.is.visible()&&k.set.position()},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==w||0<L(e).find(w).length)&&(k.debug("Element removed from DOM, tearing down events"),k.destroy())})})},hideGracefully:function(e){var t=L(e.target),n=L.contains(H.documentElement,e.target),t=0<t.closest(i.popup).length;e&&!t&&n?(k.debug("Click occurred outside popup hiding popup"),k.hide()):k.debug("Click was inside popup, keeping popup open")}},create:function(){var e=k.get.html(),t=k.get.title(),n=k.get.content();e||n||t?(k.debug("Creating pop-up html"),e=e||u.templates.popup({title:t,content:n}),c=L("<div/>").addClass(d.popup).data(p.activator,m).html(e),u.inline?(k.verbose("Inserting popup element inline",c),c.insertAfter(m)):(k.verbose("Appending popup element to body",c),c.appendTo(l)),k.refresh(),k.set.variation(),u.hoverable&&k.bind.popup(),u.onCreate.call(c,w)):u.popup&&"string"==typeof u.popup?(L(H).find(u.popup).data(p.activator,m),k.verbose("Used popup specified in settings"),k.refresh(),u.hoverable&&k.bind.popup()):0!==v.next(i.popup).length?(k.verbose("Pre-existing popup found"),u.inline=!0,u.popup=v.next(i.popup).data(p.activator,m),k.refresh(),u.hoverable&&k.bind.popup()):k.debug("No content specified skipping display",w)},createID:function(){n=(Math.random().toString(16)+"000000000").slice(2,10),t="."+n,k.verbose("Creating unique id for element",n)},toggle:function(){k.debug("Toggling pop-up"),k.is.hidden()?(k.debug("Popup is hidden, showing pop-up"),k.unbind.close(),k.show()):(k.debug("Popup is visible, hiding pop-up"),k.hide())},show:function(e){e=e||function(){},k.debug("Showing pop-up",u.transition),!k.is.hidden()||k.is.active()&&k.is.dropdown()||(k.exists()||k.create(),!1===u.onShow.call(c,w)?k.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||k.refresh(),c&&k.set.position()&&(k.save.conditions(),u.exclusive&&k.hideAll(),k.animate.show(e))))},hide:function(e){e=e||function(){},(k.is.visible()||k.is.animating())&&(!1===u.onHide.call(c,w)?k.debug("onHide callback returned false, cancelling popup animation"):(k.remove.visible(),k.unbind.close(),k.restore.conditions(),k.animate.hide(e)))},hideAll:function(){L(H).find(i.popup).filter("."+d.popupVisible).each(function(){L(this).data(p.activator).popup("hide")})},exists:function(){return!!c&&(u.inline||u.popup?k.has.popup():1<=c.closest(l).length)},removePopup:function(){k.has.popup()&&!u.popup&&(k.debug("Removing popup",c),c.remove(),c=N,u.onRemove.call(c,w))},save:{conditions:function(){k.cache={title:m.attr("title")},k.cache.title&&m.removeAttr("title"),k.verbose("Saving original attributes",k.cache.title)}},restore:{conditions:function(){return k.cache&&k.cache.title&&(m.attr("title",k.cache.title),k.verbose("Restoring original attributes",k.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(e){e=L.isFunction(e)?e:function(){},u.transition&&L.fn.transition!==N&&m.transition("is supported")?(k.set.visible(),c.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,duration:u.transition.showDuration||u.duration,onComplete:function(){k.bind.close(),e.call(c,w),u.onVisible.call(c,w)}})):k.error(f.noTransition)},hide:function(e){e=L.isFunction(e)?e:function(){},k.debug("Hiding pop-up"),u.transition&&L.fn.transition!==N&&m.transition("is supported")?c.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,onComplete:function(){k.reset(),e.call(c,w),u.onHidden.call(c,w)}}):k.error(f.noTransition)}},change:{content:function(e){c.html(e)}},get:{html:function(){return m.removeData(p.html),m.data(p.html)||u.html},title:function(){return m.removeData(p.title),m.data(p.title)||u.title},content:function(){return m.removeData(p.content),m.data(p.content)||u.content||m.attr("title")},variation:function(){return m.removeData(p.variation),m.data(p.variation)||u.variation},popup:function(){return c},popupOffset:function(){return c.offset()},calculations:function(){var e=k.get.offsetParent(c),t=v[0],n=h[0]==j,i=v.offset(),a=u.inline||u.popup&&u.movePopup?v.offsetParent().offset():{top:0,left:0},o=n?{top:0,left:0}:h.offset(),r={},n=n?{top:A.scrollTop(),left:A.scrollLeft()}:{top:0,left:0},r={target:{element:v[0],width:v.outerWidth(),height:v.outerHeight(),top:i.top-a.top,left:i.left-a.left,margin:{}},popup:{width:c.outerWidth(),height:c.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:o.top,left:o.left,scroll:{top:n.top,left:n.left},width:h.width(),height:h.height()}};return e.get(0)!==s.get(0)&&(i=e.offset(),r.target.top-=i.top,r.target.left-=i.left,r.parent.width=e.outerWidth(),r.parent.height=e.outerHeight()),u.setFluidWidth&&k.is.fluid()&&(r.container={width:c.parent().outerWidth()},r.popup.width=r.container.width),r.target.margin.top=u.inline?parseInt(j.getComputedStyle(t).getPropertyValue("margin-top"),10):0,r.target.margin.left=u.inline?k.is.rtl()?parseInt(j.getComputedStyle(t).getPropertyValue("margin-right"),10):parseInt(j.getComputedStyle(t).getPropertyValue("margin-left"),10):0,a=r.screen,r.boundary={top:a.top+a.scroll.top,bottom:a.top+a.scroll.top+a.height,left:a.left+a.scroll.left,right:a.left+a.scroll.left+a.width},r},id:function(){return n},startEvent:function(){return"hover"==u.on?"mouseenter":"focus"==u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==u.on?"mouseleave":"focus"==u.on&&"blur"},distanceFromBoundary:function(e,t){var n={},i=(t=t||k.get.calculations()).popup,t=t.boundary;return e&&(n={top:e.top-t.top,left:e.left-t.left,right:t.right-(e.left+i.width),bottom:t.bottom-(e.top+i.height)},k.verbose("Distance from boundaries determined",e,n)),n},offsetParent:function(e){var t=(e!==N?e:v)[0].parentNode,n=L(t);if(t)for(var i="none"===n.css("transform"),a="static"===n.css("position"),o=n.is("body");t&&!o&&a&&i;)t=t.parentNode,i="none"===(n=L(t)).css("transform"),a="static"===n.css("position"),o=n.is("body");return n&&0<n.length?n:L()},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],t=t[1],i="top"==n||"bottom"==n,a=!1,o=!1,r=!1;return y||(k.verbose("All available positions available"),y=k.get.positions()),k.debug("Recording last position tried",e),y[e]=!0,"opposite"===u.prefer&&(r=(r=[{top:"bottom",bottom:"top",left:"right",right:"left"}[n],t]).join(" "),a=!0===y[r],k.debug("Trying opposite strategy",r)),"adjacent"===u.prefer&&i&&(r=(r=[n,{left:"center",center:"right",right:"left"}[t]]).join(" "),o=!0===y[r],k.debug("Trying adjacent strategy",r)),(o||a)&&(k.debug("Using backup position",r),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"}[e]),r}},set:{position:function(e,t){if(0!==v.length&&0!==c.length){var n,i,a,o,r,s,l;if(t=t||k.get.calculations(),e=e||m.data(p.position)||u.position,n=m.data(p.offset)||u.offset,i=u.distanceAway,a=t.target,o=t.popup,r=t.parent,k.should.centerArrow(t)&&(k.verbose("Adjusting offset to center arrow on small target element"),"top left"!=e&&"bottom left"!=e||(n=(n+=a.width/2)-u.arrowPixelsFromEdge),"top right"!=e&&"bottom right"!=e||(n=(n-=a.width/2)+u.arrowPixelsFromEdge)),0===a.width&&0===a.height&&!k.is.svg(a.element))return k.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(k.debug("Adding margin to calculation",a.margin),"left center"==e||"right center"==e?(n+=a.margin.top,i+=-a.margin.left):"top left"==e||"top center"==e||"top right"==e?(n+=a.margin.left,i-=a.margin.top):(n+=a.margin.left,i+=a.margin.top)),k.debug("Determining popup position from calculations",e,t),k.is.rtl()&&(e=e.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),k.debug("RTL: Popup position updated",e)),e=b==u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:e){case"top left":s={top:"auto",bottom:r.height-a.top+i,left:a.left+n,right:"auto"};break;case"top center":s={bottom:r.height-a.top+i,left:a.left+a.width/2-o.width/2+n,top:"auto",right:"auto"};break;case"top right":s={bottom:r.height-a.top+i,right:r.width-a.left-a.width-n,top:"auto",left:"auto"};break;case"left center":s={top:a.top+a.height/2-o.height/2+n,right:r.width-a.left+i,left:"auto",bottom:"auto"};break;case"right center":s={top:a.top+a.height/2-o.height/2+n,left:a.left+a.width+i,bottom:"auto",right:"auto"};break;case"bottom left":s={top:a.top+a.height+i,left:a.left+n,bottom:"auto",right:"auto"};break;case"bottom center":s={top:a.top+a.height+i,left:a.left+a.width/2-o.width/2+n,bottom:"auto",right:"auto"};break;case"bottom right":s={top:a.top+a.height+i,right:r.width-a.left-a.width-n,left:"auto",bottom:"auto"}}if(s===N&&k.error(f.invalidPosition,e),k.debug("Calculated popup positioning values",s),c.css(s).removeClass(d.position).addClass(e).addClass(d.loading),l=k.get.popupOffset(),l=k.get.distanceFromBoundary(l,t),!u.forcePosition&&k.is.offstage(l,e)){if(k.debug("Position is outside viewport",e),b<u.maxSearchDepth)return b++,e=k.get.nextPosition(e),k.debug("Trying new position",e),!!c&&k.set.position(e,t);if(!u.lastResort)return k.debug("Popup could not find a position to display",c),k.error(f.cannotPlace,w),k.remove.attempts(),k.remove.loading(),k.reset(),u.onUnplaceable.call(c,w),!1;k.debug("No position found, showing with last position")}return k.debug("Position is on stage",e),k.remove.attempts(),k.remove.loading(),u.setFluidWidth&&k.is.fluid()&&k.set.fluidWidth(t),!0}k.error(f.notFound)},fluidWidth:function(e){e=e||k.get.calculations(),k.debug("Automatically setting element width to parent width",e.parent.width),c.css("width",e.container.width)},variation:function(e){(e=e||k.get.variation())&&k.has.popup()&&(k.verbose("Adding variation to popup",e),c.addClass(e))},visible:function(){m.addClass(d.visible)}},remove:{loading:function(){c.removeClass(d.loading)},variation:function(e){(e=e||k.get.variation())&&(k.verbose("Removing variation",e),c.removeClass(e))},visible:function(){m.removeClass(d.visible)},attempts:function(){k.verbose("Resetting all searched positions"),b=0,y=!1}},bind:{events:function(){k.debug("Binding popup events to module"),"click"==u.on&&m.on(M+o,k.toggle),"hover"==u.on&&m.on("touchstart"+o,k.event.touchstart),k.get.startEvent()&&m.on(k.get.startEvent()+o,k.event.start).on(k.get.endEvent()+o,k.event.end),u.target&&k.debug("Target set to element",v),A.on("resize"+t,k.event.resize)},popup:function(){k.verbose("Allowing hover events on popup to prevent closing"),c&&k.has.popup()&&c.on("mouseenter"+o,k.event.start).on("mouseleave"+o,k.event.end)},close:function(){(!0===u.hideOnScroll||"auto"==u.hideOnScroll&&"click"!=u.on)&&k.bind.closeOnScroll(),k.is.closable()?k.bind.clickaway():"hover"==u.on&&x&&k.bind.touchClose()},closeOnScroll:function(){k.verbose("Binding scroll close event to document"),g.one(k.get.scrollEvent()+t,k.event.hideGracefully)},touchClose:function(){k.verbose("Binding popup touchclose event to document"),S.on("touchstart"+t,function(e){k.verbose("Touched away from popup"),k.event.hideGracefully.call(w,e)})},clickaway:function(){k.verbose("Binding popup close event to document"),S.on(M+t,function(e){k.verbose("Clicked away from popup"),k.event.hideGracefully.call(w,e)})}},unbind:{events:function(){A.off(t),m.off(o)},close:function(){S.off(t),g.off(t)}},has:{popup:function(){return c&&0<c.length}},should:{centerArrow:function(e){return!k.is.basic()&&e.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==u.closable?"hover"!=u.on:u.closable},offstage:function(e,n){var i=[];return L.each(e,function(e,t){t<-u.jitter&&(k.debug("Position exceeds allowable distance from edge",e,t,n),i.push(e))}),0<i.length},svg:function(e){return k.supports.svg()&&e instanceof SVGGraphicsElement},basic:function(){return m.hasClass(d.basic)},active:function(){return m.hasClass(d.active)},animating:function(){return c!==N&&c.hasClass(d.animating)},fluid:function(){return c!==N&&c.hasClass(d.fluid)},visible:function(){return c!==N&&c.hasClass(d.popupVisible)},dropdown:function(){return m.hasClass(d.dropdown)},hidden:function(){return!k.is.visible()},rtl:function(){return"rtl"===m.attr("dir")||"rtl"===m.css("direction")}},reset:function(){k.remove.visible(),u.preserve?L.fn.transition!==N&&c.transition("remove transition"):k.removePopup()},setting:function(e,t){if(L.isPlainObject(e))L.extend(!0,u,e);else{if(t===N)return u[e];u[e]=t}},internal:function(e,t){if(L.isPlainObject(e))L.extend(!0,k,e);else{if(t===N)return k[e];k[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?k.performance.log(arguments):(k.debug=Function.prototype.bind.call(console.info,console,u.name+":"),k.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?k.performance.log(arguments):(k.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),k.verbose.apply(console,arguments)))},error:function(){u.silent||(k.error=Function.prototype.bind.call(console.error,console,u.name+":"),k.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(O||t),O=t,P.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(k.performance.timer),k.performance.timer=setTimeout(k.performance.display,500)},display:function(){var e=u.name+":",n=0;O=!1,clearTimeout(k.performance.timer),L.each(P,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",F&&(e+=" '"+F+"'"),(console.group!==N||console.table!==N)&&0<P.length&&(console.groupCollapsed(e),console.table?console.table(P):L.each(P,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),P=[]}},invoke:function(i,e,t){var a,o,n,r=C;return e=e||q,t=w||t,"string"==typeof i&&r!==N&&(i=i.split(/[\. ]/),a=i.length-1,L.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(L.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==N)return o=r[n],!1;{if(!L.isPlainObject(r[t])||e==a)return r[t]!==N&&(o=r[t]),!1;r=r[t]}}})),L.isFunction(o)?n=o.apply(t,e):o!==N&&(n=o),Array.isArray(D)?D.push(n):D!==N?D=[D,n]:n!==N&&(D=n),o}};I?(C===N&&k.initialize(),k.invoke(R)):(C!==N&&C.invoke("destroy"),k.initialize())}),D!==N?D:this},L.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:j,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:j,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return t[e]}):e},popup:function(e){var t="",n=L.fn.popup.settings.templates.escape;return typeof e!==N&&(typeof e.title!==N&&e.title&&(e.title=n(e.title),t+='<div class="header">'+e.title+"</div>"),typeof e.content!==N&&e.content&&(e.content=n(e.content),t+='<div class="content">'+e.content+"</div>")),t}}}}(jQuery,window,document),function(T,e,D,S){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.progress=function(h){var v,e=T(this),b=e.selector||"",y=(new Date).getTime(),x=[],w=h,C="string"==typeof w,k=[].slice.call(arguments,1);return e.each(function(){var r=T.isPlainObject(h)?T.extend(!0,{},T.fn.progress.settings,h):T.extend({},T.fn.progress.settings),n=r.className,t=r.metadata,e=r.namespace,i=r.selector,s=r.error,a="."+e,o="module-"+e,c=T(this),u=T(this).find(i.bar),l=T(this).find(i.progress),d=T(this).find(i.label),f=this,p=c.data(o),m=!1,g={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var n=0,i=1,a=e/t;n<10&&!(1<(a*=i));)i=Math.pow(10,n++);return i},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){g.set.duration(),g.set.transitionEvent(),g.debug(f),g.read.metadata(),g.read.settings(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of progress",g),p=g,c.data(o,g)},destroy:function(){g.verbose("Destroying previous progress for",c),clearInterval(p.interval),g.remove.state(),c.removeData(o),p=S},reset:function(){g.remove.nextValue(),g.update.progress(0)},complete:function(e){(g.percent===S||g.percent<100)&&(g.remove.progressPoll(),!0!==e&&g.set.percent(100))},read:{metadata:function(){var e={percent:g.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:g.helper.forceArray(c.data(t.value))};e.total!==S&&(g.debug("Total value set from metadata",e.total),g.set.total(e.total)),0<e.value.length&&(g.debug("Current value set from metadata",e.value),g.set.value(e.value),g.set.progress(e.value)),0<e.percent.length&&(g.debug("Current percent value set from metadata",e.percent),g.set.percent(e.percent))},settings:function(){!1!==r.total&&(g.debug("Current total set in settings",r.total),g.set.total(r.total)),!1!==r.value&&(g.debug("Current value set in settings",r.value),g.set.value(r.value),g.set.progress(g.value)),!1!==r.percent&&(g.debug("Current percent set in settings",r.percent),g.set.percent(r.percent))}},bind:{transitionEnd:function(t){var e=g.get.transitionEnd();u.one(e+a,function(e){clearTimeout(g.failSafeTimer),t.call(this,e)}),g.failSafeTimer=setTimeout(function(){u.triggerHandler(e)},r.duration+r.failSafeDelay),g.verbose("Adding fail safe timer",g.timer)}},increment:function(e){var t;e=g.has.total()?(t=g.get.value(),e||1):(t=g.get.percent(),e||g.get.randomValue()),g.debug("Incrementing percentage by",t,t=t+e,e),t=g.get.normalizedValue(t),g.set.progress(t)},decrement:function(e){var t,n;g.get.total()?(n=(t=g.get.value())-(e=e||1),g.debug("Decrementing value by",e,t)):(n=(t=g.get.percent())-(e=e||g.get.randomValue()),g.debug("Decrementing percentage by",e,t)),n=g.get.normalizedValue(n),g.set.progress(n)},has:{progressPoll:function(){return g.progressPoll},total:function(){return!1!==g.get.total()}},get:{text:function(e,t){var t=t||0,n=g.get.value(t),i=g.get.total(),a=m?g.get.displayPercent(t):g.get.percent(t),o=!1!==i?Math.max(0,i-n):100-a;return e=(e=e||"").replace("{value}",n).replace("{total}",i||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",r.text.bars[t]||""),g.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return g.debug("Value cannot decrement below 0"),0;if(g.has.total()){if(e>g.total)return g.debug("Value cannot increment above total",g.total),g.total}else if(100<e)return g.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==r.updateInterval?r.duration:r.updateInterval},randomValue:function(){return g.debug("Generating random increment percentage"),Math.floor(Math.random()*r.random.max+r.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=D.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(t.style[e]!==S)return n[e]},displayPercent:function(e){var e=T(u[e]),t=e.width(),n=c.width(),e=parseInt(e.css("min-width"),10)<t?t/n*100:g.percent;return 0<r.precision?Math.round(e*(10*r.precision))/(10*r.precision):Math.round(e)},percent:function(e){return g.percent&&g.percent[e||0]||0},value:function(e){return g.nextValue||g.value&&g.value[e||0]||0},total:function(){return g.total!==S&&g.total}},create:{progressPoll:function(){g.progressPoll=setTimeout(function(){g.update.toNextValue(),g.remove.progressPoll()},g.get.updateInterval())}},is:{complete:function(){return g.is.success()||g.is.warning()||g.is.error()},success:function(){return c.hasClass(n.success)},warning:function(){return c.hasClass(n.warning)},error:function(){return c.hasClass(n.error)},active:function(){return c.hasClass(n.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){g.verbose("Removing progress poll timer"),g.progressPoll&&(clearTimeout(g.progressPoll),delete g.progressPoll)},nextValue:function(){g.verbose("Removing progress value stored for next update"),delete g.nextValue},state:function(){g.verbose("Removing stored state"),delete g.total,delete g.percent,delete g.value},active:function(){g.verbose("Removing active state"),c.removeClass(n.active)},success:function(){g.verbose("Removing success state"),c.removeClass(n.success)},warning:function(){g.verbose("Removing warning state"),c.removeClass(n.warning)},error:function(){g.verbose("Removing error state"),c.removeClass(n.error)}},set:{barWidth:function(e){g.debug("set bar width with ",e),e=g.helper.forceArray(e);var a=-1,o=-1,r=g.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var n=t===s-1&&0===r,i=T(u[t]);return 0===e&&l&&!n?i.css("display","none"):(l&&n&&i.css("background","transparent"),-1==a&&(a=t),o=t,i.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){T(u[t]).css({borderTopLeftRadius:t==a?"":0,borderBottomLeftRadius:t==a?"":0,borderTopRightRadius:t==o?"":0,borderBottomRightRadius:t==o?"":0})}),c.attr("data-percent",t)},duration:function(e){e=e||r.duration,g.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=g.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,r.limitValues?Math.max(0,Math.min(100,e)):e});var t,n=g.has.total(),i=g.helper.sum(e),a=1<e.length&&n,o=g.helper.sum(g.helper.forceArray(g.value));a&&o>g.total?g.error(s.sumExceedsTotal,o,g.total):!a&&100<i?g.error(s.tooHigh,i):i<0?g.error(s.tooLow,i):(t=0<r.precision?r.precision:a?g.helper.derivePrecision(Math.min.apply(null,g.value),g.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),g.percent=o,n&&(g.value=e.map(function(e){return 0<t?Math.round(e/100*g.total*(10*t))/(10*t):Math.round(e/100*g.total*10)/10})),g.set.barWidth(e),g.set.labelInterval()),r.onChange.call(f,e,g.value,g.total)},labelInterval:function(){clearInterval(g.interval),g.bind.transitionEnd(function(){g.verbose("Bar finished animating, removing continuous label updates"),clearInterval(g.interval),m=!1,g.set.labels()}),m=!0,g.interval=setInterval(function(){T.contains(D.documentElement,f)||(clearInterval(g.interval),m=!1),g.set.labels()},r.framerate)},labels:function(){g.verbose("Setting both bar progress and outer label text"),g.set.barLabel(),g.set.state()},label:function(e){(e=e||"")&&(e=g.get.text(e),g.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=e!==S?e:g.helper.sum(g.percent))?r.autoSuccess&&1===u.length&&!(g.is.warning()||g.is.error()||g.is.success())?(g.set.success(),g.debug("Automatically triggering success at 100%")):(g.verbose("Reached 100% removing active state"),g.remove.active(),g.remove.progressPoll()):0<e?(g.verbose("Adjusting active progress bar label",e),g.set.active()):(g.remove.active(),g.remove.warning(),g.remove.error(),g.remove.success(),g.set.label(r.text.active))},barLabel:function(n){l.map(function(e,t){t=T(t);n!==S?t.text(g.get.text(n,e)):"ratio"==r.label&&g.has.total()?(g.verbose("Adding ratio to bar label"),t.text(g.get.text(r.text.ratio,e))):"percent"==r.label&&(g.verbose("Adding percentage to bar label"),t.text(g.get.text(r.text.percent,e)))})},active:function(e){e=e||r.text.active,g.debug("Setting active state"),r.showActivity&&!g.is.active()&&c.addClass(n.active),g.remove.warning(),g.remove.error(),g.remove.success(),(e=r.onLabelUpdate("active",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onActive.call(f,g.value,g.total)})},success:function(e,t){e=e||r.text.success||r.text.active,g.debug("Setting success state"),c.addClass(n.success),g.remove.active(),g.remove.warning(),g.remove.error(),g.complete(t),e=r.text.success?r.onLabelUpdate("success",e,g.value,g.total):r.onLabelUpdate("active",e,g.value,g.total),g.set.label(e),g.bind.transitionEnd(function(){r.onSuccess.call(f,g.total)})},warning:function(e,t){e=e||r.text.warning,g.debug("Setting warning state"),c.addClass(n.warning),g.remove.active(),g.remove.success(),g.remove.error(),g.complete(t),(e=r.onLabelUpdate("warning",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onWarning.call(f,g.value,g.total)})},error:function(e,t){e=e||r.text.error,g.debug("Setting error state"),c.addClass(n.error),g.remove.active(),g.remove.success(),g.remove.warning(),g.complete(t),(e=r.onLabelUpdate("error",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onError.call(f,g.value,g.total)})},transitionEvent:function(){g.get.transitionEnd()},total:function(e){g.total=e},value:function(e){g.value=g.helper.forceArray(e)},progress:function(e){g.has.progressPoll()?(g.debug("Updated within interval, setting next update to use new value",e),g.set.nextValue(e)):(g.debug("First update in progress update interval, immediately updating",e),g.update.progress(e),g.create.progressPoll())},nextValue:function(e){g.nextValue=e}},update:{toNextValue:function(){var e=g.nextValue;e&&(g.debug("Update interval complete using last updated value",e),g.update.progress(e),g.remove.nextValue())},progress:function(e){var n=g.has.total(),e=(n&&g.set.value(e),g.helper.forceArray(e).map(function(e){var t;return!1===(e=g.get.numericValue(e))&&g.error(s.nonNumeric,e),e=g.get.normalizedValue(e),n?(t=0<g.total?e/g.total*100:100,g.debug("Calculating percent complete from total",t)):(t=e,g.debug("Setting value to exact percentage value",t)),t}));g.set.percent(e)}},setting:function(e,t){if(g.debug("Changing setting",e,t),T.isPlainObject(e))T.extend(!0,r,e);else{if(t===S)return r[e];T.isPlainObject(r[e])?T.extend(!0,r[e],t):r[e]=t}},internal:function(e,t){if(T.isPlainObject(e))T.extend(!0,g,e);else{if(t===S)return g[e];g[e]=t}},debug:function(){!r.silent&&r.debug&&(r.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,r.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),g.verbose.apply(console,arguments)))},error:function(){r.silent||(g.error=Function.prototype.bind.call(console.error,console,r.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,n;r.performance&&(n=(t=(new Date).getTime())-(y||t),y=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var e=r.name+":",n=0;y=!1,clearTimeout(g.performance.timer),T.each(x,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",b&&(e+=" '"+b+"'"),(console.group!==S||console.table!==S)&&0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):T.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(i,e,t){var a,o,n,r=p;return e=e||k,t=f||t,"string"==typeof i&&r!==S&&(i=i.split(/[\. ]/),a=i.length-1,T.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(T.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==S)return o=r[n],!1;{if(!T.isPlainObject(r[t])||e==a)return r[t]!==S?o=r[t]:g.error(s.method,i),!1;r=r[t]}}})),T.isFunction(o)?n=o.apply(t,e):o!==S&&(n=o),Array.isArray(v)?v.push(n):v!==S?v=[v,n]:n!==S&&(v=n),o}};C?(p===S&&g.initialize(),g.invoke(w)):(p!==S&&p.invoke("destroy"),g.initialize())}),v!==S?v:this},T.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,n,i){return t},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%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(R,I,q,L){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},I=void 0!==I&&I.Math==Math?I:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.sidebar=function(x){var w,e=R(this),C=R(I),k=R(q),T=R("html"),D=R("head"),S=e.selector||"",A=(new Date).getTime(),E=[],F=x,M="string"==typeof F,O=[].slice.call(arguments,1),P=I.requestAnimationFrame||I.mozRequestAnimationFrame||I.webkitRequestAnimationFrame||I.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var a,o,e,t,r,s=R.isPlainObject(x)?R.extend(!0,{},R.fn.sidebar.settings,x):R.extend({},R.fn.sidebar.settings),n=s.selector,l=s.className,i=s.namespace,c=s.regExp,u=s.error,d="."+i,f="module-"+i,p=R(this),m=[I,q].indexOf(s.context)<0?R(q).find(s.context):R(s.context),g=p.children(n.sidebar),h=(m.children(n.fixed),m.children(n.pusher)),v=this,b=p.data(f),y={initialize:function(){y.debug("Initializing sidebar",x),y.create.id(),r=y.get.transitionEvent(),s.delaySetup?P(y.setup.layout):y.setup.layout(),P(function(){y.setup.cache()}),y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y),b=y,p.data(f,y)},create:{id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),o="."+e,y.verbose("Creating unique id for element",e)}},destroy:function(){y.verbose("Destroying previous module for",p),p.off(d).removeData(f),y.is.ios()&&y.remove.ios(),m.off(o),C.off(o),k.off(o)},event:{clickaway:function(e){var t;s.closable&&(t=0<h.find(e.target).length||h.is(e.target),e=m.is(e.target),t&&(y.verbose("User clicked on dimmed page"),y.hide()),e&&(y.verbose("User clicked on dimmable context (scaled out page)"),y.hide()))},touch:function(e){},containScroll:function(e){v.scrollTop<=0&&(v.scrollTop=1),v.scrollTop+v.offsetHeight>=v.scrollHeight&&(v.scrollTop=v.scrollHeight-v.offsetHeight-1)},scroll:function(e){0===R(e.target).closest(n.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){y.verbose("Adding clickaway events to context",m),m.on("click"+o,y.event.clickaway).on("touchend"+o,y.event.clickaway)},scrollLock:function(){s.scrollLock&&(y.debug("Disabling page scroll"),C.on("DOMMouseScroll"+o,y.event.scroll)),y.verbose("Adding events to contain sidebar scroll"),k.on("touchmove"+o,y.event.touch),p.on("scroll"+d,y.event.containScroll)}},unbind:{clickaway:function(){y.verbose("Removing clickaway events from context",m),m.off(o)},scrollLock:function(){y.verbose("Removing scroll lock from page"),k.off(o),C.off(o),p.off("scroll"+d)}},add:{inlineCSS:function(){var e=y.cache.width||p.outerWidth(),t=y.cache.height||p.outerHeight(),n=y.is.rtl(),i=y.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(y.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(y.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+i+".sidebar ~ .fixed, .ui.visible."+i+".sidebar ~ .pusher { -webkit-transform: translate3d("+t[i]+"px, 0, 0); transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!=i||(n+=" .ui.visible."+i+".sidebar ~ .fixed, .ui.visible."+i+".sidebar ~ .pusher { -webkit-transform: translate3d(0, "+t[i]+"px, 0); transform: translate3d(0, "+t[i]+"px, 0); }"),y.is.ie()&&("left"===i||"right"===i?(y.debug("Adding CSS rules for animation distance",e),n+=" body.pushable > .ui.visible."+i+".sidebar ~ .pusher::after { -webkit-transform: translate3d("+t[i]+"px, 0, 0); transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!=i||(n+=" body.pushable > .ui.visible."+i+".sidebar ~ .pusher::after { -webkit-transform: translate3d(0, "+t[i]+"px, 0); transform: translate3d(0, "+t[i]+"px, 0); }"),n+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }"),a=R(n+="</style>").appendTo(D),y.debug("Adding sizing css to head",a)}},refresh:function(){y.verbose("Refreshing selector cache"),m=[I,q].indexOf(s.context)<0?R(q).find(s.context):R(s.context),g=m.children(n.sidebar),h=m.children(n.pusher),m.children(n.fixed),y.clear.cache()},refreshSidebars:function(){y.verbose("Refreshing other sidebars"),g=m.children(n.sidebar)},repaint:function(){y.verbose("Forcing repaint event"),v.style.display="none";v.offsetHeight;v.scrollTop=v.scrollTop,v.style.display=""},setup:{cache:function(){y.cache={width:p.outerWidth(),height:p.outerHeight()}},layout:function(){0===m.children(n.pusher).length&&(y.debug("Adding wrapper element for sidebar"),y.error(u.pusher),h=R('<div class="pusher" />'),m.children().not(n.omitted).not(g).wrapAll(h),y.refresh()),0!==p.nextAll(n.pusher).length&&p.nextAll(n.pusher)[0]===h[0]||(y.debug("Moved sidebar to correct parent element"),y.error(u.movedSidebar,v),p.detach().prependTo(m),y.refresh()),y.clear.cache(),y.set.pushable(),y.set.direction()}},attachEvents:function(e,t){var n=R(e);t=R.isFunction(y[t])?y[t]:y.toggle,0<n.length?(y.debug("Attaching sidebar events to element",e,t),n.on("click"+d,t)):y.error(u.notFound,e)},show:function(e){if(e=R.isFunction(e)?e:function(){},y.is.hidden())if(!1===s.onShow.call(v))y.verbose("Show callback returned false cancelling show");else{if(y.refreshSidebars(),s.overlay&&(y.error(u.overlay),s.transition="overlay"),y.refresh(),y.othersActive())if(y.debug("Other sidebars currently visible"),s.exclusive){if("overlay"!=s.transition)return void y.hideOthers(y.show);y.hideOthers()}else s.transition="overlay";y.pushPage(function(){e.call(v),s.onVisible.call(v)}),s.onChange.call(v)}else y.debug("Sidebar is already visible")},hide:function(e){e=R.isFunction(e)?e:function(){},(y.is.visible()||y.is.animating())&&!1!==s.onHide.call(v)&&(y.debug("Hiding sidebar",e),y.refreshSidebars(),y.pullPage(function(){e.call(v),s.onHidden.call(v)}),s.onChange.call(v))},othersAnimating:function(){return 0<g.not(p).filter("."+l.animating).length},othersVisible:function(){return 0<g.not(p).filter("."+l.visible).length},othersActive:function(){return y.othersVisible()||y.othersAnimating()},hideOthers:function(e){var t=g.not(p).filter("."+l.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){++i==n&&e()})},toggle:function(){y.verbose("Determining toggled direction"),y.is.hidden()?y.show():y.hide()},pushPage:function(t){var e,n,i=y.get.transition(),a="overlay"===i||y.othersActive()?p:h;t=R.isFunction(t)?t:function(){},"scale down"==s.transition&&y.scrollToTop(),y.set.transition(i),y.repaint(),i=function(){y.bind.clickaway(),y.add.inlineCSS(),y.set.animating(),y.set.visible()},e=function(){y.set.dimmed()},n=function(e){e.target==a[0]&&(a.off(r+o,n),y.remove.animating(),y.bind.scrollLock(),t.call(v))},a.off(r+o),a.on(r+o,n),P(i),s.dimPage&&!y.othersVisible()&&P(e)},pullPage:function(t){var e,n,i=y.get.transition(),a="overlay"==i||y.othersActive()?p:h;t=R.isFunction(t)?t:function(){},y.verbose("Removing context push state",y.get.direction()),y.unbind.clickaway(),y.unbind.scrollLock(),e=function(){y.set.transition(i),y.set.animating(),y.remove.visible(),s.dimPage&&!y.othersVisible()&&h.removeClass(l.dimmed)},n=function(e){e.target==a[0]&&(a.off(r+o,n),y.remove.animating(),y.remove.transition(),y.remove.inlineCSS(),("scale down"==i||s.returnScroll&&y.is.mobile())&&y.scrollBack(),t.call(v))},a.off(r+o),a.on(r+o,n),P(e)},scrollToTop:function(){y.verbose("Scrolling to top of page to avoid animation issues"),t=R(I).scrollTop(),p.scrollTop(0),I.scrollTo(0,0)},scrollBack:function(){y.verbose("Scrolling back to original page position"),I.scrollTo(0,t)},clear:{cache:function(){y.verbose("Clearing cached dimensions"),y.cache={}}},set:{ios:function(){T.addClass(l.ios)},pushed:function(){m.addClass(l.pushed)},pushable:function(){m.addClass(l.pushable)},dimmed:function(){h.addClass(l.dimmed)},active:function(){p.addClass(l.active)},animating:function(){p.addClass(l.animating)},transition:function(e){e=e||y.get.transition(),p.addClass(e)},direction:function(e){e=e||y.get.direction(),p.addClass(l[e])},visible:function(){p.addClass(l.visible)},overlay:function(){p.addClass(l.overlay)}},remove:{inlineCSS:function(){y.debug("Removing inline css styles",a),a&&0<a.length&&a.remove()},ios:function(){T.removeClass(l.ios)},pushed:function(){m.removeClass(l.pushed)},pushable:function(){m.removeClass(l.pushable)},active:function(){p.removeClass(l.active)},animating:function(){p.removeClass(l.animating)},transition:function(e){e=e||y.get.transition(),p.removeClass(e)},direction:function(e){e=e||y.get.direction(),p.removeClass(l[e])},visible:function(){p.removeClass(l.visible)},overlay:function(){p.removeClass(l.overlay)}},get:{direction:function(){return p.hasClass(l.top)?l.top:p.hasClass(l.right)?l.right:p.hasClass(l.bottom)?l.bottom:l.left},transition:function(){var e=y.get.direction(),e=y.is.mobile()?"auto"==s.mobileTransition?s.defaultTransition.mobile[e]:s.mobileTransition:"auto"==s.transition?s.defaultTransition.computer[e]:s.transition;return y.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=q.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(t.style[e]!==L)return n[e]}},is:{ie:function(){var e=!I.ActiveXObject&&"ActiveXObject"in I,t="ActiveXObject"in I;return e||t},ios:function(){var e=navigator.userAgent,t=e.match(c.ios),n=e.match(c.mobileChrome);return!(!t||n)&&(y.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(c.mobile)?(y.verbose("Browser was found to be mobile",e),!0):(y.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!y.is.visible()},visible:function(){return p.hasClass(l.visible)},open:function(){return y.is.visible()},closed:function(){return y.is.hidden()},vertical:function(){return p.hasClass(l.top)},animating:function(){return m.hasClass(l.animating)},rtl:function(){return y.cache.rtl===L&&(y.cache.rtl="rtl"===p.attr("dir")||"rtl"===p.css("direction")),y.cache.rtl}},setting:function(e,t){if(y.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,s,e);else{if(t===L)return s[e];R.isPlainObject(s[e])?R.extend(!0,s[e],t):s[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,y,e);else{if(t===L)return y[e];y[e]=t}},debug:function(){!s.silent&&s.debug&&(s.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,s.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!s.silent&&s.verbose&&s.debug&&(s.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),y.verbose.apply(console,arguments)))},error:function(){s.silent||(y.error=Function.prototype.bind.call(console.error,console,s.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;s.performance&&(n=(t=(new Date).getTime())-(A||t),A=t,E.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=s.name+":",n=0;A=!1,clearTimeout(y.performance.timer),R.each(E,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",S&&(e+=" '"+S+"'"),(console.group!==L||console.table!==L)&&0<E.length&&(console.groupCollapsed(e),console.table?console.table(E):R.each(E,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),E=[]}},invoke:function(i,e,t){var a,o,n,r=b;return e=e||O,t=v||t,"string"==typeof i&&r!==L&&(i=i.split(/[\. ]/),a=i.length-1,R.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==L)return o=r[n],!1;{if(!R.isPlainObject(r[t])||e==a)return r[t]!==L?o=r[t]:y.error(u.method,i),!1;r=r[t]}}})),R.isFunction(o)?n=o.apply(t,e):o!==L&&(n=o),Array.isArray(w)?w.push(n):w!==L?w=[w,n]:n!==L&&(w=n),o}};M?(b===L&&y.initialize(),y.invoke(F)):(b!==L&&y.invoke("destroy"),y.initialize())}),w!==L?w:this},R.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(M,O,P,R){"use strict";M.isWindow=M.isWindow||function(e){return null!=e&&e===e.window},M.isFunction=M.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),M.fn.tab=function(l){var c,u=M.isFunction(this)?M(O):M(this),d=u.selector||"",f=(new Date).getTime(),D=[],S=l,A="string"==typeof S,E=[].slice.call(arguments,1),F=!1;return u.each(function(){var p,a,m,g,h,v=M.isPlainObject(l)?M.extend(!0,{},M.fn.tab.settings,l):M.extend({},M.fn.tab.settings),b=v.className,y=v.metadata,t=v.selector,x=v.error,n=v.regExp,e="."+v.namespace,i="module-"+v.namespace,w=M(this),o={},C=!0,r=0,k=this,s=w.data(i),T={initialize:function(){T.debug("Initializing tab menu item",w),T.fix.callbacks(),T.determineTabs(),T.debug("Determining tabs",v.context,a),v.auto&&T.set.auto(),T.bind.events(),v.history&&!F&&(T.initializeHistory(),F=!0);var e,t=T.determine.activeTab();v.autoTabActivation&&s===R&&null==t&&(t=!0===v.autoTabActivation?T.get.initialPath():v.autoTabActivation,T.debug("No active tab detected, setting tab active",t),T.changeTab(t)),null!=t&&v.history&&(e=M.address.autoUpdate(),M.address.autoUpdate(!1),M.address.value(t),M.address.autoUpdate(e)),T.instantiate()},instantiate:function(){T.verbose("Storing instance of module",T),s=T,w.data(i,T)},destroy:function(){T.debug("Destroying tabs",w),w.removeData(i).off(e)},bind:{events:function(){M.isWindow(k)||(T.debug("Attaching tab activation events to element",w),w.on("click"+e,T.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<w.closest(t.ui).length?(e=w.closest(t.ui),T.verbose("Using closest UI element as parent",e)):e=w,p=e.parent(),T.verbose("Determined parent element for creating context",p)):v.context?(p=[O,P].indexOf(v.context)<0?M(P).find(v.context):M(v.context),T.verbose("Using selector for tab context",v.context,p)):p=M("body"),v.childrenOnly?(a=p.children(t.tabs),T.debug("Searching tab context children for tabs",p,a)):(a=p.find(t.tabs),T.debug("Searching tab context for tabs",p,a))},fix:{callbacks:function(){M.isPlainObject(l)&&(l.onTabLoad||l.onTabInit)&&(l.onTabLoad&&(l.onLoad=l.onTabLoad,delete l.onTabLoad,T.error(x.legacyLoad,l.onLoad)),l.onTabInit&&(l.onFirstLoad=l.onTabInit,delete l.onTabInit,T.error(x.legacyInit,l.onFirstLoad)),v=M.extend(!0,{},M.fn.tab.settings,l))}},initializeHistory:function(){if(T.debug("Initializing page state"),M.address===R)return T.error(x.state),!1;if("state"==v.historyType){if(T.debug("Using HTML5 to manage state"),!1===v.path)return T.error(x.path),!1;M.address.history(!0).state(v.path),M(O).trigger("popstate")}M.address.bind("change",T.event.history.change)},event:{click:function(e){var t=M(this).data(y.tab);t!==R?(v.history?(T.verbose("Updating page state",e),M.address.value(t)):(T.verbose("Changing tab",e),T.changeTab(t)),e.preventDefault()):T.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||T.get.initialPath(),n=v.templates.determineTitle(t)||!1;T.performance.display(),T.debug("History change event",t,e),h=e,t!==R&&T.changeTab(t),n&&M.address.title(n)}}},refresh:function(){m&&(T.debug("Refreshing tab",m),T.changeTab(m))},cache:{read:function(e){return e!==R&&o[e]},add:function(e,t){e=e||m,T.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||m,T.debug("Removing cached content for",e),delete o[e]}},escape:{string:function(e){return(e=String(e)).replace(n.escape,"\\$&")}},set:{auto:function(){var e="string"==typeof v.path?v.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";T.verbose("Setting up automatic tab retrieval from server",e),M.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=T.get.tabElement(e);t.hasClass(b.loading)||(T.verbose("Setting loading state for",t),t.addClass(b.loading).siblings(a).removeClass(b.active+" "+b.loading),0<t.length&&v.onRequest.call(t[0],e))},state:function(e){M.address.value(e)}},changeTab:function(c){var u=O.history&&O.history.pushState&&v.ignoreFirstLoad&&C,d=v.auto||M.isPlainObject(v.apiSettings),f=d&&!u?T.utilities.pathToArray(c):T.get.defaultPathArray(c);c=T.utilities.arrayToPath(f),M.each(f,function(e,t){var n,i,a=f.slice(0,e+1),o=T.utilities.arrayToPath(a),r=T.is.tab(o),s=e+1==f.length,l=T.get.tabElement(o);return T.verbose("Looking for tab",t),r?(T.verbose("Tab was found",t),m=o,g=T.utilities.filterArray(f,a),s?i=!0:(r=f.slice(0,e+2),t=T.utilities.arrayToPath(r),(i=!T.is.tab(t))&&T.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(k,o)?(T.debug("onBeforeChange returned false, cancelling tab change",l),!1):i&&d?(u?(T.debug("Ignoring remote content on first tab load",o),C=!1,T.cache.add(c,l.html()),T.activate.all(o),v.onFirstLoad.call(l[0],o,g,h),v.onLoad.call(l[0],o,g,h)):(T.activate.navigation(o),T.fetch.content(o,c)),!1):(T.debug("Opened local tab",o),T.activate.all(o),T.cache.read(o)||(T.cache.add(o,!0),T.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(l[0],o,g,h)),void v.onLoad.call(l[0],o,g,h))):-1!=c.search("/")||""===c?(T.error(x.missingTab,w,p,o),!1):(c=T.escape.string(c),o=(n=M("#"+c+', a[name="'+c+'"]')).closest("[data-tab]").data(y.tab),l=T.get.tabElement(o),n&&0<n.length&&o?(T.debug("Anchor link used, opening parent tab",l,n),!1===v.onBeforeChange.call(k,o)?T.debug("onBeforeChange returned false, cancelling tab change",l):(l.hasClass(b.active)||setTimeout(function(){T.scrollTo(n)},0),T.activate.all(o),T.cache.read(o)||(T.cache.add(o,!0),T.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(l[0],o,g,h)),v.onLoad.call(l[0],o,g,h)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(T.debug("Forcing scroll to an in-page link in a hidden tab",t,e),M(P).scrollTop(t))},update:{content:function(e,t,n){var i=T.get.tabElement(e),a=i[0];n=n!==R?n:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&"string"!=typeof t?i.empty().append(M(t).clone(!0)):n?(T.debug("Updating HTML and evaluating inline scripts",e,t),i.html(t)):(T.debug("Updating HTML",e,t),a.innerHTML=t)}},fetch:{content:function(t,n){var e,i=T.get.tabElement(t),a={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==v.cacheType&&T.cache.add(n,e),T.update.content(t,e),t==m?(T.debug("Content loaded",t),T.activate.tab(t)):T.debug("Content loaded in background",t),v.onFirstLoad.call(i[0],t,g,h),v.onLoad.call(i[0],t,g,h),v.loadOnce?T.cache.add(n,!0):"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&0<i.children().length?setTimeout(function(){var e=(e=i.children().clone(!0)).not("script");T.cache.add(n,e)},0):T.cache.add(n,i.html())},urlData:{tab:n}},o=i.api("get request")||!1,o=o&&"pending"===o.state();n=n||t,e=T.cache.read(n),v.cache&&e?(T.activate.tab(t),T.debug("Adding cached content",n),v.loadOnce||("once"==v.evaluateScripts?T.update.content(t,e,!1):T.update.content(t,e)),v.onLoad.call(i[0],t,g,h)):o?(T.set.loading(t),T.debug("Content is already loading",n)):M.api!==R?(e=M.extend(!0,{},v.apiSettings,a),T.debug("Retrieving remote content",n,e),T.set.loading(t),i.api(e)):T.error(x.api)}},activate:{all:function(e){T.activate.tab(e),T.activate.navigation(e)},tab:function(e){var t=T.get.tabElement(e),n="siblings"==v.deactivate?t.siblings(a):a.not(t),i=t.hasClass(b.active);T.verbose("Showing tab content for",t),i||(t.addClass(b.active),n.removeClass(b.active+" "+b.loading),0<t.length&&v.onVisible.call(t[0],e))},navigation:function(e){var t=T.get.navElement(e),n="siblings"==v.deactivate?t.siblings(u):u.not(t),i=t.hasClass(b.active);T.verbose("Activating tab navigation for",t,e),i||(t.addClass(b.active),n.removeClass(b.active+" "+b.loading))}},deactivate:{all:function(){T.deactivate.navigation(),T.deactivate.tabs()},navigation:function(){u.removeClass(b.active)},tabs:function(){a.removeClass(b.active+" "+b.loading)}},is:{tab:function(e){return e!==R&&0<T.get.tabElement(e).length}},get:{initialPath:function(){return u.eq(0).data(y.tab)||a.eq(0).data(y.tab)},path:function(){return M.address.value()},defaultPathArray:function(e){return T.utilities.pathToArray(T.get.defaultPath(e))},defaultPath:function(e){var t=u.filter("[data-"+y.tab+'^="'+T.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(T.debug("Found default tab",t),r<v.maxDepth)return r++,T.get.defaultPath(t);T.error(x.recursion)}else T.debug("No default tabs found for",e,a);return r=0,e},navElement:function(e){return e=e||m,u.filter("[data-"+y.tab+'="'+T.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||m,t=T.utilities.pathToArray(e),t=T.utilities.last(t),e=a.filter("[data-"+y.tab+'="'+T.escape.string(e)+'"]'),t=a.filter("[data-"+y.tab+'="'+T.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return m}},determine:{activeTab:function(){var n=null;return a.each(function(e,t){M(t).hasClass(b.active)&&(t=M(this).data(y.tab),u.filter("[data-"+y.tab+'="'+T.escape.string(t)+'"]').hasClass(b.active)&&(n=t))}),n}},utilities:{filterArray:function(e,t){return M.grep(e,function(e){return-1==M.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=e===R?m:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(T.debug("Changing setting",e,t),M.isPlainObject(e))M.extend(!0,v,e);else{if(t===R)return v[e];M.isPlainObject(v[e])?M.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(M.isPlainObject(e))M.extend(!0,T,e);else{if(t===R)return T[e];T[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,v.name+":"),T.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),T.verbose.apply(console,arguments)))},error:function(){v.silent||(T.error=Function.prototype.bind.call(console.error,console,v.name+":"),T.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(f||t),f=t,D.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var e=v.name+":",n=0;f=!1,clearTimeout(T.performance.timer),M.each(D,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",d&&(e+=" '"+d+"'"),(console.group!==R||console.table!==R)&&0<D.length&&(console.groupCollapsed(e),console.table?console.table(D):M.each(D,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),D=[]}},invoke:function(i,e,t){var a,o,n,r=s;return e=e||E,t=k||t,"string"==typeof i&&r!==R&&(i=i.split(/[\. ]/),a=i.length-1,M.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(M.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==R)return o=r[n],!1;{if(!M.isPlainObject(r[t])||e==a)return r[t]!==R?o=r[t]:T.error(x.method,i),!1;r=r[t]}}})),M.isFunction(o)?n=o.apply(t,e):o!==R&&(n=o),Array.isArray(c)?c.push(n):c!==R?c=[c,n]:n!==R&&(c=n),o}};A?(s===R&&T.initialize(),T.invoke(S)):(s!==R&&s.invoke("destroy"),T.initialize())}),c!==R?c:this},M.tab=function(){M(O).tab.apply(this,arguments)},M.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},onBeforeChange:function(e){},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. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(M,O,P,R){"use strict";M.isFunction=M.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),M.fn.toast=function(C){var k,e=M(this),T=e.selector||"",D=(new Date).getTime(),S=[],A=C,E="string"==typeof A,F=[].slice.call(arguments,1);return e.each(function(){var n,i,o,a,r,s,l,e,c=M.isPlainObject(C)?M.extend(!0,{},M.fn.toast.settings,C):M.extend({},M.fn.toast.settings),u=c.className,d=c.selector,f=c.error,t=c.namespace,p=c.fields,m="."+t,g=t+"-module",h=M(this),v=c.context?[O,P].indexOf(c.context)<0?M(P).find(c.context):M(c.context):M("body"),b=h.hasClass("toast")||h.hasClass("message")||h.hasClass("card"),y=this,x=b?h.data(g):R,w={initialize:function(){w.verbose("Initializing element"),w.create.id(),w.has.container()||w.create.container(),(b||""!==c.message||""!==c.title||""!==w.get.iconClass()||c.showImage||w.has.configActions())&&("string"==typeof c.showProgress&&-1!==[u.top,u.bottom].indexOf(c.showProgress)||(c.showProgress=!1),w.create.toast(),c.closeOnClick&&(c.closeIcon||0<M(i).find(d.input).length||w.has.configActions())&&(c.closeOnClick=!1),c.closeOnClick||n.addClass(u.unclickable),w.bind.events()),w.instantiate(),n&&w.show()},instantiate:function(){w.verbose("Storing instance of toast"),x=w,h.data(g,x)},destroy:function(){n&&(w.debug("Removing toast",n),w.unbind.events(),n.remove(),s=i=n=R,c.onRemove.call(n,y),l=r=a=R),h.removeData(g)},show:function(e){!1===c.onShow.call(n,y)?w.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Showing toast"),w.animate.show(e))},close:function(e){!1===c.onHide.call(n,y)?w.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Closing toast"),w.remove.visible(),w.unbind.events(),w.animate.close(e))},create:{container:function(){w.verbose("Creating container"),v.append(M("<div/>",{class:c.position+" "+u.container+" "+(c.horizontal?u.horizontal:"")+" "+(c.context&&"body"!==c.context?u.absolute:"")}))},id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),w.verbose("Creating unique id for element",e)},toast:function(){n=M("<div/>",{class:u.box});var e,t=w.get.iconClass();b?(i=c.cloneModule?h.clone().removeAttr("id"):h,l=i.find("> i"+w.helpers.toClass(u.close)),c.closeIcon=0<l.length,""!==t&&i.find(d.icon).attr("class",t+" "+u.icon),c.showImage&&i.find(d.image).attr("src",c.showImage),""!==c.title&&i.find(d.title).html(w.helpers.escape(c.title,c.preserveHTML)),""!==c.message&&i.find(d.message).html(w.helpers.escape(c.message,c.preserveHTML))):(w.verbose("Creating toast"),i=M("<div/>",{role:"alert"}),e=M("<div/>",{class:u.content}),""!==t&&i.append(M("<i/>",{class:t+" "+u.icon})),c.showImage&&i.append(M("<img>",{class:u.image+" "+c.classImage,src:c.showImage})),""!==c.title&&(t="_"+w.get.id()+"title",i.attr("aria-labelledby",t),e.append(M("<div/>",{class:u.title,id:t,html:w.helpers.escape(c.title,c.preserveHTML)}))),t="_"+w.get.id()+"desc",i.attr("aria-describedby",t),e.append(M("<div/>",{class:u.message,id:t,html:w.helpers.escape(c.message,c.preserveHTML)})),i.addClass(c.class+" "+u.toast).append(e),i.css("opacity",c.opacity),c.closeIcon&&((l=M("<i/>",{class:u.close+" "+("string"==typeof c.closeIcon?c.closeIcon:""),role:"button",tabindex:0,"aria-label":c.text.close})).hasClass(u.left)?i.prepend(l):i.append(l))),i.hasClass(u.compact)&&(c.compact=!0),i.hasClass("card")&&(c.compact=!1),o=i.find(".actions"),w.has.configActions()&&(0===o.length&&(o=M("<div/>",{class:u.actions+" "+(c.classActions||"")}).appendTo(i)),i.hasClass("card")&&!o.hasClass(u.attached)&&(o.addClass(u.extraContent),o.hasClass(u.vertical)&&(o.removeClass(u.vertical),w.error(f.verticalCard))),c.actions.forEach(function(e){var t=e[p.icon]?"<i "+(e[p.text]?'aria-hidden="true"':"")+' class="'+w.helpers.deQuote(e[p.icon])+' icon"></i>':"",n=w.helpers.escape(e[p.text]||"",c.preserveHTML),i=w.helpers.deQuote(e[p.class]||""),a=e[p.click]&&M.isFunction(e[p.click])?e[p.click]:function(){};o.append(M("<button/>",{html:t+n,"aria-label":(e[p.text]||e[p.icon]||"").replace(/<[^>]+(>|$)/g,""),class:u.button+" "+i,click:function(){var e=M(this);e.is(d.approve)||e.is(d.deny)||!1===a.call(y,h)||w.close()}}))})),o&&o.hasClass(u.vertical)&&i.addClass(u.vertical),0<o.length&&!o.hasClass(u.attached)&&(!o||o.hasClass(u.basic)&&!o.hasClass(u.left)||i.addClass(u.actions)),"auto"===c.displayTime&&(c.displayTime=Math.max(c.minDisplayTime,i.text().split(" ").length/c.wordsPerMinute*6e4)),n.append(i),0<o.length&&o.hasClass(u.attached)&&(o.addClass(u.buttons),o.detach(),i.addClass(u.attached),o.hasClass(u.vertical)?(i.wrap(M("<div/>",{class:u.vertical+" "+u.attached+" "+(c.compact?u.compact:"")})),o.hasClass(u.left)?i.addClass(u.left).parent().addClass(u.left).prepend(o):i.parent().append(o)):o.hasClass(u.top)?(n.prepend(o),i.addClass(u.bottom)):(n.append(o),i.addClass(u.top))),h!==i&&(y=(h=i)[0]),0<c.displayTime&&(t=u.progressing+" "+(c.pauseOnHover?u.pausable:""),c.showProgress&&(a=M("<div/>",{class:u.progress+" "+(c.classProgress||c.class),"data-percent":""}),c.classProgress||(i.hasClass("toast")&&!i.hasClass(u.inverted)?a.addClass(u.inverted):a.removeClass(u.inverted)),r=M("<div/>",{class:"bar "+(c.progressUp?"up ":"down ")+t}),a.addClass(c.showProgress).append(r),a.hasClass(u.top)?n.prepend(a):n.append(a),r.css("animation-duration",c.displayTime/1e3+"s")),(s=M("<span/>",{class:"wait "+t})).css("animation-duration",c.displayTime/1e3+"s"),s.appendTo(i)),c.compact&&(n.addClass(u.compact),i.addClass(u.compact),a&&a.addClass(u.compact)),c.newestOnTop?n.prependTo(w.get.container()):n.appendTo(w.get.container())}},bind:{events:function(){w.debug("Binding events to toast"),c.closeIcon&&l.on("click"+m,w.event.close),i.on("click"+m,w.event.click),s&&s.on("animationend"+m,w.event.close),n.on("click"+m,d.approve,w.event.approve).on("click"+m,d.deny,w.event.deny)}},unbind:{events:function(){w.debug("Unbinding events to toast"),c.closeIcon&&l.off("click"+m),i.off("click"+m),s&&s.off("animationend"+m),n.off("click"+m)}},animate:{show:function(e){e=M.isFunction(e)?e:function(){},c.transition&&w.can.useElement("transition")&&h.transition("is supported")&&(w.set.visible(),n.transition({animation:c.transition.showMethod+" in",queue:!1,debug:c.debug,verbose:c.verbose,duration:c.transition.showDuration,onComplete:function(){e.call(n,y),c.onVisible.call(n,y)}}))},close:function(e){e=M.isFunction(e)?e:function(){},c.transition&&M.fn.transition!==R&&h.transition("is supported")?n.transition({animation:c.transition.hideMethod+" out",queue:!1,duration:c.transition.hideDuration,debug:c.debug,verbose:c.verbose,interval:50,onBeforeHide:function(e){e=M.isFunction(e)?e:function(){},""!==c.transition.closeEasing?n&&(n.css("opacity",0),n.wrap("<div/>").parent().hide(c.transition.closeDuration,c.transition.closeEasing,function(){n&&(n.parent().remove(),e.call(n))})):e.call(n)},onComplete:function(){e.call(n,y),c.onHidden.call(n,y),w.destroy()}}):w.error(f.noTransition)},pause:function(){s.css("animationPlayState","paused"),r&&r.css("animationPlayState","paused")},continue:function(){s.css("animationPlayState","running"),r&&r.css("animationPlayState","running")}},has:{container:function(){return w.verbose("Determining if there is already a container"),0<w.get.containers().length},toast:function(){return!!w.get.toast()},toasts:function(){return 0<w.get.toasts().length},configActions:function(){return Array.isArray(c.actions)&&0<c.actions.length}},get:{id:function(){return e},containers:function(){return v.children(w.helpers.toClass(c.position)+d.container+(c.horizontal?w.helpers.toClass(u.horizontal):":not("+w.helpers.toClass(u.horizontal)+")")+(c.context&&"body"!==c.context?w.helpers.toClass(u.absolute):":not("+w.helpers.toClass(u.absolute)+")"))},container:function(){return w.get.containers()[0]},toastBox:function(){return n||null},toast:function(){return i||null},toasts:function(){return M(w.get.container()).find(d.box)},iconClass:function(){return"string"==typeof c.showIcon?c.showIcon:c.showIcon&&c.icons[c.class]?c.icons[c.class]:""},remainingTime:function(){return s?s.css("opacity")*c.displayTime:0}},set:{visible:function(){i.addClass(u.visible)}},remove:{visible:function(){i.removeClass(u.visible)}},event:{close:function(){w.close()},click:function(e){0===M(e.target).closest(d.clickable).length&&(!1!==c.onClick.call(n,y)&&c.closeOnClick?w.close():w.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===c.onApprove.call(y,h)?w.verbose("Approve callback returned false cancelling close"):w.close()},deny:function(){!1===c.onDeny.call(y,h)?w.verbose("Deny callback returned false cancelling close"):w.close()}},helpers:{toClass:function(e){var e=e.trim().split(/\s+/),t="";return e.forEach(function(e){t+="."+e}),t},deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{useElement:function(e){return M.fn[e]!==R||(w.error(f.noElement.replace("{element}",e)),!1)}},setting:function(e,t){if(w.debug("Changing setting",e,t),M.isPlainObject(e))M.extend(!0,c,e);else{if(t===R)return c[e];M.isPlainObject(c[e])?M.extend(!0,c[e],t):c[e]=t}},internal:function(e,t){if(M.isPlainObject(e))M.extend(!0,w,e);else{if(t===R)return w[e];w[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,c.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),w.verbose.apply(console,arguments)))},error:function(){c.silent||(w.error=Function.prototype.bind.call(console.error,console,c.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var t,n;c.performance&&(n=(t=(new Date).getTime())-(D||t),D=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var e=c.name+":",n=0;D=!1,clearTimeout(w.performance.timer),M.each(S,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",T&&(e+=" '"+T+"'"),(console.group!==R||console.table!==R)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):M.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(i,e,t){var a,o,n,r=x;return e=e||F,t=y||t,"string"==typeof i&&r!==R&&(i=i.split(/[\. ]/),a=i.length-1,M.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(M.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==R)return o=r[n],!1;{if(!M.isPlainObject(r[t])||e==a)return r[t]!==R?o=r[t]:w.error(f.method,i),!1;r=r[t]}}})),M.isFunction(o)?n=o.apply(t,e):o!==R&&(n=o),Array.isArray(k)?k.push(n):k!==R?k=[k,n]:n!==R&&(k=n),o}};E?(x===R&&w.initialize(),w.invoke(A)):(x!==R&&x.invoke("destroy"),w.initialize(),k=h)}),k!==R?k:this},M.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!0,showImage:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},M.extend(M.easing,{easeOutBounce:function(e,t,n,i,a){return(t/=a)<1/2.75?i*(7.5625*t*t)+n:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+n:i*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document),function(F,M,O,P){"use strict";F.isWindow=F.isWindow||function(e){return null!=e&&e===e.window},M=void 0!==M&&M.Math==Math?M:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),F.api=F.fn.api=function(w){var C,e=F.isFunction(this)?F(M):F(this),k=e.selector||"",T=(new Date).getTime(),D=[],S=w,A="string"==typeof S,E=[].slice.call(arguments,1);return e.each(function(){var o,i,n,e,r,a,f=F.isPlainObject(w)?F.extend(!0,{},F.fn.api.settings,w):F.extend({},F.fn.api.settings),t=f.namespace,s=f.metadata,l=f.selector,c=f.error,u=f.className,d="."+t,p="module-"+t,m=F(this),g=m.closest(l.form),h=f.stateContext?[M,O].indexOf(f.stateContext)<0?F(O).find(f.stateContext):F(f.stateContext):m,v=this,b=h[0],y=m.data(p),x={initialize:function(){A||(a=f.data,x.bind.events()),x.instantiate()},instantiate:function(){x.verbose("Storing instance of module",x),y=x,m.data(p,y)},destroy:function(){x.verbose("Destroying previous module for",v),m.removeData(p).off(d)},bind:{events:function(){var e=x.get.event();e?(x.verbose("Attaching API events to element",e),m.on(e+d,x.event.trigger)):"now"==f.on&&(x.debug("Querying API endpoint immediately"),x.query())}},decode:{json:function(e){if(e!==P&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(M.Storage!==P)return t=sessionStorage.getItem(e+x.get.normalizedData()),x.debug("Using cached response",e,f.data,t),x.decode.json(t);x.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?x.debug("Response empty, not caching",t):M.Storage===P?x.error(c.noStorage):(F.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+x.get.normalizedData(),t),x.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(x.is.disabled())x.debug("Element is disabled API request aborted");else{if(x.is.loading()){if(!f.interruptRequests)return void x.debug("Cancelling request, previous request is still pending");x.debug("Interrupting previous request"),x.abort()}f.defaultData&&F.extend(!0,f.urlData,x.get.defaultData()),f.serializeForm&&(f.data=x.add.formData(a||f.data)),!1===(i=x.get.settings())?(x.cancelled=!0,x.error(c.beforeSend)):(x.cancelled=!1,(n=x.get.templatedURL())||x.is.mocked()?((n=x.add.urlData(n))||x.is.mocked())&&(i.url=f.base+n,o=F.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+n,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),x.debug("Querying URL",o.url),x.verbose("Using AJAX settings",o),"local"===f.cache&&x.read.cachedResponse(n)?(x.debug("Response returned from local cache"),x.request=x.create.request(),x.request.resolveWith(b,[x.read.cachedResponse(n)])):f.throttle?f.throttleFirstRequest||x.timer?(x.debug("Throttling request",f.throttle),clearTimeout(x.timer),x.timer=setTimeout(function(){x.timer&&delete x.timer,x.debug("Sending throttled request",e,o.method),x.send.request()},f.throttle)):(x.debug("Sending request",e,o.method),x.send.request(),x.timer=setTimeout(function(){},f.throttle)):(x.debug("Sending request",e,o.method),x.send.request())):x.error(c.missingURL))}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!x.is.form()}},is:{disabled:function(){return 0<m.filter(l.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return m.is("form")||h.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return m.is("input")},loading:function(){return!!x.request&&"pending"==x.request.state()},abortedRequest:function(e){return e&&e.readyState!==P&&0===e.readyState?(x.verbose("XHR request determined to be aborted"),!0):(x.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return x.is.expectingJSON()&&F.isFunction(f.successTest)?(x.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(x.debug("Response passed success test",e),!0):(x.debug("Response failed success test",e),!1)):(x.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return x.cancelled||!1},successful:function(){return x.request&&"resolved"==x.request.state()},failure:function(){return x.request&&"rejected"==x.request.state()},complete:function(){return x.request&&("resolved"==x.request.state()||"rejected"==x.request.state())}},add:{urlData:function(a,o){var e,t;return a&&(e=a.match(f.regExp.required),t=a.match(f.regExp.optional),o=o||f.urlData,e&&(x.debug("Looking for required URL variables",e),F.each(e,function(e,t){var n=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),i=F.isPlainObject(o)&&o[n]!==P?o[n]:m.data(n)!==P?m.data(n):h.data(n)!==P?h.data(n):o[n];if(i===P)return x.error(c.requiredParameter,n,a),a=!1;x.verbose("Found required variable",n,i),i=f.encodeParameters?x.get.urlEncodedValue(i):i,a=a.replace(t,i)})),t&&(x.debug("Looking for optional URL variables",e),F.each(t,function(e,t){var n=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),i=F.isPlainObject(o)&&o[n]!==P?o[n]:m.data(n)!==P?m.data(n):h.data(n)!==P?h.data(n):o[n];a=i!==P?(x.verbose("Optional variable Found",n,i),a.replace(t,i)):(x.verbose("Optional variable not found",n),-1!==a.indexOf("/"+t)?a.replace("/"+t,""):a.replace(t,""))}))),a},formData:function(n){var e,i,l,c,u,d={},t="formdata"===f.serializeForm;return n=n||a||f.data,e=F.isPlainObject(n),t?(d=new FormData(g[0]),f.processData=void 0!==f.processData&&f.processData,f.contentType=void 0!==f.contentType&&f.contentType):(i=g.serializeArray(),l={},c={},u=function(e,t,n){return e[t]=n,e},F.each(F('input[type="file"]',g),function(e,n){F.each(F(n)[0].files,function(e,t){i.push({name:n.name,value:t})})}),F.each(i,function(e,t){if(f.regExp.validate.test(t.name)){var n,i="checkbox"===F('[name="'+t.name+'"]',g).attr("type"),a=parseFloat(t.value),o=i&&"on"===t.value||"true"===t.value||(String(a)===t.value?a:"false"!==t.value&&t.value),r=t.name.match(f.regExp.key)||[],s=t.name.replace(/\[\]$/,"");s in l?Array.isArray(c[s])?c[s].push(o):c[s]=[c[s],o]:(l[s]=0,c[s]=o),o=c[s];for(;(n=r.pop())!==P;)""!=n||Array.isArray(o)?f.regExp.fixed.test(n)?o=u([],n,o):f.regExp.named.test(n)&&(o=u({},n,o)):o=u([],l[s]++,o);d=F.extend(!0,d,o)}})),n=e?(x.debug("Extending existing data with form data",n,d),t?(F.each(Object.keys(n),function(e,t){d.append(t,n[t])}),d):F.extend(!0,{},n,d)):(x.debug("Adding form data",d),d)}},send:{request:function(){x.set.loading(),x.request=x.create.request(),x.is.mocked()?x.mockedXHR=x.create.mockedXHR():x.xhr=x.create.xhr(),f.onRequest.call(b,x.request,x.xhr)}},event:{trigger:function(e){x.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,n){var i=this,a=(new Date).getTime()-r,a=f.loadingDuration-a,o=!!F.isFunction(f.onResponse)&&(x.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(i,F.extend(!0,{},e)):f.onResponse.call(i,e)),a=0<a?a:0;o&&(x.debug("Modified API response in onResponse callback",f.onResponse,o,e),e=o),0<a&&x.debug("Response completed early delaying state change by",a),setTimeout(function(){x.is.validResponse(e)?x.request.resolveWith(i,[e,n]):x.request.rejectWith(i,[n,"invalid"])},a)},fail:function(e,t,n){var i=this,a=(new Date).getTime()-r,a=f.loadingDuration-a;0<(a=0<a?a:0)&&x.debug("Response completed early delaying state change by",a),setTimeout(function(){x.is.abortedRequest(e)?x.request.rejectWith(i,[e,"aborted",n]):x.request.rejectWith(i,[e,"error",t,n])},a)}},request:{done:function(e,t){x.debug("Successful API Response",e),"local"===f.cache&&n&&(x.write.cachedResponse(n,e),x.debug("Saving server response locally",x.cache)),f.onSuccess.call(b,e,m,t)},complete:function(e,t){var n,i;x.was.successful()?(i=e,n=t):i=x.get.responseFromXHR(n=e),x.remove.loading(),f.onComplete.call(b,i,m,n)},fail:function(e,t,n){var i=x.get.responseFromXHR(e),a=x.get.errorFromRequest(i,t,n);if("aborted"==t)return x.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),f.onAbort.call(b,t,m,e),!0;"invalid"==t?x.debug("JSON did not pass success test. A server-side error has most likely occurred",i):"error"==t&&e!==P&&(x.debug("XHR produced a server error",t,n),(e.status<200||300<=e.status)&&n!==P&&""!==n&&x.error(c.statusMessage+n,o.url),f.onError.call(b,a,m,e)),f.errorDuration&&"aborted"!==t&&(x.debug("Adding error state"),x.set.error(),x.should.removeError()&&setTimeout(x.remove.error,f.errorDuration)),x.debug("API Request failed",a,e),f.onFailure.call(b,i,m,e)}}},create:{request:function(){return F.Deferred().always(x.event.request.complete).done(x.event.request.done).fail(x.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,n=F.Deferred().always(x.event.xhr.complete).done(x.event.xhr.done).fail(x.event.xhr.fail);return e?(e=F.isFunction(e)?(x.debug("Using specified synchronous callback",e),e.call(b,i)):(x.debug("Using settings specified response",e),e),n.resolveWith(b,[e,!1,{responseText:e}])):F.isFunction(t)&&(e=function(e){x.debug("Async callback returned response",e),e?n.resolveWith(b,[e,!1,{responseText:e}]):n.rejectWith(b,[{responseText:e},!1,!1])},x.debug("Using specified async response callback",t),t.call(b,i,e)),n},xhr:function(){var e=F.ajax(o).always(x.event.xhr.always).done(x.event.xhr.done).fail(x.event.xhr.fail);return x.verbose("Created server request",e,o),e}},set:{error:function(){x.verbose("Adding error state to element",h),h.addClass(u.error)},loading:function(){x.verbose("Adding loading state to element",h),h.addClass(u.loading),r=(new Date).getTime()}},remove:{error:function(){x.verbose("Removing error state from element",h),h.removeClass(u.error)},loading:function(){x.verbose("Removing loading state from element",h),h.removeClass(u.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!F.isPlainObject(e)&&(x.is.expectingJSON()?x.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,n){return F.isPlainObject(e)&&e.error!==P?e.error:f.error[t]!==P?f.error[t]:n},request:function(){return x.request||!1},xhr:function(){return x.xhr||!1},settings:function(){var e=f.beforeSend.call(m,f);return e&&(e.success!==P&&(x.debug("Legacy success callback detected",e),x.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==P&&(x.debug("Legacy failure callback detected",e),x.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==P&&(x.debug("Legacy complete callback detected",e),x.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===P&&x.error(c.noReturnedValue),!1===e?e:e!==P?F.extend(!0,{},e):F.extend(!0,{},f)},urlEncodedValue:function(e){var t=M.decodeURIComponent(e),n=M.encodeURIComponent(e);return t!==e?(x.debug("URL value is already encoded, avoiding double encoding",e),e):(x.verbose("Encoding value using encodeURIComponent",e,n),n)},defaultData:function(){var e={};return F.isWindow(v)||(x.is.input()?e.value=m.val():x.is.form()||(e.text=m.text())),e},event:function(){return F.isWindow(v)||"now"==f.on?(x.debug("API called without element, no events attached"),!1):"auto"==f.on?m.is("input")?v.oninput!==P?"input":v.onpropertychange!==P?"propertychange":"keyup":m.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||m.data(s.action)||f.action||!1,n=m.data(s.url)||f.url||!1)x.debug("Using specified url",n);else if(e){if(x.debug("Looking up url for action",e,f.api),f.api[e]===P&&!x.is.mocked())return void x.error(c.missingAction,f.action,f.api);n=f.api[e]}else x.is.form()&&(n=m.attr("action")||h.attr("action")||!1,x.debug("No url or action specified, defaulting to form action",n));return n}},abort:function(){var e=x.get.xhr();e&&"resolved"!==e.state()&&(x.debug("Cancelling API request"),e.abort())},reset:function(){x.remove.error(),x.remove.loading()},setting:function(e,t){if(x.debug("Changing setting",e,t),F.isPlainObject(e))F.extend(!0,f,e);else{if(t===P)return f[e];F.isPlainObject(f[e])?F.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,x,e);else{if(t===P)return x[e];x[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,f.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),x.verbose.apply(console,arguments)))},error:function(){f.silent||(x.error=Function.prototype.bind.call(console.error,console,f.name+":"),x.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(T||t),T=t,D.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var e=f.name+":",n=0;T=!1,clearTimeout(x.performance.timer),F.each(D,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",k&&(e+=" '"+k+"'"),(console.group!==P||console.table!==P)&&0<D.length&&(console.groupCollapsed(e),console.table?console.table(D):F.each(D,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),D=[]}},invoke:function(i,e,t){var a,o,n,r=y;return e=e||E,t=v||t,"string"==typeof i&&r!==P&&(i=i.split(/[\. ]/),a=i.length-1,F.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(F.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==P)return o=r[n],!1;{if(!F.isPlainObject(r[t])||e==a)return r[t]!==P?o=r[t]:x.error(c.method,i),!1;r=r[t]}}})),F.isFunction(o)?n=o.apply(t,e):o!==P&&(n=o),Array.isArray(C)?C.push(n):C!==P?C=[C,n]:n!==P&&(C=n),o}};A?(y===P&&x.initialize(),x.invoke(S)):(y!==P&&y.invoke("destroy"),x.initialize())}),C!==P?C:this},F.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,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",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g,validate:/^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(w,e,C,k){"use strict";w.isFunction=w.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),w.fn.transition=function(){var p,r=w(this),m=r.selector||"",g=(new Date).getTime(),h=[],v=arguments,b=v[0],y=[].slice.call(arguments,1),x="string"==typeof b;return r.each(function(n){var l,s,t,c,i,a,e,o,u=w(this),d=this,f={initialize:function(){l=f.get.settings.apply(d,v),c=l.className,t=l.error,i=l.metadata,o="."+l.namespace,e="module-"+l.namespace,s=u.data(e)||f,a=f.get.animationEndEvent(),!1===(x=x&&f.invoke(b))&&(f.verbose("Converted arguments into settings object",l),l.interval?f.delay(l.animate):f.animate(),f.instantiate())},instantiate:function(){f.verbose("Storing instance of module",f),s=f,u.data(e,s)},destroy:function(){f.verbose("Destroying previous module for",d),u.removeData(e)},refresh:function(){f.verbose("Refreshing display type on next animation"),delete f.displayType},forceRepaint:function(){f.verbose("Forcing element repaint");var e=u.parent(),t=u.next();0===t.length?u.detach().appendTo(e):u.detach().insertBefore(t)},repaint:function(){f.verbose("Repainting element");d.offsetWidth},delay:function(e){var t=(t=f.get.animationDirection())||(f.can.transition()?f.get.direction():"static");e=e!==k?e:l.interval,e="auto"==l.reverse&&t==c.outward||1==l.reverse?(r.length-n)*l.interval:n*l.interval,f.debug("Delaying animation by",e),setTimeout(f.animate,e)},animate:function(e){if(l=e||l,!f.is.supported())return f.error(t.support),!1;if(f.debug("Preparing animation",l.animation),f.is.animating()){if(l.queue)return!l.allowRepeats&&f.has.direction()&&f.is.occurring()&&!0!==f.queuing?f.debug("Animation is currently occurring, preventing queueing same animation",l.animation):f.queue(l.animation),!1;if(!l.allowRepeats&&f.is.occurring())return f.debug("Animation is already occurring, will not execute repeated animation",l.animation),!1;f.debug("New animation started, completing previous early",l.animation),s.complete()}f.can.animate()?f.set.animating(l.animation):f.error(t.noAnimation,l.animation,d)},reset:function(){f.debug("Resetting animation to beginning conditions"),f.remove.animationCallbacks(),f.restore.conditions(),f.remove.animating()},queue:function(e){f.debug("Queueing animation of",e),f.queuing=!0,u.one(a+".queue"+o,function(){f.queuing=!1,f.repaint(),f.animate.apply(this,l)})},complete:function(e){e&&e.target===d&&e.stopPropagation(),f.debug("Animation complete",l.animation),f.remove.completeCallback(),f.remove.failSafe(),f.is.looping()||(f.is.outward()?(f.verbose("Animation is outward, hiding element"),f.restore.conditions(),f.hide()):f.is.inward()?(f.verbose("Animation is outward, showing element"),f.restore.conditions(),f.show()):(f.verbose("Static animation completed"),f.restore.conditions(),l.onComplete.call(d)))},force:{visible:function(){var e=u.attr("style"),e=f.get.userStyle(e),t=f.get.displayType(),e=e+"display: "+t+" !important;",n=u[0].style.display;return!t||"none"===n&&l.skipInlineHidden||u[0].tagName.match(/(script|link|style)/i)?(f.remove.transition(),!1):(f.verbose("Overriding default display to show element",t),u.attr("style",e),!0)},hidden:function(){var e=u.attr("style"),t=u.css("display"),e=e===k||""===e;"none"===t||f.is.hidden()?e&&u.removeAttr("style"):(f.verbose("Overriding default display to hide element"),u.css("display","none"))}},has:{direction:function(e){var n=!1;return"string"==typeof(e=e||l.animation)&&(e=e.split(" "),w.each(e,function(e,t){t!==c.inward&&t!==c.outward||(n=!0)})),n},inlineDisplay:function(){var e=u.attr("style")||"";return Array.isArray(e.match(/display.*?;/,""))}},set:{animating:function(e){f.remove.completeCallback(),e=e||l.animation;e=f.get.animationClass(e);f.save.animation(e),f.force.visible()&&(f.remove.hidden(),f.remove.direction(),f.start.animation(e))},duration:function(e,t){!(t="number"==typeof(t=t||l.duration)?t+"ms":t)&&0!==t||(f.verbose("Setting animation duration",t),u.css({"animation-duration":t}))},direction:function(e){(e=e||f.get.direction())==c.inward?f.set.inward():f.set.outward()},looping:function(){f.debug("Transition set to loop"),u.addClass(c.looping)},hidden:function(){u.addClass(c.transition).addClass(c.hidden)},inward:function(){f.debug("Setting direction to inward"),u.removeClass(c.outward).addClass(c.inward)},outward:function(){f.debug("Setting direction to outward"),u.removeClass(c.inward).addClass(c.outward)},visible:function(){u.addClass(c.transition).addClass(c.visible)}},start:{animation:function(e){e=e||f.get.animationClass(),f.debug("Starting tween",e),u.addClass(e).one(a+".complete"+o,f.complete),l.useFailSafe&&f.add.failSafe(),f.set.duration(l.duration),l.onStart.call(d)}},save:{animation:function(e){f.cache||(f.cache={}),f.cache.animation=e},displayType:function(e){"none"!==e&&u.data(i.displayType,e)},transitionExists:function(e,t){w.fn.transition.exists[e]=t,f.verbose("Saving existence of transition",e,t)}},restore:{conditions:function(){var e=f.get.currentAnimation();e&&(u.removeClass(e),f.verbose("Removing animation class",f.cache)),f.remove.duration()}},add:{failSafe:function(){var e=f.get.duration();f.timer=setTimeout(function(){u.triggerHandler(a)},e+l.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},remove:{animating:function(){u.removeClass(c.animating)},animationCallbacks:function(){f.remove.queueCallback(),f.remove.completeCallback()},queueCallback:function(){u.off(".queue"+o)},completeCallback:function(){u.off(".complete"+o)},display:function(){u.css("display","")},direction:function(){u.removeClass(c.inward).removeClass(c.outward)},duration:function(){u.css("animation-duration","")},failSafe:function(){f.verbose("Removing fail safe timer",f.timer),f.timer&&clearTimeout(f.timer)},hidden:function(){u.removeClass(c.hidden)},visible:function(){u.removeClass(c.visible)},looping:function(){f.debug("Transitions are no longer looping"),f.is.looping()&&(f.reset(),u.removeClass(c.looping))},transition:function(){u.removeClass(c.transition).removeClass(c.visible).removeClass(c.hidden)}},get:{settings:function(e,t,n){return"object"==typeof e?w.extend(!0,{},w.fn.transition.settings,e):"function"==typeof n?w.extend({},w.fn.transition.settings,{animation:e,onComplete:n,duration:t}):"string"==typeof t||"number"==typeof t?w.extend({},w.fn.transition.settings,{animation:e,duration:t}):"object"==typeof t?w.extend({},w.fn.transition.settings,t,{animation:e}):"function"==typeof t?w.extend({},w.fn.transition.settings,{animation:e,onComplete:t}):w.extend({},w.fn.transition.settings,{animation:e})},animationClass:function(e){var e=e||l.animation,t=f.can.transition()&&!f.has.direction()?f.get.direction()+" ":"";return c.animating+" "+c.transition+" "+t+e},currentAnimation:function(){return!(!f.cache||f.cache.animation===k)&&f.cache.animation},currentDirection:function(){return f.is.inward()?c.inward:c.outward},direction:function(){return f.is.hidden()||!f.is.visible()?c.inward:c.outward},animationDirection:function(e){var n;return"string"==typeof(e=e||l.animation)&&(e=e.split(" "),w.each(e,function(e,t){t===c.inward?n=c.inward:t===c.outward&&(n=c.outward)})),n||!1},duration:function(e){return"string"==typeof(e=!1===(e=e||l.duration)?u.css("animation-duration")||0:e)?-1<e.indexOf("ms")?parseFloat(e):1e3*parseFloat(e):e},displayType:function(e){return l.displayType||((e=e===k||e)&&u.data(i.displayType)===k&&(""===(e=u.css("display"))||"none"===e?f.can.transition(!0):f.save.displayType(e)),u.data(i.displayType))},userStyle:function(e){return(e=e||u.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(e){return w.fn.transition.exists[e]},animationStartEvent:function(){var e,t=C.createElement("div"),n={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in n)if(t.style[e]!==k)return n[e];return!1},animationEndEvent:function(){var e,t=C.createElement("div"),n={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in n)if(t.style[e]!==k)return n[e];return!1}},can:{transition:function(e){var t,n,i,a,o=l.animation,r=f.get.transitionExists(o),s=f.get.displayType(!1);if(r===k||e){if(f.verbose("Determining whether animation exists"),e=u.attr("class"),t=u.prop("tagName"),n=(t=w("<"+t+" />").addClass(e).insertAfter(u)).addClass(o).removeClass(c.inward).removeClass(c.outward).addClass(c.animating).addClass(c.transition).css("animationName"),i=t.addClass(c.inward).css("animationName"),s||(s=t.attr("class",e).removeAttr("style").removeClass(c.hidden).removeClass(c.visible).show().css("display"),f.verbose("Determining final display state",s),f.save.displayType(s)),t.remove(),n!=i)f.debug("Direction exists for animation",o),a=!0;else{if("none"==n||!n)return void f.debug("No animation defined in css",o);f.debug("Static animation found",o,s),a=!1}f.save.transitionExists(o,a)}return r!==k?r:a},animate:function(){return f.can.transition()!==k}},is:{animating:function(){return u.hasClass(c.animating)},inward:function(){return u.hasClass(c.inward)},outward:function(){return u.hasClass(c.outward)},looping:function(){return u.hasClass(c.looping)},occurring:function(e){return e="."+(e=e||l.animation).replace(" ","."),0<u.filter(e).length},visible:function(){return u.is(":visible")},hidden:function(){return"hidden"===u.css("visibility")},supported:function(){return!1!==a}},hide:function(){if(!1===l.onHide.call(d))return f.verbose("Hide callback returned false cancelling hide"),!1;f.verbose("Hiding element"),f.is.animating()&&f.reset(),d.blur(),f.remove.display(),f.remove.visible(),l.onBeforeHide.call(d,f.hideNow)},hideNow:function(){f.set.hidden(),f.force.hidden(),l.onHidden.call(d),l.onComplete.call(d)},show:function(e){f.force.visible()&&!1!==l.onShow.call(d)&&(f.verbose("Showing element",e),f.remove.hidden(),l.onBeforeShow.call(d,f.showNow))},showNow:function(){f.set.visible(),l.onVisible.call(d),l.onComplete.call(d)},toggle:function(){f.is.visible()?f.hide():f.show()},stop:function(){f.debug("Stopping current animation"),u.triggerHandler(a)},stopAll:function(){f.debug("Stopping all animation"),f.remove.queueCallback(),u.triggerHandler(a)},clear:{queue:function(){f.debug("Clearing animation queue"),f.remove.queueCallback()}},enable:function(){f.verbose("Starting animation"),u.removeClass(c.disabled)},disable:function(){f.debug("Stopping animation"),u.addClass(c.disabled)},setting:function(e,t){if(f.debug("Changing setting",e,t),w.isPlainObject(e))w.extend(!0,l,e);else{if(t===k)return l[e];w.isPlainObject(l[e])?w.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(w.isPlainObject(e))w.extend(!0,f,e);else{if(t===k)return f[e];f[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,l.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),f.verbose.apply(console,arguments)))},error:function(){l.silent||(f.error=Function.prototype.bind.call(console.error,console,l.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=(new Date).getTime())-(g||t),g=t,h.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 e=l.name+":",n=0;g=!1,clearTimeout(f.performance.timer),w.each(h,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",m&&(e+=" '"+m+"'"),1<r.length&&(e+=" ("+r.length+")"),(console.group!==k||console.table!==k)&&0<h.length&&(console.groupCollapsed(e),console.table?console.table(h):w.each(h,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(i,e,t){var a,o,n,r=s;return e=e||y,t=d||t,"string"==typeof i&&r!==k&&(i=i.split(/[\. ]/),a=i.length-1,w.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(w.isPlainObject(r[n])&&e!=a)r=r[n];else{if(r[n]!==k)return o=r[n],!1;{if(!w.isPlainObject(r[t])||e==a)return r[t]!==k&&(o=r[t]),!1;r=r[t]}}})),w.isFunction(o)?n=o.apply(t,e):o!==k&&(n=o),Array.isArray(p)?p.push(n):p!==k?p=[p,n]:n!==k&&(p=n),o!==k&&o}};f.initialize()}),p!==k?p:this},w.fn.transition.exists={},w.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onBeforeShow:function(e){e.call(this)},onVisible:function(){},onHide:function(){},onHidden:function(){},onBeforeHide:function(e){e.call(this)},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document);