function_taggedTemplateLiteral(e,t){returnObject.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}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="length"ine&&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(se.test(t))returnJ.filter(t,e,n);t=J.filter(t,e)}returnJ.grep(e,function(e){returnX.call(t,e)>=0!==n})}functioni(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functiona(e){vart=fe[e]={};returnJ.each(e.match(he)||[],function(e,n){t[n]=!0}),t}functionr(){Z.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!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(we,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ye.test(n)?J.parseJSON(n):n}catch(i){}ve.set(e,t,n)}elsen=void0;returnn}functionc(){return!0}functionu(){return!1}functiond(){try{returnZ.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=Oe.exec(e.type);returnt?e.type=t[1]:e.removeAttribute("type"),e}functionm(e,t){for(varn=0,o=e.length;o>n;n++)ge.set(e[n],"globalEval",!t||ge.get(t[n],"globalEval"))}functionb(e,t){varn,o,i,a,r,s,l,c;if(1===t.nodeType){if(ge.hasData(e)&&(a=ge.access(e),r=ge.set(t,a),c=a.events)){deleter.handle,r.events={};for(iinc)for(n=0,o=c[i].length;o>n;n++)J.event.add(t,i,c[i][n])}ve.hasData(e)&&(s=ve.access(e),l=J.extend({},s),ve.set(t,l))}}functiong(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&&Te.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),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");returni.detach(),a}functionw(e){vart=Z,n=Fe[e];returnn||(n=y(e,t),"none"!==n&&n||(Re=(Re||J("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Re[0].contentDocument,t.write(),t.close(),n=y(e,t),Re.detach()),Fe[e]=n),n}functionx(e,t,n){varo,i,a,r,s=e.style;returnn=n||Be(e),n&&(r=n.getPropertyValue(t)||n[t]),n&&(""!==r||J.contains(e.ownerDocument,e)||(r=J.style(e,t)),Ue.test(r)&&He.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)),void0!==r?r+"":r}function_(e,t){return{get:function(){returne()?voiddeletethis.get:(this.get=t).apply(this,arguments)}}}functionj(e,t){if(tine)returnt;for(varn=t[0].toUpperCase()+t.slice(1),o=t,i=Ve.length;i--;)if(t=Ve[i]+n,tine)returnt;returno}functionT(e,t,n){varo=ze.exec(t);returno?Math.max(0,o[1]-(n||0))+(o[2]||"px"):t}functionk(e,t,n,o,i){for(vara=n===(o?"border":"content")?4:"width"===t?1:0,r=0;4>a;a+=2)"margin"===n&&(r+=J.css(e,n+_e[a],!0,i)),o?("content"===n&&(r-=J.css(e,"padding"+_e[a],!0,i)),"margin"!==n&&(r-=J.css(e,"border"+_e[a]+"Width",!0,i))):(r+=J.css(e,"
this.classList.remove("error")}}),!0},l=functionm(t){if(i(t)===!1)return!1;if(null!=n())returnf(!0),setTimeout(function(){returnm(t)},301),!1;e=document.activeElement;varo=a(t);document.body.insertAdjacentHTML("beforeend",o),s(t);varr=n("input");returnnull!=r&&r.select(),null!=t.callback&&t.callback(t),!0},c=function(e){h();vart=n("input[name='"+e+"']");t.classList.add("error"),t.select(),n().classList.remove("basicModal--fadeIn","basicModal--shake"),setTimeout(function(){returnn().classList.add("basicModal--shake")},1)},u=function(){returnnull!=n()?!0:!1},d=function(){vare=n("#basicModal__action");returnnull!=e?(e.click(),!0):!1},p=function(){vare=n("#basicModal__cancel");returnnull!=e?(e.click(),!0):!1},h=function(){vare=n(".basicModal__button",!0);o(e,function(e){returne.classList.remove("basicModal__button--active")});vart=n("input",!0);returno(t,function(e){returne.classList.remove("error")}),!0},f=function(t){if(u()===!1)return!1;t!==!0&&(t=!1);varo=n().parentElement;return"false"===o.getAttribute("data-closable")&&t===!1?!1:(o.classList.remove("basicModalContainer--fadeIn"),o.classList.add("basicModalContainer--fadeOut"),setTimeout(function(){returno.parentElement.removeChild(o)},300),null!=e&&(e.focus(),e=null),!0)};return{THEME:t,show:l,visible:u,getValues:r,action:d,cancel:p,error:c,reset:h,close:f}});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='thumb' data-overlay='false'>\n <img src='$","' width='200' height='
fn:o},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.setTags=function(e,t){if(!e)return!1;einstanceofArray==!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});varn={photoIDs:e.join(),tags:t};api.post("Photo::setTags",n,function(e){e!==!0&&lychee.error(null,n,e)})},photo.deleteTag=function(e,t){varn=void0;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){varn="",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(){vare=photo.json.title+"."+photo.getDirectLink().split(".").pop();Dropbox.save(photo.getDirectLink(),e)});break;default:n=""}""!==n.length&&(location.href=n)},photo.getSize=function(){vare="big",t=!1,n=""!==photo.json.medium,o=window.devicePixelRatio,i={width:$(window).width()-60,height:$(window).height()-100};return(photo.json.width>i.width||photo.json.height>i.height)&&(t=!0),null!=o&&o>1&&(i.width=i.width*o,i.height=i.height*o),n===!0&&1920>i.width&&1080>i.height&&(e="medium"),t===!1&&photo.json.width<i.width&&photo.json.width<i.height&&(e="small"),e},photo.getArchive=function(e){vart=void0,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(){vare="";returnphoto.json&&photo.json.url&&""!==photo.json.url&&(e=photo.json.url),e},photo.getViewLink=function(e){vart="view.php?p="+e;returnlocation.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){vart="",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(){vare=function(e){vart=e.dbName||"",n=e.dbUser||"",o=e.dbPassword||"",i=e.dbHost||"",a=e.dbTablePrefix||"";if(n.length<1)returnbasicModal.error("dbUser"),!1;i.length<1&&(i="localhost"),t.length<1&&(t="lychee");varr={dbName:t,dbUser:n,dbPassword:o,dbHost:i,dbTablePrefix:a};api.post("Database::createConfig",r,function(e){returne!==!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.