From c596f7c1ad9c4d6374fb330d508b6993077bdb9c Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 30 Nov 2022 13:56:34 +0100 Subject: [PATCH] Add slider module --- semantic.json | 41 +- semantic/dist/components/api.min.js | 2 +- semantic/dist/components/calendar.min.js | 2 +- semantic/dist/components/checkbox.min.js | 2 +- semantic/dist/components/dropdown.min.js | 2 +- semantic/dist/components/form.min.js | 2 +- semantic/dist/components/modal.min.js | 2 +- semantic/dist/components/popup.min.js | 2 +- semantic/dist/components/progress.min.js | 2 +- semantic/dist/components/sidebar.min.js | 2 +- semantic/dist/components/site.min.js | 2 +- semantic/dist/components/slider.css | 801 +++++++++++++ semantic/dist/components/slider.js | 1353 +++++++++++++++++++++ semantic/dist/components/slider.min.css | 1 + semantic/dist/components/slider.min.js | 11 + semantic/dist/components/tab.min.js | 2 +- semantic/dist/components/toast.min.js | 2 +- semantic/dist/semantic.css | 945 +++++++++++++++ semantic/dist/semantic.js | 1354 ++++++++++++++++++++++ semantic/dist/semantic.min.css | 2 +- semantic/dist/semantic.min.js | 2 +- 21 files changed, 4518 insertions(+), 16 deletions(-) create mode 100644 semantic/dist/components/slider.css create mode 100644 semantic/dist/components/slider.js create mode 100644 semantic/dist/components/slider.min.css create mode 100644 semantic/dist/components/slider.min.js diff --git a/semantic.json b/semantic.json index 63c6600c..7c885b32 100644 --- a/semantic.json +++ b/semantic.json @@ -19,5 +19,42 @@ "autoInstall": false, "rtl": false, "version": "2.9.0", - "components": ["api", "button", "calendar", "card", "checkbox", "container", "dimmer", "divider", "dropdown", "form", "grid", "header", "icon", "image", "input", "label", "list", "loader", "menu", "message", "modal", "placeholder", "popup", "progress", "reset", "segment", "sidebar", "site", "statistic", "step", "tab", "table", "text", "toast", "transition"] -} \ No newline at end of file + "components": [ + "api", + "button", + "calendar", + "card", + "checkbox", + "container", + "dimmer", + "divider", + "dropdown", + "form", + "grid", + "header", + "icon", + "image", + "input", + "label", + "list", + "loader", + "menu", + "message", + "modal", + "placeholder", + "popup", + "progress", + "reset", + "segment", + "sidebar", + "site", + "slider", + "statistic", + "step", + "tab", + "table", + "text", + "toast", + "transition" + ] +} diff --git a/semantic/dist/components/api.min.js b/semantic/dist/components/api.min.js index 8a96432d..6ca81706 100644 --- a/semantic/dist/components/api.min.js +++ b/semantic/dist/components/api.min.js @@ -8,4 +8,4 @@ * http://opensource.org/licenses/MIT * */ -!function(P,O,j,F){"use strict";P.isWindow=P.isWindow||function(e){return null!=e&&e===e.window},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),P.api=P.fn.api=function(q){var x,e=P.isFunction(this)?P(O):P(this),A=e.selector||"",k=(new Date).getTime(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var s,n,r,e,a,o,f=P.isPlainObject(q)?P.extend(!0,{},P.fn.api.settings,q):P.extend({},P.fn.api.settings),t=f.namespace,i=f.metadata,u=f.selector,c=f.error,d=f.className,l="."+t,g="module-"+t,p=P(this),m=p.closest(u.form),b=f.stateContext?[O,j].indexOf(f.stateContext)<0?P(j).find(f.stateContext):P(f.stateContext):p,v=this,h=b[0],y=p.data(g),R={initialize:function(){w||(o=f.data,R.bind.events()),R.instantiate()},instantiate:function(){R.verbose("Storing instance of module",R),y=R,p.data(g,y)},destroy:function(){R.verbose("Destroying previous module for",v),p.removeData(g).off(l)},bind:{events:function(){var e=R.get.event();e?(R.verbose("Attaching API events to element",e),p.on(e+l,R.event.trigger)):"now"==f.on&&(R.debug("Querying API endpoint immediately"),R.query())}},decode:{json:function(e){if(e!==F&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(O.Storage!==F)return t=sessionStorage.getItem(e+R.get.normalizedData()),R.debug("Using cached response",e,f.data,t),R.decode.json(t);R.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?R.debug("Response empty, not caching",t):O.Storage===F?R.error(c.noStorage):(P.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+R.get.normalizedData(),t),R.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(R.is.disabled())R.debug("Element is disabled API request aborted");else{if(R.is.loading()){if(!f.interruptRequests)return void R.debug("Cancelling request, previous request is still pending");R.debug("Interrupting previous request"),R.abort()}f.defaultData&&P.extend(!0,f.urlData,R.get.defaultData()),f.serializeForm&&(f.data=R.add.formData(o||f.data)),!1===(n=R.get.settings())?(R.cancelled=!0,R.error(c.beforeSend)):(R.cancelled=!1,(r=R.get.templatedURL())||R.is.mocked()?((r=R.add.urlData(r))||R.is.mocked())&&(n.url=f.base+r,s=P.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+r,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),R.debug("Querying URL",s.url),R.verbose("Using AJAX settings",s),"local"===f.cache&&R.read.cachedResponse(r)?(R.debug("Response returned from local cache"),R.request=R.create.request(),R.request.resolveWith(h,[R.read.cachedResponse(r)])):f.throttle?f.throttleFirstRequest||R.timer?(R.debug("Throttling request",f.throttle),clearTimeout(R.timer),R.timer=setTimeout(function(){R.timer&&delete R.timer,R.debug("Sending throttled request",e,s.method),R.send.request()},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request(),R.timer=setTimeout(function(){},f.throttle)):(R.debug("Sending request",e,s.method),R.send.request())):R.error(c.missingURL))}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!R.is.form()}},is:{disabled:function(){return 0").addClass(Q.popup)[e](t)),ee.addClass(Q.calendar),te&&ee.addClass(Q.inverted),e=function(){return ae.refreshTooltips(),z.onVisible.apply(ee,arguments)},l.length||(ee.attr("tabindex","0"),e=function(){return ae.refreshTooltips(),ae.focus(),z.onVisible.apply(ee,arguments)}),t=ae.setting("on"),t=re.extend({},z.popupOptions,{popup:ee,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ae.set.focusDate(ae.get.date()),ae.set.mode(ae.get.validatedMode(z.startMode)),z.onShow.apply(ee,arguments)},onVisible:e,onHide:z.onHide,onHidden:function(){return ae.blur(),z.onHidden.apply(ee,arguments)}}),ae.popup(t)))},inline:function(){d.length&&!z.inline||(z.inline=!0,ee=re("
").addClass(Q.calendar).appendTo(i),l.length||ee.attr("tabindex","0"))},input:function(){z.touchReadonly&&l.length&&c&&l.prop("readonly",!0),ae.check.disabled()},date:function(){var e;z.initialDate?e=n.date(z.initialDate,z):i.data(X.date)!==oe?e=n.date(i.data(X.date),z):l.length&&(e=n.date(l.val(),z)),ae.set.date(e,z.formatInput,!1),ae.set.mode(ae.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=Y.createEvent("HTMLEvents"),ae.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,j,a=ae.get.mode(),n=new Date,q=ae.get.date(),r=ae.get.focusDate(),o=ae.helper.dateInRange(r||q||z.initialDate||n),i=(r||ae.set.focusDate(r=o,!1,!1),"year"===a),s="month"===a,l="day"===a,d="hour"===a,u="minute"===a,W="time"===z.type,R=Math.max(z.multiMonth,1),V=l?ae.get.monthOffset():0,c=o.getMinutes(),p=o.getHours(),f=o.getDate(),G=o.getMonth()+V,h=o.getFullYear(),m=l?z.showWeekNumbers?8:7:d?4:_.column,P=l||d?6:_.row,g=l?R:1,y=(D=ee).hasClass("left")?"right center":"left center";for(D.empty(),1").addClass(Q.grid).appendTo(D)),t=0;t").addClass(Q.column).appendTo(j));var D,v=G+t,B=(new Date(h,v,1).getDay()-z.firstDayOfWeek%7+7)%7,b=(!z.constantHeight&&l&&(b=new Date(h,v+1,0).getDate()+B,P=Math.ceil(b/7)),i?10:s?1:0),M=l?1:0,C=d||u?1:0,w=d||u?f:1,x=new Date(h-b,v-M,w-C,p),M=new Date(h+b,v+M,w+C,p),w=i?new Date(10*Math.ceil(h/10)-9,0,0):s?new Date(h,0,0):l?new Date(h,v,0):new Date(h,v,f,-1),C=i?new Date(10*Math.ceil(h/10)+1,0,1):s?new Date(h+1,0,1):l?new Date(h,v+1,1):new Date(h,v,f+1),T=a,T=(l&&z.showWeekNumbers&&(T+=" andweek"),re("").addClass(Q.table).addClass(T).addClass(ne[m]+" column").appendTo(D)),K=(te&&T.addClass(Q.inverted),m);if(!W){var U=re("").appendTo(T),Y=re("").appendTo(U),O=re("").appendTo(U),z.showWeekNumbers&&((O=re("").appendTo(T),F=i?10*Math.ceil(h/10)-9:l?1-B:0,L=0;L").appendTo(J),l&&z.showWeekNumbers&&((O=re("").appendTo(J),(w=re("
").attr("colspan",""+m).appendTo(Y),k=i||s?new Date(h,0,1):l?new Date(h,v,1):new Date(h,v,f,p,c),A=re("").addClass(Q.link).appendTo(O),k=(A.text(ae.helper.dateFormat(Z[a+"Header"],k)),s?z.disableYear?"day":"year":l?z.disableMonth?"year":"month":"day");if(A.data(X.mode,k),0===t&&((A=re("").addClass(Q.prev).appendTo(O)).data(X.focusDate,x),A.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(w,a)),re("").addClass(Q.prevIcon).appendTo(A)),t===g-1&&((k=re("").addClass(Q.next).appendTo(O)).data(X.focusDate,M),k.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(C,a)),re("").addClass(Q.nextIcon).appendTo(k)),l)for(Y=re("
").appendTo(Y)).text(z.text.weekNo),O.addClass(Q.weekCell),K--),F=0;F").appendTo(Y)).text(Z.dayColumnHeader((F+z.firstDayOfWeek)%7,z))}for(var J=re("
").appendTo(Y)).text(ae.get.weekOfYear(h,v,F+1-z.firstDayOfWeek)),O.addClass(Q.weekCell)),e=0;e").addClass(Q.cell).appendTo(Y)).text(E),O.data(X.date,H),l&&H.getMonth()!==(v+12)%12),S=!z.selectAdjacentDays&&E||!ae.helper.isDateInRange(H,a)||z.isDisabled(H,a)||ae.helper.isDisabled(H,a)||!ae.helper.isEnabled(H,a),I=(S?(null!==(I=ae.helper.findDayAsObject(H,a,z.disabledDates))&&I[X.message]&&(O.attr("data-tooltip",I[X.message]),O.attr("data-position",I[X.position]||y),(I[X.inverted]||te&&I[X.inverted]===oe)&&O.attr("data-inverted",""),I[X.variation]&&O.attr("data-variation",I[X.variation])),"hour"===a&&null!==(I=ae.helper.findHourAsObject(H,a,z.disabledHours))&&I[X.message]&&(O.attr("data-tooltip",I[X.message]),O.attr("data-position",I[X.position]||y),(I[X.inverted]||te&&I[X.inverted]===oe)&&O.attr("data-inverted",""),I[X.variation]&&O.attr("data-variation",I[X.variation]))):null!==(N=ae.helper.findDayAsObject(H,a,z.eventDates))&&(O.addClass(N[X.class]||z.eventClass),N[X.message]&&(O.attr("data-tooltip",N[X.message]),O.attr("data-position",N[X.position]||y),(N[X.inverted]||te&&N[X.inverted]===oe)&&O.attr("data-inverted",""),N[X.variation]&&O.attr("data-variation",N[X.variation]))),ae.helper.dateEqual(H,q,a)),$=ae.helper.dateEqual(H,n,a),E=(O.toggleClass(Q.adjacentCell,E&&!N),O.toggleClass(Q.disabledCell,S),O.toggleClass(Q.activeCell,I&&!(E&&S)),d||u||O.toggleClass(Q.todayCell,!E&&$),{mode:a,adjacent:E,disabled:S,active:I,today:$});Z.cell(O,H,E),ae.helper.dateEqual(H,r,a)&&ae.set.focusDate(H,!1,!1)}z.today&&(x=re("
").attr("colspan",""+m).addClass(Q.today).appendTo(x)).text(Z.today(z)),w.data(X.date,n)),ae.update.focus(!1,T),z.inline&&ae.refreshTooltips()}}},update:{focus:function(e,t){t=t||ee;var i=ae.get.mode(),a=ae.get.date(),s=ae.get.focusDate(),l=ae.get.startDate(),d=ae.get.endDate(),u=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r=re(this),o=r.data(X.date);o&&(e=r.hasClass(Q.disabledCell),t=r.hasClass(Q.activeCell),a=r.hasClass(Q.adjacentCell),n=ae.helper.dateEqual(o,s,i),o=!!u&&(!!l&&ae.helper.isDateInRange(o,i,l,u)||!!d&&ae.helper.isDateInRange(o,i,u,d)),r.toggleClass(Q.focusCell,n&&(!c||f)&&(!a||z.selectAdjacentDays&&a)&&!e),ae.helper.isTodayButton(r)||r.toggleClass(Q.rangeCell,o&&!t&&!e))})}},refresh:function(){ae.create.calendar()},refreshTooltips:function(){var n=re(T).width();ee.find("td[data-position]").each(function(){var e=re(this),t=T.getComputedStyle(e[0],"::after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){ae.debug("Binding events"),ee.on("mousedown"+r,ae.event.mousedown),ee.on("touchstart"+r,ae.event.mousedown),ee.on("mouseup"+r,ae.event.mouseup),ee.on("touchend"+r,ae.event.mouseup),ee.on("mouseover"+r,ae.event.mouseover),(l.length?(l.on("input"+r,ae.event.inputChange),l.on("focus"+r,ae.event.inputFocus),l.on("blur"+r,ae.event.inputBlur),l):ee).on("keydown"+r,ae.event.keydown)}},unbind:{events:function(){ae.debug("Unbinding events"),ee.off(r),l.length&&l.off(r)}},event:{mouseover:function(e){var t=re(e.target).data(X.date),e=1===e.buttons;t&&ae.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),f=0<=e.type.indexOf("touch");e=re(e.target).data(X.date);e&&ae.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ae.focus(),e.preventDefault(),e.stopPropagation(),f=!1;var t,a,n,e=re(e.target);e.hasClass("disabled")||(t=(e=(t=e.parent()).data(X.date)||t.data(X.focusDate)||t.data(X.mode)?t:e).data(X.date),a=e.data(X.focusDate),n=e.data(X.mode),t&&!1!==z.onSelect.call(u,t,ae.get.mode())?(e=e.hasClass(Q.today),ae.selectDate(t,e)):a?ae.set.focusDate(a):n&&ae.set.mode(n))},keydown:function(e){var t,a,n,r,o,i,s,l=e.which;9===l&&ae.popup("hide"),ae.popup("is visible")&&(t=ae.get.mode(),37===l||38===l||39===l||40===l?(o="day"===t?7:"hour"===t?4:"minute"===t?_.column:3,o=37===l?-1:38===l?-o:39==l?1:o,o*="minute"===t?z.minTimeGap:1,i=(a=ae.get.focusDate()||ae.get.date()||new Date).getFullYear()+("year"===t?o:0),s=a.getMonth()+("month"===t?o:0),n=a.getDate()+("day"===t?o:0),r=a.getHours()+("hour"===t?o:0),o=a.getMinutes()+("minute"===t?o:0),i=new Date(i,s,n,r,o),"time"===z.type&&(i=ae.helper.mergeDateTime(a,i)),ae.helper.isDateInRange(i,t)&&ae.set.focusDate(i)):13===l?((s=ae.get.focusDate())&&!z.isDisabled(s,t)&&!ae.helper.isDisabled(s,t)&&ae.helper.isEnabled(s,t)&&!1!==z.onSelect.call(u,s,ae.get.mode())&&ae.selectDate(s),e.preventDefault(),e.stopPropagation()):27===l&&(ae.popup("hide"),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ae.popup("show"))},inputChange:function(){var e=l.val(),e=n.date(e,z);ae.set.date(e,!1)},inputFocus:function(){ee.addClass(Q.active)},inputBlur:function(){var e;ee.removeClass(Q.active),z.formatInput&&(e=ae.get.date(),e=ae.helper.dateFormat(Z[z.type],e),l.val(e)),m&&(ae.trigger.change(),m=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ae.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(ae.event.class.mutation),ae.debug("Setting up mutation observer",e),ae.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(i[0],{attributes:!0})}},is:{disabled:function(){return i.hasClass(Q.disabled)}},check:{disabled:function(){l.attr("tabindex",ae.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){return e=Date.UTC(e,t,a+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 ae.helper.dateFormat(e||Z[z.type],t||ae.get.date())},date:function(){return ae.helper.sanitiseDate(i.data(X.date))||null},inputDate:function(){return l.val()},focusDate:function(){return i.data(X.focusDate)||null},startDate:function(){var e=ae.get.calendarModule(z.startCalendar);return(e?e.get.date():i.data(X.startDate))||null},endDate:function(){var e=ae.get.calendarModule(z.endCalendar);return(e?e.get.date():i.data(X.endDate))||null},minDate:function(){return i.data(X.minDate)||null},maxDate:function(){return i.data(X.maxDate)||null},monthOffset:function(){return i.data(X.monthOffset)||z.monthOffset||0},mode:function(){var e=i.data(X.mode)||z.startMode;return ae.get.validatedMode(e)},validatedMode:function(e){var t=ae.get.validModes();return 0<=re.inArray(e,t)?e:"time"===z.type?"hour":"month"===z.type?"month":"year"===z.type?"year":"day"},type:function(){return i.data(X.type)||z.type},validModes:function(){var e=[];return"time"!==z.type&&(z.disableYear&&"year"!==z.type||e.push("year"),(z.disableMonth||"year"===z.type)&&"month"!==z.type||e.push("month"),0<=z.type.indexOf("date")&&e.push("day")),0<=z.type.indexOf("time")&&(e.push("hour"),z.disableMinute||e.push("minute")),e},isTouch:function(){try{return Y.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=e instanceof re?e:re(Y).find(e).first()).data(o):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ae.helper.sanitiseDate(e),e=ae.helper.dateInRange(e);var n,r=ae.get.mode(),o=ae.helper.dateFormat(Z[z.type],e);return(!a||!1!==z.onBeforeChange.call(u,e,o,r))&&(ae.set.focusDate(e),!z.isDisabled(e,r)&&((n=ae.get.endDate())&&e&&n=e?ae.verbose("Unable to set maxDate variable lower that minDate variable",e,z.minDate):(ae.setting("maxDate",e),ae.set.dataKeyValue(X.maxDate,e))},monthOffset:function(e,t){var a=Math.max(z.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ae.set.dataKeyValue(X.monthOffset,e,t)},mode:function(e,t){ae.set.dataKeyValue(X.mode,e,t)},dataKeyValue:function(e,t,a){var n=i.data(e),n=n===t||n<=t&&t<=n;return t?i.data(e,t):i.removeData(e),(a=!1!==a&&!n)&&ae.refresh(),!n}},selectDate:function(e,t){ae.verbose("New date selection",e);var a=ae.get.mode();t||"minute"===a||z.disableMinute&&"hour"===a||"date"===z.type&&"day"===a||"month"===z.type&&"month"===a||"year"===z.type&&"year"===a?!1!==ae.set.date(e)&&(m=!0,z.closable&&(ae.popup("hide"),(t=ae.get.calendarModule(z.endCalendar))&&(t.refresh(),"focus"!==t.setting("on")&&t.popup("show"),t.focus()))):(t="year"===a?z.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute",ae.set.mode(t),"hour"===a||"day"===a&&ae.get.date()?ae.set.date(e,!0,!1):ae.set.focusDate(e))},changeDate:function(e){ae.set.date(e)},clear:function(){ae.set.date(oe)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){(l.length?l:ee).focus()},blur:function(){(l.length?l:ee).blur()},helper:{dateFormat:function(e,t){var a,n,r,o,i,s,l,d,u,c;return t instanceof Date?"function"==typeof e?e.call(ae,t,z):(a=t.getDate(),n=t.getMonth(),r=t.getFullYear(),o=t.getDay(),i=t.getHours(),s=t.getMinutes(),t=t.getSeconds(),l=ae.get.weekOfYear(r,n,a+1-z.firstDayOfWeek),d=i%12||12,u=(i<12?z.text.am:z.text.pm).toLowerCase(),c={D:a,DD:("0"+a).slice(-2),M:n+1,MM:("0"+(n+1)).slice(-2),MMM:z.text.monthsShort[n],MMMM:z.text.months[n],Y:r,YY:String(r).slice(2),YYYY:r,d:o,dd:z.text.dayNamesShort[o].slice(0,2),ddd:z.text.dayNamesShort[o],dddd:z.text.dayNames[o],h:d,hh:("0"+d).slice(-2),H:i,HH:("0"+i).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=t.centuryBreak&&a===y.length-1){n<=99&&(n+=t.currentCentury-100),f=n,y.splice(a,1);break}if(p<0)for(a=0;a").addClass(Q.popup)[e](t)),ee.addClass(Q.calendar),te&&ee.addClass(Q.inverted),e=function(){return ae.refreshTooltips(),z.onVisible.apply(ee,arguments)},l.length||(ee.attr("tabindex","0"),e=function(){return ae.refreshTooltips(),ae.focus(),z.onVisible.apply(ee,arguments)}),t=ae.setting("on"),t=re.extend({},z.popupOptions,{popup:ee,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ae.set.focusDate(ae.get.date()),ae.set.mode(ae.get.validatedMode(z.startMode)),z.onShow.apply(ee,arguments)},onVisible:e,onHide:z.onHide,onHidden:function(){return ae.blur(),z.onHidden.apply(ee,arguments)}}),ae.popup(t)))},inline:function(){d.length&&!z.inline||(z.inline=!0,ee=re("
").addClass(Q.calendar).appendTo(i),l.length)||ee.attr("tabindex","0")},input:function(){z.touchReadonly&&l.length&&c&&l.prop("readonly",!0),ae.check.disabled()},date:function(){var e;z.initialDate?e=n.date(z.initialDate,z):i.data(X.date)!==oe?e=n.date(i.data(X.date),z):l.length&&(e=n.date(l.val(),z)),ae.set.date(e,z.formatInput,!1),ae.set.mode(ae.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=Y.createEvent("HTMLEvents"),ae.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,j,a=ae.get.mode(),n=new Date,q=ae.get.date(),r=ae.get.focusDate(),o=ae.helper.dateInRange(r||q||z.initialDate||n),i=(r||ae.set.focusDate(r=o,!1,!1),"year"===a),s="month"===a,l="day"===a,d="hour"===a,u="minute"===a,W="time"===z.type,R=Math.max(z.multiMonth,1),V=l?ae.get.monthOffset():0,c=o.getMinutes(),p=o.getHours(),f=o.getDate(),G=o.getMonth()+V,h=o.getFullYear(),m=l?z.showWeekNumbers?8:7:d?4:_.column,P=l||d?6:_.row,g=l?R:1,y=(D=ee).hasClass("left")?"right center":"left center";for(D.empty(),1").addClass(Q.grid).appendTo(D)),t=0;t").addClass(Q.column).appendTo(j));var D,v=G+t,B=(new Date(h,v,1).getDay()-z.firstDayOfWeek%7+7)%7,b=(!z.constantHeight&&l&&(b=new Date(h,v+1,0).getDate()+B,P=Math.ceil(b/7)),i?10:s?1:0),M=l?1:0,C=d||u?1:0,w=d||u?f:1,x=new Date(h-b,v-M,w-C,p),M=new Date(h+b,v+M,w+C,p),w=i?new Date(10*Math.ceil(h/10)-9,0,0):s?new Date(h,0,0):l?new Date(h,v,0):new Date(h,v,f,-1),C=i?new Date(10*Math.ceil(h/10)+1,0,1):s?new Date(h+1,0,1):l?new Date(h,v+1,1):new Date(h,v,f+1),T=a,T=(l&&z.showWeekNumbers&&(T+=" andweek"),re("").addClass(Q.table).addClass(T).addClass(ne[m]+" column").appendTo(D)),K=(te&&T.addClass(Q.inverted),m);if(!W){var U=re("").appendTo(T),Y=re("").appendTo(U),O=re("").appendTo(U),z.showWeekNumbers&&((O=re("").appendTo(T),F=i?10*Math.ceil(h/10)-9:l?1-B:0,L=0;L").appendTo(J),l&&z.showWeekNumbers&&((O=re("").appendTo(J),(w=re("
").attr("colspan",""+m).appendTo(Y),k=i||s?new Date(h,0,1):l?new Date(h,v,1):new Date(h,v,f,p,c),A=re("").addClass(Q.link).appendTo(O),k=(A.text(ae.helper.dateFormat(Z[a+"Header"],k)),s?z.disableYear?"day":"year":l?z.disableMonth?"year":"month":"day");if(A.data(X.mode,k),0===t&&((A=re("").addClass(Q.prev).appendTo(O)).data(X.focusDate,x),A.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(w,a)),re("").addClass(Q.prevIcon).appendTo(A)),t===g-1&&((k=re("").addClass(Q.next).appendTo(O)).data(X.focusDate,M),k.toggleClass(Q.disabledCell,!ae.helper.isDateInRange(C,a)),re("").addClass(Q.nextIcon).appendTo(k)),l)for(Y=re("
").appendTo(Y)).text(z.text.weekNo),O.addClass(Q.weekCell),K--),F=0;F").appendTo(Y)).text(Z.dayColumnHeader((F+z.firstDayOfWeek)%7,z))}for(var J=re("
").appendTo(Y)).text(ae.get.weekOfYear(h,v,F+1-z.firstDayOfWeek)),O.addClass(Q.weekCell)),e=0;e").addClass(Q.cell).appendTo(Y)).text(E),O.data(X.date,H),l&&H.getMonth()!==(v+12)%12),S=!z.selectAdjacentDays&&E||!ae.helper.isDateInRange(H,a)||z.isDisabled(H,a)||ae.helper.isDisabled(H,a)||!ae.helper.isEnabled(H,a),I=(S?(null!==(I=ae.helper.findDayAsObject(H,a,z.disabledDates))&&I[X.message]&&(O.attr("data-tooltip",I[X.message]),O.attr("data-position",I[X.position]||y),(I[X.inverted]||te&&I[X.inverted]===oe)&&O.attr("data-inverted",""),I[X.variation])&&O.attr("data-variation",I[X.variation]),"hour"===a&&null!==(I=ae.helper.findHourAsObject(H,a,z.disabledHours))&&I[X.message]&&(O.attr("data-tooltip",I[X.message]),O.attr("data-position",I[X.position]||y),(I[X.inverted]||te&&I[X.inverted]===oe)&&O.attr("data-inverted",""),I[X.variation])&&O.attr("data-variation",I[X.variation])):null!==(N=ae.helper.findDayAsObject(H,a,z.eventDates))&&(O.addClass(N[X.class]||z.eventClass),N[X.message])&&(O.attr("data-tooltip",N[X.message]),O.attr("data-position",N[X.position]||y),(N[X.inverted]||te&&N[X.inverted]===oe)&&O.attr("data-inverted",""),N[X.variation])&&O.attr("data-variation",N[X.variation]),ae.helper.dateEqual(H,q,a)),$=ae.helper.dateEqual(H,n,a),E=(O.toggleClass(Q.adjacentCell,E&&!N),O.toggleClass(Q.disabledCell,S),O.toggleClass(Q.activeCell,I&&!(E&&S)),d||u||O.toggleClass(Q.todayCell,!E&&$),{mode:a,adjacent:E,disabled:S,active:I,today:$});Z.cell(O,H,E),ae.helper.dateEqual(H,r,a)&&ae.set.focusDate(H,!1,!1)}z.today&&(x=re("
").attr("colspan",""+m).addClass(Q.today).appendTo(x)).text(Z.today(z)),w.data(X.date,n)),ae.update.focus(!1,T),z.inline&&ae.refreshTooltips()}}},update:{focus:function(e,t){t=t||ee;var i=ae.get.mode(),a=ae.get.date(),s=ae.get.focusDate(),l=ae.get.startDate(),d=ae.get.endDate(),u=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r=re(this),o=r.data(X.date);o&&(e=r.hasClass(Q.disabledCell),t=r.hasClass(Q.activeCell),a=r.hasClass(Q.adjacentCell),n=ae.helper.dateEqual(o,s,i),o=!!u&&(!!l&&ae.helper.isDateInRange(o,i,l,u)||!!d&&ae.helper.isDateInRange(o,i,u,d)),r.toggleClass(Q.focusCell,n&&(!c||f)&&(!a||z.selectAdjacentDays&&a)&&!e),ae.helper.isTodayButton(r)||r.toggleClass(Q.rangeCell,o&&!t&&!e))})}},refresh:function(){ae.create.calendar()},refreshTooltips:function(){var n=re(T).width();ee.find("td[data-position]").each(function(){var e=re(this),t=T.getComputedStyle(e[0],"::after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){ae.debug("Binding events"),ee.on("mousedown"+r,ae.event.mousedown),ee.on("touchstart"+r,ae.event.mousedown),ee.on("mouseup"+r,ae.event.mouseup),ee.on("touchend"+r,ae.event.mouseup),ee.on("mouseover"+r,ae.event.mouseover),(l.length?(l.on("input"+r,ae.event.inputChange),l.on("focus"+r,ae.event.inputFocus),l.on("blur"+r,ae.event.inputBlur),l):ee).on("keydown"+r,ae.event.keydown)}},unbind:{events:function(){ae.debug("Unbinding events"),ee.off(r),l.length&&l.off(r)}},event:{mouseover:function(e){var t=re(e.target).data(X.date),e=1===e.buttons;t&&ae.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),f=0<=e.type.indexOf("touch");e=re(e.target).data(X.date);e&&ae.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ae.focus(),e.preventDefault(),e.stopPropagation(),f=!1;var t,a,n,e=re(e.target);e.hasClass("disabled")||(t=(e=(t=e.parent()).data(X.date)||t.data(X.focusDate)||t.data(X.mode)?t:e).data(X.date),a=e.data(X.focusDate),n=e.data(X.mode),t&&!1!==z.onSelect.call(u,t,ae.get.mode())?(e=e.hasClass(Q.today),ae.selectDate(t,e)):a?ae.set.focusDate(a):n&&ae.set.mode(n))},keydown:function(e){var t,a,n,r,o,i,s,l=e.which;9===l&&ae.popup("hide"),ae.popup("is visible")&&(t=ae.get.mode(),37===l||38===l||39===l||40===l?(o="day"===t?7:"hour"===t?4:"minute"===t?_.column:3,o=37===l?-1:38===l?-o:39==l?1:o,o*="minute"===t?z.minTimeGap:1,i=(a=ae.get.focusDate()||ae.get.date()||new Date).getFullYear()+("year"===t?o:0),s=a.getMonth()+("month"===t?o:0),n=a.getDate()+("day"===t?o:0),r=a.getHours()+("hour"===t?o:0),o=a.getMinutes()+("minute"===t?o:0),i=new Date(i,s,n,r,o),"time"===z.type&&(i=ae.helper.mergeDateTime(a,i)),ae.helper.isDateInRange(i,t)&&ae.set.focusDate(i)):13===l?((s=ae.get.focusDate())&&!z.isDisabled(s,t)&&!ae.helper.isDisabled(s,t)&&ae.helper.isEnabled(s,t)&&!1!==z.onSelect.call(u,s,ae.get.mode())&&ae.selectDate(s),e.preventDefault(),e.stopPropagation()):27===l&&(ae.popup("hide"),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ae.popup("show"))},inputChange:function(){var e=l.val(),e=n.date(e,z);ae.set.date(e,!1)},inputFocus:function(){ee.addClass(Q.active)},inputBlur:function(){var e;ee.removeClass(Q.active),z.formatInput&&(e=ae.get.date(),e=ae.helper.dateFormat(Z[z.type],e),l.val(e)),m&&(ae.trigger.change(),m=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ae.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(ae.event.class.mutation),ae.debug("Setting up mutation observer",e),ae.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(i[0],{attributes:!0})}},is:{disabled:function(){return i.hasClass(Q.disabled)}},check:{disabled:function(){l.attr("tabindex",ae.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){return e=Date.UTC(e,t,a+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 ae.helper.dateFormat(e||Z[z.type],t||ae.get.date())},date:function(){return ae.helper.sanitiseDate(i.data(X.date))||null},inputDate:function(){return l.val()},focusDate:function(){return i.data(X.focusDate)||null},startDate:function(){var e=ae.get.calendarModule(z.startCalendar);return(e?e.get.date():i.data(X.startDate))||null},endDate:function(){var e=ae.get.calendarModule(z.endCalendar);return(e?e.get.date():i.data(X.endDate))||null},minDate:function(){return i.data(X.minDate)||null},maxDate:function(){return i.data(X.maxDate)||null},monthOffset:function(){return i.data(X.monthOffset)||z.monthOffset||0},mode:function(){var e=i.data(X.mode)||z.startMode;return ae.get.validatedMode(e)},validatedMode:function(e){var t=ae.get.validModes();return 0<=re.inArray(e,t)?e:"time"===z.type?"hour":"month"===z.type?"month":"year"===z.type?"year":"day"},type:function(){return i.data(X.type)||z.type},validModes:function(){var e=[];return"time"!==z.type&&(z.disableYear&&"year"!==z.type||e.push("year"),(z.disableMonth||"year"===z.type)&&"month"!==z.type||e.push("month"),0<=z.type.indexOf("date"))&&e.push("day"),0<=z.type.indexOf("time")&&(e.push("hour"),z.disableMinute||e.push("minute")),e},isTouch:function(){try{return Y.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=e instanceof re?e:re(Y).find(e).first()).data(o):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ae.helper.sanitiseDate(e),e=ae.helper.dateInRange(e);var n,r=ae.get.mode(),o=ae.helper.dateFormat(Z[z.type],e);return!(a&&!1===z.onBeforeChange.call(u,e,o,r)||(ae.set.focusDate(e),z.isDisabled(e,r)))&&((n=ae.get.endDate())&&e&&n=e?ae.verbose("Unable to set maxDate variable lower that minDate variable",e,z.minDate):(ae.setting("maxDate",e),ae.set.dataKeyValue(X.maxDate,e))},monthOffset:function(e,t){var a=Math.max(z.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ae.set.dataKeyValue(X.monthOffset,e,t)},mode:function(e,t){ae.set.dataKeyValue(X.mode,e,t)},dataKeyValue:function(e,t,a){var n=i.data(e),n=n===t||n<=t&&t<=n;return t?i.data(e,t):i.removeData(e),(a=!1!==a&&!n)&&ae.refresh(),!n}},selectDate:function(e,t){ae.verbose("New date selection",e);var a=ae.get.mode();t||"minute"===a||z.disableMinute&&"hour"===a||"date"===z.type&&"day"===a||"month"===z.type&&"month"===a||"year"===z.type&&"year"===a?!1!==ae.set.date(e)&&(m=!0,z.closable)&&(ae.popup("hide"),t=ae.get.calendarModule(z.endCalendar))&&(t.refresh(),"focus"!==t.setting("on")&&t.popup("show"),t.focus()):(t="year"===a?z.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute",ae.set.mode(t),"hour"===a||"day"===a&&ae.get.date()?ae.set.date(e,!0,!1):ae.set.focusDate(e))},changeDate:function(e){ae.set.date(e)},clear:function(){ae.set.date(oe)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){(l.length?l:ee).focus()},blur:function(){(l.length?l:ee).blur()},helper:{dateFormat:function(e,t){var a,n,r,o,i,s,l,d,u,c;return t instanceof Date?"function"==typeof e?e.call(ae,t,z):(a=t.getDate(),n=t.getMonth(),r=t.getFullYear(),o=t.getDay(),i=t.getHours(),s=t.getMinutes(),t=t.getSeconds(),l=ae.get.weekOfYear(r,n,a+1-z.firstDayOfWeek),d=i%12||12,u=(i<12?z.text.am:z.text.pm).toLowerCase(),c={D:a,DD:("0"+a).slice(-2),M:n+1,MM:("0"+(n+1)).slice(-2),MMM:z.text.monthsShort[n],MMMM:z.text.months[n],Y:r,YY:String(r).slice(2),YYYY:r,d:o,dd:z.text.dayNamesShort[o].slice(0,2),ddd:z.text.dayNamesShort[o],dddd:z.text.dayNames[o],h:d,hh:("0"+d).slice(-2),H:i,HH:("0"+i).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=t.centuryBreak&&a===y.length-1){n<=99&&(n+=t.currentCentury-100),f=n,y.splice(a,1);break}if(p<0)for(a=0;a adjusting invoked element"),p=p.closest(g.checkbox),v.refresh())}},setup:function(){v.set.initialLoad(),v.is.indeterminate()?(v.debug("Initial value is indeterminate"),v.indeterminate()):v.is.checked()?(v.debug("Initial value is checked"),v.check()):(v.debug("Initial value is unchecked"),v.uncheck()),v.remove.initialLoad()},refresh:function(){a=p.children(g.label),f=p.children(g.input),k=f[0]},hide:{input:function(){v.verbose("Modifying z-index to be unselectable"),f.addClass(n.hidden)}},show:{input:function(){v.verbose("Modifying z-index to be selectable"),f.removeClass(n.hidden)}},observeChanges:function(){"MutationObserver"in E&&((e=new MutationObserver(function(e){v.debug("DOM tree modified, updating selector cache"),v.refresh()})).observe(d,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",e))},attachEvents:function(e,n){var t=I(e);n=I.isFunction(v[n])?v[n]:v.toggle,0").insertAfter(f),v.debug("Creating label",a))}},has:{label:function(){return 0 adjusting invoked element"),p=p.closest(g.checkbox),v.refresh())}},setup:function(){v.set.initialLoad(),v.is.indeterminate()?(v.debug("Initial value is indeterminate"),v.indeterminate()):v.is.checked()?(v.debug("Initial value is checked"),v.check()):(v.debug("Initial value is unchecked"),v.uncheck()),v.remove.initialLoad()},refresh:function(){a=p.children(g.label),f=p.children(g.input),k=f[0]},hide:{input:function(){v.verbose("Modifying z-index to be unselectable"),f.addClass(n.hidden)}},show:{input:function(){v.verbose("Modifying z-index to be selectable"),f.removeClass(n.hidden)}},observeChanges:function(){"MutationObserver"in E&&((e=new MutationObserver(function(e){v.debug("DOM tree modified, updating selector cache"),v.refresh()})).observe(d,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",e))},attachEvents:function(e,n){var t=I(e);n=I.isFunction(v[n])?v[n]:v.toggle,0").insertAfter(f),v.debug("Creating label",a))}},has:{label:function(){return 0").html(i).attr("data-"+p.value,t).attr("data-"+p.text,t).addClass(f.addition).addClass(f.item),m.hideAdditions&&i.addClass(f.hidden),n=n===ne?i:n.add(i),M.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=M.get.userValues();t&&(M.debug("Adding user labels",t),Z.each(t,function(e,t){M.verbose("Adding custom user value"),M.add.label(t,t)}))},menu:function(){I=Z("
").addClass(f.menu).appendTo(y)},sizer:function(){A=Z("").addClass(f.sizer).insertAfter(S)}},search:function(e){e=e!==ne?e:M.get.query(),M.verbose("Searching for query",e),!1===m.fireOnInit&&M.is.initialLoad()?M.verbose("Skipping callback on initial load",m.onSearch):M.has.minCharacters(e)&&!1!==m.onSearch.call(R,e)?M.filter(e):M.hide(null,!0)},select:{firstUnfiltered:function(){M.verbose("Selecting first non-filtered element"),M.remove.selectedItem(),k.not(b.unselectable).not(b.addition+b.hidden).eq(0).addClass(f.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").addClass("remove icon").insertBefore(x)),M.is.search()&&!M.has.search()&&(M.verbose("Adding search input"),e=y.prev("label"),S=Z("").addClass(f.search).prop("autocomplete",M.is.chrome()?"fomantic-search":"off"),e.length&&(e.attr("id")||e.attr("id","_"+M.get.id()+"_formLabel"),S.attr("aria-labelledby",e.attr("id"))),S.insertBefore(x)),M.is.multiple()&&M.is.searchSelection()&&!M.has.sizer()&&M.create.sizer(),m.allowTab&&M.set.tabbable()},select:function(){var e=M.get.selectValues();M.debug("Dropdown initialized on a select",e),0<(T=y.is("select")?y:T).parent(b.dropdown).length?(M.debug("UI dropdown already exists. Creating dropdown menu only"),y=T.closest(b.dropdown),M.has.menu()||M.create.menu(),I=y.children(b.menu),M.setup.menu(e)):(M.debug("Creating entire dropdown from select"),y=Z("
").attr("class",T.attr("class")).addClass(f.selection).addClass(f.dropdown).html(P.dropdown(e,l,m.preserveHTML,m.className)).insertBefore(T),T.hasClass(f.multiple)&&!1===T.prop("multiple")&&(M.error(u.missingMultiple),T.prop("multiple",!0)),T.is("[multiple]")&&M.set.multiple(),T.prop("disabled")&&(M.debug("Disabling dropdown"),y.addClass(f.disabled)),T.is("[required]")&&(m.forceSelection=!0),T.removeAttr("required").removeAttr("class").detach().prependTo(y)),M.refresh()},menu:function(e){I.html(P.menu(e,l,m.preserveHTML,m.className)),k=I.find(b.item),D=m.hideDividers?k.parent().children(b.divider):Z()},reference:function(){M.debug("Dropdown behavior was called on select, replacing with closest dropdown"),y=y.parent(b.dropdown),V=y.data(w),R=y[0],M.refresh(),M.setup.returnedObject()},returnedObject:function(){var e=W.slice(0,F),t=W.slice(F+1);W=e.add(y).add(t)}},refresh:function(){M.refreshSelectors(),M.refreshData()},refreshItems:function(){k=I.find(b.item),D=m.hideDividers?k.parent().children(b.divider):Z()},refreshSelectors:function(){M.verbose("Refreshing selector cache"),x=y.find(b.text),S=y.find(b.search),T=y.find(b.input),N=y.find(b.icon),L=0"),Z.each(e,function(e,t){var n=m.templates.deQuote(t[l.value]),i=m.templates.escape(t[l.name]||"",m.preserveHTML);T.append('")}),M.observe.select())}},event:{paste:function(e){(e.originalEvent.clipboardData||ee.clipboardData).getData("text").split(m.delimiter).forEach(function(e){M.set.selected(M.escape.htmlEntities(e.trim()),null,!0,!0)}),e.preventDefault()},change:function(){U||(M.debug("Input changed, updating selection"),M.set.selected())},focus:function(){m.showOnFocus&&!O&&M.is.hidden()&&!t&&(E=!0,M.show())},blur:function(e){t=te.activeElement===this,O||t||(M.remove.activeLabel(),M.hide())},mousedown:function(){M.is.searchSelection(!0)?n=!0:O=!0},mouseup:function(){M.is.searchSelection(!0)?n=!1:O=!1},click:function(e){Z(e.target).is(y)&&(M.is.focusedOnSearch()?M.show():M.focusSearch())},search:{focus:function(e){O=!0,M.is.multiple()&&M.remove.activeLabel(),E||M.is.active()||!(m.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)||"touchstart"===e.type||(E=!0,M.search())},blur:function(e){t=te.activeElement===this,!M.is.searchSelection(!0)||n||j||t||(m.forceSelection?M.forceSelection():m.allowAdditions||M.remove.searchTerm(),M.hide()),n=!1}},clearIcon:{click:function(e){M.clear(),M.is.searchSelection()&&M.remove.searchTerm(),M.hide(),e.stopPropagation()}},icon:{click:function(e){q=!0,M.has.search()?M.is.active()?M.blurSearch():m.showOnFocus?M.focusSearch():M.toggle():M.toggle(),e.stopPropagation()}},text:{focus:function(e){O=!0,M.focusSearch()}},input:function(e){(M.is.multiple()||M.is.searchSelection())&&M.set.filtered(),clearTimeout(M.timer),M.timer=setTimeout(M.search,m.delay.search)},label:{click:function(e){var t=Z(this),n=y.find(b.label),i=n.filter("."+f.active),a=t.nextAll("."+f.active),s=t.prevAll("."+f.active),a=(0 modified, recreating menu"),M.disconnect.selectObserver(),M.refresh(),M.setup.select(),M.set.selected(),M.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=m.maxSelections?(M.debug("Maximum selection count reached"),m.useLabels&&(k.addClass(f.filtered),M.add.message(h.maxSelections)),!0):(M.verbose("No longer at maximum selection count"),M.remove.message(),M.remove.filteredItem(),M.is.searchSelection()&&M.filterItems(),!1))},disabled:function(){S.attr("tabindex",M.is.disabled()?-1:0)}},restore:{defaults:function(e){M.clear(e),M.restore.defaultText(),M.restore.defaultValue()},defaultText:function(){var e=M.get.defaultText();e===M.get.placeholderText?(M.debug("Restoring default placeholder text",e),M.set.placeholderText(e)):(M.debug("Restoring default text",e),M.set.text(e))},placeholderText:function(){M.set.placeholderText()},defaultValue:function(){var e=M.get.defaultValue();e!==ne&&(M.debug("Restoring default value",e),""!==e?(M.set.value(e),M.set.selected()):(M.remove.activeItem(),M.remove.selectedItem()))},labels:function(){m.allowAdditions&&(m.useLabels||(M.error(u.labels),m.useLabels=!0),M.debug("Restoring selected values"),M.create.userLabels()),M.check.maxSelections()},selected:function(){M.restore.values(),M.is.multiple()?(M.debug("Restoring previously selected values and labels"),M.restore.labels()):M.debug("Restoring previously selected values")},values:function(){M.set.initialLoad(),m.apiSettings&&m.saveRemoteData&&M.get.remoteValues()?M.restore.remoteValues():M.set.selected();var e=M.get.value();!e||""===e||Array.isArray(e)&&0===e.length?T.addClass(f.noselection):T.removeClass(f.noselection),M.remove.initialLoad()},remoteValues:function(){var e=M.get.remoteValues();M.debug("Recreating selected from session data",e),e&&(M.is.single()?Z.each(e,function(e,t){M.set.text(t)}):Z.each(e,function(e,t){M.add.label(e,t)}))}},read:{remoteData:function(e){if(ee.Storage!==ne)return(e=sessionStorage.getItem(e+i))!==ne&&e;M.error(u.noStorage)}},save:{defaults:function(){M.save.defaultText(),M.save.placeholderText(),M.save.defaultValue()},defaultValue:function(){var e=M.get.value();M.verbose("Saving default value as",e),y.data(p.defaultValue,e)},defaultText:function(){var e=M.get.text();M.verbose("Saving default text as",e),y.data(p.defaultText,e)},placeholderText:function(){var e;!1!==m.placeholder&&x.hasClass(f.placeholder)&&(e=M.get.text(),M.verbose("Saving placeholder text as",e),y.data(p.placeholderText,e))},remoteData:function(e,t){ee.Storage===ne?M.error(u.noStorage):(M.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t+i,e))}},clear:function(e){M.is.multiple()&&m.useLabels?M.remove.labels(y.find(b.label),e):(M.remove.activeItem(),M.remove.selectedItem(),M.remove.filteredItem()),M.set.placeholderText(),M.clearValue(e)},clearValue:function(e){M.set.value("",null,null,e)},scrollPage:function(e,t){var t=t||M.get.selectedItem(),n=t.closest(b.menu),i=n.outerHeight(),a=n.scrollTop(),s=k.eq(0).outerHeight(),i=Math.floor(i/s),a="up"==e?a-s*i:a+s*i,s=k.not(b.unselectable),i="up"==e?s.index(t)-i:s.index(t)+i,i=("up"==e?0<=i:i").addClass(f.label).attr("data-"+p.value,s).html(P.label(s,t,m.preserveHTML,m.className)),i=m.onLabelCreate.call(i,s,t),M.has.label(e)?M.debug("User selection already exists, skipping",s):(m.label.variation&&i.addClass(m.label.variation),!0===n?(M.debug("Animating in label",i),i.addClass(f.hidden).insertBefore(a).transition({animation:m.label.transition,debug:m.debug,verbose:m.verbose,silent:m.silent,duration:m.label.duration})):(M.debug("Adding selection label",i),i.insertBefore(a)))},message:function(e){var t=I.children(b.message),e=m.templates.message(M.add.variables(e));0").html(e).addClass(f.message).appendTo(I)},optionValue:function(e){var t=M.escape.value(e);0").prop("value",t).addClass(f.addition).text(e).appendTo(T),M.verbose("Adding user addition as an