7 lines
188 KiB
JavaScript
7 lines
188 KiB
JavaScript
function _taggedTemplateLiteral(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"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){function n(e){var t=!!e&&"length"in e&&e.length,n=ae.type(e);return"function"===n||ae.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(ae.isFunction(t))return ae.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return ae.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(me.test(t))return ae.filter(t,e,n);t=ae.filter(t,e)}return ae.grep(e,function(e){return J.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return ae.each(e.match(xe)||[],function(e,n){t[n]=!0}),t}function r(){V.removeEventListener("DOMContentLoaded",r),e.removeEventListener("load",r),ae.ready()}function s(){this.expando=ae.expando+s.uid++}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace($e,"-$&").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ce.test(n)?ae.parseJSON(n):n}catch(i){}ke.set(e,t,n)}else n=void 0;return n}function u(e,t,n,o){var i,a=1,r=20,s=o?function(){return o.cur()}:function(){return ae.css(e,t,"")},l=s(),u=n&&n[3]||(ae.cssNumber[t]?"":"px"),c=(ae.cssNumber[t]||"px"!==u&&+l)&&Ae.exec(ae.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do a=a||".5",c/=a,ae.style(e,t,c+u);while(a!==(a=s()/l)&&1!==a&&--r)}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=i)),i}function c(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&ae.nodeName(e,t)?ae.merge([e],n):n}function d(e,t){for(var n=0,o=e.length;o>n;n++)Me.set(e[n],"globalEval",!t||Me.get(t[n],"globalEval"))}function p(e,t,n,o,i){for(var a,r,s,l,u,p,h=t.createDocumentFragment(),f=[],m=0,b=e.length;b>m;m++)if(a=e[m],a||0===a)if("object"===ae.type(a))ae.merge(f,a.nodeType?[a]:a);else if(Ne.test(a)){for(r=r||h.appendChild(t.createElement("div")),s=(Pe.exec(a)||["",""])[1].toLowerCase(),l=Oe[s]||Oe._default,r.innerHTML=l[1]+ae.htmlPrefilter(a)+l[2],p=l[0];p--;)r=r.lastChild;ae.merge(f,r.childNodes),r=h.firstChild,r.textContent=""}else f.push(t.createTextNode(a));for(h.textContent="",m=0;a=f[m++];)if(o&&ae.inArray(a,o)>-1)i&&i.push(a);else if(u=ae.contains(a.ownerDocument,a),r=c(h.appendChild(a),"script"),u&&d(r),n)for(p=0;a=r[p++];)Ie.test(a.type||"")&&n.push(a);return h}function h(){return!0}function f(){return!1}function m(){try{return V.activeElement}catch(e){}}function b(e,t,n,o,i,a){var r,s;if("object"==typeof t){"string"!=typeof n&&(o=o||n,n=void 0);for(s in t)b(e,s,n,o,t[s],a);return e}if(null==o&&null==i?(i=n,o=n=void 0):null==i&&("string"==typeof n?(i=o,o=void 0):(i=o,o=n,n=void 0)),i===!1)i=f;else if(!i)return this;return 1===a&&(r=i,i=function(e){return ae().off(e),r.apply(this,arguments)},i.guid=r.guid||(r.guid=ae.guid++)),e.each(function(){ae.event.add(this,t,i,o,n)})}function g(e,t){return ae.nodeName(e,"table")&&ae.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=We.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){var n,o,i,a,r,s,l,u;if(1===t.nodeType){if(Me.hasData(e)&&(a=Me.access(e),r=Me.set(t,a),u=a.events)){delete r.handle,r.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)ae.event.add(t,i,u[i][n])}ke.hasData(e)&&(s=ke.access(e),l=ae.extend({},s),ke.set(t,l))}}function x(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Le.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function _(e,t,n,o){t=Z.apply([],t);var i,a,r,s,l,u,d=0,h=e.length,f=h-1,m=t[0],b=ae.isFunction(m);if(b||h>1&&"string"==typeof m&&!oe.checkClone&&Be.test(m))return e.each(function(i){var a=e.eq(i);b&&(t[0]=m.call(this,i,a.html())),_(a,t,n,o)});if(h&&(i=p(t,e[0].ownerDocument,!1,e,o),a=i.firstChild,1===i.childNodes.length&&(i=a),a||o)){for(r=ae.map(c(i,"script"),v),s=r.length;h>d;d++)l=i,d!==f&&(l=ae.clone(l,!0,!0),s&&ae.merge(r,c(l,"script"))),n.call(e[d],l,d);if(s)for(u=r[r.length-1].ownerDocument,ae.map(r,y),d=0;s>d;d++)l=r[d],Ie.test(l.type||"")&&!Me.access(l,"globalEval")&&ae.contains(u,l)&&(l.src?ae._evalUrl&&ae._evalUrl(l.src):ae.globalEval(l.textContent.replace(Xe,"")))}return e}function j(e,t,n){for(var o,i=t?ae.filter(t,e):e,a=0;null!=(o=i[a]);a++)n||1!==o.nodeType||ae.cleanData(c(o)),o.parentNode&&(n&&ae.contains(o.ownerDocument,o)&&d(c(o,"script")),o.parentNode.removeChild(o));return e}function T(e,t){var n=ae(t.createElement(e)).appendTo(t.body),o=ae.css(n[0],"display");return n.detach(),o}function M(e){var t=V,n=Ye[e];return n||(n=T(e,t),"none"!==n&&n||(ze=(ze||ae("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=ze[0].contentDocument,t.write(),t.close(),n=T(e,t),ze.detach()),Ye[e]=n),n}function k(e,t,n){var o,i,a,r,s=e.style;return n=n||Ge(e),n&&(r=n.getPropertyValue(t)||n[t],""!==r||ae.contains(e.ownerDocument,e)||(r=ae.style(e,t)),!oe.pixelMarginRight()&&Ve.test(r)&&Ke.test(t)&&(o=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=r,r=n.width,s.width=o,s.minWidth=i,s.maxWidth=a)),void 0!==r?r+"":r}function C(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function $(e){if(e in ot)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=nt.length;n--;)if(e=nt[n]+t,e in ot)return e}function D(e,t,n){var o=Ae.exec(t);return o?Math.max(0,o[2]-(n||0))+(o[3]||"px"):t}function A(e,t,n,o,i){for(var a=n===(o?"border":"content")?4:"width"===t?1:0,r=0;4>a;a+=2)"margin"===n&&(r+=ae.css(e,n+Ee[a],!0,i)),o?("content"===n&&(r-=ae.css(e,"padding"+Ee[a],!0,i)),"margin"!==n&&(r-=ae.css(e,"border"+Ee[a]+"Width",!0,i))):(r+=ae.css(e,"padding"+Ee[a],!0,i),"padding"!==n&&(r+=ae.css(e,"border"+Ee[a]+"Width",!0,i)));return r}function E(t,n,o){var i=!0,a="width"===n?t.offsetWidth:t.offsetHeight,r=Ge(t),s="border-box"===ae.css(t,"boxSizing",!1,r);if(V.msFullscreenElement&&e.top!==e&&t.getClientRects().length&&(a=Math.round(100*t.getBoundingClientRect()[n])),0>=a||null==a){if(a=k(t,n,r),(0>a||null==a)&&(a=t.style[n]),Ve.test(a))return a;i=s&&(oe.boxSizingReliable()||a===t.style[n]),a=parseFloat(a)||0}return a+A(t,n,o||(s?"border":"content"),i,r)+"px"}function S(e,t){for(var n,o,i,a=[],r=0,s=e.length;s>r;r++)o=e[r],o.style&&(a[r]=Me.get(o,"olddisplay"),n=o.style.display,t?(a[r]||"none"!==n||(o.style.display=""),""===o.style.display&&Se(o)&&(a[r]=Me.access(o,"olddisplay",M(o.nodeName)))):(i=Se(o),"none"===n&&i||Me.set(o,"olddisplay",i?n:ae.css(o,"display"))));for(r=0;s>r;r++)o=e[r],o.style&&(t&&"none"!==o.style.display&&""!==o.style.display||(o.style.display=t?a[r]||"":"none"));return e}function L(e,t,n,o,i){return new L.prototype.init(e,t,n,o,i)}function P(){return e.setTimeout(function(){it=void 0}),it=ae.now()}function I(e,t){var n,o=0,i={height:e};for(t=t?1:0;4>o;o+=2-t)n=Ee[o],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function O(e,t,n){for(var o,i=(H.tweeners[t]||[]).concat(H.tweeners["*"]),a=0,r=i.length;r>a;a++)if(o=i[a].call(n,t,e))return o}function N(e,t,n){var o,i,a,r,s,l,u,c,d=this,p={},h=e.style,f=e.nodeType&&Se(e),m=Me.get(e,"fxshow");n.queue||(s=ae._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,ae.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=ae.css(e,"display"),c="none"===u?Me.get(e,"olddisplay")||M(e.nodeName):u,"inline"===c&&"none"===ae.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(o in t)if(i=t[o],rt.exec(i)){if(delete t[o],a=a||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!m||void 0===m[o])continue;f=!0}p[o]=m&&m[o]||ae.style(e,o)}else u=void 0;if(ae.isEmptyObject(p))"inline"===("none"===u?M(e.nodeName):u)&&(h.display=u);else{m?"hidden"in m&&(f=m.hidden):m=Me.access(e,"fxshow",{}),a&&(m.hidden=!f),f?ae(e).show():d.done(function(){ae(e).hide()}),d.done(function(){var t;Me.remove(e,"fxshow");for(t in p)ae.style(e,t,p[t])});for(o in p)r=O(f?m[o]:0,o,d),o in m||(m[o]=r.start,f&&(r.end=r.start,r.start="width"===o||"height"===o?1:0))}}function q(e,t){var n,o,i,a,r;for(n in e)if(o=ae.camelCase(n),i=t[o],a=e[n],ae.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==o&&(e[o]=a,delete e[n]),r=ae.cssHooks[o],r&&"expand"in r){a=r.expand(a),delete e[o];for(n in a)n in e||(e[n]=a[n],t[n]=i)}else t[o]=i}function H(e,t,n){var o,i,a=0,r=H.prefilters.length,s=ae.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=it||P(),n=Math.max(0,u.startTime+u.duration-t),o=n/u.duration||0,a=1-o,r=0,l=u.tweens.length;l>r;r++)u.tweens[r].run(a);return s.notifyWith(e,[u,a,n]),1>a&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:ae.extend({},t),opts:ae.extend(!0,{specialEasing:{},easing:ae.easing._default},n),originalProperties:t,originalOptions:n,startTime:it||P(),duration:n.duration,tweens:[],createTween:function(t,n){var o=ae.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(o),o},stop:function(t){var n=0,o=t?u.tweens.length:0;if(i)return this;for(i=!0;o>n;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(q(c,u.opts.specialEasing);r>a;a++)if(o=H.prefilters[a].call(u,e,c,u.opts))return ae.isFunction(o.stop)&&(ae._queueHooks(u.elem,u.opts.queue).stop=ae.proxy(o.stop,o)),o;return ae.map(c,O,u),ae.isFunction(u.opts.start)&&u.opts.start.call(e,u),ae.fx.timer(ae.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function R(e){return e.getAttribute&&e.getAttribute("class")||""}function F(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var o,i=0,a=t.toLowerCase().match(xe)||[];if(ae.isFunction(n))for(;o=a[i++];)"+"===o[0]?(o=o.slice(1)||"*",(e[o]=e[o]||[]).unshift(n)):(e[o]=e[o]||[]).push(n)}}function U(e,t,n,o){function i(s){var l;return a[s]=!0,ae.each(e[s]||[],function(e,s){var u=s(t,n,o);return"string"!=typeof u||r||a[u]?r?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}var a={},r=e===Mt;return i(t.dataTypes[0])||!a["*"]&&i("*")}function B(e,t){var n,o,i=ae.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:o||(o={}))[n]=t[n]);return o&&ae.extend(!0,e,o),e}function W(e,t,n){for(var o,i,a,r,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(i in s)if(s[i]&&s[i].test(o)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}r||(r=i)}a=a||r}return a?(a!==l[0]&&l.unshift(a),n[a]):void 0}function X(e,t,n,o){var i,a,r,s,l,u={},c=e.dataTypes.slice();if(c[1])for(r in e.converters)u[r.toLowerCase()]=e.converters[r];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(r=u[l+" "+a]||u["* "+a],!r)for(i in u)if(s=i.split(" "),s[1]===a&&(r=u[l+" "+s[0]]||u["* "+s[0]])){r===!0?r=u[i]:u[i]!==!0&&(a=s[0],c.unshift(s[1]));break}if(r!==!0)if(r&&e["throws"])t=r(t);else try{t=r(t)}catch(d){return{state:"parsererror",error:r?d:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}function z(e,t,n,o){var i;if(ae.isArray(t))ae.each(t,function(t,i){n||Dt.test(e)?o(e,i):z(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,o)});else if(n||"object"!==ae.type(t))o(e,t);else for(i in t)z(e+"["+i+"]",t[i],n,o)}function Y(e){return ae.isWindow(e)?e:9===e.nodeType&&e.defaultView}var K=[],V=e.document,G=K.slice,Z=K.concat,Q=K.push,J=K.indexOf,ee={},te=ee.toString,ne=ee.hasOwnProperty,oe={},ie="2.2.0",ae=function(e,t){return new ae.fn.init(e,t)},re=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,se=/^-ms-/,le=/-([\da-z])/gi,ue=function(e,t){return t.toUpperCase()};ae.fn=ae.prototype={jquery:ie,constructor:ae,selector:"",length:0,toArray:function(){return G.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:G.call(this)},pushStack:function(e){var t=ae.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return ae.each(this,e)},map:function(e){return this.pushStack(ae.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(G.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:Q,sort:K.sort,splice:K.splice},ae.extend=ae.fn.extend=function(){var e,t,n,o,i,a,r=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof r&&(u=r,r=arguments[s]||{},s++),"object"==typeof r||ae.isFunction(r)||(r={}),s===l&&(r=this,s--);l>s;s++)if(null!=(e=arguments[s]))for(t in e)n=r[t],o=e[t],r!==o&&(u&&o&&(ae.isPlainObject(o)||(i=ae.isArray(o)))?(i?(i=!1,a=n&&ae.isArray(n)?n:[]):a=n&&ae.isPlainObject(n)?n:{},r[t]=ae.extend(u,a,o)):void 0!==o&&(r[t]=o));return r},ae.extend({expando:"jQuery"+(ie+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ae.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!ae.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){return"object"!==ae.type(e)||e.nodeType||ae.isWindow(e)?!1:e.constructor&&!ne.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ee[te.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=ae.trim(e),e&&(1===e.indexOf("use strict")?(t=V.createElement("script"),t.text=e,V.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(se,"ms-").replace(le,ue)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var o,i=0;if(n(e))for(o=e.length;o>i&&t.call(e[i],i,e[i])!==!1;i++);else for(i in e)if(t.call(e[i],i,e[i])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(re,"")},makeArray:function(e,t){var o=t||[];return null!=e&&(n(Object(e))?ae.merge(o,"string"==typeof e?[e]:e):Q.call(o,e)),o},inArray:function(e,t,n){return null==t?-1:J.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,i=e.length;n>o;o++)e[i++]=t[o];return e.length=i,e},grep:function(e,t,n){for(var o,i=[],a=0,r=e.length,s=!n;r>a;a++)o=!t(e[a],a),o!==s&&i.push(e[a]);return i},map:function(e,t,o){var i,a,r=0,s=[];if(n(e))for(i=e.length;i>r;r++)a=t(e[r],r,o),null!=a&&s.push(a);else for(r in e)a=t(e[r],r,o),null!=a&&s.push(a);return Z.apply([],s)},guid:1,proxy:function(e,t){var n,o,i;return"string"==typeof t&&(n=e[t],t=e,e=n),ae.isFunction(e)?(o=G.call(arguments,2),i=function(){return e.apply(t||this,o.concat(G.call(arguments)))},i.guid=e.guid=e.guid||ae.guid++,i):void 0},now:Date.now,support:oe}),"function"==typeof Symbol&&(ae.fn[Symbol.iterator]=K[Symbol.iterator]),ae.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){ee["[object "+t+"]"]=t.toLowerCase()});var ce=function(e){function t(e,t,n,o){var i,a,r,s,l,u,d,h,f=t&&t.ownerDocument,m=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==m&&9!==m&&11!==m)return n;if(!o&&((t?t.ownerDocument||t:R)!==S&&E(t),t=t||S,P)){if(11!==m&&(u=ge.exec(e)))if(i=u[1]){if(9===m){if(!(r=t.getElementById(i)))return n;if(r.id===i)return n.push(r),n}else if(f&&(r=f.getElementById(i))&&q(t,r)&&r.id===i)return n.push(r),n}else{if(u[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&x.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(i)),n}if(x.qsa&&!X[e+" "]&&(!I||!I.test(e))){if(1!==m)f=t,h=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(ye,"\\$&"):t.setAttribute("id",s=H),d=M(e),a=d.length,l=pe.test(s)?"#"+s:"[id='"+s+"']";a--;)d[a]=l+" "+p(d[a]);h=d.join(","),f=ve.test(e)&&c(t.parentNode)||t}if(h)try{return Q.apply(n,f.querySelectorAll(h)),n}catch(b){}finally{s===H&&t.removeAttribute("id")}}}return C(e.replace(se,"$1"),t,n,o)}function n(){function e(n,o){return t.push(n+" ")>_.cacheLength&&delete e[t.shift()],e[n+" "]=o}var t=[];return e}function o(e){return e[H]=!0,e}function i(e){var t=S.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),o=n.length;o--;)_.attrHandle[n[o]]=t}function r(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return o(function(t){return t=+t,o(function(n,o){for(var i,a=e([],n.length,t),r=a.length;r--;)n[i=a[r]]&&(n[i]=!(o[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,o="";n>t;t++)o+=e[t].value;return o}function h(e,t,n){var o=t.dir,i=n&&"parentNode"===o,a=U++;return t.first?function(t,n,a){for(;t=t[o];)if(1===t.nodeType||i)return e(t,n,a)}:function(t,n,r){var s,l,u,c=[F,a];if(r){for(;t=t[o];)if((1===t.nodeType||i)&&e(t,n,r))return!0}else for(;t=t[o];)if(1===t.nodeType||i){if(u=t[H]||(t[H]={}),l=u[t.uniqueID]||(u[t.uniqueID]={}),(s=l[o])&&s[0]===F&&s[1]===a)return c[2]=s[2];if(l[o]=c,c[2]=e(t,n,r))return!0}}}function f(e){return e.length>1?function(t,n,o){for(var i=e.length;i--;)if(!e[i](t,n,o))return!1;return!0}:e[0]}function m(e,n,o){for(var i=0,a=n.length;a>i;i++)t(e,n[i],o);return o}function b(e,t,n,o,i){for(var a,r=[],s=0,l=e.length,u=null!=t;l>s;s++)(a=e[s])&&(!n||n(a,o,i))&&(r.push(a),u&&t.push(s));return r}function g(e,t,n,i,a,r){return i&&!i[H]&&(i=g(i)),a&&!a[H]&&(a=g(a,r)),o(function(o,r,s,l){var u,c,d,p=[],h=[],f=r.length,g=o||m(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?g:b(g,p,e,s,l),y=n?a||(o?e:f||i)?[]:r:v;if(n&&n(v,y,s,l),i)for(u=b(y,h),i(u,[],s,l),c=u.length;c--;)(d=u[c])&&(y[h[c]]=!(v[h[c]]=d));if(o){if(a||e){if(a){for(u=[],c=y.length;c--;)(d=y[c])&&u.push(v[c]=d);a(null,y=[],u,l)}for(c=y.length;c--;)(d=y[c])&&(u=a?ee(o,d):p[c])>-1&&(o[u]=!(r[u]=d))}}else y=b(y===r?y.splice(f,y.length):y),a?a(null,r,y,l):Q.apply(r,y)})}function v(e){for(var t,n,o,i=e.length,a=_.relative[e[0].type],r=a||_.relative[" "],s=a?1:0,l=h(function(e){return e===t},r,!0),u=h(function(e){return ee(t,e)>-1},r,!0),c=[function(e,n,o){var i=!a&&(o||n!==$)||((t=n).nodeType?l(e,n,o):u(e,n,o));return t=null,i}];i>s;s++)if(n=_.relative[e[s].type])c=[h(f(c),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[H]){for(o=++s;i>o&&!_.relative[e[o].type];o++);return g(s>1&&f(c),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,o>s&&v(e.slice(s,o)),i>o&&v(e=e.slice(o)),i>o&&p(e))}c.push(n)}return f(c)}function y(e,n){var i=n.length>0,a=e.length>0,r=function(o,r,s,l,u){var c,d,p,h=0,f="0",m=o&&[],g=[],v=$,y=o||a&&_.find.TAG("*",u),w=F+=null==v?1:Math.random()||.1,x=y.length;for(u&&($=r===S||r||u);f!==x&&null!=(c=y[f]);f++){if(a&&c){for(d=0,r||c.ownerDocument===S||(E(c),s=!P);p=e[d++];)if(p(c,r||S,s)){l.push(c);break}u&&(F=w)}i&&((c=!p&&c)&&h--,o&&m.push(c))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,g,r,s);if(o){if(h>0)for(;f--;)m[f]||g[f]||(g[f]=G.call(l));g=b(g)}Q.apply(l,g),u&&!o&&g.length>0&&h+n.length>1&&t.uniqueSort(l)}return u&&(F=w,$=v),m};return i?o(r):r}var w,x,_,j,T,M,k,C,$,D,A,E,S,L,P,I,O,N,q,H="sizzle"+1*new Date,R=e.document,F=0,U=0,B=n(),W=n(),X=n(),z=function(e,t){return e===t&&(A=!0),0},Y=1<<31,K={}.hasOwnProperty,V=[],G=V.pop,Z=V.push,Q=V.push,J=V.slice,ee=function(e,t){for(var n=0,o=e.length;o>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",oe="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie="\\["+ne+"*("+oe+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+oe+"))|)"+ne+"*\\]",ae=":("+oe+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",re=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ue=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(ae),pe=new RegExp("^"+oe+"$"),he={ID:new RegExp("^#("+oe+")"),CLASS:new RegExp("^\\.("+oe+")"),TAG:new RegExp("^("+oe+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},fe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,be=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,ye=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var o="0x"+t-65536;return o!==o||n?t:0>o?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},_e=function(){E()};try{Q.apply(V=J.call(R.childNodes),R.childNodes),V[R.childNodes.length].nodeType}catch(je){Q={apply:V.length?function(e,t){Z.apply(e,J.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}x=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},E=t.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:R;return o!==S&&9===o.nodeType&&o.documentElement?(S=o,L=S.documentElement,P=!T(S),(n=S.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",_e,!1):n.attachEvent&&n.attachEvent("onunload",_e)),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(S.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=be.test(S.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=H,!S.getElementsByName||!S.getElementsByName(H).length}),x.getById?(_.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n=t.getElementById(e);return n?[n]:[]}},_.filter.ID=function(e){var t=e.replace(we,xe);return function(e){return e.getAttribute("id")===t}}):(delete _.find.ID,_.filter.ID=function(e){var t=e.replace(we,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&o.push(n);return o}return a},_.find.CLASS=x.getElementsByClassName&&function(e,t){return"undefined"!=typeof t.getElementsByClassName&&P?t.getElementsByClassName(e):void 0},O=[],I=[],(x.qsa=be.test(S.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="<a id='"+H+"'></a><select id='"+H+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||I.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||I.push("~="),e.querySelectorAll(":checked").length||I.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||I.push(".#.+[+~]")}),i(function(e){var t=S.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&I.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||I.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),I.push(",.*:")})),(x.matchesSelector=be.test(N=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=N.call(e,"div"),N.call(e,"[s!='']:x"),O.push("!=",ae)}),I=I.length&&new RegExp(I.join("|")),O=O.length&&new RegExp(O.join("|")),t=be.test(L.compareDocumentPosition),q=t||be.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===S||e.ownerDocument===R&&q(R,e)?-1:t===S||t.ownerDocument===R&&q(R,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,o=0,i=e.parentNode,a=t.parentNode,s=[e],l=[t];if(!i||!a)return e===S?-1:t===S?1:i?-1:a?1:D?ee(D,e)-ee(D,t):0;if(i===a)return r(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[o]===l[o];)o++;return o?r(s[o],l[o]):s[o]===R?-1:l[o]===R?1:0},S):S},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==S&&E(e),n=n.replace(ce,"='$1']"),x.matchesSelector&&P&&!X[n+" "]&&(!O||!O.test(n))&&(!I||!I.test(n)))try{var o=N.call(e,n);if(o||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(i){}return t(n,S,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==S&&E(e),q(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==S&&E(e);var n=_.attrHandle[t.toLowerCase()],o=n&&K.call(_.attrHandle,t.toLowerCase())?n(e,t,!P):void 0;return void 0!==o?o:x.attributes||!P?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],o=0,i=0;if(A=!x.detectDuplicates,D=!x.sortStable&&e.slice(0),e.sort(z),A){for(;t=e[i++];)t===e[i]&&(o=n.push(i));for(;o--;)e.splice(n[o],1)}return D=null,e},j=t.getText=function(e){var t,n="",o=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=j(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[o++];)n+=j(t);return n},_=t.selectors={cacheLength:50,createPseudo:o,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(we,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(we,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},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 he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=M(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(we,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&B(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,o){return function(i){var a=t.attr(i,e);return null==a?"!="===n:n?(a+="","="===n?a===o:"!="===n?a!==o:"^="===n?o&&0===a.indexOf(o):"*="===n?o&&a.indexOf(o)>-1:"$="===n?o&&a.slice(-o.length)===o:"~="===n?(" "+a.replace(re," ")+" ").indexOf(o)>-1:"|="===n?a===o||a.slice(0,o.length+1)===o+"-":!1):!0}},CHILD:function(e,t,n,o,i){var a="nth"!==e.slice(0,3),r="last"!==e.slice(-4),s="of-type"===t;return 1===o&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,p,h,f,m=a!==r?"nextSibling":"previousSibling",b=t.parentNode,g=s&&t.nodeName.toLowerCase(),v=!l&&!s,y=!1;if(b){if(a){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[r?b.firstChild:b.lastChild],r&&v){for(p=b,d=p[H]||(p[H]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],h=u[0]===F&&u[1],y=h&&u[2],p=h&&b.childNodes[h];p=++h&&p&&p[m]||(y=h=0)||f.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[F,h,y];break}}else if(v&&(p=t,d=p[H]||(p[H]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],h=u[0]===F&&u[1],y=h),y===!1)for(;(p=++h&&p&&p[m]||(y=h=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++y||(v&&(d=p[H]||(p[H]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),c[e]=[F,y]),p!==t)););return y-=i,y===o||y%o===0&&y/o>=0}}},PSEUDO:function(e,n){var i,a=_.pseudos[e]||_.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return a[H]?a(n):a.length>1?(i=[e,e,"",n],_.setFilters.hasOwnProperty(e.toLowerCase())?o(function(e,t){for(var o,i=a(e,n),r=i.length;r--;)o=ee(e,i[r]),e[o]=!(t[o]=i[r])}):function(e){return a(e,0,i)}):a}},pseudos:{not:o(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[H]?o(function(e,t,n,o){for(var a,r=i(e,null,o,[]),s=e.length;s--;)(a=r[s])&&(e[s]=!(t[s]=a))}):function(e,o,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}}),has:o(function(e){return function(n){return t(e,n).length>0}}),contains:o(function(e){return e=e.replace(we,xe),function(t){return(t.textContent||t.innerText||j(t)).indexOf(e)>-1}}),lang:o(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(we,xe).toLowerCase(),function(t){var n;do if(n=P?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===S.activeElement&&(!S.hasFocus||S.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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!_.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return fe.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(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var o=0>n?n+t:n;--o>=0;)e.push(o);return e}),gt:u(function(e,t,n){for(var o=0>n?n+t:n;++o<t;)e.push(o);return e})}},_.pseudos.nth=_.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})_.pseudos[w]=l(w);return d.prototype=_.filters=_.pseudos,_.setFilters=new d,M=t.tokenize=function(e,n){var o,i,a,r,s,l,u,c=W[e+" "];if(c)return n?0:c.slice(0);for(s=e,l=[],u=_.preFilter;s;){(!o||(i=le.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),o=!1,(i=ue.exec(s))&&(o=i.shift(),a.push({value:o,type:i[0].replace(se," ")}),s=s.slice(o.length));for(r in _.filter)!(i=he[r].exec(s))||u[r]&&!(i=u[r](i))||(o=i.shift(),a.push({value:o,type:r,matches:i}),s=s.slice(o.length));if(!o)break}return n?s.length:s?t.error(e):W(e,l).slice(0)},k=t.compile=function(e,t){var n,o=[],i=[],a=X[e+" "];if(!a){for(t||(t=M(e)),n=t.length;n--;)a=v(t[n]),a[H]?o.push(a):i.push(a);a=X(e,y(i,o)),a.selector=e}return a},C=t.select=function(e,t,n,o){var i,a,r,s,l,u="function"==typeof e&&e,d=!o&&M(e=u.selector||e);if(n=n||[],1===d.length){if(a=d[0]=d[0].slice(0),a.length>2&&"ID"===(r=a[0]).type&&x.getById&&9===t.nodeType&&P&&_.relative[a[1].type]){if(t=(_.find.ID(r.matches[0].replace(we,xe),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=he.needsContext.test(e)?0:a.length;i--&&(r=a[i],!_.relative[s=r.type]);)if((l=_.find[s])&&(o=l(r.matches[0].replace(we,xe),ve.test(a[0].type)&&c(t.parentNode)||t))){if(a.splice(i,1),e=o.length&&p(a),!e)return Q.apply(n,o),n;break}}return(u||k(e,d))(o,t,!P,n,!t||ve.test(e)&&c(t.parentNode)||t),n},x.sortStable=H.split("").sort(z).join("")===H,x.detectDuplicates=!!A,E(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(S.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||a(te,function(e,t,n){var o;return n?void 0:e[t]===!0?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),t}(e);ae.find=ce,ae.expr=ce.selectors,ae.expr[":"]=ae.expr.pseudos,ae.uniqueSort=ae.unique=ce.uniqueSort,ae.text=ce.getText,ae.isXMLDoc=ce.isXML,ae.contains=ce.contains;var de=function(e,t,n){for(var o=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&ae(e).is(n))break;o.push(e)}return o},pe=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},he=ae.expr.match.needsContext,fe=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,me=/^.[^:#\[\.,]*$/;ae.filter=function(e,t,n){var o=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===o.nodeType?ae.find.matchesSelector(o,e)?[o]:[]:ae.find.matches(e,ae.grep(t,function(e){return 1===e.nodeType}))},ae.fn.extend({find:function(e){var t,n=this.length,o=[],i=this;if("string"!=typeof e)return this.pushStack(ae(e).filter(function(){for(t=0;n>t;t++)if(ae.contains(i[t],this))return!0}));for(t=0;n>t;t++)ae.find(e,i[t],o);return o=this.pushStack(n>1?ae.unique(o):o),o.selector=this.selector?this.selector+" "+e:e,o},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&he.test(e)?ae(e):e||[],!1).length}});var be,ge=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ve=ae.fn.init=function(e,t,n){var o,i;if(!e)return this;if(n=n||be,"string"==typeof e){if(o="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ge.exec(e),!o||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof ae?t[0]:t,ae.merge(this,ae.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:V,!0)),fe.test(o[1])&&ae.isPlainObject(t))for(o in t)ae.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return i=V.getElementById(o[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ae.isFunction(e)?void 0!==n.ready?n.ready(e):e(ae):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ae.makeArray(e,this))};ve.prototype=ae.fn,be=ae(V);var ye=/^(?:parents|prev(?:Until|All))/,we={children:!0,contents:!0,next:!0,prev:!0};ae.fn.extend({has:function(e){var t=ae(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(ae.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,o=0,i=this.length,a=[],r=he.test(e)||"string"!=typeof e?ae(e,t||this.context):0;i>o;o++)for(n=this[o];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&ae.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?ae.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?J.call(ae(e),this[0]):J.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ae.uniqueSort(ae.merge(this.get(),ae(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ae.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return de(e,"parentNode")},parentsUntil:function(e,t,n){return de(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return de(e,"nextSibling")},prevAll:function(e){return de(e,"previousSibling")},nextUntil:function(e,t,n){return de(e,"nextSibling",n)},prevUntil:function(e,t,n){return de(e,"previousSibling",n)},siblings:function(e){return pe((e.parentNode||{}).firstChild,e)},children:function(e){return pe(e.firstChild)},contents:function(e){return e.contentDocument||ae.merge([],e.childNodes)}},function(e,t){ae.fn[e]=function(n,o){var i=ae.map(this,t,n);return"Until"!==e.slice(-5)&&(o=n),o&&"string"==typeof o&&(i=ae.filter(o,i)),this.length>1&&(we[e]||ae.uniqueSort(i),ye.test(e)&&i.reverse()),this.pushStack(i)}});var xe=/\S+/g;ae.Callbacks=function(e){e="string"==typeof e?a(e):ae.extend({},e);var t,n,o,i,r=[],s=[],l=-1,u=function(){for(i=e.once,o=t=!0;s.length;l=-1)for(n=s.shift();++l<r.length;)r[l].apply(n[0],n[1])===!1&&e.stopOnFalse&&(l=r.length,n=!1);e.memory||(n=!1),t=!1,i&&(r=n?[]:"")},c={add:function(){return r&&(n&&!t&&(l=r.length-1,s.push(n)),function o(t){ae.each(t,function(t,n){ae.isFunction(n)?e.unique&&c.has(n)||r.push(n):n&&n.length&&"string"!==ae.type(n)&&o(n)})}(arguments),n&&!t&&u()),this},remove:function(){return ae.each(arguments,function(e,t){for(var n;(n=ae.inArray(t,r,n))>-1;)r.splice(n,1),l>=n&&l--}),this},has:function(e){return e?ae.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return i=s=[],r=n="",this},disabled:function(){return!r},lock:function(){return i=s=[],n||(r=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!o}};return c},ae.extend({Deferred:function(e){var t=[["resolve","done",ae.Callbacks("once memory"),"resolved"],["reject","fail",ae.Callbacks("once memory"),"rejected"],["notify","progress",ae.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ae.Deferred(function(n){ae.each(t,function(t,a){var r=ae.isFunction(e[t])&&e[t];i[a[1]](function(){var e=r&&r.apply(this,arguments);e&&ae.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this===o?n.promise():this,r?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ae.extend(e,o):o}},i={};return o.pipe=o.then,ae.each(t,function(e,a){var r=a[2],s=a[3];o[a[1]]=r.add,s&&r.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[a[0]]=function(){return i[a[0]+"With"](this===i?o:this,arguments),this},i[a[0]+"With"]=r.fireWith}),o.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,o,i=0,a=G.call(arguments),r=a.length,s=1!==r||e&&ae.isFunction(e.promise)?r:0,l=1===s?e:ae.Deferred(),u=function(e,n,o){return function(i){n[e]=this,o[e]=arguments.length>1?G.call(arguments):i,o===t?l.notifyWith(n,o):--s||l.resolveWith(n,o)}};if(r>1)for(t=new Array(r),n=new Array(r),o=new Array(r);r>i;i++)a[i]&&ae.isFunction(a[i].promise)?a[i].promise().progress(u(i,n,t)).done(u(i,o,a)).fail(l.reject):--s;return s||l.resolveWith(o,a),l.promise()}});var _e;ae.fn.ready=function(e){return ae.ready.promise().done(e),this},ae.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ae.readyWait++:ae.ready(!0)},ready:function(e){(e===!0?--ae.readyWait:ae.isReady)||(ae.isReady=!0,e!==!0&&--ae.readyWait>0||(_e.resolveWith(V,[ae]),ae.fn.triggerHandler&&(ae(V).triggerHandler("ready"),ae(V).off("ready"))))}}),ae.ready.promise=function(t){return _e||(_e=ae.Deferred(),"complete"===V.readyState||"loading"!==V.readyState&&!V.documentElement.doScroll?e.setTimeout(ae.ready):(V.addEventListener("DOMContentLoaded",r),e.addEventListener("load",r))),_e.promise(t)},ae.ready.promise();var je=function(e,t,n,o,i,a,r){var s=0,l=e.length,u=null==n;if("object"===ae.type(n)){i=!0;for(s in n)je(e,t,s,n[s],!0,a,r)}else if(void 0!==o&&(i=!0,ae.isFunction(o)||(r=!0),u&&(r?(t.call(e,o),t=null):(u=t,t=function(e,t,n){return u.call(ae(e),n)})),t))for(;l>s;s++)t(e[s],n,r?o:o.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):a},Te=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};s.uid=1,s.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!Te(e))return{};var t=e[this.expando];return t||(t={},Te(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var o,i=this.cache(e);if("string"==typeof t)i[t]=n;else for(o in t)i[o]=t[o];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var o;return void 0===t||t&&"string"==typeof t&&void 0===n?(o=this.get(e,t),void 0!==o?o:this.get(e,ae.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,o,i,a=e[this.expando];if(void 0!==a){if(void 0===t)this.register(e);else{ae.isArray(t)?o=t.concat(t.map(ae.camelCase)):(i=ae.camelCase(t),t in a?o=[t,i]:(o=i,o=o in a?[o]:o.match(xe)||[])),n=o.length;for(;n--;)delete a[o[n]]}(void 0===t||ae.isEmptyObject(a))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ae.isEmptyObject(t)}};var Me=new s,ke=new s,Ce=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,$e=/[A-Z]/g;ae.extend({hasData:function(e){return ke.hasData(e)||Me.hasData(e)},data:function(e,t,n){return ke.access(e,t,n)},removeData:function(e,t){ke.remove(e,t)},_data:function(e,t,n){return Me.access(e,t,n)},_removeData:function(e,t){Me.remove(e,t)}}),ae.fn.extend({data:function(e,t){var n,o,i,a=this[0],r=a&&a.attributes;if(void 0===e){if(this.length&&(i=ke.get(a),1===a.nodeType&&!Me.get(a,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&(o=r[n].name,0===o.indexOf("data-")&&(o=ae.camelCase(o.slice(5)),l(a,o,i[o])));Me.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ke.set(this,e)}):je(this,function(t){var n,o;if(a&&void 0===t){if(n=ke.get(a,e)||ke.get(a,e.replace($e,"-$&").toLowerCase()),void 0!==n)return n;if(o=ae.camelCase(e),n=ke.get(a,o),void 0!==n)return n;if(n=l(a,o,void 0),void 0!==n)return n}else o=ae.camelCase(e),this.each(function(){var n=ke.get(this,o);ke.set(this,o,t),e.indexOf("-")>-1&&void 0!==n&&ke.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){ke.remove(this,e)})}}),ae.extend({queue:function(e,t,n){var o;return e?(t=(t||"fx")+"queue",o=Me.get(e,t),n&&(!o||ae.isArray(n)?o=Me.access(e,t,ae.makeArray(n)):o.push(n)),o||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=ae.queue(e,t),o=n.length,i=n.shift(),a=ae._queueHooks(e,t),r=function(){ae.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),o--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,r,a)),!o&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Me.get(e,n)||Me.access(e,n,{empty:ae.Callbacks("once memory").add(function(){Me.remove(e,[t+"queue",n])})})}}),ae.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?ae.queue(this[0],e):void 0===t?this:this.each(function(){var n=ae.queue(this,e,t);ae._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&ae.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ae.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,o=1,i=ae.Deferred(),a=this,r=this.length,s=function(){--o||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";r--;)n=Me.get(a[r],e+"queueHooks"),n&&n.empty&&(o++,n.empty.add(s));return s(),i.promise(t)}});var De=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ae=new RegExp("^(?:([+-])=|)("+De+")([a-z%]*)$","i"),Ee=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===ae.css(e,"display")||!ae.contains(e.ownerDocument,e)},Le=/^(?:checkbox|radio)$/i,Pe=/<([\w:-]+)/,Ie=/^$|\/(?:java|ecma)script/i,Oe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Oe.optgroup=Oe.option,Oe.tbody=Oe.tfoot=Oe.colgroup=Oe.caption=Oe.thead,Oe.th=Oe.td;var Ne=/<|&#?\w+;/;!function(){var e=V.createDocumentFragment(),t=e.appendChild(V.createElement("div")),n=V.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),oe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",oe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var qe=/^key/,He=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Re=/^([^.]*)(?:\.(.+)|)/;ae.event={global:{},add:function(e,t,n,o,i){var a,r,s,l,u,c,d,p,h,f,m,b=Me.get(e);if(b)for(n.handler&&(a=n,n=a.handler,i=a.selector),n.guid||(n.guid=ae.guid++),(l=b.events)||(l=b.events={}),(r=b.handle)||(r=b.handle=function(t){return"undefined"!=typeof ae&&ae.event.triggered!==t.type?ae.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(xe)||[""],u=t.length;u--;)s=Re.exec(t[u])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h&&(d=ae.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=ae.event.special[h]||{},c=ae.extend({type:h,origType:m,data:o,handler:n,guid:n.guid,selector:i,needsContext:i&&ae.expr.match.needsContext.test(i),namespace:f.join(".")},a),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,o,f,r)!==!1||e.addEventListener&&e.addEventListener(h,r)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ae.event.global[h]=!0)},remove:function(e,t,n,o,i){var a,r,s,l,u,c,d,p,h,f,m,b=Me.hasData(e)&&Me.get(e);if(b&&(l=b.events)){for(t=(t||"").match(xe)||[""],u=t.length;u--;)if(s=Re.exec(t[u])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h){for(d=ae.event.special[h]||{},h=(o?d.delegateType:d.bindType)||h,p=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=a=p.length;a--;)c=p[a],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||o&&o!==c.selector&&("**"!==o||!c.selector)||(p.splice(a,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));r&&!p.length&&(d.teardown&&d.teardown.call(e,f,b.handle)!==!1||ae.removeEvent(e,h,b.handle),delete l[h])}else for(h in l)ae.event.remove(e,h+t[u],n,o,!0);ae.isEmptyObject(l)&&Me.remove(e,"handle events")}},dispatch:function(e){e=ae.event.fix(e);var t,n,o,i,a,r=[],s=G.call(arguments),l=(Me.get(this,"events")||{})[e.type]||[],u=ae.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(r=ae.event.handlers.call(this,e,l),t=0;(i=r[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.rnamespace||e.rnamespace.test(a.namespace))&&(e.handleObj=a,e.data=a.data,o=((ae.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s),void 0!==o&&(e.result=o)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,o,i,a,r=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],n=0;s>n;n++)a=t[n],i=a.selector+" ",void 0===o[i]&&(o[i]=a.needsContext?ae(i,this).index(l)>-1:ae.find(i,this,null,[l]).length),o[i]&&o.push(a);o.length&&r.push({elem:l,handlers:o})}return s<t.length&&r.push({elem:this,handlers:t.slice(s)}),r},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,o,i,a=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||V,o=n.documentElement,i=n.body,e.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),e.which||void 0===a||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[ae.expando])return e;var t,n,o,i=e.type,a=e,r=this.fixHooks[i];for(r||(this.fixHooks[i]=r=He.test(i)?this.mouseHooks:qe.test(i)?this.keyHooks:{}),o=r.props?this.props.concat(r.props):this.props,e=new ae.Event(a),t=o.length;t--;)n=o[t],e[n]=a[n];return e.target||(e.target=V),3===e.target.nodeType&&(e.target=e.target.parentNode),r.filter?r.filter(e,a):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ae.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return ae.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ae.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ae.Event=function(e,t){return this instanceof ae.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:f):this.type=e,t&&ae.extend(this,t),this.timeStamp=e&&e.timeStamp||ae.now(),void(this[ae.expando]=!0)):new ae.Event(e,t)},ae.Event.prototype={constructor:ae.Event,isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation(),this.stopPropagation()}},ae.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ae.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,o=this,i=e.relatedTarget,a=e.handleObj;return(!i||i!==o&&!ae.contains(o,i))&&(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),ae.fn.extend({on:function(e,t,n,o){return b(this,e,t,n,o)},one:function(e,t,n,o){return b(this,e,t,n,o,1)},off:function(e,t,n){var o,i;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,ae(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=f),this.each(function(){ae.event.remove(this,e,n,t)})}});var Fe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Ue=/<script|<style|<link/i,Be=/checked\s*(?:[^=]|=\s*.checked.)/i,We=/^true\/(.*)/,Xe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;ae.extend({htmlPrefilter:function(e){return e.replace(Fe,"<$1></$2>")},clone:function(e,t,n){var o,i,a,r,s=e.cloneNode(!0),l=ae.contains(e.ownerDocument,e);if(!(oe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ae.isXMLDoc(e)))for(r=c(s),a=c(e),o=0,i=a.length;i>o;o++)x(a[o],r[o]);if(t)if(n)for(a=a||c(e),r=r||c(s),o=0,i=a.length;i>o;o++)w(a[o],r[o]);else w(e,s);return r=c(s,"script"),r.length>0&&d(r,!l&&c(e,"script")),s},cleanData:function(e){for(var t,n,o,i=ae.event.special,a=0;void 0!==(n=e[a]);a++)if(Te(n)){if(t=n[Me.expando]){if(t.events)for(o in t.events)i[o]?ae.event.remove(n,o):ae.removeEvent(n,o,t.handle);n[Me.expando]=void 0}n[ke.expando]&&(n[ke.expando]=void 0)}}}),ae.fn.extend({domManip:_,detach:function(e){return j(this,e,!0)},remove:function(e){return j(this,e)},text:function(e){return je(this,function(e){return void 0===e?ae.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return _(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.appendChild(e)}})},prepend:function(){return _(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return _(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return _(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ae.cleanData(c(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ae.clone(this,e,t)})},html:function(e){return je(this,function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ue.test(e)&&!Oe[(Pe.exec(e)||["",""])[1].toLowerCase()]){e=ae.htmlPrefilter(e);try{for(;o>n;n++)t=this[n]||{},1===t.nodeType&&(ae.cleanData(c(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return _(this,arguments,function(t){var n=this.parentNode;ae.inArray(this,e)<0&&(ae.cleanData(c(this)),n&&n.replaceChild(t,this))},e)}}),ae.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ae.fn[e]=function(e){for(var n,o=[],i=ae(e),a=i.length-1,r=0;a>=r;r++)n=r===a?this:this.clone(!0),ae(i[r])[t](n),Q.apply(o,n.get());return this.pushStack(o)}});var ze,Ye={HTML:"block",BODY:"block"},Ke=/^margin/,Ve=new RegExp("^("+De+")(?!px)[a-z%]+$","i"),Ge=function(t){var n=t.ownerDocument.defaultView;return n.opener||(n=e),n.getComputedStyle(t)},Ze=function(e,t,n,o){var i,a,r={};for(a in t)r[a]=e.style[a],e.style[a]=t[a];i=n.apply(e,o||[]);for(a in t)e.style[a]=r[a];return i},Qe=V.documentElement;!function(){function t(){s.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",Qe.appendChild(r);var t=e.getComputedStyle(s);n="1%"!==t.top,a="2px"===t.marginLeft,o="4px"===t.width,s.style.marginRight="50%",i="4px"===t.marginRight,Qe.removeChild(r)}var n,o,i,a,r=V.createElement("div"),s=V.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",oe.clearCloneStyle="content-box"===s.style.backgroundClip,r.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",r.appendChild(s),ae.extend(oe,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==o&&t(),o},pixelMarginRight:function(){return null==o&&t(),i},reliableMarginLeft:function(){return null==o&&t(),a},reliableMarginRight:function(){var t,n=s.appendChild(V.createElement("div"));return n.style.cssText=s.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",s.style.width="1px",Qe.appendChild(r),t=!parseFloat(e.getComputedStyle(n).marginRight),Qe.removeChild(r),s.removeChild(n),t}}))}();var Je=/^(none|table(?!-c[ea]).+)/,et={position:"absolute",visibility:"hidden",display:"block"},tt={letterSpacing:"0",fontWeight:"400"},nt=["Webkit","O","Moz","ms"],ot=V.createElement("div").style;ae.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=k(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,r,s=ae.camelCase(t),l=e.style;return t=ae.cssProps[s]||(ae.cssProps[s]=$(s)||s),r=ae.cssHooks[t]||ae.cssHooks[s],void 0===n?r&&"get"in r&&void 0!==(i=r.get(e,!1,o))?i:l[t]:(a=typeof n,"string"===a&&(i=Ae.exec(n))&&i[1]&&(n=u(e,t,i),a="number"),void(null!=n&&n===n&&("number"===a&&(n+=i&&i[3]||(ae.cssNumber[s]?"":"px")),oe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,o))||(l[t]=n))))}},css:function(e,t,n,o){var i,a,r,s=ae.camelCase(t);return t=ae.cssProps[s]||(ae.cssProps[s]=$(s)||s),r=ae.cssHooks[t]||ae.cssHooks[s],r&&"get"in r&&(i=r.get(e,!0,n)),void 0===i&&(i=k(e,t,o)),"normal"===i&&t in tt&&(i=tt[t]),""===n||n?(a=parseFloat(i),n===!0||isFinite(a)?a||0:i):i}}),ae.each(["height","width"],function(e,t){ae.cssHooks[t]={get:function(e,n,o){return n?Je.test(ae.css(e,"display"))&&0===e.offsetWidth?Ze(e,et,function(){return E(e,t,o)}):E(e,t,o):void 0},set:function(e,n,o){var i,a=o&&Ge(e),r=o&&A(e,t,o,"border-box"===ae.css(e,"boxSizing",!1,a),a);return r&&(i=Ae.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=ae.css(e,t)),D(e,n,r)}}}),ae.cssHooks.marginLeft=C(oe.reliableMarginLeft,function(e,t){return t?(parseFloat(k(e,"marginLeft"))||e.getBoundingClientRect().left-Ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px":void 0}),ae.cssHooks.marginRight=C(oe.reliableMarginRight,function(e,t){return t?Ze(e,{display:"inline-block"},k,[e,"marginRight"]):void 0}),ae.each({margin:"",padding:"",border:"Width"},function(e,t){ae.cssHooks[e+t]={expand:function(n){for(var o=0,i={},a="string"==typeof n?n.split(" "):[n];4>o;o++)i[e+Ee[o]+t]=a[o]||a[o-2]||a[0];return i}},Ke.test(e)||(ae.cssHooks[e+t].set=D)}),ae.fn.extend({css:function(e,t){return je(this,function(e,t,n){var o,i,a={},r=0;if(ae.isArray(t)){for(o=Ge(e),i=t.length;i>r;r++)a[t[r]]=ae.css(e,t[r],!1,o);return a}return void 0!==n?ae.style(e,t,n):ae.css(e,t)},e,t,arguments.length>1)},show:function(){return S(this,!0)},hide:function(){return S(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?ae(this).show():ae(this).hide()})}}),ae.Tween=L,L.prototype={constructor:L,init:function(e,t,n,o,i,a){this.elem=e,this.prop=n,this.easing=i||ae.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=a||(ae.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=ae.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):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.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=ae.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){ae.fx.step[e.prop]?ae.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ae.cssProps[e.prop]]&&!ae.cssHooks[e.prop]?e.elem[e.prop]=e.now:ae.style(e.elem,e.prop,e.now+e.unit)}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ae.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ae.fx=L.prototype.init,ae.fx.step={};var it,at,rt=/^(?:toggle|show|hide)$/,st=/queueHooks$/;ae.Animation=ae.extend(H,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return u(n.elem,e,Ae.exec(t),n),n}]},tweener:function(e,t){ae.isFunction(e)?(t=e,e=["*"]):e=e.match(xe);for(var n,o=0,i=e.length;i>o;o++)n=e[o],H.tweeners[n]=H.tweeners[n]||[],H.tweeners[n].unshift(t)},prefilters:[N],prefilter:function(e,t){t?H.prefilters.unshift(e):H.prefilters.push(e)}}),ae.speed=function(e,t,n){var o=e&&"object"==typeof e?ae.extend({},e):{complete:n||!n&&t||ae.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ae.isFunction(t)&&t};return o.duration=ae.fx.off?0:"number"==typeof o.duration?o.duration:o.duration in ae.fx.speeds?ae.fx.speeds[o.duration]:ae.fx.speeds._default,(null==o.queue||o.queue===!0)&&(o.queue="fx"),o.old=o.complete,o.complete=function(){ae.isFunction(o.old)&&o.old.call(this),o.queue&&ae.dequeue(this,o.queue)},o},ae.fn.extend({fadeTo:function(e,t,n,o){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,o)},animate:function(e,t,n,o){var i=ae.isEmptyObject(e),a=ae.speed(t,n,o),r=function(){var t=H(this,ae.extend({},e),a);(i||Me.get(this,"finish"))&&t.stop(!0)};return r.finish=r,i||a.queue===!1?this.each(r):this.queue(a.queue,r)},stop:function(e,t,n){var o=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,i=null!=e&&e+"queueHooks",a=ae.timers,r=Me.get(this);if(i)r[i]&&r[i].stop&&o(r[i]);else for(i in r)r[i]&&r[i].stop&&st.test(i)&&o(r[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));(t||!n)&&ae.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=Me.get(this),o=n[e+"queue"],i=n[e+"queueHooks"],a=ae.timers,r=o?o.length:0;for(n.finish=!0,ae.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;r>t;t++)o[t]&&o[t].finish&&o[t].finish.call(this);delete n.finish})}}),ae.each(["toggle","show","hide"],function(e,t){var n=ae.fn[t];ae.fn[t]=function(e,o,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,o,i)}}),ae.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ae.fn[e]=function(e,n,o){return this.animate(t,e,n,o);
|
|
}}),ae.timers=[],ae.fx.tick=function(){var e,t=0,n=ae.timers;for(it=ae.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||ae.fx.stop(),it=void 0},ae.fx.timer=function(e){ae.timers.push(e),e()?ae.fx.start():ae.timers.pop()},ae.fx.interval=13,ae.fx.start=function(){at||(at=e.setInterval(ae.fx.tick,ae.fx.interval))},ae.fx.stop=function(){e.clearInterval(at),at=null},ae.fx.speeds={slow:600,fast:200,_default:400},ae.fn.delay=function(t,n){return t=ae.fx?ae.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,o){var i=e.setTimeout(n,t);o.stop=function(){e.clearTimeout(i)}})},function(){var e=V.createElement("input"),t=V.createElement("select"),n=t.appendChild(V.createElement("option"));e.type="checkbox",oe.checkOn=""!==e.value,oe.optSelected=n.selected,t.disabled=!0,oe.optDisabled=!n.disabled,e=V.createElement("input"),e.value="t",e.type="radio",oe.radioValue="t"===e.value}();var lt,ut=ae.expr.attrHandle;ae.fn.extend({attr:function(e,t){return je(this,ae.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ae.removeAttr(this,e)})}}),ae.extend({attr:function(e,t,n){var o,i,a=e.nodeType;return 3!==a&&8!==a&&2!==a?"undefined"==typeof e.getAttribute?ae.prop(e,t,n):(1===a&&ae.isXMLDoc(e)||(t=t.toLowerCase(),i=ae.attrHooks[t]||(ae.expr.match.bool.test(t)?lt:void 0)),void 0!==n?null===n?void ae.removeAttr(e,t):i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=ae.find.attr(e,t),null==o?void 0:o)):void 0},attrHooks:{type:{set:function(e,t){if(!oe.radioValue&&"radio"===t&&ae.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o,i=0,a=t&&t.match(xe);if(a&&1===e.nodeType)for(;n=a[i++];)o=ae.propFix[n]||n,ae.expr.match.bool.test(n)&&(e[o]=!1),e.removeAttribute(n)}}),lt={set:function(e,t,n){return t===!1?ae.removeAttr(e,n):e.setAttribute(n,n),n}},ae.each(ae.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ut[t]||ae.find.attr;ut[t]=function(e,t,o){var i,a;return o||(a=ut[t],ut[t]=i,i=null!=n(e,t,o)?t.toLowerCase():null,ut[t]=a),i}});var ct=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;ae.fn.extend({prop:function(e,t){return je(this,ae.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ae.propFix[e]||e]})}}),ae.extend({prop:function(e,t,n){var o,i,a=e.nodeType;return 3!==a&&8!==a&&2!==a?(1===a&&ae.isXMLDoc(e)||(t=ae.propFix[t]||t,i=ae.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:e[t]=n:i&&"get"in i&&null!==(o=i.get(e,t))?o:e[t]):void 0},propHooks:{tabIndex:{get:function(e){var t=ae.find.attr(e,"tabindex");return t?parseInt(t,10):ct.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),oe.optSelected||(ae.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),ae.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ae.propFix[this.toLowerCase()]=this});var pt=/[\t\r\n\f]/g;ae.fn.extend({addClass:function(e){var t,n,o,i,a,r,s,l=0;if(ae.isFunction(e))return this.each(function(t){ae(this).addClass(e.call(this,t,R(this)))});if("string"==typeof e&&e)for(t=e.match(xe)||[];n=this[l++];)if(i=R(n),o=1===n.nodeType&&(" "+i+" ").replace(pt," ")){for(r=0;a=t[r++];)o.indexOf(" "+a+" ")<0&&(o+=a+" ");s=ae.trim(o),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,o,i,a,r,s,l=0;if(ae.isFunction(e))return this.each(function(t){ae(this).removeClass(e.call(this,t,R(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(xe)||[];n=this[l++];)if(i=R(n),o=1===n.nodeType&&(" "+i+" ").replace(pt," ")){for(r=0;a=t[r++];)for(;o.indexOf(" "+a+" ")>-1;)o=o.replace(" "+a+" "," ");s=ae.trim(o),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ae.isFunction(e)?this.each(function(n){ae(this).toggleClass(e.call(this,n,R(this),t),t)}):this.each(function(){var t,o,i,a;if("string"===n)for(o=0,i=ae(this),a=e.match(xe)||[];t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(void 0===e||"boolean"===n)&&(t=R(this),t&&Me.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Me.get(this,"__className__")||""))})},hasClass:function(e){var t,n,o=0;for(t=" "+e+" ";n=this[o++];)if(1===n.nodeType&&(" "+R(n)+" ").replace(pt," ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;ae.fn.extend({val:function(e){var t,n,o,i=this[0];return arguments.length?(o=ae.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=o?e.call(this,n,ae(this).val()):e,null==i?i="":"number"==typeof i?i+="":ae.isArray(i)&&(i=ae.map(i,function(e){return null==e?"":e+""})),t=ae.valHooks[this.type]||ae.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=ae.valHooks[i.type]||ae.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(ht,""):null==n?"":n)):void 0}}),ae.extend({valHooks:{option:{get:function(e){return ae.trim(e.value)}},select:{get:function(e){for(var t,n,o=e.options,i=e.selectedIndex,a="select-one"===e.type||0>i,r=a?null:[],s=a?i+1:o.length,l=0>i?s:a?i:0;s>l;l++)if(n=o[l],(n.selected||l===i)&&(oe.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!ae.nodeName(n.parentNode,"optgroup"))){if(t=ae(n).val(),a)return t;r.push(t)}return r},set:function(e,t){for(var n,o,i=e.options,a=ae.makeArray(t),r=i.length;r--;)o=i[r],(o.selected=ae.inArray(ae.valHooks.option.get(o),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),ae.each(["radio","checkbox"],function(){ae.valHooks[this]={set:function(e,t){return ae.isArray(t)?e.checked=ae.inArray(ae(e).val(),t)>-1:void 0}},oe.checkOn||(ae.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var ft=/^(?:focusinfocus|focusoutblur)$/;ae.extend(ae.event,{trigger:function(t,n,o,i){var a,r,s,l,u,c,d,p=[o||V],h=ne.call(t,"type")?t.type:t,f=ne.call(t,"namespace")?t.namespace.split("."):[];if(r=s=o=o||V,3!==o.nodeType&&8!==o.nodeType&&!ft.test(h+ae.event.triggered)&&(h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort()),u=h.indexOf(":")<0&&"on"+h,t=t[ae.expando]?t:new ae.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:ae.makeArray(n,[t]),d=ae.event.special[h]||{},i||!d.trigger||d.trigger.apply(o,n)!==!1)){if(!i&&!d.noBubble&&!ae.isWindow(o)){for(l=d.delegateType||h,ft.test(l+h)||(r=r.parentNode);r;r=r.parentNode)p.push(r),s=r;s===(o.ownerDocument||V)&&p.push(s.defaultView||s.parentWindow||e)}for(a=0;(r=p[a++])&&!t.isPropagationStopped();)t.type=a>1?l:d.bindType||h,c=(Me.get(r,"events")||{})[t.type]&&Me.get(r,"handle"),c&&c.apply(r,n),c=u&&r[u],c&&c.apply&&Te(r)&&(t.result=c.apply(r,n),t.result===!1&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),n)!==!1||!Te(o)||u&&ae.isFunction(o[h])&&!ae.isWindow(o)&&(s=o[u],s&&(o[u]=null),ae.event.triggered=h,o[h](),ae.event.triggered=void 0,s&&(o[u]=s)),t.result}},simulate:function(e,t,n){var o=ae.extend(new ae.Event,n,{type:e,isSimulated:!0});ae.event.trigger(o,null,t),o.isDefaultPrevented()&&n.preventDefault()}}),ae.fn.extend({trigger:function(e,t){return this.each(function(){ae.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?ae.event.trigger(e,t,n,!0):void 0}}),ae.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ae.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ae.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),oe.focusin="onfocusin"in e,oe.focusin||ae.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ae.event.simulate(t,e.target,ae.event.fix(e))};ae.event.special[t]={setup:function(){var o=this.ownerDocument||this,i=Me.access(o,t);i||o.addEventListener(e,n,!0),Me.access(o,t,(i||0)+1)},teardown:function(){var o=this.ownerDocument||this,i=Me.access(o,t)-1;i?Me.access(o,t,i):(o.removeEventListener(e,n,!0),Me.remove(o,t))}}});var mt=e.location,bt=ae.now(),gt=/\?/;ae.parseJSON=function(e){return JSON.parse(e+"")},ae.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(o){n=void 0}return(!n||n.getElementsByTagName("parsererror").length)&&ae.error("Invalid XML: "+t),n};var vt=/#.*$/,yt=/([?&])_=[^&]*/,wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,xt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,_t=/^(?:GET|HEAD)$/,jt=/^\/\//,Tt={},Mt={},kt="*/".concat("*"),Ct=V.createElement("a");Ct.href=mt.href,ae.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mt.href,type:"GET",isLocal:xt.test(mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ae.parseJSON,"text xml":ae.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?B(B(e,ae.ajaxSettings),t):B(ae.ajaxSettings,e)},ajaxPrefilter:F(Tt),ajaxTransport:F(Mt),ajax:function(t,n){function o(t,n,o,s){var u,d,v,y,x,j=n;2!==w&&(w=2,l&&e.clearTimeout(l),i=void 0,r=s||"",_.readyState=t>0?4:0,u=t>=200&&300>t||304===t,o&&(y=W(p,_,o)),y=X(p,y,_,u),u?(p.ifModified&&(x=_.getResponseHeader("Last-Modified"),x&&(ae.lastModified[a]=x),x=_.getResponseHeader("etag"),x&&(ae.etag[a]=x)),204===t||"HEAD"===p.type?j="nocontent":304===t?j="notmodified":(j=y.state,d=y.data,v=y.error,u=!v)):(v=j,(t||!j)&&(j="error",0>t&&(t=0))),_.status=t,_.statusText=(n||j)+"",u?m.resolveWith(h,[d,j,_]):m.rejectWith(h,[_,j,v]),_.statusCode(g),g=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[_,p,u?d:v]),b.fireWith(h,[_,j]),c&&(f.trigger("ajaxComplete",[_,p]),--ae.active||ae.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,a,r,s,l,u,c,d,p=ae.ajaxSetup({},n),h=p.context||p,f=p.context&&(h.nodeType||h.jquery)?ae(h):ae.event,m=ae.Deferred(),b=ae.Callbacks("once memory"),g=p.statusCode||{},v={},y={},w=0,x="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(2===w){if(!s)for(s={};t=wt.exec(r);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===w?r:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return w||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return w||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>w)for(t in e)g[t]=[g[t],e[t]];else _.always(e[_.status]);return this},abort:function(e){var t=e||x;return i&&i.abort(t),o(0,t),this}};if(m.promise(_).complete=b.add,_.success=_.done,_.error=_.fail,p.url=((t||p.url||mt.href)+"").replace(vt,"").replace(jt,mt.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=ae.trim(p.dataType||"*").toLowerCase().match(xe)||[""],null==p.crossDomain){u=V.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Ct.protocol+"//"+Ct.host!=u.protocol+"//"+u.host}catch(j){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=ae.param(p.data,p.traditional)),U(Tt,p,n,_),2===w)return _;c=ae.event&&p.global,c&&0===ae.active++&&ae.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!_t.test(p.type),a=p.url,p.hasContent||(p.data&&(a=p.url+=(gt.test(a)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=yt.test(a)?a.replace(yt,"$1_="+bt++):a+(gt.test(a)?"&":"?")+"_="+bt++)),p.ifModified&&(ae.lastModified[a]&&_.setRequestHeader("If-Modified-Since",ae.lastModified[a]),ae.etag[a]&&_.setRequestHeader("If-None-Match",ae.etag[a])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&_.setRequestHeader("Content-Type",p.contentType),_.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+kt+"; q=0.01":""):p.accepts["*"]);for(d in p.headers)_.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(p.beforeSend.call(h,_,p)===!1||2===w))return _.abort();x="abort";for(d in{success:1,error:1,complete:1})_[d](p[d]);if(i=U(Mt,p,n,_)){if(_.readyState=1,c&&f.trigger("ajaxSend",[_,p]),2===w)return _;p.async&&p.timeout>0&&(l=e.setTimeout(function(){_.abort("timeout")},p.timeout));try{w=1,i.send(v,o)}catch(j){if(!(2>w))throw j;o(-1,j)}}else o(-1,"No Transport");return _},getJSON:function(e,t,n){return ae.get(e,t,n,"json")},getScript:function(e,t){return ae.get(e,void 0,t,"script")}}),ae.each(["get","post"],function(e,t){ae[t]=function(e,n,o,i){return ae.isFunction(n)&&(i=i||o,o=n,n=void 0),ae.ajax(ae.extend({url:e,type:t,dataType:i,data:n,success:o},ae.isPlainObject(e)&&e))}}),ae._evalUrl=function(e){return ae.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ae.fn.extend({wrapAll:function(e){var t;return ae.isFunction(e)?this.each(function(t){ae(this).wrapAll(e.call(this,t))}):(this[0]&&(t=ae(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return ae.isFunction(e)?this.each(function(t){ae(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ae(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ae.isFunction(e);return this.each(function(n){ae(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ae.nodeName(this,"body")||ae(this).replaceWith(this.childNodes)}).end()}}),ae.expr.filters.hidden=function(e){return!ae.expr.filters.visible(e)},ae.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var $t=/%20/g,Dt=/\[\]$/,At=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,St=/^(?:input|select|textarea|keygen)/i;ae.param=function(e,t){var n,o=[],i=function(e,t){t=ae.isFunction(t)?t():null==t?"":t,o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ae.ajaxSettings&&ae.ajaxSettings.traditional),ae.isArray(e)||e.jquery&&!ae.isPlainObject(e))ae.each(e,function(){i(this.name,this.value)});else for(n in e)z(n,e[n],t,i);return o.join("&").replace($t,"+")},ae.fn.extend({serialize:function(){return ae.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ae.prop(this,"elements");return e?ae.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ae(this).is(":disabled")&&St.test(this.nodeName)&&!Et.test(e)&&(this.checked||!Le.test(e))}).map(function(e,t){var n=ae(this).val();return null==n?null:ae.isArray(n)?ae.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}}),ae.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var Lt={0:200,1223:204},Pt=ae.ajaxSettings.xhr();oe.cors=!!Pt&&"withCredentials"in Pt,oe.ajax=Pt=!!Pt,ae.ajaxTransport(function(t){var n,o;return oe.cors||Pt&&!t.crossDomain?{send:function(i,a){var r,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)s[r]=t.xhrFields[r];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(r in i)s.setRequestHeader(r,i[r]);n=function(e){return function(){n&&(n=o=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Lt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),o=s.onerror=n("error"),void 0!==s.onabort?s.onabort=o:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&o()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(l){if(n)throw l}},abort:function(){n&&n()}}:void 0}),ae.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ae.globalEval(e),e}}}),ae.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ae.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(o,i){t=ae("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),V.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Ot=/(=)\?(?=&|$)|\?\?/;ae.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||ae.expando+"_"+bt++;return this[e]=!0,e}}),ae.ajaxPrefilter("json jsonp",function(t,n,o){var i,a,r,s=t.jsonp!==!1&&(Ot.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ot.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=ae.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Ot,"$1"+i):t.jsonp!==!1&&(t.url+=(gt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return r||ae.error(i+" was not called"),r[0]},t.dataTypes[0]="json",a=e[i],e[i]=function(){r=arguments},o.always(function(){void 0===a?ae(e).removeProp(i):e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,It.push(i)),r&&ae.isFunction(a)&&a(r[0]),r=a=void 0}),"script"):void 0}),oe.createHTMLDocument=function(){var e=V.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),ae.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||(oe.createHTMLDocument?V.implementation.createHTMLDocument(""):V);var o=fe.exec(e),i=!n&&[];return o?[t.createElement(o[1])]:(o=p([e],t,i),i&&i.length&&ae(i).remove(),ae.merge([],o.childNodes))};var Nt=ae.fn.load;ae.fn.load=function(e,t,n){if("string"!=typeof e&&Nt)return Nt.apply(this,arguments);var o,i,a,r=this,s=e.indexOf(" ");return s>-1&&(o=ae.trim(e.slice(s)),e=e.slice(0,s)),ae.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),r.length>0&&ae.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){a=arguments,r.html(o?ae("<div>").append(ae.parseHTML(e)).find(o):e)}).always(n&&function(e,t){r.each(function(){n.apply(r,a||[e.responseText,t,e])})}),this},ae.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ae.fn[t]=function(e){return this.on(t,e)}}),ae.expr.filters.animated=function(e){return ae.grep(ae.timers,function(t){return e===t.elem}).length},ae.offset={setOffset:function(e,t,n){var o,i,a,r,s,l,u,c=ae.css(e,"position"),d=ae(e),p={};"static"===c&&(e.style.position="relative"),s=d.offset(),a=ae.css(e,"top"),l=ae.css(e,"left"),u=("absolute"===c||"fixed"===c)&&(a+l).indexOf("auto")>-1,u?(o=d.position(),r=o.top,i=o.left):(r=parseFloat(a)||0,i=parseFloat(l)||0),ae.isFunction(t)&&(t=t.call(e,n,ae.extend({},s))),null!=t.top&&(p.top=t.top-s.top+r),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},ae.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ae.offset.setOffset(this,e,t)});var t,n,o=this[0],i={top:0,left:0},a=o&&o.ownerDocument;return a?(t=a.documentElement,ae.contains(t,o)?(i=o.getBoundingClientRect(),n=Y(a),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],o={top:0,left:0};return"fixed"===ae.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ae.nodeName(e[0],"html")||(o=e.offset()),o.top+=ae.css(e[0],"borderTopWidth",!0)-e.scrollTop(),o.left+=ae.css(e[0],"borderLeftWidth",!0)-e.scrollLeft()),{top:t.top-o.top-ae.css(n,"marginTop",!0),left:t.left-o.left-ae.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===ae.css(e,"position");)e=e.offsetParent;return e||Qe})}}),ae.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;ae.fn[e]=function(o){return je(this,function(e,o,i){var a=Y(e);return void 0===i?a?a[t]:e[o]:void(a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[o]=i)},e,o,arguments.length)}}),ae.each(["top","left"],function(e,t){ae.cssHooks[t]=C(oe.pixelPosition,function(e,n){return n?(n=k(e,t),Ve.test(n)?ae(e).position()[t]+"px":n):void 0})}),ae.each({Height:"height",Width:"width"},function(e,t){ae.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,o){ae.fn[o]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),r=n||(o===!0||i===!0?"margin":"border");return je(this,function(t,n,o){var i;return ae.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?ae.css(t,n,r):ae.style(t,n,o,r)},t,a?o:void 0,a,null)}})}),ae.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,o){return this.on(t,e,n,o)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),ae.fn.andSelf=ae.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ae});var qt=e.jQuery,Ht=e.$;return ae.noConflict=function(t){return e.$===ae&&(e.$=Ht),t&&e.jQuery===ae&&(e.jQuery=qt),ae},t||(e.jQuery=e.$=ae),ae}),function(e,t,n){function o(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function i(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return d[e.which]?d[e.which]:p[e.which]?p[e.which]:String.fromCharCode(e.which).toLowerCase()}function a(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function r(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function s(e,t){var n,o,i,a=[];for(n=e,"+"===n?n=["+"]:(n=n.replace(/\+{2}/g,"+plus"),n=n.split("+")),i=0;i<n.length;++i)o=n[i],f[o]&&(o=f[o]),t&&"keypress"!=t&&h[o]&&(o=h[o],a.push("shift")),r(o)&&a.push(o);if(n=o,i=t,!i){if(!c){c={};for(var s in d)s>95&&112>s||d.hasOwnProperty(s)&&(c[d[s]]=s)}i=c[n]?"keydown":"keypress"}return"keypress"==i&&a.length&&(i="keydown"),{key:o,modifiers:a,action:i}}function l(e,n){return null===e||e===t?!1:e===n?!0:l(e.parentNode,n)}function u(e){function n(e){e=e||{};var t,n=!1;for(t in b)e[t]?n=!0:b[t]=0;n||(y=!1)}function l(e,t,n,o,i,a){var s,l,u=[],c=n.type;if(!f._callbacks[e])return[];for("keyup"==c&&r(e)&&(t=[e]),s=0;s<f._callbacks[e].length;++s)if(l=f._callbacks[e][s],(o||!l.seq||b[l.seq]==l.level)&&c==l.action){var d;(d="keypress"==c&&!n.metaKey&&!n.ctrlKey)||(d=l.modifiers,d=t.sort().join(",")===d.sort().join(",")),d&&(d=o&&l.seq==o&&l.level==a,(!o&&l.combo==i||d)&&f._callbacks[e].splice(s,1),u.push(l))}return u}function c(e,t,n,o){f.stopCallback(t,t.target||t.srcElement,n,o)||!1!==e(t,n)||(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)}function d(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=i(e);t&&("keyup"==e.type&&g===t?g=!1:f.handleKey(t,a(e),e))}function p(e,t,o,a){function r(t){return function(){y=t,++b[e],clearTimeout(m),m=setTimeout(n,1e3)}}function l(t){c(o,t,e),"keyup"!==a&&(g=i(t)),setTimeout(n,10)}for(var u=b[e]=0;u<t.length;++u){var d=u+1===t.length?l:r(a||s(t[u+1]).action);h(t[u],d,a,e,u)}}function h(e,t,n,o,i){f._directMap[e+":"+n]=t,e=e.replace(/\s+/g," ");var a=e.split(" ");1<a.length?p(e,a,t,n):(n=s(e,n),f._callbacks[n.key]=f._callbacks[n.key]||[],l(n.key,n.modifiers,{type:n.action},o,e,i),f._callbacks[n.key][o?"unshift":"push"]({callback:t,modifiers:n.modifiers,action:n.action,seq:o,level:i,combo:e}))}var f=this;if(e=e||t,!(f instanceof u))return new u(e);f.target=e,f._callbacks={},f._directMap={};var m,b={},g=!1,v=!1,y=!1;f._handleKey=function(e,t,o){var i,a=l(e,t,o);t={};var s=0,u=!1;for(i=0;i<a.length;++i)a[i].seq&&(s=Math.max(s,a[i].level));for(i=0;i<a.length;++i)a[i].seq?a[i].level==s&&(u=!0,t[a[i].seq]=1,c(a[i].callback,o,a[i].combo,a[i].seq)):u||c(a[i].callback,o,a[i].combo);a="keypress"==o.type&&v,o.type!=y||r(e)||a||n(t),v=u&&"keydown"==o.type},f._bindMultiple=function(e,t,n){for(var o=0;o<e.length;++o)h(e[o],t,n)},o(e,"keypress",d),o(e,"keydown",d),o(e,"keyup",d)}var c,d={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},f={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)d[111+n]="f"+n;for(n=0;9>=n;++n)d[n+96]=n;u.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},u.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},u.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},u.prototype.reset=function(){return this._callbacks={},this._directMap={},this},u.prototype.stopCallback=function(e,t){return-1<(" "+t.className+" ").indexOf(" mousetrap ")||l(t,this.target)?!1:"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},u.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},u.init=function(){var e,n=u(t);for(e in n)"_"!==e.charAt(0)&&(u[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},u.init(),e.Mousetrap=u,"undefined"!=typeof module&&module.exports&&(module.exports=u),"function"==typeof define&&define.amd&&define(function(){return u})}(window,document),function(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,o,i,a){return this.paused?!0:t[i]||t[a]?!1:n.call(this,e,o,i)},e.prototype.bindGlobal=function(e,n,o){if(this.bind(e,n,o),e instanceof Array)for(n=0;n<e.length;n++)t[e[n]]=!0;else t[e]=!0},e.init()}(Mousetrap),!function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd?define(t):window[e]=t()}("basicContext",function(){var e=null,t="item",n="separator",o=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];return document.querySelector(".basicContext "+e)},i=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],o=0===Object.keys(e).length?!0:!1;return o===!0&&(e.type=n),null==e.type&&(e.type=t),null==e["class"]&&(e["class"]=""),e.visible!==!1&&(e.visible=!0),null==e.icon&&(e.icon=null),null==e.title&&(e.title="Undefined"),e.disabled!==!0&&(e.disabled=!1),e.disabled===!0&&(e["class"]+=" basicContext__item--disabled"),null==e.fn&&e.type!==n&&e.disabled===!1?(console.warn("Missing fn for item '"+e.title+"'"),!1):!0},a=function(e,o){var a="",r="";return i(e)===!1?"":e.visible===!1?"":(e.num=o,null!==e.icon&&(r="<span class='basicContext__icon "+e.icon+"'></span>"),e.type===t?a="\n <tr class='basicContext__item "+e["class"]+"'>\n <td class='basicContext__data' data-num='"+e.num+"'>"+r+e.title+"</td>\n </tr>\n ":e.type===n&&(a="\n <tr class='basicContext__item basicContext__item--separator'></tr>\n "),a)},r=function(e){var t="";return t+="\n <div class='basicContextContainer'>\n <div class='basicContext'>\n <table>\n <tbody>\n ",e.forEach(function(e,n){return t+=a(e,n)}),t+="\n </tbody>\n </table>\n </div>\n </div>\n "},s=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t={x:e.clientX,y:e.clientY};if("touchend"===e.type&&(null==t.x||null==t.y)){var n=e.changedTouches;null!=n&&n.length>0&&(t.x=n[0].clientX,t.y=n[0].clientY)}return(null==t.x||t.x<0)&&(t.x=0),(null==t.y||t.y<0)&&(t.y=0),t},l=function(e,t){var n=s(e),o=n.x,i=n.y,a={width:window.innerWidth,height:window.innerHeight},r={width:t.offsetWidth,height:t.offsetHeight};o+r.width>a.width&&(o-=o+r.width-a.width),i+r.height>a.height&&(i-=i+r.height-a.height),r.height>a.height&&(i=0,t.classList.add("basicContext--scrollable"));var l=n.x-o,u=n.y-i;return{x:o,y:i,rx:l,ry:u}},u=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return null==e.fn?!1:e.visible===!1?!1:e.disabled===!0?!1:(o("td[data-num='"+e.num+"']").onclick=e.fn,o("td[data-num='"+e.num+"']").oncontextmenu=e.fn,!0)},c=function(t,n,i,a){var s=r(t);document.body.insertAdjacentHTML("beforeend",s),null==e&&(e=document.body.style.overflow,document.body.style.overflow="hidden");var c=o(),d=l(n,c);return c.style.left=d.x+"px",c.style.top=d.y+"px",c.style.transformOrigin=d.rx+"px "+d.ry+"px",c.style.opacity=1,null==i&&(i=p),c.parentElement.onclick=i,c.parentElement.oncontextmenu=i,t.forEach(u),"function"==typeof n.preventDefault&&n.preventDefault(),"function"==typeof n.stopPropagation&&n.stopPropagation(),"function"==typeof a&&a(),!0},d=function(){var e=o();return null==e||0===e.length?!1:!0},p=function(){if(d()===!1)return!1;var t=document.querySelector(".basicContextContainer");return t.parentElement.removeChild(t),null!=e&&(document.body.style.overflow=e,e=null),!0};return{ITEM:t,SEPARATOR:n,show:c,visible:d,close:p}}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.basicModal=e()}}(function(){return function e(t,n,o){function i(r,s){if(!n[r]){if(!t[r]){var l="function"==typeof require&&require;if(!s&&l)return l(r,!0);if(a)return a(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[r]={exports:{}};t[r][0].call(c.exports,function(e){var n=t[r][1][e];return i(n?n:e)},c,c.exports,e,t,n,o)}return n[r].exports}for(var a="function"==typeof require&&require,r=0;r<o.length;r++)i(o[r]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=null,i=(n.THEME={small:"basicModal__small",xclose:"basicModal__xclose"},function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];return t===!0?document.querySelectorAll(".basicModal "+e):document.querySelector(".basicModal "+e)}),a=function(e,t){return null==e?!1:e.constructor===Object?Array.prototype.forEach.call(Object.keys(e),function(n){return t(e[n],n,e)}):Array.prototype.forEach.call(e,function(n,o){return t(n,o,e)})},r=function(e){return null==e||0===Object.keys(e).length?(console.error("Missing or empty modal configuration object"),!1):(null==e.body&&(e.body=""),
|
|
null==e["class"]&&(e["class"]=""),e.closable!==!1&&(e.closable=!0),null==e.buttons?(console.error("basicModal requires at least one button"),!1):null!=e.buttons.action&&(null==e.buttons.action["class"]&&(e.buttons.action["class"]=""),null==e.buttons.action.title&&(e.buttons.action.title="OK"),null==e.buttons.action.fn)?(console.error("Missing fn for action-button"),!1):null!=e.buttons.cancel&&(null==e.buttons.cancel["class"]&&(e.buttons.cancel["class"]=""),null==e.buttons.cancel.title&&(e.buttons.cancel.title="Cancel"),null==e.buttons.cancel.fn)?(console.error("Missing fn for cancel-button"),!1):!0)},s=function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M405 136.798l-29.798-29.798-119.202 119.202-119.202-119.202-29.798 29.798 119.202 119.202-119.202 119.202 29.798 29.798 119.202-119.202 119.202 119.202 29.798-29.798-119.202-119.202z"/></svg>',n="";return n+="\n <div class='basicModalContainer basicModalContainer--fadeIn' data-closable='"+e.closable+"'>\n <div class='basicModal basicModal--fadeIn "+e["class"]+"' role=\"dialog\">\n <div class='basicModal__content'>\n "+e.body+"\n </div>\n <div class='basicModal__buttons'>\n ",null!=e.buttons.cancel&&(n+=-1===e.buttons.cancel["class"].indexOf("basicModal__xclose")?"<a id='basicModal__cancel' class='basicModal__button "+e.buttons.cancel["class"]+"'>"+e.buttons.cancel.title+"</a>":"<div id='basicModal__cancel' class='basicModal__button "+e.buttons.cancel["class"]+"' aria-label='close'>"+t+"</div>"),null!=e.buttons.action&&(n+="<a id='basicModal__action' class='basicModal__button "+e.buttons.action["class"]+"'>"+e.buttons.action.title+"</a>"),n+="\n </div>\n </div>\n </div>\n "},l=n.getValues=function(){var e={},t=i("input[name]",!0),n=i("select[name]",!0);return a(t,function(t){var n=t.getAttribute("name"),o=t.value;e[n]=o}),a(n,function(t){var n=t.getAttribute("name"),o=t.options[t.selectedIndex].value;e[n]=o}),0===Object.keys(e).length?null:e},u=function(e){return null!=e.buttons.cancel&&(i("#basicModal__cancel").onclick=function(){return this.classList.contains("basicModal__button--active")===!0?!1:(this.classList.add("basicModal__button--active"),void e.buttons.cancel.fn())}),null!=e.buttons.action&&(i("#basicModal__action").onclick=function(){return this.classList.contains("basicModal__button--active")===!0?!1:(this.classList.add("basicModal__button--active"),void e.buttons.action.fn(l()))}),a(i("input",!0),function(e){e.oninput=e.onblur=function(){this.classList.remove("error")}}),a(i("select",!0),function(e){e.onchange=e.onblur=function(){this.classList.remove("error")}}),!0},c=(n.show=function h(e){if(r(e)===!1)return!1;if(null!=i())return p(!0),setTimeout(function(){return h(e)},301),!1;o=document.activeElement;var t=s(e);document.body.insertAdjacentHTML("beforeend",t),u(e);var n=i("input");null!=n&&n.select();var a=i("select");return null==n&&null!=a&&a.focus(),null!=e.callback&&e.callback(e),!0},n.error=function(e){d();var t=i("input[name='"+e+"']")||i("select[name='"+e+"']");return null==t?!1:(t.classList.add("error"),"function"==typeof t.select?t.select():t.focus(),i().classList.remove("basicModal--fadeIn","basicModal--shake"),void setTimeout(function(){return i().classList.add("basicModal--shake")},1))},n.visible=function(){return null!=i()?!0:!1}),d=(n.action=function(){var e=i("#basicModal__action");return null!=e?(e.click(),!0):!1},n.cancel=function(){var e=i("#basicModal__cancel");return null!=e?(e.click(),!0):!1},n.reset=function(){var e=i(".basicModal__button",!0);a(e,function(e){return e.classList.remove("basicModal__button--active")});var t=i("input",!0);a(t,function(e){return e.classList.remove("error")});var n=i("select",!0);return a(n,function(e){return e.classList.remove("error")}),!0}),p=n.close=function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(c()===!1)return!1;var t=i().parentElement;return"false"===t.getAttribute("data-closable")&&e===!1?!1:(t.classList.remove("basicModalContainer--fadeIn"),t.classList.add("basicModalContainer--fadeOut"),setTimeout(function(){return null==t?!1:null==t.parentElement?!1:void t.parentElement.removeChild(t)},300),null!=o&&(o.focus(),o=null),!0)}},{}]},{},[1])(1)});var _templateObject=_taggedTemplateLiteral(["<p>Are you sure you want to delete the album '$","' and all of the photos it contains? This action can't be undone!</p>"],["<p>Are you sure you want to delete the album '$","' and all of the photos it contains? This action can't be undone!</p>"]),_templateObject2=_taggedTemplateLiteral(["<p>Are you sure you want to delete all $"," selected albums and all of the photos they contain? This action can't be undone!</p>"],["<p>Are you sure you want to delete all $"," selected albums and all of the photos they contain? This action can't be undone!</p>"]),_templateObject3=_taggedTemplateLiteral(["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$","'>"],["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$","'>"]),_templateObject4=_taggedTemplateLiteral(["<p>Enter a new title for this album: ","</p>"],["<p>Enter a new title for this album: ","</p>"]),_templateObject5=_taggedTemplateLiteral(["<p>Enter a title for all $"," selected albums: ","</p>"],["<p>Enter a title for all $"," selected albums: ","</p>"]),_templateObject6=_taggedTemplateLiteral(["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"],["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"]),_templateObject7=_taggedTemplateLiteral(["<p>Are you sure you want to merge the album '$","' into the album '$","'?</p>"],["<p>Are you sure you want to merge the album '$","' into the album '$","'?</p>"]),_templateObject8=_taggedTemplateLiteral(["<p>Are you sure you want to merge all selected albums into the album '$","'?</p>"],["<p>Are you sure you want to merge all selected albums into the album '$","'?</p>"]),_templateObject9=_taggedTemplateLiteral(["<svg class='iconic $","'><use xlink:href='#$","' /></svg>"],["<svg class='iconic $","'><use xlink:href='#$","' /></svg>"]),_templateObject10=_taggedTemplateLiteral(["<div class='divider'><h1>$","</h1></div>"],["<div class='divider'><h1>$","</h1></div>"]),_templateObject11=_taggedTemplateLiteral(["<div id='$","' class='edit'>","</div>"],["<div id='$","' class='edit'>","</div>"]),_templateObject12=_taggedTemplateLiteral(["<div id='multiselect' style='top: $","px; left: $","px;'></div>"],["<div id='multiselect' style='top: $","px; left: $","px;'></div>"]),_templateObject13=_taggedTemplateLiteral(["\n <div class='album' data-id='$","'>\n <img src='$","' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n <img src='$","' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n <img src='$","' srcset='$"," 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$","' draggable='false'>\n <div class='overlay'>\n <h1 title='$","'>$","</h1>\n <a>$","</a>\n </div>\n "],["\n <div class='album' data-id='$","'>\n <img src='$","' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n <img src='$","' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n <img src='$","' srcset='$"," 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$","' draggable='false'>\n <div class='overlay'>\n <h1 title='$","'>$","</h1>\n <a>$","</a>\n </div>\n "]),_templateObject14=_taggedTemplateLiteral(["\n <div class='badges'>\n <a class='badge $"," icn-star'>","</a>\n <a class='badge $"," icn-share'>","</a>\n <a class='badge $","'>","</a>\n <a class='badge $","'>","</a>\n <a class='badge $","'>","</a>\n </div>\n "],["\n <div class='badges'>\n <a class='badge $"," icn-star'>","</a>\n <a class='badge $"," icn-share'>","</a>\n <a class='badge $","'>","</a>\n <a class='badge $","'>","</a>\n <a class='badge $","'>","</a>\n </div>\n "]),_templateObject15=_taggedTemplateLiteral(["\n <div class='photo' data-album-id='$","' data-id='$","'>\n <img src='$","' srcset='$"," 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n <div class='overlay'>\n <h1 title='$","'>$","</h1>\n "],["\n <div class='photo' data-album-id='$","' data-id='$","'>\n <img src='$","' srcset='$"," 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n <div class='overlay'>\n <h1 title='$","'>$","</h1>\n "]),_templateObject16=_taggedTemplateLiteral(["<a><span title='Camera Date'>","</span>$","</a>"],["<a><span title='Camera Date'>","</span>$","</a>"]),_templateObject17=_taggedTemplateLiteral(["<a>$","</a>"],["<a>$","</a>"]),_templateObject18=_taggedTemplateLiteral(["\n <div class='badges'>\n <a class='badge $"," icn-star'>","</a>\n <a class='badge $"," icn-share'>","</a>\n </div>\n "],["\n <div class='badges'>\n <a class='badge $"," icn-star'>","</a>\n <a class='badge $"," icn-share'>","</a>\n </div>\n "]),_templateObject19=_taggedTemplateLiteral(["<div id='image' class='$","'><div><img src='$","' draggable='false'></div></div>"],["<div id='image' class='$","'><div><img src='$","' draggable='false'></div></div>"]),_templateObject20=_taggedTemplateLiteral(["<div id='image' class='$","'><div><img src='$","' srcset='$"," 1920w, $"," $","w' draggable='false'></div></div>"],["<div id='image' class='$","'><div><img src='$","' srcset='$"," 1920w, $"," $","w' draggable='false'></div></div>"]),_templateObject21=_taggedTemplateLiteral(["\n <h1>$","</h1>\n <div class='rows'>\n "],["\n <h1>$","</h1>\n <div class='rows'>\n "]),_templateObject22=_taggedTemplateLiteral(["\n <div class='row'>\n <a class='name'>$","</a>\n "],["\n <div class='row'>\n <a class='name'>$","</a>\n "]),_templateObject23=_taggedTemplateLiteral(["<a class='tag'>$","<span data-index='$","'>","</span></a>"],["<a class='tag'>$","<span data-index='$","'>","</span></a>"]),_templateObject24=_taggedTemplateLiteral(["<img class='cover' width='16' height='16' src='$","'><div class='title'>$","</div>"],["<img class='cover' width='16' height='16' src='$","'><div class='title'>$","</div>"]),_templateObject25=_taggedTemplateLiteral(["$","",""],["$","",""]),_templateObject26=_taggedTemplateLiteral(["\n <p class='signIn'>\n <input class='text' name='username' autocomplete='username' type='text' value='' placeholder='username' autocapitalize='off' autocorrect='off'>\n <input class='text' name='password' autocomplete='current-password' type='password' value='' placeholder='password'>\n </p>\n <p class='version'>Lychee $","<span> – <a target='_blank' href='$","'>Update available!</a><span></p>\n "],["\n <p class='signIn'>\n <input class='text' name='username' autocomplete='username' type='text' value='' placeholder='username' autocapitalize='off' autocorrect='off'>\n <input class='text' name='password' autocomplete='current-password' type='password' value='' placeholder='password'>\n </p>\n <p class='version'>Lychee $","<span> – <a target='_blank' href='$","'>Update available!</a><span></p>\n "]),_templateObject27=_taggedTemplateLiteral(["<p>Are you sure you want to delete the photo '$","'? This action can't be undone!</p>"],["<p>Are you sure you want to delete the photo '$","'? This action can't be undone!</p>"]),_templateObject28=_taggedTemplateLiteral(["<p>Are you sure you want to delete all $"," selected photo? This action can't be undone!</p>"],["<p>Are you sure you want to delete all $"," selected photo? This action can't be undone!</p>"]),_templateObject29=_taggedTemplateLiteral(["<p>Enter a new title for this photo: ","</p>"],["<p>Enter a new title for this photo: ","</p>"]),_templateObject30=_taggedTemplateLiteral(["<p>Enter a title for all $"," selected photos: ","</p>"],["<p>Enter a title for all $"," selected photos: ","</p>"]),_templateObject31=_taggedTemplateLiteral(["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"],["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$","'></p>"]),_templateObject32=_taggedTemplateLiteral(["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$","'>"],["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$","'>"]),_templateObject33=_taggedTemplateLiteral(["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ","</p>"],["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ","</p>"]),_templateObject34=_taggedTemplateLiteral(["<p>Enter your tags for all $"," selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ","</p>"],["<p>Enter your tags for all $"," selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ","</p>"]),_templateObject35=_taggedTemplateLiteral(["\n <p>\n In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$","'>\n </p>\n "],["\n <p>\n In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$","'>\n </p>\n "]),_templateObject36=_taggedTemplateLiteral(["<span class='attr_$","'>$","</span>"],["<span class='attr_$","'>$","</span>"]),_templateObject37=_taggedTemplateLiteral(["\n <tr>\n <td>$","</td>\n <td>","</td>\n </tr>\n "],["\n <tr>\n <td>$","</td>\n <td>","</td>\n </tr>\n "]),_templateObject38=_taggedTemplateLiteral(["\n <div class='sidebar__divider'>\n <h1>$","</h1>\n </div>\n <div id='tags'>\n <div class='attr_$","'>","</div>\n ","\n </div>\n "],["\n <div class='sidebar__divider'>\n <h1>$","</h1>\n </div>\n <div id='tags'>\n <div class='attr_$","'>","</div>\n ","\n </div>\n "]),_templateObject39=_taggedTemplateLiteral(["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$","'></p>"],["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$","'></p>"]),_templateObject40=_taggedTemplateLiteral(["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$","uploads/import/'></p>"],["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$","uploads/import/'></p>"]),_templateObject41=_taggedTemplateLiteral(['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$','")'],['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$','")']);!function(e){var t=function(t){var n=this;this.el=e(t),this.pos={start:{x:0,y:0},end:{x:0,y:0}},this.startTime,t.on("touchstart",function(e){n.touchStart(e)}),t.on("touchmove",function(e){n.touchMove(e)}),t.on("touchend",function(e){n.swipeEnd()}),t.on("mousedown",function(e){n.mouseDown(e)})};t.prototype={touchStart:function(e){var t=e.originalEvent.touches[0];this.swipeStart(e,t.pageX,t.pageY)},touchMove:function(e){var t=e.originalEvent.touches[0];this.swipeMove(e,t.pageX,t.pageY)},mouseDown:function(e){var t=this;this.swipeStart(e,e.pageX,e.pageY),this.el.on("mousemove",function(e){t.mouseMove(e)}),this.el.on("mouseup",function(){t.mouseUp()})},mouseMove:function(e){this.swipeMove(e,e.pageX,e.pageY)},mouseUp:function(e){this.swipeEnd(e),this.el.off("mousemove"),this.el.off("mouseup")},swipeStart:function(e,t,n){this.pos.start.x=t,this.pos.start.y=n,this.pos.end.x=t,this.pos.end.y=n,this.startTime=(new Date).getTime(),this.trigger("swipeStart",e)},swipeMove:function(e,t,n){this.pos.end.x=t,this.pos.end.y=n,this.trigger("swipeMove",e)},swipeEnd:function(e){this.trigger("swipeEnd",e)},trigger:function(t,n){var o=this,i=e.Event(t),a=o.pos.start.x-o.pos.end.x,r=o.pos.end.y-o.pos.start.y,s=Math.atan2(r,a),l="up",u=Math.round(Math.sqrt(Math.pow(a,2)+Math.pow(r,2))),c=Math.round(180*s/Math.PI),d=Math.round(u/((new Date).getTime()-o.startTime)*1e3);0>c&&(c=360-Math.abs(c)),45>=c&&c>=0||360>=c&&c>=315?l="left":c>=135&&225>=c?l="right":c>45&&135>c&&(l="down"),i.originalEvent=n,i.swipe={x:a,y:r,direction:l,distance:u,angle:c,speed:d},e(o.el).trigger(i)}},e.fn.swipe=function(){new t(this);return this}}(jQuery),album={json:null},album.getID=function(){var e=null,t=function(e){return"0"===e||"f"===e||"s"===e||"r"===e?!0:$.isNumeric(e)};return photo.json?e=photo.json.album:album.json&&(e=album.json.id),t(e)===!1&&(e=$(".album:hover, .album.active").attr("data-id")),t(e)===!1&&(e=$(".photo:hover, .photo.active").attr("data-album-id")),t(e)===!0?e:!1},album.load=function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];password.get(e,function(){t===!1&&lychee.animate(".content","contentZoomOut");var n=(new Date).getTime(),o={albumID:e,password:password.value};api.post("Album::get",o,function(o){var i=0;if("Warning: Album private!"===o)return void 0!=document.location.hash.replace("#","").split("/")[1]?lychee.setMode("view"):(lychee.content.show(),lychee["goto"]("")),!1;if("Warning: Wrong password!"===o)return album.load(e,t),!1;album.json=o;var a=(new Date).getTime()-n;i=a>300?0:300-a,t===!0&&(i=0),visible.albums()||visible.photo()||visible.album()||(i=0),setTimeout(function(){view.album.init(),t===!1&&(lychee.animate(lychee.content,"contentZoomIn"),header.setMode("album"))},i)})})},album.parse=function(){album.json.title||(album.json.title="Untitled")},album.add=function(){var e=function(e){var t=e.title,n=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};basicModal.close(),0===t.length&&(t="Untitled");var o={title:t};api.post("Album::add",o,function(e){e===!0&&(e=1),e!==!1&&n(e)?(albums.refresh(),lychee["goto"](e)):lychee.error(null,o,e)})};basicModal.show({body:"<p>Enter a title for the new album: <input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='Untitled'></p>",buttons:{action:{title:"Create Album",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}})},album["delete"]=function(e){var t={},n={},o="";if(!e)return!1;if(e instanceof Array==!1&&(e=[e]),t.fn=function(){var t=void 0;basicModal.close(),t={albumIDs:e.join()},api.post("Album::delete",t,function(n){visible.albums()?e.forEach(function(e){albums.json.num--,view.albums.content["delete"](e),albums.deleteByID(e)}):(albums.refresh(),lychee["goto"]("")),n!==!0&&lychee.error(null,t,n)})},"0"===e.toString())t.title="Clear Unsorted",n.title="Keep Unsorted",o="<p>Are you sure you want to delete all photos from 'Unsorted'?<br>This action can't be undone!</p>";else if(1===e.length){var i="";t.title="Delete Album and Photos",n.title="Keep Album",album.json?i=album.json.title:albums.json&&(i=albums.getByID(e).title),o=lychee.html(_templateObject,i)}else t.title="Delete Albums and Photos",n.title="Keep Albums",o=lychee.html(_templateObject2,e.length);basicModal.show({body:o,buttons:{action:{title:t.title,fn:t.fn,"class":"red"},cancel:{title:n.title,fn:basicModal.close}}})},album.setTitle=function(e){var t="",n="";if(!e)return!1;e instanceof Array==!1&&(e=[e]),1===e.length&&(album.json?t=album.json.title:albums.json&&(t=albums.getByID(e).title),t||(t=""));var o=function(t){var n=t.title;basicModal.close(),n=""===n?"Untitled":n,visible.album()?(album.json.title=n,view.album.title(),albums.json&&(albums.getByID(e[0]).title=n)):visible.albums()&&e.forEach(function(e){albums.getByID(e).title=n,view.albums.content.title(e)});var o={albumIDs:e.join(),title:n};api.post("Album::setTitle",o,function(e){e!==!0&&lychee.error(null,o,e)})},i=lychee.html(_templateObject3,t);n=1===e.length?lychee.html(_templateObject4,i):lychee.html(_templateObject5,e.length,i),basicModal.show({body:n,buttons:{action:{title:"Set Title",fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},album.setDescription=function(e){var t=album.json.description.replace(/'/g,"'"),n=function(t){var n=t.description;basicModal.close(),visible.album()&&(album.json.description=n,view.album.description());var o={albumID:e,description:n};api.post("Album::setDescription",o,function(e){e!==!0&&lychee.error(null,o,e)})};basicModal.show({body:lychee.html(_templateObject6,t),buttons:{action:{title:"Set Description",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}})},album.setPublic=function(e,t,n){var o="";if(albums.refresh(),t===!0){var i="",a={};a.fn=function(){album.setPublic(album.getID(),!1,n)},"1"===album.json["public"]?(a.title="Edit Sharing",i="The sharing-properties of this album will be changed to the following:"):(a.title="Share Album",i="This album will be shared with the following properties:");var r="\n <p class='less'>"+i+"</p>\n <form>\n <div class='choice'>\n <label>\n <input type='checkbox' name='visible'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Visible</span>\n </label>\n <p>Listed to visitors of your Lychee.</p>\n </div>\n <div class='choice'>\n <label>\n <input type='checkbox' name='downloadable'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Downloadable</span>\n </label>\n <p>Visitors of your Lychee can download this album.</p>\n </div>\n <div class='choice'>\n <label>\n <input type='checkbox' name='password'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Password protected</span>\n </label>\n <p>Only accessible with a valid password.</p>\n <input class='text' name='passwordtext' type='password' placeholder='password' value=''>\n </div>\n </form>\n ";return basicModal.show({body:r,buttons:{action:{title:a.title,fn:a.fn},cancel:{title:"Cancel",fn:basicModal.close}}}),("1"===album.json["public"]&&"1"===album.json.visible||"0"===album.json["public"])&&$('.basicModal .choice input[name="visible"]').click(),"1"===album.json.downloadable&&$('.basicModal .choice input[name="downloadable"]').click(),$('.basicModal .choice input[name="password"]').on("change",function(){$(this).prop("checked")===!0?$('.basicModal .choice input[name="passwordtext"]').show().focus():$('.basicModal .choice input[name="passwordtext"]').hide()}),!0}basicModal.visible()?(album.json["public"]="1",1===$('.basicModal .choice input[name="visible"]:checked').length?album.json.visible="1":album.json.visible="0",1===$('.basicModal .choice input[name="downloadable"]:checked').length?album.json.downloadable="1":album.json.downloadable="0",1===$('.basicModal .choice input[name="password"]:checked').length?(o=$('.basicModal .choice input[name="passwordtext"]').val(),album.json.password="1"):(o="",album.json.password="0"),basicModal.close()):album.json["public"]="0",visible.album()&&(album.json.visible="0"===album.json["public"]?"0":album.json.visible,album.json.downloadable="0"===album.json["public"]?"0":album.json.downloadable,album.json.password="0"===album.json["public"]?"0":album.json.password,view.album["public"](),view.album.visible(),view.album.downloadable(),view.album.password(),"1"===album.json["public"]&&contextMenu.shareAlbum(e,n));var s={albumID:e,"public":album.json["public"],password:o,visible:album.json.visible,downloadable:album.json.downloadable};api.post("Album::setPublic",s,function(e){e!==!0&&lychee.error(null,s,e)})},album.share=function(e){var t="",n=location.href;switch(e){case"twitter":t="https://twitter.com/share?url="+encodeURI(n);break;case"facebook":t="http://www.facebook.com/sharer.php?u="+encodeURI(n)+"&t="+encodeURI(album.json.title);break;case"mail":t="mailto:?subject="+encodeURI(album.json.title)+"&body="+encodeURI(n);break;default:t=""}""!==t&&(location.href=t)},album.getArchive=function(e){var t="",n=api.path+"?function=Album::getArchive&albumID="+e;t=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",n):location.href.replace(location.hash,"")+n,lychee.publicMode===!0&&(t+="&password="+encodeURIComponent(password.value)),location.href=t},album.merge=function(e){var t="",n="",o="";if(!e)return!1;e instanceof Array==!1&&(e=[e]),albums.json&&(t=albums.getByID(e[0]).title),t||(t=""),t=t.replace(/'/g,"'"),2===e.length?(albums.json&&(n=albums.getByID(e[1]).title),n||(n=""),n=n.replace(/'/g,"'"),o=lychee.html(_templateObject7,n,t)):o=lychee.html(_templateObject8,t);var i=function(){basicModal.close();var t={albumIDs:e.join()};api.post("Album::merge",t,function(e){e!==!0?lychee.error(null,t,e):(albums.refresh(),albums.load())})};basicModal.show({body:o,buttons:{action:{title:"Merge Albums",fn:i,"class":"red"},cancel:{title:"Don't Merge",fn:basicModal.close}}})},albums={json:null},albums.load=function(){var e=(new Date).getTime();lychee.animate(".content","contentZoomOut"),null===albums.json?api.post("Album::getAll",{},function(t){var n=0;lychee.publicMode===!1&&albums._createSmartAlbums(t.smartalbums),albums.json=t;var o=(new Date).getTime()-e;n=o>300?0:300-o,visible.albums()||visible.photo()||visible.album()||(n=0),visible.album()&&""===lychee.content.html()&&(n=0),setTimeout(function(){header.setMode("albums"),view.albums.init(),lychee.animate(lychee.content,"contentZoomIn")},n)}):setTimeout(function(){header.setMode("albums"),view.albums.init(),lychee.animate(lychee.content,"contentZoomIn")},300)},albums.parse=function(e){"1"===e.password&&lychee.publicMode===!0?(e.thumbs[0]="src/images/password.svg",e.thumbs[1]="src/images/password.svg",e.thumbs[2]="src/images/password.svg"):(e.thumbs[0]||(e.thumbs[0]="src/images/no_images.svg"),e.thumbs[1]||(e.thumbs[1]="src/images/no_images.svg"),e.thumbs[2]||(e.thumbs[2]="src/images/no_images.svg"))},albums._createSmartAlbums=function(e){e.unsorted={id:0,title:"Unsorted",sysdate:e.unsorted.num+" photos",unsorted:"1",thumbs:e.unsorted.thumbs},e.starred={id:"f",title:"Starred",sysdate:e.starred.num+" photos",star:"1",thumbs:e.starred.thumbs},e["public"]={id:"s",title:"Public",sysdate:e["public"].num+" photos","public":"1",thumbs:e["public"].thumbs},e.recent={id:"r",title:"Recent",sysdate:e.recent.num+" photos",recent:"1",thumbs:e.recent.thumbs}},albums.getByID=function(e){if(null!=e&&albums.json&&albums.json.albums){var t=void 0;return $.each(albums.json.albums,function(n){var o=albums.json.albums[n];o.id==e&&(t=o)}),t}},albums.deleteByID=function(e){if(null==e)return!1;if(!albums.json)return!1;if(!albums.json.albums)return!1;var t=!1;return $.each(albums.json.albums,function(n){return albums.json.albums[n].id==e?(albums.json.albums.splice(n,1),t=!0,!1):void 0}),t},albums.refresh=function(){albums.json=null},api={path:"php/index.php",onError:null},api.post=function(e,t,n){loadingBar.show(),t=$.extend({"function":e},t);var o=function(e){return setTimeout(loadingBar.hide,100),"string"==typeof e&&"Error: "===e.substring(0,7)?(api.onError(e.substring(7,e.length),t,e),!1):("true"===e?e=!0:"false"===e&&(e=!1),"string"==typeof e&&"{"===e.substring(0,1)&&"}"===e.substring(e.length-1,e.length)&&(e=$.parseJSON(e)),void n(e))},i=function(e,n,o){api.onError("Server error or API not found.",t,o)};$.ajax({type:"POST",url:api.path,data:t,dataType:"text",success:o,error:i})},build={},build.iconic=function(e){var t=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n="";return n+=lychee.html(_templateObject9,t,e)},build.divider=function(e){var t="";return t+=lychee.html(_templateObject10,e)},build.editIcon=function(e){var t="";return t+=lychee.html(_templateObject11,e,build.iconic("pencil"))},build.multiselect=function(e,t){return lychee.html(_templateObject12,e,t)},build.album=function(e){var t="",n=lychee.retinize(e.thumbs[0]),o=n.path,i=n.isPhoto;return t+=lychee.html(_templateObject13,e.id,e.thumbs[2],e.thumbs[1],e.thumbs[0],o,i,e.title,e.title,e.sysdate),lychee.publicMode===!1&&(t+=lychee.html(_templateObject14,"1"===e.star?"badge--visible":"",build.iconic("star"),"1"===e["public"]?"badge--visible":"",build.iconic("eye"),"1"===e.unsorted?"badge--visible":"",build.iconic("list"),"1"===e.recent?"badge--visible":"",build.iconic("clock"),"1"===e.password?"badge--visible":"",build.iconic("lock-locked"))),t+="</div>"},build.photo=function(e){var t="",n=lychee.retinize(e.thumbUrl),o=n.path;return t+=lychee.html(_templateObject15,e.album,e.id,e.thumbUrl,o,e.title,e.title),t+="1"===e.cameraDate?lychee.html(_templateObject16,build.iconic("camera-slr"),e.sysdate):lychee.html(_templateObject17,e.sysdate),t+="</div>",lychee.publicMode===!1&&(t+=lychee.html(_templateObject18,"1"===e.star?"badge--visible":"",build.iconic("star"),"1"===e["public"]&&"1"!==album.json["public"]?"badge--visible":"",build.iconic("eye"))),t+="</div>"},build.imageview=function(e,t){var n="",o=""!==e.medium;return n+=o===!1?lychee.html(_templateObject19,t===!0?"":"full",e.url):lychee.html(_templateObject20,t===!0?"":"full",e.url,e.medium,e.url,e.width),n+="\n <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>"+build.iconic("caret-left")+"</a></div>\n <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>"+build.iconic("caret-right")+"</a></div>\n "},build.no_content=function(e){var t="";switch(t+="\n <div class='no_content fadeIn'>\n "+build.iconic(e)+"\n ",
|
|
e){case"magnifying-glass":t+="<p>No results</p>";break;case"eye":t+="<p>No public albums</p>";break;case"cog":t+="<p>No configuration</p>";break;case"question-mark":t+="<p>Photo not found</p>"}return t+="</div>"},build.uploadModal=function(e,t){var n="";n+=lychee.html(_templateObject21,e);for(var o=0;o<t.length;){var i=t[o];i.name.length>40&&(i.name=i.name.substr(0,17)+"..."+i.name.substr(i.name.length-20,20)),n+=lychee.html(_templateObject22,i.name),n+=i.supported===!0?"<a class='status'></a>":"<a class='status error'>Not supported</a>",n+="\n <p class='notice'></p>\n </div>\n ",o++}return n+="</div>"},build.tags=function(e){var t="";return""!==e?(e=e.split(","),e.forEach(function(e,n,o){t+=lychee.html(_templateObject23,e,n,build.iconic("x"))})):t="<div class='empty'>No Tags</div>",t},contextMenu={},contextMenu.add=function(e){var t=[{title:build.iconic("image")+"Upload Photo",fn:function(){return $("#upload_files").click()}},{},{title:build.iconic("link-intact")+"Import from Link",fn:upload.start.url},{title:build.iconic("dropbox","ionicons")+"Import from Dropbox",fn:upload.start.dropbox},{title:build.iconic("terminal")+"Import from Server",fn:upload.start.server},{},{title:build.iconic("folder")+"New Album",fn:album.add}];basicContext.show(t,e.originalEvent),upload.notify()},contextMenu.settings=function(e){var t=[{title:build.iconic("person")+"Change Login",fn:settings.setLogin},{title:build.iconic("sort-ascending")+"Change Sorting",fn:settings.setSorting},{title:build.iconic("dropbox","ionicons")+"Set Dropbox",fn:settings.setDropboxKey},{},{title:build.iconic("info")+"About Lychee",fn:function(){return window.open(lychee.website)}},{title:build.iconic("wrench")+"Diagnostics",fn:function(){return window.open("plugins/Diagnostics/")}},{title:build.iconic("align-left")+"Show Log",fn:function(){return window.open("plugins/Log/")}},{},{title:build.iconic("account-logout")+"Sign Out",fn:lychee.logout}];basicContext.show(t,e.originalEvent)},contextMenu.album=function(e,t){if("0"===e||"f"===e||"s"===e||"r"===e)return!1;var n=albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length>1,o=[{title:build.iconic("pencil")+"Rename",fn:function(){return album.setTitle([e])}},{title:build.iconic("collapse-left")+"Merge",visible:n,fn:function(){basicContext.close(),contextMenu.mergeAlbum(e,t)}},{title:build.iconic("trash")+"Delete",fn:function(){return album["delete"]([e])}}];$('.album[data-id="'+e+'"]').addClass("active"),basicContext.show(o,t.originalEvent,contextMenu.close)},contextMenu.albumMulti=function(e,t){multiselect.stopResize();var n=e.length>1?!0:!1,o=albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length>1,i=[{title:build.iconic("pencil")+"Rename All",fn:function(){return album.setTitle(e)}},{title:build.iconic("collapse-left")+"Merge All",visible:o&&n,fn:function(){return album.merge(e)}},{title:build.iconic("collapse-left")+"Merge",visible:o&&!n,fn:function(){basicContext.close(),contextMenu.mergeAlbum(e[0],t)}},{title:build.iconic("trash")+"Delete All",fn:function(){return album["delete"](e)}}];i.push(),basicContext.show(i,t.originalEvent,contextMenu.close)},contextMenu.albumTitle=function(e,t){api.post("Album::getAll",{},function(n){var o=[];n.albums&&n.num>1&&($.each(n.albums,function(){var t=this;this.thumbs[0]||(this.thumbs[0]="src/images/no_cover.svg");var n=lychee.html(_templateObject24,this.thumbs[0],this.title);this.id!=e&&o.push({title:n,fn:function(){return lychee["goto"](t.id)}})}),o.unshift({})),o.unshift({title:build.iconic("pencil")+"Rename",fn:function(){return album.setTitle([e])}}),basicContext.show(o,t.originalEvent,contextMenu.close)})},contextMenu.mergeAlbum=function(e,t){api.post("Album::getAll",{},function(n){var o=[];return n.albums&&n.num>1&&$.each(n.albums,function(){var t=this;this.thumbs[0]||(this.thumbs[0]="src/images/no_cover.svg");var n=lychee.html(_templateObject24,this.thumbs[0],this.title);this.id!=e&&o.push({title:n,fn:function(){return album.merge([e,t.id])}})}),0===o.length?!1:void basicContext.show(o,t.originalEvent,contextMenu.close)})},contextMenu.photo=function(e,t){var n=[{title:build.iconic("star")+"Star",fn:function(){return photo.setStar([e])}},{title:build.iconic("tag")+"Tags",fn:function(){return photo.editTags([e])}},{},{title:build.iconic("pencil")+"Rename",fn:function(){return photo.setTitle([e])}},{title:build.iconic("layers")+"Duplicate",fn:function(){return photo.duplicate([e])}},{title:build.iconic("folder")+"Move",fn:function(){basicContext.close(),contextMenu.move([e],t)}},{title:build.iconic("trash")+"Delete",fn:function(){return photo["delete"]([e])}}];$('.photo[data-id="'+e+'"]').addClass("active"),basicContext.show(n,t.originalEvent,contextMenu.close)},contextMenu.photoMulti=function(e,t){multiselect.stopResize();var n=[{title:build.iconic("star")+"Star All",fn:function(){return photo.setStar(e)}},{title:build.iconic("tag")+"Tag All",fn:function(){return photo.editTags(e)}},{},{title:build.iconic("pencil")+"Rename All",fn:function(){return photo.setTitle(e)}},{title:build.iconic("layers")+"Duplicate All",fn:function(){return photo.duplicate(e)}},{title:build.iconic("folder")+"Move All",fn:function(){basicContext.close(),contextMenu.move(e,t)}},{title:build.iconic("trash")+"Delete All",fn:function(){return photo["delete"](e)}}];basicContext.show(n,t.originalEvent,contextMenu.close)},contextMenu.photoTitle=function(e,t,n){var o=[{title:build.iconic("pencil")+"Rename",fn:function(){return photo.setTitle([t])}}],i=album.json;i.content!==!1&&i.num>1&&(o.push({}),$.each(i.content,function(n){var i=this,a=lychee.html(_templateObject24,this.thumbUrl,this.title);this.id!=t&&o.push({title:a,fn:function(){return lychee["goto"](e+"/"+i.id)}})})),basicContext.show(o,n.originalEvent,contextMenu.close)},contextMenu.photoMore=function(e,t){var n=lychee.publicMode===!1||album.json&&album.json.downloadable&&"1"===album.json.downloadable&&lychee.publicMode===!0,o=[{title:build.iconic("fullscreen-enter")+"Full Photo",fn:function(){return window.open(photo.getDirectLink())}},{title:build.iconic("cloud-download")+"Download",visible:n,fn:function(){return photo.getArchive(e)}}];basicContext.show(o,t.originalEvent)},contextMenu.move=function(e,t){var n=[];api.post("Album::getAll",{},function(o){0===o.num?n=[{title:"New Album",fn:album.add}]:($.each(o.albums,function(){var t=this;this.thumbs[0]||(this.thumbs[0]="src/images/no_cover.svg");var o=lychee.html(_templateObject24,this.thumbs[0],this.title);this.id!=album.getID()&&n.push({title:o,fn:function(){return photo.setAlbum(e,t.id)}})}),"0"!==album.getID()&&(n.unshift({}),n.unshift({title:"Unsorted",fn:function(){return photo.setAlbum(e,0)}}))),basicContext.show(n,t.originalEvent,contextMenu.close)})},contextMenu.sharePhoto=function(e,t){var n=photo.getViewLink(e),o="ionicons",i=[{title:'<input readonly id="link" value="'+n+'">',fn:function(){},"class":"basicContext__item--noHover"},{},{title:build.iconic("twitter",o)+"Twitter",fn:function(){return photo.share(e,"twitter")}},{title:build.iconic("facebook",o)+"Facebook",fn:function(){return photo.share(e,"facebook")}},{title:build.iconic("envelope-closed")+"Mail",fn:function(){return photo.share(e,"mail")}},{title:build.iconic("dropbox",o)+"Dropbox",fn:function(){return photo.share(e,"dropbox")}},{title:build.iconic("link-intact")+"Direct Link",fn:function(){return window.open(photo.getDirectLink())}},{},{title:build.iconic("ban")+"Make Private",fn:function(){return photo.setPublic(e)}}];basicContext.show(i,t.originalEvent),$(".basicContext input#link").focus().select()},contextMenu.shareAlbum=function(e,t){var n="ionicons",o=[{title:'<input readonly id="link" value="'+location.href+'">',fn:function(){},"class":"basicContext__item--noHover"},{},{title:build.iconic("twitter",n)+"Twitter",fn:function(){return album.share("twitter")}},{title:build.iconic("facebook",n)+"Facebook",fn:function(){return album.share("facebook")}},{title:build.iconic("envelope-closed")+"Mail",fn:function(){return album.share("mail")}},{},{title:build.iconic("pencil")+"Edit Sharing",fn:function(){return album.setPublic(e,!0,t)}},{title:build.iconic("ban")+"Make Private",fn:function(){return album.setPublic(e,!1)}}];basicContext.show(o,t.originalEvent),$(".basicContext input#link").focus().select()},contextMenu.close=function(){return visible.contextMenu()?(basicContext.close(),$(".photo.active, .album.active").removeClass("active"),void(visible.multiselect()&&multiselect.close())):!1},header={_dom:$(".header")},header.dom=function(e){return null==e||""===e?header._dom:header._dom.find(e)},header.bind=function(){var e=lychee.getEventName();return header.dom(".header__title").on(e,function(e){return $(this).hasClass("header__title--editable")===!1?!1:void(visible.photo()?contextMenu.photoTitle(album.getID(),photo.getID(),e):contextMenu.albumTitle(album.getID(),e))}),header.dom("#button_share").on(e,function(e){"1"===photo.json["public"]||"2"===photo.json["public"]?contextMenu.sharePhoto(photo.getID(),e):photo.setPublic(photo.getID(),e)}),header.dom("#button_share_album").on(e,function(e){"1"===album.json["public"]?contextMenu.shareAlbum(album.getID(),e):album.setPublic(album.getID(),!0,e)}),header.dom("#button_signin").on(e,lychee.loginDialog),header.dom("#button_settings").on(e,contextMenu.settings),header.dom("#button_info_album").on(e,sidebar.toggle),header.dom("#button_info").on(e,sidebar.toggle),header.dom(".button_add").on(e,contextMenu.add),header.dom("#button_more").on(e,function(e){contextMenu.photoMore(photo.getID(),e)}),header.dom("#button_move").on(e,function(e){contextMenu.move([photo.getID()],e)}),header.dom(".header__hostedwith").on(e,function(){window.open(lychee.website)}),header.dom("#button_trash_album").on(e,function(){album["delete"]([album.getID()])}),header.dom("#button_trash").on(e,function(){photo["delete"]([photo.getID()])}),header.dom("#button_archive").on(e,function(){album.getArchive(album.getID())}),header.dom("#button_star").on(e,function(){photo.setStar([photo.getID()])}),header.dom("#button_back_home").on(e,function(){lychee["goto"]("")}),header.dom("#button_back").on(e,function(){lychee["goto"](album.getID())}),header.dom(".header__search").on("keyup click",function(){search.find($(this).val())}),header.dom(".header__clear").on(e,function(){header.dom(".header__search").focus(),search.reset()}),!0},header.show=function(){return clearTimeout($(window).data("timeout")),lychee.imageview.removeClass("full"),header.dom().removeClass("header--hidden"),!0},header.hide=function(e){var t=arguments.length<=1||void 0===arguments[1]?500:arguments[1];return!visible.photo()||visible.sidebar()||visible.contextMenu()||basicModal.visible()!==!1?!1:(clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){lychee.imageview.addClass("full"),header.dom().addClass("header--hidden")},t)),!0)},header.setTitle=function(){var e=arguments.length<=0||void 0===arguments[0]?"Untitled":arguments[0],t=header.dom(".header__title"),n=lychee.html(_templateObject25,e,build.iconic("caret-bottom"));return t.html(n),!0},header.setMode=function(e){switch("albums"===e&&lychee.publicMode===!0&&(e="public"),e){case"public":return header.dom().removeClass("header--view"),header.dom(".header__toolbar--albums, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"),header.dom(".header__toolbar--public").addClass("header__toolbar--visible"),!0;case"albums":return header.dom().removeClass("header--view"),header.dom(".header__toolbar--public, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"),header.dom(".header__toolbar--albums").addClass("header__toolbar--visible"),!0;case"album":var t=album.getID();return header.dom().removeClass("header--view"),header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--photo").removeClass("header__toolbar--visible"),header.dom(".header__toolbar--album").addClass("header__toolbar--visible"),album.json.content===!1?$("#button_archive").hide():$("#button_archive").show(),lychee.publicMode===!0&&"0"===album.json.downloadable&&$("#button_archive").hide(),"s"===t||"f"===t||"r"===t?$("#button_info_album, #button_trash_album, #button_share_album").hide():"0"===t?($("#button_info_album, #button_share_album").hide(),$("#button_trash_album").show()):$("#button_info_album, #button_trash_album, #button_share_album").show(),!0;case"photo":return header.dom().addClass("header--view"),header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--album").removeClass("header__toolbar--visible"),header.dom(".header__toolbar--photo").addClass("header__toolbar--visible"),!0}return!1},header.setEditable=function(e){var t=header.dom(".header__title");return lychee.publicMode===!0&&(e=!1),e?t.addClass("header__title--editable"):t.removeClass("header__title--editable"),!0},$(document).ready(function(){var e=lychee.getEventName();api.onError=lychee.error,multiselect.bind(),header.bind(),lychee.imageview.on(e,".arrow_wrapper--previous",photo.previous).on(e,".arrow_wrapper--next",photo.next),Mousetrap.bind(["left"],function(){return visible.photo()?($("#imageview a#previous").click(),!1):void 0}).bind(["right"],function(){return visible.photo()?($("#imageview a#next").click(),!1):void 0}).bind(["u"],function(){return visible.photo()?void 0:($("#upload_files").click(),!1)}).bind(["s","f"],function(){return visible.photo()?(header.dom("#button_star").click(),!1):visible.albums()?(header.dom(".header__search").focus(),!1):void 0}).bind(["r"],function(){return visible.album()?(album.setTitle(album.getID()),!1):visible.photo()?(photo.setTitle([photo.getID()]),!1):void 0}).bind(["d"],function(){return visible.photo()?(photo.setDescription(photo.getID()),!1):visible.album()?(album.setDescription(album.getID()),!1):void 0}).bind(["t"],function(){return visible.photo()?(photo.editTags([photo.getID()]),!1):void 0}).bind(["i"],function(){return visible.multiselect()?void 0:(sidebar.toggle(),!1)}).bind(["command+backspace","ctrl+backspace"],function(){return visible.photo()&&basicModal.visible()===!1?(photo["delete"]([photo.getID()]),!1):visible.album()&&basicModal.visible()===!1?(album["delete"]([album.getID()]),!1):void 0}).bind(["command+a","ctrl+a"],function(){return visible.album()&&basicModal.visible()===!1?(multiselect.selectAll(),!1):visible.albums()&&basicModal.visible()===!1?(multiselect.selectAll(),!1):void 0}),Mousetrap.bindGlobal("enter",function(){basicModal.visible()===!0&&basicModal.action()}),Mousetrap.bindGlobal(["esc","command+up"],function(){return basicModal.visible()===!0?basicModal.cancel():visible.contextMenu()?contextMenu.close():visible.photo()?lychee["goto"](album.getID()):visible.album()?lychee["goto"](""):visible.albums()&&0!==header.dom(".header__search").val().length&&search.reset(),!1}),"touchend"===e&&$(document).on("touchend","#imageview #image",function(e){(null==swipe.obj||swipe.offset>=-5&&swipe.offset<=5)&&(visible.header()?header.hide(e,0):header.show())}).swipe().on("swipeStart",function(){visible.photo()&&swipe.start($("#imageview #image"))}).swipe().on("swipeMove",function(e){visible.photo()&&swipe.move(e.swipe)}).swipe().on("swipeEnd",function(e){visible.photo()&&swipe.stop(e.swipe,photo.previous,photo.next)}),$(document).on("click",".album",function(){lychee["goto"]($(this).attr("data-id"))}).on("click",".photo",function(){lychee["goto"](album.getID()+"/"+$(this).attr("data-id"))}).on("contextmenu",".photo",function(e){contextMenu.photo(photo.getID(),e)}).on("contextmenu",".album",function(e){contextMenu.album(album.getID(),e)}).on("change","#upload_files",function(){basicModal.close(),upload.start.local(this.files)}).on("dragover",function(){return!1},!1).on("drop",function(e){return visible.photo()&&lychee["goto"](album.getID()),visible.contextMenu()&&contextMenu.close(),e.originalEvent.dataTransfer.files.length>0?upload.start.local(e.originalEvent.dataTransfer.files):e.originalEvent.dataTransfer.getData("Text").length>3&&upload.start.url(e.originalEvent.dataTransfer.getData("Text")),!1}),lychee.init()}),loadingBar={status:null,_dom:$("#loading")},loadingBar.dom=function(e){return null==e||""===e?loadingBar._dom:loadingBar._dom.find(e)},loadingBar.show=function(e,t){return"error"===e?(loadingBar.status="error",t&&(t=t.replace("<br>","")),t||(t="Whoops, it looks like something went wrong. Please reload the site and try again!"),visible.header()&&header.dom().addClass("header--error"),loadingBar.dom().removeClass("loading uploading error").html("<h1>Error: <span>"+t+"</span></h1>").addClass(e).show(),clearTimeout(loadingBar._timeout),loadingBar._timeout=setTimeout(function(){return loadingBar.hide(!0)},3e3),!0):null===loadingBar.status?(loadingBar.status="loading",clearTimeout(loadingBar._timeout),loadingBar._timeout=setTimeout(function(){visible.header()&&header.dom().addClass("header--loading"),loadingBar.dom().removeClass("loading uploading error").html("").addClass("loading").show()},1e3),!0):void 0},loadingBar.hide=function(e){("error"!==loadingBar.status&&null!=loadingBar.status||e)&&(loadingBar.status=null,header.dom().removeClass("header--error header--loading"),clearTimeout(loadingBar._timeout),setTimeout(function(){return loadingBar.dom().hide()},300))},lychee={title:document.title,version:"3.0.9",versionCode:"030009",updatePath:"//update.electerious.com/index.json",updateURL:"https://github.com/electerious/Lychee",website:"http://lychee.electerious.com",publicMode:!1,viewMode:!1,checkForUpdates:"1",sortingPhotos:"",sortingAlbums:"",location:"",dropbox:!1,dropboxKey:"",content:$(".content"),imageview:$("#imageview")},lychee.init=function(){api.post("Session::init",{},function(e){if(2===e.status)lychee.sortingPhotos=e.config.sortingPhotos||"",lychee.sortingAlbums=e.config.sortingAlbums||"",lychee.dropboxKey=e.config.dropboxKey||"",lychee.location=e.config.location||"",lychee.checkForUpdates=e.config.checkForUpdates||"1",e.config.login===!1&&settings.createLogin();else if(1===e.status)lychee.checkForUpdates=e.config.checkForUpdates||"1",lychee.setMode("public");else if(0===e.status)return lychee.setMode("public"),header.dom().hide(),lychee.content.hide(),$("body").append(build.no_content("cog")),settings.createConfig(),!0;$(window).bind("popstate",lychee.load),lychee.load()})},lychee.login=function(e){var t=e.username,n=e.password,o={user:t,password:n};api.post("Session::login",o,function(e){if(e===!0){try{localStorage.setItem("lychee_username",t)}catch(n){}window.location.reload()}else basicModal.error("password")})},lychee.loginDialog=function(){var e=lychee.html(_templateObject26,lychee.version,lychee.updateURL);if(basicModal.show({body:e,buttons:{action:{title:"Sign In",fn:lychee.login},cancel:{title:"Cancel",fn:basicModal.close}}}),localStorage){var t=localStorage.getItem("lychee_username");null!=t&&t.length>0&&($('.basicModal input[name="username"]').val(t),$('.basicModal input[name="password"]').focus())}"1"===lychee.checkForUpdates&&lychee.getUpdate()},lychee.logout=function(){api.post("Session::logout",{},function(){window.location.reload()})},lychee["goto"]=function(e){e=void 0===e?"#":"#"+e,history.pushState(null,null,e),lychee.load()},lychee.load=function(){var e="",t="",n=document.location.hash.replace("#","").split("/");$(".no_content").remove(),contextMenu.close(),multiselect.close(),null!=n[0]&&(e=n[0]),null!=n[1]&&(t=n[1]),e&&t?(photo.json=null,(""===lychee.content.html()||header.dom(".header__search").length&&0!==header.dom(".header__search").val().length)&&(lychee.content.hide(),album.load(e,!0)),photo.load(t,e)):e?(photo.json=null,visible.photo()&&view.photo.hide(),album.json&&e==album.json.id?view.album.title():album.load(e)):(null!=search.hash&&(albums.json=null,search.hash=null),album.json=null,photo.json=null,visible.sidebar()&&sidebar.toggle(),visible.photo()&&view.photo.hide(),albums.load())},lychee.getUpdate=function(){var e=function(e){e.lychee.version>parseInt(lychee.versionCode)&&$(".version span").show()};$.ajax({url:lychee.updatePath,success:e})},lychee.setTitle=function(e,t){document.title=lychee.title+" - "+e,header.setEditable(t),header.setTitle(e)},lychee.setMode=function(e){$("#button_settings, #button_trash_album, #button_share_album, .button_add, .header__divider").remove(),$("#button_trash, #button_move, #button_share, #button_star").remove(),$(document).off("click",".header__title--editable").off("touchend",".header__title--editable").off("contextmenu",".photo").off("contextmenu",".album").off("drop"),Mousetrap.unbind(["u"]).unbind(["s"]).unbind(["f"]).unbind(["r"]).unbind(["d"]).unbind(["t"]).unbind(["command+backspace","ctrl+backspace"]).unbind(["command+a","ctrl+a"]),"public"===e?lychee.publicMode=!0:"view"===e&&(Mousetrap.unbind(["esc","command+up"]),$("#button_back, a#next, a#previous").remove(),$(".no_content").remove(),lychee.publicMode=!0,lychee.viewMode=!0)},lychee.animate=function(e,t){var n=[["fadeIn","fadeOut"],["contentZoomIn","contentZoomOut"]];e.jQuery||(e=$(e));for(var o=0;o<n.length;o++)for(var i=0;i<n[o].length;i++)if(n[o][i]==t)return e.removeClass(n[o][0]+" "+n[o][1]).addClass(t),!0;return!1},lychee.retinize=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=e.split(".").pop(),n="svg"!==t;return n===!0&&(e=e.replace(/\.[^\/.]+$/,""),e=e+"@2x."+t),{path:e,isPhoto:n}},lychee.loadDropbox=function(e){if(lychee.dropbox===!1&&null!=lychee.dropboxKey&&""!==lychee.dropboxKey){loadingBar.show();var t=document.createElement("script"),n=document.getElementsByTagName("script")[0];t.src="https://www.dropbox.com/static/api/1/dropins.js",t.id="dropboxjs",t.type="text/javascript",t.async="true",t.setAttribute("data-app-key",lychee.dropboxKey),t.onload=t.onreadystatechange=function(){var t=this.readyState;t&&"complete"!==t&&"loaded"!==t||(lychee.dropbox=!0,loadingBar.hide(),e())},n.parentNode.insertBefore(t,n)}else lychee.dropbox===!0&&null!=lychee.dropboxKey&&""!==lychee.dropboxKey?e():settings.setDropboxKey(e)},lychee.getEventName=function(){var e=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)&&"ontouchend"in document.documentElement,t=e===!0?"touchend":"click";return t},lychee.escapeHTML=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];return e+="",e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},lychee.html=function(e){for(var t=e.raw,n="",o=arguments.length,i=Array(o>1?o-1:0),a=1;o>a;a++)i[a-1]=arguments[a];return i.forEach(function(e,o){var i=t[o];"$"===i.slice(-1)&&(e=lychee.escapeHTML(e),i=i.slice(0,-1)),n+=i,n+=e}),n+=t[t.length-1]},lychee.error=function(e,t,n){console.error({description:e,params:t,response:n}),loadingBar.show("error",e)},multiselect={},multiselect.position={top:null,right:null,bottom:null,left:null},multiselect.bind=function(){return $(".content").on("mousedown",function(e){1===e.which&&multiselect.show(e)}),!0},multiselect.show=function(e){return lychee.publicMode?!1:visible.albums()||visible.album()?0!==$(".album:hover, .photo:hover").length?!1:visible.search()?!1:(visible.multiselect()&&$("#multiselect").remove(),sidebar.setSelectable(!1),multiselect.position.top=e.pageY,multiselect.position.right=-1*(e.pageX-$(document).width()),multiselect.position.bottom=-1*(multiselect.position.top-$(window).height()),multiselect.position.left=e.pageX,$("body").append(build.multiselect(multiselect.position.top,multiselect.position.left)),void $(document).on("mousemove",multiselect.resize).on("mouseup",function(e){1===e.which&&multiselect.getSelection(e)})):!1},multiselect.selectAll=function(){if(lychee.publicMode)return!1;if(visible.search())return!1;if(!visible.albums()&&!visible.album)return!1;visible.multiselect()&&$("#multiselect").remove(),sidebar.setSelectable(!1),multiselect.position.top=70,multiselect.position.right=40,multiselect.position.bottom=90,multiselect.position.left=20,$("body").append(build.multiselect(multiselect.position.top,multiselect.position.left));var e={width:$(document).width(),height:$(document).height()},t={width:e.width-multiselect.position.right+2,height:e.height-multiselect.position.bottom},n={pageX:e.width-multiselect.position.right/2,pageY:e.height-multiselect.position.bottom};$("#multiselect").css(t),multiselect.getSelection(n)},multiselect.resize=function(e){if(null===multiselect.position.top||null===multiselect.position.right||null===multiselect.position.bottom||null===multiselect.position.left)return!1;var t={},n={},o={x:e.pageX,y:e.pageY},i={top:null,bottom:null,height:null,left:null,right:null,width:null};o.y>=multiselect.position.top?(n.height=$(document).height(),t.height=o.y-multiselect.position.top,multiselect.position.top+t.height>=n.height&&(t.height-=multiselect.position.top+t.height-n.height+2),i.top=multiselect.position.top,i.bottom="inherit",i.height=t.height):(i.top="inherit",i.bottom=multiselect.position.bottom,i.height=multiselect.position.top-e.pageY),o.x>=multiselect.position.left?(n.width=$(document).width(),t.width=o.x-multiselect.position.left,multiselect.position.left+t.width>=n.width&&(t.width-=multiselect.position.left+t.width-n.width+2),i.right="inherit",i.left=multiselect.position.left,i.width=t.width):(i.right=multiselect.position.right,i.left="inherit",i.width=multiselect.position.left-e.pageX),$("#multiselect").css(i)},multiselect.stopResize=function(){$(document).off("mousemove mouseup")},multiselect.getSize=function(){if(!visible.multiselect())return!1;var e=$("#multiselect"),t=e.offset();return{top:t.top,left:t.left,width:parseInt(e.css("width").replace("px","")),height:parseInt(e.css("height").replace("px",""))}},multiselect.getSelection=function(e){var t=150,n=[],o=multiselect.getSize();return visible.contextMenu()?!1:visible.multiselect()?($(".photo, .album").each(function(){var e=$(this).offset();if(e.top>=o.top-t&&e.left>=o.left-t&&e.top+206<=o.top+o.height+t&&e.left+206<=o.left+o.width+t){var i=$(this).data("id");"0"!==i&&0!==i&&"f"!==i&&"s"!==i&&"r"!==i&&null!=i&&(n.push(i),$(this).addClass("active"))}}),void(0!==n.length&&visible.album()?contextMenu.photoMulti(n,e):0!==n.length&&visible.albums()?contextMenu.albumMulti(n,e):multiselect.close())):!1},multiselect.close=function(){sidebar.setSelectable(!0),multiselect.stopResize(),multiselect.position.top=null,multiselect.position.right=null,multiselect.position.bottom=null,multiselect.position.left=null,lychee.animate("#multiselect","fadeOut"),setTimeout(function(){return $("#multiselect").remove()},300)},password={value:""},password.get=function(e,t,n){if(lychee.publicMode===!1)t();else if(album.json&&"0"===album.json.password)t();else if(albums.json&&"0"===albums.getByID(e).password)t();else if(albums.json||album.json)if(null==n)password.getDialog(e,t);else{var o={albumID:e,password:n};api.post("Album::getPublic",o,function(e){e===!0?(basicModal.close(),password.value=n,t()):basicModal.error("password")})}else album.json={password:!0},t("")},password.getDialog=function(e,t){var n=function(n){return password.get(e,t,n.password)},o=function(){basicModal.close(),visible.albums()===!1&&lychee["goto"]()},i="\n <p>\n This album is protected by a password. Enter the password below to view the photos of this album:\n <input name='password' class='text' type='password' placeholder='password' value=''>\n </p>\n ";basicModal.show({body:i,buttons:{action:{title:"Enter",fn:n},cancel:{title:"Cancel",fn:o}}})},photo={json:null,cache:null},photo.getID=function(){var e=null;return e=photo.json?photo.json.id:$(".photo:hover, .photo.active").attr("data-id"),$.isNumeric(e)===!0?e:!1},photo.load=function(e,t){var n={photoID:e,albumID:t,password:password.value};api.post("Photo::get",n,function(n){var o=function i(){""!==password.value?photo.load(e,t):setTimeout(i,250)};return"Warning: Photo private!"===n?(lychee.content.show(),lychee["goto"](""),!1):"Warning: Wrong password!"===n?(o(),!1):(photo.json=n,visible.photo()||view.photo.show(),view.photo.init(),lychee.imageview.show(),void setTimeout(function(){lychee.content.show(),photo.preloadNext(e)},300))})},photo.preloadNext=function(e){if(album.json&&album.json.content&&album.json.content[e]&&""!=album.json.content[e].nextPhoto){var t=album.json.content[e].nextPhoto,n=album.json.content[t].url;$("head [data-prefetch]").remove(),$("head").append('<link data-prefetch rel="prefetch" href="'+n+'">')}},photo.parse=function(){photo.json.title||(photo.json.title="Untitled")},photo.previous=function(e){if(photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].previousPhoto){var t=0;e===!0&&(t=200,$("#imageview #image").css({WebkitTransform:"translateX(100%)",MozTransform:"translateX(100%)",transform:"translateX(100%)",opacity:0})),setTimeout(function(){return photo.getID()===!1?!1:void lychee["goto"](album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)},t)}},photo.next=function(e){if(photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].nextPhoto){var t=0;e===!0&&(t=200,$("#imageview #image").css({WebkitTransform:"translateX(-100%)",MozTransform:"translateX(-100%)",transform:"translateX(-100%)",opacity:0})),setTimeout(function(){return photo.getID()===!1?!1:void lychee["goto"](album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)},t)}},photo.duplicate=function(e){if(!e)return!1;e instanceof Array==!1&&(e=[e]),albums.refresh();var t={photoIDs:e.join()};api.post("Photo::duplicate",t,function(e){e!==!0?lychee.error(null,t,e):album.load(album.getID())})},photo["delete"]=function(e){var t={},n={},o="",i="";return e?(e instanceof Array==!1&&(e=[e]),1===e.length&&(i=visible.photo()?photo.json.title:album.json.content[e].title,""===i&&(i="Untitled")),t.fn=function(){var t=void 0,n=void 0;basicModal.close(),e.forEach(function(e,o,i){(""!==album.json.content[e].nextPhoto||""!==album.json.content[e].previousPhoto)&&(t=album.json.content[e].nextPhoto,n=album.json.content[e].previousPhoto,album.json.content[n].nextPhoto=t,album.json.content[t].previousPhoto=n),delete album.json.content[e],view.album.content["delete"](e)}),albums.refresh(),visible.photo()&&""!==t&&t!==photo.getID()?lychee["goto"](album.getID()+"/"+t):visible.albums()||lychee["goto"](album.getID());var o={photoIDs:e.join()};api.post("Photo::delete",o,function(e){e!==!0&&lychee.error(null,o,e)})},1===e.length?(t.title="Delete Photo",n.title="Keep Photo",o=lychee.html(_templateObject27,i)):(t.title="Delete Photo",n.title="Keep Photo",o=lychee.html(_templateObject28,e.length)),void basicModal.show({body:o,buttons:{action:{title:t.title,fn:t.fn,"class":"red"},cancel:{title:n.title,fn:basicModal.close}}})):!1},photo.setTitle=function(e){var t="",n="";if(!e)return!1;e instanceof Array==!1&&(e=[e]),1===e.length&&(photo.json?t=photo.json.title:album.json&&(t=album.json.content[e].title));var o=function(t){basicModal.close();var n=t.title;visible.photo()&&(photo.json.title=""===n?"Untitled":n,view.photo.title()),e.forEach(function(e,t,o){album.json.content[e].title=n,view.album.content.title(e)});var o={photoIDs:e.join(),title:n};api.post("Photo::setTitle",o,function(e){e!==!0&&lychee.error(null,o,e)})},i=lychee.html(_templateObject3,t);n=1===e.length?lychee.html(_templateObject29,i):lychee.html(_templateObject30,e.length,i),basicModal.show({body:n,buttons:{action:{title:"Set title",fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setAlbum=function(e,t){var n=void 0,o=void 0;if(!e)return!1;e instanceof Array==!1&&(e=[e]),visible.photo&&lychee["goto"](album.getID()),e.forEach(function(e,t,i){(""!==album.json.content[e].nextPhoto||""!==album.json.content[e].previousPhoto)&&(n=album.json.content[e].nextPhoto,o=album.json.content[e].previousPhoto,album.json.content[o].nextPhoto=n,album.json.content[n].previousPhoto=o),
|
|
delete album.json.content[e],view.album.content["delete"](e)}),albums.refresh();var i={photoIDs:e.join(),albumID:t};api.post("Photo::setAlbum",i,function(e){e!==!0&&lychee.error(null,i,e)})},photo.setStar=function(e){if(!e)return!1;visible.photo()&&(photo.json.star="0"===photo.json.star?"1":"0",view.photo.star()),e.forEach(function(e,t,n){album.json.content[e].star="0"===album.json.content[e].star?"1":"0",view.album.content.star(e)}),albums.refresh();var t={photoIDs:e.join()};api.post("Photo::setStar",t,function(e){e!==!0&&lychee.error(null,t,e)})},photo.setPublic=function(e,t){if("2"===photo.json["public"]){var n=function(){basicModal.close(),lychee["goto"](photo.json.original_album)};return basicModal.show({body:"<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>",buttons:{action:{title:"Show Album",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}}),!1}visible.photo()&&(photo.json["public"]="0"===photo.json["public"]?"1":"0",view.photo["public"](),"1"===photo.json["public"]&&contextMenu.sharePhoto(e,t)),album.json.content[e]["public"]="0"===album.json.content[e]["public"]?"1":"0",view.album.content["public"](e),albums.refresh(),api.post("Photo::setPublic",{photoID:e},function(e){e!==!0&&lychee.error(null,params,e)})},photo.setDescription=function(e){var t=photo.json.description,n=function(t){basicModal.close();var n=t.description;visible.photo()&&(photo.json.description=n,view.photo.description());var o={photoID:e,description:n};api.post("Photo::setDescription",o,function(e){e!==!0&&lychee.error(null,o,e)})};basicModal.show({body:lychee.html(_templateObject31,t),buttons:{action:{title:"Set Description",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.editTags=function(e){var t="",n="";if(!e)return!1;e instanceof Array==!1&&(e=[e]),visible.photo()?t=photo.json.tags:visible.album()&&1===e.length?t=album.json.content[e].tags:visible.search()&&1===e.length?t=album.json.content[e].tags:visible.album()&&e.length>1&&!function(){var n=!0;e.forEach(function(t,o,i){n=album.json.content[t].tags===album.json.content[e[0]].tags&&n===!0?!0:!1}),n===!0&&(t=album.json.content[e[0]].tags)}(),t=t.replace(/,/g,", ");var o=function(t){basicModal.close(),photo.setTags(e,t.tags)},i=lychee.html(_templateObject32,t);n=1===e.length?lychee.html(_templateObject33,i):lychee.html(_templateObject34,e.length,i),basicModal.show({body:n,buttons:{action:{title:"Set Tags",fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setTags=function(e,t){if(!e)return!1;e instanceof Array==!1&&(e=[e]),t=t.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g,","),t=t.replace(/,$|^,|(\ ){0,}$/g,""),visible.photo()&&(photo.json.tags=t,view.photo.tags()),e.forEach(function(e,n,o){album.json.content[e].tags=t});var n={photoIDs:e.join(),tags:t};api.post("Photo::setTags",n,function(e){e!==!0&&lychee.error(null,n,e)})},photo.deleteTag=function(e,t){var n=void 0;n=photo.json.tags.split(","),n.splice(t,1),photo.json.tags=n.toString(),photo.setTags([e],photo.json.tags)},photo.share=function(e,t){var n="",o=photo.getViewLink(e);switch(t){case"twitter":n="https://twitter.com/share?url="+encodeURI(o);break;case"facebook":n="http://www.facebook.com/sharer.php?u="+encodeURI(o)+"&t="+encodeURI(photo.json.title);break;case"mail":n="mailto:?subject="+encodeURI(photo.json.title)+"&body="+encodeURI(o);break;case"dropbox":lychee.loadDropbox(function(){var e=photo.json.title+"."+photo.getDirectLink().split(".").pop();Dropbox.save(photo.getDirectLink(),e)});break;default:n=""}""!==n&&(location.href=n)},photo.getArchive=function(e){var t=void 0,n=api.path+"?function=Photo::getArchive&photoID="+e;t=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",n):location.href.replace(location.hash,"")+n,lychee.publicMode===!0&&(t+="&password="+encodeURIComponent(password.value)),location.href=t},photo.getDirectLink=function(){var e="";return photo.json&&photo.json.url&&""!==photo.json.url&&(e=photo.json.url),e},photo.getViewLink=function(e){var t="view.php?p="+e;return location.href.indexOf("index.html")>0?location.href.replace("index.html"+location.hash,t):location.href.replace(location.hash,t)},search={hash:null},search.find=function(e){clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){0!==header.dom(".header__search").val().length?api.post("search",{term:e},function(e){var t="",n="",o="";e&&e.albums&&(albums.json={albums:e.albums},$.each(albums.json.albums,function(){albums.parse(this),n+=build.album(this)})),e&&e.photos&&(album.json={content:e.photos},$.each(album.json.content,function(){o+=build.photo(this)})),t=""===n&&""===o?"error":""===n?build.divider("Photos")+o:""===o?build.divider("Albums")+n:build.divider("Photos")+o+build.divider("Albums")+n,search.hash!==e.hash&&($(".no_content").remove(),lychee.animate(".content","contentZoomOut"),search.hash=e.hash,setTimeout(function(){"error"===t?(lychee.content.html(""),$("body").append(build.no_content("magnifying-glass"))):(lychee.content.html(t),lychee.animate(lychee.content,"contentZoomIn"))},300))}):search.reset()},250))},search.reset=function(){header.dom(".header__search").val(""),$(".no_content").remove(),null!=search.hash&&(albums.json=null,album.json=null,photo.json=null,search.hash=null,lychee.animate(".divider","fadeOut"),albums.load())},settings={},settings.createConfig=function(){var e=function(e){var t=e.dbName||"",n=e.dbUser||"",o=e.dbPassword||"",i=e.dbHost||"",a=e.dbTablePrefix||"";if(n.length<1)return basicModal.error("dbUser"),!1;i.length<1&&(i="localhost"),t.length<1&&(t="lychee");var r={dbName:t,dbUser:n,dbPassword:o,dbHost:i,dbTablePrefix:a};api.post("Config::create",r,function(e){return e!==!0?-1!==e.indexOf("Warning: Connection failed!")?(basicModal.show({body:"<p>Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Creation failed!")?(basicModal.show({body:"<p>Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Could not create file!")?(basicModal.show({body:"<p>Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look at the readme for more information.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):(basicModal.show({body:"<p>Something unexpected happened. Please try again and check your installation and server. Take a look at the readme for more information.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):void window.location.reload()})},t="\n <p>\n Enter your database connection details below:\n <input name='dbHost' class='text' type='text' placeholder='Database Host (optional)' value=''>\n <input name='dbUser' class='text' type='text' placeholder='Database Username' value=''>\n <input name='dbPassword' class='text' type='password' placeholder='Database Password' value=''>\n </p>\n <p>\n Lychee will create its own database. If required, you can enter the name of an existing database instead:\n <input name='dbName' class='text' type='text' placeholder='Database Name (optional)' value=''>\n <input name='dbTablePrefix' class='text' type='text' placeholder='Table prefix (optional)' value=''>\n </p>\n ";basicModal.show({body:t,buttons:{action:{title:"Connect",fn:e}}})},settings.createLogin=function(){var e=function(e){var t=e.username,n=e.password;if(t.length<1)return basicModal.error("username"),!1;if(n.length<1)return basicModal.error("password"),!1;basicModal.close();var o={username:t,password:n};api.post("Settings::setLogin",o,function(e){e!==!0&&basicModal.show({body:"<p>Unable to save login. Please try again with another username and password!</p>",buttons:{action:{title:"Retry",fn:settings.createLogin}}})})},t="\n <p>\n Enter a username and password for your installation:\n <input name='username' class='text' type='text' placeholder='New Username' value=''>\n <input name='password' class='text' type='password' placeholder='New Password' value=''>\n </p>\n ";basicModal.show({body:t,buttons:{action:{title:"Create Login",fn:e}}})},settings.setLogin=function(){var e=function(e){var t=e.oldPassword||"",n=e.username||"",o=e.password||"";if(t.length<1)return basicModal.error("oldPassword"),!1;if(n.length<1)return basicModal.error("username"),!1;if(o.length<1)return basicModal.error("password"),!1;basicModal.close();var i={oldPassword:t,username:n,password:o};api.post("Settings::setLogin",i,function(e){e!==!0&&lychee.error(null,i,e)})},t="\n <p>\n Enter your current password:\n <input name='oldPassword' class='text' type='password' placeholder='Current Password' value=''>\n </p>\n <p>\n Your username and password will be changed to the following:\n <input name='username' class='text' type='text' placeholder='New Username' value=''>\n <input name='password' class='text' type='password' placeholder='New Password' value=''>\n </p>\n ";basicModal.show({body:t,buttons:{action:{title:"Change Login",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}})},settings.setSorting=function(){var e=[],t=[],n=function(){t[0]=$(".basicModal select#settings_albums_type").val(),t[1]=$(".basicModal select#settings_albums_order").val(),e[0]=$(".basicModal select#settings_photos_type").val(),e[1]=$(".basicModal select#settings_photos_order").val(),basicModal.close(),albums.refresh();var n={typeAlbums:t[0],orderAlbums:t[1],typePhotos:e[0],orderPhotos:e[1]};api.post("Settings::setSorting",n,function(o){o===!0?(lychee.sortingAlbums="ORDER BY "+t[0]+" "+t[1],lychee.sortingPhotos="ORDER BY "+e[0]+" "+e[1],lychee.load()):lychee.error(null,n,o)})},o="\n <p>\n Sort albums by\n <span class=\"select\">\n <select id='settings_albums_type'>\n <option value='id'>Creation Time</option>\n <option value='title'>Title</option>\n <option value='description'>Description</option>\n <option value='public'>Public</option>\n </select>\n </span>\n in an\n <span class=\"select\">\n <select id='settings_albums_order'>\n <option value='ASC'>Ascending</option>\n <option value='DESC'>Descending</option>\n </select>\n </span>\n order.\n </p>\n <p>\n Sort photos by\n <span class=\"select\">\n <select id='settings_photos_type'>\n <option value='id'>Upload Time</option>\n <option value='takestamp'>Take Date</option>\n <option value='title'>Title</option>\n <option value='description'>Description</option>\n <option value='public'>Public</option>\n <option value='star'>Star</option>\n <option value='type'>Photo Format</option>\n </select>\n </span>\n in an\n <span class=\"select\">\n <select id='settings_photos_order'>\n <option value='ASC'>Ascending</option>\n <option value='DESC'>Descending</option>\n </select>\n </span>\n order.\n </p>\n ";basicModal.show({body:o,buttons:{action:{title:"Change Sorting",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}}),""!==lychee.sortingAlbums&&(t=lychee.sortingAlbums.replace("ORDER BY ","").split(" "),$(".basicModal select#settings_albums_type").val(t[0]),$(".basicModal select#settings_albums_order").val(t[1])),""!==lychee.sortingPhotos&&(e=lychee.sortingPhotos.replace("ORDER BY ","").split(" "),$(".basicModal select#settings_photos_type").val(e[0]),$(".basicModal select#settings_photos_order").val(e[1]))},settings.setDropboxKey=function(e){var t=function(t){var n=t.key;return t.key.length<1?(basicModal.error("key"),!1):(basicModal.close(),void api.post("Settings::setDropboxKey",{key:n},function(t){t===!0?(lychee.dropboxKey=n,e&&lychee.loadDropbox(e)):lychee.error(null,params,t)}))},n=lychee.html(_templateObject35,lychee.dropboxKey);basicModal.show({body:n,buttons:{action:{title:"Set Dropbox Key",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},sidebar={_dom:$(".sidebar"),types:{DEFAULT:0,TAGS:1},createStructure:{}},sidebar.dom=function(e){return null==e||""===e?sidebar._dom:sidebar._dom.find(e)},sidebar.bind=function(){var e=lychee.getEventName();return sidebar.dom("#edit_title").off(e).on(e,function(){visible.photo()?photo.setTitle([photo.getID()]):visible.album()&&album.setTitle([album.getID()])}),sidebar.dom("#edit_description").off(e).on(e,function(){visible.photo()?photo.setDescription(photo.getID()):visible.album()&&album.setDescription(album.getID())}),sidebar.dom("#edit_tags").off(e).on(e,function(){photo.editTags([photo.getID()])}),sidebar.dom("#tags .tag span").off(e).on(e,function(){photo.deleteTag(photo.getID(),$(this).data("index"))}),!0},sidebar.toggle=function(){return visible.sidebar()||visible.sidebarbutton()?(header.dom(".button--info").toggleClass("active"),lychee.content.toggleClass("content--sidebar"),sidebar.dom().toggleClass("active"),!0):!1},sidebar.setSelectable=function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];e===!0?sidebar.dom().removeClass("notSelectable"):sidebar.dom().addClass("notSelectable")},sidebar.changeAttr=function(e){var t=arguments.length<=1||void 0===arguments[1]?"-":arguments[1],n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];return null==e||""===e?!1:((null==t||""===t)&&(t="-"),n===!1&&(t=lychee.escapeHTML(t)),sidebar.dom(".attr_"+e).html(t),!0)},sidebar.createStructure.photo=function(e){if(null==e||""===e)return!1;var t=!1,n=e.takestamp+e.make+e.model+e.shutter+e.aperture+e.focal+e.iso,o={},i="";switch(lychee.publicMode===!1&&(t=!0),e["public"]){case"0":i="No";break;case"1":i="Yes";break;case"2":i="Yes (Album)";break;default:i="-"}return o.basics={title:"Basics",type:sidebar.types.DEFAULT,rows:[{title:"Title",value:e.title,editable:t},{title:"Uploaded",value:e.sysdate},{title:"Description",value:e.description,editable:t}]},o.image={title:"Image",type:sidebar.types.DEFAULT,rows:[{title:"Size",value:e.size},{title:"Format",value:e.type},{title:"Resolution",value:e.width+" x "+e.height}]},lychee.publicMode===!1?o.tags={title:"Tags",type:sidebar.types.TAGS,value:build.tags(e.tags),editable:t}:o.tags={},"0"!==n?o.exif={title:"Camera",type:sidebar.types.DEFAULT,rows:[{title:"Captured",value:e.takedate},{title:"Make",value:e.make},{title:"Type/Model",value:e.model},{title:"Shutter Speed",value:e.shutter},{title:"Aperture",value:e.aperture},{title:"Focal Length",value:e.focal},{title:"ISO",value:e.iso}]}:o.exif={},o.sharing={title:"Sharing",type:sidebar.types.DEFAULT,rows:[{title:"Public",value:i}]},o=[o.basics,o.image,o.tags,o.exif,o.sharing]},sidebar.createStructure.album=function(e){if(null==e||""===e)return!1;var t=!1,n={},o="",i="",a="",r="";switch(lychee.publicMode===!1&&(t=!0),e["public"]){case"0":o="No";break;case"1":o="Yes";break;default:o="-"}switch(e.visible){case"0":i="No";break;case"1":i="Yes";break;default:i="-"}switch(e.downloadable){case"0":a="No";break;case"1":a="Yes";break;default:a="-"}switch(e.password){case"0":r="No";break;case"1":r="Yes";break;default:r="-"}return n.basics={title:"Basics",type:sidebar.types.DEFAULT,rows:[{title:"Title",value:e.title,editable:t},{title:"Description",value:e.description,editable:t}]},n.album={title:"Album",type:sidebar.types.DEFAULT,rows:[{title:"Created",value:e.sysdate},{title:"Images",value:e.num}]},n.share={title:"Share",type:sidebar.types.DEFAULT,rows:[{title:"Public",value:o},{title:"Visible",value:i},{title:"Downloadable",value:a},{title:"Password",value:r}]},n=[n.basics,n.album,n.share]},sidebar.render=function(e){if(null==e||""===e)return!1;var t="",n=function(e){var t="";return t+="\n <div class='sidebar__divider'>\n <h1>"+e.title+"</h1>\n </div>\n <table>\n ",e.rows.forEach(function(e){var n=e.value;(""===n||null==n)&&(n="-"),n=lychee.html(_templateObject36,e.title.toLowerCase(),n),e.editable===!0&&(n+=" "+build.editIcon("edit_"+e.title.toLowerCase())),t+=lychee.html(_templateObject37,e.title,n)}),t+="\n </table>\n "},o=function(e){var t="",n="";return e.editable===!0&&(n=build.editIcon("edit_tags")),t+=lychee.html(_templateObject38,e.title,e.title.toLowerCase(),e.value,n)};return e.forEach(function(e){e.type===sidebar.types.DEFAULT?t+=n(e):e.type===sidebar.types.TAGS&&(t+=o(e))}),t},swipe={obj:null,tolerance:150,offset:0},swipe.start=function(e,t){return e&&(swipe.obj=e),t&&(swipe.tolerance=t),!0},swipe.move=function(e){return null===swipe.obj?!1:(swipe.offset=-1*e.x,void swipe.obj.css({WebkitTransform:"translateX("+swipe.offset+"px)",MozTransform:"translateX("+swipe.offset+"px)",transform:"translateX("+swipe.offset+"px)"}))},swipe.stop=function(e,t,n){return null==swipe.obj?!1:(e.x<=-swipe.tolerance?t(!0):e.x>=swipe.tolerance?n(!0):swipe.obj.css({WebkitTransform:"translateX(0px)",MozTransform:"translateX(0px)",transform:"translateX(0px)"}),swipe.obj=null,void(swipe.offset=0))},upload={},upload.show=function(e,t,n){basicModal.show({body:build.uploadModal(e,t),buttons:{action:{title:"Close","class":"hidden",fn:basicModal.close}},callback:n})},upload.notify=function(e,t){if((null==t||""===t)&&(t="You can now manage your new photo(s)."),!window.webkitNotifications)return!1;if(0!==window.webkitNotifications.checkPermission()&&window.webkitNotifications.requestPermission(),0===window.webkitNotifications.checkPermission()&&e){var n=window.webkitNotifications.createNotification("",e,t);n.show()}},upload.start={local:function(e){var t=album.getID(),n=!1,o=!1,i=function r(e,i){var a=new FormData,s=new XMLHttpRequest,l=0,u=0,c=function(){window.onbeforeunload=null,$("#upload_files").val(""),n===!1&&o===!1?(basicModal.close(),upload.notify("Upload complete")):n===!1&&o===!0?($(".basicModal #basicModal__action.hidden").show(),upload.notify("Upload complete")):($(".basicModal #basicModal__action.hidden").show(),upload.notify("Upload complete","Failed to upload one or more photos.")),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(t)};if(i.supported===!1){if(null!=i.next)r(e,i.next);else{for(var d=!1,p=0;p<e.length;p++)if(e[p].supported===!0){d=!0;break}d===!1&&setTimeout(c,2e3)}return!1}a.append("function","Photo::add"),a.append("albumID",t),a.append(0,i),s.open("POST",api.path),s.onload=function(){var t=!1,a="";i.ready=!0,200===s.status&&"true"===s.responseText?$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Finished").addClass("success"):("Error:"===s.responseText.substr(0,6)?(a=s.responseText.substr(6)+" Please take a look at the console of your browser for further details.",n=!0,$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Failed").addClass("error")):"Warning:"===s.responseText.substr(0,8)?(a=s.responseText.substr(8),o=!0,$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Skipped").addClass("warning")):(a="Server returned an unknown response. Please take a look at the console of your browser for further details.",n=!0,$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Failed").addClass("error")),$(".basicModal .rows .row:nth-child("+(i.num+1)+") p.notice").html(a).show(),n===!0&&lychee.error("Upload failed. Server returned the status code "+s.status+"!",s,s.responseText));for(var r=0;r<e.length;r++)if(e[r].ready===!1){t=!0;break}t===!1&&c()},s.upload.onprogress=function(t){if(t.lengthComputable!==!0)return!1;if(u=t.loaded/t.total*100|0,u>l&&($(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html(u+"%"),l=u),u>=100){var n=0;i.num+1>4&&(n=40*(i.num+1-4)),$(".basicModal .rows").scrollTop(n),$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Processing"),null!=i.next&&r(e,i.next)}},s.send(a)};if(e.length<=0)return!1;(t===!1||visible.albums()===!0)&&(t=0);for(var a=0;a<e.length;a++)e[a].num=a,e[a].ready=!1,e[a].supported=!0,a<e.length-1?e[a].next=e[a+1]:e[a].next=null,"image/jpeg"!==e[a].type&&"image/jpg"!==e[a].type&&"image/png"!==e[a].type&&"image/gif"!==e[a].type&&(e[a].ready=!0,e[a].supported=!1);window.onbeforeunload=function(){return"Lychee is currently uploading!"},upload.show("Uploading",e,function(){i(e,e[0])})},url:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=album.getID();e="string"==typeof e?e:"",t===!1&&(t=0);var n=function(e){var n=[];if(e.link&&e.link.length>3){basicModal.close();var o=e.link.split(".").pop();if("jpeg"!==o&&"jpg"!==o&&"png"!==o&&"gif"!==o&&"webp"!==o)return loadingBar.show("error","File format of link not supported."),!1;n[0]={name:e.link,supported:!0},upload.show("Importing URL",n,function(){$(".basicModal .rows .row .status").html("Importing");var n={url:e.link,albumID:t};api.post("Import::url",n,function(e){e!==!0?($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(),$(".basicModal .rows .row .status").html("Finished").addClass("warning"),$(".basicModal #basicModal__action.hidden").show(),lychee.error(null,n,e)):basicModal.close(),upload.notify("Import complete"),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(t)})})}else basicModal.error("link")};basicModal.show({body:lychee.html(_templateObject39,e),buttons:{action:{title:"Import",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}})},server:function(){var e=album.getID();e===!1&&(e=0);var t=function(t){var n=[];n[0]={name:t.path,supported:!0},upload.show("Importing from server",n,function(){$(".basicModal .rows .row .status").html("Importing");var n={albumID:e,path:t.path};api.post("Import::server",n,function(t){return albums.refresh(),upload.notify("Import complete"),"Notice: Import only contained albums!"===t?(visible.albums()?lychee.load():lychee["goto"](""),basicModal.close(),!0):("Warning: Folder empty or no readable files to process!"===t?($(".basicModal .rows .row p.notice").html("Folder empty or no readable files to process. Please take a look at the log (Settings -> Show Log) for further details.").show(),$(".basicModal .rows .row .status").html("Failed").addClass("error"),lychee.error("Could not start import because the folder was empty!",n,t)):t!==!0?($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(),$(".basicModal .rows .row .status").html("Finished").addClass("warning"),lychee.error(null,n,t)):basicModal.close(),album.getID()===!1?lychee["goto"]("0"):album.load(e),void $(".basicModal #basicModal__action.hidden").show())})})};basicModal.show({body:lychee.html(_templateObject40,lychee.location),buttons:{action:{title:"Import",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},dropbox:function(){var e=album.getID();e===!1&&(e=0);var t=function(t){for(var n="",o=0;o<t.length;o++)n+=t[o].link+",",t[o]={name:t[o].link,supported:!0};n=n.substr(0,n.length-1),upload.show("Importing from Dropbox",t,function(){$(".basicModal .rows .row .status").html("Importing");var t={url:n,albumID:e};api.post("Import::url",t,function(n){n!==!0?($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(),$(".basicModal .rows .row .status").html("Finished").addClass("warning"),$(".basicModal #basicModal__action.hidden").show(),lychee.error(null,t,n)):basicModal.close(),upload.notify("Import complete"),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(e)})})};lychee.loadDropbox(function(){Dropbox.choose({linkType:"direct",multiselect:!0,success:t})})}},view={},view.albums={init:function(){view.albums.title(),view.albums.content.init()},title:function(){lychee.setTitle("Albums",!1)},content:{scrollPosition:0,init:function(){var e="",t="";lychee.publicMode===!1&&(albums.parse(albums.json.smartalbums.unsorted),albums.parse(albums.json.smartalbums["public"]),albums.parse(albums.json.smartalbums.starred),albums.parse(albums.json.smartalbums.recent),e=build.divider("Smart Albums")+build.album(albums.json.smartalbums.unsorted)+build.album(albums.json.smartalbums["public"])+build.album(albums.json.smartalbums.starred)+build.album(albums.json.smartalbums.recent)),albums.json.albums&&0!==albums.json.num&&($.each(albums.json.albums,function(){albums.parse(this),t+=build.album(this)}),lychee.publicMode===!1&&(t=build.divider("Albums")+t)),""===e&&""===t?(lychee.content.html(""),$("body").append(build.no_content("eye"))):lychee.content.html(e+t),null!=view.albums.content.scrollPosition&&0!==view.albums.content.scrollPosition&&$(document).scrollTop(view.albums.content.scrollPosition)},title:function e(t){var e=albums.getByID(t).title;e=lychee.escapeHTML(e),$('.album[data-id="'+t+'"] .overlay h1').html(e).attr("title",e)},"delete":function(e){$('.album[data-id="'+e+'"]').css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove(),albums.json.num<=0&&lychee.content.find(".divider:last-child").remove()})}}},view.album={init:function(){album.parse(),view.album.sidebar(),view.album.title(),view.album["public"](),view.album.content.init(),album.json.init=1},title:function(){if((visible.album()||!album.json.init)&&!visible.photo())switch(album.getID()){case"f":lychee.setTitle("Starred",!1);break;case"s":lychee.setTitle("Public",!1);break;case"r":lychee.setTitle("Recent",!1);break;case"0":lychee.setTitle("Unsorted",!1);break;default:album.json.init&&sidebar.changeAttr("title",album.json.title),lychee.setTitle(album.json.title,!0)}},content:{init:function(){var e="";album.json.content&&album.json.content!==!1&&$.each(album.json.content,function(){e+=build.photo(this)}),view.albums.content.scrollPosition=$(document).scrollTop(),requestAnimationFrame(function(){return $(document).scrollTop(0)}),lychee.content.html(e)},title:function t(e){var t=album.json.content[e].title;t=lychee.escapeHTML(t),$('.photo[data-id="'+e+'"] .overlay h1').html(t).attr("title",t)},star:function(e){var t=$('.photo[data-id="'+e+'"] .icn-star');"1"===album.json.content[e].star?t.addClass("badge--visible"):t.removeClass("badge--visible")},"public":function(e){var t=$('.photo[data-id="'+e+'"] .icn-share');"1"===album.json.content[e]["public"]?t.addClass("badge--visible"):t.removeClass("badge--visible")},"delete":function(e){$('.photo[data-id="'+e+'"]').css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove(),visible.albums()||(album.json.num--,view.album.num())})}},description:function(){sidebar.changeAttr("description",album.json.description)},num:function(){sidebar.changeAttr("images",album.json.num)},"public":function(){"1"===album.json["public"]?($("#button_share_album").addClass("active").attr("title","Share Album"),$(".photo .iconic-share").remove(),album.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share_album").removeClass("active").attr("title","Make Public"),album.json.init&&sidebar.changeAttr("public","No"))},visible:function(){"1"===album.json.visible?sidebar.changeAttr("visible","Yes"):sidebar.changeAttr("visible","No")},downloadable:function(){"1"===album.json.downloadable?sidebar.changeAttr("downloadable","Yes"):sidebar.changeAttr("downloadable","No")},password:function(){"1"===album.json.password?sidebar.changeAttr("password","Yes"):sidebar.changeAttr("password","No")},sidebar:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){if((visible.album()||!album.json.init)&&!visible.photo()){var e=sidebar.createStructure.album(album.json),t=sidebar.render(e);sidebar.dom(".sidebar__wrapper").html(t),sidebar.bind()}})},view.photo={init:function(){photo.parse(),view.photo.sidebar(),view.photo.title(),view.photo.star(),view.photo["public"](),view.photo.photo(),photo.json.init=1},show:function(){lychee.content.addClass("view"),header.setMode("photo"),$("body").css("overflow","hidden"),$(document).bind("mouseenter",header.show).bind("mouseleave",header.hide),lychee.animate(lychee.imageview,"fadeIn")},hide:function(){header.show(),lychee.content.removeClass("view"),header.setMode("album"),$("body").css("overflow","auto"),$(document).unbind("mouseenter").unbind("mouseleave"),lychee.animate(lychee.imageview,"fadeOut"),setTimeout(function(){lychee.imageview.hide(),view.album.sidebar()},300)},title:function(){photo.json.init&&sidebar.changeAttr("title",photo.json.title),lychee.setTitle(photo.json.title,!0)},description:function(){photo.json.init&&sidebar.changeAttr("description",photo.json.description)},star:function(){"1"===photo.json.star?$("#button_star").addClass("active").attr("title","Unstar Photo"):($("#button_star").removeClass("active"),$("#button_star").attr("title","Star Photo"))},"public":function(){"1"===photo.json["public"]||"2"===photo.json["public"]?($("#button_share").addClass("active").attr("title","Share Photo"),photo.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share").removeClass("active").attr("title","Make Public"),photo.json.init&&sidebar.changeAttr("public","No"))},tags:function(){sidebar.changeAttr("tags",build.tags(photo.json.tags),!0),sidebar.bind()},photo:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){lychee.imageview.html(build.imageview(photo.json,visible.header()));var e=lychee.imageview.find("a#next"),t=lychee.imageview.find("a#previous"),n=photo.getID(),o=album.json&&album.json.content&&album.json.content[n]&&""!==album.json.content[n].nextPhoto,i=album.json&&album.json.content&&album.json.content[n]&&""!==album.json.content[n].previousPhoto;if(o===!1||lychee.viewMode===!0)e.hide();else{var a=album.json.content[n].nextPhoto,r=album.json.content[a];e.css("background-image",lychee.html(_templateObject41,r.thumbUrl))}if(i===!1||lychee.viewMode===!0)t.hide();else{var s=album.json.content[n].previousPhoto,l=album.json.content[s];t.css("background-image",lychee.html(_templateObject41,l.thumbUrl))}}),sidebar:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=sidebar.createStructure.photo(photo.json),t=sidebar.render(e);sidebar.dom(".sidebar__wrapper").html(t),sidebar.bind()})},visible={},visible.albums=function(){return header.dom(".header__toolbar--public").hasClass("header__toolbar--visible")?!0:header.dom(".header__toolbar--albums").hasClass("header__toolbar--visible")?!0:!1},visible.album=function(){return header.dom(".header__toolbar--album").hasClass("header__toolbar--visible")?!0:!1},visible.photo=function(){return $("#imageview.fadeIn").length>0?!0:!1},visible.search=function(){return null!=search.hash?!0:!1},visible.sidebar=function(){return sidebar.dom().hasClass("active")===!0?!0:!1;
|
|
},visible.sidebarbutton=function(){return visible.photo()?!0:visible.album()&&$("#button_info_album:visible").length>0?!0:!1},visible.header=function(){return header.dom().hasClass("header--hidden")===!0?!1:!0},visible.contextMenu=function(){return basicContext.visible()},visible.multiselect=function(){return $("#multiselect").length>0?!0:!1}; |