/* * # Fomantic UI - 2.8.4 * https://github.com/fomantic/Fomantic-UI * http://fomantic-ui.com/ * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(_,ee,te,ne){"use strict";_.isFunction=_.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")(),_.fn.dropdown=function(j){var U,B=_(this),K=_(te),W=B.selector||"",Q="ontouchstart"in te.documentElement,Y=Q?"touchstart":"click",$=(new Date).getTime(),X=[],G=j,J="string"==typeof G,Z=[].slice.call(arguments,1);return B.each(function(n){var c,e,t,i,a,o,s,r,h,f=_.isPlainObject(j)?_.extend(!0,{},_.fn.dropdown.settings,j):_.extend({},_.fn.dropdown.settings),g=f.className,u=f.message,l=f.fields,p=f.keys,b=f.metadata,d=f.namespace,v=f.regExp,w=f.selector,m=f.error,C=f.templates,x="."+d,y="module-"+d,S=_(this),A=_(f.context),T=S.find(w.text),L=S.find(w.search),I=S.find(w.sizer),D=S.find(w.input),k=S.find(w.icon),q=S.find(w.clearIcon),R=0").html(a).attr("data-"+b.value,t).attr("data-"+b.text,t).addClass(g.addition).addClass(g.item),f.hideAdditions&&i.addClass(g.hidden),n=n===ne?i:n.add(i),h.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=h.get.userValues();t&&(h.debug("Adding user labels",t),_.each(t,function(e,t){h.verbose("Adding custom user value"),h.add.label(t,t)}))},menu:function(){O=_("
").addClass(g.menu).appendTo(S)},sizer:function(){I=_("").addClass(g.sizer).insertAfter(L)}},search:function(e){e=e!==ne?e:h.get.query(),h.verbose("Searching for query",e),h.has.minCharacters(e)?h.filter(e):h.hide(null,!0)},select:{firstUnfiltered:function(){h.verbose("Selecting first non-filtered element"),h.remove.selectedItem(),E.not(w.unselectable).not(w.addition+w.hidden).eq(0).addClass(g.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(w.item).not(w.unselectable).eq(0),n=e.prevAll(w.item).not(w.unselectable).eq(0);0").addClass("remove icon").insertBefore(T)),h.is.search()&&!h.has.search()&&(h.verbose("Adding search input"),L=_("").addClass(g.search).prop("autocomplete","off").insertBefore(T)),h.is.multiple()&&h.is.searchSelection()&&!h.has.sizer()&&h.create.sizer(),f.allowTab&&h.set.tabbable()},select:function(){var e=h.get.selectValues();h.debug("Dropdown initialized on a select",e),S.is("select")&&(D=S),0").attr("class",D.attr("class")).addClass(g.selection).addClass(g.dropdown).html(C.dropdown(e,l,f.preserveHTML,f.className)).insertBefore(D),D.hasClass(g.multiple)&&!1===D.prop("multiple")&&(h.error(m.missingMultiple),D.prop("multiple",!0)),D.is("[multiple]")&&h.set.multiple(),D.prop("disabled")&&(h.debug("Disabling dropdown"),S.addClass(g.disabled)),D.removeAttr("required").removeAttr("class").detach().prependTo(S)),h.refresh()},menu:function(e){O.html(C.menu(e,l,f.preserveHTML,f.className)),E=O.find(w.item),V=f.hideDividers?E.parent().children(w.divider):_()},reference:function(){h.debug("Dropdown behavior was called on select, replacing with closest dropdown"),S=S.parent(w.dropdown),H=S.data(y),N=S.get(0),h.refresh(),h.setup.returnedObject()},returnedObject:function(){var e=B.slice(0,n),t=B.slice(n+1);B=e.add(S).add(t)}},refresh:function(){h.refreshSelectors(),h.refreshData()},refreshItems:function(){E=O.find(w.item),V=f.hideDividers?E.parent().children(w.divider):_()},refreshSelectors:function(){h.verbose("Refreshing selector cache"),T=S.find(w.text),L=S.find(w.search),D=S.find(w.input),k=S.find(w.icon),R=0"),_.each(e,function(e,t){var n=f.templates.deQuote(t[l.value]),i=f.templates.escape(t[l.name]||"",f.preserveHTML);D.append('")}),h.observe.select())}},event:{change:function(){F||(h.debug("Input changed, updating selection"),h.set.selected())},focus:function(){f.showOnFocus&&!M&&h.is.hidden()&&!t&&h.show()},blur:function(e){t=te.activeElement===this,M||t||(h.remove.activeLabel(),h.hide())},mousedown:function(){h.is.searchSelection()?i=!0:M=!0},mouseup:function(){h.is.searchSelection()?i=!1:M=!1},click:function(e){_(e.target).is(S)&&(h.is.focusedOnSearch()?h.show():h.focusSearch())},search:{focus:function(e){M=!0,h.is.multiple()&&h.remove.activeLabel(),(f.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)&&h.search()},blur:function(e){t=te.activeElement===this,h.is.searchSelection()&&!i&&(z||t||(f.forceSelection?h.forceSelection():f.allowAdditions||h.remove.searchTerm(),h.hide())),i=!1}},clearIcon:{click:function(e){h.clear(),h.is.searchSelection()&&h.remove.searchTerm(),h.hide(),e.stopPropagation()}},icon:{click:function(e){P=!0,h.has.search()?h.is.active()?h.blurSearch():f.showOnFocus?h.focusSearch():h.toggle():h.toggle()}},text:{focus:function(e){M=!0,h.focusSearch()}},input:function(e){(h.is.multiple()||h.is.searchSelection())&&h.set.filtered(),clearTimeout(h.timer),h.timer=setTimeout(h.search,f.delay.search)},label:{click:function(e){var t=_(this),n=S.find(w.label),i=n.filter("."+g.active),a=t.nextAll("."+g.active),o=t.prevAll("."+g.active),s=0 modified, recreating menu"),h.is.selectMutation(e)&&(h.disconnect.selectObserver(),h.refresh(),h.setup.select(),h.set.selected(),h.observe.select())}},menu:{mutation:function(e){var t=e[0],n=t.addedNodes?_(t.addedNodes[0]):_(!1),i=t.removedNodes?_(t.removedNodes[0]):_(!1),a=n.add(i),o=a.is(w.addition)||0=f.maxSelections?(h.debug("Maximum selection count reached"),f.useLabels&&(E.addClass(g.filtered),h.add.message(u.maxSelections)),!0):(h.verbose("No longer at maximum selection count"),h.remove.message(),h.remove.filteredItem(),h.is.searchSelection()&&h.filterItems(),!1))}},restore:{defaults:function(e){h.clear(e),h.restore.defaultText(),h.restore.defaultValue()},defaultText:function(){var e=h.get.defaultText();e===h.get.placeholderText?(h.debug("Restoring default placeholder text",e),h.set.placeholderText(e)):(h.debug("Restoring default text",e),h.set.text(e))},placeholderText:function(){h.set.placeholderText()},defaultValue:function(){var e=h.get.defaultValue();e!==ne&&(h.debug("Restoring default value",e),""!==e?(h.set.value(e),h.set.selected()):(h.remove.activeItem(),h.remove.selectedItem()))},labels:function(){f.allowAdditions&&(f.useLabels||(h.error(m.labels),f.useLabels=!0),h.debug("Restoring selected values"),h.create.userLabels()),h.check.maxSelections()},selected:function(){h.restore.values(),h.is.multiple()?(h.debug("Restoring previously selected values and labels"),h.restore.labels()):h.debug("Restoring previously selected values")},values:function(){h.set.initialLoad(),f.apiSettings&&f.saveRemoteData&&h.get.remoteValues()?h.restore.remoteValues():h.set.selected();var e=h.get.value();!e||""===e||Array.isArray(e)&&0===e.length?D.addClass(g.noselection):D.removeClass(g.noselection),h.remove.initialLoad()},remoteValues:function(){var e=h.get.remoteValues();h.debug("Recreating selected from session data",e),e&&(h.is.single()?_.each(e,function(e,t){h.set.text(t)}):_.each(e,function(e,t){h.add.label(e,t)}))}},read:{remoteData:function(e){var t;if(ee.Storage!==ne)return(t=sessionStorage.getItem(e))!==ne&&t;h.error(m.noStorage)}},save:{defaults:function(){h.save.defaultText(),h.save.placeholderText(),h.save.defaultValue()},defaultValue:function(){var e=h.get.value();h.verbose("Saving default value as",e),S.data(b.defaultValue,e)},defaultText:function(){var e=h.get.text();h.verbose("Saving default text as",e),S.data(b.defaultText,e)},placeholderText:function(){var e;!1!==f.placeholder&&T.hasClass(g.placeholder)&&(e=h.get.text(),h.verbose("Saving placeholder text as",e),S.data(b.placeholderText,e))},remoteData:function(e,t){ee.Storage!==ne?(h.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t,e)):h.error(m.noStorage)}},clear:function(e){h.is.multiple()&&f.useLabels?h.remove.labels():(h.remove.activeItem(),h.remove.selectedItem(),h.remove.filteredItem()),h.set.placeholderText(),h.clearValue(e)},clearValue:function(e){h.set.value("",null,null,e)},scrollPage:function(e,t){var n,i,a=t||h.get.selectedItem(),o=a.closest(w.menu),s=o.outerHeight(),r=o.scrollTop(),l=E.eq(0).outerHeight(),c=Math.floor(s/l),u=(o.prop("scrollHeight"),"up"==e?r-l*c:r+l*c),d=E.not(w.unselectable);i="up"==e?d.index(a)-c:d.index(a)+c,0<(n=("up"==e?0<=i:i").addClass(g.label).attr("data-"+b.value,o).html(C.label(o,t,f.preserveHTML,f.className)),i=f.onLabelCreate.call(i,o,t),h.has.label(e)?h.debug("User selection already exists, skipping",o):(f.label.variation&&i.addClass(f.label.variation),!0===n?(h.debug("Animating in label",i),i.addClass(g.hidden).insertBefore(a).transition({animation:f.label.transition,debug:f.debug,verbose:f.verbose,duration:f.label.duration})):(h.debug("Adding selection label",i),i.insertBefore(a)))},message:function(e){var t=O.children(w.message),n=f.templates.message(h.add.variables(e));0").html(n).addClass(g.message).appendTo(O)},optionValue:function(e){var t=h.escape.value(e);0").prop("value",t).addClass(g.addition).html(e).appendTo(D),h.verbose("Adding user addition as an