functionmobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}functiongup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");vart="[\\?&]"+e+"=([^&#]*)",n=newRegExp(t),o=n.exec(window.location.href);returnnull===o?"":o[1]}!function(e,t){"object"==typeofmodule&&"object"==typeofmodule.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)thrownewError("jQuery requires a window with a document");returnt(e)}:t(e)}("undefined"!=typeofwindow?window:this,function(e,t){functionn(e){vart=e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeoft&&t>0&&t-1ine}functiono(e,t,n){if(J.isFunction(t))returnJ.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)returnJ.grep(e,function(e){returne===t!==n});if("string"==typeoft){if(st.test(t))returnJ.filter(t,e,n);t=J.filter(t,e)}returnJ.grep(e,function(e){returnz.call(t,e)>=0!==n})}functioni(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functionr(e){vart=ft[e]={};returnJ.each(e.match(ht)||[],function(e,n){t[n]=!0}),t}functiona(){Q.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1),J.ready()}functions(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+s.uid++}functionl(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace(wt,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:yt.test(n)?J.parseJSON(n):n}catch(i){}vt.set(e,t,n)}elsen=void0;returnn}functionu(){return!0}functionc(){return!1}functiond(){try{returnQ.activeElement}catch(e){}}functionp(e,t){returnJ.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}functionh(e){returne.type=(null!==e.getAttribute("type"))+"/"+e.type,e}functionf(e){vart=Lt.exec(e.type);returnt?e.type=t[1]:e.removeAttribute("type"),e}functionm(e,t){for(varn=0,o=e.length;o>n;n++)bt.set(e[n],"globalEval",!t||bt.get(t[n],"globalEval"))}functiong(e,t){varn,o,i,r,a,s,l,u;if(1===t.nodeType){if(bt.hasData(e)&&(r=bt.access(e),a=bt.set(t,r),u=r.events)){deletea.handle,a.events={};for(iinu)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}vt.hasData(e)&&(s=vt.access(e),l=J.extend({},s),vt.set(t,l))}}functionb(e,t){varn=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];returnvoid0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}functionv(e,t){varn=t.nodeName.toLowerCase();"input"===n&&jt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}functiony(t,n){varo,i=J(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");returni.detach(),r}functionw(e){vart=Q,n=Ht[e];returnn||(n=y(e,t),"none"!==n&&n||(Rt=(Rt||J("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Rt[0].contentDocument,t.write(),t.close(),n=y(e,t),Rt.detach()),Ht[e]=n),n}functionx(e,t,n){varo,i,r,a,s=e.style;returnn=n||Ut(e),n&&(a=n.getPropertyValue(t)||n[t]),n&&(""!==a||J.contains(e.ownerDocument,e)||(a=J.style(e,t)),Bt.test(a)&&Ft.test(t)&&(o=s.width,i=s.minWidth,r=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=o,s.minWidth=i,s.maxWidth=r)),void0!==a?a+"":a}functionT(e,t){return{get:function(){returne()?voiddeletethis.get:(this.get=t).apply(this,arguments)}}}functionC(e,t){if(tine)returnt;for(varn=t[0].toUpperCase()+t.slice(1),o=t,i=Vt.length;i--;)if(t=Vt[i]+n,tine)returnt;returno}functionj(e,t,n){varo=Xt.exec(t);returno?Math.max(0,o[1]-(n||0))+(o[2]||"px"):t}functionk(e,t,n,o,i){for(varr=n===(o?"border":"content")?4:"width"===t?1:0,a=0;4>r;r+=2)"margin"===n&&(a+=J.css(e,n+Tt[r],!0,i)),o?("content"===n&&(a-=J.css(e,"padding"+Tt[r],!0,i)),"margin"!==n&&(a-=J.css(e,"border"+Tt[r]+"Width",!0,i))):(a+=J.css(e,"padding"+Tt[r],!0,i),"p
BrowserDetect.init(),function(e){e.fn.retina=function(t){varn={"retina-background":!1,"retina-suffix":"@2x"};t&&e.extend(n,t);varo=function(e,t){varn=newImage;n.onload=function(){t(n)},n.src=e};window.devicePixelRatio>1&&this.each(function(){vart=e(this);if("img"==this.tagName.toLowerCase()&&t.attr("src")){vari=t.attr("src").replace(/\.(?!.*\.)/,n["retina-suffix"]+".");o(i,function(n){t.attr("src",n.src);varo=e("<div>").append(t.clone()).remove().html();/(width|height)=["']\d+["']/.test(o)||t.attr("width",n.width/2)})}if(n["retina-background"]){varr=t.css("background-image");if(/^url\(.*\)$/.test(r)){vari=r.substring(4,r.length-1).replace(/\.(?!.*\.)/,n["retina-suffix"]+".");o(i,function(e){t.css("background-image","url("+e.src+")"),"auto auto"==t.css("background-size")&&t.css("background-size",e.width/2+"px auto")})}}})}}(jQuery),function(e){vart=function(t){varn=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(){n.swipeEnd()}),t.on("mousedown",function(e){n.mouseDown(e)})};t.prototype={touchStart:function(e){vart=e.originalEvent.touches[0];this.swipeStart(e,t.pageX,t.pageY)},touchMove:function(e){vart=e.originalEvent.touches[0];this.swipeMove(e,t.pageX,t.pageY)},mouseDown:function(e){vart=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=(newDate).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){varo=this,i=e.Event(t),r=o.pos.start.x-o.pos.end.x,a=o.pos.end.y-o.pos.start.y,s=Math.atan2(a,r),l="up",u=Math.round(Math.sqrt(Math.pow(r,2)+Math.pow(a,2))),c=Math.round(180*s/Math.PI),d=Math.round(u/((newDate).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:r,y:a,direction:l,distance:u,angle:c,speed:d},e(o.el).trigger(i)}},e.fn.swipe=function(){newt(this);returnthis}}(jQuery),album={json:null},album.getID=function(){vare;returne=photo.json?photo.json.album:album.json?album.json.id:$(".album:hover, .album.active").attr("data-id"),e||(e=$(".album:hover, .album.active").attr("data-id")),e||(e=$(".photo:hover, .photo.active").attr("data-album-id")),e?e:!1},album.load=function(e,t){varn,o,i,r;password.get(e,function(){t||(lychee.animate(".album, .photo","contentZoomOut"),lychee.animate(".divider","fadeOut")),n=(newDate).getTime(),o="getAlbum&albumID="+e+"&password="+password.value,lychee.api(o,function(o){return"Warning: Album private!"===o?(void0!=document.location.hash.replace("#","").split("/")[1]?lychee.setMode("view"):(lychee.content.show(),lychee.goto("")),!1):"Warning: Wrong password!"===o?(album.load(e,t),!1):(album.json=o,i=(newDate).getTime()-n,r=i>300?0:300-i,t===!0&&(r=0),visible.albums()||visible.photo()||visible.album()||(r=0),voidsetTimeout(function(){view.album.init(),t||(lychee.animate(".album, .photo","contentZoomIn"),view.header.mode("album"))},r))})})},album.parse=function(){album.json.title||(album.json.title="Untitled")},album.add=function(){vare,t,n,o=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};n=[["Create Album",function(){e=$(".message input.text").val(),0===e.length&&(e="Untitled"),modal.close(),t="addAlbum&title="+escape(encodeURI(e)),lychee.api(t,function(e){e===!0&&(e=1),e!==!1&&o(e)?(albums.refresh(),lychee.goto(e)):lychee.error(null,t,e)})}],["Cancel",function(){}]],modal.show("New Album","Enter a title for this album: <input class='text' type='text' maxlength='30' placeholder='Title' value='Untitled'>",n)},album.dele
},multiselect.getSelection=function(e){vart,n,o=150,i=[],r=multiselect.getSize();returnvisible.contextMenu()?!1:visible.multiselect()?($(".photo, .album").each(function(){n=$(this).offset(),n.top>=r.top-o&&n.left>=r.left-o&&n.top+206<=r.top+r.height+o&&n.left+206<=r.left+r.width+o&&(t=$(this).data("id"),"0"!==t&&0!==t&&"f"!==t&&"s"!==t&&"r"!==t&&null!==t&&void0!==t&&(i.push(t),$(this).addClass("active")))}),void(0!==i.length&&visible.album()?contextMenu.photoMulti(i,e):0!==i.length&&visible.albums()?contextMenu.albumMulti(i,e):multiselect.close())):!1},multiselect.close=function(){multiselect.stopResize(),multiselect.position.top=null,multiselect.position.right=null,multiselect.position.bottom=null,multiselect.position.left=null,lychee.animate("#multiselect","fadeOut"),setTimeout(function(){$("#multiselect").remove()},300)},password={value:""},password.get=function(e,t){varn,o=$(".message input.text").val();lychee.publicMode?album.json&&0==album.json.password?t():albums.json&&0==albums.json.content[e].password?t():albums.json||album.json?void0==o?password.getDialog(e,t):(n="checkAlbumAccess&albumID="+e+"&password="+md5(o),lychee.api(n,function(e){e===!0?(password.value=md5(o),t()):(lychee.goto(""),loadingBar.show("error","Access denied. Wrong password!"))})):(album.json={password:!0},t("")):t()},password.getDialog=function(e,t){varn;n=[["Enter",function(){password.get(e,t)}],["Cancel",lychee.goto]],modal.show("<a class='icon-lock'></a> Enter Password","This album is protected by a password. Enter the password below to view the photos of this album: <input class='text' type='password' placeholder='password' value=''>",n,-110,!1)},photo={json:null,cache:null},photo.getID=function(){vare;returne=photo.json?photo.json.id:$(".photo:hover, .photo.active").attr("data-id"),e?e:!1},photo.load=function(e,t){varn,o;n="getPhoto&photoID="+e+"&albumID="+t+"&password="+password.value,lychee.api(n,function(n){return"Warning: Wrong password!"===n?(o=function(){""!==password.value?photo.load(e,t):setTimeout(o,250)},o(),!1):(photo.json=n,visible.photo()||view.photo.show(),view.photo.init(),lychee.imageview.show(),voidsetTimeout(function(){lychee.content.show()},300))})},photo.preloadNext=function(e){vart,n;returnmobileBrowser()?!1:void(album.json&&album.json.content&&album.json.content[e]&&""!=album.json.content[e].nextPhoto&&(t=album.json.content[e].nextPhoto,n=album.json.content[t].url,photo.cache=newImage,photo.cache.src=n,photo.cache.onload=function(){photo.cache=null}))},photo.parse=function(){photo.json.title||(photo.json.title="Untitled")},photo.previous=function(e){vart=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].previousPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(100%)",MozTransform:"translateX(100%)",transform:"translateX(100%)",opacity:0})),setTimeout(function(){returnphoto.getID()===!1?!1:voidlychee.goto(album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)},t))},photo.next=function(e){vart=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].nextPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(-100%)",MozTransform:"translateX(-100%)",transform:"translateX(-100%)",opacity:0})),setTimeout(function(){returnphoto.getID()===!1?!1:voidlychee.goto(album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)},t))},photo.duplicate=function(e){vart;returne?(einstanceofArray==!1&&(e=[e]),albums.refresh(),t="duplicatePhoto&photoIDs="+e,voidlychee.api(t,function(e){e!==!0?lychee.error(null,t,e):album.load(album.getID())})):!1},photo.delete=function(e){vart,n,o;returne?(einstanceofArray==!1&&(e=[e]),1===e.length&&(o=visible.photo()?photo.json.title:album.json.content[e].title,""===o&&(o="Untitled")),n=[["",function(){varn="",o="";e.forEach(function(e){(""!==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,