/** * Spotlight.js v0.7.8 * Copyright 2019-2021 Nextapps GmbH * Author: Thomas Wilkerling * Licence: Apache-2.0 * https://github.com/nextapps-de/spotlight */ /* this library was modified by anapnoe to work with stable-diffusion-ui-ux the changes made were to root selector and an extra function was added to toggle the pan zoom functionallity */ (function(){"use strict";function e(e,n,t){e.classList[t?"add":"remove"](n)}function n(e,n,t){t=""+t,e["_s_"+n]!==t&&(e.style.setProperty(n,t),e["_s_"+n]=t)}Object.assign||(Object.assign=function(e,n){for(var t,i=Object.keys(n),o=0;o
";var p={},v=document.createElement("video");function $(e,n,t,i){if("node"!==i){for(var o,s=Object.keys(t),r=0;r.5*(0>(e=e.deltaY)?1:e?-1:0)?eJ():eG())}function eW(n,t){("boolean"==typeof n?n:!ey)===!ey&&(e(e$,"on",ey=ey?clearTimeout(ey):1),t||eY(ey))}function eY(e){V&&(i(em,function(){n(em,"transition-duration",""),n(em,"transform","")}),e&&(n(em,"transition-duration",J+"s"),n(em,"transform","translateX(0)"))),e&&(ey=setTimeout(ne,1e3*J))}function eB(){O&&(ek=Date.now()+2950,eb||(e(d,"menu",!0),function n(t){eb=setTimeout(function(){var t=Date.now();t>=ek?(e(d,"menu"),eb=0):n(ek-t)},3e3)}(3e3)))}function eO(n){"boolean"==typeof n&&(eb=n?eb:0),eb?(eb=clearTimeout(eb),e(d,"menu")):eB()}function e2(e){r(e,!0),E=!0,z=!1;var n=e.touches;n&&(n=n[0])&&(e=n),x=k*w<=y,_=e.pageX,g=e.pageY,c(et)}function eD(e){if(r(e),E){if(z){if(x&&z){var n=(e=m<-(y/7)&&(Ny/7&&(1n?m=n:m<-n&&(m=-n),C*w>b&&(n=(C*w-b)/2,(h-=g-(g=e.pageY))>n?h=n:h<-n&&(h=-n))),z=!0,eP(m,h)}else eB()}function eM(e){var n=eF();("boolean"!=typeof e||!!n!==e)&&(n?document[ew]():d[eC]())}function ej(n){"string"!=typeof n&&(n=H?"":I||"white"),H!==n&&(H&&e(d,H),n&&e(d,n,!0),H=n)}function eA(t){"boolean"==typeof t&&(q=!t),e(eo,"autofit",q=1===w&&!q),n(eo,"transform",""),w=1,h=m=0,eL(),c(et),eP()}function eG(){var e=w/.65;50>=e&&(q&&eA(),eP(m/=.65,h/=.65),eK(e))}function eJ(){var e=.65*w;q&&eA(),1<=e&&(1===e?m=h=0:(m*=.65,h*=.65),eP(m,h),eK(e))}function eK(e){w=e||1,e6()}function eQ(){var e=ee,n=document.createElement("a"),t=eo.src;n.href=t,n.download=t.substring(t.lastIndexOf("/")+1),e.appendChild(n),n.click(),e.removeChild(n)}function eU(n){setTimeout(function(){ee.removeChild(d),et=eo=e_=S=P=R=X=W=Y=A=null},200),e(ee,"hide-scrollbars"),e(d,"show"),eM(!1),eV(),history.go(!0===n?-1:-2),eg&&(e1.src=""),ey&&eW(),eo&&eZ(eo),eb&&(eb=clearTimeout(eb)),H&&ej(),G&&e(d,G),Y&&Y()}function eZ(e){if(e.g)e.g.appendChild(e),e.g=null;else{var n=e.parentNode;n&&n.removeChild(e),e.src=e.onerror=""}}function e9(e){if(e&&eB(),1N;return N=e,nt(n),!0}}function nt(t){if(h=m=0,w=1,eo){if(eo.onerror)eZ(eo);else{var o=eo;setTimeout(function(){o&&eo!==o&&(eZ(o),o=null)},650),e4(),eP()}}!function n(t){var o,s=R[N-1],r=s;if(S={},P&&Object.assign(S,P),Object.assign(S,r.dataset||r),L=S.media,A=S.onclick,I=S.theme,G=S.class,O=eN("autohide",!0),T=eN("infinite"),V=eN("progress",!0),D=eN("autoslide"),M=eN("preload",!0),j=S.buttonHref,J=D&&parseFloat(D)||7,H||I&&ej(I),G&&e(d,G,!0),G&&i(d),r=S.control){r="string"==typeof r?r.split(","):r;for(var l=0;l