0
0
Fork 0
top-lists/js/app-legacy.1dc7f1d6.js
Oliver-Akins 74f3d069ce deploy
2021-04-02 21:24:06 -06:00

2 lines
No EOL
42 KiB
JavaScript

(function(t){function e(e){for(var a,o,s=e[0],c=e[1],l=e[2],d=0,p=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(i,o)&&i[o]&&p.push(i[o][0]),i[o]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);u&&u(e);while(p.length)p.shift()();return r.push.apply(r,l||[]),n()}function n(){for(var t,e=0;e<r.length;e++){for(var n=r[e],a=!0,s=1;s<n.length;s++){var c=n[s];0!==i[c]&&(a=!1)}a&&(r.splice(e--,1),t=o(o.s=n[0]))}return t}var a={},i={app:0},r=[];function o(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=a,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/top-lists/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var u=c;r.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"034f":function(t,e,n){"use strict";n("d1bb")},"0e80":function(t,e,n){"use strict";n("44db")},"1ade":function(t,e,n){var a=n("b236").default;n("f262"),n("02f7"),n("61c4"),n("0c2a"),n("709c"),String.prototype.toTitleCase=function(){var t,e=this.split(" "),n=[],i=a(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.push("".concat(r[0].toUpperCase()).concat(r.slice(1).toLowerCase()))}}catch(o){i.e(o)}finally{i.f()}return n.join(" ")}},"1cdb":function(t,e,n){},2668:function(t,e,n){},2669:function(t,e,n){"use strict";n("efd2")},"3b8cf":function(t,e,n){"use strict";n("e0e2")},"40e8":function(t,e,n){},"44db":function(t,e,n){},"47e8":function(t,e,n){"use strict";n("8e33")},"55ff":function(t,e,n){},"56d7":function(t,e,n){"use strict";n.r(e);n("1939"),n("0099"),n("f787"),n("ea59"),n("0c2a");var a=n("56ba"),i=n("b1ae"),r=n("916c"),o=n("220c"),s=n("b038"),c=n.n(s),l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"maximize_size"},[t.is_authed?n("MainView",{attrs:{preview_mode:t.is_preview,dev_mode:t.is_dev}}):n("LoginCard"),t.show_theme_modal?n("Themes",{on:{close:function(e){t.show_theme_modal=!1}}}):t._e(),t.show_site_info?n("SiteInfo",{on:{close:function(e){t.show_site_info=!1}}}):t._e(),n("div",{attrs:{id:"info-button"}},[n("button",{on:{click:function(e){e.stopPropagation(),t.show_site_info=!0}}},[n("Icon",{attrs:{type:"info",size:35,"inner-size":35,primary:"--button-text"}})],1)]),n("div",{attrs:{id:"theme-button"}},[n("button",{on:{click:function(e){e.stopPropagation(),t.show_theme_modal=!0}}},[n("Icon",{attrs:{type:"palette",size:35,"inner-size":35,primary:"--button-text"}})],1)])],1)},u=[],d=(n("5a00"),n("11d1"),n("7613"),n("7246"),n("709c"),n("fbd0"),n("02f7"),n("1ade"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{staticClass:"center"},[t._v("Available Themes")]),t._l(t.available_themes,(function(e){return n("div",{key:e.filename,staticClass:"theme-card",on:{click:function(n){n.stopPropagation(),t.chosen_theme=e.filename}}},[n("h3",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.chosen_theme,expression:"chosen_theme"}],attrs:{id:"select_theme"+e.filename,type:"radio"},domProps:{value:e.filename,checked:t._q(t.chosen_theme,e.filename)},on:{change:function(n){t.chosen_theme=e.filename}}}),n("label",{attrs:{for:"select_theme"+e.filename}},[t._v(t._s(e.name))])]),n("p",[t._v(" "+t._s(e.description)+" ")])])}))],2):t._e()])],1):t._e()])}),p=[],h=n("c6b6"),f={name:"ThemesListModal",data:function(){return{container:!1,content:!1,chosen_theme:"dark",default_theme:"dark",style_id:"colour-transition",themes:[{name:"Dark",filename:"dark",description:"The default theme of the website, this uses darker background colours with lighter coloured accents.",show:function(){return!0}},{name:"Light",filename:"light",description:"A light theme for the website, this uses lighter background colours with darker accent colours.",show:function(){return!0}},{name:"Halloween",filename:"halloween",description:"This elusive theme only shows up around Halloween, make sure to use it while you can!",show:function(){var t=new Date;return 9==t.getMonth()}},{name:"High Contrast (Dark)",filename:"dark-high-contrast",description:"This theme is designed to be as high contrast as possible for those who need it.",show:function(){return!0}}]}},mounted:function(){this.chosen_theme=localStorage.getItem("tl-theme")||this.default_theme;var t=document.createElement("style");t.id=this.style_id,t.innerText="/* Transition colours for theme changes */\n\t\t* {\n\t\t\ttransition: color .5s;\n\t\t\ttransition: background-color .5s;\n\t\t}",document.body.appendChild(t),this.$nextTick((function(){this.container=!0}))},computed:{available_themes:function(){var t,e=[],n=Object(h["a"])(this.themes);try{for(n.s();!(t=n.n()).done;){var a=t.value;a.show()&&e.push(a)}}catch(i){n.e(i)}finally{n.f()}return e}},watch:{chosen_theme:function(t){localStorage.setItem("tl-theme",t),document.getElementById("theme").href="static/css/theme/".concat(t,".css")}},beforeDestroy:function(){document.body.removeChild(document.getElementById(this.style_id))}},_=f,m=(n("47e8"),n("3583")),v=Object(m["a"])(_,d,p,!1,null,"2dad7c10",null),y=v.exports,g=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{staticClass:"center"},[t._v("Why Does This Exist?")]),n("p",[t._v(" This exists because "),n("a",{attrs:{href:"https://github.com/Oliver-Akins",target:"_blank",rel:"noopener"}},[t._v("Oliver")]),t._v(" wanted some way to be able to see his top songs in durations different than what Spotify distributes on their own (yearly), so he created this website. ")]),n("hr"),n("h2",[t._v("Source Code?")]),n("p",[t._v(" Top Lists is completely open source! You can audit the code at "),n("a",{attrs:{href:"http://github.com/Oliver-Akins/top-lists",target:"_blank",rel:"noopener"}},[t._v(" github.com/Oliver-Akins/top-lists ")])])]):t._e()])],1):t._e()])},C=[],b={name:"SiteInfoModal",data:function(){return{container:!1,content:!1}},mounted:function(){this.$nextTick((function(){this.container=!0}))}},w=b,k=(n("fcb4"),Object(m["a"])(w,g,C,!1,null,"6fd61e25",null)),x=k.exports,S=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"maximize_size",attrs:{id:"login_screen"}},[n("div",{staticClass:"card"},[t.error?n("div",{staticClass:"alert error"},[t._v(" "+t._s(t.error)+" ")]):t._e(),n("a",{attrs:{href:t.spotify_auth_url}},[n("button",[t._v("Login With Spotify")])]),n("p",{staticClass:"alert"},[t._v(" This website will be able to see your top artists and tracks, and make both public and private playlists on your behalf. This is all done in your web browser. ")])])])},T=[],z=(n("61c4"),n("fab8"),{name:"LoginView",data:function(){return{auth_base:"https://accounts.spotify.com/authorize",use_state:!0,client_id:"3a1795e9d55445b0aa0c05dd74c866fb",scopes:["user-top-read","playlist-modify-public","playlist-modify-private","playlist-modify-public","playlist-modify-private"],show_dialog:!1}},computed:{spotify_auth_url:function(){var t=["client_id=".concat(this.client_id),"response_type=token","redirect_uri=".concat(encodeURIComponent(this.auth_redirect)),"scope=".concat(encodeURIComponent(this.scopes.join(" "))),"show_dialog=".concat(this.show_dialog)];if(this.use_state){var e=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);t.push("state=".concat(e)),sessionStorage.setItem(this.storage_key.state,e)}return"".concat(this.auth_base,"?").concat(t.join("&"))},error:function(){var t=new URLSearchParams(window.location.search.slice(1)).get("error");return t||""}}}),P=z,M=(n("6356"),Object(m["a"])(P,S,T,!1,null,"9a0578f6",null)),L=M.exports,O=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"main_screen"}},[n("Control",{attrs:{dev:t.dev_mode,preview:t.preview_mode,auth_redirect:t.auth_redirect,data_exists:0!==t.data.length,is_track_data:"Tracks"===t.config.type},on:{playlist_export:function(e){t.playlist_export_modal=!0},user_id:function(e){t.user_id=e},data_request:t.get_data}}),t.error?n("div",{staticClass:"error"},[t._v(t._s(t.error))]):n("div",{attrs:{id:"data_view"}},t._l(t.items,(function(e){return n(t.config.type.slice(0,-1),{key:e.uri,tag:"component",attrs:{item:e}})})),1),t.playlist_export_modal?n("PlaylistExport",{attrs:{data:t.data,config:t.config,user_id:t.user_id},on:{close:function(e){t.playlist_export_modal=!1}}}):t._e()],1)},j=[],$=(n("9e81"),n("2fb5"),n("3e23")),I=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"control"}},[t.username?n("div",{attrs:{id:"user_data"}},[t.user.image?n("img",{staticClass:"profile_image",attrs:{src:t.user.image,alt:t.user.name+"'s profile picture",width:t.img_size,height:t.img_size}}):n("icon",{attrs:{type:"notes",size:t.img_size,border:Math.floor(t.img_size/2),primary:t.css_var("--missing-picture-foreground"),background:t.css_var("--missing-picture-background")}}),t._v(" "+t._s(t.username)+" ")],1):t._e(),n("div",{attrs:{id:"type"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.type,expression:"type"}],on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.type=e.target.multiple?n:n[0]},function(e){return t.verify_request_amount()}]}},[n("option",{attrs:{value:"",disabled:""}},[t._v("Select a Type")]),n("option",[t._v("Tracks")]),n("option",[t._v("Artists")])])]),n("div",{attrs:{id:"duration"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.duration,expression:"duration"}],on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.duration=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"",disabled:""}},[t._v("Select a Duration")]),n("option",{attrs:{value:"short_term"}},[t._v("~4 Weeks")]),n("option",{attrs:{value:"medium_term"}},[t._v("~6 Months")]),n("option",{attrs:{value:"long_term"}},[t._v("Several Years")])])]),n("div",{attrs:{id:"amount"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],attrs:{type:"number",min:"1",max:"50",placeholder:"How many?"},domProps:{value:t.amount},on:{input:[function(e){e.target.composing||(t.amount=e.target.value)},function(e){return t.verify_request_amount()}]}})]),t.type&&t.duration&&!t.error?n("div",{attrs:{id:"data_button"}},[n("button",{on:{click:function(e){return e.target!==e.currentTarget?null:t.data_request()}}},[t._v(" "+t._s(t.button_text)+" ")])]):t._e(),t.data_exists&&t.is_track_data?n("div",{attrs:{id:"playlist_button"}},[n("button",{on:{click:function(e){return e.target!==e.currentTarget?null:t.event("playlist_export")}}},[t._v(" Export Playlist ")])]):t._e(),t.error?n("div",{attrs:{id:"error"}},[t._v(" "+t._s(t.error)+" ")]):t._e()])},q=[],A=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:t.div_styles,attrs:{id:"icon"}},["notes"===t.type?n("span",{style:t.span_styles},[n("svg",{attrs:{width:t.innerSize,height:t.innerSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("rect",{attrs:{width:t.innerSize,height:t.innerSize,fill:"none",rx:"0",ry:"0"}}),n("path",{staticClass:"primary",style:t.primary_styles,attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.4911 2.11667L21.4511 4.09667C21.9411 4.34667 22.1411 4.93667 21.8911 5.43667C21.6411 5.93667 21.0411 6.13667 20.5511 5.88667L18.0011 4.61667L17.9911 16.4367C17.9911 16.4467 17.9936 16.4567 17.9961 16.4667C17.9986 16.4767 18.0011 16.4867 18.0011 16.4967C18.0011 18.4267 16.4311 19.9967 14.5011 19.9967C12.5711 19.9967 11.0011 18.4267 11.0011 16.4967C11.0011 14.5667 12.5711 12.9967 14.5011 12.9967C15.0411 12.9967 15.5411 13.1267 16.0011 13.3467L16.0111 3.10667C15.9911 2.99667 16.0011 2.87667 16.0311 2.75667C16.1711 2.14667 16.9411 1.80667 17.4911 2.11667ZM12.8911 5.43664C12.6511 5.93664 12.0511 6.13664 11.5511 5.88664L9.0011 4.61664L8.9911 18.4366C8.9911 18.4466 8.9936 18.4566 8.9961 18.4666C8.9986 18.4766 9.0011 18.4866 9.0011 18.4966C9.0011 20.4266 7.4311 21.9966 5.5011 21.9966C3.5711 21.9966 2.0011 20.4266 2.0011 18.4966C2.0011 16.5666 3.5711 14.9966 5.5011 14.9966C6.0411 14.9966 6.5411 15.1266 7.0011 15.3466L7.0111 3.10664C6.9911 2.99664 7.0011 2.87664 7.0311 2.76664C7.1711 2.14664 7.9411 1.81664 8.4911 2.12664L12.4411 4.09664C12.9411 4.34664 13.1411 4.94664 12.8911 5.43664Z"}})])]):"note_filled"===t.type?n("span",{style:t.span_styles},[n("svg",{attrs:{width:t.innerSize,height:t.innerSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("rect",{attrs:{width:t.innerSize,height:t.innerSize,fill:"none",rx:"0",ry:"0"}}),n("path",{staticClass:"primary",style:t.primary_styles,attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM12.6192 6.20784L15.2201 7.68004C15.5101 7.84004 15.6101 8.21004 15.4401 8.50004C15.3301 8.69004 15.1301 8.80005 14.9201 8.80005C14.8201 8.80005 14.7201 8.77004 14.6301 8.72004L12.8699 7.72372V15.6585C12.8701 15.6723 12.8701 15.6861 12.87 15.7C12.87 16.91 11.88 17.9 10.67 17.9C9.45997 17.9 8.46997 16.91 8.46997 15.7C8.46997 14.49 9.45997 13.5 10.67 13.5C11.0299 13.5 11.3698 13.5862 11.6699 13.7387V6.69998C11.6699 6.60119 11.6941 6.50777 11.7369 6.42537C11.7411 6.41687 11.7455 6.40842 11.7501 6.40004C11.7561 6.39019 11.7623 6.38054 11.7687 6.37111C11.8639 6.22688 12.0195 6.12563 12.1988 6.1042C12.2802 6.09357 12.3641 6.09981 12.4457 6.12505C12.5086 6.14354 12.5671 6.17174 12.6192 6.20784Z"}})])]):"palette"===t.type?n("span",{style:t.span_styles},[n("svg",{attrs:{width:t.innerSize,height:t.innerSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("rect",{attrs:{width:t.innerSize,height:t.innerSize,fill:"none",rx:"0",ry:"0"}}),n("path",{staticClass:"primary",style:t.primary_styles,attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.2516 20.3664C12.173 20.3884 12.0894 20.4 12 20.4C11.9227 20.4 11.8455 20.3993 11.7686 20.3978C11.7126 20.3993 11.6564 20.4 11.6 20.4C11.2372 20.4 10.8834 20.3691 10.5425 20.3104C5.7105 19.7107 2 16.1737 2 11.9C2 7.2056 6.47715 3.40002 12 3.40002C15.7082 3.40002 18.945 5.11567 20.6717 7.66406C20.6905 7.69181 20.7029 7.72492 20.7093 7.76311C21.2826 8.51263 21.5525 9.44282 21.3862 10.386C21.1499 11.7265 20.0945 12.7409 18.7432 13.1075C18.6959 13.1025 18.6482 13.1 18.6001 13.1C18.3889 13.1 18.1853 13.1491 17.9942 13.2401L17.9745 13.2418L17.9718 13.251C17.175 13.6461 16.6001 14.7723 16.6001 16.1V16.1001C16.6001 16.1342 16.6001 16.1683 16.6009 16.2021L16.5988 16.3132L16.5992 16.3295L16.5986 16.3764L16.5999 16.3784L16.6 16.4C16.6 18.4325 14.7051 20.1109 12.2516 20.3664ZM12.0566 19.1638C11.9755 19.1925 11.8879 19.2078 11.7928 19.2078C7.0471 19.2078 3.19995 15.9378 3.19995 11.9039C3.19995 7.87006 7.0471 4.59998 11.7928 4.59998C14.882 4.59998 17.8404 5.876 19.3701 7.94922C20.0399 8.54236 20.3957 9.32338 20.2583 10.103C20.0591 11.2322 19.4734 11.9526 18.2539 12.0036C17.5102 11.955 16.5185 12.6539 15.9177 13.9423C15.752 14.2978 15.6278 14.6532 15.5447 14.9934C15.5431 15.0019 15.5412 15.0106 15.539 15.0195C15.439 15.4289 15.4192 15.7734 15.4218 15.8945L15.419 15.8969C15.4158 16.046 15.4228 16.1878 15.44 16.3202C15.3393 17.8505 13.8796 19.0768 12.0566 19.1638ZM13.5 7C13.5 7.82843 12.8284 8.5 12 8.5C11.1715 8.5 10.5 7.82843 10.5 7C10.5 6.17157 11.1715 5.5 12 5.5C12.8284 5.5 13.5 6.17157 13.5 7ZM8.99995 8.5C8.99995 9.32843 8.32838 10 7.49995 10C6.67152 10 5.99995 9.32843 5.99995 8.5C5.99995 7.67157 6.67152 7 7.49995 7C8.32838 7 8.99995 7.67157 8.99995 8.5ZM11.5 18C12.8807 18 14 17.1046 14 16C14 14.8954 12.8807 14 11.5 14C10.1192 14 8.99995 14.8954 8.99995 16C8.99995 17.1046 10.1192 18 11.5 18ZM11.5 16.8C12.2179 16.8 12.8 16.4418 12.8 16C12.8 15.5582 12.2179 15.2 11.5 15.2C10.782 15.2 10.2 15.5582 10.2 16C10.2 16.4418 10.782 16.8 11.5 16.8ZM16.5 10C17.3284 10 18 9.32843 18 8.5C18 7.67157 17.3284 7 16.5 7C15.6715 7 15 7.67157 15 8.5C15 9.32843 15.6715 10 16.5 10ZM5.69995 14C6.52838 14 7.19995 13.3284 7.19995 12.5C7.19995 11.6716 6.52838 11 5.69995 11C4.87152 11 4.19995 11.6716 4.19995 12.5C4.19995 13.3284 4.87152 14 5.69995 14Z"}})])]):"info"===t.type?n("span",{style:t.span_styles},[n("svg",{attrs:{width:t.innerSize,height:t.innerSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("rect",{attrs:{width:t.innerSize,height:t.innerSize,fill:"none",rx:"0",ry:"0"}}),n("path",{staticClass:"primary",style:t.primary_styles,attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.49 6.49 2 12 2C17.51 2 22 6.49 22 12C22 17.51 17.51 22 12 22C6.49 22 2 17.51 2 12ZM4 12C4 16.41 7.59 20 12 20C16.41 20 20 16.41 20 12C20 7.59 16.41 4 12 4C7.59 4 4 7.59 4 12ZM12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9ZM12 10C11.45 10 11 10.45 11 11V16C11 16.55 11.45 17 12 17C12.55 17 13 16.55 13 16V11C13 10.45 12.55 10 12 10Z"}})])]):t._e(),"share"===t.type?n("span",{style:t.span_styles},[n("svg",{attrs:{width:t.innerSize,height:t.innerSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("rect",{attrs:{width:t.innerSize,height:t.innerSize,fill:"none",rx:"0",ry:"0"}}),n("path",{staticClass:"primary",style:t.primary_styles,attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 10C19.2091 10 21 8.20914 21 6C21 3.79086 19.2091 2 17 2C14.7909 2 13 3.79086 13 6C13 6.44376 13.0723 6.87064 13.2057 7.26952L9.90706 9.25245C9.17789 8.48121 8.14514 8 7 8C4.79086 8 3 9.79086 3 12C3 14.2091 4.79086 16 7 16C8.14608 16 9.17958 15.518 9.90885 14.7457L13.2074 16.7252C13.0729 17.1256 13 17.5543 13 18C13 20.2091 14.7909 22 17 22C19.2091 22 21 20.2091 21 18C21 15.7909 19.2091 14 17 14C15.8535 14 14.8197 14.4823 14.0904 15.2551L10.7922 13.2758C10.927 12.8751 11 12.4461 11 12C11 11.5527 10.9266 11.1226 10.7911 10.721L14.0861 8.74027C14.8156 9.51576 15.8513 10 17 10ZM19.8 18C19.8 19.5464 18.5464 20.8 17 20.8C15.4536 20.8 14.2 19.5464 14.2 18C14.2 16.4536 15.4536 15.2 17 15.2C18.5464 15.2 19.8 16.4536 19.8 18ZM19.8 6C19.8 7.5464 18.5464 8.8 17 8.8C15.4536 8.8 14.2 7.5464 14.2 6C14.2 4.4536 15.4536 3.2 17 3.2C18.5464 3.2 19.8 4.4536 19.8 6ZM9.8 12C9.8 13.5464 8.5464 14.8 7 14.8C5.4536 14.8 4.2 13.5464 4.2 12C4.2 10.4536 5.4536 9.2 7 9.2C8.5464 9.2 9.8 10.4536 9.8 12Z"}})])]):t._e()])},E=[],D=(n("d17b"),{name:"Icon",props:{type:{type:String,required:!0},primary:{type:String,default:"--icon-primary",required:!1},secondary:{type:String,default:"--icon-secondary",required:!1},size:{type:Number,default:25,required:!1},innerSize:{type:Number,default:null,required:!1},background:{type:String,default:null,required:!1},border:{type:Number,default:0,required:!1}},data:function(){return{div_styles:{"background-color":this.background?"var(".concat(this.background,")"):null,"border-radius":"".concat(this.border,"px"),width:"".concat(this.size,"px"),height:"".concat(this.size,"px")}}},computed:{span_styles:function(){if(this.innerSize)return{width:"".concat(this.innerSize,"px"),height:"".concat(this.innerSize,"px")};var t=Math.floor(.6*this.size);return{width:"".concat(t,"px"),height:"".concat(t,"px")}},primary_styles:function(){return{fill:"var(".concat(this.primary,")")}},secondary_styles:function(){return{fill:"var(".concat(this.secondary,")")}}}}),B=D,Z=(n("b3c6"),Object(m["a"])(B,A,E,!1,null,null,null)),N=Z.exports,V={name:"ControlBar",props:{data_exists:{type:Boolean,required:!0},is_track_data:{type:Boolean,required:!1,default:!1},dev:{type:Boolean,required:!0},preview:{type:Boolean,required:!0}},components:{icon:N},data:function(){return{img_size:50,error:"",user:{name:"",image:""},type:"",duration:"",amount:""}},computed:{username:function(){return this.user.name?this.user.name:this.dev?"Developer Mode":this.preview?"Preview Mode":""},button_text:function(){var t="Get Top";switch(this.amount){case"":return"".concat(t," 10 ").concat(this.type);case"1":return"".concat(t," ").concat(this.type.slice(0,-1));default:return"".concat(t," ").concat(this.amount," ").concat(this.type)}}},methods:{event:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.$emit(t,e)},verify_request_amount:function(){var t;try{t=parseInt(this.amount)}catch(e){return void(this.error=e)}return t>50?void(this.error="Cannot request more than 50 ".concat(this.type.toLowerCase())):t<1?void(this.error="Cannot get 0 or fewer ".concat(this.type.toLowerCase())):(this.error="",t)},data_request:function(){this.event("data_request",{type:this.type,limit:this.amount||"10",duration:this.duration})}},mounted:function(){this.$nextTick((function(){var t=this;this.preview||this.dev||$["get"]("".concat(this.api_url,"/me"),{headers:{Authorization:"Bearer ".concat(this.api_token)}}).then((function(e){if(e.error&&!t.preview&&!t.dev)return window.location.hash="",void(window.location.href="".concat(t.auth_redirect,"?error=").concat(encodeURI(e.error)));var n=e.data;t.user.name=n.display_name||n.id,t.user.image=n.images.length>0?n.images[0].url:"",t.$emit("user_id",n.id)})).catch((function(e){if(401==e.response.status)return t.auth_expired(e);console.error(e)}))}))}},R=V,U=(n("954ab"),Object(m["a"])(R,I,q,!1,null,null,null)),F=U.exports,J=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"image"},[0!==t.item.images.length?n("img",{attrs:{src:t.item.images[0].url,alt:t.item.name+" profile image"}}):n("icon",{attrs:{type:"notes",size:230,border:115,primary:"--missing-picture-foreground",background:"--missing-picture-background"}})],1),n("div",{staticClass:"artist-info"},[n("div",{staticClass:"title"},[t._v(t._s(t.item.name))]),n("div",{staticClass:"subtitle"},[t._v(t._s(t.genres))])]),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.popularity_tooltip,expression:"popularity_tooltip",modifiers:{auto:!0}}],staticClass:"popularity corner",on:{click:function(e){if(e.target!==e.currentTarget)return null;t.show_pop_modal=!0}}},[t._v(" "+t._s(t.item.popularity)+" ")]),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.followers_tooltip,expression:"followers_tooltip",modifiers:{auto:!0}}],staticClass:"followers corner"},[t._v(" "+t._s(t.item.followers.total.toLocaleString())+" ")]),t.show_pop_modal?n("PopularityModal",{on:{close:function(e){t.show_pop_modal=!1}}}):t._e()],1)},H=[],W=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{staticClass:"center"},[t._v("How is Popularity Calculated?")]),n("p",{staticClass:"center"},[t._v(" Popularity is a value between 0 and 100 that is calculated by Spotify based on how many plays the song/artist has recieved and how recent those plays are. ")]),n("p",{staticClass:"center"},[t._v(" This means that an artist/song that has had 100 plays today will have a higher popularity than a song/artist that has 100 from a month ago. ")]),n("p",{staticClass:"center"},[t._v(" This number is not updated in real time so refreshing the page will not reflect it's absolute accurate value. ")])]):t._e()])],1):t._e()])},Y=[],G={name:"PopularityModal",data:function(){return{container:!1,content:!1}},mounted:function(){this.$nextTick((function(){this.container=!0}))}},K=G,Q=(n("2669"),Object(m["a"])(K,W,Y,!1,null,"2b9217cf",null)),X=Q.exports,tt={name:"ArtistCard",components:{PopularityModal:X,icon:N},props:{item:{type:Object,required:!0}},data:function(){return{followers_tooltip:"Total Followers",popularity_tooltip:"Artist Popularity",show_pop_modal:!1}},computed:{genres:function(){var t,e=[],n=Object(h["a"])(this.item.genres);try{for(n.s();!(t=n.n()).done;){var a=t.value;e.push(a.toTitleCase())}}catch(i){n.e(i)}finally{n.f()}return e.join(", ")}},methods:{}},et=tt,nt=(n("b388"),Object(m["a"])(et,J,H,!1,null,"72cafcf5",null)),at=nt.exports,it=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"image"},[0!==t.item.album.images.length?n("img",{attrs:{src:t.item.album.images[0].url,alt:t.item.album.name+" cover art"}}):n("icon",{attrs:{type:"notes",size:200,border:100,primary:"--missing-picture-foreground",background:"--missing-picture-background"}})],1),n("div",{staticClass:"track-info"},[n("div",{staticClass:"title"},[t._v(t._s(t.item.name))]),n("div",{staticClass:"subtitle"},[t._v(" "+t._s(t.item.artists.map((function(t){return t.name})).join(", "))+" ")])]),n("div",{staticClass:"bottom-bar"},[n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.popularity_tooltip,expression:"popularity_tooltip"}],staticClass:"popularity",on:{click:function(e){t.show_pop_modal=!0}}},[t._v(" "+t._s(t.item.popularity)+" ")]),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.share_tooltip,expression:"share_tooltip"}],staticClass:"share",attrs:{name:"Share"},on:{click:function(e){t.show_share_modal=!0}}},[n("icon",{attrs:{type:"share",size:22,"inner-size":22,primary:"--card-bottom-row-icon-colour"}})],1),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.info_tooltip,expression:"info_tooltip"}],staticClass:"information",attrs:{name:"Track Information"},on:{click:function(e){t.show_track_info=!0}}},[n("icon",{attrs:{type:"info",size:22,"inner-size":22,primary:"--card-bottom-row-icon-colour"}})],1),n("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.duration_tooltip,expression:"duration_tooltip"}],staticClass:"duration"},[t._v(" "+t._s(t.duration)+" ")])]),t.show_pop_modal?n("PopularityModal",{on:{close:function(e){t.show_pop_modal=!1}}}):t._e(),t.show_track_info?n("TrackInfo",{attrs:{track:t.item},on:{close:function(e){t.show_track_info=!1}}}):t._e(),t.show_share_modal?n("Sharing",{attrs:{track:t.item},on:{close:function(e){t.show_share_modal=!1}}}):t._e()],1)},rt=[],ot=(n("945d"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{staticClass:"center"},[t._v("Track Sharing")]),n("div",{staticClass:"share-buttons"},[n("button",{on:{click:function(e){return t.copy_text(t.track.external_urls.spotify)}}},[t._v(" Copy Track Link ")]),n("button",{on:{click:function(e){return t.copy_text(t.track.album.external_urls.spotify)}}},[t._v(" Copy Album Link ")]),t._l(t.track.artists,(function(e){return n("button",{key:e.uri,on:{click:function(n){return t.copy_text(e.external_urls.spotify)}}},[t._v(" Copy "+t._s(e.name)+"'s Link ")])}))],2)]):t._e()])],1):t._e()])}),st=[],ct={name:"ShareTrack",props:{track:{type:Object,required:!0}},data:function(){return{content:!1,container:!1}},computed:{},mounted:function(){this.$nextTick((function(){this.container=!0}))}},lt=ct,ut=(n("a516"),Object(m["a"])(lt,ot,st,!1,null,"34520383",null)),dt=ut.exports,pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{on:{click:function(e){if(e.target!==e.currentTarget)return null;t.show_all_feature_info=!0}}},[t._v(' "'+t._s(t.track.name)+'" Information '),n("div",{staticClass:"release-date"},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.release_date_tooltip,expression:"release_date_tooltip"}]},[t._v(" "+t._s(t.track.album.release_date.replace(/-/g,"/"))+" ")])])]),n("div",{staticClass:"audio-features-container"},t._l(t.data_wanted,(function(e){return n("div",{key:e,staticClass:"audio-feature",attrs:{id:e+"-container"}},[n("percent",{attrs:{size:40,progress:t.get_percentage(e),color:t.css_var("--percent-filled"),"empty-color":t.css_var("--percent-empty"),loading:!t.data_populated,"font-color":t.css_var("--percent-text"),half:!0}}),t._v(" "+t._s(e.toTitleCase())+" ")],1)})),0)]):t._e()])],1):t._e()])},ht=[],ft=(n("f262"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},["all"===t.feature?n("h2",[t._v("Audio Features Information")]):n("h2",[t._v(t._s(t.feature.toTitleCase())+" Information")]),t.is_feature("acousticness")?n("div",["all"===t.feature?n("h3",[t._v("Acousticness")]):t._e(),n("p",[t._v(" This is the confidence that the track is acoustic or not, 100 means that Spotify feels strongly that this track is acoustic. ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("danceability")?n("div",["all"===t.feature?n("h3",[t._v("Danceability")]):t._e(),n("p",[t._v(" A value of 0.0 is least danceable and 1.0 is most danceable. The danceability of a track is an indication of how well a track can be danced to. A value closer to 0 is least danceable, and 100 is most danceable. This is based on a combination of multiple factors including: ")]),n("ul",[n("li",[t._v("Tempo")]),n("li",[t._v("Rhythm stability")]),n("li",[t._v("Beat strength")])])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("energy")?n("div",["all"===t.feature?n("h3",[t._v("Energy")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("instrumentalness")?n("div",["all"===t.feature?n("h3",[t._v("Instrumentalness")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("liveness")?n("div",["all"===t.feature?n("h3",[t._v("Liveness")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("loudness")?n("div",["all"===t.feature?n("h3",[t._v("Loudness")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("speechiness")?n("div",["all"===t.feature?n("h3",[t._v("Speechiness")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("valence")?n("div",["all"===t.feature?n("h3",[t._v("Valence")]):t._e(),n("p",[t._v(" Description ")])]):t._e(),"all"===t.feature?n("div",{staticClass:"separator"}):t._e(),t.is_feature("Popularity")?n("div",["all"===t.feature?n("h3",[t._v("Popularity")]):t._e(),n("p",[t._v(" Description ")])]):t._e()]):t._e()])],1):t._e()])}),_t=[],mt={name:"TrackFeaturesInformation",props:{feature:{type:String,required:!1,default:"all"}},created:function(){},data:function(){return{content:!1,container:!1}},mounted:function(){this.$nextTick((function(){this.container=!0}))},methods:{is_feature:function(t){return"all"===this.feature||t===this.feature}}},vt=mt,yt=(n("f02d"),Object(m["a"])(vt,ft,_t,!1,null,"2a510fa0",null)),gt=(yt.exports,{name:"DetailedTrackInfo",components:{},props:{track:{type:Object,required:!0}},data:function(){return{container:!1,content:!1,show_feature_info:!1,show_all_feature_info:!1,data_populated:!1,data_points:{},data_wanted:["acousticness","danceability","energy","instrumentalness","liveness","loudness","speechiness","valence","popularity"],months:{"01":"January","02":"Febuary","03":"March","04":"April","05":"May","06":"June","07":"July","08":"August","09":"September",10:"October",11:"November",12:"December"}}},mounted:function(){this.$nextTick((function(){var t=this;this.container=!0,$["get"]("".concat(this.api_url,"/audio-features/").concat(this.track.id),{headers:{Authorization:"Bearer ".concat(this.api_token)}}).then((function(e){var n,a=Object(h["a"])(t.data_wanted);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.data_points[i]=e.data[i]}}catch(r){a.e(r)}finally{a.f()}t.data_populated=!0})).catch((function(e){if(401==e.response.status)return t.auth_expired(e);console.error(e)}))}))},computed:{release_date_tooltip:function(){var t=this.track.album.release_date.split("-");switch(this.track.album.release_date_precision){case"year":return t[0];case"month":return"".concat(this.months[t[1]],", ").concat(t[0]);case"day":return"".concat(this.months[t[1]]," ").concat(t[2],", ").concat(t[0]);default:return""}}},methods:{get_percentage:function(t){var e=this.data_points[t];switch(t){case"loudness":return Math.round(100*Math.pow(10,e/10));case"popularity":return this.track.popularity;default:return Math.round(100*e)}}}}),Ct=gt,bt=(n("0e80"),Object(m["a"])(Ct,pt,ht,!1,null,"7c63eb57",null)),wt=bt.exports,kt={name:"TrackCard",components:{PopularityModal:X,TrackInfo:wt,Sharing:dt,icon:N},props:{item:{type:Object,required:!0}},data:function(){return{duration_tooltip:"Song Duration",popularity_tooltip:"Song Popularity",info_tooltip:"Audio Features",share_tooltip:"Share",show_pop_modal:!1,show_track_info:!1,show_share_modal:!1}},computed:{duration:function(){var t=Math.trunc(this.item.duration_ms/1e3),e=t%60;t=Math.trunc(t/60);var n=t%60;t=Math.trunc(t/60);var a=t%24;return e<10&&(e="0".concat(e)),"".concat(a>0?"".concat(a,":"):"").concat(n,":").concat(e)}},methods:{}},xt=kt,St=(n("3b8cf"),Object(m["a"])(xt,it,rt,!1,null,"47e503ba",null)),Tt=St.exports,zt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"},on:{"after-enter":function(e){t.content=!0}}},[t.container?n("div",{staticClass:"modal-container",on:{click:function(e){if(e.target!==e.currentTarget)return null;e.stopPropagation(),t.content=!1}}},[n("transition",{attrs:{name:"burst"},on:{"after-leave":function(e){return t.$emit("close")}}},[t.content?n("div",{staticClass:"modal"},[n("h2",{staticClass:"center"},[t._v("Export Playlist")]),n("div",{staticClass:"modal-form"},[n("div",{staticClass:"input-row"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],attrs:{id:"playlist-name",type:"text",name:"Playlist Name"},domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}}),n("span",{staticClass:"char_counter"},[t._v(" "+t._s(t.name.length)+"/100 ")])]),n("div",{staticClass:"input-row"},[n("textarea-autosize",{attrs:{placeholder:"Playlist Description","min-height":100},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}})],1),n("div",{staticClass:"input-row"},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.is_public,expression:"is_public"}],on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.is_public=e.target.multiple?n:n[0]}}},[n("option",{domProps:{value:!1}},[t._v("Private Playlist")]),n("option",{domProps:{value:!0}},[t._v("Public Playlist")])]),n("button",{attrs:{disabled:!t.can_export},on:{click:function(e){return e.target!==e.currentTarget?null:t.create_playlist()}}},[t._v(" Create Playlist ")])])]),t.success?n("div",{staticClass:"alert success"},[n("a",{attrs:{href:t.playlist.url}},[t._v("Playlist")]),t._v(" created successfully! ")]):t._e()]):t._e()])],1):t._e()])},Pt=[],Mt=(n("9d8f"),n("5116"),{name:"PlaylistExportModal",props:{config:{type:Object,required:!0},user_id:{type:String,required:!0},data:{type:Array,required:!0}},data:function(){return{container:!1,content:!1,create_button_enabled:!0,name:"",is_public:!1,description:"Playlist auto-generated by Top Lists for Spotify",success:!1,playlist:{id:null,url:null},exported_settings:null}},mounted:function(){var t=new Date,e=t.getMonth()+1;e=e<10?"0".concat(e):e,this.name="Top ".concat(this.config.limit||10," - ").concat(t.getFullYear(),"/").concat(e,"/").concat(t.getDate()),this.$nextTick((function(){this.container=!0}))},computed:{payload:function(){return{name:this.name,description:this.description,public:this.is_public}},can_export:function(){return!(this.name.length>100)&&(!this.exported_settings||(this.payload.name!=this.exported_settings.name||this.payload.description!=this.exported_settings.description||this.payload.is_public!=this.exported_settings.is_public))}},methods:{create_playlist:function(){var t=this,e=this.payload;this.exported_settings=e,$["post"]("".concat(this.api_url,"/users/").concat(this.user_id,"/playlists"),JSON.stringify(e),{headers:{Authorization:"Bearer ".concat(this.api_token),"Content-Type":"application/json"}}).then((function(e){t.playlist.id=e.data.id,t.playlist.url=e.data.external_urls.spotify,t.populate_playlist()})).catch((function(e){if(401==e.response.status)return t.auth_expired(e);console.error(e)}))},populate_playlist:function(){var t,e=this,n={uris:[]},a=Object(h["a"])(this.data);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uris.push(i.uri)}}catch(r){a.e(r)}finally{a.f()}$["post"]("".concat(this.api_url,"/playlists/").concat(this.playlist.id,"/tracks"),n,{headers:{Authorization:"Bearer ".concat(this.api_token),"Content-Type":"application/json"}}).then((function(t){e.success=!0})).catch((function(t){if(401==t.response.status)return e.auth_expired(t);console.error(t)}))}}}),Lt=Mt,Ot=(n("f1ad"),Object(m["a"])(Lt,zt,Pt,!1,null,"609583c4",null)),jt=Ot.exports,$t={name:"MainView",props:{preview_mode:{type:Boolean,required:!0},dev_mode:{type:Boolean,required:!0}},components:{Control:F,Track:Tt,Artist:at,PlaylistExport:jt},data:function(){return{config:{},data:[],error:"",playlist_export_modal:!1,user_id:null}},computed:{items:function(){var t=this;return this.data.filter((function(e){return e.type===t.config.type.slice(0,-1).toLowerCase()}))}},methods:{get_data:function(t){var e=this,n="".concat(this.api_url,"/me/top/").concat(t.type.toLowerCase()),a=t.limit;n+="?limit=".concat(a,"&time_range=").concat(t.duration),$["get"](n,{headers:{Authorization:"Bearer ".concat(this.api_token)}}).then((function(n){e.error="",e.config=t,e.data=n.data.items})).catch((function(t){if(e.error="".concat(t.name,": ").concat(t.message),401==t.response.status)return e.auth_expired(t);console.error(t)}))}}},It=$t,qt=(n("88d4"),Object(m["a"])(It,O,j,!1,null,"79233f52",null)),At=qt.exports,Et={name:"App",components:{LoginCard:L,MainView:At,Themes:y,Icon:N,SiteInfo:x},data:function(){return{show_theme_modal:!1,show_site_info:!1}},computed:{is_dev:function(){var t=new URLSearchParams(window.location.search.slice(1));return null!=t.get("dev")&&"false"!==t.get("dev")},is_preview:function(){var t=new URLSearchParams(window.location.search.slice(1));return null!=t.get("preview")&&"false"!==t.get("preview")},is_authed:function(){var t=new URLSearchParams(window.location.hash.slice(1));return!(!this.is_dev&&!this.is_preview)||(t.get("access_token")&&(sessionStorage.getItem(this.storage_key.state)===t.get("state")?(console.info("State compare success"),sessionStorage.setItem(this.storage_key.token,t.get("access_token")),sessionStorage.removeItem(this.storage_key.state),window.location.hash=""):console.error("State compare failed")),!!sessionStorage.getItem(this.storage_key.token))}}},Dt=Et,Bt=(n("034f"),Object(m["a"])(Dt,l,u,!1,null,null,null)),Zt=Bt.exports,Nt="https://oliver.akins.me/top-lists",Vt=Nt,Rt="".concat(Vt),Ut="https://api.spotify.com/v1",Ft={token:"top-lists-auth-token",state:"top-lists-auth-state"};a["a"].config.productionTip=!1,i["a"].enabled=window.innerWidth>768,a["a"].use(i["a"]),a["a"].use(o["a"]),a["a"].use(c.a,"percent"),a["a"].mixin({data:function(){return{api_url:Ut,auth_redirect:Rt,storage_key:Ft,home_page:Vt}},computed:{api_token:function(){return sessionStorage.getItem(this.storage_key.token)}},methods:{css_var:function(t){return getComputedStyle(document.documentElement).getPropertyValue(t)},auth_expired:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;sessionStorage.removeItem(this.storage_key.token),window.location.hash="",window.location.href=t?"".concat(this.home_page,"?error=").concat(t):this.home_page},copy_text:r["a"]}});new a["a"]({render:function(t){return t(Zt)}}).$mount("#app")},6356:function(t,e,n){"use strict";n("55ff")},"88d4":function(t,e,n){"use strict";n("beee")},"8e33":function(t,e,n){},"954ab":function(t,e,n){"use strict";n("1cdb")},"97bc":function(t,e,n){},a516:function(t,e,n){"use strict";n("40e8")},b388:function(t,e,n){"use strict";n("2668")},b3c6:function(t,e,n){"use strict";n("ba58")},ba58:function(t,e,n){},beee:function(t,e,n){},d1bb:function(t,e,n){},e0e2:function(t,e,n){},efd2:function(t,e,n){},f02d:function(t,e,n){"use strict";n("97bc")},f034:function(t,e,n){},f1ad:function(t,e,n){"use strict";n("f034")},fada:function(t,e,n){},fcb4:function(t,e,n){"use strict";n("fada")}});
//# sourceMappingURL=app-legacy.1dc7f1d6.js.map