!function(e){function t(t){for(var n,a,o=t[0],r=t[1],s=0,l=[];s=0;--o){var r=this.tryEntries[o],s=r.completion;if("root"===r.tryLoc)return a("end");if(r.tryLoc<=this.prev){var c=i.call(r,"catchLoc"),l=i.call(r,"finallyLoc");if(c&&l){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&i.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var a=i.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:A(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],i=!0,a=!1,o=void 0;try{for(var r,s=e[Symbol.iterator]();!(i=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){!function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dropdown=function(i){var a,o=e(this),r=e(n),s=o.selector||"",c="ontouchstart"in n.documentElement,l=(new Date).getTime(),d=[],u=arguments[0],h="string"==typeof u,f=[].slice.call(arguments,1),m=1;return o.each((function(p){var v,g,b,$,w,y,x,C,k=e.isPlainObject(i)?e.extend(!0,{},e.fn.dropdown.settings,i):e.extend({},e.fn.dropdown.settings),S=k.className,_=k.message,T=k.fields,A=k.keys,L=k.metadata,q=k.namespace,D=k.regExp,O=k.selector,I=k.error,R=k.templates,E="."+q,F="module-"+q,j=e(this),M=e(k.context),N=j.find(O.text),z=j.find(O.search),P=j.find(O.sizer),V=j.find(O.input),B=j.find(O.icon),H=j.prev().find(O.text).length>0?j.prev().find(O.text):j.prev(),U=j.children(O.menu),K=U.find(O.item),W=!1,J=!1,Q=!1,X=this,G=j.data(F);C={initialize:function(){C.debug("Initializing dropdown",k),C.is.alreadySetup()?C.setup.reference():(C.setup.layout(),k.values&&C.change.values(k.values),C.refreshData(),C.save.defaults(),C.restore.selected(),C.create.id(),C.bind.events(),C.observeChanges(),C.instantiate(),C.aria.setup())},instantiate:function(){C.verbose("Storing instance of dropdown",C),G=C,j.data(F,C)},destroy:function(){C.verbose("Destroying previous dropdown",j),C.remove.tabbable(),j.off(E).removeData(F),U.off(E),r.off($),C.disconnect.menuObserver(),C.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(y=new MutationObserver(C.event.select.mutation),x=new MutationObserver(C.event.menu.mutation),C.debug("Setting up mutation observer",y,x),C.observe.select(),C.observe.menu())},disconnect:{menuObserver:function(){x&&x.disconnect()},selectObserver:function(){y&&y.disconnect()}},observe:{select:function(){C.has.input()&&y.observe(j[0],{childList:!0,subtree:!0})},menu:function(){C.has.menu()&&x.observe(U[0],{childList:!0,subtree:!0})}},create:{id:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),$="."+w,C.verbose("Creating unique id for element",w)},userChoice:function(t){var n,i,a;return!!(t=t||C.get.userValues())&&(t=e.isArray(t)?t:[t],e.each(t,(function(t,o){!1===C.get.item(o)&&(a=k.templates.addition(C.add.variables(_.addResult,o)),i=e("
").html(a).attr("data-"+L.value,o).attr("data-"+L.text,o).addClass(S.addition).addClass(S.item),k.hideAdditions&&i.addClass(S.hidden),n=void 0===n?i:n.add(i),C.verbose("Creating user choices for value",o,i))})),n)},userLabels:function(t){var n=C.get.userValues();n&&(C.debug("Adding user labels",n),e.each(n,(function(e,t){C.verbose("Adding custom user value"),C.add.label(t,t)})))},menu:function(){U=e("
").addClass(S.menu).appendTo(j)},sizer:function(){P=e("").addClass(S.sizer).insertAfter(z)}},search:function(e){e=void 0!==e?e:C.get.query(),C.verbose("Searching for query",e),C.has.minCharacters(e)?C.filter(e):C.hide()},select:{firstUnfiltered:function(){C.verbose("Selecting first non-filtered element"),C.remove.selectedItem(),K.not(O.unselectable).not(O.addition+O.hidden).eq(0).addClass(S.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(O.item).not(O.unselectable).eq(0),n=e.prevAll(O.item).not(O.unselectable).eq(0);t.length>0?(C.verbose("Moving selection to",t),t.addClass(S.selected)):(C.verbose("Moving selection to",n),n.addClass(S.selected))}},aria:{setup:function(){"menu"===C.aria.guessRole()&&(j.attr("aria-busy","true"),j.attr("role","menu"),j.attr("aria-haspopup","menu"),j.attr("aria-expanded","false"),U.find(".divider").attr("role","separator"),K.attr("role","menuitem"),K.each((function(e,t){t.id||(t.id=C.aria.nextID("menuitem"))})),N=j.find("> .text").eq(0),j.data("content")?(N.attr("aria-hidden"),j.attr("aria-label",j.data("content"))):(N.attr("id",C.aria.nextID("menutext")),j.attr("aria-labelledby",N.attr("id"))),j.attr("aria-busy","false"))},nextID:function(e){var t;do{t=e+"_"+m++}while(n.getElementById(t));return t},setExpanded:function(e){j.attr("aria-haspopup")&&j.attr("aria-expanded",e)},refreshDescendant:function(){if("menu"===j.attr("aria-haspopup")){var e=K.not(O.unselectable).filter("."+S.selected).eq(0),t=U.children("."+S.active).eq(0),n=e.length>0?e:t;n?j.attr("aria-activedescendant",n.attr("id")):C.aria.removeDescendant()}},removeDescendant:function(){"menu"==j.attr("aria-haspopup")&&j.removeAttr("aria-activedescendant")},guessRole:function(){var e=j.hasClass("icon"),t=C.has.search(),n=V.length>0,i=C.is.multiple();return e||t||n||i?"unknown":"menu"}},setup:{api:function(){var e={debug:k.debug,urlData:{value:C.get.value(),query:C.get.query()},on:!1};C.verbose("First request, initializing API"),j.api(e)},layout:function(){j.is("select")&&(C.setup.select(),C.setup.returnedObject()),C.has.menu()||C.create.menu(),C.is.search()&&!C.has.search()&&(C.verbose("Adding search input"),z=e("").addClass(S.search).prop("autocomplete","off").insertBefore(N)),C.is.multiple()&&C.is.searchSelection()&&!C.has.sizer()&&C.create.sizer(),k.allowTab&&C.set.tabbable(),K.attr("tabindex","-1")},select:function(){var t=C.get.selectValues();C.debug("Dropdown initialized on a select",t),j.is("select")&&(V=j),V.parent(O.dropdown).length>0?(C.debug("UI dropdown already exists. Creating dropdown menu only"),j=V.closest(O.dropdown),C.has.menu()||C.create.menu(),U=j.children(O.menu),C.setup.menu(t)):(C.debug("Creating entire dropdown from select"),j=e("
").attr("class",V.attr("class")).addClass(S.selection).addClass(S.dropdown).html(R.dropdown(t)).insertBefore(V),V.hasClass(S.multiple)&&!1===V.prop("multiple")&&(C.error(I.missingMultiple),V.prop("multiple",!0)),V.is("[multiple]")&&C.set.multiple(),V.prop("disabled")&&(C.debug("Disabling dropdown"),j.addClass(S.disabled)),V.removeAttr("class").detach().prependTo(j)),C.refresh()},menu:function(e){U.html(R.menu(e,T)),K=U.find(O.item)},reference:function(){C.debug("Dropdown behavior was called on select, replacing with closest dropdown"),j=j.parent(O.dropdown),G=j.data(F),X=j.get(0),C.refresh(),C.setup.returnedObject()},returnedObject:function(){var e=o.slice(0,p),t=o.slice(p+1);o=e.add(j).add(t)}},refresh:function(){C.refreshSelectors(),C.refreshData()},refreshItems:function(){K=U.find(O.item)},refreshSelectors:function(){C.verbose("Refreshing selector cache"),N=j.find(O.text),z=j.find(O.search),V=j.find(O.input),B=j.find(O.icon),H=j.prev().find(O.text).length>0?j.prev().find(O.text):j.prev(),U=j.children(O.menu),K=U.find(O.item)},refreshData:function(){C.verbose("Refreshing cached metadata"),K.removeData(L.text).removeData(L.value)},clearData:function(){C.verbose("Clearing metadata"),K.removeData(L.text).removeData(L.value),j.removeData(L.defaultText).removeData(L.defaultValue).removeData(L.placeholderText)},toggle:function(){C.verbose("Toggling menu visibility"),C.is.active()?C.hide():C.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},!C.can.show()&&C.is.remote()&&(C.debug("No API results retrieved, searching before show"),C.queryRemote(C.get.query(),C.show)),C.can.show()&&!C.is.active()){if(C.debug("Showing dropdown"),!C.has.message()||C.has.maxSelections()||C.has.allResultsFiltered()||C.remove.message(),C.is.allFiltered())return!0;!1!==k.onShow.call(X)&&(C.aria.setExpanded(!0),C.aria.refreshDescendant(),C.animate.show((function(){C.can.click()&&C.bind.intent(),C.has.menuSearch()&&C.focusSearch(),C.set.visible(),t.call(X)})))}},hide:function(t){t=e.isFunction(t)?t:function(){},C.is.active()&&!C.is.animatingOutward()&&(C.debug("Hiding dropdown"),!1!==k.onHide.call(X)&&(C.aria.setExpanded(!1),C.aria.removeDescendant(),C.animate.hide((function(){C.remove.visible(),t.call(X)}))))},hideOthers:function(){C.verbose("Finding other dropdowns to hide"),o.not(j).has(O.menu+"."+S.visible).dropdown("hide")},hideMenu:function(){C.verbose("Hiding menu instantaneously"),C.remove.active(),C.remove.visible(),U.transition("hide")},hideSubMenus:function(){var e=U.children(O.item).find(O.menu);C.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){c&&C.bind.touchEvents(),C.bind.keyboardEvents(),C.bind.inputEvents(),C.bind.mouseEvents()},touchEvents:function(){C.debug("Touch device detected binding additional touch events"),C.is.searchSelection()||C.is.single()&&j.on("touchstart"+E,C.event.test.toggle),U.on("touchstart"+E,O.item,C.event.item.mouseenter)},keyboardEvents:function(){C.verbose("Binding keyboard events"),j.on("keydown"+E,C.event.keydown),C.has.search()&&j.on(C.get.inputEvent()+E,O.search,C.event.input),C.is.multiple()&&r.on("keydown"+$,C.event.document.keydown)},inputEvents:function(){C.verbose("Binding input change events"),j.on("change"+E,O.input,C.event.change)},mouseEvents:function(){C.verbose("Binding mouse events"),C.is.multiple()&&j.on("click"+E,O.label,C.event.label.click).on("click"+E,O.remove,C.event.remove.click),C.is.searchSelection()?(j.on("mousedown"+E,C.event.mousedown).on("mouseup"+E,C.event.mouseup).on("mousedown"+E,O.menu,C.event.menu.mousedown).on("mouseup"+E,O.menu,C.event.menu.mouseup).on("click"+E,O.icon,C.event.icon.click).on("focus"+E,O.search,C.event.search.focus).on("click"+E,O.search,C.event.search.focus).on("blur"+E,O.search,C.event.search.blur).on("click"+E,O.text,C.event.text.focus),C.is.multiple()&&j.on("click"+E,C.event.click)):("click"==k.on?j.on("click"+E,O.icon,C.event.icon.click).on("click"+E,C.event.test.toggle):"hover"==k.on?j.on("mouseenter"+E,C.delay.show).on("mouseleave"+E,C.delay.hide):j.on(k.on+E,C.toggle),j.on("mousedown"+E,C.event.mousedown).on("mouseup"+E,C.event.mouseup).on("focus"+E,C.event.focus),C.has.menuSearch()?j.on("blur"+E,O.search,C.event.search.blur):j.on("blur"+E,C.event.blur)),U.on("mouseenter"+E,O.item,C.event.item.mouseenter).on("mouseleave"+E,O.item,C.event.item.mouseleave).on("click"+E,O.item,C.event.item.click)},intent:function(){C.verbose("Binding hide intent event to document"),c&&r.on("touchstart"+$,C.event.test.touch).on("touchmove"+$,C.event.test.touch),r.on("click"+$,C.event.test.hide)}},unbind:{intent:function(){C.verbose("Removing hide intent event from document"),c&&r.off("touchstart"+$).off("touchmove"+$),r.off("click"+$)}},filter:function(e){var t=void 0!==e?e:C.get.query(),n=function(){C.is.multiple()&&C.filterActive(),(e||!e&&0==C.get.activeItem().length)&&C.select.firstUnfiltered(),C.has.allResultsFiltered()?k.onNoResults.call(X,t)?k.allowAdditions?k.hideAdditions&&(C.verbose("User addition with no menu, setting empty style"),C.set.empty(),C.hideMenu()):(C.verbose("All items filtered, showing message",t),C.add.message(_.noResults)):(C.verbose("All items filtered, hiding dropdown",t),C.hideMenu()):(C.remove.empty(),C.remove.message()),k.allowAdditions&&C.add.userSuggestion(e),C.is.searchSelection()&&C.can.show()&&C.is.focusedOnSearch()&&C.show()};k.useLabels&&C.has.maxSelections()||(k.apiSettings?C.can.useAPI()?C.queryRemote(t,(function(){k.filterRemoteData&&C.filterItems(t),n()})):C.error(I.noAPI):(C.filterItems(t),n()))},queryRemote:function(t,n){var i={errorDuration:!1,cache:"local",throttle:k.throttle,urlData:{query:t},onError:function(){C.add.message(_.serverError),n()},onFailure:function(){C.add.message(_.serverError),n()},onSuccess:function(e){C.remove.message(),C.setup.menu({values:e[T.remoteValues]}),n()}};j.api("get request")||C.setup.api(),i=e.extend(!0,{},i,k.apiSettings),j.api("setting",i).api("query")},filterItems:function(t){var n=void 0!==t?t:C.get.query(),i=null,a=C.escape.string(n),o=new RegExp("^"+a,"igm");C.has.query()&&(i=[],C.verbose("Searching for matching values",n),K.each((function(){var t,a,r=e(this);if("both"==k.match||"text"==k.match){if(-1!==(t=String(C.get.choiceText(r,!1))).search(o))return i.push(this),!0;if("exact"===k.fullTextSearch&&C.exactSearch(n,t))return i.push(this),!0;if(!0===k.fullTextSearch&&C.fuzzySearch(n,t))return i.push(this),!0}if("both"==k.match||"value"==k.match){if(-1!==(a=String(C.get.choiceValue(r,t))).search(o))return i.push(this),!0;if("exact"===k.fullTextSearch&&C.exactSearch(n,a))return i.push(this),!0;if(!0===k.fullTextSearch&&C.fuzzySearch(n,a))return i.push(this),!0}}))),C.debug("Showing only matched items",n),C.remove.filteredItem(),i&&K.not(i).addClass(S.filtered)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var a=0,o=0;a-1},filterActive:function(){k.useLabels&&K.filter("."+S.active).addClass(S.filtered)},focusSearch:function(e){C.has.search()&&!C.is.focusedOnSearch()&&(e?(j.off("focus"+E,O.search),z.focus(),j.on("focus"+E,O.search,C.event.search.focus)):z.focus())},forceSelection:function(){var e=K.not(S.filtered).filter("."+S.selected).eq(0),t=K.not(S.filtered).filter("."+S.active).eq(0),n=e.length>0?e:t;if(n.length>0&&!C.is.multiple())return C.debug("Forcing partial selection to selected item",n),void C.event.item.click.call(n,{},!0);k.allowAdditions?(C.set.selected(C.get.query()),C.remove.searchTerm()):C.remove.searchTerm()},change:{values:function(t){k.allowAdditions||C.clear(),C.debug("Creating dropdown with specified values",t),C.setup.menu({values:t}),e.each(t,(function(e,t){if(1==t.selected)return C.debug("Setting initial selection to",t.value),C.set.selected(t.value),!0}))}},event:{change:function(){Q||(C.debug("Input changed, updating selection"),C.set.selected())},focus:function(){k.showOnFocus&&!W&&C.is.hidden()&&!g&&C.show()},blur:function(e){g=n.activeElement===this,W||g||(C.remove.activeLabel(),C.hide())},mousedown:function(){C.is.searchSelection()?b=!0:W=!0},mouseup:function(){C.is.searchSelection()?b=!1:W=!1},click:function(t){e(t.target).is(j)&&(C.is.focusedOnSearch()?C.show():C.focusSearch())},search:{focus:function(){W=!0,C.is.multiple()&&C.remove.activeLabel(),k.showOnFocus&&C.search()},blur:function(e){g=n.activeElement===this,C.is.searchSelection()&&!b&&(J||g||(k.forceSelection&&C.forceSelection(),C.hide())),b=!1}},icon:{click:function(e){C.toggle()}},text:{focus:function(e){W=!0,C.focusSearch()}},input:function(e){(C.is.multiple()||C.is.searchSelection())&&C.set.filtered(),clearTimeout(C.timer),C.timer=setTimeout(C.search,k.delay.search)},label:{click:function(t){var n=e(this),i=j.find(O.label),a=i.filter("."+S.active),o=n.nextAll("."+S.active),r=n.prevAll("."+S.active),s=o.length>0?n.nextUntil(o).add(a).add(n):n.prevUntil(r).add(a).add(n);t.shiftKey?(a.removeClass(S.active),s.addClass(S.active)):t.ctrlKey?n.toggleClass(S.active):(a.removeClass(S.active),n.addClass(S.active)),k.onLabelSelect.apply(this,i.filter("."+S.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(S.active)?C.remove.activeLabels():C.remove.activeLabels(t)}},test:{toggle:function(e){var t=C.is.multiple()?C.show:C.toggle;C.is.bubbledLabelClick(e)||C.is.bubbledIconClick(e)||C.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){C.determine.eventOnElement(e,(function(){"touchstart"==e.type?C.timer=setTimeout((function(){C.hide()}),k.delay.touch):"touchmove"==e.type&&clearTimeout(C.timer)})),e.stopPropagation()},hide:function(e){C.determine.eventInModule(e,C.hide)}},select:{mutation:function(t){C.debug(" removing selected option",e),i=C.remove.arrayValue(e,a),C.remove.optionValue(e)):(C.verbose("Removing from delimited values",e),i=(i=C.remove.arrayValue(e,a)).join(k.delimiter)),!1===k.fireOnInit&&C.is.initialLoad()?C.verbose("No callback on initial load",k.onRemove):k.onRemove.call(X,e,t,n),C.set.value(i,t,n),C.check.maxSelections()},arrayValue:function(t,n){return e.isArray(n)||(n=[n]),n=e.grep(n,(function(e){return t!=e})),C.verbose("Removed value from delimited string",t,n),n},label:function(e,t){var n=j.find(O.label).filter("[data-"+L.value+'="'+C.escape.string(e)+'"]');C.verbose("Removing label",n),n.remove()},activeLabels:function(e){e=e||j.find(O.label).filter("."+S.active),C.verbose("Removing active label selections",e),C.remove.labels(e)},labels:function(t){t=t||j.find(O.label),C.verbose("Removing labels",t),t.each((function(){var t=e(this),n=t.data(L.value),i=void 0!==n?String(n):n,a=C.is.userValue(i);!1!==k.onLabelRemove.call(t,n)?(C.remove.message(),a?(C.remove.value(i),C.remove.label(i)):C.remove.selected(i)):C.debug("Label remove callback cancelled removal")}))},tabbable:function(){C.is.searchSelection()?(C.debug("Searchable dropdown initialized"),z.removeAttr("tabindex"),U.removeAttr("tabindex")):(C.debug("Simple selection dropdown initialized"),j.removeAttr("tabindex"),U.removeAttr("tabindex"))}},has:{menuSearch:function(){return C.has.search()&&z.closest(U).length>0},search:function(){return z.length>0},sizer:function(){return P.length>0},selectInput:function(){return V.is("select")},minCharacters:function(e){return!k.minCharacters||(e=String(void 0!==e?e:C.get.query())).length>=k.minCharacters},firstLetter:function(e,t){var n,i;return!(!e||0===e.length||"string"!=typeof t)&&(n=C.get.choiceText(e,!1),t=t.toLowerCase(),i=String(n).charAt(0).toLowerCase(),t==i)},input:function(){return V.length>0},items:function(){return K.length>0},menu:function(){return U.length>0},message:function(){return 0!==U.children(O.message).length},label:function(e){var t=C.escape.value(e),n=j.find(O.label);return k.ignoreCase&&(t=t.toLowerCase()),n.filter("[data-"+L.value+'="'+C.escape.string(t)+'"]').length>0},maxSelections:function(){return k.maxSelections&&C.get.selectionCount()>=k.maxSelections},allResultsFiltered:function(){var e=K.not(O.addition);return e.filter(O.unselectable).length===e.length},userSuggestion:function(){return U.children(O.addition).length>0},query:function(){return""!==C.get.query()},value:function(e){return k.ignoreCase?C.has.valueIgnoringCase(e):C.has.valueMatchingCase(e)},valueMatchingCase:function(t){var n=C.get.values();return!!(e.isArray(n)?n&&-1!==e.inArray(t,n):n==t)},valueIgnoringCase:function(t){var n=C.get.values(),i=!1;return e.isArray(n)||(n=[n]),e.each(n,(function(e,n){if(String(t).toLowerCase()==String(n).toLowerCase())return i=!0,!1})),i}},is:{active:function(){return j.hasClass(S.active)},animatingInward:function(){return U.transition("is inward")},animatingOutward:function(){return U.transition("is outward")},bubbledLabelClick:function(t){return e(t.target).is("select, input")&&j.closest("label").length>0},bubbledIconClick:function(t){return e(t.target).closest(B).length>0},alreadySetup:function(){return j.is("select")&&void 0!==j.parent(O.dropdown).data(F)&&0===j.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):U.transition&&U.transition("is animating")},leftward:function(e){return(e||U).hasClass(S.leftward)},disabled:function(){return j.hasClass(S.disabled)},focused:function(){return n.activeElement===j[0]},focusedOnSearch:function(){return n.activeElement===z[0]},allFiltered:function(){return(C.is.multiple()||C.has.search())&&!(0==k.hideAdditions&&C.has.userSuggestion())&&!C.has.message()&&C.has.allResultsFiltered()},hidden:function(e){return!C.is.visible(e)},initialLoad:function(){return v},inObject:function(t,n){var i=!1;return e.each(n,(function(e,n){if(n==t)return i=!0,!0})),i},multiple:function(){return j.hasClass(S.multiple)},remote:function(){return k.apiSettings&&C.can.useAPI()},single:function(){return!C.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,(function(t,i){if(i.target&&e(i.target).is("select"))return n=!0,!0})),n},search:function(){return j.hasClass(S.search)},searchSelection:function(){return C.has.search()&&1===z.parent(O.dropdown).length},selection:function(){return j.hasClass(S.selection)},userValue:function(t){return-1!==e.inArray(t,C.get.userValues())},upward:function(e){return(e||j).hasClass(S.upward)},visible:function(e){return e?e.hasClass(S.visible):U.hasClass(S.visible)},verticallyScrollableContext:function(){var e=M.get(0)!==t&&M.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=M.get(0)!==t&&M.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!k.useLabels||(!C.has.maxSelections()||!(!C.has.maxSelections()||!e.hasClass(S.active)))},openDownward:function(e){var n,i,a=e||U,o=!0;return a.addClass(S.loading),i={context:{offset:M.get(0)===t?{top:0,left:0}:M.offset(),scrollTop:M.scrollTop(),height:M.outerHeight()},menu:{offset:a.offset(),height:a.outerHeight()}},C.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),(n={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(C.verbose("Dropdown can fit in context downward",n),o=!0):n.below||n.above?(C.verbose("Dropdown cannot fit below, opening upward",n),o=!1):(C.verbose("Dropdown cannot fit in either direction, favoring downward",n),o=!0),a.removeClass(S.loading),o},openRightward:function(e){var n,i,a=e||U,o=!0;return a.addClass(S.loading),i={context:{offset:M.get(0)===t?{top:0,left:0}:M.offset(),scrollLeft:M.scrollLeft(),width:M.outerWidth()},menu:{offset:a.offset(),width:a.outerWidth()}},C.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(n=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(C.verbose("Dropdown cannot fit in context rightward",n),o=!1),a.removeClass(S.loading),o},click:function(){return c||"click"==k.on},extendSelect:function(){return k.allowAdditions||k.apiSettings},show:function(){return!C.is.disabled()&&(C.has.items()||C.has.message())},useAPI:function(){return void 0!==e.fn.api}},animate:{show:function(t,n){var i,a=n||U,o=n?function(){}:function(){C.hideSubMenus(),C.hideOthers(),C.set.active()};t=e.isFunction(t)?t:function(){},C.verbose("Doing menu show animation",a),C.set.direction(n),i=C.get.transition(n),C.is.selection()&&C.set.scrollPosition(C.get.selectedItem(),!0),(C.is.hidden(a)||C.is.animating(a))&&("none"==i?(o(),a.transition("show"),t.call(X)):void 0!==e.fn.transition&&j.transition("is supported")?a.transition({animation:i+" in",debug:k.debug,verbose:k.verbose,duration:k.duration,queue:!0,onStart:o,onComplete:function(){t.call(X)}}):C.error(I.noTransition,i))},hide:function(t,n){var i=n||U,a=(n?k.duration:k.duration,n?function(){}:function(){C.can.click()&&C.unbind.intent(),C.remove.active()}),o=C.get.transition(n);t=e.isFunction(t)?t:function(){},(C.is.visible(i)||C.is.animating(i))&&(C.verbose("Doing menu hide animation",i),"none"==o?(a(),i.transition("hide"),t.call(X)):void 0!==e.fn.transition&&j.transition("is supported")?i.transition({animation:o+" out",duration:k.duration,debug:k.debug,verbose:k.verbose,queue:!1,onStart:a,onComplete:function(){t.call(X)}}):C.error(I.transition))}},hideAndClear:function(){C.remove.searchTerm(),C.has.maxSelections()||(C.has.search()?C.hide((function(){C.remove.filteredItem()})):C.hide())},delay:{show:function(){C.verbose("Delaying show event to ensure user intent"),clearTimeout(C.timer),C.timer=setTimeout(C.show,k.delay.show)},hide:function(){C.verbose("Delaying hide event to ensure user intent"),clearTimeout(C.timer),C.timer=setTimeout(C.hide,k.delay.hide)}},escape:{value:function(t){var n=e.isArray(t),i="string"==typeof t,a=!i&&!n,o=i&&-1!==t.search(D.quote),r=[];return a||!o?t:(C.debug("Encoding quote values for use in select",t),n?(e.each(t,(function(e,t){r.push(t.replace(D.quote,"""))})),r):t.replace(D.quote,"""))},string:function(e){return(e=String(e)).replace(D.escape,"\\$&")}},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,k,t);else{if(void 0===n)return k[t];e.isPlainObject(k[t])?e.extend(!0,k[t],n):k[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(void 0===n)return C[t];C[t]=n}},debug:function(){!k.silent&&k.debug&&(k.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,k.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),C.verbose.apply(console,arguments)))},error:function(){k.silent||(C.error=Function.prototype.bind.call(console.error,console,k.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n;k.performance&&(n=(t=(new Date).getTime())-(l||t),l=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:X,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=k.name+":",n=0;l=!1,clearTimeout(C.performance.timer),e.each(d,(function(e,t){n+=t["Execution Time"]})),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(void 0!==console.group||void 0!==console.table)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,(function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")})),console.groupEnd()),d=[]}},invoke:function(t,n,i){var o,r,s,c=G;return n=n||f,i=X||i,"string"==typeof t&&void 0!==c&&(t=t.split(/[\. ]/),o=t.length-1,e.each(t,(function(n,i){var a=n!=o?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=o)c=c[a];else{if(void 0!==c[a])return r=c[a],!1;if(!e.isPlainObject(c[i])||n==o)return void 0!==c[i]?(r=c[i],!1):(C.error(I.method,t),!1);c=c[i]}}))),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),e.isArray(a)?a.push(s):void 0!==a?a=[a,s]:void 0!==s&&(a=s),r}},h?(void 0===G&&C.initialize(),C.invoke(u)):(void 0!==G&&G.invoke("destroy"),C.initialize())})),void 0!==a?a:o},e.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term}",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"')).val(t.uuid);c.append(n)})),this.on("removedfile",(function(e){e.name in l&&($("#".concat(l[e.name].uuid)).remove(),r.data("remove-url")&&r.data("csrf")&&!l[e.name].submitted&&$.post(r.data("remove-url"),{file:l[e.name].uuid,_csrf:r.data("csrf")}))})),this.on("submit",(function(){$.each(l,(function(e){l[e].submitted=!0}))})),this.on("reload",(function(){$.getJSON(i.data("attachment-url"),(function(e){var t=r.get(0).dropzone;t.removeAllFiles(!0),c.empty(),$.each(e,(function(){var e="".concat(r.data("upload-url"),"/").concat(this.uuid);t.emit("addedfile",this),t.emit("thumbnail",this,e),t.emit("complete",this),t.files.push(this),l[this.name]={submitted:!0,uuid:this.uuid},r.find("img[src='".concat(e,"']")).css("max-width","100%");var n=$('')).val(this.uuid);c.append(n)}))}))}))}}),r.get(0).dropzone.emit("reload")}var d=i.find(".ui.comment.form"),u=d.find(".tabular.menu");u.attr("data-write",i.data("write")),u.attr("data-preview",i.data("preview")),u.find(".write.item").attr("data-tab",i.data("write")),u.find(".preview.item").attr("data-tab",i.data("preview")),d.find(".write.segment").attr("data-tab",i.data("write")),d.find(".preview.segment").attr("data-tab",i.data("preview")),f(d),i.find(".cancel.button").click((function(){a.show(),i.hide(),r.get(0).dropzone.emit("reload")})),i.find(".save.button").click((function(){a.show(),i.hide();var e=c.find("[name=files]").map((function(){return $(this).val()})).get();$.post(i.data("update-url"),{_csrf:s,content:t.val(),context:i.data("context"),files:e},(function(e){0===e.length?a.html($("#no-content").html()):(a.html(e.content),emojify.run(a[0]),$("pre code",a[0]).each((function(){hljs.highlightBlock(this)})));var t=n.parent();t.find(".ui.small.images").length?""===e.attachments?t.find(".ui.small.images").parent().remove():t.find(".ui.small.images").html(e.attachments):""!==e.attachments&&(t.append('
'),t.find(".ui.small.images").html(e.attachments)),r.get(0).dropzone.emit("submit"),r.get(0).dropzone.emit("reload")}))}))}else t=n.find("textarea");i.show(),a.hide(),0===t.val().length&&t.val(o.text()),t.focus(),e.preventDefault()})),$(".delete-comment").click((function(){var e=$(this);return window.confirm(e.data("locale"))&&$.post(e.data("url"),{_csrf:s}).success((function(){$("#".concat(e.data("comment-id"))).remove()})),!1}));var o=$("#status-button");$("#comment-form .edit_area").keyup((function(){0===$(this).val().length?o.text(o.data("status")):o.text(o.data("status-and-comment"))})),o.click((function(){$("#status").val(o.data("status-val")),$("#comment-form").submit()}));var r=$(".merge-button > button");r.on("click",(function(e){e.preventDefault(),$(".".concat($(this).data("do"),"-fields")).show(),$(this).parent().hide()})),$(".merge-button > .dropdown").dropdown({onChange:function(e,t,n){n.data("do")&&(r.find(".button-text").text(n.text()),r.data("do",n.data("do")))}}),$(".merge-cancel").on("click",(function(e){e.preventDefault(),$(this).closest(".form").hide(),r.parent().show()})),function e(t){var n="";t||(t=$(document),n=".reactions > "),t.find("".concat(n,"a.label")).popup({position:"bottom left",metadata:{content:"title",title:"none"}}),t.find(".select-reaction > .menu > .item, ".concat(n,"a.label")).on("click",(function(t){var n=this;if(t.preventDefault(),!$(this).hasClass("disabled")){var i=$(this).hasClass("item")?$(this).closest(".select-reaction").data("action-url"):$(this).data("action-url"),a="".concat(i,"/").concat($(this).hasClass("blue")?"unreact":"react");$.ajax({type:"POST",url:a,data:{_csrf:s,content:$(this).data("content")}}).done((function(t){if(t&&(t.html||t.empty)){var i=$(n).closest(".content"),a=i.find(".segment.reactions");if(!t.empty&&a.length>0&&a.remove(),!t.empty){a=$('
');var o=i.find(".segment.bottom:first");o.length>0?a.insertBefore(o):a.appendTo(i),a.html(t.html);for(var r=a.find(".has-emoji"),s=0;s0&&$(".diff-counter").each((function(){var e=$(this),t=e.find("span[data-line].add").data("line"),n=e.find("span[data-line].del").data("line"),i=parseFloat(t)/(parseFloat(t)+parseFloat(n))*100;e.find(".bar .add").css("width","".concat(i,"%"))})),$("#repo-clone-ssh").click((function(){$(".clone-url").text($(this).data("link")),$("#repo-clone-url").val($(this).data("link")),$(this).addClass("blue"),$("#repo-clone-https").removeClass("blue"),localStorage.setItem("repo-clone-protocol","ssh")})),$("#repo-clone-https").click((function(){$(".clone-url").text($(this).data("link")),$("#repo-clone-url").val($(this).data("link")),$(this).addClass("blue"),$("#repo-clone-ssh").removeClass("blue"),localStorage.setItem("repo-clone-protocol","https")})),$("#repo-clone-url").click((function(){$(this).select()}));var c=$(".repository.compare.pull");c.length>0&&(l(".choose.branch .dropdown"),c.find("button.show-form").on("click",(function(e){e.preventDefault(),c.find(".pullrequest-form").show(),$(this).parent().hide()}))),$(".repository.settings.branches").length>0&&(l(".protected-branches .dropdown"),$(".enable-protection, .enable-whitelist").change((function(){this.checked?$($(this).data("target")).removeClass("disabled"):$($(this).data("target")).addClass("disabled")})),$(".disable-whitelist").change((function(){this.checked&&$($(this).data("target")).addClass("disabled")})))}function l(e){var t=$(e);t.dropdown({fullTextSearch:!0,selectOnKeydown:!1,onChange:function(e,t,n){n.data("url")&&(window.location.href=n.data("url"))},message:{noResults:t.data("no-results")}})}}function y(e){var t=Math.floor(Math.random()*Math.floor(1e6));return e.attr("data-write",e.attr("data-write")+t),e.attr("data-preview",e.attr("data-preview")+t),e.find(".item").each((function(){var e=$(this).attr("data-tab")+t;$(this).attr("data-tab",e)})),e.parent().find("*[data-tab='write']").attr("data-tab","write".concat(t)),e.parent().find("*[data-tab='preview']").attr("data-tab","preview".concat(t)),f(e.parent(".form")),t}function x(){$(".access-mode.menu .item").click((function(){var e=$(this).parent();$.post(e.data("url"),{_csrf:s,uid:e.data("uid"),mode:$(this).data("value")})}))}function C(){$(".js-quick-pull-choice-option").change((function(){"commit-to-new-branch"===$(this).val()?($(".quick-pull-branch-name").show(),$(".quick-pull-branch-name input").prop("required",!0)):($(".quick-pull-branch-name").hide(),$(".quick-pull-branch-name input").prop("required",!1)),$("#commit-button").text($(this).attr("button_text"))}));var e=$("#file-name");e.keyup((function(e){var t,n,i=$(".breadcrumb span.section"),a=$(".breadcrumb div.divider");if(8===e.keyCode&&0===$(this).getCursorPosition()&&i.length>0&&(t=i.last().find("a").text(),$(this).val(t+$(this).val()),$(this)[0].setSelectionRange(t.length,t.length),i.last().remove(),a.last().remove()),191===e.keyCode){n=$(this).val().split("/");for(var o=0;o'.concat(t,"")).insertBefore($(this)),$('
/
').insertBefore($(this))):$(this).val(t),$(this)[0].setSelectionRange(0,0)}n=[],$(".breadcrumb span.section").each((function(){var e=$(this);e.find("a").length?n.push(e.find("a").text()):n.push(e.text())})),$(this).val()&&n.push($(this).val()),$("#tree_path").val(n.join("/"))})).trigger("keyup");var t=$(".repository.editor textarea#edit_area");if(t.length){var n=t.data("markdown-file-exts").split(","),i=t.data("line-wrap-extensions").split(",");e.on("keyup",(function(){var a,o,r,c,h,f,m=e.val();r=c="";var p=/.+\.([^.]+)$/.exec(m);p&&(r=p[1],c=".".concat(r));var v=CodeMirror.findModeByExtension(r),g=$("a[data-tab=preview]");if(v?(a=v.mode,o=v.mime,f=a):f=r,g.length&&f&&l&&l.length&&l.indexOf(f)>=0?(h=g.data("url"),g.data("url",h.replace(/(.*)\/.*/i,"$1/".concat(a))),g.show()):g.hide(),!(n.indexOf(c)>=0&&function(e){return u&&(u.toTextArea(),u=null),!!d||(d=new SimpleMDE({autoDownloadFontAwesome:!1,element:e[0],forceSync:!0,renderingConfig:{singleLineBreaks:!1},indentWithTabs:!1,tabSize:4,spellChecker:!1,previewRender:function(t,n){return setTimeout((function(){$.post(e.data("url"),{_csrf:s,mode:"gfm",context:e.data("context"),text:t},(function(e){n.innerHTML='
'.concat(e,"
"),emojify.run($(".editor-preview")[0])}))}),0),"Loading..."},toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|","code","quote","|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","clean-block","preview","fullscreen","side-by-side"]}),!0)}(t))&&(u||function(e){return d&&(d.toTextArea(),d=null),!!u||((u=CodeMirror.fromTextArea(e[0],{lineNumbers:!0})).on("change",(function(t,n){e.val(t.getValue())})),!0)}(t))){a&&(u.setOption("mode",o),CodeMirror.autoLoadMode(u,a)),i.indexOf(c)>=0?u.setOption("lineWrapping",!0):u.setOption("lineWrapping",!1);var b=e.val();0!==b.length&&(b=(b=b.split("/"))[b.length-1],$.getJSON(e.data("ec-url-prefix")+b,(function(e){"tab"===e.indent_style?(u.setOption("indentWithTabs",!0),u.setOption("extraKeys",{})):(u.setOption("indentWithTabs",!1),u.setOption("extraKeys",{Tab:function(e){var t=Array(parseInt(e.getOption("indentUnit"))+1).join(" ");e.replaceSelection(t)}})),u.setOption("indentUnit",e.indent_size||4),u.setOption("tabSize",e.tab_width||4)})))}})).trigger("keyup");var a=$("#commit-button"),o=$(".ui.edit.form");a.prop("disabled",!0),o.areYouSure({silent:!0,dirtyClass:"dirty-file",fieldSelector:":input:not(.commit-form-wrapper :input)",change:function(){var e=$(this).hasClass("dirty-file");a.prop("disabled",!e)}}),a.click((function(e){0===t.val().length&&($("#edit-empty-content-modal").modal({onApprove:function(){$(".edit.form").submit()}}).modal("show"),e.preventDefault())}))}}function k(){$(".user.settings.profile").length>0&&$("#username").keyup((function(){var e=$("#name-change-prompt");$(this).val().toString().toLowerCase()!==$(this).data("name").toString().toLowerCase()?e.show():e.hide()}))}function S(){$(".ui.button").keypress((function(e){13!==e.keyCode&&32!==e.keyCode||$(this).click()}))}function _(){$(".code-view .linenums").length>0&&($(document).on("click",".lines-num span",(function(e){var t=$(this),n=t.parent().siblings(".lines-code").find("ol.linenums > li");O(n,n.filter("[rel=".concat(t.attr("id"),"]")),e.shiftKey?n.filter(".active").eq(0):null),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()})),$(window).on("hashchange",(function(){var e,t=window.location.hash.match(/^#(L\d+)-(L\d+)$/),n=$(".code-view ol.linenums > li");if(t)return e=n.filter(".".concat(t[1])),O(n,e,n.filter(".".concat(t[2]))),void $("html, body").scrollTop(e.offset().top-200);(t=window.location.hash.match(/^#(L|n)(\d+)$/))&&(e=n.filter(".L".concat(t[2])),O(n,e),$("html, body").scrollTop(e.offset().top-200))})).trigger("hashchange")),$(".ui.fold-code").on("click",(function(e){var t=$(e.target);t.hasClass("fa-chevron-down")?$(e.target).parent().next().slideUp("fast",(function(){t.removeClass("fa-chevron-down").addClass("fa-chevron-right")})):$(e.target).parent().next().slideDown("fast",(function(){t.removeClass("fa-chevron-right").addClass("fa-chevron-down")}))})),$(".ui.blob-excerpt").on("click",(function(e){!function e(t){var n=$(t.target),i=n.parent().parent();$.get("".concat(n.data("url"),"?").concat(n.data("query"),"&anchor=").concat(n.data("anchor")),(function(t){i.replaceWith(t),$('[data-anchor="'.concat(n.data("anchor"),'"]')).on("click",(function(t){e(t)}))}))}(e)}))}function T(e){$.ajax({url:"".concat(c,"/user/u2f/sign"),type:"POST",headers:{"X-Csrf-Token":s},data:JSON.stringify(e),contentType:"application/json; charset=utf-8"}).done((function(e){window.location.replace(e)})).fail((function(){L(1)}))}function A(e){(function(e){if(!("errorCode"in e))return!1;if(0===e.errorCode)return!1;return L(e.errorCode),!0})(e)||$.ajax({url:"".concat(c,"/user/settings/security/u2f/register"),type:"POST",headers:{"X-Csrf-Token":s},data:JSON.stringify(e),contentType:"application/json; charset=utf-8",success:function(){v()},fail:function(){L(1)}})}function L(e){var t={browser:$("#unsupported-browser"),1:$("#u2f-error-1"),2:$("#u2f-error-2"),3:$("#u2f-error-3"),4:$("#u2f-error-4"),5:$(".u2f-error-5")};t[e].removeClass("hide"),Object.keys(t).forEach((function(n){n!==e&&t[n].addClass("hide")})),$("#u2f-error").modal("show")}function q(){$.post("".concat(c,"/user/settings/security/u2f/request_register"),{_csrf:s,name:$("#nickname").val()}).success((function(e){$("#nickname").closest("div.field").removeClass("error"),$("#register-device").modal("show"),null===e.registeredKeys&&(e.registeredKeys=[]),u2fApi.register(e.appId,e.registerRequests,e.registeredKeys,30).then(A).catch((function(e){L(void 0!==e?e.metaData.code:1)}))})).fail((function(e){409===e.status&&$("#nickname").closest("div.field").addClass("error")}))}function D(e){window.history.pushState?window.history.pushState(null,null,e):window.location.hash=e}function O(e,t,n){if(e.removeClass("active"),n){var i,a=parseInt(t.attr("rel").substr(1)),o=parseInt(n.attr("rel").substr(1));if(a!==o){a>o&&(i=a,a=o,o=i);for(var r=[],s=a;s<=o;s++)r.push(".L".concat(s));return e.filter(r.join(",")).addClass("active"),void D("#L".concat(a,"-L").concat(o))}}t.addClass("active"),D("#".concat(t.attr("rel")))}function I(){var e=$(this),t="";e.attr("id")&&(t+="#".concat(e.attr("id")));var n=$(".delete.modal".concat(t));return n.find(".name").text(e.data("name")),n.modal({closable:!1,onApprove:function(){"form"!==e.data("type")?$.post(e.data("url"),{_csrf:s,id:e.data("id")}).done((function(e){window.location.href=e.redirect})):$(e.data("form")).submit()}}).modal("show"),!1}function R(){var e=$(this),t="";e.attr("id")&&(t+="#".concat(e.attr("id")));var n=$(".addall.modal".concat(t));return n.find(".name").text(e.data("name")),n.modal({closable:!1,onApprove:function(){"form"!==e.data("type")?$.post(e.data("url"),{_csrf:s,id:e.data("id")}).done((function(e){window.location.href=e.redirect})):$(e.data("form")).submit()}}).modal("show"),!1}"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1),$.fn.getCursorPosition=function(){var e=$(this).get(0),t=0;if("selectionStart"in e)t=e.selectionStart;else if("selection"in document){e.focus();var n=document.selection.createRange(),i=document.selection.createRange().text.length;n.moveStart("character",-e.value.length),t=n.text.length-i}return t},$(document).ready((function(){if(s=$("meta[name=_csrf]").attr("content"),c=$("meta[name=_suburl]").attr("content"),$(".time-since").each((function(){$(this).addClass("poping up").attr("data-content",$(this).attr("title")).attr("data-variation","inverted tiny").attr("title","")})),$(".dropdown:not(.custom)").dropdown(),$(".jump.dropdown").dropdown({action:"hide",onShow:function(){$(".poping.up").popup("hide")}}),$(".slide.up.dropdown").dropdown({transition:"slide up"}),$(".upward.dropdown").dropdown({direction:"upward"}),$(".ui.accordion").accordion(),$(".ui.checkbox").checkbox(),$(".ui.progress").progress({showActivity:!1}),$(".poping.up").popup(),$(".top.menu .poping.up").popup({onShow:function(){if($(".top.menu .menu.transition").hasClass("visible"))return!1}}),$(".tabular.menu .item").tab(),$(".tabable.menu .item").tab(),$(".toggle.button").click((function(){$($(this).data("target")).slideToggle(100)})),$("tr[data-href]").click((function(){window.location=$(this).data("href")})),"undefined"!=typeof hljs)for(var e=[].slice.call(document.querySelectorAll("pre code")||[]),t=0;t0){var i={};new Dropzone("#dropzone",{url:n.data("upload-url"),headers:{"X-Csrf-Token":s},maxFiles:n.data("max-file"),maxFilesize:n.data("max-size"),acceptedFiles:"*/*"===n.data("accepts")?null:n.data("accepts"),addRemoveLinks:!0,dictDefaultMessage:n.data("default-message"),dictInvalidFileType:n.data("invalid-input-type"),dictFileTooBig:n.data("file-too-big"),dictRemoveFile:n.data("remove-file"),init:function(){this.on("success",(function(e,t){i[e.name]=t.uuid;var n=$('')).val(t.uuid);$(".files").append(n)})),this.on("removedfile",(function(e){e.name in i&&$("#".concat(i[e.name])).remove(),n.data("remove-url")&&n.data("csrf")&&$.post(n.data("remove-url"),{file:i[e.name],_csrf:n.data("csrf")})}))}})}emojify.setConfig({img_dir:"".concat(c,"/vendor/plugins/emojify/images"),ignore_emoticons:!0});for(var a=document.getElementsByClassName("has-emoji"),o=0;o0&&(i="".concat(n,"-").concat(e[n])),void 0===e[n]?e[n]=1:e[n]+=1,(t=t.wrap('
'))).append(''))}))})),$(".issue-checkbox").click((function(){$(".issue-checkbox").children("input:checked").length>0?($("#issue-filters").addClass("hide"),$("#issue-actions").removeClass("hide")):($("#issue-filters").removeClass("hide"),$("#issue-actions").addClass("hide"))})),$(".issue-action").click((function(){var e=this.dataset.action,t=this.dataset.elementId,n=$(".issue-checkbox").children("input:checked").map((function(){return this.dataset.issueId})).get().join(),i=this.dataset.url;"0"===t&&"/assignee"===i.substr(-9)&&(t="",e="clear"),p(i,e,n,t).then((function(){"close"!==e&&"open"!==e||$('.issue-checkbox input[type="checkbox"]').each((function(e,t){t.checked=!1})),v()}))})),$('.issue-checkbox input[type="checkbox"]:checked').first().each((function(e,t){t.checked=!1,$(t).click()})),S(),$("#search-user-box").search({minCharacters:2,apiSettings:{url:"".concat(c,"/api/v1/users/search?q={query}"),onResponse:function(e){var t=[];return $.each(e.data,(function(e,n){var i=n.login;n.full_name&&n.full_name.length>0&&(i+=" (".concat(h(n.full_name),")")),t.push({title:i,image:n.avatar_url})})),{results:t}}},searchFields:["login","full_name"],showNoResults:!1}),(l=$("#search-team-box")).search({minCharacters:2,apiSettings:{url:"".concat(c,"/api/v1/orgs/").concat(l.data("org"),"/teams/search?q={query}"),headers:{"X-Csrf-Token":s},onResponse:function(e){var t=[];return $.each(e.data,(function(e,n){var i="".concat(n.name," (").concat(n.permission," access)");t.push({title:i})})),{results:t}}},searchFields:["name","description"],showNoResults:!1}),(d=$("#search-repo-box")).search({minCharacters:2,apiSettings:{url:"".concat(c,"/api/v1/repos/search?q={query}&uid=").concat(d.data("uid")),onResponse:function(e){var t=[];return $.each(e.data,(function(e,n){t.push({title:n.full_name.split("/")[1],description:n.full_name})})),{results:t}}},searchFields:["full_name"],showNoResults:!1}),b(),0!==$(".install").length&&(""===$("#db_host").val()&&($("#db_host").val("127.0.0.1:3306"),$("#db_user").val("gitea"),$("#db_name").val("gitea")),$("#db_type").change((function(){var e=$(this).val();if("SQLite3"===e)return $("#sql_settings").hide(),$("#pgsql_settings").hide(),$("#mysql_settings").hide(),$("#sqlite_settings").show(),void("SQLite3"===e&&"data/gitea_tidb"===$("#db_path").val()&&$("#db_path").val("data/gitea.db"));var t={MySQL:"127.0.0.1:3306",PostgreSQL:"127.0.0.1:5432",MSSQL:"127.0.0.1:1433"};$("#sqlite_settings").hide(),$("#sql_settings").show(),$("#pgsql_settings").toggle("PostgreSQL"===e),$("#mysql_settings").toggle("MySQL"===e),$.each(t,(function(n,i){if($("#db_host").val()===i)return $("#db_host").val(t[e]),!1}))})),$("#offline-mode input").change((function(){$(this).is(":checked")&&($("#disable-gravatar").checkbox("check"),$("#federated-avatar-lookup").checkbox("uncheck"))})),$("#disable-gravatar input").change((function(){$(this).is(":checked")?$("#federated-avatar-lookup").checkbox("uncheck"):$("#offline-mode").checkbox("uncheck")})),$("#federated-avatar-lookup input").change((function(){$(this).is(":checked")&&($("#disable-gravatar").checkbox("uncheck"),$("#offline-mode").checkbox("uncheck"))})),$("#enable-openid-signin input").change((function(){$(this).is(":checked")?$("#disable-registration input").is(":checked")||$("#enable-openid-signup").checkbox("check"):$("#enable-openid-signup").checkbox("uncheck")})),$("#disable-registration input").change((function(){$(this).is(":checked")?($("#enable-captcha").checkbox("uncheck"),$("#enable-openid-signup").checkbox("uncheck")):$("#enable-openid-signup").checkbox("check")})),$("#enable-captcha input").change((function(){$(this).is(":checked")&&$("#disable-registration").checkbox("uncheck")}))),w(),(u=function(){var e=$("#auth_username").val(),t=$("#clone_addr").val();!$("#mirror").is(":checked")&&e&&e.length>0&&void 0!==t&&(t.startsWith("https://github.com")||t.startsWith("http://github.com"))?$("#migrate_items").show():$("#migrate_items").hide()})(),$("#clone_addr").on("input",u),$("#auth_username").on("input",u),$("#mirror").on("change",u),function(){var e=$(".repository.wiki textarea#edit_area"),t=0,n=null;if(e.length>0){var i=new SimpleMDE({autoDownloadFontAwesome:!1,element:e[0],forceSync:!0,previewRender:function(a,o){return setTimeout((function(){var r=function(){t=0,null!=n&&(clearTimeout(n),n=null),$.post(e.data("url"),{_csrf:s,mode:"gfm",context:e.data("context"),text:a},(function(e){o.innerHTML='
'.concat(e,"
"),emojify.run($(".editor-preview")[0]),$(o).find("pre code").each((function(e,t){hljs.highlightBlock(t)}))}))};i.isSideBySideActive()?(++t>10&&r(),null!=n&&(clearTimeout(n),n=null),n=setTimeout(r,600)):r()}),0),i.isSideBySideActive()?o.innerHTML:"Loading..."},renderingConfig:{singleLineBreaks:!1},indentWithTabs:!1,tabSize:4,spellChecker:!1,toolbar:["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","heading-bigger","heading-smaller","|",{name:"code-inline",action:function(e){var t=e.codemirror,n=t.getSelection();if(t.replaceSelection("`".concat(n,"`")),!n){var i=t.getCursor();t.setCursor(i.line,i.ch-1)}t.focus()},className:"fa fa-angle-right",title:"Add Inline Code"},"code","quote","|",{name:"checkbox-empty",action:function(e){var t=e.codemirror;t.replaceSelection("\n- [ ] ".concat(t.getSelection())),t.focus()},className:"fa fa-square-o",title:"Add Checkbox (empty)"},{name:"checkbox-checked",action:function(e){var t=e.codemirror;t.replaceSelection("\n- [x] ".concat(t.getSelection())),t.focus()},className:"fa fa-check-square-o",title:"Add Checkbox (checked)"},"|","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|","clean-block","preview","fullscreen","side-by-side"]});$(i.codemirror.getInputField()).addClass("js-quick-submit"),setTimeout((function(){var e=$('.repository.wiki.new .previewtabs a[data-tab="write"]'),n=$('.repository.wiki.new .previewtabs a[data-tab="preview"]'),i=$(".editor-toolbar"),a=$(".editor-toolbar a.fa-eye"),o=$(".editor-toolbar a.fa-columns");e.on("click",(function(){i.hasClass("disabled-for-preview")&&a.click()})),n.on("click",(function(){i.hasClass("disabled-for-preview")||a.click()})),a.on("click",(function(){setTimeout((function(){i.hasClass("disabled-for-preview")?(e.hasClass("active")&&e.removeClass("active"),n.hasClass("active")||n.addClass("active")):(e.hasClass("active")||e.addClass("active"),n.hasClass("active")&&n.removeClass("active"))}),0)})),o.on("click",(function(){t=10}))}),0)}}(),m(),C(),0!==$(".organization").length&&$(".organization.settings.options").length>0&&$("#org_name").keyup((function(){var e=$("#org-name-change-prompt");$(this).val().toString().toLowerCase()!==$(this).data("org-name").toString().toLowerCase()?e.show():e.hide()})),0!==$(".edit.githook").length&&CodeMirror.autoLoadMode(CodeMirror.fromTextArea($("#content")[0],{lineNumbers:!0,mode:"shell"}),"shell"),function(){if(0!==$(".new.webhook").length){$(".events.checkbox input").change((function(){$(this).is(":checked")&&$(".events.fields").show()})),$(".non-events.checkbox input").change((function(){$(this).is(":checked")&&$(".events.fields").hide()}));var e=function(){var e="POST"===$("#http_method").val();$("#content_type").parent().parent()[e?"show":"hide"]()};e(),$("#http_method").change((function(){e()})),$("#test-delivery").click((function(){var e=$(this);e.addClass("loading disabled"),$.post(e.data("link"),{_csrf:s}).done(setTimeout((function(){window.location.href=e.data("redirect")}),5e3))}))}}(),function(){if(0!==$(".admin").length){if(($(".admin.new.user").length>0||$(".admin.edit.user").length>0)&&$("#login_type").change((function(){"0"===$(this).val().substring(0,1)?($("#login_name").removeAttr("required"),$(".non-local").hide(),$(".local").show(),$("#user_name").focus(),"required"===$(this).data("password")&&$("#password").attr("required","required")):($("#login_name").attr("required","required"),$(".non-local").show(),$(".local").hide(),$("#login_name").focus(),$("#password").removeAttr("required"))})),$(".admin.new.authentication").length>0&&($("#auth_type").change((function(){$(".ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size .sspi").hide(),$(".ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]").removeAttr("required"),$(".binddnrequired").removeClass("required");var e=$(this).val();switch(e){case"2":$(".ldap").show(),$(".binddnrequired input, .ldap div.required:not(.dldap) input").attr("required","required"),$(".binddnrequired").addClass("required");break;case"3":$(".smtp").show(),$(".has-tls").show(),$(".smtp div.required input, .has-tls").attr("required","required");break;case"4":$(".pam").show(),$(".pam input").attr("required","required");break;case"5":$(".dldap").show(),$(".dldap div.required:not(.ldap) input").attr("required","required");break;case"6":$(".oauth2").show(),$(".oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input").attr("required","required"),o();break;case"7":$(".sspi").show(),$(".sspi div.required input").attr("required","required")}"2"!==e&&"5"!==e||i(),"2"===e&&a()})),$("#auth_type").change(),$("#security_protocol").change(i),$("#use_paged_search").change(a),$("#oauth2_provider").change(o),$("#oauth2_use_custom_url").change(r)),$(".admin.edit.authentication").length>0){var e=$("#auth_type").val();"2"===e||"5"===e?($("#security_protocol").change(i),"2"===e&&$("#use_paged_search").change(a)):"6"===e&&($("#oauth2_provider").change(o),$("#oauth2_use_custom_url").change(r),o())}if($(".admin.notice")){var t=$("#detail-modal");$(".view-detail").click((function(){return t.find(".content p").text($(this).data("content")),t.modal("show"),!1}));var n=$(".select.table .ui.checkbox");$(".select.action").click((function(){switch($(this).data("action")){case"select-all":n.checkbox("check");break;case"deselect-all":n.checkbox("uncheck");break;case"inverse":n.checkbox("toggle")}})),$("#delete-selection").click((function(){var e=$(this);e.addClass("loading disabled");var t=[];n.each((function(){$(this).checkbox("is checked")&&t.push($(this).data("id"))})),$.post(e.data("link"),{_csrf:s,ids:t}).done((function(){window.location.href=e.data("redirect")}))}))}}function i(){$("#security_protocol").val()>0?$(".has-tls").show():$(".has-tls").hide()}function a(){$("#use_paged_search").prop("checked")?$(".search-page-size").show().find("input").attr("required","required"):$(".search-page-size").hide().find("input").removeAttr("required")}function o(){switch($(".open_id_connect_auto_discovery_url, .oauth2_use_custom_url").hide(),$(".open_id_connect_auto_discovery_url input[required]").removeAttr("required"),$("#oauth2_provider").val()){case"github":case"gitlab":case"gitea":$(".oauth2_use_custom_url").show();break;case"openidConnect":$(".open_id_connect_auto_discovery_url input").attr("required","required"),$(".open_id_connect_auto_discovery_url").show()}r()}function r(){var e=$("#oauth2_provider").val();if($(".oauth2_use_custom_url_field").hide(),$(".oauth2_use_custom_url_field input[required]").removeAttr("required"),$("#oauth2_use_custom_url").is(":checked"))switch($("#oauth2_token_url").val()||$("#oauth2_token_url").val($("#".concat(e,"_token_url")).val()),$("#oauth2_auth_url").val()||$("#oauth2_auth_url").val($("#".concat(e,"_auth_url")).val()),$("#oauth2_profile_url").val()||$("#oauth2_profile_url").val($("#".concat(e,"_profile_url")).val()),$("#oauth2_email_url").val()||$("#oauth2_email_url").val($("#".concat(e,"_email_url")).val()),e){case"github":$(".oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input, .oauth2_email_url input").attr("required","required"),$(".oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url, .oauth2_email_url").show();break;case"gitea":case"gitlab":$(".oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input").attr("required","required"),$(".oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url").show(),$("#oauth2_email_url").val("")}}}(),_(),function(){var e=document.getElementById("app");if(!e)return;Vue.component("repo-search",{delimiters:["${","}"],props:{searchLimit:{type:Number,default:10},suburl:{type:String,required:!0},uid:{type:Number,required:!0},organizations:{type:Array,default:[]},isOrganization:{type:Boolean,default:!0},canCreateOrganization:{type:Boolean,default:!1},organizationsTotalCount:{type:Number,default:0},moreReposLink:{type:String,default:""}},data:function(){return{tab:"repos",repos:[],reposTotalCount:0,reposFilter:"all",searchQuery:"",isLoading:!1,repoTypes:{all:{count:0,searchMode:""},forks:{count:0,searchMode:"fork"},mirrors:{count:0,searchMode:"mirror"},sources:{count:0,searchMode:"source"},collaborative:{count:0,searchMode:"collaborative"}}}},computed:{showMoreReposLink:function(){return this.repos.length>0&&this.repos.length').concat(a[r],"")).insertBefore(o);O.css("display","none"),E.show()}})).fail((function(t){if(422===t.status)if(t.responseJSON.invalidTopics.length>0){N.formatPrompt=t.responseJSON.message;var n=t.responseJSON.invalidTopics,i=j.children("a.ui.label");e.split(",").forEach((function(e,t){for(var a=0;a]*>?/gm,""),i=!1,a=[];if(j.find("div.label.visible.topic,a.label.visible").each((function(e,t){a.push(t.dataset.value)})),e.topics){for(var o=!1,r=0;r0&&!i?(t.success=!0,t.results.unshift({description:n,"data-value":n})):n.length>0&&i&&t.results.sort((function(e,t){return e.description.toLowerCase()===n.toLowerCase()?-1:t.description.toLowerCase()===n.toLowerCase()?1:e.description>t.description?-1:e.description').concat(h(i.repository.full_name),"
"),value:i.id})})),t},cache:!1},fullTextSearch:!0}),$(".menu a.label-filter-item").each((function(){$(this).click((function(e){if(e.altKey){e.preventDefault();var t=$(this).attr("href"),n=$(this).data("label-id"),i="labels=(-?[0-9]+%2c)*(".concat(n,")(%2c-?[0-9]+)*&");window.location=t.replace(new RegExp(i),"labels=$1-$2$3&")}}))})),$(".menu .ui.dropdown.label-filter").keydown((function(e){if(e.altKey&&13===e.keyCode){var t=$(".menu .ui.dropdown.label-filter .menu .item.selected");if(t.length>0){var n=$(t[0]),i=n.attr("href"),a=n.data("label-id"),o="labels=(-?[0-9]+%2c)*(".concat(a,")(%2c-?[0-9]+)*&");window.location=i.replace(new RegExp(o),"labels=$1-$2$3&")}}}))}(),$(".title_wip_desc > a").click((function(e){e.preventDefault();var t=$("#issue_title");t.focus();var n=t.val().trim().toUpperCase();for(var i in wipPrefixes)if(n.startsWith(wipPrefixes[i].toUpperCase()))return;t.val("".concat(wipPrefixes[0]," ").concat(t.val()))})),$(".show-outdated").on("click",(function(e){e.preventDefault();var t=$(this).data("comment");$(this).addClass("hide"),$("#code-comments-".concat(t)).removeClass("hide"),$("#code-preview-".concat(t)).removeClass("hide"),$("#hide-outdated-".concat(t)).removeClass("hide")})),$(".hide-outdated").on("click",(function(e){e.preventDefault();var t=$(this).data("comment");$(this).addClass("hide"),$("#code-comments-".concat(t)).addClass("hide"),$("#code-preview-".concat(t)).addClass("hide"),$("#show-outdated-".concat(t)).removeClass("hide")})),$("button.comment-form-reply").on("click",(function(e){e.preventDefault(),$(this).hide();var t=$(this).parent().find(".comment-form");t.removeClass("hide"),y(t.find(".menu"))})),0!==$(".repository.pull.diff").length&&($(".diff-detail-box.ui.sticky").sticky(),$(".btn-review").on("click",(function(e){e.preventDefault(),$(this).closest(".dropdown").find(".menu").toggle("visible")})).closest(".dropdown").find(".link.close").on("click",(function(e){e.preventDefault(),$(this).closest(".menu").toggle("visible")})),$(".code-view .lines-code,.code-view .lines-num").on("mouseenter",(function(){var e=$(this).closest("td");$(this).closest("tr").addClass(e.hasClass("lines-num-old")||e.hasClass("lines-code-old")?"focus-lines-old":"focus-lines-new")})).on("mouseleave",(function(){$(this).closest("tr").removeClass("focus-lines-new focus-lines-old")})),$(".add-code-comment").on("click",(function(e){if(!$(e.target).hasClass("btn-add-single")){e.preventDefault();var t=$(this).closest(".code-diff").hasClass("code-diff-split"),n=$(this).data("side"),i=$(this).data("idx"),a=$(this).data("path"),o=$("#pull_review_add_comment").html(),r=$(this).closest("tr"),s=r.next();s.hasClass("add-comment")||(s=$(''.concat(t?'':'',"")),r.after(s));var c=s.find(".add-comment-".concat(n)),l=c.find(".comment-code-cloud");0===l.length&&(c.html(o),y((l=c.find(".comment-code-cloud")).find(".menu")),c.find("input[name='line']").val(i),c.find("input[name='side']").val("left"===n?"previous":"proposed"),c.find("input[name='path']").val(a)),l.find("textarea").focus()}}))),function e(){var t=$("#repo_migrating");if($("#repo_migrating_failed").hide(),t){var n=t.attr("repo");if(void 0===n)return;$.ajax({type:"GET",url:"".concat(c,"/").concat(n,"/status"),data:{_csrf:s},complete:function(t){if(200===t.status&&t.responseJSON)return 0===t.responseJSON.status?void window.location.reload():void setTimeout((function(){e()}),2e3);$("#repo_migrating_progress").hide(),$("#repo_migrating_failed").show()}})}}(),function(){var e=$("#repo_template"),t=function(){var t=$("#template_units"),n=$("#non_template");""!==e.val()?(t.show(),n.hide()):(t.hide(),n.show())};e.change(t),t();var n=function(){$("#repo_template_search").dropdown({apiSettings:{url:"".concat(c,"/api/v1/repos/search?q={query}&template=true&priority_owner_id=").concat($("#uid").val()),onResponse:function(e){var t={success:!0,results:[]};return t.results.push({name:"",value:""}),$.each(e.data,(function(e,n){t.results.push({name:h(n.full_name),value:n.id})})),t},cache:!1},fullTextSearch:!0})};$("#uid").change(n),n()}(),$("#repo-clone-url").length>0)switch(localStorage.getItem("repo-clone-protocol")){case"ssh":0===$("#repo-clone-ssh").click().length&&$("#repo-clone-https").click();break;default:$("#repo-clone-https").click()}var B,H={"div.user.settings":k,"div.repository.settings.collaboration":x};for(B in H)if($(B).length>0){H[B]();break}var U=$("#clone_addr");U.change((function(){var e=$("#repo_name");U.val().length>0&&0===e.val().length&&e.val(U.val().match(/^(.*\/)?((.+?)(\.git)?)$/)[3])}))})),$((function(){0===$(".user.signin").length&&$("form:not(.ignore-dirty)").areYouSure(),$("#ssh-key-content").on("change paste keyup",(function(){var e=$(this).val().split(" "),t=$("#ssh-key-title");""===t.val()&&3===e.length&&""!==e[2]&&t.val(e[2])}))})),window.timeAddManual=function(){$(".mini.modal").modal({duration:200,onApprove:function(){$("#add_time_manual_form").submit()}}).modal("show")},window.toggleStopwatch=function(){$("#toggle_stopwatch_form").submit()},window.cancelStopwatch=function(){$("#cancel_stopwatch_form").submit()},window.initHeatmap=function(e,t,n){var i=document.getElementById(e);if(i){(n=n||{}).contributions=n.contributions||"contributions",n.no_contributions=n.no_contributions||"No contributions";var a=["${","}"];Vue.component("activity-heatmap",{delimiters:a,props:{user:{type:String,required:!0},suburl:{type:String,required:!0},locale:{type:Object,required:!0}},data:function(){return{isLoading:!0,colorRange:[],endDate:null,values:[],totalContributions:0}},mounted:function(){this.colorRange=[this.getColor(0),this.getColor(1),this.getColor(2),this.getColor(3),this.getColor(4),this.getColor(5)],this.endDate=new Date,this.loadHeatmap(this.user)},methods:{loadHeatmap:function(e){var t=this;$.get("".concat(this.suburl,"/api/v1/users/").concat(e,"/heatmap"),(function(e){for(var n=[],i=0;i

total contributions in the last 12 months

'}),new Vue({delimiters:a,el:i,data:{suburl:document.querySelector("meta[name=_suburl]").content,heatmapUser:t,locale:n}})}},$(".commit-button").click((function(e){e.preventDefault(),$(this).parent().find(".commit-body").toggle()})),window.toggleDeadlineForm=function(){$("#deadlineForm").fadeToggle(150)},window.setDeadline=function(){var e=$("#deadlineDate").val();window.updateDeadline(e)},window.updateDeadline=function(e){$("#deadline-err-invalid-date").hide(),$("#deadline-loader").addClass("loading");var t=null;if(""!==e){var n=Date.parse(e);if(Number.isNaN(n))return $("#deadline-loader").removeClass("loading"),$("#deadline-err-invalid-date").show(),!1;t=new Date(n)}$.ajax("".concat($("#update-issue-deadline-form").attr("action"),"/deadline"),{data:JSON.stringify({due_date:t}),headers:{"X-Csrf-Token":s,"X-Remote":!0},contentType:"application/json",type:"POST",success:function(){v()},error:function(){$("#deadline-loader").removeClass("loading"),$("#deadline-err-invalid-date").show()}})},window.deleteDependencyModal=function(e,t){$(".remove-dependency").modal({closable:!1,duration:200,onApprove:function(){$("#removeDependencyID").val(e),$("#dependencyType").val(t),$("#removeDependencyForm").submit()}}).modal("show")},window.cancelCodeComment=function(e){var t=$(e).closest("form");t.length>0&&t.hasClass("comment-form")?(t.addClass("hide"),t.parent().find("button.comment-form-reply").show()):t.closest(".comment-code-cloud").remove()},window.onOAuthLoginClick=function(){var e=$("#oauth2-login-loader"),t=$("#oauth2-login-navigator");t.hide(),e.removeClass("disabled"),setTimeout((function(){e.addClass("disabled"),t.show()}),5e3)}}]); //# sourceMappingURL=index.js.map