From 91afe634dd9e80d5248728b5b6213e74f6d6f60d Mon Sep 17 00:00:00 2001 From: Roberto Tonino Date: Thu, 7 May 2020 22:10:13 +0200 Subject: [PATCH] installed the following dependencies (and removed them from vendor folder): lodash, jquery, toastify-js; update COMPILE-UI.md with shorthand for npm install and "Other" section --- COMPILE-UI.md | 12 +- package-lock.json | 15 + package.json | 5 + public/index.html | 3 - public/js/bundle.js | 1885 +------------------- public/js/bundle.js.map | 2 +- public/js/vendor/jquery-3.3.1.min.js | 2 - public/js/vendor/lodash.min.js | 137 -- public/js/vendor/toastify.js | 351 ---- src/js/app.js | 1 + src/js/modules/components/artist-tab.js | 2 + src/js/modules/components/tracklist-tab.js | 11 +- src/js/modules/downloads.js | 1 + src/js/modules/toasts.js | 3 + src/js/modules/track-preview.js | 2 + 15 files changed, 81 insertions(+), 2351 deletions(-) delete mode 100644 public/js/vendor/jquery-3.3.1.min.js delete mode 100644 public/js/vendor/lodash.min.js delete mode 100644 public/js/vendor/toastify.js diff --git a/COMPILE-UI.md b/COMPILE-UI.md index 7ad6c95..e06bbbf 100644 --- a/COMPILE-UI.md +++ b/COMPILE-UI.md @@ -19,7 +19,7 @@ If you will see the corresponding versions of node and npm, you are ready to cod 3. Go to the root of this project, open your favorite prompt and run ```console -$ npm install +$ npm i ``` # Scripts @@ -50,4 +50,12 @@ If you want to deploy your application, you have to run $ npm run build ``` -This is necessary to get a bundled `.js` file **minified**, helping ro drop your final application size. \ No newline at end of file +This is necessary to get a bundled `.js` file **minified**, helping ro drop your final application size. + +# Other + +If you notice that another member of the team installed one or more new packages, just run + +```bash +$ npm i +``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6bddce1..d85ae3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -403,6 +403,11 @@ } } }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -427,6 +432,11 @@ "strip-bom": "^3.0.0" } }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -806,6 +816,11 @@ "source-map-support": "~0.5.12" } }, + "toastify-js": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/toastify-js/-/toastify-js-1.7.0.tgz", + "integrity": "sha512-GmPy4zJ/ulCfmCHlfCtgcB+K2xhx2AXW3T/ZZOSjyjaIGevhz+uvR8HSCTay/wBq4tt2mUnBqlObP1sSWGlsnQ==" + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/package.json b/package.json index 683fa2b..de1be54 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,10 @@ "serve": "python server.py", "dev": "npm-run-all --parallel watch:js serve", "build": "npm-run-all build:js" + }, + "dependencies": { + "jquery": "^3.5.1", + "lodash": "^4.17.15", + "toastify-js": "^1.7.0" } } diff --git a/public/index.html b/public/index.html index 38eb702..a4f07d6 100644 --- a/public/index.html +++ b/public/index.html @@ -1095,10 +1095,7 @@

