hanayo/static/dist.min.js

45 lines
370 KiB
JavaScript
Raw Normal View History

2019-02-23 13:29:15 +00:00
/*!
* You are currently viewing the Ripple JavaScript source code.
* Just so you know: if you want to see the source of the Ripple Frontend
* (Hanayo), you can do so at https://github.com/osuYozora/hanayo
* Un-minified version of this file as a whole is not available, however
* its dependencies (jquery, timeago, semantic...) are open source, and ripple's
* custom JS is available at /static/ripple.js.
*/
/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
function closeClosestMessage(){$(this).closest(".message").fadeOut(300,function(){$(this).remove()})}function showMessage(e,t){var n=$('<div class="ui '+e+' message hidden"><i class="close icon"></i>'+T(t)+"</div>");n.find(".close.icon").click(closeClosestMessage),$("#messages-container").append(n),n.slideDown(300)}function api(e,t,n,i,o){"function"==typeof t&&(n=t,t=null),"boolean"==typeof i&&(o=i,i=void 0);var r="An error occurred while contacting the Ripple API. Please report this to a Ripple developer.";$.ajax({method:o?"POST":"GET",dataType:"json",url:hanayoConf.baseAPI+"/api/v1/"+e,data:o?JSON.stringify(t):t,contentType:o?"application/json; charset=utf-8":"",success:function(e){if(200!=e.code){if(e.code>=400&&e.code<500&&"function"==typeof i)return void i(e);console.warn(e),showMessage("error",r)}n(e)},error:function(e,t,n){return e.status>=400&&e.status<500&&"function"==typeof i?void i(e.responseJSON):(console.warn(e,t,n),void showMessage("error",r))}})}function escapeHTML(e){return String(e).replace(/[&<>"'\/]/g,function(e){return entityMap[e]})}function setupSimplepag(e){var t=$(".simplepag");t.find(".left.floated .item").click(function(){return!$(this).hasClass("disabled")&&(page--,void e())}),t.find(".right.floated .item").click(function(){return!$(this).hasClass("disabled")&&(page++,void e())})}function disableSimplepagButtons(e){var t=$(".simplepag");page<=1?t.find(".left.floated .item").addClass("disabled"):t.find(".left.floated .item").removeClass("disabled"),e?t.find(".right.floated .item").addClass("disabled"):t.find(".right.floated .item").removeClass("disabled")}function addCommas(e){e+="",x=e.split("."),x1=x[0],x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2}function getScoreMods(e,t){var n=[];return 512==(512&e)&&(e&=-65),16384==(16384&e)&&(e&=-33),modsString.forEach(function(t,i){var o=1<<i;(e&o)>0&&n.push(t)}),n.length>0?(t?"":"+ ")+n.join(", "):t?T("None"):""}function timeFormat(e){var t=Math.floor(e/3600);e%=3600;var n=Math.floor(e/60),i=e%60,o="";return t>0?(o+=t+":",n<10&&(o+="0"),o+=n+":"):o+=n+":",i<10&&(o+="0"),o+=i}function query(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),i=n.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function formToObject(e){var t=e.find("input, textarea, select"),n={};return t.each(function(e,t){if(t=$(t),void 0!==t.attr("name")){var i,o=t.attr("name").split(".");switch(t.attr("type")){case"checkbox":i=t.is(":checked");break;default:switch(t.data("cast")){case"int":i=+t.val();break;default:i=t.val()}}n=modifyObjectDynamically(n,o,i)}}),n}function modifyObjectDynamically(e,t,n){return 1===t.length?e[t[0]]=n:t.length>1&&("object"!=typeof e[t[0]]&&(e[t[0]]={}),e[t[0]]=modifyObjectDynamically(e[t[0]],t.slice(1),n)),e}function T(e,t){return"undefined"!=typeof t&&"undefined"!=typeof t.count&&$.inArray(hanayoConf.language,langWhitelist)===-1&&1!==t.count&&(e=keyPlurals[e]),i18next.t(e,t)}function privilegesToString(e){var t=[];return apiPrivileges.forEach(function(n,i){0!=(e&1<<i+1)&&t.push(n)}),t.join(", ")}!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t){t=t||te;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function i(e){var t=!!e&&"length"in e&&e.length,n=he.type(e);return"function"!==n&&!he.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function o(e,t,n){return he.isFunction(t)?he.grep(e,function(e,i){return!!t.call(e,i,e)!==n}):t.nodeType?he.grep(e,function(e){return e===t!==n}):"string"!=typeof t?he.grep(e,function(e){return ae.call(t,e)>-1!==n}):Te.test(t)?he.filter(t,e,n):(t=he.filter(t,e),he.grep(e,function(e){return ae.call(t,e)>-1!==n&&1===e.nodeType}))}function r(e,t){for(;(e=e[t])&&1!==e.nodeType;);r
},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=A(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ye,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(o){var r=t.attr(o,e);return null==r?"!="===n:!n||(r+="","="===n?r===i:"!="===n?r!==i:"^="===n?i&&0===r.indexOf(i):"*="===n?i&&r.indexOf(i)>-1:"$="===n?i&&r.slice(-i.length)===i:"~="===n?(" "+r.replace(ae," ")+" ").indexOf(i)>-1:"|="===n&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,n,i,o){var r="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,g=r!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),b=!l&&!s,y=!1;if(m){if(r){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&b){for(f=m,d=f[$]||(f[$]={}),u=d[f.uniqueID]||(d[f.uniqueID]={}),c=u[e]||[],p=c[0]===U&&c[1],y=p&&c[2],f=p&&m.childNodes[p];f=++p&&f&&f[g]||(y=p=0)||h.pop();)if(1===f.nodeType&&++y&&f===t){u[e]=[U,p,y];break}}else if(b&&(f=t,d=f[$]||(f[$]={}),u=d[f.uniqueID]||(d[f.uniqueID]={}),c=u[e]||[],p=c[0]===U&&c[1],y=p),y===!1)for(;(f=++p&&f&&f[g]||(y=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++y||(b&&(d=f[$]||(f[$]={}),u=d[f.uniqueID]||(d[f.uniqueID]={}),u[e]=[U,y]),f!==t)););return y-=o,y===i||y%i===0&&y/i>=0}}},PSEUDO:function(e,n){var o,r=k.pseudos[e]||k.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return r[$]?r(n):r.length>1?(o=[e,e,"",n],k.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,o=r(e,n),a=o.length;a--;)i=ee(e,o[a]),e[i]=!(t[i]=o[a])}):function(e){return r(e,0,o)}):r}},pseudos:{not:i(function(e){var t=[],n=[],o=E(e.replace(se,"$1"));return o[$]?i(function(e,t,n,i){for(var r,a=o(e,null,i,[]),s=e.length;s--;)(r=a[s])&&(e[s]=!(t[s]=r))}):function(e,i,r){return t[0]=e,o(t,null,r,n),t[0]=null,!n.pop()}}),has:i(function(e){return function(n){return t(e,n).length>0}}),contains:i(function(e){return e=e.replace(ye,xe),function(t){return(t.textContent||t.innerText||T(t)).indexOf(e)>-1}}),lang:i(function(e){return fe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ye,xe).toLowerCase(),function(t){var n;do if(n=q?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===F.activeElement&&(!F.hasFocus||F.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!k.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){r
return o}},rt.test(e)||(he.cssHooks[e+t].set=L)}),he.fn.extend({css:function(e,t){return Fe(this,function(e,t,n){var i,o,r={},a=0;if(he.isArray(t)){for(i=st(e),o=t.length;a<o;a++)r[t[a]]=he.css(e,t[a],!1,i);return r}return void 0!==n?he.style(e,t,n):he.css(e,t)},e,t,arguments.length>1)}}),he.Tween=M,M.prototype={constructor:M,init:function(e,t,n,i,o,r){this.elem=e,this.prop=n,this.easing=o||he.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=r||(he.cssNumber[n]?"":"px")},cur:function(){var e=M.propHooks[this.prop];return e&&e.get?e.get(this):M.propHooks._default.get(this)},run:function(e){var t,n=M.propHooks[this.prop];return this.options.duration?this.pos=t=he.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=he.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){he.fx.step[e.prop]?he.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[he.cssProps[e.prop]]&&!he.cssHooks[e.prop]?e.elem[e.prop]=e.now:he.style(e.elem,e.prop,e.now+e.unit)}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},he.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},he.fx=M.prototype.init,he.fx.step={};var pt,ht,gt=/^(?:toggle|show|hide)$/,mt=/queueHooks$/;he.Animation=he.extend(W,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return h(n.elem,e,$e.exec(t),n),n}]},tweener:function(e,t){he.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,i=0,o=e.length;i<o;i++)n=e[i],W.tweeners[n]=W.tweeners[n]||[],W.tweeners[n].unshift(t)},prefilters:[U],prefilter:function(e,t){t?W.prefilters.unshift(e):W.prefilters.push(e)}}),he.speed=function(e,t,n){var i=e&&"object"==typeof e?he.extend({},e):{complete:n||!n&&t||he.isFunction(e)&&e,duration:e,easing:n&&t||t&&!he.isFunction(t)&&t};return he.fx.off||te.hidden?i.duration=0:"number"!=typeof i.duration&&(i.duration in he.fx.speeds?i.duration=he.fx.speeds[i.duration]:i.duration=he.fx.speeds._default),null!=i.queue&&i.queue!==!0||(i.queue="fx"),i.old=i.complete,i.complete=function(){he.isFunction(i.old)&&i.old.call(this),i.queue&&he.dequeue(this,i.queue)},i},he.fn.extend({fadeTo:function(e,t,n,i){return this.filter(Ue).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var o=he.isEmptyObject(e),r=he.speed(t,n,i),a=function(){var t=W(this,he.extend({},e),r);(o||qe.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||r.queue===!1?this.each(a):this.queue(r.queue,a)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",r=he.timers,a=qe.get(this);if(o)a[o]&&a[o].stop&&i(a[o]);else for(o in a)a[o]&&a[o].stop&&mt.test(o)&&i(a[o]);for(o=r.length;o--;)r[o].elem!==this||null!=e&&r[o].queue!==e||(r[o].anim.stop(n),t=!1,r.splice(o,1));!t&&n||he.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=qe.get(this),i=n[e+"queue"],o=n[e+"queueHooks"],r=he.timers,a=i?i.length:0;for(n.finish=!0,he.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===e&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<a;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),he.each(["toggle","show","hide"],function(e,t){var n=he.fn[t];he.fn[t]=function(e,i,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate($(t,!0),e,i,o)}}),he.each({slideDown:$("show"),slideUp:$("hide"),slideToggle:$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){he.fn[e]=
* Timeago is a jQuery plugin that makes it easy to support automatically
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
*
* @name timeago
* @version 1.5.3
* @requires jQuery v1.2.3+
* @author Ryan McGeary
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*
* For usage and examples, visit:
* http://timeago.yarp.com/
*
* Copyright (c) 2008-2015, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
*/
function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&"object"==typeof module.exports?require("jquery"):jQuery)}(function(e){function t(){var t=r.settings;if(t.autoDispose&&!e.contains(document.documentElement,this))return e(this).timeago("dispose"),this;var a=n(this);return isNaN(a.datetime)||(0==t.cutoff||Math.abs(o(a.datetime))<t.cutoff?e(this).text(i(a.datetime)):e(this).attr("title").length>0&&e(this).text(e(this).attr("title"))),this}function n(t){if(t=e(t),!t.data("timeago")){t.data("timeago",{datetime:r.datetime(t)});var n=e.trim(t.text());r.settings.localeTitle?t.attr("title",t.data("timeago").datetime.toLocaleString()):!(n.length>0)||r.isTime(t)&&t.attr("title")||t.attr("title",n)}return t.data("timeago")}function i(e){return r.inWords(o(e))}function o(e){return(new Date).getTime()-e.getTime()}e.timeago=function(t){return i(t instanceof Date?t:"string"==typeof t?e.timeago.parse(t):"number"==typeof t?new Date(t):e.timeago.datetime(t))};var r=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,autoDispose:!0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){function n(n,o){var r=e.isFunction(n)?n(o,t):n,a=i.numbers&&i.numbers[o]||o;return r.replace(/%d/i,a)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,o=i.prefixAgo,r=i.suffixAgo;if(this.settings.allowFuture&&t<0&&(o=i.prefixFromNow,r=i.suffixFromNow),!this.settings.allowPast&&t>=0)return this.settings.strings.inPast;var a=Math.abs(t)/1e3,s=a/60,l=s/60,c=l/24,u=c/365,d=a<45&&n(i.seconds,Math.round(a))||a<90&&n(i.minute,1)||s<45&&n(i.minutes,Math.round(s))||s<90&&n(i.hour,1)||l<24&&n(i.hours,Math.round(l))||l<42&&n(i.day,1)||c<30&&n(i.days,Math.round(c))||c<45&&n(i.month,1)||c<365&&n(i.months,Math.round(c/30))||u<1.5&&n(i.year,1)||n(i.years,Math.round(u)),f=i.wordSeparator||"";return void 0===i.wordSeparator&&(f=" "),e.trim([o,d,r].join(f))},parse:function(t){var n=e.trim(t);return n=n.replace(/\.\d+/,""),n=n.replace(/-/,"/").replace(/-/,"/"),n=n.replace(/T/," ").replace(/Z/," UTC"),n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),n=n.replace(/([\+\-]\d\d)$/," $100"),new Date(n)},datetime:function(t){var n=r.isTime(t)?e(t).attr("datetime"):e(t).attr("title");return r.parse(n)},isTime:function(t){return"time"===e(t).get(0).tagName.toLowerCase()}});var a={init:function(){var n=e.proxy(t,this);n();var i=r.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(n,i.refreshMillis))},update:function(n){var i=n instanceof Date?n:r.parse(n);e(this).data("timeago",{datetime:i}),r.settings.localeTitle&&e(this).attr("title",i.toLocaleString()),t.apply(this)},updateFromDOM:function(){e(this).data("timeago",{datetime:r.parse(r.isTime(this)?e(this).attr("datetime"):e(this).attr("title"))}),t.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};e.fn.timeago=function(e,t){var n=e?a[e]:a.init;if(!n)throw new Error("Unknown function name '"+e+"' for timeago");return this.each(function(){n.call(this,t)}),this},document.createElement("abbr"),document.createElement("time")}),/*
* # Semantic UI - 2.2.6
* https://github.com/Semantic-Org/Semantic-UI
* http://www.semantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(e,t,n,i){e.site=e.fn.site=function(o){var r,a,s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),p=f.namespace,h=f.error,g="module-"+p,m=e(n),v=m,b=this,y=v.data(g);return r={initialize:function(){r.instantiate()},instantiate:function(){r.verbose("Storing instance of site",r),y=r,v.data(g,r)},normalize:function(){r.fix.console(),r.fix.requestAnimationFrame()},fix:{console:function(){r.debug("Normalizing window.console"),console!==i&&console.log!==i||(r.verbose("Console not available, normalizing events"),r.disable.console()),"undefined"!=typeof console.group&&"undefined"!=typeof console.groupEnd&&"undefined"!=typeof console.groupCollapsed||(r.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(r.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){r.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){r.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(r.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||f.modules,e.each(t,function(e,t){r.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||f.modules,e.each(t,function(e,t){r.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,a){o="string"==typeof o?"all"===o?f.modules:[o]:o||f.modules,a=a===i||a,e.each(o,function(i,o){var s,l=!r.moduleExists(o)||e.fn[o].settings.namespace||!1;r.moduleExists(o)&&(r.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,a&&l&&(s=e(":data(module-"+l+")"),s.length>0&&(r.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||f.modules,o=o===i||o,e.each(n,function(n,i){var a;r.moduleExists(i)&&(r.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&p&&(a=e(":data(module-"+p+")"),a.length>0&&(r.verbose("Modifying existing settings",a),a[i]("setting",t))))})}},enable:{console:function(){r.console(!0)},debug:function(e,t){e=e||f.modules,r.debug("Enabling debug for modules",e),r.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||f.modules,r.debug("Enabling verbose debug for modules",e),r.change.setting("verbose",!0,e,t)}},disable:{console:function(){r.console(!1)},debug:function(e,t){e=e||f.modules,r.debug("Disabling debug for modules",e),r.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||f.modules,r.debug("Disabling verbose debug for modules",e),r.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void r.error(h.console);r.debug("Restoring console function"),t.console=y.cache.console}else r.debug("Disabling console function"),y.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){r.verbose("Destroying previous site for",v),v.removeData(g)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,r,t);else{if(n===i)return r[t];r[t]=n}},debug:function(){f.debug&&(f.performance?r.performance.log(arguments):(r.debug=Function.prototype.bind.call(console.info,console,f.name+":"),r.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?r.performance.log(arguments):(r.verbose=Function.prototype.bind.call(console.info,co
onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.checkbox=function(o){var r,a=e(this),s=a.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return a.each(function(){var a,p,h=e.extend(!0,{},e.fn.checkbox.settings,o),g=h.className,m=h.namespace,v=h.selector,b=h.error,y="."+m,x="module-"+m,w=e(this),C=e(this).children(v.label),k=e(this).children(v.input),T=k[0],S=!1,A=!1,E=w.data(x),j=this;p={initialize:function(){p.verbose("Initializing checkbox",h),p.create.label(),p.bind.events(),p.set.tabbable(),p.hide.input(),p.observeChanges(),p.instantiate(),p.setup()},instantiate:function(){p.verbose("Storing instance of module",p),E=p,w.data(x,p)},destroy:function(){p.verbose("Destroying module"),p.unbind.events(),p.show.input(),w.removeData(x)},fix:{reference:function(){w.is(v.input)&&(p.debug("Behavior called on <input> adjusting invoked element"),w=w.closest(v.checkbox),p.refresh())}},setup:function(){p.set.initialLoad(),p.is.indeterminate()?(p.debug("Initial value is indeterminate"),p.indeterminate()):p.is.checked()?(p.debug("Initial value is checked"),p.check()):(p.debug("Initial value is unchecked"),p.uncheck()),p.remove.initialLoad()},refresh:function(){C=w.children(v.label),k=w.children(v.input),T=k[0]},hide:{input:function(){p.verbose("Modifying <input> z-index to be unselectable"),k.addClass(g.hidden)}},show:{input:function(){p.verbose("Modifying <input> z-index to be selectable"),k.removeClass(g.hidden)}},observeChanges:function(){"MutationObserver"in t&&(a=new MutationObserver(function(e){p.debug("DOM tree modified, updating selector cache"),p.refresh()}),a.observe(j,{childList:!0,subtree:!0}),p.debug("Setting up mutation observer",a))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(p[n])?p[n]:p.toggle,i.length>0?(p.debug("Attaching checkbox events to element",t,n),i.on("click"+y,n)):p.error(b.notFound)},event:{click:function(t){var n=e(t.target);return n.is(v.input)?void p.verbose("Using default check action on initialized checkbox"):n.is(v.link)?void p.debug("Clicking link inside checkbox, skipping toggle"):(p.toggle(),k.focus(),void t.preventDefault())},keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape?(p.verbose("Escape key pressed blurring field"),k.blur(),A=!0):e.ctrlKey||t!=n.space&&t!=n.enter?A=!1:(p.verbose("Enter/space key pressed, toggling checkbox"),p.toggle(),A=!0)},keyup:function(e){A&&e.preventDefault()}},check:function(){p.should.allowCheck()&&(p.debug("Checking checkbox",k),p.set.checked(),p.should.ignoreCallbacks()||(h.onChecked.call(T),h.onChange.call(T)))},uncheck:function(){p.should.allowUncheck()&&(p.debug("Unchecking checkbox"),p.set.unchecked(),p.should.ignoreCallbacks()||(h.onUnchecked.call(T),h.onChange.call(T)))},indeterminate:function(){return p.should.allowIndeterminate()?void p.debug("Checkbox is already indeterminate"):(p.debug("Making checkbox indeterminate"),p.set.indeterminate(),void(p.should.ignoreCallbacks()||(h.onIndeterminate.call(T),h.onChange.call(T))))},determinate:function(){return p.should.allowDeterminate()?void p.debug("Checkbox is already determinate"):(p.debug("Making checkbox determinate"),p.set.determinate(),void(p.should.ignoreCallbacks()||(h.onDeterminate.call(T),h.onChange.call(T))))},enable:function(){return p.is.enabled()?void p.debug("Checkbox is already enabled"):(p.debug("Enabling checkbox"),p.set.enabled(),h.onEnable.call(T),void h.onEnabled.call(T))},disable:function(){return p.is.disabled()?void p.debug("Checkbox is already disabled"):(p.debug("Disabling checkbox"),p.set.disabled(),h.onDisable.call(T),void h.onDisabled.call(T))},get:{radios:fu
},label:{click:function(t){var n=e(this),i=M.find(P.label),o=i.filter("."+S.active),r=n.nextAll("."+S.active),a=n.prevAll("."+S.active),s=r.length>0?n.nextUntil(r).add(o).add(n):n.prevUntil(a).add(o).add(n);t.shiftKey?(o.removeClass(S.active),s.addClass(S.active)):t.ctrlKey?n.toggleClass(S.active):(o.removeClass(S.active),n.addClass(S.active)),T.onLabelSelect.apply(this,i.filter("."+S.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(S.active)?k.remove.activeLabels():k.remove.activeLabels(t)}},test:{toggle:function(e){var t=k.is.multiple()?k.show:k.toggle;k.is.bubbledLabelClick(e)||k.is.bubbledIconClick(e)||k.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){k.determine.eventOnElement(e,function(){"touchstart"==e.type?k.timer=setTimeout(function(){k.hide()},T.delay.touch):"touchmove"==e.type&&clearTimeout(k.timer)}),e.stopPropagation()},hide:function(e){k.determine.eventInModule(e,k.hide)}},select:{mutation:function(e){k.debug("<select> modified, recreating menu"),k.setup.select()}},menu:{mutation:function(t){var n=t[0],i=e(!!n.addedNodes&&n.addedNodes[0]),o=e(!!n.removedNodes&&n.removedNodes[0]),r=i.add(o),a=r.is(P.addition)||r.closest(P.addition).length>0,s=r.is(P.message)||r.closest(P.message).length>0;a||s?(k.debug("Updating item selector cache"),k.refreshItems()):(k.debug("Menu modified, updating selector cache"),k.refresh())},mousedown:function(){X=!0},mouseup:function(){X=!1}},item:{mouseenter:function(t){var n=e(t.target),i=e(this),o=i.children(P.menu),r=i.siblings(P.item).children(P.menu),a=o.length>0,s=o.find(n).length>0;!s&&a&&(clearTimeout(k.itemTimer),k.itemTimer=setTimeout(function(){k.verbose("Showing sub-menu",o),e.each(r,function(){k.animate.hide(!1,e(this))}),k.animate.show(!1,o)},T.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(P.menu);n.length>0&&(clearTimeout(k.itemTimer),k.itemTimer=setTimeout(function(){k.verbose("Hiding sub-menu",n),k.animate.hide(!1,n)},T.delay.hide))},click:function(t,n){var i=e(this),o=e(t?t.target:""),r=i.find(P.menu),a=k.get.choiceText(i),s=k.get.choiceValue(i,a),l=r.length>0,c=r.find(o).length>0;c||l&&!T.allowCategorySelection||(k.is.searchSelection()&&(T.allowAdditions&&k.remove.userAddition(),k.remove.searchTerm(),k.is.focusedOnSearch()||1==n||k.focusSearch(!0)),T.useLabels||(k.remove.filteredItem(),k.set.scrollPosition(i)),k.determine.selectAction.call(this,a,s))}},document:{keydown:function(e){var t=e.which,n=k.is.inObject(t,j);if(n){var i=M.find(P.label),o=i.filter("."+S.active),r=(o.data(R.value),i.index(o)),a=i.length,s=o.length>0,l=o.length>1,c=0===r,u=r+1==a,d=k.is.searchSelection(),f=k.is.focusedOnSearch(),p=k.is.focused(),h=f&&0===k.get.caretPosition();if(d&&!s&&!f)return;t==j.leftArrow?!p&&!h||s?s&&(e.shiftKey?k.verbose("Adding previous label to selection"):(k.verbose("Selecting previous label"),i.removeClass(S.active)),c&&!l?o.addClass(S.active):o.prev(P.siblingLabel).addClass(S.active).end(),e.preventDefault()):(k.verbose("Selecting previous label"),i.last().addClass(S.active)):t==j.rightArrow?(p&&!s&&i.first().addClass(S.active),s&&(e.shiftKey?k.verbose("Adding next label to selection"):(k.verbose("Selecting next label"),i.removeClass(S.active)),u?d?f?i.removeClass(S.active):k.focusSearch():l?o.next(P.siblingLabel).addClass(S.active):o.addClass(S.active):o.next(P.siblingLabel).addClass(S.active),e.preventDefault())):t==j.deleteKey||t==j.backspace?s?(k.verbose("Removing active labels"),u&&d&&!f&&k.focusSearch(),o.last().next(P.siblingLabel).addClass(S.active),k.remove.activeLabels(o),e.preventDefault()):h&&!s&&t==j.backspace&&(k.verbose("Removing last label on input backspace"),o=i.last().addClass(S.active),k.remove.activeLabels(o)):o.removeClass(S.active)}}},keydown:function(e){var t=e.which,n=k.is.inObject(t,j);if(n){var i,o,r=_.not(P.unselectable).filter("."+S.selected).eq(0),a=B.children("."+S.active).eq(0),s=r.length>0?r:a,l=s.length>0?s.siblings(":not(."+S.filtered+")").addBack():B.children(":not(."+S.filtered+")"),c=s.children(P.menu),u=s.closest(P.menu),d=u.hasClass(S.visible)||u.ha
k.initialize())}),r!==i?r:a},e.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",apiSettings:!1,selectOnKeydown:!0,minCharacters:0,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!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 <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},e.fn.dropdown.settings.templates={dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+='<i class="dropdown icon"></i>',i+=t.placeholder?'<div class="default text">'+n+"</div>":'<div class="text"></div>',i+='<div class="menu">',e.each(t.values,function(e,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"</div>":'<div class="item" data-value="'+t.value+'">'+t.name+"</div>"}),i+="</div>"},menu:function(t,n){var i=t[n.values]||{},o="";return e.each(i,function(e,t){var i=t[n.text]?'data-text="'+t[n.text]+'"':"",r=t[n.disabled]?"disabled ":"";o+='<div class="'+r+'item" data-value="'+t[n.value]+'"'+i+">",o+=t[n.name],o+="</div>"}),o},label:function(e,t){return t+'<i class="delete icon"></i>'},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.embed=function(n){var o,r=e(this),a=r.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"=
w.hide())},show:function(e){if(e=e||function(){},w.debug("Showing pop-up",C.transition),w.is.hidden()&&(!w.is.active()||!w.is.dropdown())){if(w.exists()||w.create(),C.onShow.call(a,I)===!1)return void w.debug("onShow callback returned false, cancelling popup animation");C.preserve||C.popup||w.refresh(),a&&w.set.position()&&(w.save.conditions(),C.exclusive&&w.hideAll(),w.animate.show(e))}},hide:function(e){if(e=e||function(){},w.is.visible()||w.is.animating()){if(C.onHide.call(a,I)===!1)return void w.debug("onHide callback returned false, cancelling popup animation");w.remove.visible(),w.unbind.close(),w.restore.conditions(),w.animate.hide(e)}},hideAll:function(){e(k.popup).filter("."+T.visible).each(function(){e(this).data(A.activator).popup("hide")})},exists:function(){return!!a&&(C.inline||C.popup?w.has.popup():a.closest(O).length>=1)},removePopup:function(){w.has.popup()&&!C.popup&&(w.debug("Removing popup",a),a.remove(),a=i,C.onRemove.call(a,I))},save:{conditions:function(){w.cache={title:D.attr("title")},w.cache.title&&D.removeAttr("title"),w.verbose("Saving original attributes",w.cache.title)}},restore:{conditions:function(){return w.cache&&w.cache.title&&(D.attr("title",w.cache.title),w.verbose("Restoring original attributes",w.cache.title)),!0}},supports:{svg:function(){return typeof SVGGraphicsElement===i}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},C.transition&&e.fn.transition!==i&&D.transition("is supported")?(w.set.visible(),a.transition({animation:C.transition+" in",queue:!1,debug:C.debug,verbose:C.verbose,duration:C.duration,onComplete:function(){w.bind.close(),t.call(a,I),C.onVisible.call(a,I)}})):w.error(S.noTransition)},hide:function(t){return t=e.isFunction(t)?t:function(){},w.debug("Hiding pop-up"),C.onHide.call(a,I)===!1?void w.debug("onHide callback returned false, cancelling popup animation"):void(C.transition&&e.fn.transition!==i&&D.transition("is supported")?a.transition({animation:C.transition+" out",queue:!1,duration:C.duration,debug:C.debug,verbose:C.verbose,onComplete:function(){w.reset(),t.call(a,I),C.onHidden.call(a,I)}}):w.error(S.noTransition))}},change:{content:function(e){a.html(e)}},get:{html:function(){return D.removeData(A.html),D.data(A.html)||C.html},title:function(){return D.removeData(A.title),D.data(A.title)||C.title},content:function(){return D.removeData(A.content),D.data(A.content)||D.attr("title")||C.content},variation:function(){return D.removeData(A.variation),D.data(A.variation)||C.variation},popup:function(){return a},popupOffset:function(){return a.offset()},calculations:function(){var e,n=L[0],i=F[0]==t,o=C.inline||C.popup&&C.movePopup?L.position():L.offset(),r=i?{top:0,left:0}:F.offset(),s={},c=i?{top:l.scrollTop(),left:l.scrollLeft()}:{top:0,left:0};return s={target:{element:L[0],width:L.outerWidth(),height:L.outerHeight(),top:o.top,left:o.left,margin:{}},popup:{width:a.outerWidth(),height:a.outerHeight()},parent:{width:v.outerWidth(),height:v.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:c.top,left:c.left},width:F.width(),height:F.height()}},C.setFluidWidth&&w.is.fluid()&&(s.container={width:a.parent().outerWidth()},s.popup.width=s.container.width),s.target.margin.top=C.inline?parseInt(t.getComputedStyle(n).getPropertyValue("margin-top"),10):0,s.target.margin.left=C.inline?w.is.rtl()?parseInt(t.getComputedStyle(n).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(n).getPropertyValue("margin-left"),10):0,e=s.screen,s.boundary={top:e.top+e.scroll.top,bottom:e.top+e.scroll.top+e.height,left:e.left+e.scroll.left,right:e.left+e.scroll.left+e.width},s},id:function(){return x},startEvent:function(){return"hover"==C.on?"mouseenter":"focus"==C.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==C.on?"mouseleave":"focus"==C.on&&"blur"},distanceFromBoundary:function(e,t){var n,i,o={};return t=t||w.get.calculations(),n=t.popup,i=t.boundary,e&&(o={top:e.top-i.top,left:e.left-i.left,right:i.right-(e.left+n.width),bottom:i.bottom-(e.top+n.height)},w.verbose("Distance from boundaries determined",e,o)),o},
e.each(n,function(n,i){if(e.isArray(i.results)&&(r=p.search.object(t,i.results,o)[0]))return!1})):(p.debug("Finding result in results object",t),r=p.search.object(t,n,o)[0]),r||!1}},select:{firstResult:function(){p.verbose("Selecting first result"),j.first().addClass(g.active)}},set:{focus:function(){T.addClass(g.focus)},loading:function(){T.addClass(g.loading)},value:function(e){p.verbose("Setting search input value",e),S.val(e)},type:function(e){e=e||h.type,"category"==h.type&&T.addClass(h.type)},buttonPressed:function(){A.addClass(g.pressed)}},remove:{loading:function(){T.removeClass(g.loading)},focus:function(){T.removeClass(g.focus)},buttonPressed:function(){A.removeClass(g.pressed)}},query:function(){var t=p.get.value(),n=p.read.cache(t);p.has.minimumCharacters()?(n?(p.debug("Reading result from cache",t),p.save.results(n.results),p.addResults(n.html),p.inject.id(n.results)):(p.debug("Querying for",t),e.isPlainObject(h.source)||e.isArray(h.source)?p.search.local(t):p.can.useAPI()?p.search.remote(t):p.error(x.source)),h.onSearchQuery.call(D,t)):p.hideResults()},search:{local:function(e){var t,n=p.search.object(e,h.content);p.set.loading(),p.save.results(n),p.debug("Returned local search results",n),t=p.generateResults({results:n}),p.remove.loading(),p.addResults(t),p.inject.id(n),p.write.cache(e,{html:t,results:n})},remote:function(e){T.api("is loading")&&T.api("abort"),p.setup.api(e),T.api("query")},object:function(t,n,o){var r=[],a=[],s=t.toString().replace(v.escape,"\\$&"),l=new RegExp(v.beginsWith+s,"i"),c=function(t,n){var i=e.inArray(n,r)==-1,o=e.inArray(n,a)==-1;i&&o&&t.push(n)};return n=n||h.source,o=o!==i?o:h.searchFields,e.isArray(o)||(o=[o]),n===i||n===!1?(p.error(x.source),[]):(e.each(o,function(i,o){e.each(n,function(e,n){var i="string"==typeof n[o];i&&(n[o].search(l)!==-1?c(r,n):h.searchFullText&&p.fuzzySearch(t,n[o])&&c(a,n))})}),e.merge(r,a))}},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,r=0;o<i;o++){for(var a=e.charCodeAt(o);r<n;)if(t.charCodeAt(r++)===a)continue e;return!1}return!0},parse:{response:function(e,t){var n=p.generateResults(e);p.verbose("Parsing server response",e),e!==i&&t!==i&&e[b.results]!==i&&(p.addResults(n),p.inject.id(e[b.results]),p.write.cache(t,{html:n,results:e[b.results]}),p.save.results(e[b.results]))}},cancel:{query:function(){p.can.useAPI()&&T.api("abort")}},has:{minimumCharacters:function(){var e=p.get.value(),t=e.length;return t>=h.minCharacters}},clear:{cache:function(e){var t=T.data(m.cache);e?e&&t&&t[e]&&(p.debug("Removing value from cache",e),delete t[e],T.data(m.cache,t)):(p.debug("Clearing cache",e),T.removeData(m.cache))}},read:{cache:function(e){var t=T.data(m.cache);return!!h.cache&&(p.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==i&&t[e])}},create:{id:function(e,t){var n,o,r=e+1;return t!==i?(n=String.fromCharCode(97+t),o=n+r,p.verbose("Creating category result id",o)):(o=r,p.verbose("Creating result id",o)),o},results:function(){0===E.length&&(E=e("<div />").addClass(g.results).appendTo(T))}},inject:{result:function(e,t,n){p.verbose("Injecting result into results");var o=n!==i?E.children().eq(n).children(y.result).eq(t):E.children(y.result).eq(t);p.verbose("Injecting results metadata",o),o.data(m.result,e)},id:function(t){p.debug("Injecting unique ids into results");var n=0,o=0;return"category"===h.type?e.each(t,function(t,r){o=0,e.each(r.results,function(e,t){var a=r.results[e];a.id===i&&(a.id=p.create.id(o,n)),p.inject.result(a,o,n),o++}),n++}):e.each(t,function(e,n){var r=t[e];r.id===i&&(r.id=p.create.id(o)),p.inject.result(r,o),o++}),t}},save:{results:function(e){p.verbose("Saving current search results to metadata",e),T.data(m.results,e)}},write:{cache:function(e,t){var n=T.data(m.cache)!==i?T.data(m.cache):{};h.cache&&(p.verbose("Writing generated html to cache",e,t),n[e]=t,T.data(m.cache,n))}},addResults:function(t){return e.isFunction(h.onResultsAdd)&&h.onResultsAdd.call(E,t)===!1?(p.debu
var t=a.filter("[data-"+C.tab+'^="'+e+'/"]').eq(0),n=t.data(C.tab)||!1;if(n){if(b.debug("Found default tab",n),D<x.maxDepth)return D++,b.get.defaultPath(n);b.error(T.recursion)}else b.debug("No default tabs found for",e,g);return D=0,e},navElement:function(e){return e=e||m,a.filter("[data-"+C.tab+'="'+e+'"]')},tabElement:function(e){var t,n,i,o;return e=e||m,i=b.utilities.pathToArray(e),o=b.utilities.last(i),t=g.filter("[data-"+C.tab+'="'+e+'"]'),n=g.filter("[data-"+C.tab+'="'+o+'"]'),t.length>0?t:n},tab:function(){return m}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return e.inArray(t,n)==-1})},last:function(t){return!!e.isArray(t)&&t[t.length-1]},pathToArray:function(e){return e===i&&(e=m),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return!!e.isArray(t)&&t.join("/")}},setting:function(t,n){if(b.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];e.isPlainObject(x[t])?e.extend(!0,x[t],n):x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},debug:function(){!x.silent&&x.debug&&(x.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,x.name+":"),b.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),b.verbose.apply(console,arguments)))},error:function(){x.silent||(b.error=Function.prototype.bind.call(console.error,console,x.name+":"),b.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:O,"Execution Time":n})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,500)},display:function(){var t=x.name+":",n=0;l=!1,clearTimeout(b.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var a,s,l,c=P;return n=n||f,o=O||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i?(s=c[o],!1):(b.error(T.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),s}},d?(P===i&&b.initialize(),b.invoke(u)):(P!==i&&P.invoke("destroy"),b.initialize())}),r!==i?r:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i
return"aborted"==t?(m.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),v.onAbort.call(R,t,S,e),!0):("invalid"==t?m.debug("JSON did not pass success test. A server-side error has most likely occurred",o):"error"==t&&e!==i&&(m.debug("XHR produced a server error",t,n),200!=e.status&&n!==i&&""!==n&&m.error(w.statusMessage+n,r.url),v.onError.call(R,a,S,e)),v.errorDuration&&"aborted"!==t&&(m.debug("Adding error state"),m.set.error(),m.should.removeError()&&setTimeout(m.remove.error,v.errorDuration)),m.debug("API Request failed",a,e),void v.onFailure.call(R,o,S,e))}}},create:{request:function(){return e.Deferred().always(m.event.request.complete).done(m.event.request.done).fail(m.event.request.fail)},mockedXHR:function(){var t,n,i,o=!1,r=!1,a=!1,s=v.mockResponse||v.response,l=v.mockResponseAsync||v.responseAsync;return i=e.Deferred().always(m.event.xhr.complete).done(m.event.xhr.done).fail(m.event.xhr.fail),s?(e.isFunction(s)?(m.debug("Using specified synchronous callback",s),n=s.call(R,f)):(m.debug("Using settings specified response",s),n=s),i.resolveWith(R,[n,o,{responseText:n}])):e.isFunction(l)&&(t=function(e){m.debug("Async callback returned response",e),e?i.resolveWith(R,[e,o,{responseText:e}]):i.rejectWith(R,[{responseText:e},r,a])},m.debug("Using specified async response callback",l),l.call(R,f,t)),i},xhr:function(){var t;return t=e.ajax(r).always(m.event.xhr.always).done(m.event.xhr.done).fail(m.event.xhr.fail),m.verbose("Created server request",t,r),t}},set:{error:function(){m.verbose("Adding error state to element",E),E.addClass(C.error)},loading:function(){m.verbose("Adding loading state to element",E),E.addClass(C.loading),g=(new Date).getTime()}},remove:{error:function(){m.verbose("Removing error state from element",E),E.removeClass(C.error)},loading:function(){m.verbose("Removing loading state from element",E),E.removeClass(C.loading)}},get:{responseFromXHR:function(t){return!!e.isPlainObject(t)&&(m.is.expectingJSON()?m.decode.json(t.responseText):t.responseText)},errorFromRequest:function(t,n,o){return e.isPlainObject(t)&&t.error!==i?t.error:v.error[n]!==i?v.error[n]:o},request:function(){return m.request||!1},xhr:function(){return m.xhr||!1},settings:function(){var t;return t=v.beforeSend.call(R,v),t&&(t.success!==i&&(m.debug("Legacy success callback detected",t),m.error(w.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==i&&(m.debug("Legacy failure callback detected",t),m.error(w.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==i&&(m.debug("Legacy complete callback detected",t),m.error(w.legacyParameters,t.complete),t.onComplete=t.complete)),t===i&&m.error(w.noReturnedValue),t===!1?t:t!==i?e.extend(!0,{},t):e.extend(!0,{},v)},urlEncodedValue:function(e){var n=t.decodeURIComponent(e),i=t.encodeURIComponent(e),o=n!==e;return o?(m.debug("URL value is already encoded, avoiding double encoding",e),e):(m.verbose("Encoding value using encodeURIComponent",e,i),i)},defaultData:function(){var t={};return e.isWindow(j)||(m.is.input()?t.value=S.val():m.is.form()||(t.text=S.text())),t},event:function(){return e.isWindow(j)||"now"==v.on?(m.debug("API called without element, no events attached"),!1):"auto"==v.on?S.is("input")?j.oninput!==i?"input":j.onpropertychange!==i?"propertychange":"keyup":S.is("form")?"submit":"click":v.on},templatedURL:function(e){if(e=e||S.data(y.action)||v.action||!1,p=S.data(y.url)||v.url||!1)return m.debug("Using specified url",p),p;if(e){if(m.debug("Looking up url for action",e,v.api),v.api[e]===i&&!m.is.mocked())return void m.error(w.missingAction,v.action,v.api);p=v.api[e]}else m.is.form()&&(p=S.attr("action")||E.attr("action")||!1,m.debug("No url or action specified, defaulting to form action",p));return p}},abort:function(){var e=m.get.xhr();e&&"resolved"!==e.state()&&(m.debug("Cancelling API request"),e.abort())},reset:function(){m.remove.error(),m.remove.loading()},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];e.isPlainObject(v[t])?e.extend(!0,v[t],n):v[t]=n}}
2019-02-23 13:59:41 +00:00
"string"!=typeof a&&(a=e(a)),a||(this.logger.warn("missed to pass in variable "+r[1]+" for interpolating "+t),a=""),t=t.replace(r[0],a),this.regexp.lastIndex=0;return t},t}(),H=function(e){function t(n,i,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};w(this,t);var a=T(this,e.call(this));return a.backend=n,a.store=i,a.services=o,a.options=r,a.logger=j.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,r.backend,r),a}return k(t,e),t.prototype.queueLoad=function(e,t,n){var i=this,o=[],r=[],a=[],s=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var a=e+"|"+t;i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?r.indexOf(a)<0&&r.push(a):(i.state[a]=1,n=!1,r.indexOf(a)<0&&r.push(a),o.indexOf(a)<0&&o.push(a),s.indexOf(t)<0&&s.push(t)))}),n||a.push(e)}),(o.length||r.length)&&this.queue.push({pending:r,loaded:{},errors:[],callback:n}),{toLoad:o,pending:r,toLoadLanguages:a,toLoadNamespaces:s}},t.prototype.loaded=function(e,t,n){var i=this,r=e.split("|"),a=S(r,2),s=a[0],l=a[1];t&&this.emit("failedLoading",s,l,t),n&&this.store.addResourceBundle(s,l,n),this.state[e]=t?-1:2,this.queue.forEach(function(n){o(n.loaded,[s],l),m(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(i.emit("loaded",n.loaded),n.errors.length?n.callback(n.errors):n.callback(),n.done=!0)}),this.queue=this.queue.filter(function(e){return!e.done})},t.prototype.read=function(e,t,n,i,o,r){var a=this;return i||(i=0),o||(o=250),e.length?void this.backend[n](e,t,function(s,l){return s&&l&&i<5?void setTimeout(function(){a.read.call(a,e,t,n,++i,2*o,r)},o):void r(s,l)}):r(null,{})},t.prototype.load=function(e,t,n){var i=this;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();var o=C({},this.backend.options,this.options.backend);"string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,n);if(!a.toLoad.length)return void(a.pending.length||n());if(o.allowMultiLoading&&this.backend.readMulti)this.read(a.toLoadLanguages,a.toLoadNamespaces,"readMulti",null,null,function(e,t){e&&i.logger.warn("loading namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading failed",e),!e&&t&&i.logger.log("loaded namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading",t),a.toLoad.forEach(function(n){var o=n.split("|"),a=S(o,2),s=a[0],l=a[1],c=r(t,[s,l]);if(c)i.loaded(n,e,c);else{var u="loading namespace "+l+" for language "+s+" via multiloading failed";i.loaded(n,u),i.logger.error(u)}})});else{var s=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("loading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("loaded namespace "+r+" for language "+o,i),t.loaded(e,n,i)})};a.toLoad.forEach(function(e){s.call(i,e)})}},t.prototype.reload=function(e,t){var n=this;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");var i=C({},this.backend.options,this.options.backend);if("string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]),i.allowMultiLoading&&this.backend.readMulti)this.read(e,t,"readMulti",null,null,function(i,o){i&&n.logger.warn("reloading namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading failed",i),!i&&o&&n.logger.log("reloaded namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading",o),e.forEach(function(e){t.forEach(function(t){var a=r(o,[e,t]);if(a)n.loaded(e+"|"+t,i,a);else{var s="reloading namespace "+t+" for language "+e+" via multiloading failed";n.loaded(e+"|"+t,s),n.logger.error(s)}})})});else{var o=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("reloading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("reloaded namespace "+r+" for