{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","uploadsHistoryOrder","previewImages","fileLength","uploadAge","stripTags","page","localStorage","apiChecked","private","enableUserAccounts","maxSize","chunkSizeConfig","temporaryUploadAges","fileIdentifierLength","stripTagsConfig","album","maxSizeBytes","urlMaxSize","urlMaxSizeBytes","tabs","activeTab","albumSelect","albumSelectOnChange","previewTemplate","dropzone","clipboardJS","lazyLoad","urlsQueue","activeUrlsQueue","imageExts","videoExts","albumTitleMaxLength","albumDescMaxLength","onInitError","error","document","querySelector","classList","add","querySelectorAll","forEach","element","uploadButton","innerText","remove","addEventListener","window","location","reload","response","onAxiosError","onError","console","content","createElement","innerHTML","toString","swal","title","icon","cont","statusText","520","521","522","523","524","525","526","527","530","status","data","description","success","checkClientVersion","apiVersion","match","src","text","buttons","confirm","closeModal","then","checkIfPublic","axios","get","onDownloadProgress","render","done","do","version","parseInt","max","default","preparePage","catch","prepareUpload","verifyToken","button","href","reloadOnError","post","removeItem","authLink","setAttribute","value","prepareShareX","fetchAlbums","prepareUploadConfig","getPrettyBytes","prepareDropzone","event","addUrlsToQueue","tabsContainer","loop","i","id","dataset","tabContent","setActiveTab","push","tab","length","index","let","headers","Array","isArray","albums","option","name","appendChild","previewNode","parentNode","removeChild","tabDiv","div","className","previewsContainer","Dropzone","body","url","paramName","clickable","maxFilesize","uploadMultiple","createImageThumbnails","autoProcessQueue","chunking","Boolean","parallelChunkUploads","timeout","init","this","on","file","previewElement","xhr","ontimeout","instances","getUploadingFiles","filter","instance","_handleUploadError","undefined","_uplSpeedCalc","lastSent","timestamp","Date","now","bytes","upload","chunked","setRequestHeader","chunks","progress","prettyBytesPerSec","total","Math","size","percentage","bytesSent","toFixed","upl","prefix","skipProgress","last","totalChunkCount","chunkIndex","elapsed","bytesPerSec","fullSec","splice","excessDuration","duration","files","updateTemplate","err","Error","test","updateTemplateIcon","chunksUploaded","uuid","original","type","albumid","filelength","age","striptags","urls","split","trim","firstChild","processUrlsQueue","shiftQueue","initUrlUpload","finishedUrlUpload","shift","templateElement","iconClass","iconElement","link","a","clipboard","clipboardText","parentElement","exec","extname","toLowerCase","includes","img","onerror","currentTarget","update","expirydate","expiryDate","getPrettyDate","createAlbum","cancel","download","checked","public","selected","fallback","min","config","siBytes","label","select","help","valueHandler","display","number","round","disabled","force","video","suffix","uploadFields","stored","parseFloat","String","getPrettyUploadAge","isNaN","form","preventDefault","configKeys","Object","keys","key","conf","field","parsed","find","sel","control","opts","j","opt","join","tmp","submit","checkValidity","elements","hours","minutes","days","items","clipboardData","originalEvent","item","kind","blob","getAsFile","File","addFile","cookieconsent","initialise","cookie","path","pathname","expiryDays","secure","protocol","palette","popup","background","theme","position","message","dismiss","ClipboardJS","timer","LazyLoad","elements_selector"],"mappings":"AAEAA,IAAMC,OAAS,CACbC,MAAO,QACPC,UAAW,YACXC,gBAAiB,kBACjBC,oBAAqB,sBACrBC,cAAe,gBACfC,WAAY,aACZC,UAAW,YACXC,UAAW,aAGPC,KAAO,CAEXR,MAAOS,aAAaV,OAAOC,OAG3BU,YAAY,EACZC,QAAS,KACTC,mBAAoB,KACpBC,QAAS,KACTC,gBAAiB,KACjBC,oBAAqB,KACrBC,qBAAsB,KACtBC,gBAAiB,KAGjBC,MAAO,KAEPhB,gBAAiB,KACjBE,cAAe,KACfC,WAAY,KACZC,UAAW,KACXC,UAAW,KAEXY,aAAc,KACdC,WAAY,KACZC,gBAAiB,KACjBpB,UAAW,KAEXqB,KAAM,GACNC,UAAW,KACXC,YAAa,KACbC,oBAAqB,KACrBC,gBAAiB,KAEjBC,SAAU,KACVC,YAAa,KACbC,SAAU,KAGVC,UAAW,GACXC,gBAAiB,EAIjBC,UAAW,CAAC,QAAS,OAAQ,QAAS,OAAQ,OAAQ,OAAQ,QAAS,OAAQ,QAC/EC,UAAW,CAAC,QAAS,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,SAErEC,oBAAqB,GACrBC,mBAAoB,IAItBC,YAAgB,SAA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AAIQ,EAAMD,OAAQP,IAAK,CACrCzH,IAAMwS,EAAOH,EAAMpK,EAAMR,IACzB,GAAkB,SAAd+K,EAAKC,KAAiB,CACxBzS,IAAM0S,EAAOF,EAAKG,YAEZ1I,EAAO,IAAI2I,KAAK,CAACF,GAAO,gBAAgBA,EAAKxF,KAAKhI,MAAM,sBAAsB,GAAM,CACxFgI,KAAMwF,EAAKxF,OAEbxM,KAAKmB,SAASgR,QAAQ5I,QAK5B9G,OAAOD,iBAAiB,oBAAkB,WACpCC,OAAO2P,eACT3P,OAAO2P,cAAcC,WAAW,CAC9BC,OAAQ,CACNxK,KAAM,uBACNyK,KAAM9P,OAAOC,SAAS8P,SACtBC,WAAY,IACZC,OAAqC,WAA7BjQ,OAAOC,SAASiQ,UAE1BC,QAAS,CACPC,MAAO,CACLC,WAAY,UACZpO,KAAM,WAERoB,OAAQ,CACNgN,WAAY,UACZpO,KAAM,YAGVqO,MAAO,UACPC,SAAU,cACVhQ,QAAS,CACPiQ,QAAS,uJACTC,QAAS,UACTzF,KAAM,+BACN1H,KAAM,kBAIZ/F,KAAK+E,gBAEL/E,KAAKoB,YAAc,IAAI+R,YAAY,iBAEnCnT,KAAKoB,YAAYkI,GAAG,WAAS,WAC3B,OAAOlG,KAAK,GAAI,yCAA0C,UAAW,CACnEuB,SAAS,EACTyO,MAAO,UAIXpT,KAAKoB,YAAYkI,GAAG,QAAStJ,KAAK8C,SAElC9C,KAAKqB,SAAW,IAAIgS,SAAS,CAC3BC,kBAAmB,uBAGrBxR,SAASC,cAAc,gBAAgBS,iBAAiB,SAAO,WAC7DxC,KAAKyO","file":"home.js","sourcesContent":["/* global render, swal, axios, Dropzone, ClipboardJS, LazyLoad */\n\nconst lsKeys = {\n token: 'token',\n chunkSize: 'chunkSize',\n parallelUploads: 'parallelUploads',\n uploadsHistoryOrder: 'uploadsHistoryOrder',\n previewImages: 'previewImages',\n fileLength: 'fileLength',\n uploadAge: 'uploadAge',\n stripTags: 'stripTags'\n}\n\nconst page = {\n // user token\n token: localStorage[lsKeys.token],\n\n // configs from api/check\n apiChecked: false,\n private: null,\n enableUserAccounts: null,\n maxSize: null,\n chunkSizeConfig: null,\n temporaryUploadAges: null,\n fileIdentifierLength: null,\n stripTagsConfig: null,\n\n // store album id that will be used with upload requests\n album: null,\n\n parallelUploads: null,\n previewImages: null,\n fileLength: null,\n uploadAge: null,\n stripTags: null,\n\n maxSizeBytes: null,\n urlMaxSize: null,\n urlMaxSizeBytes: null,\n chunkSize: null,\n\n tabs: [],\n activeTab: null,\n albumSelect: null,\n albumSelectOnChange: null,\n previewTemplate: null,\n\n dropzone: null,\n clipboardJS: null,\n lazyLoad: null,\n\n // additional vars for url uploads\n urlsQueue: [],\n activeUrlsQueue: 0,\n\n // Include BMP for uploads preview only, cause the real images will be used\n // Sharp isn't capable of making their thumbnails for dashboard and album public pages\n imageExts: ['.webp', '.jpg', '.jpeg', '.bmp', '.gif', '.png', '.tiff', '.tif', '.svg'],\n videoExts: ['.webm', '.mp4', '.wmv', '.avi', '.mov', '.mkv', '.m4v', '.m2ts'],\n\n albumTitleMaxLength: 70,\n albumDescMaxLength: 4000\n}\n\n// Handler for errors during initialization\npage.onInitError = error => {\n // Hide these elements\n document.querySelector('#albumDiv').classList.add('is-hidden')\n document.querySelector('#tabs').classList.add('is-hidden')\n document.querySelectorAll('.tab-content').forEach(element => {\n return element.classList.add('is-hidden')\n })\n\n // Update upload button\n const uploadButton = document.querySelector('#loginToUpload')\n uploadButton.innerText = 'An error occurred. Try to reload?'\n uploadButton.classList.remove('is-loading')\n uploadButton.classList.remove('is-hidden')\n\n uploadButton.addEventListener('click', () => {\n window.location.reload()\n })\n\n if (error.response)\n page.onAxiosError(error)\n else\n page.onError(error)\n}\n\n// Handler for regular JS errors\npage.onError = error => {\n console.error(error)\n\n const content = document.createElement('div')\n content.innerHTML = `${error.toString()}
`\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n}\n\n// Handler for Axios errors\npage.onAxiosError = (error, cont) => {\n if (!cont)\n console.error(error)\n\n // Better Cloudflare errors\n const cloudflareErrors = {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n\n const statusText = cloudflareErrors[error.response.status] || error.response.statusText\n\n if (!cont) {\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'There was an error with the request, please check the console for more information.'\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n } else if (error.response.data && error.response.data.description) {\n return error.response\n } else {\n const description = error.response\n ? `${error.response.status} ${statusText}`\n : error.toString()\n return { data: { success: false, description } }\n }\n}\n\npage.checkClientVersion = apiVersion => {\n const self = document.querySelector('#mainScript')\n const match = self.src.match(/\\?_=(\\d+)$/)\n if (match && match[1] && match[1] !== apiVersion)\n return swal({\n title: 'Updated detected!',\n text: 'Client assets have been updated. Reload to display the latest version?',\n icon: 'info',\n buttons: {\n confirm: {\n text: 'Reload',\n closeModal: false\n }\n }\n }).then(() => {\n window.location.reload()\n })\n}\n\npage.checkIfPublic = () => {\n return axios.get('api/check', {\n onDownloadProgress: () => {\n // Only load render after this request has been initiated to avoid blocking\n if (typeof render !== 'undefined' && !render.done)\n render.do()\n else if (!page.apiChecked)\n page.apiChecked = true\n }\n }).then(response => {\n if (response.data.version)\n page.checkClientVersion(response.data.version)\n\n page.private = response.data.private\n page.enableUserAccounts = response.data.enableUserAccounts\n\n page.maxSize = parseInt(response.data.maxSize)\n page.maxSizeBytes = page.maxSize * 1e6\n page.chunkSizeConfig = {\n max: (response.data.chunkSize && parseInt(response.data.chunkSize.max)) || 95,\n default: response.data.chunkSize && parseInt(response.data.chunkSize.default)\n }\n\n page.temporaryUploadAges = response.data.temporaryUploadAges\n page.fileIdentifierLength = response.data.fileIdentifierLength\n page.stripTagsConfig = response.data.stripTags\n\n return page.preparePage()\n }).catch(page.onInitError)\n}\n\npage.preparePage = () => {\n if (page.private)\n if (page.token) {\n return page.verifyToken(page.token, true)\n } else {\n const button = document.querySelector('#loginToUpload')\n button.href = 'auth'\n button.classList.remove('is-loading')\n if (page.enableUserAccounts)\n button.innerText = 'Anonymous upload is disabled.\\nLog in or register to upload.'\n else\n button.innerText = 'Running in private mode.\\nLog in to upload.'\n }\n else\n return page.prepareUpload()\n}\n\npage.verifyToken = (token, reloadOnError) => {\n return axios.post('api/tokens/verify', { token }).then(response => {\n if (response.data.success === false)\n return swal({\n title: 'An error occurred!',\n text: response.data.description,\n icon: 'error'\n }).then(() => {\n if (!reloadOnError) return\n localStorage.removeItem('token')\n window.location.reload()\n })\n\n localStorage[lsKeys.token] = token\n page.token = token\n return page.prepareUpload()\n }).catch(page.onInitError)\n}\n\npage.prepareUpload = () => {\n // I think this fits best here because we need to check for a valid token before we can get the albums\n if (page.token) {\n // Change /auth link to /dashboard\n const authLink = document.querySelector('#linksColumn a[href=\"auth\"]')\n if (authLink)\n authLink.setAttribute('href', 'dashboard')\n\n // Display the album selection\n document.querySelector('#albumDiv').classList.remove('is-hidden')\n\n page.albumSelect = document.querySelector('#albumSelect')\n page.albumSelectOnChange = () => {\n page.album = parseInt(page.albumSelect.value)\n // Re-generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n }\n page.albumSelect.addEventListener('change', page.albumSelectOnChange)\n\n // Fetch albums\n page.fetchAlbums()\n } else if (page.enableUserAccounts) {\n document.querySelector('#loginLinkText').innerHTML = 'Create an account and keep track of your uploads'\n }\n\n // Prepare & generate config tab\n page.prepareUploadConfig()\n\n // Update elements wherever applicable\n document.querySelector('#maxSize > span').innerHTML = page.getPrettyBytes(page.maxSizeBytes)\n document.querySelector('#loginToUpload').classList.add('is-hidden')\n\n // Prepare & generate files upload tab\n page.prepareDropzone()\n\n // Generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n\n // Prepare urls upload tab\n const urlMaxSize = document.querySelector('#urlMaxSize')\n if (urlMaxSize) {\n page.urlMaxSize = parseInt(urlMaxSize.innerHTML)\n page.urlMaxSizeBytes = page.urlMaxSize * 1e6\n urlMaxSize.innerHTML = page.getPrettyBytes(page.urlMaxSizeBytes)\n document.querySelector('#uploadUrls').addEventListener('click', event => {\n page.addUrlsToQueue()\n })\n }\n\n // Get all tabs\n const tabsContainer = document.querySelector('#tabs')\n const tabs = tabsContainer.querySelectorAll('li')\n for (let i = 0; i < tabs.length; i++) {\n const id = tabs[i].dataset.id\n const tabContent = document.querySelector(`#${id}`)\n if (!tabContent) continue\n\n tabs[i].addEventListener('click', () => {\n page.setActiveTab(i)\n })\n page.tabs.push({ tab: tabs[i], content: tabContent })\n }\n\n // Set first valid tab as the default active tab\n if (page.tabs.length) {\n page.setActiveTab(0)\n tabsContainer.classList.remove('is-hidden')\n }\n}\n\npage.setActiveTab = index => {\n for (let i = 0; i < page.tabs.length; i++)\n if (i === index) {\n page.tabs[i].tab.classList.add('is-active')\n page.tabs[i].content.classList.remove('is-hidden')\n page.activeTab = index\n } else {\n page.tabs[i].tab.classList.remove('is-active')\n page.tabs[i].content.classList.add('is-hidden')\n }\n}\n\npage.fetchAlbums = () => {\n return axios.get('api/albums', { headers: { token: page.token } }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n // Create an option for each album\n if (Array.isArray(response.data.albums) && response.data.albums.length)\n for (let i = 0; i < response.data.albums.length; i++) {\n const album = response.data.albums[i]\n const option = document.createElement('option')\n option.value = album.id\n option.innerHTML = album.name\n page.albumSelect.appendChild(option)\n }\n }).catch(page.onInitError)\n}\n\npage.prepareDropzone = () => {\n // Parse template element\n const previewNode = document.querySelector('#tpl')\n page.previewTemplate = previewNode.innerHTML\n previewNode.parentNode.removeChild(previewNode)\n\n // Generate files upload tab\n const tabDiv = document.querySelector('#tab-files')\n const div = document.createElement('div')\n div.className = 'control is-expanded'\n div.innerHTML = `\n
Max length is ${page.albumTitleMaxLength} characters.
\nMax length is ${page.albumDescMaxLength} characters.
\n${help}
` : ''}\n `\n field.querySelector('div.control').appendChild(control)\n\n form.appendChild(field)\n }\n\n const submit = document.createElement('div')\n submit.className = 'field'\n submit.innerHTML = `\n\n \n
\n\n This configuration will only be used in this browser.
\n After reloading the page, some of them will also be applied to the ShareX config that you can download by clicking on the ShareX icon below.\n