{{ metadata }} - - - diff --git a/public/js/bundle.js b/public/js/bundle.js index 0fadc83..70d4031 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -1,1854 +1,35 @@ -const socket = io.connect(window.location.href); - -socket.on('connect', () => { - document.getElementById('loading_overlay').classList.remove('active'); -}); - -let toastsWithId = {}; - -const toast = function (msg, icon = null, dismiss = true, id = null) { - if (toastsWithId[id]) { - let toastObj = toastsWithId[id]; - let toastDOM = $(`div.toastify[toast_id=${id}]`); - if (msg) { - toastDOM.find('.toast-message').html(msg); - } - if (icon) { - if (icon == 'loading') icon = `
`; - else icon = `${icon}`; - toastDOM.find('.toast-icon').html(icon); - } - if (dismiss !== null && dismiss) { - setTimeout(function () { - toastObj.hideToast(); - delete toastsWithId[id]; - }, 3000); - } - } else { - if (icon == null) icon = ''; - else if (icon == 'loading') icon = `
`; - else icon = `${icon}`; - let toastObj = Toastify({ - text: `${icon}${msg}`, - duration: dismiss ? 3000 : 0, - gravity: 'bottom', - position: 'left' - }).showToast(); - if (id) { - toastsWithId[id] = toastObj; - $(toastObj.toastElement).attr('toast_id', id); - } - } -}; - -socket.on('toast', data => { - toast(data.msg, data.icon || null, data.dismiss !== undefined ? data.dismiss : true, data.id || null); -}); - -/* ===== Locals ===== */ -const tabMinWidth = 250; -const tabMaxWidth = 500; - -let cachedTabWidth = parseInt(localStorage.getItem('downloadTabWidth')) || 300; -let queueList = {}; -let queue = []; -let queueComplete = []; -let tabContainerEl; -let listEl; -let dragHandlerEl; - -function init() { - // Find download DOM elements - tabContainerEl = document.getElementById('download_tab_container'); - listEl = document.getElementById('download_list'); - dragHandlerEl = document.getElementById('download_tab_drag_handler'); - - // Check if download tab should be open - if ('true' === localStorage.getItem('downloadTabOpen')) { - tabContainerEl.classList.remove('tab_hidden'); - - setTabWidth(cachedTabWidth); - } - - linkListeners(); -} - -function linkListeners() { - listEl.addEventListener('click', handleListClick); - document.getElementById('toggle_download_tab').addEventListener('click', toggleDownloadTab); - - // Queue buttons - document.getElementById('clean_queue').addEventListener('click', () => { - socket.emit('removeFinishedDownloads'); - }); - - document.getElementById('cancel_queue').addEventListener('click', () => { - socket.emit('cancelAllDownloads'); - }); - - dragHandlerEl.addEventListener('mousedown', event => { - event.preventDefault(); - - document.addEventListener('mousemove', handleDrag); - }); - - document.addEventListener('mouseup', () => { - document.removeEventListener('mousemove', handleDrag); - }); - - tabContainerEl.addEventListener('transitionend', () => { - tabContainerEl.style.transition = ''; - }); - - window.addEventListener('beforeunload', () => { - localStorage.setItem('downloadTabWidth', cachedTabWidth); - }); -} - -function setTabWidth(newWidth) { - if (undefined === newWidth) { - tabContainerEl.style.width = ''; - listEl.style.width = ''; - } else { - tabContainerEl.style.width = newWidth + 'px'; - listEl.style.width = newWidth + 'px'; - } -} - -function handleDrag(event) { - let newWidth = window.innerWidth - event.pageX + 2; - - if (newWidth < tabMinWidth) { - newWidth = tabMinWidth; - } else if (newWidth > tabMaxWidth) { - newWidth = tabMaxWidth; - } - - cachedTabWidth = newWidth; - - setTabWidth(newWidth); -} - -function sendAddToQueue(url, bitrate = null) { - if (url.indexOf(';') !== -1) { - let urls = url.split(';'); - urls.forEach(url => { - socket.emit('addToQueue', { url: url, bitrate: bitrate }); - }); - } else if (url != '') { - socket.emit('addToQueue', { url: url, bitrate: bitrate }); - } -} - -function addToQueue(queueItem, current = false) { - queueList[queueItem.uuid] = queueItem; - if (queueItem.downloaded + queueItem.failed == queueItem.size) { - queueComplete.push(queueItem.uuid); - } else { - queue.push(queueItem.uuid); - } - $(listEl).append( - `
-
- Cover ${queueItem.title} -
- ${queueItem.title} - - ${queueItem.artist} -
-
- ${queueItem.downloaded + queueItem.failed}/${ - queueItem.size - } -
-
-
-
- remove -
-
` - ); - if (queueItem.progress > 0 || current) { - $('#bar_' + queueItem.uuid) - .removeClass('indeterminate') - .addClass('determinate'); - } - $('#bar_' + queueItem.uuid).css('width', queueItem.progress + '%'); - if (queueItem.failed >= 1) { - $('#download_' + queueItem.uuid + ' .download_info_status').append( - `(${queueItem.failed}error_outline)` - ); - } - if (queueItem.downloaded + queueItem.failed == queueItem.size) { - let result_icon = $('#download_' + queueItem.uuid).find('.queue_icon'); - if (queueItem.failed == 0) { - result_icon.text('done'); - } else if (queueItem.failed == queueItem.size) { - result_icon.text('error'); - } else { - result_icon.text('warning'); - } - } -} - -function initQueue(data) { - if (data.queueComplete.length) { - data.queueComplete.forEach(item => { - addToQueue(data.queueList[item]); - }); - } - if (data.currentItem) { - addToQueue(data['queueList'][data.currentItem], true); - } - data.queue.forEach(item => { - addToQueue(data.queueList[item]); - }); -} - -function startDownload(uuid) { - $('#bar_' + uuid) - .removeClass('indeterminate') - .addClass('determinate'); -} - -socket.on('startDownload', startDownload); - -function handleListClick(event) { - if (!event.target.matches('.queue_icon[data-uuid]')) { - return - } - - let icon = event.target.innerText; - let uuid = $(event.target).data('uuid'); - - switch (icon) { - case 'remove': - socket.emit('removeFromQueue', uuid); - break - } -} - -// Show/Hide Download Tab -function toggleDownloadTab(ev) { - ev.preventDefault(); - - setTabWidth(); - - tabContainerEl.style.transition = 'all 250ms ease-in-out'; - - // Toggle returns a Boolean based on the action it performed - let isHidden = tabContainerEl.classList.toggle('tab_hidden'); - - if (!isHidden) { - setTabWidth(cachedTabWidth); - } - - localStorage.setItem('downloadTabOpen', !isHidden); -} - -socket.on('init_downloadQueue', initQueue); -socket.on('addedToQueue', addToQueue); - -function removeFromQueue(uuid) { - let index = queue.indexOf(uuid); - if (index > -1) { - queue.splice(index, 1); - $(`#download_${queueList[uuid].uuid}`).remove(); - delete queueList[uuid]; - } -} - -socket.on('removedFromQueue', removeFromQueue); - -function finishDownload(uuid) { - if (queue.indexOf(uuid) > -1) { - toast(`${queueList[uuid].title} finished downloading.`, 'done'); - $('#bar_' + uuid).css('width', '100%'); - let result_icon = $('#download_' + uuid).find('.queue_icon'); - if (queueList[uuid].failed == 0) { - result_icon.text('done'); - } else if (queueList[uuid].failed >= queueList[uuid].size) { - result_icon.text('error'); - } else { - result_icon.text('warning'); - } - let index = queue.indexOf(uuid); - if (index > -1) { - queue.splice(index, 1); - queueComplete.push(uuid); - } - if (queue.length <= 0) { - toast('All downloads completed!', 'done_all'); - } - } -} - -socket.on('finishDownload', finishDownload); - -function removeAllDownloads(currentItem) { - queueComplete = []; - if (currentItem == '') { - queue = []; - queueList = {}; - $(listEl).html(''); - } else { - queue = [currentItem]; - let tempQueueItem = queueList[currentItem]; - queueList = {}; - queueList[currentItem] = tempQueueItem; - $('.download_object').each(function (index) { - if ($(this).attr('id') != 'download_' + currentItem) $(this).remove(); - }); - } -} - -socket.on('removedAllDownloads', removeAllDownloads); - -function removedFinishedDownloads() { - queueComplete.forEach(item => { - $('#download_' + item).remove(); - }); - queueComplete = []; -} - -socket.on('removedFinishedDownloads', removedFinishedDownloads); - -function updateQueue(update) { - if (update.uuid && queue.indexOf(update.uuid) > -1) { - if (update.downloaded) { - queueList[update.uuid].downloaded++; - $('#download_' + update.uuid + ' .queue_downloaded').text( - queueList[update.uuid].downloaded + queueList[update.uuid].failed - ); - } - if (update.failed) { - queueList[update.uuid].failed++; - $('#download_' + update.uuid + ' .queue_downloaded').text( - queueList[update.uuid].downloaded + queueList[update.uuid].failed - ); - if (queueList[update.uuid].failed == 1) { - $('#download_' + update.uuid + ' .download_info_status').append( - `(1 error_outline)` - ); - } else { - $('#download_' + update.uuid + ' .queue_failed').text(queueList[update.uuid].failed); - } - } - if (update.progress) { - queueList[update.uuid].progress = update.progress; - $('#bar_' + update.uuid).css('width', update.progress + '%'); - } - } -} - -socket.on('updateQueue', updateQueue); - -var Downloads = { - init, - sendAddToQueue, - addToQueue -}; - -const QualityModal = { - // Defaults - open: false, - url: '' -}; - -function init$1() { - QualityModal.element = document.getElementById('modal_quality'); - - linkListeners$1(); -} - -function open(link) { - QualityModal.url = link; - QualityModal.element.style.display = 'block'; - QualityModal.element.classList.add('animated', 'fadeIn'); -} - -function linkListeners$1() { - QualityModal.element.addEventListener('click', handleClick); - QualityModal.element.addEventListener('webkitAnimationEnd', handleAnimationEnd); -} - -function handleClick(event) { - QualityModal.element.classList.add('animated', 'fadeOut'); - - if (!event.target.matches('.quality-button')) { - return - } - - let bitrate = event.target.dataset.qualityValue; - - Downloads.sendAddToQueue(QualityModal.url, bitrate); -} - -function handleAnimationEnd() { - QualityModal.element.classList.remove('animated', QualityModal.open ? 'fadeOut' : 'fadeIn'); - QualityModal.element.style.display = QualityModal.open ? 'none' : 'block'; - QualityModal.open = !QualityModal.open; -} - -var QualityModal$1 = { - init: init$1, - open -}; - -const ArtistTab = new Vue({ - data() { - return { - currentTab: '', - sortKey: 'release_date', - sortOrder: 'desc', - title: '', - image: '', - type: '', - link: '', - head: null, - body: null - } - }, - methods: { - albumView, - reset() { - this.title = 'Loading...'; - this.image = ''; - this.type = ''; - this.currentTab = ''; - this.sortKey = 'release_date'; - this.sortOrder = 'desc'; - this.link = ''; - this.head = []; - this.body = null; - }, - addToQueue(e) { - e.stopPropagation(); - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal(e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - sortBy(key) { - if (key == this.sortKey) { - this.sortOrder = this.sortOrder == 'asc' ? 'desc' : 'asc'; - } else { - this.sortKey = key; - this.sortOrder = 'asc'; - } - }, - changeTab(tab) { - this.currentTab = tab; - }, - checkNewRelease(date) { - let g1 = new Date(); - let g2 = new Date(date); - g2.setDate(g2.getDate() + 3); - g1.setHours(0, 0, 0, 0); - - return g1.getTime() <= g2.getTime() - }, - showArtist(data) { - this.title = data.name; - this.image = data.picture_xl; - this.type = 'Artist'; - this.link = `https://www.deezer.com/artist/${data.id}`; - this.currentTab = Object.keys(data.releases)[0]; - this.sortKey = 'release_date'; - this.sortOrder = 'desc'; - this.head = [ - { title: 'Title', sortKey: 'title' }, - { title: 'Release Date', sortKey: 'release_date' }, - { title: '', width: '32px' } - ]; - if (_.isEmpty(data.releases)) { - this.body = null; - } else { - this.body = data.releases; - } - } - }, - computed: { - showTable() { - if (this.body) return _.orderBy(this.body[this.currentTab], this.sortKey, this.sortOrder) - else return [] - } - }, - mounted() { - socket.on('show_artist', this.showArtist); - } -}).$mount('#artist_tab'); - -/* ===== Globals ====== */ -window.preview_max_volume = 1; - -/* ===== Locals ===== */ -let preview_track = document.getElementById('preview-track'); -let preview_stopped = true; - -// init stuff -function init$2() { - preview_track.volume = 1; - /*preview_max_volume = parseFloat(localStorage.getItem("previewVolume")) - if (preview_max_volume === null){ - preview_max_volume = 0.8 - localStorage.setItem("previewVolume", preview_max_volume) - }*/ - - // start playing when track loaded - preview_track.addEventListener('canplay', function () { - preview_track.play(); - preview_stopped = false; - $(preview_track).animate({ volume: preview_max_volume }, 500); - }); - - // auto fadeout when at the end of the song - preview_track.addEventListener('timeupdate', function () { - if (preview_track.currentTime > preview_track.duration - 1) { - $(preview_track).animate({ volume: 0 }, 800); - preview_stopped = true; - $('a[playing] > .preview_controls').css({ opacity: 0 }); - $('*').removeAttr('playing'); - $('.preview_controls').text('play_arrow'); - $('.preview_playlist_controls').text('play_arrow'); - } - }); -} - -// on modal closing -function stopStackedTabsPreview() { - if ( - $('.preview_playlist_controls').filter(function () { - return $(this).attr('playing') - }).length > 0 - ) { - $(preview_track).animate({ volume: 0 }, 800); - preview_stopped = true; - $('.preview_playlist_controls').removeAttr('playing'); - $('.preview_playlist_controls').text('play_arrow'); - } -} - -// on hover event -function previewMouseEnter(e) { - $(e.currentTarget).css({ opacity: 1 }); -} - -function previewMouseLeave(e) { - let obj = e.currentTarget; - if (($(obj).parent().attr('playing') && preview_stopped) || !$(obj).parent().attr('playing')) { - $(obj).css({ opacity: 0 }, 200); - } -} - -// on click event -function playPausePreview(e) { - e.preventDefault(); - let obj = e.currentTarget; - var icon = obj.tagName == 'I' ? $(obj) : $(obj).children('i'); - if ($(obj).attr('playing')) { - if (preview_track.paused) { - preview_track.play(); - preview_stopped = false; - icon.text('pause'); - $(preview_track).animate({ volume: preview_max_volume }, 500); - } else { - preview_stopped = true; - icon.text('play_arrow'); - $(preview_track).animate({ volume: 0 }, 250, 'swing', () => { - preview_track.pause(); - }); - } - } else { - $('*').removeAttr('playing'); - $(obj).attr('playing', true); - $('.preview_controls').text('play_arrow'); - $('.preview_playlist_controls').text('play_arrow'); - $('.preview_controls').css({ opacity: 0 }); - icon.text('pause'); - icon.css({ opacity: 1 }); - preview_stopped = false; - $(preview_track).animate({ volume: 0 }, 250, 'swing', () => { - preview_track.pause(); - $('#preview-track_source').prop('src', $(obj).data('preview')); - preview_track.load(); - }); - } -} - -var TrackPreview = { - init: init$2, - stopStackedTabsPreview, - previewMouseEnter, - previewMouseLeave, - playPausePreview -}; - -const TracklistTab = new Vue({ - data: () => ({ - title: '', - metadata: '', - release_date: '', - label: '', - explicit: false, - image: '', - type: '', - link: '', - head: null, - body: [] - }), - methods: { - artistView, - albumView, - playPausePreview: TrackPreview.playPausePreview, - reset() { - this.title = 'Loading...'; - this.image = ''; - this.metadata = ''; - this.label = ''; - this.release_date = ''; - this.explicit = false; - this.type = ''; - this.head = []; - this.body = []; - }, - addToQueue(e) { - e.stopPropagation(); - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal(e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - toggleAll(e) { - this.body.forEach(item => { - if (item.type == 'track') { - item.selected = e.currentTarget.checked; - } - }); - }, - selectedLinks() { - var selected = []; - if (this.body) { - this.body.forEach(item => { - if (item.type == 'track' && item.selected) selected.push(this.type == "Spotify Playlist" ? item.uri : item.link); - }); - } - return selected.join(';') - }, - convertDuration(duration) { - //convert from seconds only to mm:ss format - let mm, ss; - mm = Math.floor(duration / 60); - ss = duration - mm * 60; - //add leading zero if ss < 0 - if (ss < 10) { - ss = '0' + ss; - } - return mm + ':' + ss - }, - showAlbum(data) { - this.type = 'Album'; - this.link = `https://www.deezer.com/album/${data.id}`; - this.title = data.title; - this.explicit = data.explicit_lyrics; - this.label = data.label; - this.metadata = `${data.artist.name} • ${data.tracks.length} songs`; - this.release_date = data.release_date.substring(0, 10); - this.image = data.cover_xl; - this.head = [ - { title: 'music_note', width: '24px' }, - { title: '#' }, - { title: 'Song' }, - { title: 'Artist' }, - { title: 'timer', width: '40px' } - ]; - if (_.isEmpty(data.tracks)) { - console.log('show e lodash ok'); - - this.body = null; - } else { - this.body = data.tracks; - } - }, - showPlaylist(data) { - this.type = 'Playlist'; - this.link = `https://www.deezer.com/playlist/${data.id}`; - this.title = data.title; - this.image = data.picture_xl; - this.release_date = data.creation_date.substring(0, 10); - this.metadata = `by ${data.creator.name} • ${data.tracks.length} songs`; - this.head = [ - { title: 'music_note', width: '24px' }, - { title: '#' }, - { title: 'Song' }, - { title: 'Artist' }, - { title: 'Album' }, - { title: 'timer', width: '40px' } - ]; - if (_.isEmpty(data.tracks)) { - this.body = null; - } else { - this.body = data.tracks; - } - }, - showSpotifyPlaylist(data) { - this.type = 'Spotify Playlist'; - this.link = data.uri; - this.title = data.name; - this.image = data.images.length ? data.images[0].url : "https://e-cdns-images.dzcdn.net/images/cover/d41d8cd98f00b204e9800998ecf8427e/1000x1000-000000-80-0-0.jpg"; - this.release_date = ""; - this.metadata = `by ${data.owner.display_name} • ${data.tracks.length} songs`; - this.head = [ - { title: 'music_note', width: '24px' }, - { title: '#' }, - { title: 'Song' }, - { title: 'Artist' }, - { title: 'Album' }, - { title: 'timer', width: '40px' } - ]; - if (_.isEmpty(data.tracks)) { - this.body = null; - } else { - this.body = data.tracks; - } - } - }, - mounted() { - socket.on('show_album', this.showAlbum); - socket.on('show_playlist', this.showPlaylist); - socket.on('show_spotifyplaylist', this.showSpotifyPlaylist); - } -}).$mount('#tracklist_tab'); - -function isValidURL(text) { - let lowerCaseText = text.toLowerCase(); - - if (lowerCaseText.startsWith('http')) { - if (lowerCaseText.indexOf('deezer.com') >= 0 || lowerCaseText.indexOf('open.spotify.com') >= 0) { - return true - } - } else if (lowerCaseText.startsWith('spotify:')) { - return true - } - return false -} - -function convertDuration(duration) { - // convert from seconds only to mm:ss format - let mm, ss; - mm = Math.floor(duration / 60); - ss = duration - mm * 60; - //add leading zero if ss < 0 - if (ss < 10) { - ss = '0' + ss; - } - return mm + ':' + ss -} - -function convertDurationSeparated(duration) { - let hh, mm, ss; - mm = Math.floor(duration / 60); - hh = Math.floor(mm / 60); - ss = duration - mm * 60; - mm -= hh * 60; - return [hh, mm, ss] -} - -function numberWithDots(x) { - return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.') -} - -// On scroll event, returns currentTarget = null -// Probably on other events too -function debounce(func, wait, immediate) { - var timeout; - return function () { - var context = this; - var args = arguments; - var later = function () { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - } -} - -const COUNTRIES = { - AF: 'Afghanistan', - AX: '\u00c5land Islands', - AL: 'Albania', - DZ: 'Algeria', - AS: 'American Samoa', - AD: 'Andorra', - AO: 'Angola', - AI: 'Anguilla', - AQ: 'Antarctica', - AG: 'Antigua and Barbuda', - AR: 'Argentina', - AM: 'Armenia', - AW: 'Aruba', - AU: 'Australia', - AT: 'Austria', - AZ: 'Azerbaijan', - BS: 'Bahamas', - BH: 'Bahrain', - BD: 'Bangladesh', - BB: 'Barbados', - BY: 'Belarus', - BE: 'Belgium', - BZ: 'Belize', - BJ: 'Benin', - BM: 'Bermuda', - BT: 'Bhutan', - BO: 'Bolivia, Plurinational State of', - BQ: 'Bonaire, Sint Eustatius and Saba', - BA: 'Bosnia and Herzegovina', - BW: 'Botswana', - BV: 'Bouvet Island', - BR: 'Brazil', - IO: 'British Indian Ocean Territory', - BN: 'Brunei Darussalam', - BG: 'Bulgaria', - BF: 'Burkina Faso', - BI: 'Burundi', - KH: 'Cambodia', - CM: 'Cameroon', - CA: 'Canada', - CV: 'Cape Verde', - KY: 'Cayman Islands', - CF: 'Central African Republic', - TD: 'Chad', - CL: 'Chile', - CN: 'China', - CX: 'Christmas Island', - CC: 'Cocos (Keeling) Islands', - CO: 'Colombia', - KM: 'Comoros', - CG: 'Congo', - CD: 'Congo, the Democratic Republic of the', - CK: 'Cook Islands', - CR: 'Costa Rica', - CI: "C\u00f4te d'Ivoire", - HR: 'Croatia', - CU: 'Cuba', - CW: 'Cura\u00e7ao', - CY: 'Cyprus', - CZ: 'Czech Republic', - DK: 'Denmark', - DJ: 'Djibouti', - DM: 'Dominica', - DO: 'Dominican Republic', - EC: 'Ecuador', - EG: 'Egypt', - SV: 'El Salvador', - GQ: 'Equatorial Guinea', - ER: 'Eritrea', - EE: 'Estonia', - ET: 'Ethiopia', - FK: 'Falkland Islands (Malvinas)', - FO: 'Faroe Islands', - FJ: 'Fiji', - FI: 'Finland', - FR: 'France', - GF: 'French Guiana', - PF: 'French Polynesia', - TF: 'French Southern Territories', - GA: 'Gabon', - GM: 'Gambia', - GE: 'Georgia', - DE: 'Germany', - GH: 'Ghana', - GI: 'Gibraltar', - GR: 'Greece', - GL: 'Greenland', - GD: 'Grenada', - GP: 'Guadeloupe', - GU: 'Guam', - GT: 'Guatemala', - GG: 'Guernsey', - GN: 'Guinea', - GW: 'Guinea-Bissau', - GY: 'Guyana', - HT: 'Haiti', - HM: 'Heard Island and McDonald Islands', - VA: 'Holy See (Vatican City State)', - HN: 'Honduras', - HK: 'Hong Kong', - HU: 'Hungary', - IS: 'Iceland', - IN: 'India', - ID: 'Indonesia', - IR: 'Iran, Islamic Republic of', - IQ: 'Iraq', - IE: 'Ireland', - IM: 'Isle of Man', - IL: 'Israel', - IT: 'Italy', - JM: 'Jamaica', - JP: 'Japan', - JE: 'Jersey', - JO: 'Jordan', - KZ: 'Kazakhstan', - KE: 'Kenya', - KI: 'Kiribati', - KP: "Korea, Democratic People's Republic of", - KR: 'Korea, Republic of', - KW: 'Kuwait', - KG: 'Kyrgyzstan', - LA: "Lao People's Democratic Republic", - LV: 'Latvia', - LB: 'Lebanon', - LS: 'Lesotho', - LR: 'Liberia', - LY: 'Libya', - LI: 'Liechtenstein', - LT: 'Lithuania', - LU: 'Luxembourg', - MO: 'Macao', - MK: 'Macedonia, the Former Yugoslav Republic of', - MG: 'Madagascar', - MW: 'Malawi', - MY: 'Malaysia', - MV: 'Maldives', - ML: 'Mali', - MT: 'Malta', - MH: 'Marshall Islands', - MQ: 'Martinique', - MR: 'Mauritania', - MU: 'Mauritius', - YT: 'Mayotte', - MX: 'Mexico', - FM: 'Micronesia, Federated States of', - MD: 'Moldova, Republic of', - MC: 'Monaco', - MN: 'Mongolia', - ME: 'Montenegro', - MS: 'Montserrat', - MA: 'Morocco', - MZ: 'Mozambique', - MM: 'Myanmar', - NA: 'Namibia', - NR: 'Nauru', - NP: 'Nepal', - NL: 'Netherlands', - NC: 'New Caledonia', - NZ: 'New Zealand', - NI: 'Nicaragua', - NE: 'Niger', - NG: 'Nigeria', - NU: 'Niue', - NF: 'Norfolk Island', - MP: 'Northern Mariana Islands', - NO: 'Norway', - OM: 'Oman', - PK: 'Pakistan', - PW: 'Palau', - PS: 'Palestine, State of', - PA: 'Panama', - PG: 'Papua New Guinea', - PY: 'Paraguay', - PE: 'Peru', - PH: 'Philippines', - PN: 'Pitcairn', - PL: 'Poland', - PT: 'Portugal', - PR: 'Puerto Rico', - QA: 'Qatar', - RE: 'R\u00e9union', - RO: 'Romania', - RU: 'Russian Federation', - RW: 'Rwanda', - BL: 'Saint Barth\u00e9lemy', - SH: 'Saint Helena, Ascension and Tristan da Cunha', - KN: 'Saint Kitts and Nevis', - LC: 'Saint Lucia', - MF: 'Saint Martin (French part)', - PM: 'Saint Pierre and Miquelon', - VC: 'Saint Vincent and the Grenadines', - WS: 'Samoa', - SM: 'San Marino', - ST: 'Sao Tome and Principe', - SA: 'Saudi Arabia', - SN: 'Senegal', - RS: 'Serbia', - SC: 'Seychelles', - SL: 'Sierra Leone', - SG: 'Singapore', - SX: 'Sint Maarten (Dutch part)', - SK: 'Slovakia', - SI: 'Slovenia', - SB: 'Solomon Islands', - SO: 'Somalia', - ZA: 'South Africa', - GS: 'South Georgia and the South Sandwich Islands', - SS: 'South Sudan', - ES: 'Spain', - LK: 'Sri Lanka', - SD: 'Sudan', - SR: 'Suriname', - SJ: 'Svalbard and Jan Mayen', - SZ: 'Swaziland', - SE: 'Sweden', - CH: 'Switzerland', - SY: 'Syrian Arab Republic', - TW: 'Taiwan, Province of China', - TJ: 'Tajikistan', - TZ: 'Tanzania, United Republic of', - TH: 'Thailand', - TL: 'Timor-Leste', - TG: 'Togo', - TK: 'Tokelau', - TO: 'Tonga', - TT: 'Trinidad and Tobago', - TN: 'Tunisia', - TR: 'Turkey', - TM: 'Turkmenistan', - TC: 'Turks and Caicos Islands', - TV: 'Tuvalu', - UG: 'Uganda', - UA: 'Ukraine', - AE: 'United Arab Emirates', - GB: 'United Kingdom', - US: 'United States', - UM: 'United States Minor Outlying Islands', - UY: 'Uruguay', - UZ: 'Uzbekistan', - VU: 'Vanuatu', - VE: 'Venezuela, Bolivarian Republic of', - VN: 'Viet Nam', - VG: 'Virgin Islands, British', - VI: 'Virgin Islands, U.S.', - WF: 'Wallis and Futuna', - EH: 'Western Sahara', - YE: 'Yemen', - ZM: 'Zambia', - ZW: 'Zimbabwe' -}; - -var Utils = { - isValidURL, - convertDuration, - convertDurationSeparated, - numberWithDots, - debounce, - COUNTRIES -}; - -const LinkAnalyzerTab = new Vue({ - data() { - return { - title: '', - subtitle: '', - image: '', - data: {}, - type: '', - link: '', - countries: [] - } - }, - methods: { - albumView, - convertDuration: Utils.convertDuration, - reset() { - this.title = 'Loading...'; - this.subtitle = ''; - this.image = ''; - this.data = {}; - this.type = ''; - this.link = ''; - this.countries = []; - }, - showTrack(data) { - this.title = - data.title + - (data.title_version && data.title.indexOf(data.title_version) == -1 ? ' ' + data.title_version : ''); - this.subtitle = `by ${data.artist.name}\nin ${data.album.title}`; - this.image = data.album.cover_xl; - this.type = 'track'; - this.link = data.link; - data.available_countries.forEach(cc => { - let temp = []; - let chars = [...cc].map(c => c.charCodeAt() + 127397); - temp.push(String.fromCodePoint(...chars)); - temp.push(Utils.COUNTRIES[cc]); - this.countries.push(temp); - }); - this.data = data; - }, - showAlbum(data) { - console.log(data); - this.title = data.title; - this.subtitle = `by ${data.artist.name}\n${data.nb_tracks} tracks`; - this.image = data.cover_xl; - this.type = 'album'; - this.link = data.link; - this.data = data; - } - }, - mounted() { - socket.on('analyze_track', this.showTrack); - socket.on('analyze_album', this.showAlbum); - } -}).$mount('#analyzer_tab'); - -const HomeTab = new Vue({ - data() { - return { - tracks: [], - albums: [], - artists: [], - playlists: [] - } - }, - methods: { - artistView, - albumView, - playlistView, - playPausePreview: TrackPreview.playPausePreview, - previewMouseEnter: TrackPreview.previewMouseEnter, - previewMouseLeave: TrackPreview.previewMouseLeave, - numberWithDots: Utils.numberWithDots, - convertDuration: Utils.convertDuration, - addToQueue(e) { - e.stopPropagation(); - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal(e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - initHome(data) { - this.tracks = data.tracks.data; - this.albums = data.albums.data; - this.artists = data.artists.data; - this.playlists = data.playlists.data; - } - }, - mounted() { - socket.on('init_home', this.initHome); - } -}).$mount('#home_tab'); - -const ChartsTab = new Vue({ - data() { - return { - country: '', - id: 0, - countries: [], - chart: [] - } - }, - methods: { - artistView, - albumView, - playPausePreview: TrackPreview.playPausePreview, - previewMouseEnter: TrackPreview.previewMouseEnter, - previewMouseLeave: TrackPreview.previewMouseLeave, - convertDuration: Utils.convertDuration, - addToQueue(e) { - e.stopPropagation(); - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal(e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - getTrackList(e){ - this.country = e.currentTarget.dataset.title; - localStorage.setItem('chart', this.country); - this.id = e.currentTarget.dataset.id; - socket.emit('getChartTracks', this.id); - }, - setTracklist(data){ - this.chart = data; - }, - changeCountry(){ - this.country = ''; - this.id = 0; - }, - initCharts(data) { - this.countries = data; - this.country = localStorage.getItem('chart') || ''; - if (this.country){ - let i = 0; - for (i; i < this.countries.length; i++) if (this.countries[i].title == this.country) break - if (i != this.countries.length){ - this.id = this.countries[i].id; - socket.emit('getChartTracks', this.id); - }else { - this.country = ''; - localStorage.setItem('chart', this.country); - } - } - } - }, - mounted() { - socket.on('init_charts', this.initCharts); - socket.on('setChartTracks', this.setTracklist); - } -}).$mount('#charts_tab'); - -const FavoritesTab = new Vue({ - data() { - return { - tracks: [], - albums: [], - artists: [], - playlists: [], - spotifyPlaylists: [] - } - }, - methods: { - playlistView, - artistView, - albumView, - spotifyPlaylistView, - playPausePreview: TrackPreview.playPausePreview, - previewMouseEnter: TrackPreview.previewMouseEnter, - previewMouseLeave: TrackPreview.previewMouseLeave, - convertDuration: Utils.convertDuration, - addToQueue(e) { - e.stopPropagation(); - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal(e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - updated_userSpotifyPlaylists(data){this.spotifyPlaylists = data;}, - updated_userPlaylists(data){this.playlists = data;}, - updated_userAlbums(data){this.albums = data;}, - updated_userArtist(data){this.artists = data;}, - updated_userTracks(data){this.tracks = data;}, - initFavorites(data) { - this.tracks = data.tracks; - this.albums = data.albums; - this.artists = data.artists; - this.playlists = data.playlists; - document.getElementById('favorites_playlist_tab').click(); - } - }, - mounted() { - socket.on('init_favorites', this.initFavorites); - socket.on('updated_userSpotifyPlaylists', this.updated_userSpotifyPlaylists); - socket.on('updated_userPlaylists', this.updated_userPlaylists); - socket.on('updated_userAlbums', this.updated_userAlbums); - socket.on('updated_userArtist', this.updated_userArtist); - socket.on('updated_userTracks', this.updated_userTracks); - } -}).$mount('#favorites_tab'); - -const SettingsTab = new Vue({ - data: () => ({ - settings: { tags: {} }, - lastSettings: {}, - spotifyFeatures: {}, - lastCredentials: {}, - defaultSettings: {}, - lastUser: '', - spotifyUser: '', - darkMode: false, - slimDownloads: false - }), - computed: { - changeDarkMode: { - get() { - return this.darkMode - }, - set(wantDarkMode) { - this.darkMode = wantDarkMode; - document.documentElement.setAttribute('data-theme', wantDarkMode ? 'dark' : 'default'); - localStorage.setItem('darkMode', wantDarkMode); - } - }, - changeSlimDownloads: { - get() { - return this.slimDownloads - }, - set(wantSlimDownloads) { - this.slimDownloads = wantSlimDownloads; - document.getElementById('download_list').classList.toggle('slim', wantSlimDownloads); - localStorage.setItem('slimDownloads', wantSlimDownloads); - } - } - }, - methods: { - copyARLtoClipboard() { - let copyText = this.$refs.loginInput; - - copyText.setAttribute('type', 'text'); - copyText.select(); - copyText.setSelectionRange(0, 99999); - document.execCommand('copy'); - copyText.setAttribute('type', 'password'); - - toast('ARL copied to clipboard', 'assignment'); - }, - saveSettings() { - this.lastSettings = { ...this.settings }; - this.lastCredentials = { ...this.spotifyFeatures }; - let changed = false; - if (this.lastUser != this.spotifyUser) { - // force cloning without linking - this.lastUser = (' ' + this.spotifyUser).slice(1); - localStorage.setItem('spotifyUser', this.lastUser); - changed = true; - } - - socket.emit('saveSettings', this.lastSettings, this.lastCredentials, changed ? this.lastUser : false); - console.log(this.darkMode); - }, - loadSettings(settings, spotifyCredentials, defaults = null) { - if (defaults) { - this.defaultSettings = { ...defaults }; - } - - this.lastSettings = { ...settings }; - this.lastCredentials = { ...spotifyCredentials }; - this.settings = settings; - this.spotifyFeatures = spotifyCredentials; - }, - login() { - let arl = this.$refs.loginInput.value; - if (arl != '' && arl != localStorage.getItem('arl')) { - socket.emit('login', arl, true); - } - }, - logout() { - socket.emit('logout'); - }, - initSettings(settings, credentials, defaults) { - this.loadSettings(settings, credentials, defaults); - toast('Settings loaded!', 'settings'); - }, - updateSettings(settings, credentials) { - this.loadSettings(settings, credentials); - toast('Settings updated!', 'settings'); - }, - resetSettings() { - this.settings = { ...this.defaultSettings }; - } - }, - mounted() { - socket.on('init_settings', this.initSettings); - socket.on('updateSettings', this.updateSettings); - - let spotyUser = localStorage.getItem('spotifyUser'); - - if ('' !== spotyUser) { - this.lastUser = spotyUser; - this.spotifyUser = spotyUser; - } - - this.changeDarkMode = 'true' === localStorage.getItem('darkMode'); - this.changeSlimDownloads = 'true' === localStorage.getItem('slimDownloads'); - } -}).$mount('#settings_tab'); - -const MainSearch = new Vue({ - data: { - names: { - TOP_RESULT: 'Top Result', - TRACK: 'Tracks', - ARTIST: 'Artists', - ALBUM: 'Albums', - PLAYLIST: 'Playlists' - }, - results: { - query: '', - allTab: { - ORDER: [], - TOP_RESULT: [], - ALBUM: {}, - ARTIST: {}, - TRACK: {}, - PLAYLIST: {} - }, - trackTab: { - data: [], - next: 0, - total: 0, - loaded: false - }, - albumTab: { - data: [], - next: 0, - total: 0, - loaded: false - }, - artistTab: { - data: [], - next: 0, - total: 0, - loaded: false - }, - playlistTab: { - data: [], - next: 0, - total: 0, - loaded: false - } - } - }, - methods: { - artistView, - albumView, - playlistView, - playPausePreview: TrackPreview.playPausePreview, - previewMouseEnter: TrackPreview.previewMouseEnter, - previewMouseLeave: TrackPreview.previewMouseLeave, - handleClickTopResult(event) { - let topResultType = this.results.allTab.TOP_RESULT[0].type; - - switch (topResultType) { - case 'artist': - this.artistView(event); - break - case 'album': - this.albumView(event); - break - case 'playlist': - this.playlistView(event); - break - } - }, - changeSearchTab(section) { - if (section != 'TOP_RESULT') { - document.getElementById(`search_${section.toLowerCase()}_tab`).click(); - } - }, - addToQueue: function (e) { - Downloads.sendAddToQueue(e.currentTarget.dataset.link); - }, - openQualityModal: function (e) { - QualityModal$1.open(e.currentTarget.dataset.link); - }, - numberWithDots: Utils.numberWithDots, - convertDuration: Utils.convertDuration, - search(type) { - socket.emit('search', { - term: this.results.query, - type: type, - start: this.results[type + 'Tab'].next, - nb: 30 - }); - }, - scrolledSearch(type) { - if (this.results[type + 'Tab'].next < this.results[type + 'Tab'].total) { - socket.emit('search', { - term: this.results.query, - type: type, - start: this.results[type + 'Tab'].next, - nb: 30 - }); - } - }, - handleMainSearch(result) { - let resetObj = { data: [], next: 0, total: 0, loaded: false }; - this.results.allTab = result; - this.results.query = result.QUERY; - this.results.trackTab = { ...resetObj }; - this.results.albumTab = { ...resetObj }; - this.results.artistTab = { ...resetObj }; - this.results.playlistTab = { ...resetObj }; - document.getElementById('search_all_tab').click(); - document.getElementById('search_tab_content').style.display = 'block'; - document.getElementById('main_search_tablink').click(); - }, - handleSearch(result) { - let next = 0; - - if (result.next) { - next = parseInt(result.next.match(/index=(\d*)/)[1]); - } else { - next = result.total; - } - - if (this.results[result.type + 'Tab'].total != result.total) { - this.results[result.type + 'Tab'].total = result.total; - } - - if (this.results[result.type + 'Tab'].next != next) { - this.results[result.type + 'Tab'].next = next; - this.results[result.type + 'Tab'].data = this.results[result.type + 'Tab'].data.concat(result.data); - } - this.results[result.type + 'Tab'].loaded = true; - } - }, - mounted() { - socket.on('mainSearch', this.handleMainSearch); - socket.on('search', this.handleSearch); - } -}).$mount('#search_tab'); - -/* ===== Globals ====== */ -window.search_selected = ''; -window.main_selected = ''; -window.windows_stack = []; - -/* ===== Locals ===== */ -let currentStack = {}; - -// Exporting this function out of the default export -// because it's used in components that are needed -// in this file too -function artistView(ev) { - let id = ev.currentTarget.dataset.id; - ArtistTab.reset(); - socket.emit('getTracklist', { type: 'artist', id: id }); - showTab('artist', id); -} - -// Exporting this function out of the default export -// because it's used in components that are needed -// in this file too -function albumView(ev) { - let id = ev.currentTarget.dataset.id; - TracklistTab.reset(); - socket.emit('getTracklist', { type: 'album', id: id }); - showTab('album', id); -} - -// Exporting this function out of the default export -// because it's used in components that are needed -// in this file too -function playlistView(ev) { - let id = ev.currentTarget.dataset.id; - TracklistTab.reset(); - socket.emit('getTracklist', { type: 'playlist', id: id }); - showTab('playlist', id); -} - -function spotifyPlaylistView(ev) { - let id = ev.currentTarget.dataset.id; - TracklistTab.reset(); - socket.emit('getTracklist', { type: 'spotifyplaylist', id: id }); - showTab('spotifyplaylist', id); -} - -function analyzeLink(link) { - console.log('Analyzing: ' + link); - LinkAnalyzerTab.reset(); - socket.emit('analyzeLink', link); -} - -function linkListeners$2() { - document.getElementById('search_tab').addEventListener('click', handleSearchTabClick); - document.getElementById('favorites_tab').addEventListener('click', handleFavoritesTabClick); - document.getElementById('sidebar').addEventListener('click', handleSidebarClick); - - const backButtons = Array.from(document.getElementsByClassName('back-button')); - - backButtons.forEach(button => { - button.addEventListener('click', backTab); - }); -} - -/** - * Handles click Event on the sidebar and changes tab - * according to clicked icon. - * Uses event delegation - * @param {Event} event - * @since 0.1.0 +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e((function(e){ +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2020-05-04T22:49Z */ -function handleSidebarClick(event) { - if (!(event.target.matches('.main_tablinks') || event.target.parentElement.matches('.main_tablinks'))) { - return - } - - let sidebarEl = event.target.matches('.main_tablinks') ? event.target : event.target.parentElement; - let targetID = sidebarEl.getAttribute('id'); - - switch (targetID) { - case 'main_search_tablink': - changeTab(sidebarEl, 'main', 'search_tab'); - break - case 'main_home_tablink': - changeTab(sidebarEl, 'main', 'home_tab'); - break - case 'main_charts_tablink': - changeTab(sidebarEl, 'main', 'charts_tab'); - break - case 'main_favorites_tablink': - changeTab(sidebarEl, 'main', 'favorites_tab'); - break - case 'main_analyzer_tablink': - changeTab(sidebarEl, 'main', 'analyzer_tab'); - break - case 'main_settings_tablink': - changeTab(sidebarEl, 'main', 'settings_tab'); - break - case 'main_about_tablink': - changeTab(sidebarEl, 'main', 'about_tab'); - break - } -} - -function handleSearchTabClick(event) { - let targetID = event.target.id; - - switch (targetID) { - case 'search_all_tab': - changeTab(event.target, 'search', 'main_search'); - break - case 'search_track_tab': - changeTab(event.target, 'search', 'track_search'); - break - case 'search_album_tab': - changeTab(event.target, 'search', 'album_search'); - break - case 'search_artist_tab': - changeTab(event.target, 'search', 'artist_search'); - break - case 'search_playlist_tab': - changeTab(event.target, 'search', 'playlist_search'); - break - } -} - -function handleFavoritesTabClick(event) { - let targetID = event.target.id; - - switch (targetID) { - case 'favorites_playlist_tab': - changeTab(event.target, 'favorites', 'playlist_favorites'); - break - case 'favorites_album_tab': - changeTab(event.target, 'favorites', 'album_favorites'); - break - case 'favorites_artist_tab': - changeTab(event.target, 'favorites', 'artist_favorites'); - break - case 'favorites_track_tab': - changeTab(event.target, 'favorites', 'track_favorites'); - break - } -} - -function changeTab(sidebarEl, section, tabName) { - windows_stack = []; - currentStack = {}; - var i, tabcontent, tablinks; - tabcontent = document.getElementsByClassName(section + '_tabcontent'); - for (i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = 'none'; - } - tablinks = document.getElementsByClassName(section + '_tablinks'); - for (i = 0; i < tablinks.length; i++) { - tablinks[i].classList.remove('active'); - } - if (tabName == 'settings_tab' && main_selected != 'settings_tab') { - SettingsTab.settings = { ...SettingsTab.lastSettings }; - SettingsTab.spotifyCredentials = { ...SettingsTab.lastCredentials }; - SettingsTab.spotifyUser = (' ' + SettingsTab.lastUser).slice(1); - } - - document.getElementById(tabName).style.display = 'block'; - - if ('main' === section) { - main_selected = tabName; - } else if ('search' === section) { - search_selected = tabName; - } - - // Not choosing .currentTarget beacuse the event - // is delegated - sidebarEl.classList.add('active'); - - // Check if you need to load more content in the search tab - if ( - main_selected == 'search_tab' && - ['track_search', 'album_search', 'artist_search', 'playlist_search'].indexOf(search_selected) != -1 && - MainSearch.results[search_selected.split('_')[0] + 'Tab'].data.length == 0 - ) { - MainSearch.search(search_selected.split('_')[0]); - } -} - -function showTab(type, id, back = false) { - if (windows_stack.length == 0) { - windows_stack.push({ tab: main_selected }); - } else if (!back) { - windows_stack.push(currentStack); - } - - window.tab = type == 'artist' ? 'artist_tab' : 'tracklist_tab'; - - currentStack = { type: type, id: id }; - let tabcontent = document.getElementsByClassName('main_tabcontent'); - - for (let i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = 'none'; - } - document.getElementById(tab).style.display = 'block'; - TrackPreview.stopStackedTabsPreview(); -} - -function backTab() { - if (windows_stack.length == 1) { - document.getElementById(`main_${main_selected}link`).click(); - } else { - let tabObj = windows_stack.pop(); - if (tabObj.type == 'artist') { - ArtistTab.reset(); - } else { - TracklistTab.reset(); - } - socket.emit('getTracklist', { type: tabObj.type, id: tabObj.id }); - showTab(tabObj.type, tabObj.id, true); - } - TrackPreview.stopStackedTabsPreview(); -} - -var Tabs = { - linkListeners: linkListeners$2, - artistView, - albumView, - playlistView, - analyzeLink -}; - -function linkListeners$3() { - document.getElementById('content').addEventListener('scroll', Utils.debounce(handleContentScroll, 100)); - document.getElementById('searchbar').addEventListener('keyup', handleSearchBarKeyup); -} - -// Load more content when the search page is at the end -function handleContentScroll(event) { - let contentElement = event.target; - - if (contentElement.scrollTop + contentElement.clientHeight >= contentElement.scrollHeight) { - if ( - main_selected === 'search_tab' && - ['track_search', 'album_search', 'artist_search', 'playlist_search'].indexOf(search_selected) != -1 - ) { - MainSearch.scrolledSearch(search_selected.split('_')[0]); - } - } -} - -function handleSearchBarKeyup(e) { - if (e.keyCode == 13) { - let term = this.value; - if (Utils.isValidURL(term)) { - if (e.ctrlKey) { - QualityModal$1.open(term); - } else { - if (window.main_selected == 'analyzer_tab') { - Tabs.analyzeLink(term); - } else { - Downloads.sendAddToQueue(term); - } - } - } else { - if (term != MainSearch.query || main_selected == 'search_tab') { - document.getElementById('search_tab_content').style.display = 'none'; - socket.emit('mainSearch', { term: term }); - } else { - document.getElementById('search_all_tab').click(); - document.getElementById('search_tab_content').style.display = 'block'; - document.getElementById('main_search_tablink').click(); - } - } - } -} - -var Search = { - linkListeners: linkListeners$3 -}; - -/* ===== Socketio listeners ===== */ - -// Debug messages for socketio -socket.on('message', function (msg) { - console.log(msg); -}); - -socket.on('logging_in', function () { - toast('Logging in', 'loading', false, 'login-toast'); -}); - -socket.on('logged_in', function (data) { - switch (data.status) { - case 1: - case 3: - toast('Logged in', 'done', true, 'login-toast'); - if (data.arl) { - localStorage.setItem('arl', data.arl); - $('#login_input_arl').val(data.arl); - } - $('#open_login_prompt').hide(); - if (data.user) { - $('#settings_username').text(data.user.name); - $('#settings_picture').attr( - 'src', - `https://e-cdns-images.dzcdn.net/images/user/${data.user.picture}/125x125-000000-80-0-0.jpg` - ); - // $('#logged_in_info').show() - document.getElementById('logged_in_info').classList.remove('hide'); - } - break - case 2: - toast('Already logged in', 'done', true, 'login-toast'); - if (data.user) { - $('#settings_username').text(data.user.name); - $('#settings_picture').attr( - 'src', - `https://e-cdns-images.dzcdn.net/images/user/${data.user.picture}/125x125-000000-80-0-0.jpg` - ); - // $('#logged_in_info').show() - document.getElementById('logged_in_info').classList.remove('hide'); - } - break - case 0: - toast("Couldn't log in", 'close', true, 'login-toast'); - localStorage.removeItem('arl'); - $('#login_input_arl').val(''); - $('#open_login_prompt').show(); - document.getElementById('logged_in_info').classList.add('hide'); - // $('#logged_in_info').hide() - $('#settings_username').text('Not Logged'); - $('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`); - break - } -}); - -socket.on('logged_out', function () { - toast('Logged out', 'done', true, 'login-toast'); - localStorage.removeItem('arl'); - $('#login_input_arl').val(''); - $('#open_login_prompt').show(); - document.getElementById('logged_in_info').classList.add('hide'); - // $('#logged_in_info').hide() - $('#settings_username').text('Not Logged'); - $('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`); -}); - -/* ===== App initialization ===== */ -function startApp() { - Downloads.init(); - QualityModal$1.init(); - Tabs.linkListeners(); - Search.linkListeners(); - TrackPreview.init(); - - document.getElementById('logged_in_info').classList.add('hide'); - - if (localStorage.getItem('arl')) { - let arl = localStorage.getItem('arl'); - - socket.emit('login', arl); - $('#login_input_arl').val(arl); - } - if ('true' === localStorage.getItem('slimDownloads')) { - document.getElementById('download_list').classList.add('slim'); - } - let spotifyUser = localStorage.getItem('spotifyUser'); - if (spotifyUser != '') { - socket.emit('update_userSpotifyPlaylists', spotifyUser); - } - // Open default tab - document.getElementById('main_home_tablink').click(); -} - -document.addEventListener('DOMContentLoaded', startApp); +!function(t,n){e.exports=t.document?n(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}}("undefined"!=typeof window?window:t,(function(t,e){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(t){return n.flat.call(t)}:function(t){return n.concat.apply([],t)},a=n.push,u=n.indexOf,s={},l=s.toString,c=s.hasOwnProperty,f=c.toString,d=f.call(Object),p={},h=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},v=function(t){return null!=t&&t===t.window},g=t.document,m={type:!0,src:!0,nonce:!0,noModule:!0};function y(t,e,n){var r,i,o=(n=n||g).createElement("script");if(o.text=t,e)for(r in m)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function _(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?s[l.call(t)]||"object":typeof t}var b=function(t,e){return new b.fn.init(t,e)};function w(t){var e=!!t&&"length"in t&&t.length,n=_(t);return!h(t)&&!v(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}b.fn=b.prototype={jquery:"3.5.1",constructor:b,length:0,toArray:function(){return i.call(this)},get:function(t){return null==t?i.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=b.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return b.each(this,t)},map:function(t){return this.pushStack(b.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(b.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(b.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),U=new RegExp(R+"|>"),V=new RegExp(H),G=new RegExp("^"+B+"$"),K={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},at=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(j=M.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(t){I={apply:j.length?function(t,e){N.apply(t,M.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function ut(t,e,r,i){var o,u,l,c,f,h,m,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(e),e=e||p,v)){if(11!==w&&(f=J.exec(t)))if(o=f[1]){if(9===w){if(!(l=e.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(y&&(l=y.getElementById(o))&&_(e,l)&&l.id===o)return r.push(l),r}else{if(f[2])return I.apply(r,e.getElementsByTagName(t)),r;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!C[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(m=t,y=e,1===w&&(U.test(t)||F.test(t))){for((y=tt.test(t)&&mt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=b)),u=(h=a(t)).length;u--;)h[u]=(c?"#"+c:":scope")+" "+_t(h[u]);m=h.join(",")}try{return I.apply(r,y.querySelectorAll(m)),r}catch(e){C(t,!0)}finally{c===b&&e.removeAttribute("id")}}}return s(t.replace($,"$1"),e,r,i)}function st(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function lt(t){return t[b]=!0,t}function ct(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ft(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function vt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return lt((function(e){return e=+e,lt((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ut.support={},o=ut.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!Q.test(e||n&&n.nodeName||"HTML")},d=ut.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!=p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,v=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ct((function(t){return h.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=ct((function(t){return h.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},m=[],g=[],(n.qsa=Z.test(p.querySelectorAll))&&(ct((function(t){var e;h.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),m.push("!=",H)})),g=g.length&&new RegExp(g.join("|")),m=m.length&&new RegExp(m.join("|")),e=Z.test(h.compareDocumentPosition),_=e||Z.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},A=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==w&&_(w,t)?-1:e==p||e.ownerDocument==w&&_(w,e)?1:c?O(c,t)-O(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],u=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:c?O(c,t)-O(c,e):0;if(i===o)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?dt(a[r],u[r]):a[r]==w?-1:u[r]==w?1:0},p):p},ut.matches=function(t,e){return ut(t,null,null,e)},ut.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&v&&!C[e+" "]&&(!m||!m.test(e))&&(!g||!g.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){C(e,!0)}return ut(e,p,null,[t]).length>0},ut.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),_(t,e)},ut.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var i=r.attrHandle[e.toLowerCase()],o=i&&L.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ut.escape=function(t){return(t+"").replace(rt,it)},ut.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ut.uniqueSort=function(t){var e,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(A),f){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return c=null,t},i=ut.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=ut.selectors={cacheLength:50,createPseudo:lt,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ut.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ut.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return K.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&k(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=ut.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(W," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,s){var l,c,f,d,p,h,v=o!==a?"nextSibling":"previousSibling",g=e.parentNode,m=u&&e.nodeName.toLowerCase(),y=!s&&!u,_=!1;if(g){if(o){for(;v;){for(d=e;d=d[v];)if(u?d.nodeName.toLowerCase()===m:1===d.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(_=(p=(l=(c=(f=(d=g)[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===x&&l[1])&&l[2],d=p&&g.childNodes[p];d=++p&&d&&d[v]||(_=p=0)||h.pop();)if(1===d.nodeType&&++_&&d===e){c[t]=[x,p,_];break}}else if(y&&(_=p=(l=(c=(f=(d=e)[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===x&&l[1]),!1===_)for(;(d=++p&&d&&d[v]||(_=p=0)||h.pop())&&((u?d.nodeName.toLowerCase()!==m:1!==d.nodeType)||!++_||(y&&((c=(f=d[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]=[x,_]),d!==e)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||ut.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?lt((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=O(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:lt((function(t){var e=[],n=[],r=u(t.replace($,"$1"));return r[b]?lt((function(t,e,n,i){for(var o,a=r(t,null,i,[]),u=t.length;u--;)(o=a[u])&&(t[u]=!(e[u]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:lt((function(t){return function(e){return ut(t,e).length>0}})),contains:lt((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:lt((function(t){return G.test(t||"")||ut.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:vt(!1),disabled:vt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return X.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:gt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function xt(t,e,n,r,i){for(var o,a=[],u=0,s=t.length,l=null!=e;u-1&&(o[l]=!(a[l]=f))}}else m=xt(m===a?m.splice(h,m.length):m),i?i(null,a,m,s):I.apply(a,m)}))}function kt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],u=a||r.relative[" "],s=a?1:0,c=bt((function(t){return t===e}),u,!0),f=bt((function(t){return O(e,t)>-1}),u,!0),d=[function(t,n,r){var i=!a&&(r||n!==l)||((e=n).nodeType?c(t,n,r):f(t,n,r));return e=null,i}];s1&&wt(d),s>1&&_t(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace($,"$1"),n,s0,i=t.length>0,o=function(o,a,u,s,c){var f,h,g,m=0,y="0",_=o&&[],b=[],w=l,T=o||i&&r.find.TAG("*",c),k=x+=null==w?1:Math.random()||.1,S=T.length;for(c&&(l=a==p||a||c);y!==S&&null!=(f=T[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument==p||(d(f),u=!v);g=t[h++];)if(g(f,a||p,u)){s.push(f);break}c&&(x=k)}n&&((f=!g&&f)&&m--,o&&_.push(f))}if(m+=y,n&&y!==m){for(h=0;g=e[h++];)g(_,b,a,u);if(o){if(m>0)for(;y--;)_[y]||b[y]||(b[y]=D.call(s));b=xt(b)}I.apply(s,b),c&&!o&&b.length>0&&m+e.length>1&&ut.uniqueSort(s)}return c&&(x=k,l=w),_};return n?lt(o):o}(o,i))).selector=t}return u},s=ut.select=function(t,e,n,i){var o,s,l,c,f,d="function"==typeof t&&t,p=!i&&a(t=d.selector||t);if(n=n||[],1===p.length){if((s=p[0]=p[0].slice(0)).length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&v&&r.relative[s[1].type]){if(!(e=(r.find.ID(l.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(s.shift().value.length)}for(o=K.needsContext.test(t)?0:s.length;o--&&(l=s[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(et,nt),tt.test(s[0].type)&&mt(e.parentNode)||e))){if(s.splice(o,1),!(t=i.length&&_t(s)))return I.apply(n,i),n;break}}return(d||u(t,p))(i,e,!v,n,!e||tt.test(t)&&mt(e.parentNode)||e),n},n.sortStable=b.split("").sort(A).join("")===b,n.detectDuplicates=!!f,d(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ct((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||ft("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ft("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||ft(P,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),ut}(t);b.find=x,b.expr=x.selectors,b.expr[":"]=b.expr.pseudos,b.uniqueSort=b.unique=x.uniqueSort,b.text=x.getText,b.isXMLDoc=x.isXML,b.contains=x.contains,b.escapeSelector=x.escape;var T=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&b(t).is(n))break;r.push(t)}return r},k=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=b.expr.match.needsContext;function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return h(e)?b.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?b.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?b.grep(t,(function(t){return u.call(e,t)>-1!==n})):b.filter(e,t,n)}b.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?b.find.matchesSelector(r,t)?[r]:[]:b.find.matches(t,b.grep(e,(function(t){return 1===t.nodeType})))},b.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(b(t).filter((function(){for(e=0;e1?b.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&S.test(t)?b(t):t||[],!1).length}});var L,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(b.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||L,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:j.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof b?e[0]:e,b.merge(this,b.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),C.test(r[1])&&b.isPlainObject(e))for(r in e)h(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):h(t)?void 0!==n.ready?n.ready(t):t(b):b.makeArray(t,this)}).prototype=b.fn,L=b(g);var D=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function I(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}b.fn.extend({has:function(t){var e=b(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&b.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?b.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?u.call(b(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),b.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return I(t,"nextSibling")},prev:function(t){return I(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return k((t.parentNode||{}).firstChild,t)},children:function(t){return k(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),b.merge([],t.childNodes))}},(function(t,e){b.fn[t]=function(n,r){var i=b.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),this.length>1&&(N[t]||b.uniqueSort(i),D.test(t)&&i.reverse()),this.pushStack(i)}}));var M=/[^\x20\t\r\n\f]+/g;function O(t){return t}function P(t){throw t}function R(t,e,n,r){var i;try{t&&h(i=t.promise)?i.call(t).done(e).fail(n):t&&h(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}b.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return b.each(t.match(M)||[],(function(t,n){e[n]=!0})),e}(t):b.extend({},t);var e,n,r,i,o=[],a=[],u=-1,s=function(){for(i=i||t.once,r=e=!0;a.length;u=-1)for(n=a.shift();++u-1;)o.splice(n,1),n<=u&&u--})),this},has:function(t){return t?b.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||s()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},b.extend({Deferred:function(e){var n=[["notify","progress",b.Callbacks("memory"),b.Callbacks("memory"),2],["resolve","done",b.Callbacks("once memory"),b.Callbacks("once memory"),0,"resolved"],["reject","fail",b.Callbacks("once memory"),b.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return b.Deferred((function(e){b.each(n,(function(n,r){var i=h(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&h(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(e,r,i){var o=0;function a(e,n,r,i){return function(){var u=this,s=arguments,l=function(){var t,l;if(!(e=o&&(r!==P&&(u=void 0,s=[t]),n.rejectWith(u,s))}};e?c():(b.Deferred.getStackHook&&(c.stackTrace=b.Deferred.getStackHook()),t.setTimeout(c))}}return b.Deferred((function(t){n[0][3].add(a(0,t,h(i)?i:O,t.notifyWith)),n[1][3].add(a(0,t,h(e)?e:O)),n[2][3].add(a(0,t,h(r)?r:P))})).promise()},promise:function(t){return null!=t?b.extend(t,i):i}},o={};return b.each(n,(function(t,e){var a=e[2],u=e[5];i[e[1]]=a.add,u&&a.add((function(){r=u}),n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),a.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),o=i.call(arguments),a=b.Deferred(),u=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?i.call(arguments):n,--e||a.resolveWith(r,o)}};if(e<=1&&(R(t,a.done(u(n)).resolve,a.reject,!e),"pending"===a.state()||h(o[n]&&o[n].then)))return a.then();for(;n--;)R(o[n],u(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;b.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&B.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},b.readyException=function(e){t.setTimeout((function(){throw e}))};var q=b.Deferred();function H(){g.removeEventListener("DOMContentLoaded",H),t.removeEventListener("load",H),b.ready()}b.fn.ready=function(t){return q.then(t).catch((function(t){b.readyException(t)})),this},b.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--b.readyWait:b.isReady)||(b.isReady=!0,!0!==t&&--b.readyWait>0||q.resolveWith(g,[b]))}}),b.ready.then=q.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(b.ready):(g.addEventListener("DOMContentLoaded",H),t.addEventListener("load",H));var W=function(t,e,n,r,i,o,a){var u=0,s=t.length,l=null==n;if("object"===_(n))for(u in i=!0,n)W(t,e,u,n[u],!0,o,a);else if(void 0!==r&&(i=!0,h(r)||(a=!0),l&&(a?(e.call(t,r),e=null):(l=e,e=function(t,e,n){return l.call(b(t),n)})),e))for(;u1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),b.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=K.get(t,e),n&&(!r||Array.isArray(n)?r=K.access(t,e,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=b.queue(t,e),r=n.length,i=n.shift(),o=b._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){b.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return K.get(t,n)||K.access(t,n,{empty:b.Callbacks("once memory").add((function(){K.remove(t,[e+"queue",n])}))})}}),b.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ht=/^$|^module$|\/(?:java|ecma)script/i;ct=g.createDocumentFragment().appendChild(g.createElement("div")),(ft=g.createElement("input")).setAttribute("type","radio"),ft.setAttribute("checked","checked"),ft.setAttribute("name","t"),ct.appendChild(ft),p.checkClone=ct.cloneNode(!0).cloneNode(!0).lastChild.checked,ct.innerHTML="",p.noCloneChecked=!!ct.cloneNode(!0).lastChild.defaultValue,ct.innerHTML="",p.option=!!ct.lastChild;var vt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function gt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?b.merge([t],n):n}function mt(t,e){for(var n=0,r=t.length;n",""]);var yt=/<|&#?\w+;/;function _t(t,e,n,r,i){for(var o,a,u,s,l,c,f=e.createDocumentFragment(),d=[],p=0,h=t.length;p-1)i&&i.push(o);else if(l=rt(o),a=gt(f.appendChild(o),"script"),l&&mt(a),n)for(c=0;o=a[c++];)ht.test(o.type||"")&&n.push(o);return f}var bt=/^key/,wt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xt=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function kt(){return!1}function St(t,e){return t===function(){try{return g.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,r,i,o){var a,u;if("object"==typeof e){for(u in"string"!=typeof n&&(r=r||n,n=void 0),e)Et(t,u,n,r,e[u],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=kt;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return b().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=b.guid++)),t.each((function(){b.event.add(this,e,i,r,n)}))}function Ct(t,e,n){n?(K.set(t,e,!1),b.event.add(t,e,{namespace:!1,handler:function(t){var r,o,a=K.get(this,e);if(1&t.isTrigger&&this[e]){if(a.length)(b.event.special[e]||{}).delegateType&&t.stopPropagation();else if(a=i.call(arguments),K.set(this,e,a),r=n(this,e),this[e](),a!==(o=K.get(this,e))||r?K.set(this,e,!1):o={},a!==o)return t.stopImmediatePropagation(),t.preventDefault(),o.value}else a.length&&(K.set(this,e,{value:b.event.trigger(b.extend(a[0],b.Event.prototype),a.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===K.get(t,e)&&b.event.add(t,e,Tt)}b.event={global:{},add:function(t,e,n,r,i){var o,a,u,s,l,c,f,d,p,h,v,g=K.get(t);if(V(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&b.find.matchesSelector(nt,i),n.guid||(n.guid=b.guid++),(s=g.events)||(s=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==b&&b.event.triggered!==e.type?b.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(M)||[""]).length;l--;)p=v=(u=xt.exec(e[l])||[])[1],h=(u[2]||"").split(".").sort(),p&&(f=b.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=b.event.special[p]||{},c=b.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&b.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=s[p])||((d=s[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),b.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,u,s,l,c,f,d,p,h,v,g=K.hasData(t)&&K.get(t);if(g&&(s=g.events)){for(l=(e=(e||"").match(M)||[""]).length;l--;)if(p=v=(u=xt.exec(e[l])||[])[1],h=(u[2]||"").split(".").sort(),p){for(f=b.event.special[p]||{},d=s[p=(r?f.delegateType:f.bindType)||p]||[],u=u[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&v!==c.origType||n&&n.guid!==c.guid||u&&!u.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(t,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||b.removeEvent(t,p,g.handle),delete s[p])}else for(p in s)b.event.remove(t,p+e[l],n,r,!0);b.isEmptyObject(s)&&K.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,u=new Array(arguments.length),s=b.event.fix(t),l=(K.get(this,"events")||Object.create(null))[s.type]||[],c=b.event.special[s.type]||{};for(u[0]=s,e=1;e=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:b.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&u.push({elem:l,handlers:o})}return l=this,s\s*$/g;function Dt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&b(t).children("tbody")[0]||t}function Nt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function It(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Mt(t,e){var n,r,i,o,a,u;if(1===e.nodeType){if(K.hasData(t)&&(u=K.get(t).events))for(i in K.remove(e,"handle events"),u)for(n=0,r=u[i].length;n1&&"string"==typeof g&&!p.checkClone&&Lt.test(g))return t.each((function(i){var o=t.eq(i);m&&(e[0]=g.call(this,i,o.html())),Pt(o,e,n,r)}));if(d&&(a=(i=_t(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(s=(u=b.map(gt(i,"script"),Nt)).length;f0&&mt(a,!s&>(t,"script")),u},cleanData:function(t){for(var e,n,r,i=b.event.special,o=0;void 0!==(n=t[o]);o++)if(V(n)){if(e=n[K.expando]){if(e.events)for(r in e.events)i[r]?b.event.remove(n,r):b.removeEvent(n,r,e.handle);n[K.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),b.fn.extend({detach:function(t){return Rt(this,t,!0)},remove:function(t){return Rt(this,t)},text:function(t){return W(this,(function(t){return void 0===t?b.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Pt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Dt(this,t).appendChild(t)}))},prepend:function(){return Pt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Dt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Pt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Pt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(b.cleanData(gt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return b.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!vt[(pt.exec(t)||["",""])[1].toLowerCase()]){t=b.htmlPrefilter(t);try{for(;n3,nt.removeChild(e)),u}}))}();var Ft=["Webkit","Moz","ms"],Ut=g.createElement("div").style,Vt={};function Gt(t){var e=b.cssProps[t]||Vt[t];return e||(t in Ut?t:Vt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Ft.length;n--;)if((t=Ft[n]+e)in Ut)return t}(t)||t)}var Kt=/^(none|table(?!-c[ea]).+)/,Qt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Xt={letterSpacing:"0",fontWeight:"400"};function Zt(t,e,n){var r=tt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function Jt(t,e,n,r,i,o){var a="width"===e?1:0,u=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=b.css(t,n+et[a],!0,i)),r?("content"===n&&(s-=b.css(t,"padding"+et[a],!0,i)),"margin"!==n&&(s-=b.css(t,"border"+et[a]+"Width",!0,i))):(s+=b.css(t,"padding"+et[a],!0,i),"padding"!==n?s+=b.css(t,"border"+et[a]+"Width",!0,i):u+=b.css(t,"border"+et[a]+"Width",!0,i));return!r&&o>=0&&(s+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-s-u-.5))||0),s}function te(t,e,n){var r=qt(t),i=(!p.boxSizingReliable()||n)&&"border-box"===b.css(t,"boxSizing",!1,r),o=i,a=$t(t,e,r),u="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(a)){if(!n)return a;a="auto"}return(!p.boxSizingReliable()&&i||!p.reliableTrDimensions()&&E(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===b.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===b.css(t,"boxSizing",!1,r),(o=u in t)&&(a=t[u])),(a=parseFloat(a)||0)+Jt(t,e,n||(i?"border":"content"),o,r,a)+"px"}function ee(t,e,n,r,i){return new ee.prototype.init(t,e,n,r,i)}b.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=$t(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,u=U(e),s=Qt.test(e),l=t.style;if(s||(e=Gt(u)),a=b.cssHooks[e]||b.cssHooks[u],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:l[e];"string"===(o=typeof n)&&(i=tt.exec(n))&&i[1]&&(n=at(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||s||(n+=i&&i[3]||(b.cssNumber[u]?"":"px")),p.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(s?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,r){var i,o,a,u=U(e);return Qt.test(e)||(e=Gt(u)),(a=b.cssHooks[e]||b.cssHooks[u])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=$t(t,e,r)),"normal"===i&&e in Xt&&(i=Xt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),b.each(["height","width"],(function(t,e){b.cssHooks[e]={get:function(t,n,r){if(n)return!Kt.test(b.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?te(t,e,r):Ht(t,Yt,(function(){return te(t,e,r)}))},set:function(t,n,r){var i,o=qt(t),a=!p.scrollboxSize()&&"absolute"===o.position,u=(a||r)&&"border-box"===b.css(t,"boxSizing",!1,o),s=r?Jt(t,e,r,u,o):0;return u&&a&&(s-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Jt(t,e,"border",!1,o)-.5)),s&&(i=tt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=b.css(t,e)),Zt(0,n,s)}}})),b.cssHooks.marginLeft=zt(p.reliableMarginLeft,(function(t,e){if(e)return(parseFloat($t(t,"marginLeft"))||t.getBoundingClientRect().left-Ht(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),b.each({margin:"",padding:"",border:"Width"},(function(t,e){b.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+et[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(b.cssHooks[t+e].set=Zt)})),b.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=qt(t),i=e.length;a1)}}),b.Tween=ee,ee.prototype={constructor:ee,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||b.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var t=ee.propHooks[this.prop];return t&&t.get?t.get(this):ee.propHooks._default.get(this)},run:function(t){var e,n=ee.propHooks[this.prop];return this.options.duration?this.pos=e=b.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ee.propHooks._default.set(this),this}},ee.prototype.init.prototype=ee.prototype,ee.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=b.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){b.fx.step[t.prop]?b.fx.step[t.prop](t):1!==t.elem.nodeType||!b.cssHooks[t.prop]&&null==t.elem.style[Gt(t.prop)]?t.elem[t.prop]=t.now:b.style(t.elem,t.prop,t.now+t.unit)}}},ee.propHooks.scrollTop=ee.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},b.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},b.fx=ee.prototype.init,b.fx.step={};var ne,re,ie=/^(?:toggle|show|hide)$/,oe=/queueHooks$/;function ae(){re&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(ae):t.setTimeout(ae,b.fx.interval),b.fx.tick())}function ue(){return t.setTimeout((function(){ne=void 0})),ne=Date.now()}function se(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=et[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var r,i=(ce.tweeners[e]||[]).concat(ce.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each((function(){b.removeAttr(this,t)}))}}),b.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?b.prop(t,e,n):(1===o&&b.isXMLDoc(t)||(i=b.attrHooks[e.toLowerCase()]||(b.expr.match.bool.test(e)?fe:void 0)),void 0!==n?null===n?void b.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=b.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(M);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),fe={set:function(t,e,n){return!1===e?b.removeAttr(t,n):t.setAttribute(n,n),n}},b.each(b.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=de[e]||b.find.attr;de[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=de[a],de[a]=i,i=null!=n(t,e,r)?a:null,de[a]=o),i}}));var pe=/^(?:input|select|textarea|button)$/i,he=/^(?:a|area)$/i;function ve(t){return(t.match(M)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function me(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(M)||[]}b.fn.extend({prop:function(t,e){return W(this,b.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[b.propFix[t]||t]}))}}),b.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&b.isXMLDoc(t)||(e=b.propFix[e]||e,i=b.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=b.find.attr(t,"tabindex");return e?parseInt(e,10):pe.test(t.nodeName)||he.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(b.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),b.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){b.propFix[this.toLowerCase()]=this})),b.fn.extend({addClass:function(t){var e,n,r,i,o,a,u,s=0;if(h(t))return this.each((function(e){b(this).addClass(t.call(this,e,ge(this)))}));if((e=me(t)).length)for(;n=this[s++];)if(i=ge(n),r=1===n.nodeType&&" "+ve(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(u=ve(r))&&n.setAttribute("class",u)}return this},removeClass:function(t){var e,n,r,i,o,a,u,s=0;if(h(t))return this.each((function(e){b(this).removeClass(t.call(this,e,ge(this)))}));if(!arguments.length)return this.attr("class","");if((e=me(t)).length)for(;n=this[s++];)if(i=ge(n),r=1===n.nodeType&&" "+ve(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(u=ve(r))&&n.setAttribute("class",u)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):h(t)?this.each((function(n){b(this).toggleClass(t.call(this,n,ge(this),e),e)})):this.each((function(){var e,i,o,a;if(r)for(i=0,o=b(this),a=me(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ge(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ve(ge(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;b.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=h(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,b(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=b.map(i,(function(t){return null==t?"":t+""}))),(e=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=b.valHooks[i.type]||b.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ye,""):null==n?"":n:void 0}}),b.extend({valHooks:{option:{get:function(t){var e=b.find.attr(t,"value");return null!=e?e:ve(b.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,u=a?null:[],s=a?o+1:i.length;for(r=o<0?s:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),b.each(["radio","checkbox"],(function(){b.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=b.inArray(b(t).val(),e)>-1}},p.checkOn||(b.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),p.focusin="onfocusin"in t;var _e=/^(?:focusinfocus|focusoutblur)$/,be=function(t){t.stopPropagation()};b.extend(b.event,{trigger:function(e,n,r,i){var o,a,u,s,l,f,d,p,m=[r||g],y=c.call(e,"type")?e.type:e,_=c.call(e,"namespace")?e.namespace.split("."):[];if(a=p=u=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!_e.test(y+b.event.triggered)&&(y.indexOf(".")>-1&&(_=y.split("."),y=_.shift(),_.sort()),l=y.indexOf(":")<0&&"on"+y,(e=e[b.expando]?e:new b.Event(y,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=_.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:b.makeArray(n,[e]),d=b.event.special[y]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!v(r)){for(s=d.delegateType||y,_e.test(s+y)||(a=a.parentNode);a;a=a.parentNode)m.push(a),u=a;u===(r.ownerDocument||g)&&m.push(u.defaultView||u.parentWindow||t)}for(o=0;(a=m[o++])&&!e.isPropagationStopped();)p=a,e.type=o>1?s:d.bindType||y,(f=(K.get(a,"events")||Object.create(null))[e.type]&&K.get(a,"handle"))&&f.apply(a,n),(f=l&&a[l])&&f.apply&&V(a)&&(e.result=f.apply(a,n),!1===e.result&&e.preventDefault());return e.type=y,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(m.pop(),n)||!V(r)||l&&h(r[y])&&!v(r)&&((u=r[l])&&(r[l]=null),b.event.triggered=y,e.isPropagationStopped()&&p.addEventListener(y,be),r[y](),e.isPropagationStopped()&&p.removeEventListener(y,be),b.event.triggered=void 0,u&&(r[l]=u)),e.result}},simulate:function(t,e,n){var r=b.extend(new b.Event,n,{type:t,isSimulated:!0});b.event.trigger(r,null,e)}}),b.fn.extend({trigger:function(t,e){return this.each((function(){b.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return b.event.trigger(t,e,n,!0)}}),p.focusin||b.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){b.event.simulate(e,t.target,b.event.fix(t))};b.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,e);i||r.addEventListener(t,n,!0),K.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,e)-1;i?K.access(r,e,i):(r.removeEventListener(t,n,!0),K.remove(r,e))}}}));var we=t.location,xe={guid:Date.now()},Te=/\?/;b.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+e),n};var ke=/\[\]$/,Se=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,r){var i;if(Array.isArray(e))b.each(e,(function(e,i){n||ke.test(t)?r(t,i):Ae(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==_(e))r(t,e);else for(i in e)Ae(t+"["+i+"]",e[i],n,r)}b.param=function(t,e){var n,r=[],i=function(t,e){var n=h(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!b.isPlainObject(t))b.each(t,(function(){i(this.name,this.value)}));else for(n in t)Ae(n,t[n],e,i);return r.join("&")},b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=b.prop(this,"elements");return t?b.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!b(this).is(":disabled")&&Ce.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!dt.test(t))})).map((function(t,e){var n=b(this).val();return null==n?null:Array.isArray(n)?b.map(n,(function(t){return{name:e.name,value:t.replace(Se,"\r\n")}})):{name:e.name,value:n.replace(Se,"\r\n")}})).get()}});var Le=/%20/g,je=/#.*$/,De=/([?&])_=[^&]*/,Ne=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ie=/^(?:GET|HEAD)$/,Me=/^\/\//,Oe={},Pe={},Re="*/".concat("*"),Be=g.createElement("a");function qe(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(M)||[];if(h(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function He(t,e,n,r){var i={},o=t===Pe;function a(u){var s;return i[u]=!0,b.each(t[u]||[],(function(t,u){var l=u(e,n,r);return"string"!=typeof l||o||i[l]?o?!(s=l):void 0:(e.dataTypes.unshift(l),a(l),!1)})),s}return a(e.dataTypes[0])||!i["*"]&&a("*")}function We(t,e){var n,r,i=b.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&b.extend(!0,t,r),t}Be.href=we.href,b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:we.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(we.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Re,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":JSON.parse,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?We(We(t,b.ajaxSettings),e):We(b.ajaxSettings,t)},ajaxPrefilter:qe(Oe),ajaxTransport:qe(Pe),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,o,a,u,s,l,c,f,d,p=b.ajaxSetup({},n),h=p.context||p,v=p.context&&(h.nodeType||h.jquery)?b(h):b.event,m=b.Deferred(),y=b.Callbacks("once memory"),_=p.statusCode||{},w={},x={},T="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(l){if(!a)for(a={};e=Ne.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)k.always(t[k.status]);else for(e in t)_[e]=[_[e],t[e]];return this},abort:function(t){var e=t||T;return r&&r.abort(e),S(0,e),this}};if(m.promise(k),p.url=((e||p.url||we.href)+"").replace(Me,we.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(M)||[""],null==p.crossDomain){s=g.createElement("a");try{s.href=p.url,s.href=s.href,p.crossDomain=Be.protocol+"//"+Be.host!=s.protocol+"//"+s.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),He(Oe,p,n,k),l)return k;for(f in(c=b.event&&p.global)&&0==b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ie.test(p.type),i=p.url.replace(je,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Le,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Te.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(De,"$1"),d=(Te.test(i)?"&":"?")+"_="+xe.guid+++d),p.url=i+d),p.ifModified&&(b.lastModified[i]&&k.setRequestHeader("If-Modified-Since",b.lastModified[i]),b.etag[i]&&k.setRequestHeader("If-None-Match",b.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Re+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,k,p)||l))return k.abort();if(T="abort",y.add(p.complete),k.done(p.success),k.fail(p.error),r=He(Pe,p,n,k)){if(k.readyState=1,c&&v.trigger("ajaxSend",[k,p]),l)return k;p.async&&p.timeout>0&&(u=t.setTimeout((function(){k.abort("timeout")}),p.timeout));try{l=!1,r.send(w,S)}catch(t){if(l)throw t;S(-1,t)}}else S(-1,"No Transport");function S(e,n,a,s){var f,d,g,w,x,T=n;l||(l=!0,u&&t.clearTimeout(u),r=void 0,o=s||"",k.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(w=function(t,e,n){for(var r,i,o,a,u=t.contents,s=t.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){s.unshift(i);break}if(s[0]in n)o=s[0];else{for(i in n){if(!s[0]||t.converters[i+" "+s[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==s[0]&&s.unshift(o),n[o]}(p,k,a)),!f&&b.inArray("script",p.dataTypes)>-1&&(p.converters["text script"]=function(){}),w=function(t,e,n,r){var i,o,a,u,s,l={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=o,o=c.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(!(a=l[s+" "+o]||l["* "+o]))for(i in l)if((u=i.split(" "))[1]===o&&(a=l[s+" "+u[0]]||l["* "+u[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=u[0],c.unshift(u[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+s+" to "+o}}}return{state:"success",data:e}}(p,w,k,f),f?(p.ifModified&&((x=k.getResponseHeader("Last-Modified"))&&(b.lastModified[i]=x),(x=k.getResponseHeader("etag"))&&(b.etag[i]=x)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=w.state,d=w.data,f=!(g=w.error))):(g=T,!e&&T||(T="error",e<0&&(e=0))),k.status=e,k.statusText=(n||T)+"",f?m.resolveWith(h,[d,T,k]):m.rejectWith(h,[k,T,g]),k.statusCode(_),_=void 0,c&&v.trigger(f?"ajaxSuccess":"ajaxError",[k,p,f?d:g]),y.fireWith(h,[k,T]),c&&(v.trigger("ajaxComplete",[k,p]),--b.active||b.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return b.get(t,e,n,"json")},getScript:function(t,e){return b.get(t,void 0,e,"script")}}),b.each(["get","post"],(function(t,e){b[e]=function(t,n,r,i){return h(n)&&(i=i||r,r=n,n=void 0),b.ajax(b.extend({url:t,type:e,dataType:i,data:n,success:r},b.isPlainObject(t)&&t))}})),b.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),b._evalUrl=function(t,e,n){return b.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){b.globalEval(t,e,n)}})},b.fn.extend({wrapAll:function(t){var e;return this[0]&&(h(t)&&(t=t.call(this[0])),e=b(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return h(t)?this.each((function(e){b(this).wrapInner(t.call(this,e))})):this.each((function(){var e=b(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=h(t);return this.each((function(n){b(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){b(this).replaceWith(this.childNodes)})),this}}),b.expr.pseudos.hidden=function(t){return!b.expr.pseudos.visible(t)},b.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},b.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var $e={0:200,1223:204},ze=b.ajaxSettings.xhr();p.cors=!!ze&&"withCredentials"in ze,p.ajax=ze=!!ze,b.ajaxTransport((function(e){var n,r;if(p.cors||ze&&!e.crossDomain)return{send:function(i,o){var a,u=e.xhr();if(u.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)u[a]=e.xhrFields[a];for(a in e.mimeType&&u.overrideMimeType&&u.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)u.setRequestHeader(a,i[a]);n=function(t){return function(){n&&(n=r=u.onload=u.onerror=u.onabort=u.ontimeout=u.onreadystatechange=null,"abort"===t?u.abort():"error"===t?"number"!=typeof u.status?o(0,"error"):o(u.status,u.statusText):o($e[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=n(),r=u.onerror=u.ontimeout=n("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&t.setTimeout((function(){n&&r()}))},n=n("abort");try{u.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}})),b.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return b.globalEval(t),t}}}),b.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),b.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=b("