[
  {
    "path": ".gitattributes",
    "content": "###############################################################################\n# Set default behavior to automatically normalize line endings.\n###############################################################################\n* text=auto\n\n###############################################################################\n# Set default behavior for command prompt diff.\n#\n# This is need for earlier builds of msysgit that does not have it on by\n# default for csharp files.\n# Note: This is only used by command line\n###############################################################################\n#*.cs     diff=csharp\n\n###############################################################################\n# Set the merge driver for project and solution files\n#\n# Merging from the command prompt will add diff markers to the files if there\n# are conflicts (Merging from VS is not affected by the settings below, in VS\n# the diff markers are never inserted). Diff markers may cause the following \n# file extensions to fail to load in VS. An alternative would be to treat\n# these files as binary and thus will always conflict and require user\n# intervention with every merge. To do so, just uncomment the entries below\n###############################################################################\n#*.sln       merge=binary\n#*.csproj    merge=binary\n#*.vbproj    merge=binary\n#*.vcxproj   merge=binary\n#*.vcproj    merge=binary\n#*.dbproj    merge=binary\n#*.fsproj    merge=binary\n#*.lsproj    merge=binary\n#*.wixproj   merge=binary\n#*.modelproj merge=binary\n#*.sqlproj   merge=binary\n#*.wwaproj   merge=binary\n\n###############################################################################\n# behavior for image files\n#\n# image files are treated as binary by default.\n###############################################################################\n#*.jpg   binary\n#*.png   binary\n#*.gif   binary\n\n###############################################################################\n# diff behavior for common document formats\n# \n# Convert binary document formats to text before diffing them. This feature\n# is only available from the command line. Turn it on by uncommenting the \n# entries below.\n###############################################################################\n#*.doc   diff=astextplain\n#*.DOC   diff=astextplain\n#*.docx  diff=astextplain\n#*.DOCX  diff=astextplain\n#*.dot   diff=astextplain\n#*.DOT   diff=astextplain\n#*.pdf   diff=astextplain\n#*.PDF   diff=astextplain\n#*.rtf   diff=astextplain\n#*.RTF   diff=astextplain\n"
  },
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n\n# Visual Studio 2015 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUNIT\n*.VisualState.xml\nTestResult.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# DNX\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\n\n*_i.c\n*_p.c\n*_i.h\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# JustCode is a .NET coding add-in\n.JustCode\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# TODO: Comment the next line if you want to checkin your web deploy settings\n# but database connection strings (with potential passwords) will be unencrypted\n#*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# The packages folder can be ignored because of Package Restore\n**/packages/*\n# except build/, which is used as an MSBuild target.\n!**/packages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/packages/repositories.config\n# NuGet v3's project.json files produces more ignoreable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\nnode_modules/\norleans.codegen.cs\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\n*.mdf\n*.ldf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# JetBrains Rider\n.idea/\n*.sln.iml\n\n# CodeRush\n.cr/\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n\n\nSecrets.cs\n\n# Generated css files\nXpoMusic/InjectedAssets/style-dark.css\nXpoMusic/InjectedAssets/style-dark.min.css\nXpoMusic/InjectedAssets/style-light.css\nXpoMusic/InjectedAssets/style-light.min.css\n\n#Generated js files\nXpoMusic/InjectedAssets/init-dark.js\nXpoMusic/InjectedAssets/init-dark.js.map\nXpoMusic/InjectedAssets/init-light.js\nXpoMusic/InjectedAssets/init-light.js.map\n"
  },
  {
    "path": "LICENSE.md",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "Preview.md",
    "content": "# Xpo Music Preview\n\nXpo Music v3 is currently in development. It utilizes [WinUI 3](https://docs.microsoft.com/en-us/windows/apps/winui/winui3/) and brings numerous improvements, notably a new rendering engine (Edge Chromium) which will result in a lot of performance and reliability improvements.\n\n\n### When will this get released?\n\nXpo Music v3.0 will replace the current version when WinUI 3 is stable enough. Currently WinUI 3 itself is in preview, and is not stable enough for production usage. The goal is to make Xpo Music v3 ready before WinUI 3 launch.\n\n### How can I get Xpo Music 3 Preview?\n\nHere are the steps to get the Xpo Music Preview:\n\n1. Make sure you have installed new Edge browser (Beta, Dev or Canary version) on your PC.\n\n2. Install test certificate [from here](https://xpomusic.com/vNext/get/XpoMusic_3.0.1.0_Debug_Test/XpoMusic_3.0.1.0_x86_Debug.cer); make sure to install it on Local Machine, inside Trusted Root Certificate Authorities.\n\n3. Get the app by clicking on \"Get the app\" button on [this page](https://xpomusic.com/vNext/get/).\n\n### Is the preview stable enough for daily use?\n\nThe core playback functionality is working and is already more performant than v2, but some crashes are to be expected.\n\nAlso, certain Windows integration features like Live Tiles and Pin To Start are not yet available in v3 Preview.\n\n### How can I send feedback for the preview version?\n\nSimply open an issue in this repository, make sure to mention you're talking about the preview version, and not the release version.\n\n### Can I contribute?\n\nOf course! read [here](https://github.com/MahdiGhiasi/XpoMusic#contributing) for more information.\n"
  },
  {
    "path": "README.md",
    "content": "# Xpo Music (formerly Xpotify)\nA modern Spotify experience for Windows 10\n\n**Get it from [XpoMusic.com](https://xpomusic.com/)**\n\n## Building from source\n\n#### Requirements\n\nYou need to have these components installed in order to build Xpo Music:\n\n* Visual Studio 2019 (or 2017)\n* Windows 10 SDK 18362\n* TypeScript\n* [Web Compiler extension for Visual Studio](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler)\n\n#### Configuration\n\nCreate a file named `Secrets.cs` in the `XpoMusic/` directory, and put the following content into it:\n\n    namespace XpoMusic\n    {\n        internal static class Secrets\n        {\n            internal static readonly string SpotifyClientId = \"\";\n            internal static readonly string SpotifyClientSecret = \"\";\n            internal static readonly string GoogleAnalyticsTrackerId = \"\";\n            internal static readonly string AppCenterId = \"\";\n        }\n    }\n\nSign up on [Spotify Developer website](https://developer.spotify.com/) and get an API key for yourself. Put Id and Secret that you get from Spotify into the `SpotifyClientId` and `SpotifyClientSecret` fields. You can leave the `GoogleAnalyticsTrackerId` empty.\n\nAlso, you will need to add `https://xpomusic.ghiasi.net/login/redirect` as the redirect URI on Spotify developer dashboard for the app entry you created. Alternatively, you can choose a different redirect URI and then modify [this line of code](https://github.com/MahdiGhiasi/Xpotify/blob/7e003b9879104a5b8b771f48475feca92155de8a/Xpotify/SpotifyApi/Authorization.cs#L18) accordingly.\n\n## Contributing\n\nIf you want to work on a bug or an enhancement that is already present and approved in the Issues, please leave a comment under that issue stating that you're going to work on it (so we can avoid doing duplicate work).\n\nAlso, if you want to work on a new feature you have in mind for Xpo Music, please create an issue first so we can discuss it.\n\n## License\n\nXpo Music is available under [GNU General Public License v3.0](https://github.com/MahdiGhiasi/Xpotify/blob/master/LICENSE.md).\n"
  },
  {
    "path": "XpoMusic/App.xaml",
    "content": "﻿<Application\n    x:Class=\"XpoMusic.App\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:converters=\"using:XpoMusic.Classes.Converters\">\n    <Application.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <XamlControlsResources xmlns=\"using:Microsoft.UI.Xaml.Controls\"/>\n                <ResourceDictionary Source=\"Styles/TopBarDarkButtonStyle.xaml\" />\n                <ResourceDictionary Source=\"Styles/TopBarLightButtonStyle.xaml\" />\n                <ResourceDictionary Source=\"Styles/CircleButtonStyle.xaml\" />\n                <ResourceDictionary Source=\"Styles/MinimalButtonStyle.xaml\" />\n            </ResourceDictionary.MergedDictionaries>\n            <converters:BooleanToVisibilityConverter x:Key=\"BooleanToVisibilityConverter\" />\n        </ResourceDictionary>\n    </Application.Resources>\n\n</Application>\n"
  },
  {
    "path": "XpoMusic/App.xaml.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Activation;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Popups;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Media.Animation;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Pages;\nusing Microsoft.AppCenter;\nusing Microsoft.AppCenter.Crashes;\nusing Microsoft.AppCenter.Analytics;\n\nnamespace XpoMusic\n{\n    /// <summary>\n    /// Provides application-specific behavior to supplement the default Application class.\n    /// </summary>\n    sealed partial class App : Application\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        /// <summary>\n        /// Initializes the singleton application object.  This is the first line of authored code\n        /// executed, and as such is the logical equivalent of main() or WinMain().\n        /// </summary>\n        public App()\n        {\n            this.InitializeComponent();\n            this.Suspending += OnSuspending;\n            this.UnhandledException += App_UnhandledException;\n\n            if (!string.IsNullOrWhiteSpace(Secrets.AppCenterId))\n            {\n                AppCenter.LogLevel = LogLevel.Debug;\n                AppCenter.Start(Secrets.AppCenterId, typeof(Analytics), typeof(Crashes));\n            }\n        }\n\n        private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)\n        {\n            e.Handled = true;\n\n            AnalyticsHelper.Log(\"unhandledException\", e.Message, e.Exception.ToString());\n            await new MessageDialog(e.Message + \"\\r\\n---\\r\\n\" + e.Exception.ToString(), \"An exception has been occured in Xpo Music.\").ShowAsync();\n            logger.Error(\"Unhandled exception: \\r\\n\" + e.Message + \"\\r\\n---\\r\\n\" + e.Exception.ToString());\n        }\n\n        /// <summary>\n        /// Invoked when the application is launched normally by the end user.  Other entry points\n        /// will be used such as when the application is launched to open a specific file.\n        /// </summary>\n        /// <param name=\"e\">Details about the launch request and process.</param>\n        protected override void OnLaunched(LaunchActivatedEventArgs e)\n        {\n            Frame rootFrame = InitRootFrame(e.PreviousExecutionState);\n\n            if (e.PrelaunchActivated == false)\n            {\n                if (rootFrame.Content == null)\n                {\n                    // When the navigation stack isn't restored navigate to the first page,\n                    // configuring the new page by passing required information as a navigation\n                    // parameter\n                    rootFrame.Navigate(typeof(MainPage), e.Arguments);\n                }\n                else if (!string.IsNullOrEmpty(e.Arguments))\n                {\n                    // If app is already opened but a secondary tile is clicked,\n\n                    var currentMainPage = (rootFrame.Content as MainPage);\n                    if (currentMainPage == null)\n                    {\n                        // if MainPage is not opened, navigate to MainPage with the necessary argument\n\n                        rootFrame.Navigate(typeof(MainPage), e.Arguments);\n                    }\n                    else\n                    {\n                        // if MainPage is opened already, send a signal to it so it can navigate to the new url.\n\n                        currentMainPage.NavigateToSecondaryTile(e.Arguments);\n                    }\n                }\n\n                // Ensure the current window is active\n                Window.Current.Activate();\n            }\n        }\n\n        protected override void OnActivated(IActivatedEventArgs e)\n        {\n            Frame rootFrame = InitRootFrame(e.PreviousExecutionState);\n\n            // Handle toast activation\n            if (e.Kind == ActivationKind.ToastNotification)\n            {\n                var toastActivationArgs = e as ToastNotificationActivatedEventArgs;\n\n                logger.Info($\"ToastActivation with argument '{toastActivationArgs.Argument}'.\");\n\n                // Parse the query string (using QueryString.NET)\n                var args = new WwwFormUrlDecoder(toastActivationArgs.Argument);\n\n                // See what action is being requested \n                switch (args.GetFirstValueByName(\"action\"))\n                {\n                    // Open the image\n                    case \"reopenApp\":\n                        if (rootFrame.Content == null)\n                        {\n                            rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());\n                        }\n                        break;\n                }\n            }\n            else if (e.Kind == ActivationKind.Protocol)\n            {\n                var args = e as ProtocolActivatedEventArgs;\n                var uri = args.Uri.ToString();\n                var currentMainPage = (rootFrame.Content as MainPage);\n\n                logger.Info($\"ProtocolActivation with uri '{uri}'.\");\n\n                var targetPwaUri = SpotifyShareUriHelper.GetPwaUri(uri);\n\n                if (string.IsNullOrWhiteSpace(targetPwaUri))\n                {\n                    // Invalid uri, will launch default page\n\n                    if (currentMainPage == null)\n                    {\n                        // if MainPage is not opened, navigate to MainPage with the necessary argument\n                        rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());\n                    }\n                }\n                else\n                {\n                    var argument = \"pageUrl=\" + WebUtility.UrlEncode(targetPwaUri);\n\n                    if (uri.ToLower().StartsWith(\"spotify:nl:\"))\n                    {\n                        var autoplay = targetPwaUri.ToLower().Contains(\"/track/\") ? \"track\" : \"playlist\";\n                        argument += \"&autoplay=\" + autoplay;\n                        argument += \"&source=cortana\";\n                    }\n\n                    if (currentMainPage == null)\n                    {\n                        // if MainPage is not opened, navigate to MainPage with the necessary argument\n                        rootFrame.Navigate(typeof(MainPage), argument);\n                    }\n                    else\n                    {\n                        // if MainPage is opened already, send a signal to it so it can navigate to the new url.\n                        currentMainPage.NavigateWithConfig(argument);\n                    }\n                }\n            }\n\n            // TODO: Handle other types of activation\n\n            // Ensure the current window is active\n            Window.Current.Activate();\n        }\n\n        private Frame InitRootFrame(ApplicationExecutionState previousExecutionState)\n        {\n            // Get the root frame\n            Frame rootFrame = Window.Current.Content as Frame;\n\n            // Do not repeat app initialization when the Window already has content,\n            // just ensure that the window is active\n            if (rootFrame == null)\n            {\n                // Create a Frame to act as the navigation context and navigate to the first page\n                rootFrame = new Frame();\n\n                rootFrame.NavigationFailed += OnNavigationFailed;\n\n                if (previousExecutionState == ApplicationExecutionState.Terminated)\n                {\n                    //TODO: Load state from previously suspended application\n                }\n\n                // Place the frame in the current Window\n                Window.Current.Content = rootFrame;\n            }\n\n            return rootFrame;\n        }\n\n        /// <summary>\n        /// Invoked when Navigation to a certain page fails\n        /// </summary>\n        /// <param name=\"sender\">The Frame which failed navigation</param>\n        /// <param name=\"e\">Details about the navigation failure</param>\n        void OnNavigationFailed(object sender, NavigationFailedEventArgs e)\n        {\n            throw new Exception(\"Failed to load Page \" + e.SourcePageType.FullName);\n        }\n\n        /// <summary>\n        /// Invoked when application execution is being suspended.  Application state is saved\n        /// without knowing whether the application will be terminated or resumed with the contents\n        /// of memory still intact.\n        /// </summary>\n        /// <param name=\"sender\">The source of the suspend request.</param>\n        /// <param name=\"e\">Details about the suspend request.</param>\n        private void OnSuspending(object sender, SuspendingEventArgs e)\n        {\n            var deferral = e.SuspendingOperation.GetDeferral();\n            //TODO: Save application state and stop any background activity\n            deferral.Complete();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Assets/ReauthorizeForV2.html",
    "content": "﻿<!DOCTYPE html>\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title></title>\n    <style>\n        html {\n            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n            -webkit-user-select: none;\n        }\n\n        body.dark {\n            background: #201B1B;\n            color: white;\n        }\n\n        body.light {\n            background: #D1D3D3;\n            color: black;\n        }\n\n        .container {\n            max-width: 700px;\n            padding-left: 32px;\n            padding-right: 32px;\n            padding-top: 72px;\n            margin-left: auto;\n            margin-right: auto;\n        }\n\n        h1 {\n            font-size: 48px;\n            font-weight: 100;\n        }\n\n            h1 img {\n                height: 60px;\n                width: auto;\n                vertical-align: middle;\n                margin-right: 8px;\n                margin-top: 4px;\n            }\n\n            h1 span {\n                vertical-align: middle;\n            }\n\n\n        h2 {\n            font-weight: 400;\n            margin-left: 88px;\n        }\n\n        h3 {\n            font-weight: 400;\n            margin-left: 88px;\n        }\n\n        .button {\n            background-color: #0099ab;\n            border: none;\n            color: white;\n            padding: 8px 34px;\n            text-align: center;\n            text-decoration: none;\n            display: inline-block;\n            font-size: 20px;\n            cursor: pointer;\n        }\n\n        .buttonContainer {\n            margin-left: 88px;\n            margin-top: 36px;\n        }\n\n        .lastParagraph {\n            font-weight: 600;\n            padding-top: 30px;\n        }\n\n        a:hover, a:visited, a:link, a:active {\n            text-decoration: none;\n        }\n\n        body.dark a {\n            color: lightskyblue;\n        }\n\n        body.light a {\n            color: deepskyblue;\n        }\n\n        a {\n            font-weight: 600;\n        }\n\n        .buttonContainer a {\n            color: white !important;\n        }\n\n        @media (max-width: 660px) {\n            h1 {\n                font-size: 32px;\n            }\n\n                h1 img {\n                    height: 44px;\n                }\n\n            h3 {\n                margin-left: 60px;\n            }\n\n            .buttonContainer {\n                margin-left: 60px;\n            }\n        }\n    </style>\n    <script>\n        function load() {\n            var urlParams = new URLSearchParams(window.location.search);\n            var redirectUri = urlParams.get('redirectUri');\n            var theme = urlParams.get('theme');\n\n            document.getElementById(\"authorizeButton\").setAttribute(\"href\", redirectUri);\n\n            if (theme !== null)\n                document.body.className = theme;\n        }\n    </script>\n</head>\n<body onload=\"load()\" class=\"dark\">\n    <div class=\"container\">\n        <h1>\n            <img src=\"xpotify.png\" />\n            <span>Welcome to Xpo Music v2.0</span>\n        </h1>\n        <h2 style=\"font-weight: 600; opacity: 0.85; font-size: 22px\">\n            Xpotify has been renamed to Xpo Music!\n        </h2>\n        <h3 style=\"opacity: 0.7\">\n            This update also contains many new features and improvements:\n            <ul>\n                <li>Now Playing page</li>\n                <li>Keyboard shortcuts <i><a href=\"https://xpomusic.com/keyboardShortcuts\" target=\"_blank\">read more</a></i></li>\n                <li>Add or remove songs to your Liked Songs quickly on album and playlist pages</li>\n                <li>Mini view redesign</li>\n                <li>Change volume by mouse wheel over volume bar</li>\n                <li>Appropriate device and app name in Spotify Connect</li>\n                <li>Animation improvements</li>\n                <li>Playback improvements</li>\n                <li>Many more under the hood improvements</li>\n            </ul>\n        </h3>\n        <h3 class=\"lastParagraph\">\n            Xpo Music requires you to authorize it again with your Spotify account, so you can have the best experience possible.\n        </h3>\n        <div class=\"buttonContainer\">\n            <a href=\"#\" id=\"authorizeButton\" class=\"button\">Authorize Xpo Music</a>\n        </div>\n    </div>\n</body>\n</html>"
  },
  {
    "path": "XpoMusic/Assets/TileTemplates/LiveTileAlbumAndArtistArt.xml",
    "content": "﻿<tile>\n  <visual branding=\"nameAndLogo\">\n\n    <binding template='TileMedium' hint-textStacking='center'>\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <group>\n        <subgroup>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n        </subgroup>\n      </group>\n      <image src='{albumPhoto}' placement='peek'/>\n    </binding>\n\n    <binding template='TileWide' hint-textStacking='center' >\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <group>\n        <subgroup hint-textStacking='center' hint-weight='90'>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n          <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n        </subgroup>\n      </group>\n      <image src='{albumPhoto}' placement='peek'/>\n    </binding>\n\n    <binding template='TileLarge' hint-textStacking='center'>\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <group>\n        <subgroup hint-weight='2'/>\n        <subgroup hint-weight='3'>\n          <image src='{albumPhoto}' />\n        </subgroup>\n        <subgroup hint-weight='2'/>\n      </group>\n      <group>\n        <subgroup hint-weight='15'/>\n        <subgroup hint-weight='1'>\n          <image src='ms-appx:///Assets/TransparentSquare.png' />\n        </subgroup>\n        <subgroup hint-weight='15'/>\n      </group>\n      <text hint-style='subtitle' hint-align='center' hint-wrap='true'>{songName}</text>\n      <text hint-style='body' hint-align='center'>{artistName}</text>\n      <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n    </binding>\n    \n  </visual>\n</tile>"
  },
  {
    "path": "XpoMusic/Assets/TileTemplates/LiveTileAlbumArtOnly.xml",
    "content": "﻿<tile>\n  <visual branding=\"nameAndLogo\">\n\n    <binding template='TileMedium' hint-textStacking='center'>\n      <group>\n        <subgroup>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n        </subgroup>\n      </group>\n      <image src='{albumPhoto}' placement='peek'/>\n    </binding>\n\n    <binding template='TileWide' hint-textStacking='center' >\n      <group>\n        <subgroup hint-textStacking='center' hint-weight='90'>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n          <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n        </subgroup>\n      </group>\n      <image src='{albumPhoto}' placement='peek'/>\n    </binding>\n\n    <binding template='TileLarge' hint-textStacking='center'>\n      <image src='{albumPhoto}' placement='background' hint-overlay='30'/>\n      <text hint-style='subtitle' hint-align='center' hint-wrap='true'>{songName}</text>\n      <group>\n        <subgroup hint-weight='100'/>\n        <subgroup hint-weight='1'>\n          <image src='ms-appx:///Assets/TransparentSquare.png' />\n        </subgroup>\n        <subgroup hint-weight='100'/>\n      </group>\n      <text hint-style='body' hint-align='center'>{artistName}</text>\n      <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n    </binding>\n\n  </visual>\n</tile>"
  },
  {
    "path": "XpoMusic/Assets/TileTemplates/LiveTileArtistArtOnly.xml",
    "content": "﻿<tile>\n  <visual branding=\"nameAndLogo\">\n\n    <binding template='TileMedium' hint-textStacking='center'>\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <group>\n        <subgroup>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n        </subgroup>\n      </group>\n    </binding>\n\n    <binding template='TileWide' hint-textStacking='center' >\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <group>\n        <subgroup hint-textStacking='center' hint-weight='90'>\n          <text hint-style='base' hint-align='center' hint-wrap='true'>{songName}</text>\n          <text hint-style='caption' hint-align='center'>{artistName}</text>\n          <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n        </subgroup>\n      </group>\n    </binding>\n\n    <binding template='TileLarge' hint-textStacking='center'>\n      <image src='{artistPhoto}' placement='background' hint-overlay='30'/>\n      <text hint-style='subtitle' hint-align='center' hint-wrap='true'>{songName}</text>\n      <group>\n        <subgroup hint-weight='15'/>\n        <subgroup hint-weight='1'>\n          <image src='ms-appx:///Assets/TransparentSquare.png' />\n        </subgroup>\n        <subgroup hint-weight='15'/>\n      </group>\n      <text hint-style='body' hint-align='center'>{artistName}</text>\n      <text hint-style='captionSubtle' hint-align='center'>{albumName}</text>\n    </binding>\n\n  </visual>\n</tile>"
  },
  {
    "path": "XpoMusic/Classes/AppConstants.cs",
    "content": "﻿using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing Windows.UI.ViewManagement;\nusing XpoMusic.Classes.Model.WebResourceModifications;\nusing XpoMusic.Helpers;\nusing XpoMusic.XpotifyApi;\n\nnamespace XpoMusic.Classes\n{\n    public class AppConstants\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static AppConstants instance;\n        public static AppConstants Instance\n        {\n            get\n            {\n                if (instance == null)\n                    instance = new AppConstants();\n\n                return instance;\n            }\n        }\n\n        private AppConstants()\n        {\n#if DEBUG\n            var initialStateJson = JsonConvert.SerializeObject(this, Formatting.Indented);\n#endif\n\n            var latestSavedAppConstantsString = LocalConfiguration.LatestAppConstants;\n            try\n            {\n                if (!string.IsNullOrWhiteSpace(latestSavedAppConstantsString))\n                {\n                    JsonConvert.PopulateObject(latestSavedAppConstantsString, this);\n                    this.ConstantsUpdated?.Invoke(this, new EventArgs());\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn($\"Updating AppConstants from latest saved app constants string failed. The content was: '{latestSavedAppConstantsString}'\");\n                logger.Error($\"Updating AppConstants from latest saved app constants string failed: {ex}\");\n            }\n        }\n\n        public event EventHandler ConstantsUpdated;\n\n        [JsonProperty]\n        public int PlayStatePollIntervalMilliseconds { get; private set; } = 20000;\n\n        [JsonProperty]\n        public int PlayStatePollIntervalMillisecondsWithCompactOverlayOpen { get; private set; } = 15000;\n\n        [JsonIgnore]\n        public TimeSpan PlayStatePollInterval\n        {\n            get\n            {\n                if (ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.CompactOverlay)\n                    return TimeSpan.FromMilliseconds(PlayStatePollIntervalMillisecondsWithCompactOverlayOpen);\n\n                return TimeSpan.FromMilliseconds(PlayStatePollIntervalMilliseconds);\n            }\n        }\n\n        [JsonProperty]\n        public bool HeartbeatEnabled { get; private set; } = true;\n\n        [JsonProperty]\n        public int HeartbeatIntervalSeconds { get; private set; } = 60 * 10;\n\n        [JsonIgnore]\n        public TimeSpan HeartbeatInterval => TimeSpan.FromSeconds(HeartbeatIntervalSeconds);\n\n        [JsonProperty]\n        public int StuckDetectSameElapsedCount { get; private set; } = 10;\n\n        [JsonProperty]\n        public int StuckDetectSameElapsedExtraCount { get; private set; } = 5;\n\n        [JsonProperty]\n        public int MaxStuckResolveTryCount { get; private set; } = 1;\n\n        [JsonProperty]\n        public WebResourceModificationRule[] ModificationRules { get; private set; } = new[]\n            {\n                new WebResourceModificationRule\n                {\n                    UriRegexMatch = @\"web-player\\.[a-zA-Z0-9]*\\.js\",\n                    Type = WebResourceModificationRuleType.ModifyString,\n                    StringModificationRules = new[]\n                    {\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = Regex.Escape(@\"window.matchMedia(\"\"(display-mode: standalone)\"\").addEventListener(\"\"change\"\",function(t){e(t.matches)})\"),\n                            ReplaceTo = @\"window.matchMedia(\"\"(display-mode: standalone)\"\").addListener(\"\"change\"\",function(t){e(t.matches)})\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = Regex.Escape(@\"var t=window.matchMedia(\"\"(display-mode: standalone)\"\");(t.addEventListener||t.addListener)(\"\"change\"\",function(t){return e(t.matches)})\"),\n                            ReplaceTo = @\"var t=window.matchMedia(\"\"(display-mode: standalone)\"\");t.addListener(\"\"change\"\",function(t){return e(t.matches)})\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"\"\"Web Player \\(\"\".concat\\([a-zA-Z]+.getBrowserName\\(\\),\"\"\\)\"\"\\)\",\n                            ReplaceTo = @\"\"\"Xpo Music\"\"\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"\\{\\.\\.\\.r\\._propagators,\\.\\.\\.e\\.propagators\\}\",\n                            ReplaceTo = @\"Object.assign({}, r._propagators, e.propagators)\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"\\{\\.\\.\\.p\\}\",\n                            ReplaceTo = @\"Object.assign({}, p)\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"\\{\\.\\.\\.f\\}\",\n                            ReplaceTo = @\"Object.assign({}, f)\",\n                        },\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"globalThis\",\n                            ReplaceTo = @\"window\",\n                        },\n                    }\n                },\n                new WebResourceModificationRule\n                {\n                    UriRegexMatch = @\"https\\:\\/\\/accounts\\.spotify\\.com(\\/[a-z]+)?\\/status.*\",\n                    Type = WebResourceModificationRuleType.ModifyString,\n                    StringModificationRules = new[]\n                    {\n                        new WebResourceStringModificationRule\n                        {\n                            RegexMatch = @\"^(.*\\s*)*$\",\n                            ReplaceTo = @\"<script>window.location.href='https://open.spotify.com'</script><meta http-equiv='refresh' content='0;URL=https://open.spotify.com/'>\",\n                        },\n                    }\n                }\n            };\n\n        [JsonProperty]\n        public bool WebPlayerBackupEnabled { get; private set; } = true;\n\n        [JsonProperty]\n        public bool XamlInvertFilterForLightThemeEnabled { get; private set; } = true;\n\n        public static async void Update()\n        {\n            try\n            {\n                var updateString = await AppConstantsApi.GetAppConstantsString();\n\n                if (string.IsNullOrWhiteSpace(updateString))\n                {\n                    logger.Info(\"No AppConstants update available.\");\n                    return;\n                }\n\n                JsonConvert.PopulateObject(updateString, Instance);\n                Instance.ConstantsUpdated?.Invoke(Instance, new EventArgs());\n\n                LocalConfiguration.LatestAppConstants = updateString;\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"AppConstants.Update failed: \" + ex.ToString());\n                AnalyticsHelper.Log(\"constantsFetchException\", ex.Message, ex.ToString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/AlbumStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public class AlbumStore : CacheStore<SpotifyApi.Model.AlbumSimplified>\n    {\n        protected override Task<SpotifyApi.Model.AlbumSimplified> RetrieveItem(string key)\n        {\n            var album = new SpotifyApi.Album();\n            return album.GetAlbum(key);\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/ArtistStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public class ArtistStore : CacheStore<SpotifyApi.Model.Artist>\n    {\n        protected override Task<SpotifyApi.Model.Artist> RetrieveItem(string key)\n        {\n            var artist = new SpotifyApi.Artist();\n            return artist.GetArtist(key);\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/CacheStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public abstract class CacheStore<T>\n    {\n        private Dictionary<string, T> data = new Dictionary<string, T>();\n        private SemaphoreQueue semaphore = new SemaphoreQueue(1, 1);\n\n        public void Clear()\n        {\n            data.Clear();\n        }\n\n        protected abstract Task<T> RetrieveItem(string key);\n\n        public async Task<T> GetItem(string key)\n        {\n            try\n            {\n                await semaphore.WaitAsync();\n                if (!data.ContainsKey(key))\n                {\n                    data[key] = await RetrieveItem(key);\n                }\n\n                return data[key];\n            }\n            finally\n            {\n                semaphore.Release();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/GlobalCache.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public static class GlobalCache\n    {\n        public static ArtistStore Artist { get; } = new ArtistStore();\n        public static AlbumStore Album { get; } = new AlbumStore();\n        public static PlaylistStore Playlist { get; } = new PlaylistStore();\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/PlaylistStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public class PlaylistStore : CacheStore<SpotifyApi.Model.Playlist>\n    {\n        protected override Task<SpotifyApi.Model.Playlist> RetrieveItem(string key)\n        {\n            var playlist = new SpotifyApi.Playlist();\n            return playlist.GetPlaylist(key);\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Cache/SongExtraInfoStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.SpotifyApi;\n\nnamespace XpoMusic.Classes.Cache\n{\n    public class SongExtraInfoStore : CacheStore<SongExtraInfo>\n    {\n        protected override async Task<SongExtraInfo> RetrieveItem(string key)\n        {\n            var library = new Library();\n            var info = new SongExtraInfo\n            {\n                SongId = key,\n                IsSavedToLibrary = await library.IsTrackSaved(key),\n            };\n            return info;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Converters/BooleanToVisibilityConverter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Data;\n\nnamespace XpoMusic.Classes.Converters\n{\n    public class BooleanToVisibilityConverter : IValueConverter\n    {\n        public object Convert(object value, Type targetType, object parameter, string language) =>\n            (bool)value ^ (parameter as string ?? string.Empty).Equals(\"Reverse\") ?\n                Visibility.Visible : Visibility.Collapsed;\n\n        public object ConvertBack(object value, Type targetType, object parameter, string language) =>\n            (Visibility)value == Visibility.Visible ^ (parameter as string ?? string.Empty).Equals(\"Reverse\");\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Converters/LanguageToStringConverter.cs",
    "content": "﻿using XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Data;\n\nnamespace XpoMusic.Classes.Converters\n{\n    public class LanguageToStringConverter : IValueConverter\n    {\n        public object Convert(object value, Type targetType, object parameter, string language)\n        {\n            var lang = (Language)value;\n\n            return LanguageHelper.GetLanguageName(lang);\n        }\n\n        public object ConvertBack(object value, Type targetType, object parameter, string language)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Converters/LiveTileDesignToStringConverter.cs",
    "content": "﻿using XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Data;\nusing static XpoMusic.Helpers.LiveTileHelper;\n\nnamespace XpoMusic.Classes.Converters\n{\n    public class LiveTileDesignToStringConverter : IValueConverter\n    {\n        public object Convert(object value, Type targetType, object parameter, string language)\n        {\n            var design = (LiveTileDesign)value;\n\n            switch (design)\n            {\n                case LiveTileDesign.AlbumArtOnly:\n                    return \"Album art only\";\n                case LiveTileDesign.ArtistArtOnly:\n                    return \"Artist art only\";\n                case LiveTileDesign.Disabled:\n                    return \"Disabled\";\n                case LiveTileDesign.AlbumAndArtistArt:\n                    return \"Album art and artist art\";\n                default:\n                    return \"???\";\n            }\n        }\n\n        public object ConvertBack(object value, Type targetType, object parameter, string language)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Converters/MillisecondsToMinSecConverter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Data;\n\nnamespace XpoMusic.Classes.Converters\n{\n    public class MillisecondsToMinSecConverter : IValueConverter\n    {\n        public object Convert(object value, Type targetType, object parameter, string language)\n        {\n            var ms = (double)value;\n            var t = TimeSpan.FromMilliseconds(ms);\n\n            return $\"{(int)Math.Floor(t.TotalMinutes)}:{t.Seconds.ToString(\"00\")}\";\n        }\n\n        public object ConvertBack(object value, Type targetType, object parameter, string language)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Converters/ThemeToStringConverter.cs",
    "content": "﻿using XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Data;\n\nnamespace XpoMusic.Classes.Converters\n{\n    public class ThemeToStringConverter : IValueConverter\n    {\n        public object Convert(object value, Type targetType, object parameter, string language)\n        {\n            var lang = (Theme)value;\n\n            return ThemeHelper.GetThemeName(lang);\n        }\n\n        public object ConvertBack(object value, Type targetType, object parameter, string language)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/LocalConfiguration.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Storage;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing static XpoMusic.Helpers.LiveTileHelper;\nusing static XpoMusic.Helpers.ProxyHelper;\n\nnamespace XpoMusic.Classes\n{\n    public static class LocalConfiguration\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static readonly Size compactOverlayDefaultSize = new Size(300, 300);\n\n        public static Size CompactOverlaySize\n        {\n            get\n            {\n                var config = GetConfiguration(\"CompactOverlaySize\");\n\n                if (string.IsNullOrEmpty(config))\n                    return compactOverlayDefaultSize;\n\n                try\n                {\n                    var configParts = config.Split(';');\n                    return new Size(double.Parse(configParts[0]), double.Parse(configParts[1]));\n                }\n                catch\n                {\n                    return compactOverlayDefaultSize;\n                }\n            }\n\n            set\n            {\n                SetConfiguration(\"CompactOverlaySize\", $\"{value.Width};{value.Height}\");\n            }\n        }\n\n        public static Size WindowMinSize => new Size(500, 500);\n\n        public static bool IsLoggedInByFacebook\n        {\n            get\n            {\n                return GetConfiguration(\"IsLoggedInByFacebook\") == \"1\";\n            }\n            set\n            {\n                SetConfiguration(\"IsLoggedInByFacebook\", value ? \"1\" : \"0\");\n            }\n        }\n\n        public static bool IsCustomProxyEnabled\n        {\n            get\n            {\n                return GetConfiguration(\"IsCustomProxyEnabled\") == \"1\";\n            }\n            set\n            {\n                SetConfiguration(\"IsCustomProxyEnabled\", value ? \"1\" : \"0\");\n            }\n        }\n\n        public static string CustomProxyAddress\n        {\n            get\n            {\n                return GetConfiguration(\"CustomProxyAddress\");\n            }\n            set\n            {\n                SetConfiguration(\"CustomProxyAddress\", value);\n            }\n        }\n\n        public static string CustomProxyPort\n        {\n            get\n            {\n                return GetConfiguration(\"CustomProxyPort\");\n            }\n            set\n            {\n                SetConfiguration(\"CustomProxyPort\", value);\n            }\n        }\n\n        public static ProxyType CustomProxyType\n        {\n            get\n            {\n                if (!int.TryParse(GetConfiguration(\"CustomProxyType\"), out int type))\n                    type = (int)ProxyType.HttpHttps;\n\n                return (ProxyType)type;\n            }\n            set\n            {\n                SetConfiguration(\"CustomProxyType\", ((int)value).ToString());\n            }\n        }\n\n        public static Language Language\n        {\n            get\n            {\n                if (!int.TryParse(GetConfiguration(\"Language\"), out int type))\n                    type = (int)Language.Default;\n\n                return (Language)type;\n            }\n            set\n            {\n                SetConfiguration(\"Language\", ((int)value).ToString());\n            }\n        }\n\n        public static Theme Theme\n        {\n            get\n            {\n                if (!int.TryParse(GetConfiguration(\"Theme\"), out int type))\n                    type = (int)Theme.Dark;\n\n                return (Theme)type;\n            }\n            set\n            {\n                SetConfiguration(\"Theme\", ((int)value).ToString());\n            }\n        }\n\n        public static LiveTileDesign LiveTileDesign\n        {\n            get\n            {\n                if (!int.TryParse(GetConfiguration(\"LiveTileDesign\"), out int type))\n                    type = (int)LiveTileDesign.AlbumAndArtistArt;\n\n                return (LiveTileDesign)type;\n            }\n            set\n            {\n                SetConfiguration(\"LiveTileDesign\", ((int)value).ToString());\n            }\n        }\n\n\n        public static string[] DeveloperMessageShownIds\n        {\n            get\n            {\n                try\n                {\n                    var ids = GetConfiguration(\"DeveloperMessageShownIds\");\n\n                    if (string.IsNullOrEmpty(ids))\n                        return new string[] { };\n\n                    return ids.Split(';');\n                }\n                catch (Exception ex)\n                {\n                    logger.Warn(\"DeveloperMessageShownIds failed: \" + ex.ToString());\n                    AnalyticsHelper.Log(\"exception-DeveloperMessageShownIds\", ex.Message, ex.ToString());\n                    return new string[] { };\n                }\n            }\n        }\n\n        public static void AddIdToDeveloperMessageShownIds(string id)\n        {\n            var ids = DeveloperMessageShownIds.ToList();\n            ids.Add(id);\n\n            SetConfiguration(\"DeveloperMessageShownIds\", string.Join(';', ids.ToArray()));\n        }\n\n        public static int LatestAssetUpdateVersion\n        {\n            get\n            {\n                if (int.TryParse(GetConfiguration(\"LatestAssetUpdateVersion\"), out int latestVersion))\n                    return latestVersion;\n\n                return 0;\n            }\n            set\n            {\n                SetConfiguration(\"LatestAssetUpdateVersion\", value.ToString());\n            }\n        }\n\n        public static Version LatestAppVersionOnAssetUpdate\n        {\n            get\n            {\n                if (Version.TryParse(GetConfiguration(\"LatestAppVersionOnAssetUpdate\"), out Version latestVersion))\n                    return latestVersion;\n\n                return PackageHelper.GetAppVersion();\n            }\n            set\n            {\n                SetConfiguration(\"LatestAppVersionOnAssetUpdate\", value.ToString());\n            }\n        }\n\n        public static bool OpenInMiniViewByCortana\n        {\n            get\n            {\n                var config = GetConfiguration(\"OpenInMiniViewByCortana\");\n                if (config == null)\n                    return true;\n                return config == \"1\";\n            }\n            set\n            {\n                SetConfiguration(\"OpenInMiniViewByCortana\", value ? \"1\" : \"0\");\n            }\n        }\n\n        public static bool NowPlayingShowArtistArt\n        {\n            get\n            {\n                var config = GetConfiguration(\"NowPlayingShowArtistArt\");\n                if (config == null)\n                    return true;\n                return config == \"1\";\n            }\n            set\n            {\n                SetConfiguration(\"NowPlayingShowArtistArt\", value ? \"1\" : \"0\");\n            }\n        }\n\n        public static bool MiniViewShowArtistArt\n        {\n            get\n            {\n                var config = GetConfiguration(\"MiniViewShowArtistArt\");\n                if (config == null)\n                    return false;\n                return config == \"1\";\n            }\n            set\n            {\n                SetConfiguration(\"MiniViewShowArtistArt\", value ? \"1\" : \"0\");\n            }\n        }\n\n        public static int ApiTokenVersion\n        {\n            get\n            {\n                var config = GetConfiguration(\"ApiTokenVersion\");\n                if (config == null)\n                    return 1;\n                if (!int.TryParse(config, out int apiTokenVersion))\n                    return 1;\n                return apiTokenVersion;\n            }\n            set\n            {\n                SetConfiguration(\"ApiTokenVersion\", value.ToString());\n            }\n        }\n\n        public static string LatestAppConstants\n        {\n            get\n            {\n                return GetConfiguration(\"LatestAppConstants\");\n            }\n            set\n            {\n                SetConfiguration(\"LatestAppConstants\", value.ToString());\n            }\n        }\n\n        private static string GetConfiguration(string key)\n        {\n            var completeKey = \"LocalConfiguration_\" + key;\n            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey(completeKey))\n                return null;\n\n            return ApplicationData.Current.LocalSettings.Values[completeKey].ToString();\n        }\n\n        private static void SetConfiguration(string key, string value)\n        {\n            var completeKey = \"LocalConfiguration_\" + key;\n            ApplicationData.Current.LocalSettings.Values[completeKey] = value;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/AutoPlayAction.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model\n{\n    public enum AutoPlayAction\n    {\n        None,\n        Track,\n        Playlist,\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/Language.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model\n{\n    public enum Language\n    {\n        Default = 0,\n        English = 1,\n        Arabic = 2,\n        Hungarian = 4,\n        Czech = 5,\n        German = 6,\n        Spanish = 7,\n        Finnish = 8,\n        French = 9,\n        CanadianFrench = 10,\n        Greek = 11,\n        Indonesian = 12,\n        Italian = 13,\n        Japanese = 14,\n        Malay = 15,\n        Dutch = 16,\n        Polish = 17,\n        BrazillianPortuguese = 18,\n        Swedish = 19,\n        Thai = 20,\n        Turkish = 21,\n        Vietnamese = 22,\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/LocalStoragePlayback.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model\n{\n    public class LocalStoragePlayback\n    {\n        public double volume;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/LyricsViewer/CurrentPlayingSongInfo.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model.LyricsViewer\n{\n    public class CurrentPlayingSongInfo\n    {\n        public string SongName { get; set; }\n        public string ArtistName { get; set; }\n        public string AlbumName { get; set; }\n        public string AlbumArtUri { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            if (obj is CurrentPlayingSongInfo cpsi)\n            {\n                return SongName == cpsi.SongName\n                    && ArtistName == cpsi.ArtistName\n                    && AlbumArtUri == cpsi.AlbumArtUri\n                    && AlbumName == cpsi.AlbumName;\n            }\n\n            return false;\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 2090074316;\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(SongName);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ArtistName);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AlbumName);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AlbumArtUri);\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/SongExtraInfo.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model\n{\n    public class SongExtraInfo\n    {\n        public string SongId { get; set; }\n        public bool IsSavedToLibrary { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/Theme.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model\n{\n    public enum Theme\n    {\n        Dark,\n        Light,\n        System,\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/WebResourceModifications/WebResourceModificationRule.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model.WebResourceModifications\n{\n    public class WebResourceModificationRule\n    {\n        public string UriRegexMatch { get; set; }\n        public WebResourceModificationRuleType Type { get; set; }\n        public string AlternativeFileUri { get; set; }\n        public WebResourceStringModificationRule[] StringModificationRules { get; set; }\n\n        public bool Match(string requestUri) => Regex.IsMatch(requestUri, UriRegexMatch);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/WebResourceModifications/WebResourceModificationRuleType.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model.WebResourceModifications\n{\n    public enum WebResourceModificationRuleType\n    {\n        ReplaceWholeFile = 1,\n        ModifyString = 2,\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/Model/WebResourceModifications/WebResourceStringModificationRule.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes.Model.WebResourceModifications\n{\n    public class WebResourceStringModificationRule\n    {\n        public string RegexMatch { get; set; }\n        public string ReplaceTo { get; set; }\n\n        public string Apply(string responseString) => Regex.Replace(responseString, RegexMatch, ReplaceTo);\n    }\n}"
  },
  {
    "path": "XpoMusic/Classes/PlayStatusTracker.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing XpoMusic.SpotifyApi;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Media;\nusing Windows.Storage.Streams;\nusing Windows.UI.Xaml;\nusing Newtonsoft.Json;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Classes.Cache;\nusing XpoMusicWebAgent.Model;\n\nnamespace XpoMusic.Classes\n{\n    public static class PlayStatusTracker\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        static DispatcherTimer timer;\n        static DateTime lastStatusFetch = DateTime.MinValue;\n\n        public static bool IsLocalStatusTrackingOperational { get; private set; } = false;\n\n        public static class LastPlayStatus\n        {\n            public static string ArtistName { get; internal set; }\n            public static string ArtistId { get; internal set; }\n            public static string AlbumName { get; internal set; }\n            public static string AlbumId { get; internal set; }\n            public static string SongName { get; internal set; }\n            public static string SongId { get; internal set; }\n            public static int SongLengthMilliseconds { get; internal set; }\n            public static bool IsPlaying { get; internal set; }\n            public static double Volume { get; internal set; }\n            public static bool IsNextTrackAvailable { get; internal set; }\n            public static bool IsPrevTrackAvailable { get; internal set; }\n\n            private static int progressedMilliseconds;\n            private static DateTime progressedMillisecondsSetMoment;\n            public static int ProgressedMilliseconds\n            {\n                get\n                {\n                    if (!IsPlaying)\n                        return Math.Min(progressedMilliseconds, SongLengthMilliseconds);\n\n                    return Math.Min(SongLengthMilliseconds, (int)(progressedMilliseconds \n                        + (DateTime.UtcNow - progressedMillisecondsSetMoment).TotalMilliseconds));\n                }\n                set\n                {\n                    progressedMilliseconds = value;\n                    progressedMillisecondsSetMoment = DateTime.UtcNow;\n                }\n            }\n\n            public static event EventHandler Updated;\n\n            internal static void InvokeUpdated()\n            {\n                Updated?.Invoke(null, null);\n            }\n        }\n\n        static PlayStatusTracker()\n        {\n            timer = new DispatcherTimer\n            {\n                Interval = TimeSpan.FromSeconds(1),\n            };\n            timer.Tick += Timer_Tick;\n        }\n\n        public static void SeekPlayback(double percentage)\n        {\n            LastPlayStatus.ProgressedMilliseconds = (int)(LastPlayStatus.SongLengthMilliseconds * percentage);\n            LastPlayStatus.InvokeUpdated();\n        }\n\n        public static void SeekVolume(double percentage)\n        {\n            LastPlayStatus.Volume = percentage;\n            LastPlayStatus.InvokeUpdated();\n        }\n\n        private static async void Timer_Tick(object sender, object e)\n        {\n            // Ignore if not logged in\n            if (!TokenHelper.HasTokens())\n                return;\n\n            if ((DateTime.UtcNow - lastStatusFetch) > AppConstants.Instance.PlayStatePollInterval)\n            {\n                IsLocalStatusTrackingOperational = false;\n                await RefreshPlayStatus();\n            }\n        }\n\n        public static void StartRegularRefresh()\n        {\n            if (!timer.IsEnabled)\n                timer.Start();\n        }\n\n        private static int timesFingerprintEmpty = 0;\n        private static string lastLocalFingerprint = \"\";\n        public static async void LocalPlaybackDataReceived(NowPlayingData data)\n        {\n            try\n            {\n                if (string.IsNullOrWhiteSpace(data.TrackFingerprint))\n                {\n                    if (timesFingerprintEmpty == 20)\n                    {\n                        logger.Warn($\"LocalPlaybackDataError #{timesFingerprintEmpty}\");\n                        AnalyticsHelper.Log(\"localPlaybackDataError\", \"fingerprintInvalid\", JsonConvert.SerializeObject(data));\n                        timesFingerprintEmpty++;\n                    }\n                    else if (timesFingerprintEmpty < 20)\n                    {\n                        timesFingerprintEmpty++;\n                        logger.Info($\"LocalPlaybackDataError #{timesFingerprintEmpty}\");\n                    }\n                }\n\n                if (!data.Success\n                    && !string.IsNullOrWhiteSpace(data.TrackFingerprint)\n                    && data.TrackFingerprint != lastLocalFingerprint)\n                {\n                    logger.Info(\"LocalPlaybackDataReceived, success = false, fingerprint changed to \" + data.TrackFingerprint);\n                    await RefreshPlayStatus();\n                    AnalyticsHelper.Log(\"localPlaybackDataError\", \"invalid\", JsonConvert.SerializeObject(data));\n                }\n                else if (data.Success)\n                {\n                    bool changed = (LastPlayStatus.SongId != data.TrackId\n                        || LastPlayStatus.Volume != data.Volume \n                        || LastPlayStatus.IsNextTrackAvailable != data.IsNextTrackAvailable\n                        || LastPlayStatus.IsPrevTrackAvailable != data.IsPrevTrackAvailable);\n\n                    LastPlayStatus.AlbumId = data.AlbumId;\n                    LastPlayStatus.ArtistId = data.ArtistId;\n                    LastPlayStatus.ArtistName = data.ArtistName;\n                    LastPlayStatus.ProgressedMilliseconds = data.ElapsedTime;\n                    LastPlayStatus.SongLengthMilliseconds = data.TotalTime;\n                    LastPlayStatus.SongId = data.TrackId;\n                    LastPlayStatus.SongName = data.TrackName;\n                    LastPlayStatus.IsPlaying = data.IsPlaying;\n                    LastPlayStatus.Volume = data.Volume;\n                    LastPlayStatus.IsNextTrackAvailable = data.IsNextTrackAvailable;\n                    LastPlayStatus.IsPrevTrackAvailable = data.IsPrevTrackAvailable;\n\n                    try\n                    {\n                        var album = await GlobalCache.Album.GetItem(data.AlbumId);\n                        LastPlayStatus.AlbumName = album.name;\n                    }\n                    catch (Exception ex)\n                    {\n                        logger.Info(\"LocalPlaybackDataReceived:GetAlbumInfo failed: \" + ex.ToString());\n                    }\n\n                    if (changed)\n                    {\n                        LastPlayStatus.InvokeUpdated();\n                        logger.Info(\"LocalPlaybackDataReceived and changed = true for \" + data.TrackFingerprint);\n                    }\n\n                    lastStatusFetch = DateTime.UtcNow;\n                    IsLocalStatusTrackingOperational = true;\n                }\n\n                lastLocalFingerprint = data.TrackFingerprint;\n            }\n            catch (Exception ex)\n            {\n                logger.Info(\"LocalPlaybackDataReceived failed: \" + ex.ToString());\n            }\n        }\n\n        public static async Task RefreshPlayStatus()\n        {\n            try\n            {\n                // Don't ask API if local status tracking is working correctly.\n                if (IsLocalStatusTrackingOperational)\n                    return;\n\n                lastStatusFetch = DateTime.UtcNow;\n\n                var player = new Player();\n                var current = await player.GetCurrentlyPlaying();\n\n                //if (current == null)\n                //{\n                //    LastPlayStatus.AlbumId = \"\";\n                //    LastPlayStatus.AlbumName = \"\";\n                //    LastPlayStatus.ArtistId = \"\";\n                //    LastPlayStatus.ArtistName = \"\";\n                //    LastPlayStatus.ProgressedMilliseconds = 0;\n                //    LastPlayStatus.SongLengthMilliseconds = 0;\n                //    LastPlayStatus.SongId = \"\";\n                //    LastPlayStatus.SongName = \"\";\n                //    LastPlayStatus.IsPlaying = false;\n                //    LastPlayStatus.Volume = 0.0;\n                //\n                //    LastPlayStatus.InvokeUpdated();\n                //}\n                //else\n                if (current != null)\n                {\n                    LastPlayStatus.AlbumId = current.item.album.id;\n                    LastPlayStatus.AlbumName = current.item.album.name;\n                    LastPlayStatus.ArtistId = current.item.artists.FirstOrDefault().id ?? \"\";\n                    LastPlayStatus.ArtistName = current.item.artists.FirstOrDefault().name ?? \"Unknown Artist\";\n                    LastPlayStatus.ProgressedMilliseconds = current.progress_ms;\n                    LastPlayStatus.SongLengthMilliseconds = current.item.duration_ms;\n                    LastPlayStatus.SongId = current.item.id;\n                    LastPlayStatus.SongName = current.item.name;\n                    LastPlayStatus.IsPlaying = current.is_playing;\n                    LastPlayStatus.Volume = (current.device.volume_percent ?? 50) / 100.0;\n                    LastPlayStatus.IsNextTrackAvailable = true;\n                    LastPlayStatus.IsPrevTrackAvailable = true;\n\n                    LastPlayStatus.InvokeUpdated();\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Info(\"RefreshPlayStatus failed: \" + ex.ToString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Classes/SemaphoreQueue.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Classes\n{\n    public class SemaphoreQueue\n    {\n        private SemaphoreSlim semaphore;\n        private ConcurrentQueue<TaskCompletionSource<bool>> queue = new ConcurrentQueue<TaskCompletionSource<bool>>();\n\n        public int WaitingCount => queue.Count;\n\n        public SemaphoreQueue(int initialCount)\n        {\n            semaphore = new SemaphoreSlim(initialCount);\n        }\n\n        public SemaphoreQueue(int initialCount, int maxCount)\n        {\n            semaphore = new SemaphoreSlim(initialCount, maxCount);\n        }\n\n        public void Wait()\n        {\n            WaitAsync().Wait();\n        }\n\n        public Task WaitAsync()\n        {\n            var tcs = new TaskCompletionSource<bool>();\n            queue.Enqueue(tcs);\n            semaphore.WaitAsync().ContinueWith(t =>\n            {\n                TaskCompletionSource<bool> popped;\n                if (queue.TryDequeue(out popped))\n                    popped.SetResult(true);\n            });\n            return tcs.Task;\n        }\n\n        public void Release()\n        {\n            semaphore.Release();\n        }\n    }\n\n}\n"
  },
  {
    "path": "XpoMusic/Classes/WebViewController.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Classes.Model;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Controls;\nusing Windows.Web.Http;\nusing Windows.Web.Http.Filters;\nusing Newtonsoft.Json;\nusing Windows.UI.Popups;\nusing XpoMusic.SpotifyApi;\nusing Windows.Networking.Connectivity;\n\nnamespace XpoMusic.Helpers\n{\n    public class WebViewController\n    {\n        private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public const string SpotifyPwaUrlBeginsWith = \"https://open.spotify.com\";\n\n        public string LastInitErrors { get; internal set; } = \"\";\n\n        private WebView mainWebView;\n\n        public WebViewController(WebView webView)\n        {\n            mainWebView = webView;\n        }\n\n        public void Navigate(Uri targetUri)\n        {\n            Navigate(targetUri, LocalConfiguration.Language); \n        }\n\n        private void Navigate(Uri targetUri, Language language)\n        {\n            var request = new HttpRequestMessage(HttpMethod.Get, targetUri);\n\n            var languageString = LanguageHelper.GetHeaderLanguageString(language);\n            if (!string.IsNullOrWhiteSpace(languageString))\n                request.Headers.Add(\"Accept-Language\", languageString);\n\n            mainWebView.NavigateWithHttpRequestMessage(request);\n        }\n\n        /// <returns>true if just injected the script, false if it was already injected.</returns>\n        public async Task<bool> InjectInitScript(bool lightTheme)\n        {\n            var checkIfInjected = \"((document.getElementsByTagName('body')[0].getAttribute('data-scriptinjection') == null) ? '0' : '1');\";\n            var injected = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { checkIfInjected });\n\n            if (injected != \"1\")\n            {\n                var script = await AssetManager.LoadAssetString(lightTheme ? \"init-light.js\" : \"init-dark.js\");\n                var styleCss = await AssetManager.LoadAssetString(lightTheme ? \"style-light.min.css\" : \"style-dark.min.css\");\n\n                var tokens = TokenHelper.GetTokens();\n\n                script = script\n                    .Replace(\"{{XPOTIFYCSSBASE64CONTENT}}\", Convert.ToBase64String(Encoding.UTF8.GetBytes(styleCss)))\n                    .Replace(\"{{XPOTIFYISPROVERSION}}\", PackageHelper.IsProVersion ? \"1\" : \"0\")\n                    .Replace(\"{{SPOTIFYACCESSTOKEN}}\", tokens.AccessToken)\n                    .Replace(\"{{DEVICENAME}}\", DeviceInfoHelper.GetDeviceName());\n\n                try\n                {\n                    await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n                }\n                catch (Exception ex)\n                {\n                    logger.Warn(\"InjectInitScript failed: \" + ex.ToString());\n                    AnalyticsHelper.Log(\"injectException\", ex.Message, $\"{LastInitErrors}\\n{ex}\");\n\n                    if (ex.ToString().Contains(\"80020101\"))\n                    {\n                        MessageDialog md = new MessageDialog(\n                            content: $\"Error details:\\r\\n\\r\\n{LastInitErrors}\\r\\n{ex}\", \n                            title: \"There was a problem while initializing Xpo Music. Some features might not work properly.\");\n#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed\n                        md.ShowAsync();\n#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed\n                    }\n                    else\n                    {\n                        MessageDialog md = new MessageDialog(\n                            content: ex.ToString(),\n                            title: \"Xpo Music initialization failed. Some features might not work properly.\");\n#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed\n                        md.ShowAsync();\n#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed\n                    }\n                }\n\n                return true;\n            }\n\n            return false;\n        }\n\n        public async Task<bool> CheckLoggedIn()\n        {\n            var script = await AssetManager.LoadAssetString(\"isLoggedInCheck.js\");\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result != \"0\");\n        }\n\n        public async Task<bool> TryPushingFacebookLoginButton()\n        {\n            var script = await AssetManager.LoadAssetString(\"clickOnFacebookLogin.js\");\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public async Task EnableNowPlaying()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.enableNowPlaying();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n\n        public async Task<bool> GoBackIfPossible()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.goBackIfPossible();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public void ClearCookies()\n        {\n            // WebView.ClearTemporaryWebDataAsync() causes cookies (that will be added later) to not \n            // be saved upon app exit during current session. It seems to be a bug. \n            // So we can't use that to clear cookies.\n\n            ClearCookies(new Uri(\"https://www.spotify.com\"));\n            ClearCookies(new Uri(\"https://spotify.com\"));\n            ClearCookies(new Uri(\"https://accounts.spotify.com\"));\n            ClearCookies(new Uri(\"https://open.spotify.com\"));\n            ClearCookies(new Uri(\"https://facebook.com\"));\n            ClearCookies(new Uri(\"https://www.facebook.com\"));\n        }\n\n        private void ClearCookies(Uri uri)\n        {\n            HttpBaseProtocolFilter baseFilter = new HttpBaseProtocolFilter();\n            foreach (var cookie in baseFilter.CookieManager.GetCookies(uri))\n            {\n                baseFilter.CookieManager.DeleteCookie(cookie);\n            }\n        }\n\n        public async Task<string> GetPageUrl()\n        {\n            return await mainWebView.InvokeScriptAsync(\"eval\", new string[] { \"window.location.href\" });\n        }\n\n        public async Task<string> GetPageTitle()\n        {\n            var findPageTitleScript = \"window.XpoMusicScript.Common.PageTitleFinder.getTitle();\";\n            var pageTitle = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { findPageTitleScript });\n\n            return pageTitle;\n        }\n\n        public async Task NavigateToSpotifyUrl(string url)\n        {\n            var currentUrl = await mainWebView.InvokeScriptAsync(\"eval\", new String[] { \"document.location.href;\" });\n\n            if (currentUrl.ToLower().StartsWith(SpotifyPwaUrlBeginsWith.ToLower()))\n            {\n                var script = $\"window.XpoMusicScript.Common.Action.navigateToPage('{url.Replace(\"'\", \"\\\\'\")}');\";\n                await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n            }\n            else\n            {\n                Navigate(new Uri(url));\n            }\n        }\n\n        internal async Task AutoPlay(AutoPlayAction action)\n        {\n            string script;\n            if (action == AutoPlayAction.Track)\n                script = \"window.XpoMusicScript.Common.Action.autoPlayTrack();\";\n            else\n                script = \"window.XpoMusicScript.Common.Action.autoPlayPlaylist();\";\n            \n            var currentPlaying = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n\n        public async Task<string> ClearPlaybackLocalStorage()\n        {\n            var script = await AssetManager.LoadAssetString(\"clearPlaybackLocalStorage.js\");\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return result;\n        }\n\n        public async Task<bool> PlayPause()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.playPause();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public async Task<bool> Play()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.play();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public async Task<bool> Pause()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.pause();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public async Task<bool> NextTrack()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.nextTrack();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        public async Task<bool> PreviousTrack(bool canGoToBeginningOfCurrentSong = true)\n        {\n            string script;\n            if (canGoToBeginningOfCurrentSong)\n                script = \"window.XpoMusicScript.Common.Action.prevTrack();\";\n            else\n                script = \"window.XpoMusicScript.Common.Action.prevTrackForce();\";\n\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        internal async Task<bool> IsPlayingOnThisApp()\n        {\n            var script = \"window.XpoMusicScript.Common.Action.isPlayingOnThisApp();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n\n            return (result == \"1\");\n        }\n\n        internal async Task SeekPlayback(double percentage)\n        {\n            var script = $\"window.XpoMusicScript.Common.Action.seekPlayback({percentage});\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n\n        internal async Task SeekVolume(double percentage)\n        {\n            var script = $\"window.XpoMusicScript.Common.Action.seekVolume({percentage});\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n\n        internal async Task<bool> OnKeyDown(int charCode, bool shiftPressed, bool ctrlPressed, bool altPressed)\n        {\n            var script = $\"window.XpoMusicScript.Common.KeyboardShortcutListener.keyDownExternalCall\" +\n                $\"({charCode}, {shiftPressed.ToString().ToLower()}, {ctrlPressed.ToString().ToLower()}, \" +\n                $\"{altPressed.ToString().ToLower()});\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n            logger.Info(result);\n            return result == \"1\";\n        }\n\n        internal async Task TryResolvePlaybackStartStuck()\n        {\n            var script = $\"window.XpoMusicScript.Common.PlaybackStuckHelper.tryResolveStart();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n\n        internal async Task TryResolvePlaybackMiddleStuck()\n        {\n            var script = $\"window.XpoMusicScript.Common.PlaybackStuckHelper.tryResolveMiddle();\";\n            var result = await mainWebView.InvokeScriptAsync(\"eval\", new string[] { script });\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/FlyoutContainer.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.FlyoutContainer\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:flyouts=\"using:XpoMusic.Flyouts\"\n    xmlns:interactivity=\"using:Microsoft.Xaml.Interactivity\"  \n    xmlns:behaviors=\"using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors\" \n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n\n    <Grid x:Name=\"overlay\" Background=\"#00FFFFFF\" Visibility=\"Collapsed\">\n        <VisualStateManager.VisualStateGroups>\n            <VisualStateGroup>\n                <VisualState x:Name=\"OverlayClosedVisualState\">\n                    <Storyboard>\n                        <DoubleAnimation Storyboard.TargetName=\"overlay\" \n                                 Storyboard.TargetProperty=\"(UIElement.Opacity)\"\n                                 Duration=\"0:0:0.25\" From=\"1\" To=\"0\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                        <DoubleAnimation Storyboard.TargetName=\"flyoutContainer\" \n                                 Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\"\n                                 Duration=\"0:0:0.25\" From=\"0\" To=\"-50\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"overlay\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.25\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"OverlayVisibleVisualState\">\n                    <Storyboard>\n                        <DoubleAnimation Storyboard.TargetName=\"overlay\" \n                                         Storyboard.TargetProperty=\"(UIElement.Opacity)\"\n                                         Duration=\"0:0:0.3\" From=\"0\" To=\"1\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                        <DoubleAnimation Storyboard.TargetName=\"flyoutContainer\" \n                                         Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.Y)\"\n                                         Duration=\"0:0:0.3\" From=\"50\" To=\"0\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"overlay\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n            </VisualStateGroup>\n        </VisualStateManager.VisualStateGroups>\n        \n        <Grid>\n            <interactivity:Interaction.Behaviors>\n                <behaviors:Blur x:Name=\"blurBehavior\" \n                                Value=\"24\" \n                                Duration=\"0\" \n                                Delay=\"0\" \n                                AutomaticallyStart=\"True\"/>\n            </interactivity:Interaction.Behaviors>\n        </Grid>\n        <Grid x:Name=\"flyoutContainer\" Margin=\"0,40,0,40\">\n            <Grid.RenderTransform>\n                <TranslateTransform />\n            </Grid.RenderTransform>\n            <flyouts:DeveloperMessageFlyout x:Name=\"developerMessageFlyout\"\n                                            Visibility=\"Collapsed\"\n                                            Width=\"400\"\n                                            MaxHeight=\"300\"\n                                            FlyoutCloseRequest=\"DeveloperMessageFlyout_FlyoutCloseRequest\" />\n            <flyouts:WhatsNewFlyout x:Name=\"whatsNewFlyout\"\n                                    Visibility=\"Collapsed\"\n                                    Width=\"400\"\n                                    MaxHeight=\"400\"\n                                    FlyoutCloseRequest=\"WhatsNewFlyout_FlyoutCloseRequest\" />\n            <flyouts:SettingsFlyout x:Name=\"settingsFlyout\"\n                                    Visibility=\"Collapsed\"\n                                    MaxHeight=\"470\"\n                                    FlyoutCloseRequest=\"SettingsFlyout_FlyoutCloseRequest\" />\n        </Grid>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/FlyoutContainer.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Helpers;\nusing XpoMusic.XpotifyApi.Model;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class FlyoutContainer : UserControl\n    {\n        public FlyoutContainer()\n        {\n            this.InitializeComponent();\n        }\n\n        public void OpenSettings()\n        {\n            OpenSettings(0);\n        }\n\n        public void OpenHelp()\n        {\n            OpenSettings(1);\n        }\n\n        public void OpenAbout()\n        {\n            OpenSettings(2);\n        }\n\n        public void OpenDonate()\n        {\n            OpenSettings(3);\n        }\n\n        private void OpenSettings(int tabId)\n        {\n            settingsFlyout.InitFlyout(tabId);\n            settingsFlyout.Visibility = Visibility.Visible;\n            VisualStateManager.GoToState(this, nameof(OverlayVisibleVisualState), false);\n        }\n\n        public async void OpenWhatsNew()\n        {\n            await Task.Delay(500);\n\n            whatsNewFlyout.InitFlyout();\n            whatsNewFlyout.Visibility = Visibility.Visible;\n            VisualStateManager.GoToState(this, nameof(OverlayVisibleVisualState), false);\n\n            AnalyticsHelper.Log(\"flyoutShow\", \"whatsNew\", PackageHelper.GetAppVersionString());\n        }\n\n        public async void OpenDeveloperMessage(DeveloperMessage message)\n        {\n            await Task.Delay(700);\n\n            while (whatsNewFlyout.Visibility == Visibility.Visible)\n                await Task.Delay(500);\n\n            developerMessageFlyout.InitFlyout(message);\n            developerMessageFlyout.Visibility = Visibility.Visible;\n            VisualStateManager.GoToState(this, nameof(OverlayVisibleVisualState), false);\n\n            AnalyticsHelper.Log(\"flyoutShow\", \"developerMessage\", message.id);\n        }\n\n        private void WhatsNewFlyout_FlyoutCloseRequest(object sender, EventArgs e)\n        {\n            CloseOverlays();\n        }\n\n        private void SettingsFlyout_FlyoutCloseRequest(object sender, EventArgs e)\n        {\n            CloseOverlays();\n        }\n\n        private void DeveloperMessageFlyout_FlyoutCloseRequest(object sender, EventArgs e)\n        {\n            CloseOverlays();\n        }\n\n        private async void CloseOverlays()\n        {\n            VisualStateManager.GoToState(this, nameof(OverlayClosedVisualState), false);\n\n            await Task.Delay(300);\n\n            developerMessageFlyout.Visibility = Visibility.Collapsed;\n            whatsNewFlyout.Visibility = Visibility.Collapsed;\n            settingsFlyout.Visibility = Visibility.Collapsed;\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/NowPlayingView.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.NowPlayingView\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:controls=\"using:Microsoft.Toolkit.Uwp.UI.Controls\"\n    xmlns:interactivity=\"using:Microsoft.Xaml.Interactivity\" \n    xmlns:core=\"using:Microsoft.Xaml.Interactions.Core\"\n    xmlns:media=\"using:Microsoft.Xaml.Interactions.Media\"\n    xmlns:vm=\"using:XpoMusic.ViewModels\"\n    xmlns:converters=\"using:XpoMusic.Classes.Converters\"\n    xmlns:behaviors=\"using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors\"\n    xmlns:media1=\"using:Microsoft.Toolkit.Uwp.UI.Media\"\n    xmlns:xpotifycontrols=\"using:XpoMusic.Controls\"\n    mc:Ignorable=\"d\"\n    RequestedTheme=\"Dark\"\n    Loaded=\"UserControl_Loaded\"\n    SizeChanged=\"UserControl_SizeChanged\"\n    PointerPressed=\"UserControl_PointerPressed\"\n    PointerMoved=\"UserControl_PointerMoved\"\n    PointerReleased=\"UserControl_PointerReleased\"\n    PointerExited=\"UserControl_PointerExited\"\n    d:DesignHeight=\"400\"\n    d:DesignWidth=\"400\">\n\n    <UserControl.DataContext>\n        <vm:NowPlayingViewModel x:Name=\"ViewModel\" />\n    </UserControl.DataContext>\n\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <converters:MillisecondsToMinSecConverter x:Name=\"MillisecondsToMinSecConverter\" />\n            <Storyboard x:Name=\"hideToLeftStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\"\n                                 Duration=\"0:0:0.4\" \n                                 To=\"{x:Bind ViewModel.StoryboardOffsetNegative, Mode=OneWay}\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 Duration=\"0:0:0.4\" To=\"0\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n            </Storyboard>\n            <Storyboard x:Name=\"hideToRightStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\"\n                                 Duration=\"0:0:0.4\" \n                                 To=\"{x:Bind ViewModel.StoryboardOffset, Mode=OneWay}\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 Duration=\"0:0:0.4\" To=\"0\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n            </Storyboard>\n            <Storyboard x:Name=\"hideQuickStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 Duration=\"0:0:0\" To=\"0\">\n                </DoubleAnimation>\n            </Storyboard>\n            <Storyboard x:Name=\"showFromLeftStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\"\n                                 Duration=\"0:0:0.4\" \n                                 From=\"{x:Bind ViewModel.StoryboardOffsetNegative, Mode=OneWay}\" \n                                 To=\"0\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 Duration=\"0:0:0.4\" From=\"0\" To=\"1\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"swipeTranslateTransform\"\n                                 Storyboard.TargetProperty=\"(TranslateTransform.X)\"\n                                 Duration=\"0:0:0\"\n                                 To=\"0\" />\n            </Storyboard>\n            <Storyboard x:Name=\"showFromRightStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"(UIElement.RenderTransform).(TranslateTransform.X)\"\n                                 Duration=\"0:0:0.4\" \n                                 From=\"{x:Bind ViewModel.StoryboardOffset, Mode=OneWay}\" \n                                 To=\"0\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"animatedPanel\" \n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 Duration=\"0:0:0.4\" From=\"0\" To=\"1\">\n                    <DoubleAnimation.EasingFunction>\n                        <CubicEase EasingMode=\"EaseOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"swipeTranslateTransform\"\n                                 Storyboard.TargetProperty=\"(TranslateTransform.X)\"\n                                 Duration=\"0:0:0\"\n                                 To=\"0\" />\n            </Storyboard>\n        </ResourceDictionary>\n    </UserControl.Resources>\n\n    <Grid x:Name=\"mainGrid\">\n        <VisualStateManager.VisualStateGroups>\n            <VisualStateGroup>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowWidth=\"800\" MinWindowHeight=\"600\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"artistName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"albumArtContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"contentPanel.VerticalAlignment\" Value=\"Bottom\" />\n                        <Setter Target=\"contentPanel.Margin\" Value=\"0,0,0,60\" />\n                        <Setter Target=\"musicSliderContainer.Margin\" Value=\"36,12,36,0\" />\n                        <Setter Target=\"largeButtonsContainer.Margin\" Value=\"36,4,36,0\" />\n                        <Setter Target=\"progressBar.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"smallButtonsContainer.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"largeButtonsContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"musicSliderContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"songName.FontSize\" Value=\"28\" />\n                        <Setter Target=\"songName.FontWeight\" Value=\"Bold\" />\n                        <Setter Target=\"songName.(RelativePanel.RightOf)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"songName.(RelativePanel.Above)\" Value=\"artistName\" />\n                        <Setter Target=\"songName.(RelativePanel.AlignLeftWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"songName.(RelativePanel.AlignRightWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"songName.(RelativePanel.Below)\" Value=\"\" />\n                        <Setter Target=\"albumArt.Width\" Value=\"150\" />\n                        <Setter Target=\"albumArt.Height\" Value=\"150\" />\n                        <Setter Target=\"albumName.FontSize\" Value=\"22\" />\n                        <Setter Target=\"artistAndAlbumSeparator.FontSize\" Value=\"22\" />\n                        <Setter Target=\"artistName.FontSize\" Value=\"22\" />\n                        <Setter Target=\"artistName.Margin\" Value=\"8,4,8,40\" />\n                        <Setter Target=\"artistName.(RelativePanel.RightOf)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignBottomWith)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignLeftWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignRightWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"artistName.(RelativePanel.Below)\" Value=\"\" />\n                        <Setter Target=\"albumArtContainer.(RelativePanel.AlignHorizontalCenterWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"albumArtContainer.Margin\" Value=\"36,0,12,0\" />\n                        <Setter Target=\"smallOptionsButton.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"xpotifyLogo.Margin\" Value=\"6,0,0,6\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Visibility\" Value=\"Collapsed\" />\n                    </VisualState.Setters>\n                </VisualState>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowWidth=\"370\" MinWindowHeight=\"290\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"artistName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"albumArtContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"contentPanel.VerticalAlignment\" Value=\"Bottom\" />\n                        <Setter Target=\"contentPanel.Margin\" Value=\"0,0,0,40\" />\n                        <Setter Target=\"progressBar.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"smallButtonsContainer.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"largeButtonsContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"musicSliderContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"songName.FontSize\" Value=\"22\" />\n                        <Setter Target=\"songName.FontWeight\" Value=\"Bold\" />\n                        <Setter Target=\"songName.(RelativePanel.RightOf)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"songName.(RelativePanel.Above)\" Value=\"artistName\" />\n                        <Setter Target=\"songName.(RelativePanel.AlignLeftWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"songName.(RelativePanel.AlignRightWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"songName.(RelativePanel.Below)\" Value=\"\" />\n                        <Setter Target=\"artistName.FontSize\" Value=\"18\" />\n                        <Setter Target=\"artistName.(RelativePanel.RightOf)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignBottomWith)\" Value=\"albumArtContainer\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignLeftWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"artistName.(RelativePanel.AlignRightWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"artistName.(RelativePanel.Below)\" Value=\"\" />\n                        <Setter Target=\"albumArtContainer.(RelativePanel.AlignHorizontalCenterWithPanel)\" Value=\"False\" />\n                        <Setter Target=\"albumArtContainer.Margin\" Value=\"24,0,12,0\" />\n                        <Setter Target=\"smallOptionsButton.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"xpotifyLogo.Margin\" Value=\"6,0,0,6\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Visibility\" Value=\"Collapsed\" />\n                    </VisualState.Setters>\n                </VisualState>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowHeight=\"180\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"songName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"songName.FontWeight\" Value=\"Bold\" />\n                        <Setter Target=\"artistName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"smallButtonsContainer.Margin\" Value=\"0,0,0,0\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Margin\" Value=\"0,0,0,60\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Width\" Value=\"28\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Height\" Value=\"28\" />\n                    </VisualState.Setters>\n                </VisualState>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowHeight=\"290\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"albumArtContainer.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"songName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"songName.FontWeight\" Value=\"Bold\" />\n                        <Setter Target=\"artistName.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"smallButtonsContainer.Margin\" Value=\"0,0,0,0\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Margin\" Value=\"0,0,0,60\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Width\" Value=\"32\" />\n                        <Setter Target=\"nextTrackLoadingProgressRing.Height\" Value=\"32\" />\n                    </VisualState.Setters>\n                </VisualState>\n            </VisualStateGroup>\n            <VisualStateGroup>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowWidth=\"450\" MinWindowHeight=\"290\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"artistAndAlbumSeparator.Visibility\" Value=\"Visible\" />\n                        <Setter Target=\"albumName.Visibility\" Value=\"Visible\" />\n                    </VisualState.Setters>\n                </VisualState>\n            </VisualStateGroup>\n            <VisualStateGroup>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <StateTrigger IsActive=\"{x:Bind ViewModel.IsCompactOverlayViewMode, Mode=OneWay}\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"showNowPlayingListButton.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"miniViewButton.Visibility\" Value=\"Collapsed\" />\n                        <Setter Target=\"fullScreenButton.Visibility\" Value=\"Collapsed\" />\n                    </VisualState.Setters>\n                </VisualState>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <StateTrigger IsActive=\"{x:Bind ViewModel.IsNormalViewMode, Mode=OneWay}\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                    </VisualState.Setters>\n                </VisualState>\n            </VisualStateGroup>\n        </VisualStateManager.VisualStateGroups>\n\n        <Grid Background=\"#888888\">\n            <Grid x:Name=\"backgroundArtContainer\">\n                <Grid.Background>\n                    <ImageBrush ImageSource=\"{x:Bind ViewModel.BackgroundArt, Mode=OneWay}\" Stretch=\"UniformToFill\">\n                        <interactivity:Interaction.Behaviors>\n                            <core:EventTriggerBehavior EventName=\"ImageOpened\">\n                                <media:ControlStoryboardAction ControlStoryboardOption=\"Play\">\n                                    <media:ControlStoryboardAction.Storyboard>\n                                        <Storyboard>\n                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\"\n                                                                           Storyboard.TargetName=\"backgroundArtContainer\">\n                                                <EasingDoubleKeyFrame KeyTime=\"0\" Value=\"0\"/>\n                                                <EasingDoubleKeyFrame KeyTime=\"0:0:0.3\" Value=\"1\"/>\n                                            </DoubleAnimationUsingKeyFrames>\n                                        </Storyboard>\n                                    </media:ControlStoryboardAction.Storyboard>\n                                </media:ControlStoryboardAction>\n                            </core:EventTriggerBehavior>\n                        </interactivity:Interaction.Behaviors>\n                    </ImageBrush>\n                </Grid.Background>\n            </Grid>\n        </Grid>\n        <Grid Background=\"#66000000\" x:Name=\"mainBackgroundGrid\">\n        </Grid>\n        <Grid x:Name=\"blurBackground\" \n              Visibility=\"{x:Bind ViewModel.BlurEnabled, Mode=OneWay, ConverterParameter={StaticResource BooleanToVisibilityConverter}}\">\n            <Grid.Background>\n                <media1:BackdropBlurBrush Amount=\"30\" />\n            </Grid.Background>\n        </Grid>\n        <Grid>\n            <ProgressRing x:Name=\"nextTrackLoadingProgressRing\" \n                          IsActive=\"{x:Bind ViewModel.ProgressRingActive, Mode=OneWay}\"\n                          Foreground=\"White\"\n                          IsHitTestVisible=\"False\"\n                          Margin=\"0,0,0,54\"\n                          Width=\"20\"\n                          Height=\"20\" />\n\n            <StackPanel x:Name=\"contentPanel\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Stretch\">\n                <Grid x:Name=\"animatedPanelContainer\">\n                    <Grid.RenderTransform>\n                        <TranslateTransform x:Name=\"swipeTranslateTransform\" />\n                    </Grid.RenderTransform>\n                    <RelativePanel x:Name=\"animatedPanel\">\n                        <RelativePanel.RenderTransform>\n                            <TranslateTransform />\n                        </RelativePanel.RenderTransform>\n                        <controls:DropShadowPanel x:Name=\"albumArtContainer\" \n                                                  RelativePanel.AlignHorizontalCenterWithPanel=\"True\"\n                                                  BlurRadius=\"40.0\" \n                                                  ShadowOpacity=\"1\"\n                                                  OffsetX=\"0.0\" \n                                                  OffsetY=\"0.0\" \n                                                  Color=\"#111\"\n                                                  Background=\"Transparent\" \n                                                  Opacity=\"{x:Bind ViewModel.AlbumArtContainerOpacity, Mode=TwoWay}\"\n                                                  Visibility=\"Collapsed\"\n                                                  IsHitTestVisible=\"False\">\n                            <Grid x:Name=\"albumArt\" \n                                  ToolTipService.ToolTip=\"{x:Bind ViewModel.AlbumName, Mode=OneWay}\"\n                                  Width=\"100\" \n                                  Height=\"100\">\n                                <Grid.Background>\n                                    <ImageBrush ImageSource=\"{x:Bind ViewModel.AlbumArt, Mode=OneWay}\"\n                                                Stretch=\"UniformToFill\">\n                                        <interactivity:Interaction.Behaviors>\n                                            <core:EventTriggerBehavior EventName=\"ImageOpened\">\n                                                <media:ControlStoryboardAction ControlStoryboardOption=\"Play\">\n                                                    <media:ControlStoryboardAction.Storyboard>\n                                                        <Storyboard>\n                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Opacity)\"\n                                                                                           Storyboard.TargetName=\"albumArtContainer\">\n                                                                <EasingDoubleKeyFrame KeyTime=\"0:0:0\" Value=\"0\"/>\n                                                                <EasingDoubleKeyFrame KeyTime=\"0:0:0.3\" Value=\"1\"/>\n                                                            </DoubleAnimationUsingKeyFrames>\n                                                        </Storyboard>\n                                                    </media:ControlStoryboardAction.Storyboard>\n                                                </media:ControlStoryboardAction>\n                                            </core:EventTriggerBehavior>\n                                        </interactivity:Interaction.Behaviors>\n                                    </ImageBrush>\n                                </Grid.Background>\n                            </Grid>\n                        </controls:DropShadowPanel>\n                        <TextBlock x:Name=\"songName\" \n                                   RelativePanel.AlignLeftWithPanel=\"True\"\n                                   RelativePanel.AlignRightWithPanel=\"True\"\n                                   RelativePanel.Below=\"albumArtContainer\"\n                                   Text=\"{x:Bind ViewModel.SongName, Mode=OneWay}\"\n                                   Margin=\"8,16,8,0\"\n                                   Visibility=\"Visible\"\n                                   IsHitTestVisible=\"False\"\n                                   TextAlignment=\"Center\"\n                                   FontWeight=\"SemiBold\" />\n                        <TextBlock x:Name=\"artistName\"\n                                   RelativePanel.AlignLeftWithPanel=\"True\"\n                                   RelativePanel.AlignRightWithPanel=\"True\"\n                                   RelativePanel.Below=\"songName\"\n                                   Text=\"{x:Bind ViewModel.ArtistName, Mode=OneWay}\"\n                                   Margin=\"8,4,8,20\"\n                                   Visibility=\"Collapsed\"\n                                   IsHitTestVisible=\"False\"\n                                   TextAlignment=\"Center\"\n                                   FontWeight=\"Normal\" />\n                        <TextBlock x:Name=\"artistAndAlbumSeparator\" \n                                   Visibility=\"Collapsed\"\n                                   Text=\"&#x2022;\"\n                                   FontSize=\"18\"\n                                   Margin=\"0,4,0,0\"\n                                   RelativePanel.RightOf=\"artistName\"\n                                   RelativePanel.AlignTopWith=\"artistName\"/>\n                        <TextBlock x:Name=\"albumName\" \n                                   Visibility=\"Collapsed\"\n                                   Text=\"{x:Bind ViewModel.AlbumName, Mode=OneWay}\"\n                                   Margin=\"8,4,4,0\"\n                                   FontSize=\"18\"\n                                   RelativePanel.RightOf=\"artistAndAlbumSeparator\"\n                                   RelativePanel.AlignTopWith=\"artistAndAlbumSeparator\"/>\n                    </RelativePanel>\n                </Grid>\n                <Grid x:Name=\"musicSliderContainer\"\n                      Height=\"40\"\n                      Visibility=\"Collapsed\"\n                      Margin=\"24,12,24,0\">\n                    <Grid.ColumnDefinitions>\n                        <ColumnDefinition Width=\"Auto\" />\n                        <ColumnDefinition Width=\"*\" />\n                        <ColumnDefinition Width=\"Auto\" />\n                    </Grid.ColumnDefinitions>\n                    <TextBlock Grid.Column=\"0\" \n                               Text=\"{x:Bind ViewModel.ProgressBarValue, Mode=OneWay, Converter={StaticResource MillisecondsToMinSecConverter}}\"\n                               Visibility=\"{x:Bind ViewModel.ProgressRingActive, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Reverse}\"\n                               VerticalAlignment=\"Center\" />\n                    <xpotifycontrols:SliderExtended Grid.Column=\"1\"\n                                                    VerticalAlignment=\"Center\"\n                                                    KeyboardStepFrequency=\"10000\"\n                                                    ContinousUpdateWhileDragging=\"False\"\n                                                    ThumbToolTipValueConverter=\"{StaticResource MillisecondsToMinSecConverter}\"\n                                                    Value2=\"{x:Bind ViewModel.ProgressBarValue, Mode=OneWay}\"\n                                                    Maximum=\"{x:Bind ViewModel.ProgressBarMaximum, Mode=OneWay}\"\n                                                    Margin=\"12,4,12,0\"\n                                                    Visibility=\"{x:Bind ViewModel.ProgressRingActive, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Reverse}\"\n                                                    ValueChangedByUserManipulation=\"PlaybackSlider_ValueChangedByUserManipulation\"/>\n                    <ProgressBar Grid.Column=\"1\" \n                                 VerticalAlignment=\"Center\"\n                                 Margin=\"12,4,12,0\"\n                                 IsIndeterminate=\"True\"\n                                 Foreground=\"White\"\n                                 Visibility=\"{x:Bind ViewModel.ProgressRingActive, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}\" />\n                    <TextBlock Grid.Column=\"2\" \n                               Text=\"{x:Bind ViewModel.ProgressBarMaximum, Mode=OneWay, Converter={StaticResource MillisecondsToMinSecConverter}}\"\n                               Visibility=\"{x:Bind ViewModel.ProgressRingActive, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Reverse}\"\n                               VerticalAlignment=\"Center\" />\n                </Grid>\n                <Grid x:Name=\"largeButtonsContainer\" \n                      Visibility=\"Collapsed\"\n                      Margin=\"24,4,24,0\"\n                      RelativePanel.AlignLeftWithPanel=\"True\"\n                      RelativePanel.AlignRightWithPanel=\"True\"\n                      RelativePanel.Below=\"musicSliderContainer\">\n                    <StackPanel Orientation=\"Horizontal\"\n                                Margin=\"0,0,0,0\"\n                                HorizontalAlignment=\"Left\">\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                IsEnabled=\"{x:Bind ViewModel.PrevButtonEnabled, Mode=OneWay}\"\n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"0,0,4,0\"\n                                Click=\"PrevTrackButton_Click\"\n                                Background=\"Transparent\"\n                                ToolTipService.ToolTip=\"Previous track\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE100;\" />\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                Visibility=\"{x:Bind ViewModel.PlayButtonVisibility, Mode=OneWay}\"\n                                IsEnabled=\"{x:Bind ViewModel.PlayPauseButtonEnabled, Mode=OneWay}\"\n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"PlayButton_Click\"\n                                Background=\"Transparent\"\n                                ToolTipService.ToolTip=\"Play\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE102;\" />\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                Visibility=\"{x:Bind ViewModel.PauseButtonVisibility, Mode=OneWay}\"\n                                IsEnabled=\"{x:Bind ViewModel.PlayPauseButtonEnabled, Mode=OneWay}\"\n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"PauseButton_Click\"\n                                Background=\"Transparent\" \n                                ToolTipService.ToolTip=\"Pause\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE103;\" />\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                IsEnabled=\"{x:Bind ViewModel.NextButtonEnabled, Mode=OneWay}\"\n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"NextTrackButton_Click\"\n                                Background=\"Transparent\" \n                                ToolTipService.ToolTip=\"Next track\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE101;\" />\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Background=\"Transparent\" \n                                ToolTipService.ToolTip=\"Volume\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"{x:Bind ViewModel.VolumeIconGlyph, Mode=OneWay}\" />\n                            <Button.Flyout>\n                                <Flyout>\n                                    <Grid Width=\"140\" Height=\"40\">\n                                        <xpotifycontrols:SliderExtended Grid.Column=\"2\"\n                                                                        KeyboardStepFrequency=\"10\"\n                                                                        VerticalAlignment=\"Center\"\n                                                                        ContinousUpdateWhileDragging=\"True\"\n                                                                        IsThumbToolTipEnabled=\"True\"\n                                                                        Value2=\"{x:Bind ViewModel.Volume, Mode=TwoWay}\"\n                                                                        Maximum=\"100\"\n                                                                        PointerWheelChanged=\"VolumeSlider_PointerWheelChanged\"\n                                                                        ValueChangedByUserManipulation=\"VolumeSlider_ValueChangedByUserManipulation\"/>\n                                    </Grid>\n                                </Flyout>\n                            </Button.Flyout>\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"SaveToYourLibrary_Click\"\n                                Background=\"Transparent\" \n                                Visibility=\"{x:Bind ViewModel.IsSavedToLibrary, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=Reverse}\" \n                                ToolTipService.ToolTip=\"Save to your liked songs\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xEB51;\" />\n                        </Button>\n                        <Button Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"RemoveFromYourLibrary_Click\"\n                                Background=\"Transparent\" \n                                Visibility=\"{x:Bind ViewModel.IsSavedToLibrary, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}\" \n                                ToolTipService.ToolTip=\"Remove from your liked songs\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xEB52;\" Foreground=\"ForestGreen\" />\n                        </Button>\n                    </StackPanel>\n                    <StackPanel Orientation=\"Horizontal\"\n                                Margin=\"0,0,0,0\"\n                                HorizontalAlignment=\"Right\">\n                        <Button x:Name=\"showNowPlayingListButton\" \n                                Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"0,0,4,0\"\n                                Click=\"ShowNowPlayingListButton_Click\"\n                                Background=\"Transparent\"\n                                ToolTipService.ToolTip=\"Show now playing list\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE292;\" />\n                        </Button>\n                        <Button x:Name=\"miniViewButton\" \n                                Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"MiniViewButton_Click\"\n                                Background=\"Transparent\"\n                                ToolTipService.ToolTip=\"Mini view\">\n                            <Grid Margin=\"2,3,2,-4\">\n                                <FontIcon FontFamily=\"Segoe MDL2 Assets\" \n                                            VerticalAlignment=\"Top\"\n                                            HorizontalAlignment=\"Left\"\n                                            FontSize=\"20\" \n                                            Glyph=\"&#xE7FB;\" />\n                                <FontIcon FontFamily=\"Segoe MDL2 Assets\" \n                                            VerticalAlignment=\"Top\"\n                                            HorizontalAlignment=\"Left\"\n                                            FontSize=\"10\" \n                                            Margin=\"6.5,1.5,0,0\"\n                                            Glyph=\"&#xEB9F;\" />\n                            </Grid>\n                        </Button>\n                        <Button x:Name=\"fullScreenButton\" \n                                Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,4,0\"\n                                Click=\"FullScreenButton_Click\"\n                                Background=\"Transparent\" \n                                ToolTipService.ToolTip=\"Full screen\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE740;\" />\n                        </Button>\n                        <Button x:Name=\"optionsButton\" \n                                Style=\"{StaticResource CircleButtonStyle}\" \n                                Width=\"40\"\n                                Height=\"40\"\n                                Margin=\"4,0,0,0\"\n                                Background=\"Transparent\">\n                            <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE10C;\" />\n                            <Button.Flyout>\n                                <MenuFlyout>\n                                    <ToggleMenuFlyoutItem Text=\"Show artist art\" \n                                                          IsChecked=\"{x:Bind ViewModel.ShowArtistArt, Mode=TwoWay}\"/>\n                                </MenuFlyout>\n                            </Button.Flyout>\n                        </Button>\n                    </StackPanel>\n                </Grid>\n                <StackPanel x:Name=\"smallButtonsContainer\" \n                            Margin=\"0,8,0,0\"\n                            Orientation=\"Horizontal\"\n                            HorizontalAlignment=\"Center\">\n                    <Button Style=\"{StaticResource CircleButtonStyle}\" \n                            IsEnabled=\"{x:Bind ViewModel.PrevButtonEnabled, Mode=OneWay}\"\n                            Width=\"40\"\n                            Height=\"40\"\n                            Click=\"PrevTrackButton_Click\"\n                            Background=\"Transparent\"\n                            ToolTipService.ToolTip=\"Previous track\">\n                        <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE100;\" />\n                    </Button>\n                    <Button Style=\"{StaticResource CircleButtonStyle}\" \n                            Visibility=\"{x:Bind ViewModel.PlayButtonVisibility, Mode=OneWay}\"\n                            IsEnabled=\"{x:Bind ViewModel.PlayPauseButtonEnabled, Mode=OneWay}\"\n                            Width=\"54\"\n                            Height=\"54\"\n                            Margin=\"4,0,4,0\"\n                            Click=\"PlayButton_Click\"\n                            Background=\"Transparent\"\n                            ToolTipService.ToolTip=\"Play\">\n                        <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"36\" Glyph=\"&#xE102;\" />\n                    </Button>\n                    <Button Style=\"{StaticResource CircleButtonStyle}\" \n                            Visibility=\"{x:Bind ViewModel.PauseButtonVisibility, Mode=OneWay}\"\n                            IsEnabled=\"{x:Bind ViewModel.PlayPauseButtonEnabled, Mode=OneWay}\"\n                            Width=\"54\"\n                            Height=\"54\"\n                            Margin=\"4,0,4,0\"\n                            Click=\"PauseButton_Click\"\n                            Background=\"Transparent\" \n                            ToolTipService.ToolTip=\"Pause\">\n                        <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"36\" Glyph=\"&#xE103;\" />\n                    </Button>\n                    <Button Style=\"{StaticResource CircleButtonStyle}\" \n                            IsEnabled=\"{x:Bind ViewModel.NextButtonEnabled, Mode=OneWay}\"\n                            Width=\"40\"\n                            Height=\"40\"\n                            Click=\"NextTrackButton_Click\"\n                            Background=\"Transparent\" \n                            ToolTipService.ToolTip=\"Next track\">\n                        <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"24\" Glyph=\"&#xE101;\" />\n                    </Button>\n                </StackPanel>\n            </StackPanel>\n            <ProgressBar x:Name=\"progressBar\" \n                         VerticalAlignment=\"Bottom\"\n                         IsIndeterminate=\"False\"\n                         Value=\"{x:Bind ViewModel.ProgressBarValue, Mode=OneWay}\"\n                         Maximum=\"{x:Bind ViewModel.ProgressBarMaximum, Mode=OneWay}\"\n                         Foreground=\"#77ffffff\" />\n            <Image x:Name=\"xpotifyLogo\" \n                   Source=\"ms-appx-web:///Assets/xpotify-white.png\"\n                   Opacity=\"0.5\"\n                   IsHitTestVisible=\"False\"\n                   Width=\"20\"\n                   Height=\"20\" \n                   Margin=\"4,0,0,8\"\n                   HorizontalAlignment=\"Left\"\n                   VerticalAlignment=\"Bottom\"/>\n            <Grid x:Name=\"titleBarArea\"\n                  Background=\"#01000000\"\n                  Height=\"32\"\n                  HorizontalAlignment=\"Stretch\"\n                  VerticalAlignment=\"Top\" />\n            <Button x:Name=\"backButton\" \n                    Style=\"{StaticResource TopBarDarkButtonStyle}\"\n                    Width=\"46\"\n                    Height=\"32\"\n                    HorizontalAlignment=\"Left\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"Transparent\"\n                    ToolTipService.ToolTip=\"Back\"\n                    Click=\"BackButton_Click\">\n                <FontIcon FontFamily=\"Segoe MDL2 Assets\" \n                          VerticalAlignment=\"Top\"\n                          HorizontalAlignment=\"Left\"\n                          Foreground=\"#ddd\"\n                          FontSize=\"14\" \n                          Glyph=\"&#xE0A6;\" />\n            </Button>\n            <Button x:Name=\"smallOptionsButton\" \n                    Style=\"{StaticResource MinimalButtonStyle}\" \n                    Width=\"40\"\n                    Height=\"40\"\n                    HorizontalAlignment=\"Right\"\n                    VerticalAlignment=\"Bottom\"\n                    Background=\"Transparent\">\n                <FontIcon FontFamily=\"Segoe MDL2 Assets\" FontSize=\"18\" Glyph=\"&#xE10C;\" />\n                <Button.Flyout>\n                    <MenuFlyout>\n                        <ToggleMenuFlyoutItem Text=\"Show artist art\" \n                                              IsChecked=\"{x:Bind ViewModel.ShowArtistArt, Mode=TwoWay}\"/>\n                        <MenuFlyoutItem Text=\"Save to your liked songs\"\n                                        Visibility=\"{x:Bind ViewModel.IsSavedToLibrary, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=Reverse}\" \n                                        Click=\"SaveToYourLibrary_Click\" />\n                        <MenuFlyoutItem Text=\"Remove from your liked songs\"\n                                        Visibility=\"{x:Bind ViewModel.IsSavedToLibrary, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}\"\n                                        Click=\"RemoveFromYourLibrary_Click\" />\n                    </MenuFlyout>\n                </Button.Flyout>\n            </Button>\n        </Grid>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/NowPlayingView.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.UI.ViewManagement;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Input;\nusing XpoMusic.Classes;\nusing XpoMusic.Classes.Cache;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing XpoMusic.SpotifyApi;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class NowPlayingView : UserControl\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        #region Enums\n        public enum NowPlayingViewMode\n        {\n            Normal,\n            CompactOverlay,\n        }\n\n        public enum Action\n        {\n            Back,\n            PlayQueue,\n            SeekPlayback,\n            SeekVolume,\n        }\n\n        private enum AnimationState\n        {\n            None,\n            HiddenToRightSide,\n            HiddenToLeftSide,\n        }\n        #endregion\n\n        #region Custom Properties\n        public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(\n            \"IsOpen\", typeof(bool), typeof(NowPlayingView), new PropertyMetadata(defaultValue: false,\n                propertyChangedCallback: new PropertyChangedCallback(OnIsOpenPropertyChanged)));\n\n        public bool IsOpen\n        {\n            get => (bool)GetValue(IsOpenProperty);\n            set\n            {\n                if (IsOpen != value)\n                    SetValue(IsOpenProperty, value);\n\n                if (IsOpen && !timer.IsEnabled)\n                {\n                    songInfoCache.Clear();\n                    HideNameAndAlbumArtQuick();\n                    SetTopBar();\n                    TryUpdate();\n                    timer.Start();\n                }\n                else if (!IsOpen && timer.IsEnabled)\n                {\n                    OnViewClosed();\n                    timer.Stop();\n                }\n\n                mainGrid.Visibility = value ? Visibility.Visible : Visibility.Collapsed;\n            }\n        }\n\n        private static void OnIsOpenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            (d as NowPlayingView).IsOpen = (bool)e.NewValue;\n        }\n\n        public static readonly DependencyProperty ViewModeProperty = DependencyProperty.Register(\n            \"ViewMode\", typeof(NowPlayingViewMode), typeof(NowPlayingView), new PropertyMetadata(defaultValue: NowPlayingViewMode.Normal,\n                propertyChangedCallback: new PropertyChangedCallback(OnViewModePropertyChanged)));\n\n        public NowPlayingViewMode ViewMode\n        {\n            get => (NowPlayingViewMode)GetValue(ViewModeProperty);\n            set\n            {\n                if (ViewMode != value)\n                    SetValue(ViewModeProperty, value);\n\n                ViewModel.ViewMode = value;\n            }\n        }\n\n        private static void OnViewModePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            (d as NowPlayingView).ViewMode = (NowPlayingViewMode)e.NewValue;\n        }\n        #endregion\n\n        public event EventHandler<ActionRequestedEventArgs> ActionRequested;\n        public FrameworkElement MainBackgroundControl => this.mainBackgroundGrid;\n\n        /// <summary>\n        /// If this variable is set, track change animation will run in reverse direction as a song change is detected.\n        /// NOTE: DO NOT set this variable directly to true, use SetPrevTrackCommandIssued() method, which reverts the\n        /// change automatically after 4 seconds.\n        /// </summary>\n        private bool prevTrackCommandIssued = false;\n\n        private AnimationState animationState = AnimationState.None;\n\n        private DateTime spinnerShowTime = DateTime.MaxValue;\n        private readonly TimeSpan maximumSpinnerShowTime = TimeSpan.FromSeconds(7);\n\n        private DispatcherTimer timer;\n        private string currentSongId = \"\";\n        private bool? currentShowArtistArtState = null;\n        private bool isCompactOverlayFromNowPlaying = false;\n        \n        private SemaphoreQueue volumeSetSemaphore = new SemaphoreQueue(1, 1);\n\n        private SongExtraInfoStore songInfoCache = new SongExtraInfoStore();\n\n        public NowPlayingView()\n        {\n            this.InitializeComponent();\n\n            ViewModel.PropertyChanged += ViewModel_PropertyChanged;\n\n            timer = new DispatcherTimer\n            {\n                Interval = TimeSpan.FromSeconds(1),\n            };\n            timer.Tick += Timer_Tick;\n            timer.Start();\n\n            PlayStatusTracker.LastPlayStatus.Updated += LastPlayStatus_Updated;\n        }\n\n        private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"ShowArtistArt\")\n                TryUpdate();\n        }\n\n        public void ActivateProgressRing()\n        {\n            ViewModel.ProgressRingActive = true;\n        }\n\n        private void LastPlayStatus_Updated(object sender, EventArgs e)\n        {\n            TryUpdate();\n        }\n\n        private void Timer_Tick(object sender, object e)\n        {\n            TryUpdate();\n        }\n\n        private async void TryUpdate()\n        {\n            try\n            {\n                if (!IsOpen)\n                    return;\n\n                await Update();\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"Update failed: \" + ex.ToString());\n            }\n        }\n\n        private async Task Update()\n        {\n            if (ViewModel.ProgressBarValue != ViewModel.ProgressBarMaximum && PlayStatusTracker.LastPlayStatus.ProgressedMilliseconds == ViewModel.ProgressBarMaximum)\n            {\n                // Song just reached the end. refresh status now.\n                RefreshPlayStatus();\n            }\n\n            ViewModel.ProgressBarMaximum = PlayStatusTracker.LastPlayStatus.SongLengthMilliseconds;\n            ViewModel.ProgressBarValue = PlayStatusTracker.LastPlayStatus.ProgressedMilliseconds;\n\n            ViewModel.Volume = PlayStatusTracker.LastPlayStatus.Volume * 100;\n\n            ViewModel.IsPlaying = PlayStatusTracker.LastPlayStatus.IsPlaying;\n\n            ViewModel.PrevButtonEnabled = true;\n            ViewModel.NextButtonEnabled = PlayStatusTracker.LastPlayStatus.IsNextTrackAvailable;\n\n            if (currentSongId != PlayStatusTracker.LastPlayStatus.SongId\n                || currentShowArtistArtState != ViewModel.ShowArtistArt)\n            {\n                currentSongId = PlayStatusTracker.LastPlayStatus.SongId;\n                currentShowArtistArtState = ViewModel.ShowArtistArt;\n\n                if (animationState == AnimationState.None)\n                {\n                    if (prevTrackCommandIssued)\n                    {\n                        prevTrackCommandIssued = false;\n\n                        animationState = AnimationState.HiddenToRightSide;\n                        await hideToRightStoryboard.RunAsync();\n                    }\n                    else\n                    {\n                        animationState = AnimationState.HiddenToLeftSide;\n                        await hideToLeftStoryboard.RunAsync();\n                    }\n                }\n\n                ViewModel.SongName = PlayStatusTracker.LastPlayStatus.SongName;\n                ViewModel.AlbumName = PlayStatusTracker.LastPlayStatus.AlbumName;\n                ViewModel.ArtistName = PlayStatusTracker.LastPlayStatus.ArtistName;\n\n                var albumArtUrl = await SongImageProvider.GetAlbumArt(PlayStatusTracker.LastPlayStatus.AlbumId);\n                if (!string.IsNullOrWhiteSpace(albumArtUrl))\n                    ViewModel.AlbumArtUri = new Uri(albumArtUrl);\n\n                if (ViewModel.ShowArtistArt)\n                {\n                    var artistArtUrl = await SongImageProvider.GetArtistArt(PlayStatusTracker.LastPlayStatus.ArtistId);\n                    if (!string.IsNullOrWhiteSpace(artistArtUrl))\n                    {\n                        ViewModel.BackgroundArtUri = new Uri(artistArtUrl);\n                        ViewModel.BlurEnabled = false;\n                    }\n                }\n                else\n                {\n                    if (!string.IsNullOrWhiteSpace(albumArtUrl))\n                    {\n                        ViewModel.BackgroundArtUri = new Uri(albumArtUrl);\n                        ViewModel.BlurEnabled = true;\n                    }\n                }\n\n                await Task.Delay(200);\n\n                if (animationState == AnimationState.HiddenToRightSide)\n                    showFromLeftStoryboard.Begin();\n                else // None or HiddenToLeftSide\n                    showFromRightStoryboard.Begin();\n\n                ViewModel.ProgressRingActive = false;\n                animationState = AnimationState.None;\n            }\n            else if ((DateTime.UtcNow - spinnerShowTime) > maximumSpinnerShowTime\n                && ViewModel.ProgressRingActive)\n            {\n                // Workaround for when prev track gets pushed when no prev track is there,\n                // or in general when a command fails.\n                // (progress ring should not be shown forever!)\n\n                if (animationState == AnimationState.HiddenToRightSide)\n                    showFromRightStoryboard.Begin();\n                else // None or HiddenToLeftSide\n                    showFromLeftStoryboard.Begin();\n\n                ViewModel.ProgressRingActive = false;\n                animationState = AnimationState.None;\n            }\n\n            try\n            {\n                var extraInfo = await songInfoCache.GetItem(currentSongId);\n                ViewModel.IsSavedToLibrary = extraInfo.IsSavedToLibrary;\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetSongExtraInfo failed: \" + ex.ToString());\n            }\n        }\n\n        private void SetTopBar()\n        {\n            Window.Current.SetTitleBar(titleBarArea);\n        }\n\n        private void OnViewClosed()\n        {\n            ViewModel.BackgroundArtUri = null;\n            ViewModel.AlbumArtUri = null;\n            HideNameAndAlbumArtQuick();\n            currentSongId = \"\";\n            currentShowArtistArtState = null;\n        }\n\n        private void HideNameAndAlbumArtQuick()\n        {\n            hideQuickStoryboard.Begin();\n            animationState = AnimationState.HiddenToLeftSide;\n        }\n\n        private async void RefreshPlayStatus()\n        {\n            await Task.Delay(1000);\n            await PlayStatusTracker.RefreshPlayStatus();\n        }\n\n        private async void BackButton_Click(object sender, RoutedEventArgs e)\n        {\n            var view = ApplicationView.GetForCurrentView();\n            if (view.IsFullScreenMode)\n            {\n                AnalyticsHelper.PageView(\"NowPlaying\");\n                view.ExitFullScreenMode();\n                return;\n            }\n\n            if (isCompactOverlayFromNowPlaying)\n            {\n                HideNameAndAlbumArtQuick();\n                currentSongId = \"\";\n\n                await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);\n\n                isCompactOverlayFromNowPlaying = false;\n                ViewMode = NowPlayingViewMode.Normal;\n\n                AnalyticsHelper.PageView(\"NowPlaying\");\n\n                return;\n            }\n\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Action.Back,\n            });\n        }\n\n        private async void PauseButton_Click(object sender, RoutedEventArgs e)\n        {\n            try\n            {\n                ViewModel.IsPlaying = false;\n                ViewModel.PlayPauseButtonEnabled = false;\n                timer.Stop();\n\n                // This delay is a workaround for PlayPauseButtonEnabled to\n                // update the newly appeared UI. Otherwize it appears after\n                // running PlaybackActionHelper.Play().\n                await Task.Delay(100);\n\n                if (await PlaybackActionHelper.Pause())\n                {\n                    RefreshPlayStatus();\n                    ViewModel.PlayPauseButtonEnabled = true;\n                }\n                else\n                {\n                    ViewModel.IsPlaying = true;\n                    ViewModel.PlayPauseButtonEnabled = true;\n\n                    RefreshPlayStatus();\n                }\n            }\n            catch (UnauthorizedAccessException)\n            {\n                UnauthorizedHelper.OnUnauthorizedError();\n            }\n            finally\n            {\n                ViewModel.PlayPauseButtonEnabled = true;\n                if (!timer.IsEnabled)\n                    timer.Start();\n            }\n        }\n\n        private async void PlayButton_Click(object sender, RoutedEventArgs e)\n        {\n            try\n            {\n                ViewModel.IsPlaying = true;\n                ViewModel.PlayPauseButtonEnabled = false;\n                timer.Stop();\n\n                // This delay is a workaround for PlayPauseButtonEnabled to\n                // update the newly appeared UI. Otherwize it appears after\n                // running PlaybackActionHelper.Play().\n                await Task.Delay(100);\n\n                if (await PlaybackActionHelper.Play())\n                {\n                    RefreshPlayStatus();\n                    ViewModel.PlayPauseButtonEnabled = true;\n                }\n                else\n                {\n                    ViewModel.IsPlaying = false;\n                    ViewModel.PlayPauseButtonEnabled = true;\n\n                    RefreshPlayStatus();\n                }\n            }\n            catch (UnauthorizedAccessException)\n            {\n                UnauthorizedHelper.OnUnauthorizedError();\n            }\n            finally\n            {\n                ViewModel.PlayPauseButtonEnabled = true;\n                if (!timer.IsEnabled)\n                    timer.Start();\n            }\n        }\n\n        private async void PrevTrackButton_Click(object sender, RoutedEventArgs e)\n        {\n            if (PlayStatusTracker.LastPlayStatus.IsPrevTrackAvailable)\n                await PrevTrack(canGoToBeginningOfCurrentSong: true);\n            else\n                ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n                {\n                    Action = Action.SeekPlayback,\n                    AdditionalData = 0.0,\n                });\n        }\n\n        private async Task PrevTrack(bool canGoToBeginningOfCurrentSong)\n        {\n            try\n            {\n                if (!canGoToBeginningOfCurrentSong)\n                    HideToRightAnimation();\n\n                if (!(await PlaybackActionHelper.PreviousTrack(canGoToBeginningOfCurrentSong)))\n                {\n                    if (!canGoToBeginningOfCurrentSong)\n                        showFromRightStoryboard.Begin();\n                    animationState = AnimationState.None;\n                    ViewModel.ProgressRingActive = false;\n                    return;\n                }\n\n                SetPrevTrackCommandIssued();\n                ViewModel.PrevButtonEnabled = false;\n                RefreshPlayStatus();\n                ViewModel.PrevButtonEnabled = true;\n            }\n            catch (UnauthorizedAccessException)\n            {\n                UnauthorizedHelper.OnUnauthorizedError();\n            }\n        }\n\n        private async void NextTrackButton_Click(object sender, RoutedEventArgs e)\n        {\n            await NextTrack();\n        }\n\n        private async Task NextTrack()\n        {\n            try\n            {\n                HideToLeftAnimation();\n\n                if (!(await PlaybackActionHelper.NextTrack()))\n                {\n                    showFromLeftStoryboard.Begin();\n                    animationState = AnimationState.None;\n                    ViewModel.ProgressRingActive = false;\n                    return;\n                }\n\n                ViewModel.NextButtonEnabled = false;\n                RefreshPlayStatus();\n                ViewModel.NextButtonEnabled = PlayStatusTracker.LastPlayStatus.IsNextTrackAvailable;\n            }\n            catch (UnauthorizedAccessException)\n            {\n                UnauthorizedHelper.OnUnauthorizedError();\n            }\n        }\n\n        private async void HideToRightAnimation()\n        {\n            animationState = AnimationState.HiddenToRightSide;\n            spinnerShowTime = DateTime.UtcNow;\n\n            ViewModel.ProgressRingActive = true;\n\n            await hideToRightStoryboard.RunAsync();\n        }\n\n        private async void HideToLeftAnimation()\n        {\n            animationState = AnimationState.HiddenToLeftSide;\n            spinnerShowTime = DateTime.UtcNow;\n\n            ViewModel.ProgressRingActive = true;\n\n            await hideToLeftStoryboard.RunAsync();\n        }\n\n        public void PlayChangeTrackAnimation(bool reverse)\n        {\n            if (reverse)\n            {\n                SetPrevTrackCommandIssued();\n            }\n            else\n            {\n                HideToLeftAnimation();\n            }\n        }\n\n        private Guid lastPrevTrackCommandGuid = Guid.Empty;\n        private async void SetPrevTrackCommandIssued()\n        {\n            var commandGuid = Guid.NewGuid();\n            lastPrevTrackCommandGuid = commandGuid;\n\n            // This is only valid if a change is detected in the next 4 seconds,\n            // otherwise, its value is returned to false.\n            prevTrackCommandIssued = true;\n            await Task.Delay(TimeSpan.FromSeconds(4));\n\n            if (lastPrevTrackCommandGuid != commandGuid)\n                return; // A newer prev command has arrived during the last seconds, so we won't invalidate the prevTrackCommandIssued now.\n\n            prevTrackCommandIssued = false;\n        }\n\n        #region Swipe Gesture\n        const double _minimumDeltaXForSwipe = 20.0;\n        Point? pressStartPoint = null, lastPoint = null;\n        private void UserControl_PointerPressed(object sender, PointerRoutedEventArgs e)\n        {\n            pressStartPoint = e.GetCurrentPoint(null).Position;\n        }\n\n        private void UserControl_PointerMoved(object sender, PointerRoutedEventArgs e)\n        {\n            if (!pressStartPoint.HasValue)\n                return;\n\n            lastPoint = e.GetCurrentPoint(null).Position;\n            var movement = lastPoint.Value.X - pressStartPoint.Value.X;\n\n            if ((!PlayStatusTracker.LastPlayStatus.IsPrevTrackAvailable && movement > 0) ||\n                (!PlayStatusTracker.LastPlayStatus.IsNextTrackAvailable && movement < 0))\n            {\n                movement = 0;\n                pressStartPoint = lastPoint;\n            }\n\n            swipeTranslateTransform.X = movement;\n        }\n\n        private void UserControl_PointerReleased(object sender, PointerRoutedEventArgs e)\n        {\n            if (!pressStartPoint.HasValue)\n                return;\n\n            SwipeFinished(e.GetCurrentPoint(null).Position.X);\n        }\n\n        private async void SwipeFinished(double finalX)\n        {\n            var deltaX = finalX - pressStartPoint.Value.X;\n            pressStartPoint = null;\n\n            if (Math.Abs(deltaX) > _minimumDeltaXForSwipe)\n            {\n                if (deltaX > 0)\n                    await PrevTrack(canGoToBeginningOfCurrentSong: false);\n                else\n                    await NextTrack();\n            }\n            else\n            {\n                swipeTranslateTransform.X = 0;\n            }\n        }\n\n        private void UserControl_PointerExited(object sender, PointerRoutedEventArgs e)\n        {\n            if (!pressStartPoint.HasValue)\n                return;\n            if (!lastPoint.HasValue)\n                return;\n\n            SwipeFinished(lastPoint.Value.X);\n        }\n        #endregion\n\n        private async void UserControl_Loaded(object sender, RoutedEventArgs e)\n        {\n            try\n            {\n                await Update();\n                RefreshPlayStatus();\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"Loaded event failed: \" + ex.ToString());\n            }\n        }\n\n        private void FullScreenButton_Click(object sender, RoutedEventArgs e)\n        {\n            ToggleFullscreen();\n        }\n\n        public void ToggleFullscreen()\n        {\n            var view = ApplicationView.GetForCurrentView();\n            if (view.IsFullScreenMode)\n            {\n                AnalyticsHelper.PageView(\"NowPlaying\");\n                view.ExitFullScreenMode();\n            }\n            else\n            {\n                AnalyticsHelper.PageView(\"NowPlayingFullScreen\");\n                view.TryEnterFullScreenMode();\n            }\n        }\n\n        private async void MiniViewButton_Click(object sender, RoutedEventArgs e)\n        {\n            await SwitchToMiniView();\n        }\n\n        public async Task SwitchToMiniView()\n        {\n            if (ViewMode == NowPlayingViewMode.CompactOverlay)\n                return;\n\n            var viewMode = ViewModePreferences.CreateDefault(ApplicationViewMode.CompactOverlay);\n            viewMode.ViewSizePreference = ViewSizePreference.Custom;\n            viewMode.CustomSize = LocalConfiguration.CompactOverlaySize;\n\n            var modeSwitched = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, viewMode);\n\n            if (modeSwitched)\n            {\n                HideNameAndAlbumArtQuick();\n                currentSongId = \"\";\n                ViewMode = NowPlayingViewMode.CompactOverlay;\n                isCompactOverlayFromNowPlaying = true;\n                AnalyticsHelper.PageView(\"CompactOverlay\");\n            }\n        }\n\n        private void ShowNowPlayingListButton_Click(object sender, RoutedEventArgs e)\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Action.PlayQueue,\n            });\n        }\n\n        private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)\n        {\n            ViewModel.StoryboardOffset = e.NewSize.Width;\n        }\n\n        private void PlaybackSlider_ValueChangedByUserManipulation(object sender, SliderExtendedValueChangedEventArgs e)\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Action.SeekPlayback,\n                AdditionalData = (e.NewValue / ViewModel.ProgressBarMaximum),\n            });\n        }\n\n        private async void VolumeSlider_ValueChangedByUserManipulation(object sender, SliderExtendedValueChangedEventArgs e)\n        {\n            try\n            {\n                await volumeSetSemaphore.WaitAsync();\n\n                // There are new shiny requests waiting, so I'm not needed anymore :(\n                if (volumeSetSemaphore.WaitingCount > 0)\n                    return;\n\n                ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n                {\n                    Action = Action.SeekVolume,\n                    AdditionalData = e.NewValue / 100.0,\n                });\n\n                // Don't overload the SeekVolume request.\n                await Task.Delay(200);\n            }\n            finally\n            {\n                volumeSetSemaphore.Release();\n            }\n        }\n\n        private async void SaveToYourLibrary_Click(object sender, RoutedEventArgs e)\n        {\n            var extraInfo = await songInfoCache.GetItem(currentSongId);\n            extraInfo.IsSavedToLibrary = true;\n            ViewModel.IsSavedToLibrary = true;\n\n            var library = new Library();\n            var result = await library.SaveTrackToLibrary(currentSongId);\n\n            extraInfo.IsSavedToLibrary = result;\n            ViewModel.IsSavedToLibrary = result;\n        }\n\n        private async void RemoveFromYourLibrary_Click(object sender, RoutedEventArgs e)\n        {\n            var extraInfo = await songInfoCache.GetItem(currentSongId);\n            extraInfo.IsSavedToLibrary = false;\n            ViewModel.IsSavedToLibrary = false;\n\n            var library = new Library();\n            var result = await library.RemoveTrackFromLibrary(currentSongId);\n\n            extraInfo.IsSavedToLibrary = !result;\n            ViewModel.IsSavedToLibrary = !result;\n        }\n\n        private async void VolumeSlider_PointerWheelChanged(object sender, PointerRoutedEventArgs e)\n        {\n            SliderExtended sliderExtended = (SliderExtended)sender;\n            int delta = e.GetCurrentPoint(null).Properties.MouseWheelDelta;\n\n            try\n            {\n                await volumeSetSemaphore.WaitAsync();\n\n                // There are new shiny requests waiting, so I'm not needed anymore :(\n                if (volumeSetSemaphore.WaitingCount > 0)\n                    return;\n\n                double newValue = Math.Max(0.0, Math.Min(sliderExtended.Value + ((double)delta / 20.0), 100.0));\n                ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n                {\n                    Action = Action.SeekVolume,\n                    AdditionalData = newValue / 100.0,\n                });\n\n                // Don't overload the SeekVolume request.\n                await Task.Delay(50);\n            }\n            finally\n            {\n                volumeSetSemaphore.Release();\n            }\n        }\n    }\n\n    public class ActionRequestedEventArgs\n    {\n        public NowPlayingView.Action Action { get; set; }\n        public object AdditionalData { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/ProxyConfiguration.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.ProxyConfiguration\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:vm=\"using:XpoMusic.ViewModels\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"420\"\n    d:DesignWidth=\"300\">\n\n    <UserControl.DataContext>\n        <vm:ProxyConfigurationViewModel x:Name=\"ViewModel\" />\n    </UserControl.DataContext>\n    \n    <Grid x:Name=\"mainGrid\">\n        <StackPanel>\n            <ToggleSwitch Header=\"Use custom proxy server\" \n                          IsOn=\"{x:Bind ViewModel.IsCustomProxyEnabled, Mode=TwoWay}\"\n                          HorizontalAlignment=\"Left\" \n                          VerticalAlignment=\"Top\"/>\n            <TextBlock Margin=\"0,4,0,0\" Opacity=\"0.5\" TextWrapping=\"Wrap\" Visibility=\"{x:Bind ViewModel.SystemProxyNoticeVisibility, Mode=OneWay}\">\n                System-wide proxy settings will be used.\n            </TextBlock>\n            <TextBlock Margin=\"0,4,0,0\" Foreground=\"Red\" TextWrapping=\"Wrap\" Visibility=\"{x:Bind ViewModel.RestartNeededNoticeVisibility, Mode=OneWay}\">\n                You'll need to close and reopen Xpo Music for this change to take effect.\n            </TextBlock>\n            <HyperlinkButton Content=\"Restart Xpo Music\"\n                             Visibility=\"{x:Bind ViewModel.RestartNeededNoticeVisibility, Mode=OneWay}\"\n                             Click=\"RestartApp_Click\"/>\n            <StackPanel Margin=\"16,8,16,0\" Visibility=\"{x:Bind ViewModel.ProxyConfigurationVisibility, Mode=OneWay}\">\n                <RadioButton Content=\"HTTP/HTTPS proxy\"\n                             IsChecked=\"{x:Bind ViewModel.IsHttpProxy, Mode=TwoWay}\" />\n                <RadioButton Content=\"SOCKS proxy\" \n                             IsChecked=\"{x:Bind ViewModel.IsSocksProxy, Mode=TwoWay}\" />\n                <Grid Margin=\"0,8,0,0\">\n                    <Grid.ColumnDefinitions>\n                        <ColumnDefinition Width=\"*\" />\n                        <ColumnDefinition Width=\"80\" />\n                    </Grid.ColumnDefinitions>\n                    <StackPanel Grid.Column=\"0\">\n                        <TextBlock Text=\"Address:\" />\n                        <TextBox Margin=\"0,4,0,0\" \n                                 Text=\"{x:Bind ViewModel.ProxyAddress, Mode=TwoWay}\" />\n                    </StackPanel>\n                    <StackPanel Grid.Column=\"1\" Margin=\"12,0,0,0\">\n                        <TextBlock Text=\"Port:\" />\n                        <TextBox Margin=\"0,4,0,0\" \n                                 MaxLength=\"5\"\n                                 InputScope=\"NumericPin\"\n                                 BeforeTextChanging=\"PortTextBox_BeforeTextChanging\"\n                                 Text=\"{x:Bind ViewModel.ProxyPort, Mode=TwoWay}\" />\n                    </StackPanel>\n                </Grid>\n                <Button Margin=\"0,8,0,0\" \n                        Content=\"Apply settings\" \n                        HorizontalAlignment=\"Right\"\n                        Click=\"Button_Click\" />\n                <RichTextBlock Margin=\"0,8,0,0\" Opacity=\"0.7\">\n                    <Paragraph>\n                        <Run>If you want to set a local proxy, you'll need to enable loopback for this app first.</Run>\n                    </Paragraph>\n                </RichTextBlock>\n                <HyperlinkButton Click=\"LocalProxyHelp_Click\">\n                    How can I enable loopback?\n                </HyperlinkButton>\n            </StackPanel>\n        </StackPanel>\n\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/ProxyConfiguration.xaml.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel.Core;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing Windows.System;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class ProxyConfiguration : UserControl\n    {\n        private readonly Uri localProxyHelpPage = new Uri(\"https://xpomusic.com/loopback\");\n\n        public ProxyConfiguration()\n        {\n            this.InitializeComponent();\n        }\n\n        private void PortTextBox_BeforeTextChanging(TextBox sender, TextBoxBeforeTextChangingEventArgs args)\n        {\n            args.Cancel = args.NewText.Any(c => !char.IsDigit(c));\n        }\n\n        private async void Button_Click(object sender, RoutedEventArgs e)\n        {\n            // Save config\n            LocalConfiguration.IsCustomProxyEnabled = true;\n            LocalConfiguration.CustomProxyType = ViewModel.ProxyType;\n            LocalConfiguration.CustomProxyAddress = ViewModel.ProxyAddress;\n            LocalConfiguration.CustomProxyPort = ViewModel.ProxyPort;\n\n            ContentDialog cd = new ContentDialog\n            {\n                Title = \"Restart Xpo Music\",\n                Content = \"We need to restart Xpo Music in order to apply proxy settings.\",\n                RequestedTheme = ElementTheme.Dark,\n                IsPrimaryButtonEnabled = true,\n                PrimaryButtonText = \"Restart Now\",\n                IsSecondaryButtonEnabled = true,\n                SecondaryButtonText = \"Restart Later\",\n            };\n            cd.PrimaryButtonClick += (s, args) =>\n            {\n                PackageHelper.RestartApp();\n            };\n\n            await cd.ShowAsync();\n        }\n\n        private void RestartApp_Click(object sender, RoutedEventArgs e)\n        {\n            PackageHelper.RestartApp();\n        }\n\n        private async void LocalProxyHelp_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(localProxyHelpPage);\n            AnalyticsHelper.Log(\"helpLink\", \"localProxy\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/SliderExtended.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Documents;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\n\nnamespace XpoMusic.Controls\n{\n    public sealed class SliderExtended : Slider\n    {\n        public event EventHandler<SliderExtendedValueChangedEventArgs> ValueChangedByUserManipulation;\n\n        private Thumb horizontalThumb, verticalThumb;\n        private double valueToSetWithoutNotifying;\n        private DateTime value2lastSetTime;\n        private bool isBeingDragged;\n        private double draggedInitialValue;\n\n        public SliderExtended()\n        {\n            this.DefaultStyleKey = typeof(SliderExtended);\n\n            isBeingDragged = false;\n        }\n\n        /// <summary>\n        /// If this is true, ValueChangedByUserManipulation will be raised in real time while\n        /// user is dragging the thumb, and also Value2 will be updated in real time.\n        /// But if this is false, ValueChangedByUserManipulation will be raised and Value2 will\n        /// be updated only on the beginning of dragging and after user finishes dragging the thumb.\n        /// \n        /// NOTE: Disabling this will cause a slight lag in raising ValueChanged and \n        /// ValueChangedByUserManipulation events, and also updating Value2 when user\n        /// changes the value.\n        /// </summary>\n        public bool ContinousUpdateWhileDragging\n        {\n            get { return (bool)GetValue(ContinousUpdateWhileDraggingProperty); }\n            set { SetValue(ContinousUpdateWhileDraggingProperty, value); }\n        }\n\n        public static readonly DependencyProperty ContinousUpdateWhileDraggingProperty =\n            DependencyProperty.Register(\"ContinousUpdateWhileDragging\", typeof(bool), typeof(SliderExtended), new PropertyMetadata(true));\n\n        /// <summary>\n        /// Values set using this property does not cause ValueChanged event to raise, and also \n        /// will be ignored if user is dragging the slider at the same time.\n        /// If ContinousUpdateWhileDragging is false, when user drags the thumb, this value will only\n        /// be updated on the beginning and the end of dragging. But if it's true, this value will be \n        /// updated in real time.\n        /// </summary>\n        public double Value2\n        {\n            get => (double)GetValue(Value2Property);\n            set\n            {\n                if (isBeingDragged)\n                    return;\n\n                SetValue(Value2Property, value);\n                if (Value != value)\n                {\n                    valueToSetWithoutNotifying = value;\n                    value2lastSetTime = DateTime.UtcNow;\n                    Value = value;\n                }\n            }\n        }\n        public static readonly DependencyProperty Value2Property =\n            DependencyProperty.Register(\"Value2\", typeof(double), typeof(SliderExtended), new PropertyMetadata(0));\n\n        public double KeyboardStepFrequency\n        {\n            get { return (double)GetValue(KeyboardStepFrequencyProperty); }\n            set { SetValue(KeyboardStepFrequencyProperty, value); }\n        }\n\n        // Using a DependencyProperty as the backing store for KeyboardStepFrequency.  This enables animation, styling, binding, etc...\n        public static readonly DependencyProperty KeyboardStepFrequencyProperty =\n            DependencyProperty.Register(\"KeyboardStepFrequency\", typeof(double), typeof(SliderExtended), new PropertyMetadata(1));\n\n        protected override void OnApplyTemplate()\n        {\n            base.OnApplyTemplate();\n\n            horizontalThumb = GetTemplateChild(\"HorizontalThumb\") as Thumb;\n            verticalThumb = GetTemplateChild(\"VerticalThumb\") as Thumb;\n\n            horizontalThumb.DragStarted += Thumb_DragStarted;\n            horizontalThumb.DragCompleted += Thumb_DragCompleted;\n            verticalThumb.DragStarted += Thumb_DragStarted;\n            verticalThumb.DragCompleted += Thumb_DragCompleted;\n\n            this.ManipulationMode = ManipulationModes.TranslateRailsX;\n            this.ManipulationStarted += SliderExtended_ManipulationStarted;\n            this.ManipulationCompleted += SliderExtended_ManipulationCompleted;\n        }\n\n        private void SliderExtended_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)\n        {\n            isBeingDragged = false;\n\n            if (!ContinousUpdateWhileDragging)\n                OnValueChanged(draggedInitialValue, Value);\n        }\n\n        private void SliderExtended_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)\n        {\n            isBeingDragged = true;\n            draggedInitialValue = Value2;\n        }\n\n        private void Thumb_DragStarted(object sender, DragStartedEventArgs e)\n        {\n            isBeingDragged = true;\n            draggedInitialValue = Value2;\n        }\n\n        private void Thumb_DragCompleted(object sender, DragCompletedEventArgs e)\n        {\n            isBeingDragged = false;\n\n            if (!ContinousUpdateWhileDragging)\n                OnValueChanged(draggedInitialValue, Value);\n        }\n\n        protected override async void OnValueChanged(double oldValue, double newValue)\n        {\n            base.OnValueChanged(oldValue, newValue);\n\n            if (newValue == valueToSetWithoutNotifying \n                && DateTime.UtcNow - value2lastSetTime < TimeSpan.FromMilliseconds(10))\n            {\n                // Don't fire ValueChangedByUserManipulation as this change is done via Value2.\n                return;\n            }\n\n            if (!ContinousUpdateWhileDragging)\n                await Task.Delay(10);\n\n            if (!ContinousUpdateWhileDragging && isBeingDragged)\n                return;\n\n            ValueChangedByUserManipulation?.Invoke(this, new SliderExtendedValueChangedEventArgs\n            {\n                OldValue = oldValue,\n                NewValue = newValue,\n            });\n\n            // Also set the Value2 DependencyProperty directly\n            SetValue(Value2Property, newValue);\n        }\n\n        protected override void OnKeyDown(KeyRoutedEventArgs e)\n        {\n            if (e.Key == Windows.System.VirtualKey.Right || e.Key == Windows.System.VirtualKey.Up)\n                Value = Math.Min(Value + KeyboardStepFrequency, Maximum);\n            else if (e.Key == Windows.System.VirtualKey.Left || e.Key == Windows.System.VirtualKey.Down)\n                Value = Math.Max(Value - KeyboardStepFrequency, Minimum);\n            else\n                base.OnKeyDown(e);\n        }\n    }\n\n    public class SliderExtendedValueChangedEventArgs\n    {\n        public double OldValue { get; set; }\n        public double NewValue { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/SplashScreen.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.SplashScreen\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    Loaded=\"UserControl_Loaded\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <Storyboard x:Name=\"splashScreenToLightStoryboard\">\n                <ColorAnimation Storyboard.TargetName=\"splashScreen\"\n                                Storyboard.TargetProperty=\"(Control.Background).(SolidColorBrush.Color)\"\n                                To=\"#D1D3D3\"\n                                Duration=\"0:0:0.6\">\n                    <ColorAnimation.EasingFunction>\n                        <ExponentialEase EasingMode=\"EaseInOut\" />\n                    </ColorAnimation.EasingFunction>\n                </ColorAnimation>\n                <ColorAnimation Storyboard.TargetName=\"splashProgressRing\"\n                                Storyboard.TargetProperty=\"(Control.Foreground).(SolidColorBrush.Color)\"\n                                To=\"Black\"\n                                Duration=\"0:0:0.6\">\n                    <ColorAnimation.EasingFunction>\n                        <ExponentialEase EasingMode=\"EaseInOut\" />\n                    </ColorAnimation.EasingFunction>\n                </ColorAnimation>\n            </Storyboard>\n        </ResourceDictionary>\n    </UserControl.Resources>\n    \n    <Grid x:Name=\"splashScreen\" Background=\"#201B1B\">\n        <VisualStateManager.VisualStateGroups>\n            <VisualStateGroup>\n                <VisualState x:Name=\"SplashScreenVisibleVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashProgressRing\"\n                                                       Storyboard.TargetProperty=\"IsActive\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"SplashScreenClosedVisualState\">\n                    <Storyboard>\n                        <DoubleAnimation Storyboard.TargetName=\"extendedSplashImage\" \n                                         Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleX)\"\n                                         BeginTime=\"0:0:0.6\"\n                                         Duration=\"0:0:0.3\" To=\"5\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                        <DoubleAnimation Storyboard.TargetName=\"extendedSplashImage\" \n                                         Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleY)\"\n                                         BeginTime=\"0:0:0.6\"\n                                         Duration=\"0:0:0.3\" To=\"5\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                        <DoubleAnimation Storyboard.TargetName=\"splashScreen\" \n                                         Storyboard.TargetProperty=\"Opacity\"\n                                         BeginTime=\"0:0:0.6\"\n                                         Duration=\"0:0:0.3\" To=\"0\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.9\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashProgressRing\"\n                                                       Storyboard.TargetProperty=\"IsActive\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.9\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"SplashScreenClosedQuickVisualState\">\n                    <Storyboard>\n                        <DoubleAnimation Storyboard.TargetName=\"splashScreen\" \n                                         Storyboard.TargetProperty=\"Opacity\"\n                                         Duration=\"0:0:0.2\" To=\"0\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.2\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashProgressRing\"\n                                                       Storyboard.TargetProperty=\"IsActive\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.2\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n            </VisualStateGroup>\n        </VisualStateManager.VisualStateGroups>\n        <Image x:Name=\"extendedSplashImage\" \n                RenderTransformOrigin=\"0.5, 0.5\"\n                VerticalAlignment=\"Center\"\n                HorizontalAlignment=\"Center\"\n                Width=\"620\"\n                Source=\"ms-appx:///Assets/Logo/SplashScreen.png\">\n            <Image.RenderTransform>\n                <ScaleTransform ScaleX=\"1\" ScaleY=\"1\" />\n            </Image.RenderTransform>\n        </Image>\n        <ProgressRing x:Name=\"splashProgressRing\"\n                        Margin=\"0,380,0,0\"\n                        Width=\"40\"\n                        Height=\"40\"\n                        Foreground=\"White\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/SplashScreen.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class SplashScreen : UserControl\n    {\n        public enum SplashScreenShowState\n        {\n            Visible,\n            Closed,\n            ClosedQuick,\n        }\n\n        #region Custom Properties\n        public static readonly DependencyProperty SplashStateProperty = DependencyProperty.Register(\n            \"SplashState\", typeof(SplashScreenShowState), typeof(SplashScreen), new PropertyMetadata(defaultValue: SplashScreenShowState.Visible,\n                propertyChangedCallback: new PropertyChangedCallback(OnSplashStatePropertyChanged)));\n\n        public SplashScreenShowState SplashState\n        {\n            get => (SplashScreenShowState)GetValue(SplashStateProperty);\n            set\n            {\n                if (SplashState != value)\n                    SetValue(SplashStateProperty, value);\n\n                switch (value)\n                {\n                    case SplashScreenShowState.Visible:\n                        VisualStateManager.GoToState(this, nameof(SplashScreenVisibleVisualState), true);\n                        break;\n                    case SplashScreenShowState.Closed:\n                        VisualStateManager.GoToState(this, nameof(SplashScreenClosedVisualState), true);\n                        break;\n                    case SplashScreenShowState.ClosedQuick:\n                    default:\n                        VisualStateManager.GoToState(this, nameof(SplashScreenClosedQuickVisualState), true);\n                        break;\n                }\n            }\n        }\n\n        private static void OnSplashStatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            (d as SplashScreen).SplashState = (SplashScreenShowState)e.NewValue;\n        }\n        #endregion\n\n        public SplashScreen()\n        {\n            this.InitializeComponent();\n        }\n\n        private void UserControl_Loaded(object sender, RoutedEventArgs e)\n        {\n            if (ThemeHelper.GetCurrentTheme() == Theme.Light)\n                splashScreenToLightStoryboard.Begin();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/TopBar.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.TopBar\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:vm=\"using:XpoMusic.ViewModels\"\n    xmlns:media=\"using:Microsoft.Toolkit.Uwp.UI.Media\"\n    mc:Ignorable=\"d\"\n    Loaded=\"UserControl_Loaded\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n    <UserControl.DataContext>\n        <vm:TopBarViewModel x:Name=\"ViewModel\" />\n    </UserControl.DataContext>\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <AcrylicBrush x:Name=\"topBarButtonsAcrylicBrush\" BackgroundSource=\"Backdrop\"\n                          TintOpacity=\"0.3\" TintColor=\"#FFFFFFFF\" FallbackColor=\"#77FFFFFF\" />\n        </ResourceDictionary>\n    </UserControl.Resources>\n    \n    <Grid>\n        <Grid x:Name=\"topBar\" \n              RequestedTheme=\"Light\"\n              Height=\"{x:Bind ViewModel.TopBarButtonHeight, Mode=OneWay}\">\n            <Rectangle x:Name=\"topBarBackground\"\n                       Fill=\"#01000000\" />\n            <StackPanel x:Name=\"topBarButtonsStackPanel\" \n                        HorizontalAlignment=\"Right\"\n                        Padding=\"0,0,0,0\"\n                        Orientation=\"Horizontal\" \n                        FlowDirection=\"RightToLeft\">\n                <StackPanel.Background>\n                    <media:BackdropBlurBrush Amount=\"30\" />\n                </StackPanel.Background>\n                <Grid Width=\"{x:Bind ViewModel.TopBarBehindSystemControlsAreaWidth, Mode=OneWay}\"\n                      Height=\"{x:Bind ViewModel.TopBarButtonHeight, Mode=OneWay}\" />\n                <Grid x:Name=\"topBarButtonSeparator\"\n                      Width=\"{x:Bind ViewModel.TopBarButtonWidth, Mode=OneWay}\"\n                      Height=\"{x:Bind ViewModel.TopBarButtonHeight, Mode=OneWay}\"\n                      Visibility=\"{x:Bind ViewModel.OpenLinkFromClipboardVisibility, Mode=OneWay}\" />\n                <Button x:Name=\"openLinkFromClipboard\"\n                        Width=\"{x:Bind ViewModel.TopBarButtonWidth, Mode=OneWay}\"\n                        Height=\"{x:Bind ViewModel.TopBarButtonHeight, Mode=OneWay}\"\n                        Visibility=\"{x:Bind ViewModel.OpenLinkFromClipboardVisibility, Mode=OneWay}\"\n                        Click=\"OpenLinkFromClipboard_Click\"\n                        ToolTipService.ToolTip=\"Open Spotify link from clipboard\">\n                    <Button.Content>\n                        <FontIcon FontFamily=\"Segoe MDL2 Assets\" Glyph=\"&#xE78B;\" RenderTransformOrigin=\"0.5, 0.5\">\n                            <FontIcon.RenderTransform>\n                                <RotateTransform Angle=\"180\" />\n                            </FontIcon.RenderTransform>\n                        </FontIcon>\n                    </Button.Content>\n                </Button>\n            </StackPanel>\n        </Grid>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/TopBar.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.ApplicationModel.Core;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI;\nusing Windows.UI.Core;\nusing Windows.UI.ViewManagement;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing XpoMusic.SpotifyApi;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class TopBar : UserControl\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public event EventHandler<string> OpenSpotifyUriRequested;\n\n        #region Custom Properties\n        public static readonly DependencyProperty ShowExtraButtonsProperty = DependencyProperty.Register(\n            \"ShowExtraButtons\", typeof(bool), typeof(TopBar), new PropertyMetadata(defaultValue: false, \n                propertyChangedCallback: new PropertyChangedCallback(OnShowExtraButtonsPropertyChanged)));\n\n        public bool ShowExtraButtons\n        {\n            get => (bool)GetValue(ShowExtraButtonsProperty);\n            set\n            {\n                SetValue(ShowExtraButtonsProperty, value);\n\n                ViewModel.ShowExtraButtons = value;\n\n                if (ShowExtraButtons && !clipboardCheckTimer.IsEnabled)\n                    clipboardCheckTimer.Start();\n                else if (!ShowExtraButtons && clipboardCheckTimer.IsEnabled)\n                    clipboardCheckTimer.Stop();\n            }\n        }\n\n        private static void OnShowExtraButtonsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            (d as TopBar).ShowExtraButtons = (bool)e.NewValue;\n        }\n        #endregion\n\n        private DispatcherTimer clipboardCheckTimer;\n\n        public TopBar()\n        {\n            this.InitializeComponent();\n\n            clipboardCheckTimer = new DispatcherTimer\n            {\n                Interval = TimeSpan.FromSeconds(4),\n            };\n            clipboardCheckTimer.Tick += ClipboardCheckTimer_Tick;\n\n            ShowExtraButtons = false;\n        }\n\n        private void UserControl_Loaded(object sender, RoutedEventArgs e)\n        {\n            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;\n            coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged;\n            coreTitleBar.LayoutMetricsChanged += CoreTitleBar_LayoutMetricsChanged;\n\n            Window.Current.CoreWindow.Activated += Window_Activated;\n\n            InitTitleBar();\n        }\n\n\n        private void ClipboardCheckTimer_Tick(object sender, object e)\n        {\n            // Ignore if not logged in\n            if (!TokenHelper.HasTokens())\n                return;\n\n            CheckForSpotifyUriInClipboard();\n        }\n\n        private async void OpenLinkFromClipboard_Click(object sender, RoutedEventArgs e)\n        {\n            var uri = await ClipboardHelper.GetSpotifyUri();\n\n            if (!string.IsNullOrWhiteSpace(uri))\n            {\n                OpenSpotifyUriRequested?.Invoke(this, uri);\n            }\n        }\n\n        private void Window_Activated(object sender, WindowActivatedEventArgs e)\n        {\n            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)\n            {\n                CheckForSpotifyUriInClipboard();\n            }\n        }\n\n        private async void CheckForSpotifyUriInClipboard()\n        {\n            try\n            {\n                var isSpotifyUriPresent = await ClipboardHelper.IsSpotifyUriPresent();\n\n                if (isSpotifyUriPresent && TokenHelper.HasTokens())\n                {\n                    ViewModel.OpenLinkFromClipboardVisibility = Visibility.Visible;\n                }\n                else\n                {\n                    ViewModel.OpenLinkFromClipboardVisibility = Visibility.Collapsed;\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Error(\"CheckForSpotifyUriInClipboard failed: \" + ex.ToString());\n            }\n        }\n\n\n        private void CoreTitleBar_IsVisibleChanged(CoreApplicationViewTitleBar sender, object args)\n        {\n            UpdateTitleBarSize();\n        }\n\n        private void CoreTitleBar_LayoutMetricsChanged(CoreApplicationViewTitleBar sender, object args)\n        {\n            UpdateTitleBarSize();\n        }\n\n        private void UpdateTitleBarSize()\n        {\n            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;\n\n            if (!coreTitleBar.IsVisible)\n            {\n                ViewModel.TopBarButtonWidth = 0.0;\n                ViewModel.TopBarButtonHeight = 0.0;\n                return;\n            }\n\n            var isTabletMode = (UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Touch);\n\n            ViewModel.TopBarButtonHeight = coreTitleBar.Height;\n            ViewModel.TopBarButtonWidth = coreTitleBar.SystemOverlayRightInset / (isTabletMode ? 2.0 : 4.0);\n        }\n\n        public void InitTitleBar()\n        {\n            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;\n            coreTitleBar.ExtendViewIntoTitleBar = true;\n            Window.Current.SetTitleBar(topBarBackground);\n            \n            UpdateTitleBarColors(ThemeHelper.GetCurrentTheme());\n        }\n\n        public void UpdateTitleBarColors(Theme theme)\n        {\n            var titleBar = ApplicationView.GetForCurrentView().TitleBar;\n            if (theme == Theme.Dark)\n            {\n                // Top bar buttons background color\n                topBarButtonsAcrylicBrush.TintColor = Colors.Black;\n                topBarButtonsAcrylicBrush.FallbackColor = Colors.Black;\n\n                // Clipboard button style\n                openLinkFromClipboard.Style = Application.Current.Resources[\"TopBarDarkButtonStyle\"] as Style;\n\n                // Set active window colors\n                titleBar.ForegroundColor = Colors.White;\n                titleBar.BackgroundColor = Colors.Transparent;\n                titleBar.ButtonForegroundColor = Colors.White;\n                titleBar.ButtonBackgroundColor = Colors.Transparent;\n                titleBar.ButtonHoverForegroundColor = Colors.White;\n                titleBar.ButtonHoverBackgroundColor = Color.FromArgb(128, 100, 100, 100);\n                titleBar.ButtonPressedForegroundColor = Colors.White;\n                titleBar.ButtonPressedBackgroundColor = Color.FromArgb(128, 140, 140, 140);\n\n                // Set inactive window colors\n                titleBar.InactiveForegroundColor = Color.FromArgb(255, 200, 200, 200);\n                titleBar.InactiveBackgroundColor = Colors.Transparent;\n                titleBar.ButtonInactiveForegroundColor = Color.FromArgb(255, 200, 200, 200);\n                titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;\n            }\n            else\n            {\n                // Top bar buttons background color\n                topBarButtonsAcrylicBrush.TintColor = Colors.White;\n                topBarButtonsAcrylicBrush.FallbackColor = Colors.White;\n\n                // Clipboard button style\n                openLinkFromClipboard.Style = Application.Current.Resources[\"TopBarLightButtonStyle\"] as Style;\n\n                // Set active window colors\n                titleBar.ForegroundColor = Colors.Black;\n                titleBar.BackgroundColor = Colors.Transparent;\n                titleBar.ButtonForegroundColor = Colors.Black;\n                titleBar.ButtonBackgroundColor = Colors.Transparent;\n                titleBar.ButtonHoverForegroundColor = Colors.Black;\n                titleBar.ButtonHoverBackgroundColor = Color.FromArgb(128, 200, 200, 200);\n                titleBar.ButtonPressedForegroundColor = Colors.Black;\n                titleBar.ButtonPressedBackgroundColor = Color.FromArgb(128, 160, 160, 160);\n\n                // Set inactive window colors\n                titleBar.InactiveForegroundColor = Color.FromArgb(255, 255 - 200, 255 - 200, 255 - 200);\n                titleBar.InactiveBackgroundColor = Colors.Transparent;\n                titleBar.ButtonInactiveForegroundColor = Color.FromArgb(255, 255 - 200, 255 - 200, 255 - 200);\n                titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Controls/XpoMusicWebApp.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Controls.XpoMusicWebApp\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:controls=\"using:XpoMusic.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:Windows10version1809=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)\"\n    xmlns:media=\"using:Microsoft.Toolkit.Uwp.UI.Media\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n    \n    <Grid>\n        <VisualStateManager.VisualStateGroups>\n            <VisualStateGroup>\n                <VisualState x:Name=\"DefaultVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainWebView\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"windowTitle\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainProgressRing\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"loadFailedMessage\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"WaitingVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainWebView\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"windowTitle\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainProgressRing\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainProgressRing\"\n                                                       Storyboard.TargetProperty=\"IsActive\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"loadFailedMessage\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"LoadFailedVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainWebView\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"windowTitle\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"mainProgressRing\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"loadFailedMessage\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n            </VisualStateGroup>\n            <VisualStateGroup>\n                <VisualState>\n                    <VisualState.StateTriggers>\n                        <AdaptiveTrigger MinWindowWidth=\"721\" />\n                    </VisualState.StateTriggers>\n                    <VisualState.Setters>\n                        <Setter Target=\"windowTitle.Opacity\" Value=\"1\" />\n                    </VisualState.Setters>\n                </VisualState>\n            </VisualStateGroup>\n        </VisualStateManager.VisualStateGroups>\n        \n        <WebView x:Name=\"mainWebView\"\n                 Windows10version1809:WebResourceRequested=\"MainWebView_WebResourceRequested\"\n                 NavigationStarting=\"MainWebView_NavigationStarting\"\n                 NavigationFailed=\"MainWebView_NavigationFailed\"\n                 LoadCompleted=\"MainWebView_LoadCompleted\" />\n\n        <Border x:Name=\"invertColorFilter\"\n                BorderBrush=\"Transparent\" \n                BorderThickness=\"0\"\n                IsHitTestVisible=\"False\"\n                VerticalAlignment=\"Stretch\"\n                HorizontalAlignment=\"Stretch\">\n            <Border.Background>\n                <media:BackdropInvertBrush />\n            </Border.Background>\n        </Border>\n\n        <TextBlock x:Name=\"windowTitle\"\n                   Visibility=\"Visible\"\n                   Opacity=\"0\"\n                   Margin=\"54,7,0,0\"\n                   FontSize=\"12\"\n                   VerticalAlignment=\"Top\"\n                   HorizontalAlignment=\"Left\"/>\n\n        <ProgressRing x:Name=\"mainProgressRing\"\n                      Foreground=\"{ThemeResource ButtonForegroundThemeBrush}\"\n                      Width=\"60\"\n                      Height=\"60\"\n                      IsActive=\"False\" />\n\n        <ProgressBar x:Name=\"playbackBarProgressBar\"\n                     Foreground=\"{ThemeResource ButtonForegroundThemeBrush}\"\n                     VerticalAlignment=\"Top\"\n                     HorizontalAlignment=\"Left\"\n                     Visibility=\"Collapsed\"\n                     IsIndeterminate=\"True\" />\n\n        <Grid x:Name=\"loadFailedMessage\" Background=\"#201B1B\" RequestedTheme=\"Dark\">\n            <ScrollViewer>\n                <StackPanel MaxWidth=\"800\" Padding=\"40,100,40,40\">\n                    <TextBlock Text=\"Connection failed.\"\n                               Foreground=\"White\"\n                               TextWrapping=\"Wrap\"\n                               FontWeight=\"Light\"\n                               FontSize=\"34\" />\n                    <TextBlock Text=\"Please check your internet connection and then try again.\"\n                               Foreground=\"White\"\n                               Margin=\"0,20,0,0\"\n                               TextWrapping=\"Wrap\"\n                               FontWeight=\"Light\"\n                               FontSize=\"22\"/>\n                    <TextBlock Text=\"Url:\"\n                               Foreground=\"White\"\n                               Margin=\"0,20,0,0\"\n                               Opacity=\"0.6\"\n                               FontSize=\"14\" />\n                    <TextBlock x:Name=\"loadFailedUrlText\"\n                               Foreground=\"White\"\n                               Margin=\"12,0,0,0\"\n                               Text=\"[url]\"\n                               TextWrapping=\"Wrap\"\n                               Opacity=\"0.6\"\n                               FontSize=\"14\" />\n                    <TextBlock Text=\"Error Message:\"\n                               Foreground=\"White\"\n                               Margin=\"0,20,0,0\"\n                               Opacity=\"0.6\"\n                               FontSize=\"14\" />\n                    <TextBlock x:Name=\"errorMessageText\"\n                               Foreground=\"White\"\n                               Margin=\"12,0,0,0\"\n                               Text=\"[error]\"\n                               TextWrapping=\"Wrap\"\n                               Opacity=\"0.6\"\n                               FontSize=\"14\" />\n\n                    <Button Content=\"Retry\"\n                            Background=\"#4D4949\"\n                            Foreground=\"White\"\n                            Click=\"RetryConnectButton_Click\"\n                            Margin=\"0,40,0,0\"\n                            FontWeight=\"Light\"\n                            Width=\"140\"\n                            FontSize=\"20\" />\n\n                    <HyperlinkButton x:Name=\"loadFailedProxySettingsLink\" \n                                     Content=\"Proxy settings\"\n                                     Margin=\"0,24,0,0\"\n                                     Click=\"LoadFailedProxySettingsLink_Click\" />\n                    <controls:ProxyConfiguration x:Name=\"loadFailedProxySettings\" \n                                                 Width=\"300\"\n                                                 HorizontalAlignment=\"Left\"\n                                                 Visibility=\"Collapsed\"\n                                                 Margin=\"0,24,0,0\" />\n\n                    <StackPanel Orientation=\"Horizontal\" Margin=\"0,80,0,0\">\n                        <TextBlock Text=\"Xpo Music v\"\n                                   Foreground=\"White\"\n                                   Opacity=\"0.5\"\n                                   FontWeight=\"ExtraLight\"\n                                   FontSize=\"12\" />\n                        <TextBlock x:Name=\"loadFailedAppVersionText\"\n                                   Text=\"X.Y.Z\"\n                                   Foreground=\"White\"\n                                   Opacity=\"0.5\"\n                                   FontWeight=\"ExtraLight\"\n                                   FontSize=\"12\" />\n\n                    </StackPanel>\n                </StackPanel>\n            </ScrollViewer>\n        </Grid>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Controls/XpoMusicWebApp.xaml.cs",
    "content": "﻿using Microsoft.Toolkit.Uwp.Helpers;\nusing Newtonsoft.Json;\nusing System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.UI;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Classes;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing XpoMusic.SpotifyApi;\nusing XpoMusicWebAgent;\nusing XpoMusicWebAgent.Model;\n\nnamespace XpoMusic.Controls\n{\n    public sealed partial class XpoMusicWebApp : UserControl\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public enum XpoMusicWebAppActionRequest\n        {\n            OpenSettingsFlyout,\n            OpenAboutFlyout,\n            OpenDonateFlyout,\n            GoToCompactOverlay,\n            GoToNowPlaying,\n            ShowSplashScreen,\n        }\n\n        public event EventHandler<EventArgs> PageLoaded;\n        public event EventHandler<EventArgs> WebAppLoaded;\n        public event EventHandler<XpoMusicWebAppActionRequest> ActionRequested;\n\n        public AutoPlayAction AutoPlayAction { get; set; } = AutoPlayAction.None;\n        public WebViewController Controller { get; }\n        public bool BackEnabled { get; private set; } = false;\n        public bool IsWebAppLoaded { get; private set; } = false;\n\n        #region Custom Properties\n        public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(\n            \"IsOpen\", typeof(bool), typeof(XpoMusicWebApp), new PropertyMetadata(defaultValue: false,\n                propertyChangedCallback: new PropertyChangedCallback(OnIsOpenPropertyChanged)));\n        private readonly string initialLoadPageUrl = \"https://open.spotify.com/static/offline.html?\";\n\n        public bool IsOpen\n        {\n            get => (bool)GetValue(IsOpenProperty);\n            set\n            {\n                if (IsOpen != value)\n                    SetValue(IsOpenProperty, value);\n\n                this.Visibility = value ? Visibility.Visible : Visibility.Collapsed;\n                mainWebView.Visibility = this.Visibility;\n\n                // TODO: Hide html content from DOM when possible via javascript to reduce CPU usage\n            }\n        }\n\n        private static void OnIsOpenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            (d as XpoMusicWebApp).IsOpen = (bool)e.NewValue;\n        }\n        #endregion\n\n        private Uri loadFailedUrl;\n        private string webViewPreviousUri = \"\";\n        private LocalStoragePlayback initialPlaybackState;\n        private XpoMusicWebAgent.WebAgent xpoWebAgent;\n        private bool isLoggingInByFacebook = false;\n\n        public XpoMusicWebApp()\n        {\n            this.InitializeComponent();\n\n            Controller = new WebViewController(this.mainWebView);\n            PlaybackActionHelper.SetController(Controller);\n\n            loadFailedAppVersionText.Text = PackageHelper.GetAppVersionString();\n\n            AppConstants.Instance.ConstantsUpdated += App_ConstantsUpdated;\n\n            xpoWebAgent = new XpoMusicWebAgent.WebAgent()\n            {\n                WebPlayerBackupEnabled = AppConstants.Instance.WebPlayerBackupEnabled,\n                OSVersion = SystemInformation.OperatingSystemVersion.ToString(),\n            };\n            xpoWebAgent.ProgressBarCommandReceived += XpotifyWebAgent_ProgressBarCommandReceived;\n            xpoWebAgent.StatusReportReceived += XpotifyWebAgent_StatusReportReceived;\n            xpoWebAgent.ActionRequested += XpotifyWebAgent_ActionRequested;\n            xpoWebAgent.InitializationFailed += XpotifyWebAgent_InitializationFailed;\n            xpoWebAgent.NewAccessTokenRequested += XpotifyWebAgent_NewAccessTokenRequested;\n            xpoWebAgent.LogMessageReceived += XpotifyWebAgent_LogMessageReceived;\n\n            VisualStateManager.GoToState(this, nameof(DefaultVisualState), false);\n\n            SetInvertColorFilterVisibility();\n        }\n\n        private void App_ConstantsUpdated(object sender, EventArgs e)\n        {\n            SetInvertColorFilterVisibility();\n        }\n\n        private void SetInvertColorFilterVisibility()\n        {\n            invertColorFilter.Visibility = (IsWebAppLoaded && ThemeHelper.GetCurrentTheme() == Theme.Light && AppConstants.Instance.XamlInvertFilterForLightThemeEnabled) ? Visibility.Visible : Visibility.Collapsed;\n        }\n\n        private void XpotifyWebAgent_LogMessageReceived(object sender, LogMessageReceivedEventArgs e)\n        {\n            logger.Info($\"js::{e.Message}\");\n        }\n\n        private async void XpotifyWebAgent_NewAccessTokenRequested(object sender, object e)\n        {\n            await TokenHelper.GetAndSaveNewTokenAsync();\n            xpoWebAgent.SetNewAccessToken(TokenHelper.GetTokens().AccessToken);\n        }\n\n        private void XpotifyWebAgent_InitializationFailed(object sender, InitFailedEventArgs e)\n        {\n            Controller.LastInitErrors = e.Errors;\n            logger.Warn(\"WebAgent: InitFailed :: \" + e.Errors);\n            AnalyticsHelper.Log(\"webAgentInitFailed\", e.Errors);\n        }\n\n        private async void XpotifyWebAgent_ActionRequested(object sender, XpoMusicWebAgent.Model.ActionRequestedEventArgs e)\n        {\n            switch (e.Action)\n            {\n                case XpoMusicWebAgent.Model.Action.PinToStart:\n                    await PinPageToStart();\n                    break;\n                case XpoMusicWebAgent.Model.Action.OpenSettings:\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.OpenSettingsFlyout);\n                    break;\n                case XpoMusicWebAgent.Model.Action.OpenDonate:\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.OpenDonateFlyout);\n                    break;\n                case XpoMusicWebAgent.Model.Action.OpenAbout:\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.OpenAboutFlyout);\n                    break;\n                case XpoMusicWebAgent.Model.Action.OpenMiniView:\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.GoToCompactOverlay);\n                    break;\n                case XpoMusicWebAgent.Model.Action.OpenNowPlaying:\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.GoToNowPlaying);\n                    break;\n                case XpoMusicWebAgent.Model.Action.NavigateToClipboardUri:\n                    if (await ClipboardHelper.IsSpotifyUriPresent())\n                    {\n                        var uri = await ClipboardHelper.GetSpotifyUri();\n                        await Controller.NavigateToSpotifyUrl(uri);\n                    }\n                    break;\n                default:\n                    logger.Warn($\"Action {e.Action} is unknown.\");\n                    break;\n            }\n        }\n\n        private void XpotifyWebAgent_StatusReportReceived(object sender, StatusReportReceivedEventArgs e)\n        {\n            logger.Trace(\"StatusReport Received.\");\n\n            BackEnabled = e.Status.BackButtonEnabled;\n            PlayStatusTracker.LocalPlaybackDataReceived(e.Status.NowPlaying);\n            StuckResolveHelper.StatusReportReceived(e.Status.NowPlaying, Controller);\n        }\n\n        private void XpotifyWebAgent_ProgressBarCommandReceived(object sender, ProgressBarCommandEventArgs e)\n        {\n            if (e.Command == ProgressBarCommand.Show)\n            {\n                playbackBarProgressBar.Margin = new Thickness(e.Left * mainWebView.ActualWidth, e.Top * mainWebView.ActualHeight, 0, 0);\n                playbackBarProgressBar.Width = e.Width * mainWebView.ActualWidth;\n                playbackBarProgressBar.Visibility = Visibility.Visible;\n            }\n            else\n            {\n                playbackBarProgressBar.Visibility = Visibility.Collapsed;\n            }\n        }\n\n        public void OpenWebApp()\n        {\n            var destinationUrl = \"https://open.spotify.com\";\n            var navigateUrl = initialLoadPageUrl + \"redirectUrl=\" + System.Net.WebUtility.UrlEncode(destinationUrl);\n\n            OpenWebApp(navigateUrl);\n        }\n\n        public void OpenWebApp(string targetUrl)\n        {\n            if (TokenHelper.HasTokens())\n            {\n                if (LocalConfiguration.ApiTokenVersion < 2)\n                {\n                    var authorizeUrl = Authorization.GetAuthorizationUrl(targetUrl);\n                    Controller.Navigate(new Uri($\"ms-appx-web:///Assets/ReauthorizeForV2.html?theme={(ThemeHelper.GetCurrentTheme() == Theme.Light ? \"light\" : \"dark\")}&\" +\n                        $\"redirectUri={System.Net.WebUtility.UrlEncode(authorizeUrl)}\"));\n                }\n                else\n                {\n                    if (LocalConfiguration.IsLoggedInByFacebook)\n                    {\n                        // We need to open the login page and click on facebook button\n                        logger.Info(\"Logging in via Facebook...\");\n                        var loginUrl = \"https://accounts.spotify.com/login?continue=\" + System.Net.WebUtility.UrlEncode(targetUrl);\n                        Controller.Navigate(new Uri(loginUrl));\n                    }\n                    else\n                    {\n                        Controller.Navigate(new Uri(targetUrl));\n                    }\n                }\n            }\n            else\n            {\n                Authorize(targetUrl, clearExisting: false);\n            }\n        }\n\n        private async void MainWebView_NavigationFailed(object sender, WebViewNavigationFailedEventArgs e)\n        {\n            if (e.Uri.ToString().StartsWith(Authorization.RedirectUri))\n            {\n                FinalizeAuthorization(e.Uri.ToString());\n                return;\n            }\n\n\n            if (e.Uri.ToString().StartsWith(initialLoadPageUrl + \"redirectUrl=\"))\n            {\n                await InitialLoadPageCompleted(e.Uri.ToString());\n                return;\n            }\n\n\n            VisualStateManager.GoToState(this, nameof(LoadFailedVisualState), false);\n            PageLoaded?.Invoke(this, new EventArgs());\n            loadFailedUrlText.Text = e.Uri.ToString();\n            loadFailedUrl = e.Uri;\n            errorMessageText.Text = e.WebErrorStatus.ToString();\n        }\n\n        private async void MainWebView_LoadCompleted(object sender, NavigationEventArgs e)\n        {\n            VisualStateManager.GoToState(this, nameof(DefaultVisualState), false);\n\n            if (e.Uri.ToString().StartsWith(Authorization.SpotifyLoginUri) && LocalConfiguration.IsLoggedInByFacebook)\n            {\n                if (await Controller.TryPushingFacebookLoginButton())\n                {\n                    logger.Info(\"Pushed the facebook login button.\");\n                    return;\n                }\n            }\n\n            if (e.Uri.ToString().StartsWith(initialLoadPageUrl + \"redirectUrl=\"))\n            {\n                await InitialLoadPageCompleted(e.Uri.ToString());\n                return;\n            }\n\n            if (e.Uri.ToString().ToLower().Contains(WebViewController.SpotifyPwaUrlBeginsWith.ToLower()))\n            {\n                var justInjected = await Controller.InjectInitScript(ThemeHelper.GetCurrentTheme() == Theme.Light);\n                if (justInjected)\n                {\n                    SetInitialPlaybackState();\n                    PlayStatusTracker.StartRegularRefresh();\n                    SetFocusToWebView();\n                    windowTitle.Text = PackageHelper.GetAppNameString();\n                }\n\n                if (AutoPlayAction != AutoPlayAction.None)\n                {\n                    AutoPlayOnStartup(AutoPlayAction);\n                    AutoPlayAction = AutoPlayAction.None;\n                }\n            }\n            else\n            {\n                windowTitle.Text = \"\";\n            }\n\n            if (e.Uri.ToString().StartsWith(Authorization.RedirectUri))\n            {\n                IsWebAppLoaded = false;\n                SetInvertColorFilterVisibility();\n                FinalizeAuthorization(e.Uri.ToString());\n            }\n            else if (e.Uri.ToString().ToLower().Contains(WebViewController.SpotifyPwaUrlBeginsWith.ToLower()))\n            {\n                IsWebAppLoaded = true;\n                SetInvertColorFilterVisibility();\n                WebAppLoaded?.Invoke(this, new EventArgs());\n            }\n            else if (e.Uri.ToString().ToLower().StartsWith(Authorization.FacebookLoginUri))\n            {\n                isLoggingInByFacebook = true;\n            }\n            else\n            {\n                IsWebAppLoaded = false;\n                SetInvertColorFilterVisibility();\n                PageLoaded?.Invoke(this, new EventArgs());\n            }\n\n            if (!await Controller.CheckLoggedIn())\n            {\n                Authorize(\"https://accounts.spotify.com/login?continue=https%3A%2F%2Fopen.spotify.com%2F\", clearExisting: true);\n                AnalyticsHelper.Log(\"mainEvent\", \"notLoggedIn\");\n            }\n        }\n\n        private async Task InitialLoadPageCompleted(string url)\n        {\n            logger.Info(\"Clearing local storage and redirecting...\");\n            var result = await Controller.ClearPlaybackLocalStorage();\n\n            try\n            {\n                if (result.Length > 0)\n                {\n                    initialPlaybackState = JsonConvert.DeserializeObject<LocalStoragePlayback>(result);\n                    logger.Info(\"initial playback volume = \" + initialPlaybackState.volume);\n                }\n                else\n                {\n                    logger.Info(\"localStorage.playback was undefined.\");\n                }\n            }\n            catch\n            {\n                logger.Warn(\"Decoding localStorage.playback failed.\");\n                logger.Info(\"localStorage.playback content was: \" + result);\n            }\n\n            var urlDecoder = new WwwFormUrlDecoder(url.Substring(url.IndexOf('?') + 1));\n            Controller.Navigate(new Uri(urlDecoder.GetFirstValueByName(\"redirectUrl\")));\n        }\n\n        public async void SetFocusToWebView()\n        {\n            await FocusManager.TryFocusAsync(mainWebView, FocusState.Programmatic);\n        }\n\n        private async void AutoPlayOnStartup(AutoPlayAction autoPlayAction)\n        {\n            await Task.Delay(TimeSpan.FromSeconds(1));\n            logger.Info(\"AutoPlay \" + autoPlayAction);\n            await Controller.AutoPlay(autoPlayAction);\n        }\n\n        private async void MainWebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs e)\n        {\n            logger.Info(\"Page: \" + e.Uri.ToString());\n\n            if (e.Uri.ToString().EndsWith(\"#xpotifyInitialPage\"))\n            {\n            }\n            else if (e.Uri.ToString().ToLower().Contains(WebViewController.SpotifyPwaUrlBeginsWith.ToLower()))\n            {\n                mainWebView.AddWebAllowedObject(\"XpoMusic\", xpoWebAgent);\n            }\n            else\n            {\n                if (!webViewPreviousUri.ToLower().StartsWith(WebViewController.SpotifyPwaUrlBeginsWith.ToLower())\n                    || !e.Uri.ToString().ToLower().StartsWith(WebViewController.SpotifyPwaUrlBeginsWith.ToLower()))\n                {\n                    // Open splash screen, unless both new and old uris are in open.spotify.com itself.\n                    ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.ShowSplashScreen);\n                }\n            }\n\n            if (e.Uri.ToString().StartsWith(Authorization.FacebookLoginFinishRedirectUri))\n            {\n                logger.Info(\"Logged in by Facebook.\");\n                LocalConfiguration.IsLoggedInByFacebook = true;\n            }\n\n            webViewPreviousUri = e.Uri.ToString();\n        }\n\n        private async Task PinPageToStart()\n        {\n            VisualStateManager.GoToState(this, nameof(WaitingVisualState), false);\n\n            var pageUrl = await Controller.GetPageUrl();\n            var pageTitle = await Controller.GetPageTitle();\n\n            if (await TileHelper.PinPageToStart(pageUrl, pageTitle))\n                AnalyticsHelper.Log(\"mainEvent\", \"pinToStart\");\n\n            VisualStateManager.GoToState(this, nameof(DefaultVisualState), false);\n        }\n\n        private void RetryConnectButton_Click(object sender, RoutedEventArgs e)\n        {\n            ActionRequested?.Invoke(this, XpoMusicWebAppActionRequest.ShowSplashScreen);\n            Controller.Navigate(loadFailedUrl);\n        }\n\n        private async void FinalizeAuthorization(string url)\n        {\n            try\n            {\n                var urlDecoder = new WwwFormUrlDecoder(url.Substring(url.IndexOf('?') + 1));\n                await Authorization.RetrieveAndSaveTokensFromAuthCode(urlDecoder.GetFirstValueByName(\"code\"));\n                Controller.Navigate(new Uri(urlDecoder.GetFirstValueByName(\"state\")));\n\n                if (isLoggingInByFacebook)\n                {\n                    LocalConfiguration.IsLoggedInByFacebook = true;\n                    isLoggingInByFacebook = false;\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Info(\"Authorization failed. \" + ex.ToString());\n\n                Authorize(\"https://open.spotify.com/\", clearExisting: false);\n            }\n        }\n\n        public void Authorize(string targetUrl, bool clearExisting)\n        {\n            if (clearExisting)\n            {\n                Controller.ClearCookies();\n                TokenHelper.ClearTokens();\n                LocalConfiguration.IsLoggedInByFacebook = false;\n            }\n\n            var authorizationUrl = Authorization.GetAuthorizationUrl(targetUrl);\n            Controller.Navigate(new Uri(authorizationUrl));\n        }\n\n        private void LoadFailedProxySettingsLink_Click(object sender, RoutedEventArgs e)\n        {\n            loadFailedProxySettingsLink.Visibility = Visibility.Collapsed;\n            loadFailedProxySettings.Visibility = Visibility.Visible;\n        }\n\n        private async void SetInitialPlaybackState()\n        {\n            // Restore initial playback state\n            // (We removed the localStorage entry, because of PWA's bug with Edge. See clearPlaybackLocalStorage.js for more info)\n\n            if (initialPlaybackState == null)\n                return;\n\n            try\n            {\n                await Task.Delay(1000);\n\n                logger.Info($\"Setting [initial] volume to {initialPlaybackState.volume}\");\n                await Controller.SeekVolume(initialPlaybackState.volume);\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"SetInitialPlaybackState failed: \" + ex.ToString());\n            }\n        }\n\n        private void MainWebView_WebResourceRequested(WebView sender, WebViewWebResourceRequestedEventArgs args)\n        {\n            // Getting deferral does not work as args.Response can't be set will cause an exception (The application \n            // called an interface that was marshalled for a different thread) if we set it after an await. So we need\n            // to block the current thread.\n\n            logger.Debug(\"WebResourceRequested: \" + args.Request.RequestUri.ToString());\n\n            var response = WebResourceModificationHelper.WebResourceRequested(args.Request).GetAwaiter().GetResult();\n            if (response != null)\n                args.Response = response;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Flyouts/DeveloperMessageFlyout.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Flyouts.DeveloperMessageFlyout\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Flyouts\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:controls=\"using:Microsoft.UI.Xaml.Controls\"\n    mc:Ignorable=\"d\"\n    RequestedTheme=\"Dark\"\n    d:DesignHeight=\"250\"\n    d:DesignWidth=\"400\">\n\n    <Grid Background=\"{ThemeResource NavigationViewExpandedPaneBackground}\"\n          BorderBrush=\"#aaa\"\n          BorderThickness=\"1\">\n        <controls:NavigationView x:Name=\"navigationView\" \n                                 PaneDisplayMode=\"Top\" \n                                 IsSettingsVisible=\"False\" \n                                 IsBackEnabled=\"True\"\n                                 BackRequested=\"NavigationView_BackRequested\">\n            <controls:NavigationView.MenuItems>\n                <controls:NavigationViewItem Content=\"A Message from Developer\" />\n            </controls:NavigationView.MenuItems>\n            <Grid>\n                <ScrollViewer>\n                    <Grid>\n                        <Grid.RowDefinitions>\n                            <RowDefinition MinHeight=\"32\" Height=\"Auto\" />\n                            <RowDefinition />\n                        </Grid.RowDefinitions>\n                        <Grid Grid.Row=\"0\" Padding=\"12\">\n                            <StackPanel>\n                                <TextBlock x:Name=\"messageTitle\" \n                                           Text=\"Message Title\"\n                                           TextWrapping=\"Wrap\"\n                                           FontSize=\"16\"\n                                           FontWeight=\"Bold\"/>\n                                <TextBlock x:Name=\"messageDate\" \n                                           Text=\"just now\"\n                                           TextWrapping=\"Wrap\"\n                                           FontSize=\"12\"\n                                           Opacity=\"0.7\"\n                                           Margin=\"0,2,0,0\"/>\n                            </StackPanel>\n                        </Grid>\n                        <Grid Grid.Row=\"1\" Padding=\"12,4,12,12\">\n                            <StackPanel>\n                                <TextBlock x:Name=\"messageContent\" \n                                           TextWrapping=\"Wrap\"\n                                           Text=\"Message Content\" />\n                            </StackPanel>\n                        </Grid>\n                    </Grid>\n                </ScrollViewer>\n            </Grid>\n        </controls:NavigationView>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Flyouts/DeveloperMessageFlyout.xaml.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing XpoMusic.XpotifyApi.Model;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace XpoMusic.Flyouts\n{\n    public sealed partial class DeveloperMessageFlyout : UserControl, IFlyout<EventArgs>\n    {\n        public event EventHandler<EventArgs> FlyoutCloseRequest;\n\n        public DeveloperMessageFlyout()\n        {\n            this.InitializeComponent();\n\n            if (ThemeHelper.GetCurrentTheme() == Classes.Model.Theme.Dark)\n                RequestedTheme = ElementTheme.Dark;\n            else\n                RequestedTheme = ElementTheme.Light;\n\n            navigationView.SelectedItem = navigationView.MenuItems.First();\n        }\n\n        private void NavigationView_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args)\n        {\n            FlyoutCloseRequest?.Invoke(this, new EventArgs());\n        }\n\n        public void InitFlyout(DeveloperMessage message)\n        {\n            messageTitle.Text = message.title;\n            messageContent.Text = message.content;\n            messageDate.Text = TimeAgo(message.messageDate);\n        }\n\n        /// <summary>\n        /// Taken from https://dotnetthoughts.net/time-ago-function-for-c/\n        /// </summary>\n        public static string TimeAgo(DateTime dateTime)\n        {\n            string result = string.Empty;\n            var timeSpan = DateTime.Now.Subtract(dateTime);\n\n            if (timeSpan <= TimeSpan.FromSeconds(60))\n            {\n                result = \"just now\";\n            }\n            else if (timeSpan <= TimeSpan.FromMinutes(60))\n            {\n                result = timeSpan.Minutes > 1 ?\n                    String.Format(\"{0} minutes ago\", timeSpan.Minutes) :\n                    \"a minute ago\";\n            }\n            else if (timeSpan <= TimeSpan.FromHours(24))\n            {\n                result = timeSpan.Hours > 1 ?\n                    String.Format(\"{0} hours ago\", timeSpan.Hours) :\n                    \"an hour ago\";\n            }\n            else if (timeSpan <= TimeSpan.FromDays(30))\n            {\n                result = timeSpan.Days > 1 ?\n                    String.Format(\"{0} days ago\", timeSpan.Days) :\n                    \"yesterday\";\n            }\n            else if (timeSpan <= TimeSpan.FromDays(365))\n            {\n                result = timeSpan.Days > 30 ?\n                    String.Format(\"{0} months ago\", timeSpan.Days / 30) :\n                    \"a month ago\";\n            }\n            else\n            {\n                result = \"\";\n            }\n\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Flyouts/IFlyout.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Flyouts\n{\n    internal interface IFlyout<T>\n    {\n        event EventHandler<T> FlyoutCloseRequest;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Flyouts/SettingsFlyout.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Flyouts.SettingsFlyout\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Flyouts\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:controls=\"using:Microsoft.UI.Xaml.Controls\"\n    mc:Ignorable=\"d\"\n    RequestedTheme=\"Dark\"\n    d:DesignHeight=\"500\"\n    d:DesignWidth=\"400\">\n\n    <Grid Background=\"{ThemeResource NavigationViewExpandedPaneBackground}\"\n          BorderBrush=\"#aaa\"\n          BorderThickness=\"1\"\n          MaxWidth=\"400\"\n          MaxHeight=\"500\">\n        <Grid Grid.Row=\"0\">\n            <controls:NavigationView x:Name=\"navigationView\" \n                                     PaneDisplayMode=\"Top\" \n                                     IsSettingsVisible=\"False\" \n                                     IsBackEnabled=\"True\"\n                                     SelectionChanged=\"NavigationView_SelectionChanged\"\n                                     BackRequested=\"NavigationView_BackRequested\">\n                <controls:NavigationView.MenuItems>\n                    <controls:NavigationViewItem Content=\"Settings\" x:Name=\"settingsMenuItem\" />\n                    <controls:NavigationViewItem Content=\"Help\" x:Name=\"helpMenuItem\" />\n                    <controls:NavigationViewItem Content=\"About\" x:Name=\"aboutMenuItem\" />\n                    <controls:NavigationViewItem Content=\"Donate\" x:Name=\"donateMenuItem\" />\n                </controls:NavigationView.MenuItems>\n                <Frame x:Name=\"contentFrame\" />\n            </controls:NavigationView>\n        </Grid>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Flyouts/SettingsFlyout.xaml.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Runtime.Serialization;\nusing Windows.ApplicationModel.Email;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.Storage;\nusing Windows.Storage.Streams;\nusing Windows.System;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Media.Animation;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Pages;\n\nnamespace XpoMusic.Flyouts\n{\n    public sealed partial class SettingsFlyout : UserControl, IFlyout<EventArgs>\n    {\n        public event EventHandler<EventArgs> FlyoutCloseRequest;\n\n        public SettingsFlyout()\n        {\n            this.InitializeComponent();\n\n            if (ThemeHelper.GetCurrentTheme() == Classes.Model.Theme.Dark)\n                RequestedTheme = ElementTheme.Dark;\n            else\n                RequestedTheme = ElementTheme.Light;\n        }\n\n        public void InitFlyout(int tabId)\n        {\n            navigationView.SelectedItem = navigationView.MenuItems[tabId];\n        }\n\n        private void NavigationView_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args)\n        {\n            FlyoutCloseRequest?.Invoke(this, new EventArgs());\n        }\n\n        private void NavigationView_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)\n        {\n            if (args.SelectedItem == settingsMenuItem)\n            {\n                contentFrame.Navigate(typeof(SettingsPage), null, new EntranceNavigationTransitionInfo());\n                AnalyticsHelper.PageView(\"SettingsPage\");\n            }\n            else if (args.SelectedItem == helpMenuItem)\n            {\n                contentFrame.Navigate(typeof(HelpPage), null, new EntranceNavigationTransitionInfo());\n                AnalyticsHelper.PageView(\"HelpPage\");\n            }\n            else if (args.SelectedItem == aboutMenuItem)\n            {\n                contentFrame.Navigate(typeof(AboutPage), null, new EntranceNavigationTransitionInfo());\n                AnalyticsHelper.PageView(\"AboutPage\");\n            }\n            else if (args.SelectedItem == donateMenuItem)\n            {\n                contentFrame.Navigate(typeof(DonatePage), null, new EntranceNavigationTransitionInfo());\n                AnalyticsHelper.PageView(\"DonatePage\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Flyouts/WhatsNewFlyout.xaml",
    "content": "﻿<UserControl\n    x:Class=\"XpoMusic.Flyouts.WhatsNewFlyout\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:controls=\"using:Microsoft.UI.Xaml.Controls\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:local=\"using:XpoMusic.Flyouts\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    d:DesignHeight=\"550\"\n    d:DesignWidth=\"400\"\n    RequestedTheme=\"Dark\"\n    mc:Ignorable=\"d\">\n\n    <Grid\n        Background=\"{ThemeResource NavigationViewExpandedPaneBackground}\"\n        BorderBrush=\"#aaa\"\n        BorderThickness=\"1\">\n        <controls:NavigationView\n            x:Name=\"navigationView\"\n            BackRequested=\"NavigationView_BackRequested\"\n            IsBackEnabled=\"True\"\n            IsSettingsVisible=\"False\"\n            PaneDisplayMode=\"Top\">\n            <controls:NavigationView.MenuItems>\n                <controls:NavigationViewItem Content=\"What's new\" />\n            </controls:NavigationView.MenuItems>\n            <Grid>\n                <ScrollViewer>\n                    <Grid>\n                        <Grid.RowDefinitions>\n                            <RowDefinition Height=\"Auto\" MinHeight=\"32\" />\n                            <RowDefinition />\n                        </Grid.RowDefinitions>\n                        <Grid x:Name=\"Header\" Grid.Row=\"0\">\n                            <StackPanel Orientation=\"Horizontal\">\n                                <TextBlock\n                                    Margin=\"10,10,0,0\"\n                                    FontWeight=\"Bold\"\n                                    Text=\"Xpo Music v\" />\n                                <TextBlock\n                                    x:Name=\"VersionText\"\n                                    Margin=\"0,10,0,0\"\n                                    FontWeight=\"Bold\"\n                                    Text=\"x.y.z\" />\n                            </StackPanel>\n                        </Grid>\n                        <Grid Grid.Row=\"1\" Padding=\"14,8,14,14\">\n                            <StackPanel x:Name=\"Content\">\n                                <StackPanel\n                                    Margin=\"0,0,0,24\"\n                                    Tag=\"5\"\n                                    Visibility=\"Visible\">\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; UI improvements and fixes\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where Xpo Music was interfering with playback when another device was playing music via Spotify Connect\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where Save to Library button was missing from some items in track list\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where parts of screen were shown pixelated on tall screens\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where the scrollbar of playlists side bar section was missing\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where certain URIs (like podcast section) were not handled properly\"\n                                        TextWrapping=\"Wrap\" />\n                                </StackPanel>\n                                <StackPanel\n                                    Margin=\"0,0,0,24\"\n                                    Tag=\"4\"\n                                    Visibility=\"Visible\">\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; See the currently playing music on Xpotify live tile!\"\n                                        TextWrapping=\"Wrap\" />\n                                    <RichTextBlock\n                                        Margin=\"16,0,0,0\"\n                                        IsTextSelectionEnabled=\"False\"\n                                        Opacity=\"0.7\">\n                                        <Paragraph>\n                                            <Run>You can also customize the live tile from Settings.</Run>\n                                        </Paragraph>\n                                    </RichTextBlock>\n\n                                    <TextBlock\n                                        Margin=\"0,16,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Tablet mode improvements\"\n                                        TextWrapping=\"Wrap\" />\n                                </StackPanel>\n                                <StackPanel\n                                    Margin=\"0,0,0,24\"\n                                    Tag=\"3\"\n                                    Visibility=\"Visible\">\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Cortana can now play songs on Xpotify\"\n                                        TextWrapping=\"Wrap\" />\n                                    <RichTextBlock Margin=\"16,0,0,0\" IsTextSelectionEnabled=\"False\">\n                                        <Paragraph>\n                                            <Run>If you ask Cortana to play artists, albums, playlists and songs on Spotify, it'll be played on Xpotify.</Run>\n                                        </Paragraph>\n                                        <Paragraph Margin=\"0,8,0,0\">\n                                            <Run>You will need to connect your Spotify account to Cortana in Cortana's Notebook.</Run>\n                                        </Paragraph>\n                                    </RichTextBlock>\n                                    <RichTextBlock\n                                        Margin=\"16,8,0,0\"\n                                        IsTextSelectionEnabled=\"False\"\n                                        Opacity=\"0.7\">\n                                        <Paragraph>\n                                            <Run>Note: If the Spotify official app is installed on your PC as well, you may see a prompt asking which app to use. You can select Xpotify as the default app for handling spotify links there.</Run>\n                                        </Paragraph>\n                                    </RichTextBlock>\n\n                                    <TextBlock\n                                        Margin=\"0,16,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Follow Windows app theme\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"16,4,0,0\"\n                                        Opacity=\"0.7\"\n                                        Text=\"Xpotify can now follow app theme set in system settings as well.\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fixed an issue where some playlists didn't have proper picture when pinned to Start.\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Support the development of Xpotify by purchasing Xpotify Pro\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"16,4,0,0\"\n                                        Opacity=\"0.7\"\n                                        Text=\"Xpotify does not have any limitations compared to Xpotify Pro, but you can buy Xpotify Pro to support the development of the app.\"\n                                        TextWrapping=\"Wrap\" />\n                                    <HyperlinkButton\n                                        Margin=\"16,0,0,0\"\n                                        Click=\"GetXpotifyPro_Click\"\n                                        Content=\"Get Xpotify Pro from the Store\" />\n                                </StackPanel>\n                                <StackPanel\n                                    Margin=\"0,0,0,24\"\n                                    Tag=\"2\"\n                                    Visibility=\"Visible\">\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Open shared spotify links in Xpotify\"\n                                        TextWrapping=\"Wrap\" />\n                                    <RichTextBlock Margin=\"16,0,0,0\" IsTextSelectionEnabled=\"False\">\n                                        <Paragraph>\n                                            <Run>Links starting with</Run>\n                                            <Run FontStyle=\"Italic\" FontWeight=\"SemiBold\">spotify:</Run>\n                                            <Run>or</Run>\n                                            <Run FontStyle=\"Italic\" FontWeight=\"SemiBold\">https://open.spotify.com/</Run>\n                                            <Run>can be opened easily in Xpotify.</Run>\n                                        </Paragraph>\n                                    </RichTextBlock>\n                                    <RichTextBlock\n                                        Margin=\"16,8,0,0\"\n                                        IsTextSelectionEnabled=\"False\"\n                                        Opacity=\"0.7\">\n                                        <Paragraph>\n                                            <Run>&#8226; Copy the link to clipboard and click on</Run>\n                                            <InlineUIContainer>\n                                                <FontIcon\n                                                    Margin=\"0,0,0,-5\"\n                                                    FontFamily=\"Segoe MDL2 Assets\"\n                                                    Glyph=\"&#xE78B;\"\n                                                    RenderTransformOrigin=\"0.5, 0.5\">\n                                                    <FontIcon.RenderTransform>\n                                                        <RotateTransform Angle=\"180\" />\n                                                    </FontIcon.RenderTransform>\n                                                </FontIcon>\n                                            </InlineUIContainer>\n                                            <Run>icon that appears on the top right side of the app, next to minimize button.</Run>\n                                        </Paragraph>\n                                        <Paragraph Margin=\"0,4,0,0\">\n                                            <Run>&#8226; Or just drag and drop the link into the Xpotify window!</Run>\n                                        </Paragraph>\n                                    </RichTextBlock>\n\n                                    <TextBlock\n                                        Margin=\"0,16,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Light theme\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"16,4,0,0\"\n                                        Opacity=\"0.7\"\n                                        Text=\"Xpotify now supports a light theme as well as the default dark theme.\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Fluent design improvements\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Custom proxy server setting support\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Custom language setting support\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"0,12,0,0\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Bugfixes and improvements\"\n                                        TextWrapping=\"Wrap\" />\n                                </StackPanel>\n                                <StackPanel\n                                    Margin=\"0,0,0,24\"\n                                    Tag=\"1\"\n                                    Visibility=\"Visible\">\n                                    <TextBlock\n                                        Margin=\"0,0,0,8\"\n                                        FontWeight=\"SemiBold\"\n                                        Text=\"&#8226; Dark themed scrollbar\"\n                                        TextWrapping=\"Wrap\" />\n                                    <TextBlock\n                                        Margin=\"16,0,0,0\"\n                                        Opacity=\"0.7\"\n                                        Text=\"The scrollbar is now dark to match the app theme!\"\n                                        TextWrapping=\"Wrap\" />\n                                </StackPanel>\n                            </StackPanel>\n                        </Grid>\n                    </Grid>\n                </ScrollViewer>\n            </Grid>\n        </controls:NavigationView>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "XpoMusic/Flyouts/WhatsNewFlyout.xaml.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.System;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace XpoMusic.Flyouts\n{\n    public sealed partial class WhatsNewFlyout : UserControl, IFlyout<EventArgs>\n    {\n        public event EventHandler<EventArgs> FlyoutCloseRequest;\n\n        public WhatsNewFlyout()\n        {\n            this.InitializeComponent();\n\n            if (ThemeHelper.GetCurrentTheme() == Classes.Model.Theme.Dark)\n                RequestedTheme = ElementTheme.Dark;\n            else\n                RequestedTheme = ElementTheme.Light;\n\n            foreach (var item in Content.Children)\n            {\n                var sp = (item as StackPanel);\n                if (sp != null)\n                    sp.Visibility = Visibility.Collapsed;\n            }\n\n            if (WhatsNewHelper.testMode)\n                VersionText.Text = \"Next\";\n            else\n                VersionText.Text = PackageHelper.GetAppVersionString();\n\n            navigationView.SelectedItem = navigationView.MenuItems.First();\n        }\n\n        private void NavigationView_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args)\n        {\n            FlyoutCloseRequest?.Invoke(this, new EventArgs());\n        }\n\n        public void InitFlyout()\n        {\n            bool changelogPresent = false;\n            var ids = WhatsNewHelper.GetWhatsNewContentIdAndMarkAsRead();\n\n            foreach (var item in Content.Children)\n            {\n                var sp = item as StackPanel;\n                if (sp == null)\n                    continue;\n\n                if (ids.Contains(sp.Tag.ToString()))\n                {\n                    changelogPresent = true;\n                    sp.Visibility = Visibility.Visible;\n                }\n                else\n                {\n                    sp.Visibility = Visibility.Collapsed;\n                }\n            }\n\n            if (!changelogPresent)\n                FlyoutCloseRequest?.Invoke(this, new EventArgs());\n#if !DEBUG\n            //App.Tracker.Send(HitBuilder.CreateCustomEvent(\"What's new\", \"Show\", DeviceInfo.ApplicationVersionString).Build());\n#endif\n        }\n\n        private async void GetXpotifyPro_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(PackageHelper.ProStoreUri);\n            AnalyticsHelper.Log(\"whatsNew\", \"getXpotifyPro\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/AnalyticsHelper.cs",
    "content": "﻿using GoogleAnalytics;\nusing Microsoft.AppCenter.Analytics;\nusing Microsoft.Services.Store.Engagement;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class AnalyticsHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static StoreServicesCustomEventLogger storeCustomEventLoggerObject = null;\n        private static StoreServicesCustomEventLogger StoreCustomEventLogger\n        {\n            get\n            {\n                if (storeCustomEventLoggerObject == null)\n                    storeCustomEventLoggerObject = StoreServicesCustomEventLogger.GetDefault();\n\n                return storeCustomEventLoggerObject;\n            }\n        }\n\n        private static Tracker googleAnalyticsTrackerObject = null;\n        private static Tracker GoogleAnalyticsTracker\n        {\n            get\n            {\n                if (googleAnalyticsTrackerObject == null)\n                {\n                    AnalyticsManager.Current.IsDebug = false; //use only for debugging, returns detailed info on hits sent to analytics servers\n                    AnalyticsManager.Current.DispatchPeriod = TimeSpan.Zero; //immediate mode, sends hits immediately\n                    AnalyticsManager.Current.ReportUncaughtExceptions = true; //catch unhandled exceptions and send the details\n                    AnalyticsManager.Current.AutoAppLifetimeMonitoring = true; //handle suspend/resume and empty hit batched hits on suspend\n\n                    googleAnalyticsTrackerObject = AnalyticsManager.Current.CreateTracker(Secrets.GoogleAnalyticsTrackerId);\n                }\n\n                return googleAnalyticsTrackerObject;\n            }\n        }\n\n        public static void Log(string eventName, string action)\n        {\n#if !DEBUG\n            StoreCustomEventLogger.Log(eventName + \" : \" + action);\n            GoogleAnalyticsTracker.Send(HitBuilder.CreateCustomEvent(eventName, action).Build());\n#endif\n            Analytics.TrackEvent(eventName, new Dictionary<string, string>()\n            {\n                { \"action\", action },\n            });\n            logger.Info($\"Analytics event '{eventName} : {action}' fired.\");\n        }\n\n        public static void Log(string eventName, string action, string label)\n        {\n#if !DEBUG\n            StoreCustomEventLogger.Log(eventName + \" : \" + action + \" : \" + label);\n            GoogleAnalyticsTracker.Send(HitBuilder.CreateCustomEvent(eventName, action, label).Build());\n#endif\n            Analytics.TrackEvent(eventName, new Dictionary<string, string>()\n            {\n                { \"action\", action },\n                { \"label\", label },\n            });\n            logger.Info($\"Analytics event '{eventName} : {action} : {label}' fired.\");\n        }\n\n        internal static void PageView(string pageName, bool setNewSession = false)\n        {\n#if !DEBUG\n            if (setNewSession)\n                GoogleAnalyticsTracker.Send(HitBuilder.CreateScreenView(pageName).SetNewSession().Build());\n            else\n                GoogleAnalyticsTracker.Send(HitBuilder.CreateScreenView(pageName).Build());\n#endif\n            Analytics.TrackEvent(\"pageView\", new Dictionary<string, string>()\n            {\n                { \"name\", pageName },\n            });\n            logger.Info($\"PageView '{pageName}' fired.\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/AssetManager.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.XpotifyApi;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Windows.Storage;\n\nnamespace XpoMusic.Helpers\n{\n    public static class AssetManager\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n        private static readonly string assetUpdateFolderName = \"AssetUpdate\";\n\n        private static List<StorageFolder> assetFolders = null;\n        private static SemaphoreSlim loadAssetFoldersSemaphore = new SemaphoreSlim(1, 1);\n        private static Dictionary<string, string> assetStringFileCache = new Dictionary<string, string>();\n\n        public static async void UpdateAssets()\n        {\n            try\n            {\n                var package = await AssetUpdatesApi.GetLatestAssetPackage();\n                if (package == null)\n                {\n                    logger.Info(\"No new asset package available.\");\n                    return;\n                }\n\n                var destinationFolder = await GetAssetUpdateFolder(package.AssetPackageInfo.version.ToString());\n\n                using (var stream = await package.File.OpenStreamForReadAsync())\n                {\n                    var archive = new ZipArchive(stream);\n                    await Task.Run(() => archive.ExtractToDirectory(destinationFolder.Path, overwriteFiles: true));\n                }\n\n                LocalConfiguration.LatestAppVersionOnAssetUpdate = PackageHelper.GetAppVersion();\n                LocalConfiguration.LatestAssetUpdateVersion = package.AssetPackageInfo.version;\n                logger.Info($\"Asset update version {package.AssetPackageInfo.version} downloaded and extracted.\");\n\n                // The zip file is no longer needed.\n                await package.File.DeleteAsync();\n\n                // Reload assetFolders on next asset load request.\n                assetFolders = null;\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"UpdateAssets failed: \" + ex.ToString());\n            }\n        }\n\n        private static async Task<StorageFolder> GetAssetUpdateFolder(string name)\n        {\n            var parentFolder = await GetAssetUpdateParentFolder();\n\n            var folder = (await parentFolder.TryGetItemAsync(name)) as StorageFolder;\n            if (folder == null)\n                folder = await parentFolder.CreateFolderAsync(name);\n\n            return folder;\n        }\n\n        private static async Task<StorageFolder> GetAssetUpdateParentFolder()\n        {\n            var folder = (await ApplicationData.Current.LocalFolder.TryGetItemAsync(assetUpdateFolderName)) as StorageFolder;\n            if (folder == null)\n                folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(assetUpdateFolderName);\n\n            return folder;\n        }\n\n        private static async Task LoadAssetFolders()\n        {\n            try\n            {\n                await loadAssetFoldersSemaphore.WaitAsync();\n\n                if (assetFolders != null)\n                    return;\n\n                var parentFolder = await GetAssetUpdateParentFolder();\n                var folders = await parentFolder.GetFoldersAsync();\n\n                if (LocalConfiguration.LatestAppVersionOnAssetUpdate < PackageHelper.GetAppVersion())\n                {\n                    logger.Info($\"LatestAppVersionOnAssetUpdate is {LocalConfiguration.LatestAppVersionOnAssetUpdate}, but current app version is {PackageHelper.GetAppVersion()}. Will delete all old asset updates.\");\n\n                    foreach (var folder in folders)\n                        await folder.DeleteAsync(StorageDeleteOption.PermanentDelete);\n\n                    LocalConfiguration.LatestAssetUpdateVersion = 0;\n                    assetFolders = new List<StorageFolder>();\n                }\n                else\n                {\n                    assetFolders = folders.OrderByDescending(x =>\n                    {\n                        if (int.TryParse(x.DisplayName, out int result))\n                            return result;\n\n                        return 0;\n                    }).ToList();\n                }\n\n                var defaultFolder = await Windows.Application­Model.Package.Current.InstalledLocation.GetFolderAsync(\"InjectedAssets\");\n                assetFolders.Add(defaultFolder);\n\n                logger.Info(\"Asset folders:\\n\" + string.Join('\\n', assetFolders.Select(x => x.Path)));\n                logger.Info(\"LatestAssetUpdateVersion: \" + LocalConfiguration.LatestAssetUpdateVersion);\n            }\n            finally\n            {\n                loadAssetFoldersSemaphore.Release();\n            }\n        }\n\n        public static async Task<string> LoadAssetString(string fileName)\n        {\n            if (assetFolders == null)\n                await LoadAssetFolders();\n\n            foreach (var folder in assetFolders)\n            {\n                if ((await folder.TryGetItemAsync(fileName)) is StorageFile file)\n                {\n                    return await ReadTextFile(fileName, file);\n                }\n            }\n\n            logger.Warn($\"LoadAssetString: File '{fileName}' not found.\");\n            return null;\n        }\n\n        private static async Task<string> ReadTextFile(string fileName, StorageFile file)\n        {\n            if (assetStringFileCache.ContainsKey(file.Path))\n            {\n#if DEBUG\n                logger.Info($\"Asset '{fileName}' loaded from cache.\");\n#endif\n                return assetStringFileCache[file.Path];\n            }\n\n            var text = await FileIO.ReadTextAsync(file);\n            assetStringFileCache[file.Path] = text;\n            logger.Info($\"Asset '{fileName}' loaded from '{file.Path}'.\");\n\n            return text;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/ClipboardHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel.DataTransfer;\n\nnamespace XpoMusic.Helpers\n{\n    public static class ClipboardHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static async Task<bool> IsSpotifyUriPresent()\n        {\n            try\n            {\n                var content = Clipboard.GetContent();\n\n                if (!content.Contains(StandardDataFormats.Text))\n                    return false;\n\n                var data = await content.GetTextAsync();\n                var uri = SpotifyShareUriHelper.GetPwaUri(data);\n\n                return !string.IsNullOrWhiteSpace(uri);\n            }\n            catch (Exception ex)\n            {\n                logger.Error(ex.ToString());\n                return false;\n            }\n        }\n\n        public static async Task<string> GetSpotifyUri()\n        {\n            try\n            {\n                var content = Clipboard.GetContent();\n\n                if (!content.Contains(StandardDataFormats.Text))\n                    return \"\";\n\n                var data = await content.GetTextAsync();\n                var uri = SpotifyShareUriHelper.GetPwaUri(data);\n\n                return uri;\n            }\n            catch (Exception ex)\n            {\n                logger.Error(ex.ToString());\n                return \"\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/CropBitmap.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Graphics.Imaging;\nusing Windows.Storage;\nusing Windows.Storage.Streams;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Media.Imaging;\n\nnamespace XpoMusic.Helpers\n{\n    // Taken from https://github.com/XamlBrewer/UWP-ImageCropper-/blob/master/XamlBrewer.Uwp.Controls/Helpers/CropBitmap.cs\n\n    public static class CropBitmap\n    {\n        /// <summary>\n        /// Get a cropped bitmap from a image file.\n        /// </summary>\n        /// <param name=\"originalImageFile\">\n        /// The original image file.\n        /// </param>\n        /// <param name=\"startPoint\">\n        /// The start point of the region to be cropped.\n        /// </param>\n        /// <param name=\"corpSize\">\n        /// The size of the region to be cropped.\n        /// </param>\n        /// <returns>\n        /// The cropped image.\n        /// </returns>\n        public static async Task<WriteableBitmap> GetCroppedBitmapAsync(StorageFile originalImageFile,\n            Point startPoint, Size corpSize, double scale)\n        {\n            if (double.IsNaN(scale) || double.IsInfinity(scale))\n            {\n                scale = 1;\n            }\n\n            // Convert start point and size to integer.\n            uint startPointX = (uint)Math.Floor(startPoint.X * scale);\n            uint startPointY = (uint)Math.Floor(startPoint.Y * scale);\n            uint height = (uint)Math.Floor(corpSize.Height * scale);\n            uint width = (uint)Math.Floor(corpSize.Width * scale);\n\n            using (IRandomAccessStream stream = await originalImageFile.OpenReadAsync())\n            {\n\n                // Create a decoder from the stream. With the decoder, we can get \n                // the properties of the image.\n                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);\n\n                // The scaledSize of original image.\n                uint scaledWidth = (uint)Math.Floor(decoder.PixelWidth * scale);\n                uint scaledHeight = (uint)Math.Floor(decoder.PixelHeight * scale);\n\n\n                // Refine the start point and the size. \n                if (startPointX + width > scaledWidth)\n                {\n                    startPointX = scaledWidth - width;\n                }\n\n                if (startPointY + height > scaledHeight)\n                {\n                    startPointY = scaledHeight - height;\n                }\n\n                // Get the cropped pixels.\n                byte[] pixels = await GetPixelData(decoder, startPointX, startPointY, width, height,\n                    scaledWidth, scaledHeight);\n\n                // Stream the bytes into a WriteableBitmap\n                WriteableBitmap cropBmp = new WriteableBitmap((int)width, (int)height);\n                Stream pixStream = cropBmp.PixelBuffer.AsStream();\n                pixStream.Write(pixels, 0, (int)(width * height * 4));\n\n                return cropBmp;\n            }\n        }\n\n        /// <summary>\n        /// Use BitmapTransform to define the region to crop, and then get the pixel data in the region\n        /// </summary>\n        private static async Task<byte[]> GetPixelData(BitmapDecoder decoder, uint startPointX, uint startPointY,\n            uint width, uint height)\n        {\n            return await GetPixelData(decoder, startPointX, startPointY, width, height,\n                decoder.PixelWidth, decoder.PixelHeight);\n        }\n\n        /// <summary>\n        /// Use BitmapTransform to define the region to crop, and then get the pixel data in the region.\n        /// If you want to get the pixel data of a scaled image, set the scaledWidth and scaledHeight\n        /// of the scaled image.\n        /// </summary>\n        private static async Task<byte[]> GetPixelData(BitmapDecoder decoder, uint startPointX, uint startPointY,\n            uint width, uint height, uint scaledWidth, uint scaledHeight)\n        {\n            BitmapTransform transform = new BitmapTransform();\n            BitmapBounds bounds = new BitmapBounds();\n            bounds.X = startPointX;\n            bounds.Y = startPointY;\n            bounds.Height = height;\n            bounds.Width = width;\n            transform.Bounds = bounds;\n\n            transform.ScaledWidth = scaledWidth;\n            transform.ScaledHeight = scaledHeight;\n\n            // Get the cropped pixels within the bounds of transform.\n            PixelDataProvider pix = await decoder.GetPixelDataAsync(\n                BitmapPixelFormat.Bgra8,\n                BitmapAlphaMode.Straight,\n                transform,\n                ExifOrientationMode.IgnoreExifOrientation,\n                ColorManagementMode.ColorManageToSRgb);\n            byte[] pixels = pix.DetachPixelData();\n            return pixels;\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Helpers/DeveloperMessageHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.XpotifyApi;\nusing XpoMusic.XpotifyApi.Model;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class DeveloperMessageHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static async Task<DeveloperMessage> GetNextDeveloperMessage()\n        {\n            try\n            {\n                var messages = await DeveloperMessageApi.GetDeveloperMessages();\n\n                if (messages == null || messages.messages == null)\n                    return null;\n\n                var readMessageIds = LocalConfiguration.DeveloperMessageShownIds;\n                var unreadMessages = messages.messages.Where(x => !readMessageIds.Contains(x.id)).ToList();\n\n                var firstUnreadMessage = unreadMessages.FirstOrDefault();\n\n                if (firstUnreadMessage == null)\n                    return null;\n\n                LocalConfiguration.AddIdToDeveloperMessageShownIds(firstUnreadMessage.id);\n                return firstUnreadMessage;\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetNextDeveloperMessage failed: \" + ex.ToString());\n                AnalyticsHelper.Log(\"exception-GetNextDeveloperMessage\", ex.Message, ex.ToString());\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/DeviceInfoHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Networking.Connectivity;\n\nnamespace XpoMusic.Helpers\n{\n    public class DeviceInfoHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static string GetDeviceName()\n        {\n            try\n            {\n                var hostNames = NetworkInformation.GetHostNames();\n                var localName = hostNames.FirstOrDefault(name => name.DisplayName.Contains(\".local\"));\n                var computerName = localName.DisplayName.Replace(\".local\", \"\");\n\n                return computerName;\n            }\n            catch (Exception ex)\n            {\n                logger.Info(\"GetDeviceName via HostName failed: \" + ex.ToString() + \"\\n Will try using EasClientDeviceInformation instead.\");\n                return (new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation()).FriendlyName;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/ImageSaveHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Graphics.Imaging;\nusing Windows.Storage;\nusing Windows.Storage.Streams;\nusing Windows.UI.Xaml.Media.Imaging;\n\nnamespace XpoMusic.Helpers\n{\n    public static class ImageSaveHelper\n    {\n        private const string tileImageCacheFolderName = \"TileImageCache\";\n\n        public static async Task<Uri> GetAndSaveTileOriginalImage(string remoteUri)\n        {\n            using (var httpClient = new HttpClient())\n            {\n                var response = await httpClient.GetAsync(remoteUri);\n                var content = await response.Content.ReadAsByteArrayAsync();\n\n                var folder = (await ApplicationData.Current.LocalFolder.TryGetItemAsync(tileImageCacheFolderName)) as StorageFolder;\n                if (folder == null)\n                    folder = await CreateTileCacheFolder();\n\n                var fileName = DateTime.Now.ToString(\"yyyyMMddHHmm\") + \"-\" + Guid.NewGuid() + \".jpg\";\n                var file = await folder.CreateFileAsync(fileName);\n\n                await FileIO.WriteBytesAsync(file, content);\n\n                return new Uri($\"ms-appdata:///local/{tileImageCacheFolderName}/{fileName}\");\n            }\n        }\n\n        private static async Task<StorageFolder> CreateTileCacheFolder()\n        {\n            return await ApplicationData.Current.LocalFolder.CreateFolderAsync(tileImageCacheFolderName);\n        }\n\n        public static async Task<Uri> SaveWritableBitmapToTileImageCache(WriteableBitmap wb, string tag)\n        {\n            var folder = (await ApplicationData.Current.LocalFolder.TryGetItemAsync(tileImageCacheFolderName)) as StorageFolder;\n            if (folder == null)\n                folder = await CreateTileCacheFolder();\n\n            var fileName = DateTime.Now.ToString(\"yyyyMMddHHmm\") + \"-\" + Guid.NewGuid() + \"-\" + tag + \".jpg\";\n            var file = await folder.CreateFileAsync(fileName);\n\n            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.ReadWrite))\n            {\n                BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream);\n                Stream pixelStream = wb.PixelBuffer.AsStream();\n                byte[] pixels = new byte[pixelStream.Length];\n                await pixelStream.ReadAsync(pixels, 0, pixels.Length);\n\n                encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore,\n                                    (uint)wb.PixelWidth,\n                                    (uint)wb.PixelHeight,\n                                    96.0,\n                                    96.0,\n                                    pixels);\n                await encoder.FlushAsync();\n            }\n\n            return new Uri($\"ms-appdata:///local/{tileImageCacheFolderName}/{fileName}\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/Integration/LyricsViewerIntegrationHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Classes.Model.LyricsViewer;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel.AppService;\nusing Windows.Foundation.Collections;\n\nnamespace XpoMusic.Helpers.Integration\n{\n    public static class LyricsViewerIntegrationHelper\n    {\n        private const string lyricsViewerPackageFamilyName = \"36835MahdiGhiasi.LyricsViewerforSpotify_yddpmccgg2mz2\";\n        private const string lyricsViewerAppServiceName = \"LyricsViewerService\";\n\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n        private static bool isLyricsViewerInstalled = true;\n\n        private static AppServiceConnection connection = null;\n        private static bool connectionActive = false;\n\n        private static async Task SendPlaybackToLyricsViewer(CurrentPlayingSongInfo currentSong)\n        {\n            if (!isLyricsViewerInstalled)\n                return;\n\n            if (connection == null || !connectionActive)\n            {\n                connection = new AppServiceConnection\n                {\n                    AppServiceName = lyricsViewerAppServiceName,\n                    PackageFamilyName = lyricsViewerPackageFamilyName,\n                };\n                connection.ServiceClosed += Connection_ServiceClosed;\n\n                var connectionResult = await connection.OpenAsync();\n\n                if (connectionResult == AppServiceConnectionStatus.AppNotInstalled)\n                {\n                    logger.Info(\"Can't connect to LyricsViewer app service: AppNotInstalled.\");\n                    isLyricsViewerInstalled = false;\n                    return;\n                }\n                else if (connectionResult != AppServiceConnectionStatus.Success)\n                {\n                    logger.Info($\"Can't connect to LyricsViewer app service: {connectionResult}.\");\n                    return;\n                }\n\n                connectionActive = true;\n            }\n\n            var vs = new ValueSet\n            {\n                { \"messageType\", \"currentPlayingSongInfo\" },\n                { \"sender\", \"Xpotify\" },\n                { \"data\", JsonConvert.SerializeObject(currentSong) },\n            };\n            var result = await connection.SendMessageAsync(vs);\n\n            logger.Info($\"Sent currentPlayingSongInfo to LyricsViewer. Result was '{result.Status}' and response was: {JsonConvert.SerializeObject(result.Message)}\");\n        }\n\n        private static void Connection_ServiceClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)\n        {\n            connectionActive = false;\n        }\n\n        internal static async void SendPlaybackToLyricsViewer()\n        {\n            if (!isLyricsViewerInstalled)\n                return;\n\n            try\n            {\n                var currentSong = new CurrentPlayingSongInfo\n                {\n                    ArtistName = PlayStatusTracker.LastPlayStatus.ArtistName,\n                    AlbumName = PlayStatusTracker.LastPlayStatus.AlbumName,\n                    SongName = PlayStatusTracker.LastPlayStatus.SongName,\n                    AlbumArtUri = await SongImageProvider.GetAlbumArt(PlayStatusTracker.LastPlayStatus.AlbumId),\n                };\n\n                await SendPlaybackToLyricsViewer(currentSong);\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"SendPlaybackToLyricsViewer failed: \" + ex.ToString());\n            }\n        }\n\n        internal static void InitIntegration()\n        {\n            PlayStatusTracker.LastPlayStatus.Updated += (s, e) =>\n            {\n                SendPlaybackToLyricsViewer();\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/JumpListHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.StartScreen;\n\nnamespace XpoMusic.Helpers\n{\n    public static class JumpListHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        /// <summary>\n        /// Entries get added to the jump list when you play music via Cortana.\n        /// This function removes them.\n        /// </summary>\n        public static async void DeleteRecentJumplistEntries()\n        {\n            try\n            {\n                var jumpList = await JumpList.LoadCurrentAsync();\n\n                jumpList.SystemGroupKind = JumpListSystemGroupKind.None;\n                jumpList.Items.Clear();\n\n                await jumpList.SaveAsync();\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"DeleteRecentJumplistEntries failed: \" + ex.ToString());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/KeyboardShortcutHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.System;\nusing XpoMusic.Classes;\n\nnamespace XpoMusic.Helpers\n{\n    public static class KeyboardShortcutHelper\n    {\n        public enum KeyDownProcessResult\n        {\n            Handled,\n            AskJs,\n            GoBack,\n        };\n\n        public static async Task<KeyDownProcessResult> KeyDown(VirtualKey key, bool shiftPressed, bool ctrlPressed, bool altPressed, WebViewController controller, Controls.NowPlayingView nowPlaying)\n        {\n            if (key == VirtualKey.Space)\n            {\n                // Play/Pause\n                await controller.PlayPause();\n            }\n            else if (key == VirtualKey.Right && ctrlPressed)\n            {\n                // Next Track\n                await controller.NextTrack();\n                if (nowPlaying.IsOpen)\n                    nowPlaying.PlayChangeTrackAnimation(reverse: false);\n            }\n            else if (key == VirtualKey.Left && ctrlPressed)\n            {\n                // Prev Track\n                await controller.PreviousTrack();\n                if (nowPlaying.IsOpen)\n                    nowPlaying.PlayChangeTrackAnimation(reverse: true);\n            }\n            else if (key == VirtualKey.Up && ctrlPressed & shiftPressed)\n            {\n                // Max volume\n                await controller.SeekVolume(1.0);\n            }\n            else if (key == VirtualKey.Down && ctrlPressed && shiftPressed)\n            {\n                // Mute\n                await controller.SeekVolume(0.0);\n            }\n            else if (key == VirtualKey.Up && ctrlPressed)\n            {\n                // Volume up\n                var newVolume = Math.Min(PlayStatusTracker.LastPlayStatus.Volume + 0.1, 1.0);\n                await controller.SeekVolume(newVolume);\n                PlayStatusTracker.LastPlayStatus.Volume = newVolume;\n            }\n            else if (key == VirtualKey.Down && ctrlPressed)\n            {\n                // Volume down\n                var newVolume = Math.Max(PlayStatusTracker.LastPlayStatus.Volume - 0.1, 0.0);\n                await controller.SeekVolume(newVolume);\n                PlayStatusTracker.LastPlayStatus.Volume = newVolume;\n            }\n            else if (key == VirtualKey.Left && altPressed)\n            {\n                // Back\n                return KeyDownProcessResult.GoBack;\n            }\n            else if (key == VirtualKey.Escape)\n            {\n                // Back\n                return KeyDownProcessResult.GoBack;\n            }\n            else if (key == VirtualKey.M && ctrlPressed && nowPlaying.IsOpen && nowPlaying.ViewMode == Controls.NowPlayingView.NowPlayingViewMode.Normal)\n            {\n                await nowPlaying.SwitchToMiniView();\n            }\n            else if (key == VirtualKey.Left || key == VirtualKey.Right || key == VirtualKey.Up || key == VirtualKey.Down)\n            {\n                // Do nothing, but don't switch out of now playing either.\n            }\n            else\n            {\n                return KeyDownProcessResult.AskJs;\n            }\n            return KeyDownProcessResult.Handled;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/LanguageHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.Classes.Model;\n\nnamespace XpoMusic.Helpers\n{\n    public static class LanguageHelper\n    {\n        public static List<Language> GetLanguages()\n        {\n            var output = new List<Language>();\n\n            var items = Enum.GetValues(typeof(Language));\n            foreach (var item in items)\n            {\n                if ((Language)item == Language.Default)\n                    continue;\n                output.Add((Language)item);\n            }\n\n            output = output.OrderBy(x => GetLanguageName(x)).ToList();\n            output.Insert(0, Language.Default);\n\n            return output;\n        }\n\n        public static string GetLanguageName(Language language)\n        {\n            switch (language)\n            {\n                case Language.English:\n                    return \"English\";\n                case Language.Arabic:\n                    return \"Arabic\";\n                case Language.Hungarian:\n                    return \"Hungarian\";\n                case Language.Czech:\n                    return \"Czech\";\n                case Language.German:\n                    return \"German\";\n                case Language.Spanish:\n                    return \"Spanish\";\n                case Language.Finnish:\n                    return \"Finnish\";\n                case Language.French:\n                    return \"French\";\n                case Language.CanadianFrench:\n                    return \"French (Canadian)\";\n                case Language.Greek:\n                    return \"Greek\";\n                case Language.Indonesian:\n                    return \"Indonesian\";\n                case Language.Italian:\n                    return \"Italian\";\n                case Language.Japanese:\n                    return \"Japanese\";\n                case Language.Malay:\n                    return \"Malay\";\n                case Language.Dutch:\n                    return \"Dutch\";\n                case Language.Polish:\n                    return \"Polish\";\n                case Language.BrazillianPortuguese:\n                    return \"Portuguese (Brazil)\";\n                case Language.Swedish:\n                    return \"Swedish\";\n                case Language.Thai:\n                    return \"Thai\";\n                case Language.Turkish:\n                    return \"Turkish\";\n                case Language.Vietnamese:\n                    return \"Vietnamese\";\n                case Language.Default:\n                default:\n                    return \"Auto detect\";\n            }\n        }\n\n        public static string GetHeaderLanguageString(Language language)\n        {\n            switch (language)\n            {\n                case Language.English:\n                    return \"en\";\n                case Language.Arabic:\n                    return \"ar\";\n                case Language.Hungarian:\n                    return \"hu\";\n                case Language.Czech:\n                    return \"cs\";\n                case Language.German:\n                    return \"de\";\n                case Language.Spanish:\n                    return \"es\";\n                case Language.Finnish:\n                    return \"fi\";\n                case Language.French:\n                    return \"fr\";\n                case Language.CanadianFrench:\n                    return \"fr-ca\";\n                case Language.Greek:\n                    return \"el\";\n                case Language.Indonesian:\n                    return \"id\";\n                case Language.Italian:\n                    return \"it\";\n                case Language.Japanese:\n                    return \"ja\";\n                case Language.Malay:\n                    return \"ms\";\n                case Language.Dutch:\n                    return \"nl\";\n                case Language.Polish:\n                    return \"pl\";\n                case Language.BrazillianPortuguese:\n                    return \"pt-br\";\n                case Language.Swedish:\n                    return \"sv\";\n                case Language.Thai:\n                    return \"th\";\n                case Language.Turkish:\n                    return \"tr\";\n                case Language.Vietnamese:\n                    return \"vi\";\n                case Language.Default:\n                default:\n                    return \"\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/LiveTileHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Core;\nusing Windows.Data.Xml.Dom;\nusing Windows.UI.Notifications;\nusing Windows.UI.StartScreen;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.Helpers\n{\n    public static class LiveTileHelper\n    {\n        public enum LiveTileDesign\n        {\n            Disabled = 0,\n            AlbumAndArtistArt = 1,\n            AlbumArtOnly = 2,\n            ArtistArtOnly = 3,\n        }\n\n        internal static LiveTileDesign[] GetLiveTileDesigns()\n        {\n            return new[] {\n                LiveTileDesign.AlbumAndArtistArt,\n                LiveTileDesign.AlbumArtOnly,\n                LiveTileDesign.ArtistArtOnly,\n                LiveTileDesign.Disabled,\n            };\n        }\n\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static TileUpdater tileUpdater;\n        private static int? lastTileUpdateHash = null;\n\n        public static void InitLiveTileUpdates()\n        {\n            tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();\n\n            ClearLiveTile(); // Clear live tile on startup\n\n            PlayStatusTracker.LastPlayStatus.Updated += LastPlayStatus_Updated;\n            Application.Current.Suspending += Current_Suspending;\n        }\n\n        private static void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)\n        {\n            ClearLiveTile();\n            logger.Info(\"Cleared live tile on Suspending event.\");\n        }\n\n        private static void LastPlayStatus_Updated(object sender, EventArgs e)\n        {\n            try\n            {\n                //if (!PlayStatusTracker.LastPlayStatus.IsPlaying)\n                //{\n                //    ClearLiveTile();\n                //    return;\n                //}\n\n                UpdateLiveTile();\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"LastPlayStatus_Updated error: \" + ex.ToString());\n            }\n        }\n\n        public static async void UpdateLiveTile()\n        {\n            try\n            {\n                if (LocalConfiguration.LiveTileDesign == LiveTileDesign.Disabled)\n                {\n                    ClearLiveTile();\n                    return;\n                }\n\n                var artistPhoto = await SongImageProvider.GetArtistArt(PlayStatusTracker.LastPlayStatus.ArtistId);\n                var albumPhoto = await SongImageProvider.GetAlbumArt(PlayStatusTracker.LastPlayStatus.AlbumId);\n\n                var template = GetLiveTileTemplate(LocalConfiguration.LiveTileDesign)\n                    .Replace(\"{albumName}\", WebUtility.HtmlEncode(PlayStatusTracker.LastPlayStatus.AlbumName))\n                    .Replace(\"{artistName}\", WebUtility.HtmlEncode(PlayStatusTracker.LastPlayStatus.ArtistName))\n                    .Replace(\"{songName}\", WebUtility.HtmlEncode(PlayStatusTracker.LastPlayStatus.SongName))\n                    .Replace(\"{artistPhoto}\", WebUtility.HtmlEncode(artistPhoto))\n                    .Replace(\"{albumPhoto}\", WebUtility.HtmlEncode(albumPhoto));\n\n                UpdateTileWithTemplate(template);\n\n                logger.Info(\"Live tile updated.\");\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"UpdateLiveTile failed: \" + ex.ToString());\n            }\n        }\n\n        private static string GetLiveTileTemplate(LiveTileDesign design)\n        {\n            return File.ReadAllText($\"Assets/TileTemplates/LiveTile{design}.xml\");\n        }\n\n        private static void UpdateTileWithTemplate(string template)\n        {\n            if (lastTileUpdateHash.HasValue && lastTileUpdateHash.Value.GetHashCode() == template.GetHashCode())\n                return; // Do not update tile again with same data.\n            lastTileUpdateHash = template.GetHashCode();\n\n            var xml = new XmlDocument();\n            xml.LoadXml(template);\n\n            var notification = new TileNotification(xml);\n\n            tileUpdater.Update(notification);\n        }\n\n        public static void ClearLiveTile()\n        {\n            lastTileUpdateHash = null;\n            tileUpdater.Clear();\n        }\n\n        internal static async Task<bool> IsPinnedToStart()\n        {\n            AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];\n            bool isPinned = await StartScreenManager.GetDefault().ContainsAppListEntryAsync(entry);\n\n            return isPinned;\n        }\n\n        internal static async Task<bool> CanPinToStart()\n        {\n            AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];\n            bool isSupported = StartScreenManager.GetDefault().SupportsAppListEntry(entry);\n\n            return isSupported;\n        }\n\n        internal static async Task PinToStart()\n        {\n            AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];\n            bool isPinned = await StartScreenManager.GetDefault().RequestAddAppListEntryAsync(entry);\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/MediaControlsHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Media;\nusing Windows.Storage.Streams;\nusing Windows.UI.Core;\nusing XpoMusic.Classes;\nusing XpoMusic.Controls;\nusing static XpoMusic.Classes.PlayStatusTracker;\n\nnamespace XpoMusic.Helpers\n{\n    public static class MediaControlsHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static event EventHandler<TrackChangedEventArgs> TrackChanged;\n        public static SystemMediaTransportControls MediaControls { get; private set; }\n\n        private static CoreDispatcher _dispatcher;\n\n        private static int lastMediaControlUpdateHash;\n\n        public static async void Init(CoreDispatcher dispatcher)\n        {\n            _dispatcher = dispatcher;\n\n            var mediaControls = SystemMediaTransportControls.GetForCurrentView();\n            mediaControls.IsEnabled = true;\n            mediaControls.IsPreviousEnabled = true;\n            mediaControls.IsNextEnabled = true;\n            mediaControls.IsPlayEnabled = true;\n            mediaControls.IsPauseEnabled = true;\n            mediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;\n            mediaControls.ButtonPressed += SystemControls_ButtonPressed;\n            await mediaControls.DisplayUpdater.CopyFromFileAsync(MediaPlaybackType.Music,\n                await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri(\"ms-appx:///Assets/Media/silent.wav\")));\n\n            MediaControls = mediaControls;\n\n            PlayStatusTracker.LastPlayStatus.Updated += LastPlayStatus_Updated;\n        }\n\n        private static async void LastPlayStatus_Updated(object sender, EventArgs e)\n        {\n            try\n            {\n                await UpdateMediaControls();\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"UpdateMediaControls failed: \" + ex.ToString());\n            }\n        }\n\n        private static async Task UpdateMediaControls()\n        {\n            if (MediaControls == null)\n                return;\n\n            var hash = $\"{LastPlayStatus.IsPlaying};{LastPlayStatus.SongName};{LastPlayStatus.AlbumId};{LastPlayStatus.ArtistId}\".GetHashCode();\n            if (lastMediaControlUpdateHash == hash)\n                return;\n\n            lastMediaControlUpdateHash = hash;\n\n            logger.Info(\"Updating MediaControls...\");\n\n            MediaControls.PlaybackStatus = (LastPlayStatus.IsPlaying) ? MediaPlaybackStatus.Playing : MediaPlaybackStatus.Paused;\n            MediaControls.DisplayUpdater.MusicProperties.Title = LastPlayStatus.SongName;\n            MediaControls.DisplayUpdater.MusicProperties.AlbumTitle = LastPlayStatus.AlbumName;\n            MediaControls.DisplayUpdater.MusicProperties.Artist = LastPlayStatus.ArtistName;\n\n            try\n            {\n                var albumArt = await SongImageProvider.GetAlbumArt(LastPlayStatus.AlbumId);\n                if (string.IsNullOrEmpty(albumArt))\n                    MediaControls.DisplayUpdater.Thumbnail = null;\n                else\n                    MediaControls.DisplayUpdater.Thumbnail = RandomAccessStreamReference.CreateFromUri(new Uri(albumArt));\n            }\n            catch { }\n\n            MediaControls.DisplayUpdater.Update();\n\n            logger.Info(\"MediaControls updated.\");\n        }\n\n        private static async void SystemControls_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs e)\n        {\n            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>\n            {\n                var mediaControls = SystemMediaTransportControls.GetForCurrentView();\n\n                try\n                {\n                    switch (e.Button)\n                    {\n                        case SystemMediaTransportControlsButton.Play:\n                            if (await PlaybackActionHelper.Play())\n                                mediaControls.PlaybackStatus = MediaPlaybackStatus.Playing;\n\n                            break;\n                        case SystemMediaTransportControlsButton.Pause:\n                            if (await PlaybackActionHelper.Pause())\n                                mediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;\n\n                            break;\n                        case SystemMediaTransportControlsButton.Stop:\n                            if (await PlaybackActionHelper.Pause())\n                                mediaControls.PlaybackStatus = MediaPlaybackStatus.Paused;\n\n                            break;\n                        case SystemMediaTransportControlsButton.Next:\n                            if (await PlaybackActionHelper.NextTrack())\n                                TrackChanged?.Invoke(null, new TrackChangedEventArgs\n                                {\n                                    Direction = TrackChangedEventArgs.TrackChangeDirection.Forward,\n                                });\n                                \n\n                            break;\n                        case SystemMediaTransportControlsButton.Previous:\n                            if (await PlaybackActionHelper.PreviousTrack())\n                                TrackChanged?.Invoke(null, new TrackChangedEventArgs\n                                {\n                                    Direction = TrackChangedEventArgs.TrackChangeDirection.Backward,\n                                });\n\n                            // Necessary for progress bar update, in case 'previous' command goes to \n                            // the beginning of the same track.\n                            await Task.Delay(500);\n                            await PlayStatusTracker.RefreshPlayStatus();\n\n                            break;\n                    }\n                }\n                catch (UnauthorizedAccessException)\n                {\n                    UnauthorizedHelper.OnUnauthorizedError();\n                }\n            });\n        }\n\n        public class TrackChangedEventArgs\n        {\n            public TrackChangeDirection Direction { get; internal set; }\n\n            public enum TrackChangeDirection\n            {\n                Forward,\n                Backward,\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/PackageHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Core;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.Helpers\n{\n    public static class PackageHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static readonly string proPackageName = \"36835MahdiGhiasi.XpotifyPro\";\n        internal static readonly Uri ProStoreUri = new Uri(\"ms-windows-store://pdp/?productid=9PC9VV8KTXPL\");\n\n        public static string GetAppVersionString()\n        {\n            Package package = Package.Current;\n            PackageId packageId = package.Id;\n            PackageVersion version = packageId.Version;\n\n            return string.Format(\"{0}.{1}.{2}.{3}\", version.Major, version.Minor, version.Build, version.Revision);\n        }\n\n        public static string GetAppNameString()\n        {\n            return Package.Current.DisplayName;\n        }\n\n        public static Version GetAppVersion()\n        {\n            return Version.Parse(GetAppVersionString());\n        }\n\n        public static void RestartApp()\n        {\n            ToastHelper.SendReopenAppToast();\n\n            LiveTileHelper.ClearLiveTile();\n            logger.Info(\"Cleared live tile on RestartApp().\");\n\n            logger.Info(\"RestartApp() will close the app now.\");\n            Application.Current.Exit();\n        }\n\n        public static bool IsProVersion => Package.Current.Id.FamilyName.Contains(proPackageName);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/PlaybackActionHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.SpotifyApi;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class PlaybackActionHelper\n    {\n        private static WebViewController _controller;\n\n        public static void SetController(WebViewController controller)\n        {\n            _controller = controller;\n        }\n\n        public static async Task<bool> Play()\n        {\n            if (await _controller.Play())\n            {\n                await Task.Delay(100);\n                return true;\n            }\n\n            return await (new Player()).ResumePlaying();\n        }\n\n        public static async Task<bool> Pause()\n        {\n            if (await _controller.Pause())\n            {\n                await Task.Delay(100);\n                return true;\n            }\n\n            return await (new Player()).Pause();\n        }\n\n        public static async Task<bool> NextTrack()\n        {\n            // Progress bar on CompactOverlay should jump *immediately* to 0,\n            // so the user get the feeling that their command was received.\n            PlayStatusTracker.LastPlayStatus.ProgressedMilliseconds = 0;\n\n            if (await _controller.NextTrack())\n            {\n                await Task.Delay(100);\n                return true;\n            }\n\n            return await (new Player()).NextTrack();\n        }\n\n        public static async Task<bool> PreviousTrack(bool canGoToBeginningOfCurrentSong = true)\n        {\n            // Progress bar on CompactOverlay should jump *immediately* to 0,\n            // so the user get the feeling that their command was received.\n            PlayStatusTracker.LastPlayStatus.ProgressedMilliseconds = 0;\n\n            if (!canGoToBeginningOfCurrentSong && await (new Player()).PreviousTrack())\n            {\n                // Prefer API call when not going to the beginning of the current song\n                return true;\n            }\n\n            if (await _controller.PreviousTrack(canGoToBeginningOfCurrentSong))\n            {\n                await Task.Delay(100);\n                return true;\n            }\n\n            return await (new Player()).PreviousTrack();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/ProxyHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class ProxyHelper\n    {\n        public enum ProxyType\n        {\n            HttpHttps = 1,\n            Socks = 2,\n        }\n\n        public static bool IsCustomProxyEverEnabledInThisSession { get; private set; } = false;\n\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        internal static void SetSocksProxyInProcess(string address, string port)\n        {\n            SetProxyInProcess($\"socks={address}:{port}\", \"local\");\n        }\n\n        internal static void SetHttpHttpsProxyInProcess(string address, string port)\n        {\n            SetProxyInProcess($\"http={address}:{port};https={address}:{port}\", \"local\");\n        }\n\n        public static void SetProxyInProcess(string proxy, string proxyBypass)\n        {\n            IsCustomProxyEverEnabledInThisSession = true;\n\n            var proxyInfo = new INTERNET_PROXY_INFO\n            {\n                dwAccessType = INTERNET_OPEN_TYPE.INTERNET_OPEN_TYPE_PROXY,\n                lpszProxy = proxy,\n                lpszProxyBypass = proxyBypass,\n            };\n            var dwBufferLength = (uint)Marshal.SizeOf(proxyInfo);\n            var result = UrlMkSetSessionOption(INTERNET_OPTION.INTERNET_OPTION_PROXY, proxyInfo, dwBufferLength, 0U);\n\n            if (result != 0)\n            {\n                var errorCode = Marshal.GetLastWin32Error();\n                logger.Warn($\"UrlMkSetSessionOption failed with error code {errorCode}.\");\n            }\n        }\n\n        internal static void ApplyProxySettings()\n        {\n            if (!LocalConfiguration.IsCustomProxyEnabled)\n                return;\n\n            if (string.IsNullOrWhiteSpace(LocalConfiguration.CustomProxyAddress))\n                return;\n            if (string.IsNullOrWhiteSpace(LocalConfiguration.CustomProxyPort))\n                return;\n\n            if (LocalConfiguration.CustomProxyType == ProxyType.HttpHttps)\n                SetHttpHttpsProxyInProcess(LocalConfiguration.CustomProxyAddress, LocalConfiguration.CustomProxyPort);\n            else\n                SetSocksProxyInProcess(LocalConfiguration.CustomProxyAddress, LocalConfiguration.CustomProxyPort);\n        }\n\n        internal enum INTERNET_OPTION\n        {\n            INTERNET_OPTION_REFRESH = 37,\n            INTERNET_OPTION_PROXY = 38,\n            INTERNET_OPTION_SETTINGS_CHANGED = 39,\n            INTERNET_OPTION_PER_CONNECTION_OPTION = 75,\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal class INTERNET_PROXY_INFO\n        {\n            [MarshalAs(UnmanagedType.U4)]\n            public INTERNET_OPEN_TYPE dwAccessType;\n\n            [MarshalAs(UnmanagedType.LPStr)]\n            public string lpszProxy;\n\n            [MarshalAs(UnmanagedType.LPStr)]\n            public string lpszProxyBypass;\n        }\n\n        internal enum INTERNET_OPEN_TYPE\n        {\n            INTERNET_OPEN_TYPE_PRECONFIG = 0,\n            INTERNET_OPEN_TYPE_DIRECT = 1,\n            INTERNET_OPEN_TYPE_PROXY = 3,\n            INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4,\n        }\n\n        [DllImport(\"urlmon.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        internal static extern int UrlMkSetSessionOption(\n            INTERNET_OPTION dwOption,\n            INTERNET_PROXY_INFO pBuffer,\n            uint dwBufferLength,\n            uint dwReserved);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/SongImageProvider.cs",
    "content": "﻿using XpoMusic.SpotifyApi;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.Classes.Cache;\n\nnamespace XpoMusic.Helpers\n{\n    public static class SongImageProvider\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        static Dictionary<string, string> artistImages = new Dictionary<string, string>();\n        static Dictionary<string, string> albumImages = new Dictionary<string, string>();\n        static Dictionary<string, string> playlistImages = new Dictionary<string, string>();\n\n        public static async Task<string> GetArtistArt(string artistId)\n        {\n            if (string.IsNullOrEmpty(artistId))\n                return \"\";\n\n            try\n            {\n                var artist = await GlobalCache.Artist.GetItem(artistId);\n\n                artistImages[artistId] = artist.images.OrderBy(x => x.width).Last().url;\n                return artistImages[artistId];\n            }\n            catch (Exception ex)\n            {\n                logger.Info($\"Fetching artist art for {artistId} failed: {ex}\");\n                return \"\";\n            }\n        }\n\n        public static async Task<string> GetAlbumArt(string albumId)\n        {\n            if (string.IsNullOrEmpty(albumId))\n                return \"\";\n\n            try\n            {\n                var album = await GlobalCache.Album.GetItem(albumId);\n\n                albumImages[albumId] = album.images.OrderBy(x => x.width).Last().url;\n                return albumImages[albumId];\n            }\n            catch (Exception ex)\n            {\n                logger.Info($\"Fetching album art for {albumId} failed: {ex}\");\n                return \"\";\n            }\n        }\n\n        public static async Task<string> GetPlaylistArt(string playlistId)\n        {\n            if (string.IsNullOrEmpty(playlistId))\n                return \"\";\n\n            try\n            {\n                var playlist = await GlobalCache.Playlist.GetItem(playlistId);\n\n                playlistImages[playlistId] = playlist.images.OrderBy(x => x.width).Last().url;\n                return playlistImages[playlistId];\n            }\n            catch (Exception ex)\n            {\n                logger.Info($\"Fetching playlist art for {playlistId} failed: {ex}\");\n                return \"\";\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "XpoMusic/Helpers/SpotifyShareUriHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class SpotifyShareUriHelper\n    {\n        public static string GetPwaUri(string uri)\n        {\n            if (string.IsNullOrWhiteSpace(uri))\n                return \"\";\n\n            uri = Regex.Replace(uri, \"http\\\\://\", \"https://\", RegexOptions.IgnoreCase);\n\n            var uriLowerCase = uri.ToLower();\n\n            if (uriLowerCase.StartsWith(\"xpotify:https://\"))\n            {\n                uri = uri.Substring(\"xpotify:\".Length);\n                uriLowerCase = uri.ToLower();\n            }\n            else if (uriLowerCase.StartsWith(\"xpomusic:https://\"))\n            {\n                uri = uri.Substring(\"xpomusic:\".Length);\n                uriLowerCase = uri.ToLower();\n            }\n            else if (uriLowerCase.StartsWith(\"xpotify:\"))\n            {\n                uri = Regex.Replace(uri, \"^xpotify\\\\:\", \"spotify:\", RegexOptions.IgnoreCase);\n                uriLowerCase = uri.ToLower();\n            }\n            else if (uriLowerCase.StartsWith(\"xpomusic:\"))\n            {\n                uri = Regex.Replace(uri, \"^xpomusic\\\\:\", \"spotify:\", RegexOptions.IgnoreCase);\n                uriLowerCase = uri.ToLower();\n            }\n            else if (uriLowerCase.StartsWith(\"spotify:nl:\"))\n            {\n                uri = ParseNlUri(uri.Substring(\"spotify:nl:\".Length));\n                uriLowerCase = uri.ToLower();\n            }\n\n            if (uriLowerCase.StartsWith(WebViewController.SpotifyPwaUrlBeginsWith))\n                return uri;\n\n\n            var spotifyUriMatch = Regex.Match(uriLowerCase, \"^spotify:[A-Za-z]+:\");\n            if (spotifyUriMatch.Success)\n            {\n                var categoryTerm = spotifyUriMatch.ToString();\n                var category = categoryTerm.Split(':')[1].ToLower();\n                var idx = uriLowerCase.IndexOf(categoryTerm) + categoryTerm.Length;\n                return \"https://open.spotify.com/\" + category + \"/\" + uri.Substring(idx);\n            }\n\n            return \"\";\n        }\n\n        private static string ParseNlUri(string base64Code)\n        {\n            var code = Encoding.UTF8.GetString(Convert.FromBase64String(base64Code));\n            var code2 = new string(code.Where(x => char.IsLetterOrDigit(x) || x == ':').ToArray());\n\n            string type;\n            if (code2.Contains(\"album:\"))\n                type = \"album:\";\n            else if (code2.Contains(\"playlist:\"))\n                type = \"playlist:\";\n            else if (code2.Contains(\"dailymix:\"))\n                type = \"dailymix:\";\n            else if (code2.Contains(\"track:\"))\n                type = \"track:\";\n            else if (code2.Contains(\"artist:\"))\n                type = \"artist:\";\n            else if (code2.Contains(\"show:\"))\n                type = \"show:\";\n            else\n                return \"\";\n\n            var code3 = code2.Substring(code2.IndexOf(type)).Trim();\n\n            return $\"spotify:{code3}\";\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/StoryboardExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml.Media.Animation;\n\nnamespace XpoMusic.Helpers\n{\n    public static class StoryboardExtensions\n    {\n        public static async Task RunAsync(this Storyboard storyboard)\n        {\n            TaskCompletionSource<bool> tcs;\n            tcs = new TaskCompletionSource<bool>();\n\n            void handler(object s, object e) => tcs.TrySetResult(true);\n\n            storyboard.Completed += handler;\n\n            storyboard.Begin();\n            await tcs.Task;\n\n            storyboard.Completed -= handler;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/StuckResolveHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.Classes;\nusing XpoMusic.SpotifyApi;\nusing XpoMusicWebAgent.Model;\n\nnamespace XpoMusic.Helpers\n{\n    public static class StuckResolveHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static int stuckResolveTryCount = 0;\n        private static int sameElapsedCounter = 0;\n        private static int lastElapsed = -1;\n\n        public static async void StatusReportReceived(NowPlayingData data, WebViewController controller)\n        {\n            if (!data.IsPlaying)\n                return;\n\n            if (!(await controller.IsPlayingOnThisApp()))\n            {\n                // Not playing on this app. StuckResolve is not valid in this context.\n                lastElapsed = -1;\n                return;\n            }\n\n            logger.Trace(data.ElapsedTime.ToString());\n\n            try\n            {\n                if (data.ElapsedTime == lastElapsed)\n                {\n                    sameElapsedCounter++;\n\n                    if (sameElapsedCounter > AppConstants.Instance.StuckDetectSameElapsedCount)\n                    {\n                        if (stuckResolveTryCount >= AppConstants.Instance.MaxStuckResolveTryCount)\n                        {\n                            logger.Warn(\"MaxStuckResolveTryCount exceeded.\");\n\n                            if (stuckResolveTryCount == AppConstants.Instance.MaxStuckResolveTryCount)\n                                LogPlaybackStuck(\"MaxStuckResolveTryCountExceeded\");\n\n                            // TODO: Probably reload the page?\n                        }\n\n                        if (data.ElapsedTime == 0)\n                        {\n                            await PlayStartStuckResolve(controller);\n                        }\n                        else\n                        {\n                            await PlayMiddleStuckResolve(controller);\n                        }\n\n                        stuckResolveTryCount++;\n                        sameElapsedCounter = -1 * AppConstants.Instance.StuckDetectSameElapsedExtraCount;\n                    }\n                }\n                else\n                {\n                    stuckResolveTryCount = 0;\n                    sameElapsedCounter = 0;\n                    lastElapsed = data.ElapsedTime;\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"StuckResolveHelper.StatusReportReceived failed: \" + ex.ToString());\n            }\n        }\n\n        private static async Task PlayMiddleStuckResolve(WebViewController controller)\n        {\n            await controller.TryResolvePlaybackMiddleStuck();\n            LogPlaybackStuck(\"14\");\n        }\n\n        private static async Task PlayStartStuckResolve(WebViewController controller)\n        {\n            bool apiFixSuccess = false;\n\n            var player = new Player();\n            apiFixSuccess = await player.PreviousTrack();\n\n            if (apiFixSuccess)\n            {\n                LogPlaybackStuck(\"11\");\n            }\n            else\n            {\n                await controller.TryResolvePlaybackStartStuck();\n\n                LogPlaybackStuck(\"12\");\n            }\n        }\n\n        private static void LogPlaybackStuck(string code)\n        {\n            ToastHelper.SendDebugToast(\"PlaybackStuck\", code);\n            AnalyticsHelper.Log(\"playbackStuck\", code);\n            logger.Info($\"PlaybackStuck - {code}\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/ThemeHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Classes.Model;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.Helpers\n{\n    public static class ThemeHelper\n    {\n        public static List<Theme> GetThemes()\n        {\n            var output = new List<Theme>();\n\n            var items = Enum.GetValues(typeof(Theme));\n            foreach (var item in items)\n            {\n                output.Add((Theme)item);\n            }\n\n            output = output.OrderBy(x => (int)x).ToList();\n\n            return output;\n        }\n\n        public static string GetThemeName(Theme theme)\n        {\n            switch (theme)\n            {\n                case Theme.Dark:\n                    return \"Dark\";\n                case Theme.Light:\n                    return \"Light\";\n                case Theme.System:\n                    return \"Follow Windows app theme\";\n                default:\n                    return \"???\";\n            }\n        }\n\n        internal static Theme GetCurrentTheme()\n        {\n            if (LocalConfiguration.Theme != Theme.System)\n                return LocalConfiguration.Theme;\n\n            return (Application.Current.RequestedTheme == ApplicationTheme.Dark) ? Theme.Dark : Theme.Light;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/TileHelper.cs",
    "content": "﻿using XpoMusic.Classes;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Net;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Graphics.Imaging;\nusing Windows.Storage;\nusing Windows.UI.StartScreen;\nusing Windows.UI.Xaml.Media.Imaging;\n\nnamespace XpoMusic.Helpers\n{\n    public static class TileHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static async Task<bool> PinPageToStart(string pageUrl, string title)\n        {\n            // TODO: Download and use album/artist/playlist image for tile, if applicable\n\n            string tileId = Guid.NewGuid().ToString();\n\n            string arguments = \"pageUrl=\" + WebUtility.UrlEncode(pageUrl);\n\n            SecondaryTile tile = new SecondaryTile(\n                tileId,\n                title,\n                arguments,\n                new Uri(\"ms-appx:///Assets/Logo/Square150x150Logo.png\"),\n                TileSize.Default);\n\n            // Enable wide and large tile sizes\n            tile.VisualElements.Wide310x150Logo = new Uri(\"ms-appx:///Assets/Logo/Wide310x150Logo.png\");\n            tile.VisualElements.Square310x310Logo = new Uri(\"ms-appx:///Assets/Logo/LargeTile.png\");\n\n            var images = await GetTileImages(pageUrl);\n            if (images != null)\n            {\n                tile.VisualElements.Square150x150Logo = images.SquareImage;\n                tile.VisualElements.Wide310x150Logo = images.WideImage;\n                tile.VisualElements.Square310x310Logo = images.SquareImage;\n            }\n\n            // Show the display name on all sizes\n            tile.VisualElements.ShowNameOnSquare150x150Logo = true;\n            tile.VisualElements.ShowNameOnWide310x150Logo = true;\n            tile.VisualElements.ShowNameOnSquare310x310Logo = true;\n\n            var result = await tile.RequestCreateAsync();\n\n            if (!result)\n                logger.Info(\"Tile creation failed\");\n\n            return result;\n        }\n\n        public static async Task<TileImageCollection> GetTileImages(string pageUrl)\n        {\n            try\n            {\n                if (pageUrl.ToLower().StartsWith(\"https://open.spotify.com/playlist/\"))\n                {\n                    string playlistId = pageUrl.Substring(\"https://open.spotify.com/playlist/\".Length);\n                    if (playlistId.Contains('/'))\n                        playlistId = playlistId.Substring(0, playlistId.IndexOf('/') - 1);\n\n                    var image = await ImageSaveHelper.GetAndSaveTileOriginalImage(await SongImageProvider.GetPlaylistArt(playlistId));\n                    var tileImages = await CreateTileImages(image);\n\n                    await (await StorageFile.GetFileFromApplicationUriAsync(image)).DeleteAsync();\n\n                    return tileImages;\n                }\n                else if (pageUrl.ToLower().StartsWith(\"https://open.spotify.com/artist/\"))\n                {\n                    string artistId = pageUrl.Substring(\"https://open.spotify.com/artist/\".Length);\n                    if (artistId.Contains('/'))\n                        artistId = artistId.Substring(0, artistId.IndexOf('/') - 1);\n\n                    var image = await ImageSaveHelper.GetAndSaveTileOriginalImage(await SongImageProvider.GetArtistArt(artistId));\n                    var tileImages = await CreateTileImages(image);\n\n                    await (await StorageFile.GetFileFromApplicationUriAsync(image)).DeleteAsync();\n\n                    return tileImages;\n                }\n                else if (pageUrl.ToLower().StartsWith(\"https://open.spotify.com/album/\"))\n                {\n                    string albumId = pageUrl.Substring(\"https://open.spotify.com/album/\".Length);\n                    if (albumId.Contains('/'))\n                        albumId = albumId.Substring(0, albumId.IndexOf('/') - 1);\n\n                    var image = await ImageSaveHelper.GetAndSaveTileOriginalImage(await SongImageProvider.GetAlbumArt(albumId));\n                    var tileImages = await CreateTileImages(image);\n\n                    await (await StorageFile.GetFileFromApplicationUriAsync(image)).DeleteAsync();\n\n                    return tileImages;\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Info(\"GetTileImage failed: \" + ex.ToString());\n            }\n\n            return null;\n        }\n\n        private static async Task<TileImageCollection> CreateTileImages(Uri imageUri)\n        {\n            var file = await StorageFile.GetFileFromApplicationUriAsync(imageUri);\n            var decoder = await BitmapDecoder.CreateAsync(await file.OpenAsync(FileAccessMode.Read));\n\n            WriteableBitmap squareBitmap, wideBitmap;\n\n            (Point squarePoint, Size squareSize) = GetCropDetails(decoder, 1.0);\n            squareBitmap = await CropBitmap.GetCroppedBitmapAsync(file, squarePoint, squareSize, 1.0);\n\n            (Point widePoint, Size wideSize) = GetCropDetails(decoder, 310.0 / 150.0);\n            wideBitmap = await CropBitmap.GetCroppedBitmapAsync(file, widePoint, wideSize, 1.0);\n\n            var squareFile = await ImageSaveHelper.SaveWritableBitmapToTileImageCache(squareBitmap, \"square\");\n            var wideFile = await ImageSaveHelper.SaveWritableBitmapToTileImageCache(wideBitmap, \"wide\");\n\n            return new TileImageCollection\n            {\n                SquareImage = squareFile,\n                WideImage = wideFile,\n            };\n        }\n\n        public static (Point, Size) GetCropDetails(BitmapDecoder decoder, double desiredRatio)\n        {\n            double sourceRatio = ((double)decoder.PixelWidth) / ((double)decoder.PixelHeight);\n\n            if (sourceRatio == desiredRatio)\n            {\n                return (new Point(0, 0), new Size(decoder.PixelWidth, decoder.PixelHeight));\n            }\n            else if (sourceRatio > desiredRatio)\n            {\n                var destWidth = (desiredRatio / sourceRatio) * decoder.PixelWidth;\n                var x = (decoder.PixelWidth / 2.0) - (destWidth / 2.0);\n                return (new Point(x, 0), new Size(destWidth, decoder.PixelHeight));\n            }\n            else\n            {\n                var destHeight = (sourceRatio / desiredRatio) * decoder.PixelHeight;\n                var y = (decoder.PixelHeight / 2.0) - (destHeight / 2.0);\n                return (new Point(0, y), new Size(decoder.PixelWidth, destHeight));\n            }\n        }\n    }\n\n    public class TileImageCollection\n    {\n        public Uri SquareImage;\n        public Uri WideImage;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/ToastHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.Helpers\n{\n    public static class ToastHelper\n    {\n        public static void SendDebugToast(string title, string text)\n        {\n#if DEBUG\n            // template to load for showing Toast Notification\n            var xmlToastTemplate = \"<toast launch=\\\"app-defined-string\\\">\" +\n                                     \"<visual>\" +\n                                       \"<binding template =\\\"ToastGeneric\\\">\" +\n                                         \"<text>\" + WebUtility.HtmlEncode(title) + \"</text>\" +\n                                         \"<text>\" +\n                                           WebUtility.HtmlEncode(text) +\n                                         \"</text>\" +\n                                       \"</binding>\" +\n                                     \"</visual>\" +\n                                   \"</toast>\";\n\n            // load the template as XML document\n            var xmlDocument = new Windows.Data.Xml.Dom.XmlDocument();\n            xmlDocument.LoadXml(xmlToastTemplate);\n\n            // create the toast notification and show to user\n            var toastNotification = new Windows.UI.Notifications.ToastNotification(xmlDocument);\n            var notification = Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier();\n            notification.Show(toastNotification);\n#endif\n        }\n\n        public static void SendReopenAppToast()\n        {\n            // template to load for showing Toast Notification\n            var xmlToastTemplate = \"<toast launch=\\\"action=reopenApp\\\">\" +\n                                     \"<visual>\" +\n                                       \"<binding template =\\\"ToastGeneric\\\">\" +\n                                         \"<text>Tap here to open Xpo Music again</text>\" +\n                                       \"</binding>\" +\n                                     \"</visual>\" +\n                                   \"</toast>\";\n\n            // load the template as XML document\n            var xmlDocument = new Windows.Data.Xml.Dom.XmlDocument();\n            xmlDocument.LoadXml(xmlToastTemplate);\n\n            // create the toast notification and show to user\n            var toastNotification = new Windows.UI.Notifications.ToastNotification(xmlDocument);\n            var notification = Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier();\n            notification.Show(toastNotification);\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/UnauthorizedHelper.cs",
    "content": "﻿using XpoMusic.SpotifyApi;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Popups;\n\nnamespace XpoMusic.Helpers\n{\n    public static class UnauthorizedHelper\n    {\n        static readonly TimeSpan minimumNotifyDelay = TimeSpan.FromMinutes(3);\n\n        static DateTime lastNotifyToUser = DateTime.MinValue;\n\n        public static async void OnUnauthorizedError()\n        {\n            if (DateTime.UtcNow - lastNotifyToUser < minimumNotifyDelay)\n                return;\n\n            lastNotifyToUser = DateTime.UtcNow;\n\n            TokenHelper.ClearTokens();\n\n            var md = new MessageDialog(\"Please close and reopen Xpo Music; you may be asked to enter your credentials \" +\n                \"again. In the meantime, some features might not work correctly.\", \"Authorization Error\");\n            await md.ShowAsync();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/WebResourceModificationHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Web.Http;\nusing XpoMusic.Classes;\nusing XpoMusic.Classes.Model.WebResourceModifications;\n\nnamespace XpoMusic.Helpers\n{\n    public static class WebResourceModificationHelper\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public static async Task<HttpResponseMessage> WebResourceRequested(HttpRequestMessage request)\n        {\n            if (AppConstants.Instance.ModificationRules == null)\n                return null;\n\n            var requestUri = request.RequestUri.ToString();\n\n            foreach (var rule in AppConstants.Instance.ModificationRules)\n            {\n                if (!rule.Match(requestUri))\n                    continue;\n\n                if (rule.Type == WebResourceModificationRuleType.ReplaceWholeFile)\n                {\n                    return await DownloadFile(new HttpRequestMessage(request.Method, new Uri(rule.AlternativeFileUri)));\n                }\n                else if (rule.Type == WebResourceModificationRuleType.ModifyString)\n                {\n                    var response = await DownloadFile(request);\n\n                    if (!response.IsSuccessStatusCode)\n                        return response;\n\n                    var responseBuffer = await response.Content.ReadAsBufferAsync();\n                    var responseByteArray = responseBuffer.ToArray();\n                    var responseString = Encoding.UTF8.GetString(responseByteArray, 0, responseByteArray.Length);\n\n                    foreach (var stringModificationRule in rule.StringModificationRules)\n                        responseString = stringModificationRule.Apply(responseString);\n\n                    var newResponse = new HttpResponseMessage(response.StatusCode)\n                    {\n                        RequestMessage = request,\n                    };\n                    if (response?.Content?.Headers?.ContentType?.MediaType != null)\n                        newResponse.Content = new HttpStringContent(responseString, Windows.Storage.Streams.UnicodeEncoding.Utf8, response.Content.Headers.ContentType.MediaType);\n                    else\n                        newResponse.Content = new HttpStringContent(responseString, Windows.Storage.Streams.UnicodeEncoding.Utf8);\n\n                    return newResponse;\n                }\n            }\n\n            return null;\n        }\n\n        private static async Task<HttpResponseMessage> DownloadFile(HttpRequestMessage request)\n        {\n            using (var httpClient = new HttpClient())\n            {\n#if DEBUG\n                var sw = new Stopwatch();\n                sw.Start();\n#endif\n                var response = await httpClient.SendRequestAsync(request);\n#if DEBUG\n                sw.Stop();\n                logger.Debug($\"Getting {request.RequestUri} took {sw.ElapsedMilliseconds} ms\");\n#endif\n                return response;\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Helpers/WhatsNewHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Storage;\n\nnamespace XpoMusic.Helpers\n{\n    public static class WhatsNewHelper\n    {\n        const string latestWhatsNewVersionKey = \"LatestWhatsNewVersion\";\n        public static readonly bool testMode = false;\n\n        public static bool ShouldShowWhatsNew()\n        {\n            if (testMode)\n                return true;\n\n            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey(latestWhatsNewVersionKey))\n            {\n                MarkThisWhatsNewAsRead();\n                return false;\n            }\n\n            if (Version.TryParse(ApplicationData.Current.LocalSettings.Values[latestWhatsNewVersionKey].ToString(), out Version v))\n            {\n                if (v < Version.Parse(PackageHelper.GetAppVersionString()))\n                {\n                    if (GetWhatsNewContentId().Count > 0)\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n\n        public static List<string> GetWhatsNewContentIdAndMarkAsRead()\n        {\n            if (!ShouldShowWhatsNew())\n                return new List<string>();\n\n            List<string> output = GetWhatsNewContentId();\n\n            MarkThisWhatsNewAsRead();\n\n            return output;\n        }\n\n        private static List<string> GetWhatsNewContentId()\n        {\n            Version prevVersion = new Version(0, 0, 0, 0);\n\n            if (!testMode)\n                if (ApplicationData.Current.LocalSettings.Values.ContainsKey(latestWhatsNewVersionKey))\n                    Version.TryParse(ApplicationData.Current.LocalSettings.Values[latestWhatsNewVersionKey].ToString(), out prevVersion);\n\n            List<string> output = new List<string>();\n\n            if (prevVersion < new Version(\"2.1.0.0\"))\n                output.Add(\"5\");\n\n            if (prevVersion < new Version(\"1.6.0.0\"))\n                output.Add(\"4\");\n\n            if (prevVersion < new Version(\"1.5.0.0\"))\n                output.Add(\"3\");\n\n            if (prevVersion < new Version(\"1.4.2.0\"))\n                output.Add(\"2\");\n\n            if (prevVersion < new Version(\"1.1.0.0\"))\n                output.Add(\"1\");\n\n            return output;\n        }\n\n        private static void MarkThisWhatsNewAsRead()\n        {\n            ApplicationData.Current.LocalSettings.Values[latestWhatsNewVersionKey] = PackageHelper.GetAppVersionString();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/InjectedAssets/clearPlaybackLocalStorage.js",
    "content": "﻿\n// This script works around a bug of Spotify PWA in Microsoft Edge,\n// where volume is reset to the initial value in LocalStorage every few\n// minutes, by clearing the LocalStorage.playback before opening the PWA\n\nfunction clearPlaybackLocalStorage() {\n    var value = window.localStorage.playback;\n    window.localStorage.removeItem('playback');\n\n    return value;\n}\n\n\nclearPlaybackLocalStorage();\n"
  },
  {
    "path": "XpoMusic/InjectedAssets/clickOnFacebookLogin.js",
    "content": "﻿\nfunction pushFacebookButton() {\n    var facebookButton = document.querySelectorAll(\"a.btn-facebook\");\n\n    if (facebookButton.length > 0) {\n        facebookButton[0].click();\n        return \"1\";\n    }\n\n    return \"0\";\n}\n\npushFacebookButton();\n"
  },
  {
    "path": "XpoMusic/InjectedAssets/gridTest.html",
    "content": "<html>\n    <head>\n        <style>\n            body {\n                margin: 0;\n                padding: 0;\n                font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n            }\n\n            .gridview-header {\n                cursor: pointer;\n                width: 100%;\n                font-size: 24px;\n                font-weight: 700;\n                margin-bottom: 16px;\n                padding: 8px 16px;\n            }\n\n            .gridview-header:hover {\n                background: rgba(0, 0, 0, 0.07);\n            }\n            \n            .gridview-group {\n                display: block;\n                overflow: hidden;\n            }\n\n            .gridview-item {\n                margin-left: 8px;\n                margin-right: 8px;\n                margin-bottom: 32px;\n                width: 216px;\n                height: 250px;\n                float: left;\n                text-align: center;\n                cursor: pointer;\n                overflow: hidden;\n            }\n\n            .gridview-item-image {\n                background-size: cover;\n                width: 200px;\n                height: 200px;\n                transition: filter ease-out 0.1s;\n            }\n\n            .artist-image {\n                border-radius: 100px;\n            }\n\n            .gridview-item-image:hover {\n                filter: brightness(0.5);\n            }\n\n            .gridview-item-text {\n                padding-top: 8px;\n            }\n\n            .gridview-jumplist {\n                display: none;\n            }\n                \n            .gridview-jumplist-enabled .gridview-jumplist {\n                position: fixed;\n                top: 0;\n                bottom: 0;\n                left: 0;\n                right: 0;\n                display: flex;\n                flex-direction: column;\n                justify-content: center;\n            }\n            \n            .gridview-jumplist-itemcontainer {\n                width: 320px;\n                margin-left: auto;\n                margin-right: auto;\n                display: block;\n                overflow: hidden;\n            }\n            \n            .gridview-jumplist-item {\n                margin: 4px;\n                padding: 20px;\n                font-size: 24px;\n                font-weight: 700;\n                cursor: pointer;\n                display: block;\n                float: left;\n                width: 30px;\n                height: 30px;\n                line-height: 30px;\n                text-align: center;\n            }\n            \n            .gridview-jumplist-item:hover {\n                background: rgba(0, 0, 0, 0.07);\n            }\n\n            .gridview-container {\n                transition: filter ease-out 0.3s, opacity ease-out 0.2s;\n            }\n\n            .gridview-jumplist-enabled .gridview-container {\n                filter: blur(30px);\n                opacity: 0.5;\n            }\n        </style>\n        <script src=\"https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js\"></script>\n        <script>\n            $(document).ready(function() {\n                $(document).on('click', '.gridview-header', function() {\n                    $(\".gridview\").addClass(\"gridview-jumplist-enabled\");\n                });\n\n                $(document).on('click', '.gridview-jumplist-item', function() {\n                    $(\".gridview\").removeClass(\"gridview-jumplist-enabled\");\n                    window.location.hash = $(this).attr(\"data-navigationdest\");\n                });\n            });\n        </script>\n    </head>\n    <body>\n        <div class=\"gridview\">\n            <div class=\"gridview-container\">\n                <div class=\"gridview-header\">\n                    <a name=\"A\"></a>A\n                </div>\n                <div class=\"gridview-group\">\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>  \n                </div>\n\n                <div class=\"gridview-header\">\n                    <a name=\"B\"></a>B\n                </div>\n                <div class=\"gridview-group\">\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody\n                        </div>\n                    </div>\n                    <div class=\"gridview-item\">\n                        <div class=\"gridview-item-image artist-image\" style=\"background-image:url(https://i.scdn.co/image/865f24753e5e4f40a383bf24a9cdda598a4559a8);\">\n                        </div>\n                        <div class=\"gridview-item-text\">\n                            Somebody Somebody SomebodySomebodySomebody SomebodySomebody Somebody  Somebody\n                        </div>\n                    </div>\n                        \n                </div>\n            </div>\n            <div class=\"gridview-jumplist\">\n                <div class=\"gridview-jumplist-itemcontainer\">\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"dot\">...</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"A\">A</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"B\">B</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">C</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">D</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">E</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">F</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">G</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">H</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">I</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">J</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">K</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">L</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">M</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">N</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">O</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">P</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">Q</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">R</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">S</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">T</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">U</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">V</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">W</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">X</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">Y</div>\n                    <div class=\"gridview-jumplist-item\" data-navigationdest=\"\">Z</div>\n                </div>\n            </div>\n        </div>\n    </body>\n</html>"
  },
  {
    "path": "XpoMusic/InjectedAssets/isLoggedInCheck.js",
    "content": "﻿(document.querySelectorAll('[data-testid=signup-bar]').length === 0) ? \"1\" : \"0\""
  },
  {
    "path": "XpoMusic/NLog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\n  <targets>\n    <target name=\"logfile\" \n            xsi:type=\"File\" \n            fileName=\"${specialfolder:folder=LocalApplicationData}/logs/xpotify.log\"\n            concurrentWrites=\"false\"\n            archiveAboveSize=\"1000000\"\n            maxArchiveFiles=\"10\"\n            layout=\"${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=tostring}\" />\n    <target name=\"debugger\" xsi:type=\"Debugger\" layout=\"${logger} :: ${message}\"/>\n  </targets>\n\n  <rules>\n    <logger name=\"*\" minlevel=\"Debug\" writeTo=\"logfile\" />\n    <logger name=\"*\" minlevel=\"Trace\" writeTo=\"debugger\" />\n  </rules>\n</nlog>"
  },
  {
    "path": "XpoMusic/Package.appxmanifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\" xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\" xmlns:uap3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/3\" IgnorableNamespaces=\"uap uap3 mp\">\n  <Identity Name=\"36835MahdiGhiasi.Xpotify\" Publisher=\"CN=980F2E87-1831-4300-B1DC-4FDADD353F32\" Version=\"2.1.8.0\" />\n  <mp:PhoneIdentity PhoneProductId=\"f4804a35-66dc-4b7f-bee4-fc64421e3643\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\" />\n  <Properties>\n    <DisplayName>Xpo Music</DisplayName>\n    <PublisherDisplayName>Mahdi Ghiasi</PublisherDisplayName>\n    <Logo>Assets\\Logo\\StoreLogo.png</Logo>\n  </Properties>\n  <Dependencies>\n    <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.0.0\" MaxVersionTested=\"10.0.0.0\" />\n  </Dependencies>\n  <Resources>\n    <Resource Language=\"x-generate\" />\n  </Resources>\n  <Applications>\n    <Application Id=\"App\" Executable=\"$targetnametoken$.exe\" EntryPoint=\"XpoMusic.App\">\n      <uap:VisualElements DisplayName=\"Xpo Music\" Square150x150Logo=\"Assets\\Logo\\Square150x150Logo.png\" Square44x44Logo=\"Assets\\Logo\\Square44x44Logo.png\" Description=\"Xpo Music - A modern third-party Spotify client for Windows 10\" BackgroundColor=\"#201B1B\">\n        <uap:DefaultTile Wide310x150Logo=\"Assets\\Logo\\Wide310x150Logo.png\" Square310x310Logo=\"Assets\\Logo\\LargeTile.png\" Square71x71Logo=\"Assets\\Logo\\SmallTile.png\">\n          <uap:ShowNameOnTiles>\n            <uap:ShowOn Tile=\"square150x150Logo\" />\n            <uap:ShowOn Tile=\"wide310x150Logo\" />\n            <uap:ShowOn Tile=\"square310x310Logo\" />\n          </uap:ShowNameOnTiles>\n        </uap:DefaultTile>\n        <uap:SplashScreen Image=\"Assets\\Logo\\SplashScreen.png\" BackgroundColor=\"#201B1B\" />\n      </uap:VisualElements>\n      <Extensions>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"spotify\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"xpotify\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"xpomusic\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n      </Extensions>\n    </Application>\n  </Applications>\n  <Capabilities>\n    <Capability Name=\"internetClient\" />\n    <uap3:Capability Name=\"backgroundMediaPlayback\" />\n  </Capabilities>\n</Package>"
  },
  {
    "path": "XpoMusic/Package.debug.appxmanifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\" xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\" xmlns:uap3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/3\" IgnorableNamespaces=\"uap uap3 mp\">\n  <Identity Name=\"36835MahdiGhiasi.Xpotify.Alpha\" Publisher=\"CN=980F2E87-1831-4300-B1DC-4FDADD353F32\" Version=\"2.1.1.0\" />\n  <mp:PhoneIdentity PhoneProductId=\"e912f189-3e56-431c-935e-2cb74d520630\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\" />\n  <Properties>\n    <DisplayName>Xpo Music Alpha</DisplayName>\n    <PublisherDisplayName>Mahdi Ghiasi</PublisherDisplayName>\n    <Logo>Assets\\Logo\\StoreLogo.png</Logo>\n  </Properties>\n  <Dependencies>\n    <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.0.0\" MaxVersionTested=\"10.0.0.0\" />\n  </Dependencies>\n  <Resources>\n    <Resource Language=\"x-generate\" />\n  </Resources>\n  <Applications>\n    <Application Id=\"App\" Executable=\"$targetnametoken$.exe\" EntryPoint=\"XpoMusic.App\">\n      <uap:VisualElements DisplayName=\"Xpo Music Alpha\" Square150x150Logo=\"Assets\\Logo\\Square150x150Logo.png\" Square44x44Logo=\"Assets\\Logo\\Square44x44Logo.png\" Description=\"Xpo Music - A modern third-party Spotify client for Windows 10\" BackgroundColor=\"#201B1B\">\n        <uap:DefaultTile Wide310x150Logo=\"Assets\\Logo\\Wide310x150Logo.png\" Square310x310Logo=\"Assets\\Logo\\LargeTile.png\" Square71x71Logo=\"Assets\\Logo\\SmallTile.png\">\n          <uap:ShowNameOnTiles>\n            <uap:ShowOn Tile=\"square150x150Logo\" />\n            <uap:ShowOn Tile=\"wide310x150Logo\" />\n            <uap:ShowOn Tile=\"square310x310Logo\" />\n          </uap:ShowNameOnTiles>\n        </uap:DefaultTile>\n        <uap:SplashScreen Image=\"Assets\\Logo\\SplashScreen.png\" BackgroundColor=\"#201B1B\" />\n      </uap:VisualElements>\n      <Extensions>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"spotify\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"xpotify\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n        <uap:Extension Category=\"windows.protocol\">\n          <uap:Protocol Name=\"xpomusic\">\n            <uap:Logo>Assets\\Logo\\Square44x44Logo.png</uap:Logo>\n            <uap:DisplayName>Xpo Music</uap:DisplayName>\n          </uap:Protocol>\n        </uap:Extension>\n      </Extensions>\n    </Application>\n  </Applications>\n  <Capabilities>\n    <Capability Name=\"internetClient\" />\n    <uap3:Capability Name=\"backgroundMediaPlayback\" />\n  </Capabilities>\n</Package>"
  },
  {
    "path": "XpoMusic/Pages/AboutPage.xaml",
    "content": "﻿<Page\n    x:Class=\"XpoMusic.Pages.AboutPage\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    Background=\"Transparent\">\n\n    <Grid>\n        <ScrollViewer>\n            <StackPanel x:Name=\"Content\" Padding=\"14\">\n                <StackPanel Margin=\"0,0,0,24\" Visibility=\"Visible\">\n                    <Grid Margin=\"0,0,0,20\">\n                        <Grid.ColumnDefinitions>\n                            <ColumnDefinition Width=\"Auto\" />\n                            <ColumnDefinition Width=\"*\" />\n                        </Grid.ColumnDefinitions>\n                        <Grid Grid.Column=\"0\">\n                            <Image x:Name=\"whiteLogo\" \n                                   Source=\"ms-appx:///Assets/xpotify-white.png\"\n                                   Margin=\"4,4,16,0\"\n                                   Width=\"32\"\n                                   Height=\"32\" \n                                   VerticalAlignment=\"Top\" />\n                            <Image x:Name=\"coloredLogo\" \n                                   Source=\"ms-appx:///Assets/xpotify.png\"\n                                   Margin=\"4,4,16,0\"\n                                   Width=\"32\"\n                                   Height=\"32\" \n                                   VerticalAlignment=\"Top\" />\n                        </Grid>\n                        <StackPanel Grid.Column=\"1\">\n                            <TextBlock x:Name=\"appNameText\"\n                                       Text=\"Xpo Music\"\n                                       FontSize=\"24\"\n                                       FontWeight=\"Light\"\n                                       Margin=\"0,0,0,4\"\n                                       TextWrapping=\"Wrap\" />\n                            <TextBlock Text=\"A modern Spotify client for Windows 10\"\n                                       FontSize=\"14\"\n                                       Opacity=\"0.8\"\n                                       FontWeight=\"Light\"\n                                       Margin=\"0,0,0,8\"\n                                       TextWrapping=\"Wrap\" />\n                            <StackPanel Orientation=\"Horizontal\" Margin=\"0,0,0,0\">\n                                <TextBlock Text=\"v\"\n                                           Opacity=\"0.6\"\n                                           FontWeight=\"Light\"\n                                           FontSize=\"12\" />\n                                <TextBlock x:Name=\"appVersionText\"\n                                           Text=\"X.Y.Z\"\n                                           Opacity=\"0.6\"\n                                           FontWeight=\"Light\"\n                                           FontSize=\"12\" />\n                            </StackPanel>\n                            <StackPanel Orientation=\"Horizontal\" Margin=\"0,8,0,0\" x:Name=\"assetUpdatePackSection\">\n                                <TextBlock Text=\"Script update version:\"\n                                           Opacity=\"0.6\"\n                                           FontWeight=\"Light\"\n                                           FontSize=\"12\" />\n                                <TextBlock x:Name=\"assetUpdatePackText\"\n                                           Margin=\"2,0,0,0\"\n                                           Text=\"0\"\n                                           Opacity=\"0.6\"\n                                           FontWeight=\"Light\"\n                                           FontSize=\"12\" />\n                            </StackPanel>\n                        </StackPanel>\n                    </Grid>\n\n                    <HyperlinkButton Content=\"Follow @XpoMusic on Twitter\"\n                                     Click=\"TwitterButton_Click\"/>\n                    <HyperlinkButton Content=\"Browse source code on GitHub\"\n                                     Click=\"GitHubButton_Click\"/>\n                    <HyperlinkButton Content=\"Rate and review\"\n                                     Click=\"RateAndReviewButton_Click\"/>\n                    <HyperlinkButton Content=\"Privacy policy\"\n                                     Click=\"PrivacyPolicyButton_Click\"/>\n                </StackPanel>\n            </StackPanel>\n        </ScrollViewer>\n    </Grid>\n</Page>\n"
  },
  {
    "path": "XpoMusic/Pages/AboutPage.xaml.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.ApplicationModel.Email;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.Storage;\nusing Windows.Storage.Streams;\nusing Windows.System;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace XpoMusic.Pages\n{\n    public sealed partial class AboutPage : Page\n    {\n        private readonly Uri twitterPageUri = new Uri(\"https://twitter.com/XpoMusic\");\n        private readonly Uri githubPageUri = new Uri(\"https://github.com/MahdiGhiasi/Xpotify\");\n        private readonly Uri privacyPolicyPageUri = new Uri(\"https://xpomusic.com/privacy.html\");\n\n        public AboutPage()\n        {\n            this.InitializeComponent();\n\n            if (ThemeHelper.GetCurrentTheme() == Classes.Model.Theme.Dark)\n            {\n                coloredLogo.Visibility = Visibility.Collapsed;\n                whiteLogo.Visibility = Visibility.Visible;\n            }\n            else\n            {\n                coloredLogo.Visibility = Visibility.Visible;\n                whiteLogo.Visibility = Visibility.Collapsed;\n            }\n\n            appNameText.Text = PackageHelper.GetAppNameString();\n            appVersionText.Text = PackageHelper.GetAppVersionString();\n\n            if (LocalConfiguration.LatestAssetUpdateVersion == 0)\n            {\n                assetUpdatePackSection.Visibility = Visibility.Collapsed;\n            }\n            else\n            {\n                assetUpdatePackSection.Visibility = Visibility.Visible;\n                assetUpdatePackText.Text = LocalConfiguration.LatestAssetUpdateVersion.ToString();\n            }\n        }\n\n        private async void RateAndReviewButton_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(new Uri(string.Format(\"ms-windows-store:REVIEW?PFN={0}\", Windows.ApplicationModel.Package.Current.Id.FamilyName)));\n            AnalyticsHelper.Log(\"aboutLink\", \"rateAndReview\");\n        }\n\n        private async void PrivacyPolicyButton_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(privacyPolicyPageUri);\n            AnalyticsHelper.Log(\"aboutLink\", \"privacyPolicy\");\n        }\n\n        private async void TwitterButton_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(twitterPageUri);\n            AnalyticsHelper.Log(\"aboutLink\", \"twitter\");\n        }\n\n        private async void GitHubButton_Click(object sender, RoutedEventArgs e)\n        {\n            await Launcher.LaunchUriAsync(githubPageUri);\n            AnalyticsHelper.Log(\"aboutLink\", \"gitHub\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Pages/DonatePage.xaml",
    "content": "﻿<Page\n    x:Class=\"XpoMusic.Pages.DonatePage\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    Background=\"Transparent\"\n    mc:Ignorable=\"d\">\n\n    <ScrollViewer>\n        <StackPanel Margin=\"16,4,16,0\">\n            <TextBlock\n                x:Name=\"runningProVersion\"\n                Margin=\"0,8,0,16\"\n                FontWeight=\"Bold\"\n                Foreground=\"ForestGreen\"\n                Text=\"You are running Xpo Music Pro. Thanks for your support!\"\n                TextWrapping=\"Wrap\" />\n            <TextBlock\n                Margin=\"0,8,0,0\"\n                Text=\"You can support the development of Xpo Music by donating to one of the addresses below.\"\n                TextWrapping=\"Wrap\" />\n            <TextBlock\n                Margin=\"0,16,0,0\"\n                FontWeight=\"Bold\"\n                Text=\"Bitcoin:\" />\n            <TextBlock\n                x:Name=\"bitcoinWallet\"\n                Margin=\"0,8,0,0\"\n                IsTextSelectionEnabled=\"True\"\n                Text=\"xxx\" />\n            <StackPanel HorizontalAlignment=\"Right\" Orientation=\"Horizontal\">\n                <FontIcon\n                    x:Name=\"bitcoinAddressCopiedCheckMark\"\n                    Margin=\"0,0,8,0\"\n                    FontFamily=\"Segoe MDL2 Assets\"\n                    Glyph=\"&#xE10B;\"\n                    Visibility=\"Collapsed\" />\n                <HyperlinkButton\n                    HorizontalAlignment=\"Right\"\n                    Click=\"CopyBitcoinAddressToClipboard_Click\"\n                    Content=\"Copy to clipboard\" />\n            </StackPanel>\n            <TextBlock\n                Margin=\"0,8,0,0\"\n                FontWeight=\"Bold\"\n                Text=\"Ethereum:\" />\n            <TextBlock\n                x:Name=\"ethereumWallet\"\n                Margin=\"0,8,0,0\"\n                IsTextSelectionEnabled=\"True\"\n                Text=\"xxx\" />\n            <StackPanel HorizontalAlignment=\"Right\" Orientation=\"Horizontal\">\n                <FontIcon\n                    x:Name=\"ethereumAddressCopiedCheckMark\"\n                    Margin=\"0,0,8,0\"\n                    FontFamily=\"Segoe MDL2 Assets\"\n                    Glyph=\"&#xE10B;\"\n                    Visibility=\"Collapsed\" />\n                <HyperlinkButton\n                    HorizontalAlignment=\"Right\"\n                    Click=\"CopyEthereumAddressToClipboard_Click\"\n                    Content=\"Copy to clipboard\" />\n            </StackPanel>\n        </StackPanel>\n    </ScrollViewer>\n</Page>\n"
  },
  {
    "path": "XpoMusic/Pages/DonatePage.xaml.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel.DataTransfer;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.System;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace XpoMusic.Pages\n{\n    public sealed partial class DonatePage : Page\n    {\n        private readonly string bitcoinWalletAddress = \"38TmLnUjix9NiPpiFoKV7qAjNeqaSi1EJH\";\n        private readonly string ethereumWalletAddress = \"0x8c8d6a7f0c4e2da49bf9e249fdb349ffde884a00\";\n\n        public DonatePage()\n        {\n            this.InitializeComponent();\n\n            bitcoinWallet.Text = bitcoinWalletAddress;\n            ethereumWallet.Text = ethereumWalletAddress;\n\n            runningProVersion.Visibility = PackageHelper.IsProVersion ? Visibility.Visible : Visibility.Collapsed;\n        }\n\n        private async void CopyBitcoinAddressToClipboard_Click(object sender, RoutedEventArgs e)\n        {\n            CopyTextToClipboard(bitcoinWalletAddress);\n\n            AnalyticsHelper.Log(\"donate\", \"copyToClipboard\", \"bitcoin\");\n            bitcoinAddressCopiedCheckMark.Visibility = Visibility.Visible;\n            await Task.Delay(TimeSpan.FromSeconds(3));\n            bitcoinAddressCopiedCheckMark.Visibility = Visibility.Collapsed;\n        }\n\n        private async void CopyEthereumAddressToClipboard_Click(object sender, RoutedEventArgs e)\n        {\n            CopyTextToClipboard(ethereumWalletAddress);\n\n            AnalyticsHelper.Log(\"donate\", \"copyToClipboard\", \"ethereum\");\n            ethereumAddressCopiedCheckMark.Visibility = Visibility.Visible;\n            await Task.Delay(TimeSpan.FromSeconds(3));\n            ethereumAddressCopiedCheckMark.Visibility = Visibility.Collapsed;\n        }\n\n        private void CopyTextToClipboard(string text)\n        {\n            var dataPackage = new DataPackage();\n            dataPackage.SetText(text);\n            Clipboard.SetContent(dataPackage);\n            Clipboard.Flush();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Pages/HelpPage.xaml",
    "content": "﻿<Page\n    x:Class=\"XpoMusic.Pages.HelpPage\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Pages\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    Background=\"Transparent\">\n\n    <Grid>\n        <ScrollViewer>\n            <StackPanel Margin=\"0,0,0,24\" Visibility=\"Visible\" Padding=\"14\">\n                <RichTextBlock TextWrapping=\"Wrap\" LineHeight=\"22\">\n                    <Paragraph>\n                        <Hyperlink Click=\"KeyboardShortcuts_Click\">\n                            Keyboard shortcuts\n                        </Hyperlink>\n                    </Paragraph>\n                    <Paragraph Margin=\"0,8,0,0\">\n                        <Hyperlink Click=\"LocalProxy_Click\">\n                            Enable local proxy for Xpo Music\n                        </Hyperlink>\n                    </Paragraph>\n                    <Paragraph Margin=\"0,32,0,8\">\n                        <Run>Want to report a problem, request a feature or ask a question?</Run>\n                    </Paragraph>\n                    <Paragraph>\n                        <Hyperlink Click=\"DiscordGroup_Click\">\n                            Come join us at\n                            <Bold>UWP Community</Bold> discord server\n                        </Hyperlink>,\n                    </Paragraph>\n                    <Paragraph>\n                        <Hyperlink Click=\"GitHubIssue_Click\">\n                            create an issue on GitHub\n                        </Hyperlink>,\n                    </Paragraph>\n                    <Paragraph>\n                        or <Hyperlink Click=\"Contact_Click\">contact me via email</Hyperlink>.\n                    </Paragraph>\n                </RichTextBlock>            \n            </StackPanel>\n        </ScrollViewer>\n    </Grid>\n</Page>\n"
  },
  {
    "path": "XpoMusic/Pages/HelpPage.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.ApplicationModel.Email;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.Storage;\nusing Windows.Storage.Streams;\nusing Windows.System;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Documents;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Helpers;\n\n// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238\n\nnamespace XpoMusic.Pages\n{\n    /// <summary>\n    /// An empty page that can be used on its own or navigated to within a Frame.\n    /// </summary>\n    public sealed partial class HelpPage : Page\n    {\n        private const string supportEmailAddress = \"xpotifyapp@gmail.com\";\n        private readonly Uri gitHubIssuesHelpPage = new Uri(\"https://github.com/MahdiGhiasi/Xpotify/issues\");\n        private readonly Uri localProxyHelpPage = new Uri(\"https://xpomusic.com/loopback\");\n        private readonly Uri keyboardShortuctsHelpPage = new Uri(\"https://xpomusic.com/keyboardShortcuts\");\n        private readonly Uri discordServerUrl = new Uri(\"https://discord.gg/4RQCctB\");\n\n        public HelpPage()\n        {\n            this.InitializeComponent();\n        }\n\n        private async void Contact_Click(Hyperlink sender, HyperlinkClickEventArgs args)\n        {\n            RandomAccessStreamReference logFileReference = null;\n            var emailMessage = new EmailMessage\n            {\n                Body = \"\",\n            };\n\n            try\n            {\n                if (await ApplicationData.Current.LocalFolder.TryGetItemAsync(\"logs\") is StorageFolder logFolder)\n                {\n                    if (await logFolder.TryGetItemAsync(\"xpotify-email.log\") is StorageFile oldLogFile)\n                        await oldLogFile.DeleteAsync();\n\n                    if (await logFolder.TryGetItemAsync(\"xpotify.log\") is StorageFile logFile)\n                    {\n                        var newFile = await logFile.CopyAsync(logFolder, \"xpotify-email.log\");\n                        logFileReference = RandomAccessStreamReference.CreateFromFile(newFile);\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                emailMessage.Body = \"\\r\\n\\r\\n\\r\\n\\r\\nCould not attach log file\\r\\n\" + ex.ToString();\n            }\n\n            emailMessage.To.Add(new EmailRecipient(supportEmailAddress));\n            emailMessage.Subject = $\"{PackageHelper.GetAppNameString()} v{PackageHelper.GetAppVersionString()}\";\n            if (logFileReference != null)\n            {\n                emailMessage.Attachments.Add(new EmailAttachment(\"xpotify-email.log\", logFileReference));\n            }\n\n            await EmailManager.ShowComposeNewEmailAsync(emailMessage);\n            AnalyticsHelper.Log(\"helpLink\", \"email\");\n        }\n\n        private async void GitHubIssue_Click(Hyperlink sender, HyperlinkClickEventArgs args)\n        {\n            await Launcher.LaunchUriAsync(gitHubIssuesHelpPage);\n            AnalyticsHelper.Log(\"helpLink\", \"gitHubIssue\");\n        }\n\n        private async void LocalProxy_Click(Hyperlink sender, HyperlinkClickEventArgs args)\n        {\n            await Launcher.LaunchUriAsync(localProxyHelpPage);\n            AnalyticsHelper.Log(\"helpLink\", \"localProxy\");\n        }\n\n        private async void KeyboardShortcuts_Click(Hyperlink sender, HyperlinkClickEventArgs args)\n        {\n            await Launcher.LaunchUriAsync(keyboardShortuctsHelpPage);\n            AnalyticsHelper.Log(\"helpLink\", \"keyboardShortcuts\");\n        }\n\n        private async void DiscordGroup_Click(Hyperlink sender, HyperlinkClickEventArgs args)\n        {\n            await Launcher.LaunchUriAsync(discordServerUrl);\n            AnalyticsHelper.Log(\"helpLink\", \"joinDiscordServer\");\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Pages/MainPage.xaml",
    "content": "﻿<Page\n    x:Class=\"XpoMusic.Pages.MainPage\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:controls=\"using:XpoMusic.Controls\"\n    xmlns:vm=\"using:XpoMusic.ViewModels\"\n    mc:Ignorable=\"d\"\n    Loaded=\"Page_Loaded\"\n    SizeChanged=\"Page_SizeChanged\"\n    Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\">\n\n    <Page.DataContext>\n        <vm:MainPageViewModel x:Name=\"ViewModel\" />\n    </Page.DataContext>\n\n    <Grid x:Name=\"mainGrid\">\n        <VisualStateManager.VisualStateGroups>\n            <VisualStateGroup>\n                <VisualState x:Name=\"SplashScreenVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Visible\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"MainScreenQuickVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"ClosedQuick\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"MainScreenVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Closed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"ShowExtraButtons\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"CompactOverlayVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Closed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"ShowExtraButtons\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"ViewMode\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"CompactOverlay\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.5\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"NowPlayingVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Closed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsTabStop\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"IsTabStop\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"ShowExtraButtons\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"ViewMode\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Normal\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.5\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"Visibility\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Collapsed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <DoubleAnimation Storyboard.TargetName=\"nowPlaying\" \n                                         Storyboard.TargetProperty=\"Opacity\"\n                                         Duration=\"0:0:0.3\" From=\"0\" To=\"1\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                    </Storyboard>\n                </VisualState>\n                <VisualState x:Name=\"NowPlayingClosingVisualState\">\n                    <Storyboard>\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"splashScreen\"\n                                                       Storyboard.TargetProperty=\"SplashState\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"Closed\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"topBar\"\n                                                       Storyboard.TargetProperty=\"ShowExtraButtons\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"xpoWebView\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0\" Value=\"True\" />\n                        </ObjectAnimationUsingKeyFrames>\n                        \n                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"nowPlaying\"\n                                                       Storyboard.TargetProperty=\"IsOpen\">\n                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\" />\n                            <DiscreteObjectKeyFrame KeyTime=\"0:0:0.2\" Value=\"False\" />\n                        </ObjectAnimationUsingKeyFrames>\n\n                        <DoubleAnimation Storyboard.TargetName=\"nowPlaying\" \n                                         Storyboard.TargetProperty=\"Opacity\"\n                                         Duration=\"0:0:0.2\" From=\"1\" To=\"0\">\n                            <DoubleAnimation.EasingFunction>\n                                <ExponentialEase EasingMode=\"EaseOut\" />\n                            </DoubleAnimation.EasingFunction>\n                        </DoubleAnimation>\n                    </Storyboard>\n                </VisualState>\n            </VisualStateGroup>\n        </VisualStateManager.VisualStateGroups>\n\n        <controls:XpoMusicWebApp x:Name=\"xpoWebView\"\n                                IsTabStop=\"True\"\n                                MinWidth=\"500\"\n                                MinHeight=\"500\"\n                                PageLoaded=\"XpoWebView_PageLoaded\"\n                                WebAppLoaded=\"XpoWebView_WebAppLoaded\"\n                                ActionRequested=\"XpoWebView_ActionRequested\"/>\n\n        <controls:FlyoutContainer x:Name=\"flyoutContainer\" />\n\n        <controls:SplashScreen x:Name=\"splashScreen\" SplashState=\"Visible\" />\n\n        <controls:NowPlayingView x:Name=\"nowPlaying\"\n                                 IsTabStop=\"False\"\n                                 IsOpen=\"False\" />\n\n        <controls:TopBar x:Name=\"topBar\" \n                         IsTabStop=\"True\"\n                         OpenSpotifyUriRequested=\"TopBar_OpenSpotifyUriRequested\"\n                         Margin=\"46,0,0,0\"\n                         VerticalAlignment=\"Top\"\n                         HorizontalAlignment=\"Stretch\" />\n    </Grid>\n</Page>\n"
  },
  {
    "path": "XpoMusic/Pages/MainPage.xaml.cs",
    "content": "﻿using Microsoft.Toolkit.Uwp.Helpers;\nusing XpoMusic.Classes;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing XpoMusic.Helpers.Integration;\nusing XpoMusic.SpotifyApi;\nusing XpoMusic.XpotifyApi.Model;\nusing System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Media.Core;\nusing Windows.Media.Playback;\nusing Windows.UI.Core;\nusing Windows.UI.ViewManagement;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Navigation;\nusing XpoMusic.Controls;\nusing static XpoMusic.Helpers.MediaControlsHelper.TrackChangedEventArgs;\nusing Windows.System;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Popups;\n\nnamespace XpoMusic.Pages\n{\n    public sealed partial class MainPage : Page\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        MediaPlayer silentMediaPlayer;\n        private bool shouldShowWhatsNew = false;\n        private DeveloperMessage developerMessage = null;\n        private bool isNowPlayingEnabled = false;\n\n        private DispatcherTimer analyticsHeartbeatTimer;\n\n        private readonly string _playQueueUri = \"https://open.spotify.com/queue\";\n\n        public MainPage()\n        {\n            ProxyHelper.ApplyProxySettings();\n            this.InitializeComponent();\n\n            silentMediaPlayer = new MediaPlayer\n            {\n                Source = MediaSource.CreateFromUri(new Uri(\"ms-appx:///Assets/Media/silent.wav\")),\n                IsLoopingEnabled = true,\n            };\n            silentMediaPlayer.CommandManager.IsEnabled = false;\n\n            analyticsHeartbeatTimer = new DispatcherTimer()\n            {\n                Interval = AppConstants.Instance.HeartbeatInterval,\n            };\n            analyticsHeartbeatTimer.Tick += AnalyticsHeartbeatTimer_Tick;\n            analyticsHeartbeatTimer.Start();\n\n            AppConstants.Instance.ConstantsUpdated += Instance_ConstantsUpdated;\n\n            xpoWebView.RequestedTheme = (ThemeHelper.GetCurrentTheme() == Theme.Light) ? ElementTheme.Light : ElementTheme.Dark;\n\n            VisualStateManager.GoToState(this, nameof(SplashScreenVisualState), false);\n        }\n\n        private void Instance_ConstantsUpdated(object sender, EventArgs e)\n        {\n            analyticsHeartbeatTimer.Interval = AppConstants.Instance.HeartbeatInterval;\n        }\n\n        private void AnalyticsHeartbeatTimer_Tick(object sender, object e)\n        {\n            if (!AppConstants.Instance.HeartbeatEnabled)\n                return;\n\n            // Keep the session alive in analytics\n            AnalyticsHelper.Log(\"Heartbeat\", \"Heartbeat\");\n        }\n\n        protected override void OnNavigatedTo(NavigationEventArgs e)\n        {\n            var targetUrl = GetTileLaunchTargetUrl(e.Parameter as string);\n\n            if (string.IsNullOrEmpty(targetUrl))\n                xpoWebView.OpenWebApp();\n            else\n                xpoWebView.OpenWebApp(targetUrl);\n        }\n\n        private string GetTileLaunchTargetUrl(string parameter)\n        {\n            if (!string.IsNullOrEmpty(parameter))\n            {\n                try\n                {\n                    // Launched from a secondary tile\n                    var urlDecoder = new WwwFormUrlDecoder(parameter);\n                    var pageUrl = urlDecoder.GetFirstValueByName(\"pageUrl\");\n\n                    var autoplayEntry = urlDecoder.FirstOrDefault(x => x.Name == \"autoplay\");\n                    if (autoplayEntry != null)\n                    {\n                        xpoWebView.AutoPlayAction = autoplayEntry.Value == \"track\" ? AutoPlayAction.Track : AutoPlayAction.Playlist;\n                    }\n                    else\n                    {\n                        xpoWebView.AutoPlayAction = AutoPlayAction.None;\n                    }\n\n                    var sourceEntry = urlDecoder.FirstOrDefault(x => x.Name == \"source\");\n                    if (sourceEntry != null && sourceEntry.Value == \"cortana\" && LocalConfiguration.OpenInMiniViewByCortana)\n                    {\n                        OpenCompactOverlayForAutoPlay();\n                    }\n\n                    return pageUrl;\n                }\n                catch (Exception ex)\n                {\n                    logger.Info($\"Parsing input parameter '{parameter}' failed: {ex}\");\n                }\n            }\n\n            return null;\n        }\n\n        private async void OpenCompactOverlayForAutoPlay()\n        {\n            await GoToCompactOverlayMode();\n            nowPlaying.ActivateProgressRing();\n        }\n\n        public void NavigateToSecondaryTile(string parameter)\n        {\n            // Launched from a secondary tile\n            if (ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.CompactOverlay)\n                CloseCompactOverlay();\n\n            NavigateWithConfig(parameter);\n        }\n\n        public async void NavigateWithConfig(string parameter)\n        {\n            try\n            {\n                var urlDecoder = new WwwFormUrlDecoder(parameter);\n                var pageUrl = urlDecoder.GetFirstValueByName(\"pageUrl\");\n\n                await xpoWebView.Controller.NavigateToSpotifyUrl(pageUrl);\n\n                var autoplayEntry = urlDecoder.FirstOrDefault(x => x.Name == \"autoplay\");\n                AutoPlayAction action = AutoPlayAction.None;\n                if (autoplayEntry != null)\n                    action = autoplayEntry.Value == \"track\" ? AutoPlayAction.Track : AutoPlayAction.Playlist;\n\n                if (action != AutoPlayAction.None)\n                    await xpoWebView.Controller.AutoPlay(action);\n\n                return;\n            }\n            catch (Exception ex)\n            {\n                logger.Info($\"Parsing input parameter {parameter} failed. {ex}\");\n            }\n        }\n\n        private async void Page_Loaded(object sender, RoutedEventArgs e)\n        {\n            try\n            {\n                ApplicationView.GetForCurrentView().SetPreferredMinSize(LocalConfiguration.WindowMinSize);\n\n                SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;\n\n                // Update app constants from server\n                AppConstants.Update();\n\n                // Update assets from server\n                AssetManager.UpdateAssets();\n\n                // Play silent sound to avoid suspending the app when it's minimized.\n                silentMediaPlayer.Play();\n\n                // Media controls are necessary for the audio to continue when app is minimized.\n                MediaControlsHelper.Init(Dispatcher);\n                MediaControlsHelper.TrackChanged += (ss, trackChangedArgs) =>\n                {\n                    if (nowPlaying.IsOpen)\n                        nowPlaying.PlayChangeTrackAnimation(\n                            reverse: (trackChangedArgs.Direction == TrackChangeDirection.Backward));\n                };\n\n                // Show what's new if necessary\n                if (WhatsNewHelper.ShouldShowWhatsNew())\n                    shouldShowWhatsNew = true;\n\n                LyricsViewerIntegrationHelper.InitIntegration();\n                LiveTileHelper.InitLiveTileUpdates();\n                JumpListHelper.DeleteRecentJumplistEntries();\n\n                AnalyticsHelper.PageView(\"MainPage\", setNewSession: true);\n                AnalyticsHelper.Log(\"mainEvent\", \"appOpened\", SystemInformation.OperatingSystemVersion.ToString());\n\n                developerMessage = await DeveloperMessageHelper.GetNextDeveloperMessage();\n\n                // Window.Current.CoreWindow.KeyDown does not capture Alt events, but AcceleratorKeyActivated does.\n                // NOTE: This event captures all key events, even when WebView is focused.\n                CoreWindow.GetForCurrentThread().Dispatcher.AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated;\n            }\n            catch (Exception ex)\n            {\n                AnalyticsHelper.Log(\"mainPageLoadedException\", ex.Message, ex.ToString());\n                await new MessageDialog(ex.ToString(), \"MainPage:Loaded unhandled exception\").ShowAsync();\n            }\n        }\n\n        private async void Dispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs e)\n        {\n            if (!xpoWebView.IsWebAppLoaded)\n                return;\n\n            if (e.EventType == CoreAcceleratorKeyEventType.KeyDown || e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown)\n            {\n                // We won't process the event if the currently focused element is WebView,\n                // as the web app can handle keyboard shortcuts itself.\n                if (FocusManager.GetFocusedElement().GetType() == typeof(WebView))\n                    return;\n\n                var shiftState = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Shift);\n                var shiftPressed = (shiftState & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;\n\n                var ctrlState = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Control);\n                var ctrlPressed = (ctrlState & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;\n\n                var altState = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Menu);\n                var altPressed = (altState & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;\n\n                logger.Info(e.VirtualKey);\n                var isHandled = await KeyboardShortcutHelper.KeyDown(e.VirtualKey, shiftPressed, ctrlPressed, altPressed, xpoWebView.Controller, nowPlaying);\n                if (isHandled == KeyboardShortcutHelper.KeyDownProcessResult.AskJs)\n                {\n                    logger.Info(\"Sending it to js...\");\n                    int charCode = (int)e.VirtualKey;\n                    var handledByJs = await xpoWebView.Controller.OnKeyDown(charCode, shiftPressed, ctrlPressed, altPressed);\n                    if (handledByJs)\n                    {\n                        if (nowPlaying.IsOpen)\n                        {\n                            if (nowPlaying.ViewMode == NowPlayingView.NowPlayingViewMode.CompactOverlay)\n                                CloseCompactOverlay();\n                            else\n                                CloseNowPlaying();\n                        }\n                    }\n                }\n                else if (isHandled == KeyboardShortcutHelper.KeyDownProcessResult.GoBack)\n                {\n                    if (nowPlaying.IsOpen)\n                    {\n                        if (nowPlaying.ViewMode == NowPlayingView.NowPlayingViewMode.CompactOverlay)\n                            CloseCompactOverlay();\n                        else if (ApplicationView.GetForCurrentView().IsFullScreenMode)\n                            nowPlaying.ToggleFullscreen();\n                        else\n                            CloseNowPlaying();\n                    }\n                }\n            }\n            \n        }\n\n        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)\n        {\n            SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;\n\n            base.OnNavigatingFrom(e);\n        }\n\n        private async void App_BackRequested(object sender, BackRequestedEventArgs e)\n        {\n            if (nowPlaying.IsOpen)\n            {\n                e.Handled = true;\n                NowPlaying_ActionRequested(nowPlaying, new ActionRequestedEventArgs\n                {\n                    Action = NowPlayingView.Action.Back,\n                });\n            }\n            else if (xpoWebView.BackEnabled)\n            {\n                e.Handled = true;\n\n                var result = await xpoWebView.Controller.GoBackIfPossible();\n                logger.Info($\"GoBackIfPossible() result = {result}\");\n            }\n        }\n        \n        private void GoToNowPlayingMode()\n        {\n            VisualStateManager.GoToState(this, nameof(NowPlayingVisualState), false);\n            nowPlaying.ActionRequested += NowPlaying_ActionRequested;\n            topBar.UpdateTitleBarColors(Theme.Dark);\n\n            AnalyticsHelper.PageView(\"NowPlaying\");\n        }\n\n        private async Task GoToCompactOverlayMode()\n        {\n            if (!ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))\n                return;\n\n            VisualStateManager.GoToState(this, nameof(CompactOverlayVisualState), false);\n\n            var viewMode = ViewModePreferences.CreateDefault(ApplicationViewMode.CompactOverlay);\n            viewMode.ViewSizePreference = ViewSizePreference.Custom;\n            viewMode.CustomSize = LocalConfiguration.CompactOverlaySize;\n\n            var modeSwitched = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, viewMode);\n\n            if (modeSwitched)\n            {\n                nowPlaying.ActionRequested += NowPlaying_ActionRequested;\n                topBar.UpdateTitleBarColors(Theme.Dark);\n\n                AnalyticsHelper.PageView(\"CompactOverlay\");\n            }\n            else\n            {\n                VisualStateManager.GoToState(this, nameof(MainScreenVisualState), false);\n            }\n        }\n\n        private async void NowPlaying_ActionRequested(object sender, ActionRequestedEventArgs e)\n        {\n            if ((sender as NowPlayingView).ViewMode == NowPlayingView.NowPlayingViewMode.CompactOverlay)\n            {\n                if (e.Action == NowPlayingView.Action.Back)\n                {\n                    CloseCompactOverlay();\n                }\n                else if (e.Action == NowPlayingView.Action.SeekPlayback)\n                {\n                    SeekPlayback((double)e.AdditionalData);\n                }\n                else if (e.Action == NowPlayingView.Action.SeekVolume)\n                {\n                    SeekVolume((double)e.AdditionalData);\n                }\n            }\n            else\n            {\n                if (e.Action == NowPlayingView.Action.Back)\n                {\n                    CloseNowPlaying();\n                }\n                else if (e.Action == NowPlayingView.Action.PlayQueue)\n                {\n                    await xpoWebView.Controller.NavigateToSpotifyUrl(_playQueueUri);\n                    CloseNowPlaying();\n                }\n                else if (e.Action == NowPlayingView.Action.SeekPlayback)\n                {\n                    SeekPlayback((double)e.AdditionalData);\n                }\n                else if (e.Action == NowPlayingView.Action.SeekVolume)\n                {\n                    SeekVolume((double)e.AdditionalData);\n                }\n            }\n        }\n\n        private async void SeekPlayback(double percentage)\n        {\n            try\n            {\n                PlayStatusTracker.SeekPlayback(percentage);\n                await xpoWebView.Controller.SeekPlayback(percentage);\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"SeekPlayback failed: \" + ex.ToString());\n            }\n        }\n\n        private async void SeekVolume(double percentage)\n        {\n            try\n            {\n                PlayStatusTracker.SeekVolume(percentage);\n                await xpoWebView.Controller.SeekVolume(percentage);\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"SeekVolume failed: \" + ex.ToString());\n            }\n        }\n\n        private async void CloseCompactOverlay()\n        {\n            await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);\n            nowPlaying.ActionRequested -= NowPlaying_ActionRequested;\n            VisualStateManager.GoToState(this, nameof(MainScreenVisualState), false);\n            topBar.InitTitleBar();\n\n            AnalyticsHelper.PageView(\"MainPage\");\n\n            GetBackFocusToWebView();\n        }\n\n        private async void CloseNowPlaying()\n        {\n            nowPlaying.ActionRequested -= NowPlaying_ActionRequested;\n            topBar.InitTitleBar();\n\n            VisualStateManager.GoToState(this, nameof(NowPlayingClosingVisualState), false);\n            await Task.Delay(200);\n            VisualStateManager.GoToState(this, nameof(MainScreenVisualState), false);\n\n            AnalyticsHelper.PageView(\"MainPage\");\n\n            GetBackFocusToWebView();\n        }\n\n        private async void GetBackFocusToWebView()\n        {\n            await Task.Delay(200);\n            xpoWebView.SetFocusToWebView();\n        }\n\n        private void XpoWebView_PageLoaded(object sender, EventArgs e)\n        {\n            VisualStateManager.GoToState(this, nameof(MainScreenQuickVisualState), false);\n\n            OnWebViewLoadCompleted();\n\n            isNowPlayingEnabled = false;\n            PlayStatusTracker.LastPlayStatus.Updated -= LastPlayStatus_Updated;\n        }\n\n        private void XpoWebView_WebAppLoaded(object sender, EventArgs e)\n        {\n            if (splashScreen.SplashState == Controls.SplashScreen.SplashScreenShowState.Visible)\n                VisualStateManager.GoToState(this, nameof(MainScreenVisualState), false);\n\n            OnWebViewLoadCompleted();\n\n            if (!isNowPlayingEnabled)\n            {\n                EnableNowPlayingWhenReady();\n            }\n        }\n\n        private void OnWebViewLoadCompleted()\n        {\n            if (shouldShowWhatsNew)\n            {\n                flyoutContainer.OpenWhatsNew();\n                shouldShowWhatsNew = false;\n            }\n\n            if (developerMessage != null)\n            {\n                flyoutContainer.OpenDeveloperMessage(developerMessage);\n                developerMessage = null;\n            }\n        }\n\n        private async void EnableNowPlayingWhenReady()\n        {\n            try\n            {\n                PlayStatusTracker.LastPlayStatus.Updated += LastPlayStatus_Updated;\n                var result = await EnableNowPlayingIfReady();\n\n                if (result)\n                    PlayStatusTracker.LastPlayStatus.Updated -= LastPlayStatus_Updated;\n\n                logger.Info($\"EnableNowPlaying (initial) result = {result}\");\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"EnableNowPlaying (initial) failed: \" + ex.ToString());\n            }\n        }\n\n        private async void LastPlayStatus_Updated(object sender, EventArgs e)\n        {\n            try\n            {\n                var result = await EnableNowPlayingIfReady();\n\n                logger.Info($\"EnableNowPlaying (event) result = {result}\");\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"EnableNowPlaying (event) failed: \" + ex.ToString());\n            }\n        }\n\n        private async Task<bool> EnableNowPlayingIfReady()\n        {\n            var nowPlayingShouldBeEnabled = (!string.IsNullOrWhiteSpace(PlayStatusTracker.LastPlayStatus.SongId)) ||\n                (!string.IsNullOrWhiteSpace(PlayStatusTracker.LastPlayStatus.SongName));\n\n            if (!isNowPlayingEnabled && nowPlayingShouldBeEnabled)\n            {\n                PlayStatusTracker.LastPlayStatus.Updated -= LastPlayStatus_Updated;\n                await xpoWebView.Controller.EnableNowPlaying();\n                isNowPlayingEnabled = true;\n                return true;\n            }\n\n            return false;\n        }\n\n        private async void XpoWebView_ActionRequested(object sender, XpoMusicWebApp.XpoMusicWebAppActionRequest request)\n        {\n            switch (request)\n            {\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.OpenSettingsFlyout:\n                    flyoutContainer.OpenSettings();\n                    break;\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.OpenAboutFlyout:\n                    flyoutContainer.OpenAbout();\n                    break;\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.OpenDonateFlyout:\n                    flyoutContainer.OpenDonate();\n                    break;\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.GoToCompactOverlay:\n                    if (isNowPlayingEnabled)\n                        await GoToCompactOverlayMode();\n                    break;\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.GoToNowPlaying:\n                    if (isNowPlayingEnabled)\n                        GoToNowPlayingMode();\n                    break;\n                case XpoMusicWebApp.XpoMusicWebAppActionRequest.ShowSplashScreen:\n                    VisualStateManager.GoToState(this, nameof(SplashScreenVisualState), false);\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        private async void TopBar_OpenSpotifyUriRequested(object sender, string uri)\n        {\n            await xpoWebView.Controller.NavigateToSpotifyUrl(uri);\n        }\n\n        private void Page_SizeChanged(object sender, SizeChangedEventArgs e)\n        {\n            if (ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.CompactOverlay)\n            {\n                LocalConfiguration.CompactOverlaySize = new Size(this.ActualWidth, this.ActualHeight);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Pages/SettingsPage.xaml",
    "content": "﻿<Page\n    x:Class=\"XpoMusic.Pages.SettingsPage\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:vm=\"using:XpoMusic.ViewModels\"\n    xmlns:converters=\"using:XpoMusic.Classes.Converters\"\n    xmlns:controls=\"using:XpoMusic.Controls\"\n    mc:Ignorable=\"d\"\n    Background=\"Transparent\">\n\n    <Page.Resources>\n        <ResourceDictionary>\n            <converters:LanguageToStringConverter x:Key=\"LanguageToStringConverter\" />\n            <converters:ThemeToStringConverter x:Key=\"ThemeToStringConverter\" />\n            <converters:LiveTileDesignToStringConverter x:Key=\"LiveTileDesignToStringConverter\" />\n        </ResourceDictionary>\n    </Page.Resources>\n    <Page.DataContext>\n        <vm:SettingsViewModel x:Name=\"ViewModel\" />\n    </Page.DataContext>\n\n    <Grid>\n        <ScrollViewer>\n            <StackPanel x:Name=\"Content\" Padding=\"14\">\n                <StackPanel Margin=\"0,0,0,24\" Visibility=\"Visible\">\n                    <TextBlock Text=\"Theme:\" />\n                    <ComboBox ItemsSource=\"{x:Bind ViewModel.Themes, Mode=OneWay}\"\n                              SelectedItem=\"{x:Bind ViewModel.SelectedTheme, Mode=TwoWay}\"\n                              Margin=\"0,8,0,0\" \n                              Width=\"240\">\n                        <ComboBox.ItemTemplate>\n                            <DataTemplate>\n                                <TextBlock Text=\"{Binding Converter={StaticResource ThemeToStringConverter}}\" />\n                            </DataTemplate>\n                        </ComboBox.ItemTemplate>\n                    </ComboBox>\n                    <TextBlock Text=\"You'll need to close and reopen Xpo Music for this change to take effect.\"\n                               TextWrapping=\"Wrap\"\n                               Margin=\"0,4,0,0\"\n                               Foreground=\"Red\"\n                               Visibility=\"{x:Bind ViewModel.ThemeRestartNeededNoticeVisibility, Mode=OneWay}\" />\n                    <HyperlinkButton Content=\"Restart Xpo Music\"\n                             Visibility=\"{x:Bind ViewModel.ThemeRestartNeededNoticeVisibility, Mode=OneWay}\"\n                             Click=\"RestartApp_Click\"/>\n\n                    <TextBlock Text=\"Live tile preference:\" Margin=\"0,24,0,0\" />\n                    <ComboBox ItemsSource=\"{x:Bind ViewModel.LiveTileDesigns, Mode=OneWay}\"\n                              SelectedItem=\"{x:Bind ViewModel.SelectedLiveTileDesign, Mode=TwoWay}\"\n                              Margin=\"0,8,0,0\" \n                              Width=\"240\">\n                        <ComboBox.ItemTemplate>\n                            <DataTemplate>\n                                <TextBlock Text=\"{Binding Converter={StaticResource LiveTileDesignToStringConverter}}\" />\n                            </DataTemplate>\n                        </ComboBox.ItemTemplate>\n                    </ComboBox>\n                    <TextBlock Opacity=\"0.5\" \n                               Margin=\"0,4,8,0\"\n                               TextWrapping=\"Wrap\">\n                        Live tile will show up on Xpo Music tile when you're listening to music.\n                    </TextBlock>\n                    <HyperlinkButton Visibility=\"{x:Bind ViewModel.PinToStartLinkVisibility, Mode=OneWay}\"\n                                     Click=\"PinTileToStart_Click\">\n                        Pin Xpo Music to Start\n                    </HyperlinkButton>\n\n                    <TextBlock Text=\"Interface language:\" Margin=\"0,24,0,0\" />\n                    <ComboBox ItemsSource=\"{x:Bind ViewModel.Languages, Mode=OneWay}\"\n                              SelectedItem=\"{x:Bind ViewModel.SelectedLanguage, Mode=TwoWay}\"\n                              Margin=\"0,8,0,0\" \n                              Width=\"240\">\n                        <ComboBox.ItemTemplate>\n                            <DataTemplate>\n                                <TextBlock Text=\"{Binding Converter={StaticResource LanguageToStringConverter}}\" />\n                            </DataTemplate>\n                        </ComboBox.ItemTemplate>\n                    </ComboBox>\n                    <TextBlock Text=\"You'll need to close and reopen Xpo Music for this change to take effect.\"\n                               TextWrapping=\"Wrap\"\n                               Margin=\"0,4,0,0\"\n                               Foreground=\"Red\"\n                               Visibility=\"{x:Bind ViewModel.LanguageRestartNeededNoticeVisibility, Mode=OneWay}\" />\n                    <HyperlinkButton Content=\"Restart Xpo Music\"\n                             Visibility=\"{x:Bind ViewModel.LanguageRestartNeededNoticeVisibility, Mode=OneWay}\"\n                             Click=\"RestartApp_Click\"/>\n                    <ToggleSwitch Header=\"Open Xpo Music in mini view when launched by Cortana\" \n                                  Margin=\"0,24,0,0\"\n                                  IsOn=\"{x:Bind ViewModel.OpenInMiniViewByCortana, Mode=TwoWay}\" />\n                    <TextBlock Margin=\"0,4,0,0\" Opacity=\"0.5\" TextWrapping=\"Wrap\">\n                        State of the app won't be changed if it's already opened before Cortana's request.\n                    </TextBlock>\n                    <controls:ProxyConfiguration Margin=\"0,24,0,0\" />\n                </StackPanel>\n            </StackPanel>\n        </ScrollViewer>\n    </Grid>\n</Page>\n"
  },
  {
    "path": "XpoMusic/Pages/SettingsPage.xaml.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace XpoMusic.Pages\n{\n    public sealed partial class SettingsPage : Page\n    {\n        public SettingsPage()\n        {\n            this.InitializeComponent();\n        }\n\n        private void RestartApp_Click(object sender, RoutedEventArgs e)\n        {\n            PackageHelper.RestartApp();\n        }\n\n        private async void PinTileToStart_Click(object sender, RoutedEventArgs e)\n        {\n            await LiveTileHelper.PinToStart();\n            ViewModel.CheckPrimaryTileStatus();\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Xpotify\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Xpotify\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2019\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n[assembly: ComVisible(false)]"
  },
  {
    "path": "XpoMusic/Properties/Default.rd.xml",
    "content": "<!--\n    This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n    developers. However, you can modify these parameters to modify the behavior of the .NET Native\n    optimizer.\n\n    Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919\n\n    To fully enable reflection for App1.MyClass and all of its public/private members\n    <Type Name=\"App1.MyClass\" Dynamic=\"Required All\"/>\n\n    To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32\n    <TypeInstantiation Name=\"App1.AppClass\" Arguments=\"System.Int32\" Activate=\"Required Public\" />\n\n    Using the Namespace directive to apply reflection policy to all the types in a particular namespace\n    <Namespace Name=\"DataClasses.ViewModels\" Serialize=\"All\" />\n-->\n\n<Directives xmlns=\"http://schemas.microsoft.com/netfx/2013/01/metadata\">\n  <Application>\n    <!--\n      An Assembly element with Name=\"*Application*\" applies to all assemblies in\n      the application package. The asterisks are not wildcards.\n    -->\n    <Assembly Name=\"*Application*\" Dynamic=\"Required All\" />\n    \n    \n    <!-- Add your application specific runtime directives here. -->\n\n\n  </Application>\n</Directives>"
  },
  {
    "path": "XpoMusic/Scripts/Common/action.ts",
    "content": "﻿namespace XpoMusicScript.Common.Action {\n\n    export function nextTrack() {\n        var nextButton = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__center .spoticon-skip-forward-16\");\n\n        if (nextButton.length === 1) {\n            (<HTMLElement>nextButton[0]).click();\n            return \"1\";\n        }\n\n        return \"0\";\n    }\n\n    export function pause() {\n        var pauseButton = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__center .spoticon-pause-16\");\n\n        if (pauseButton.length === 1) {\n            (<HTMLElement>pauseButton[0]).click();\n            return \"1\";\n        }\n\n        return \"0\";\n    }\n\n    export function play() {\n        var playButton = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__center .spoticon-play-16\");\n\n        if (playButton.length === 1) {\n            (<HTMLElement>playButton[0]).click();\n            return \"1\";\n        }\n\n        return \"0\";\n    }\n\n    export function playPause() {\n        if (play() === '0') {\n            pause();\n        }\n    }\n\n\n    export function prevTrack() {\n        var prevButton = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__center .spoticon-skip-back-16\");\n\n        if (prevButton.length === 1) {\n            (<HTMLElement>prevButton[0]).click();\n            return \"1\";\n        }\n\n        return \"0\";\n    }\n\n    export function prevTrackForce() {\n        var prevButton = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__center .spoticon-skip-back-16\");\n\n        if (prevButton.length === 1) {\n            var currentPlaying = StatusReport.getTrackFingerprint();\n\n            (<HTMLElement>prevButton[0]).click();\n\n            var delay = 300;\n            if (document.querySelectorAll(\".ConnectBar\").length > 0)\n                delay = 1250;\n\n            setTimeout(function () {\n                var newCurrentPlaying = StatusReport.getTrackFingerprint();\n                if (currentPlaying === newCurrentPlaying) {\n                    (<HTMLElement>prevButton[0]).click();\n                }\n            }, delay);\n\n            return \"1\";\n        }\n\n        return \"0\";\n    }\n\n    function tryAutoPlayTrack(remainingCount) {\n        if (remainingCount <= 0)\n            return;\n\n        //console.log('r' + remainingCount);\n\n        setTimeout(function () {\n            var modalPlayButton = document.querySelectorAll(\".autoplay-modal-container .btn-green\");\n            if (modalPlayButton.length > 0)\n                (<HTMLElement>modalPlayButton[0]).click();\n            else\n                tryAutoPlayTrack(remainingCount - 1);\n        }, 500);\n    }\n\n    export function autoPlayTrack() {\n        tryAutoPlayTrack(26);\n    }\n\n    function tryAutoPlayPlaylist(remainingCount) {\n        if (remainingCount <= 0)\n            return;\n\n        //console.log('r' + remainingCount);\n\n        setTimeout(function () {\n            var modalPlayButton = document.querySelectorAll(\".autoplay-modal-container .btn-green\");\n            var tracklistPlayButton = document.querySelectorAll(\".TrackListHeader .btn-green\");\n\n            if (modalPlayButton.length > 0)\n                (<HTMLElement>modalPlayButton[0]).click();\n            else if (tracklistPlayButton.length > 0)\n                (<HTMLElement>tracklistPlayButton[0]).click();\n            else\n                tryAutoPlayPlaylist(remainingCount - 1);\n        }, 500);\n    }\n\n    export function autoPlayPlaylist() {\n        tryAutoPlayPlaylist(26);\n    }\n\n    export function enableNowPlaying() {\n        var nowPlayingButton = document.querySelectorAll('.nowPlaying-navBar-item');\n        if (nowPlayingButton.length > 0) {\n            nowPlayingButton[0].classList.remove('nowPlaying-navBar-item-disabled');\n        } else {\n            setTimeout(enableNowPlaying, 1000);\n            return;\n        }\n\n        var compactOverlayButton = document.querySelectorAll('.CompactOverlayButton');\n        if (compactOverlayButton.length > 0) {\n            compactOverlayButton[0].classList.remove('CompactOverlayButton-disabled');\n        } else {\n            setTimeout(enableNowPlaying, 1000);\n            return;\n        }\n    }\n\n    export function goBackIfPossible() {\n        if (BrowserHistory.canGoBack()) {\n            window.history.go(-1);\n            return \"1\";\n        }\n        return \"0\";\n    }\n\n    export function goForwardIfPossible() {\n        window.history.go(1);\n    }\n\n    export function isPlayingOnThisApp() {\n        return (document.querySelectorAll(\".Root__now-playing-bar .ConnectBar\").length === 0) ? \"1\" : \"0\";\n    }\n\n    export function navigateToPage(url) {\n        history.pushState({}, null, url);\n        history.pushState({}, null, url + \"#navigatingToPagePleaseIgnore\");\n        history.back();\n    }\n\n    export function seekPlayback(percentage) {\n        var progressBar = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar .playback-bar .progress-bar\")[0];\n\n        var rect = progressBar.getBoundingClientRect();\n        var x = rect.left + 1 + (rect.width - 2) * percentage;\n        var y = rect.top + rect.height / 2;\n\n        var mouseDownEvent = document.createEvent('MouseEvents');\n        mouseDownEvent.initMouseEvent(\n            'mousedown', true, true, window, 0,\n            0, 0, x, y, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(x, y).dispatchEvent(mouseDownEvent);\n\n        var mouseUpEvent = document.createEvent('MouseEvents');\n        mouseUpEvent.initMouseEvent(\n            'mouseup', true, true, window, 0,\n            0, 0, x, y, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(x, y).dispatchEvent(mouseUpEvent);\n    }\n\n    export function seekVolume(percentage) {\n        var progressBar = document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar .volume-bar .progress-bar\")[0];\n\n        var rect = progressBar.getBoundingClientRect();\n        var x = rect.left + (rect.width - 1) * percentage;\n        var y = rect.top + rect.height / 2;\n\n        var mouseDownEvent = document.createEvent('MouseEvents');\n        mouseDownEvent.initMouseEvent(\n            'mousedown', true, true, window, 0,\n            0, 0, x, y, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(x, y).dispatchEvent(mouseDownEvent);\n\n        var mouseUpEvent = document.createEvent('MouseEvents');\n        mouseUpEvent.initMouseEvent(\n            'mouseup', true, true, window, 0,\n            0, 0, x, y, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(x, y).dispatchEvent(mouseUpEvent);\n    }\n\n    export function newPlaylist() {\n        var newPlaylistButton = document.querySelectorAll('.CreatePlaylistButton');\n\n        if (newPlaylistButton.length > 0) {\n            (<HTMLElement>newPlaylistButton[0]).click();\n        }\n        else {\n            // Old UI\n            Action.navigateToPage(\"/collection/playlists\");\n\n            setTimeout(function () {\n                (<HTMLElement>document.querySelectorAll('.Root__main-view .asideButton button')[0]).click();\n            }, 250);\n\n            return;\n        }\n\n        \n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/browserHistory.ts",
    "content": "﻿namespace XpoMusicScript.Common.BrowserHistory {\n    export function canGoBack() {\n        return window.location.hash !== \"#xpotifyInitialPage\";\n    }\n\n    export function goBack() {\n        if (canGoBack()) {\n            window.history.go(-1);\n        }\n    }\n\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/color.ts",
    "content": "﻿namespace XpoMusicScript.Common.Color {\n    declare var Vibrant: any;\n\n    export function setNowPlayingBarColor(url, lightTheme) {\n        try {\n            var img = document.createElement('img');\n            img.crossOrigin = 'anonymous';\n            img.setAttribute('src', url);\n\n            img.addEventListener('load', function () {\n                try {\n                    var vibrant = new Vibrant(img);\n                    var swatches = vibrant.swatches();\n\n                    var brigtnessFactor = 0.6;\n                    var opacity = 0.7;\n                    var rgb = swatches.Muted.getRgb();\n                    if (swatches.Muted.getPopulation() < swatches.Vibrant.getPopulation()) {\n                        rgb = swatches.Vibrant.getRgb();\n                    }\n\n                    if (lightTheme) {\n                        rgb[0] = 255 - rgb[0];\n                        rgb[1] = 255 - rgb[1];\n                        rgb[2] = 255 - rgb[2];\n\n                        brigtnessFactor = 0.7;\n                        opacity = 0.6;\n                    }\n\n                    rgb[0] = Math.max(brigtnessFactor * rgb[0], 0);\n                    rgb[1] = Math.max(brigtnessFactor * rgb[1], 0);\n                    rgb[2] = Math.max(brigtnessFactor * rgb[2], 0);\n\n                    (<HTMLElement>document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar\")[0]).style.backgroundColor = \"rgba(\" + rgb[0] + \", \" + rgb[1] + \", \" + rgb[2] + \", \" + opacity + \")\";\n                }\n                catch (ex2) {\n                    console.log(\"setNowPlayingBarColor failed (2)\");\n                    console.log(ex2);\n                }\n            });\n        }\n        catch (ex) {\n            console.log(\"setNowPlayingBarColor failed (1)\");\n            console.log(ex);\n        }\n    }\n\n    export function addXpotifyClassToBackground(retryCount) {\n        if (retryCount < 0)\n            return;\n\n        var rootElement = document.querySelectorAll(\".Root__top-container\");\n        if (rootElement.length === 0) {\n            setTimeout(function () {\n                addXpotifyClassToBackground(retryCount - 1);\n            }, 250);\n        } else {\n            (<HTMLElement>rootElement[0].previousSibling).setAttribute('data-xpoBackground', '1');\n        }\n    }\n\n    export function addXpotifyClassToSectionBackground(retryCount) {\n        if (retryCount < 0)\n            return;\n\n        var elements = document.querySelectorAll(\".main-view-container__scroll-node-child > section > div:nth-child(1), .main-view-container__scroll-node-child > section > div:nth-child(2)\");\n        if (elements.length <= 1) {\n            setTimeout(function () {\n                addXpotifyClassToSectionBackground(retryCount - 1);\n            }, 250);\n        } else {\n            (<HTMLElement>elements[0]).setAttribute('data-xpoBackground', '1');\n            (<HTMLElement>elements[1]).setAttribute('data-xpoBackground', '1');\n        }\n    }\n\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/dragDrop.ts",
    "content": "﻿/// <reference path=\"uriHelper.ts\" />\n\nnamespace XpoMusicScript.Common.DragDrop {\n\n    export function allowDrop(event) {\n        event.preventDefault();\n    }\n\n    export function drop(event) {\n        var data = event.dataTransfer.getData(\"Text\");\n        var uri = UriHelper.getPwaUri(data);\n\n        if (uri === undefined || uri.length === 0) {\n            return;\n        }\n\n        event.preventDefault();\n\n        // Navigate to page\n        Action.navigateToPage(uri);\n    }\n\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/indeterminateProgressBarHandler.ts",
    "content": "﻿namespace XpoMusicScript.Common.IndeterminateProgressBarHandler {\n\n    declare var XpoMusic: any;\n\n    function trackLoadCheck(initialProgress) {\n        try {\n            var playbackBar = <HTMLElement>(document.querySelectorAll(\".Root__now-playing-bar .playback-bar\")[0]);\n            var progressBarProgress = (<HTMLElement>(playbackBar.querySelectorAll(\".progress-bar__fg\")[0])).style.transform;\n\n            var isPlaying = true;\n            try {\n                isPlaying = StatusReport.getIsPlaying();\n            } catch (ex) { }\n\n            if (progressBarProgress != initialProgress || isPlaying === false) {\n                var progressBarBg = <HTMLElement>(playbackBar.querySelectorAll(\".progress-bar__bg\")[0]);\n                var times = playbackBar.querySelectorAll(\".playback-bar__progress-time\");\n\n                progressBarBg.style.opacity = '1';\n                (<HTMLElement>(times[0])).style.opacity = '1';\n                (<HTMLElement>(times[1])).style.opacity = '1';\n\n                XpoMusic.hideProgressBar();\n            } else {\n                setTimeout(function () {\n                    trackLoadCheck(initialProgress);\n                }, 250);\n            }\n        } catch (ex) {\n            console.log(\"trackLoadCheck failed.\", ex);\n        }\n    }\n\n    export function onTrackLoadBegin() {\n        try {\n            var playbackBar = <HTMLElement>(document.querySelectorAll(\".Root__now-playing-bar .playback-bar\")[0]);\n            var progressBarBg = <HTMLElement>(playbackBar.querySelectorAll(\".progress-bar__bg\")[0]);\n            var times = playbackBar.querySelectorAll(\".playback-bar__progress-time\");\n\n            progressBarBg.style.opacity = '0';\n            (<HTMLElement>(times[0])).style.opacity = '0';\n            (<HTMLElement>(times[1])).style.opacity = '0';\n\n            var rect = progressBarBg.getBoundingClientRect();\n\n            XpoMusic.showProgressBar(rect.left / window.innerWidth, rect.top / window.innerHeight, rect.width / window.innerWidth);\n\n            setTimeout(function () {\n                var progressBarProgress = (<HTMLElement>(playbackBar.querySelectorAll(\".progress-bar__fg\")[0])).style.transform;\n\n                if (progressBarProgress.indexOf(\"translate\") == -1) {\n                    // Something's wrong. Will ignore progress bar\n                    progressBarBg.style.opacity = '1';\n                    (<HTMLElement>(times[0])).style.opacity = '1';\n                    (<HTMLElement>(times[1])).style.opacity = '1';\n                    console.log(\"onTrackLoadBegin failed, and reverted changes.\")\n                    return;\n                }\n\n                setTimeout(function () {\n                    trackLoadCheck(progressBarProgress);\n                }, 250);\n            }, 250);\n        } catch (ex) {\n            console.log(\"onTrackLoadBegin failed.\", ex);\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/initScript-common.ts",
    "content": "﻿/// <reference path=\"uiElementModifier.ts\" />\n/// <reference path=\"dragDrop.ts\" />\n/// <reference path=\"../Lib/vibrant.ts\" />\n/// <reference path=\"../Lib/focus-visible.ts\" />\n/// <reference path=\"color.ts\" />\n/// <reference path=\"browserHistory.ts\" />\n/// <reference path=\"resize.ts\" />\n/// <reference path=\"startupAnimation.ts\" />\n/// <reference path=\"requestIntercepter.ts\" />\n/// <reference path=\"statusReport.ts\" />\n/// <reference path=\"action.ts\" />\n/// <reference path=\"pageTitleFinder.ts\" />\n/// <reference path=\"keyboardShortcutListener.ts\" />\n/// <reference path=\"mouseWheelListener.ts\" />\n/// <reference path=\"themedScrollbar.ts\" />\n/// <reference path=\"web-player-backup.ts\" />\n\n\nnamespace XpoMusicScript.Common {\n\n    declare var XpoMusic: any;\n\n    export function isProVersion(): boolean {\n        //@ts-ignore\n        return '{{XPOTIFYISPROVERSION}}' === '1';\n    }\n\n    export function getDeviceName(): string {\n        return '{{DEVICENAME}}';\n    }\n\n    export function getAppName(): string {\n        return isProVersion() ? 'Xpo Music Pro' : 'Xpo Music';\n    }\n\n    export function isLightTheme(): boolean {\n        return (document.getElementsByTagName('body')[0].getAttribute('data-xpotifyTheme') === 'light');\n    }\n\n    export function sleep(ms) {\n        return new Promise(resolve => setTimeout(resolve, ms));\n    }\n\n    export function getCurrentZoomLevel(): number {\n        // @ts-ignore\n        return (screen.deviceXDPI / screen.logicalXDPI);\n    }\n\n    export function init() {\n        if (document.querySelectorAll(\"#main\").length === 0\n            && XpoMusic.isWebPlayerBackupEnabled()) {\n            XpoMusic.log(\"#main is missing. Will try runWebPlayerBackup()\");\n            try {\n                WebPlayerBackup.runWebPlayerBackup();\n            } catch (ex) {\n                XpoMusic.log(\"runWebPlayerBackup() failed: \" + ex);\n            }\n        }\n\n        var errors = \"\";\n\n        markPageAsInjected();\n        initDragDrop();\n\n        XpoMusic.log(\"Initializing UiElemetModifier stuff...\");\n        errors += injectCss();\n        errors += UiElementModifier.createBackButton();\n        errors += UiElementModifier.createNavBarButtons();\n        errors += UiElementModifier.createCompactOverlayButton();\n        errors += UiElementModifier.addNowPlayingButton();\n        errors += UiElementModifier.addBackgroundClass();\n        errors += initNowPlayingBarCheck();\n\n        XpoMusic.log(\"Removing top right 'Upgrade' button if present...\");\n        removeTopUpgradeButton();\n\n        XpoMusic.log(\"Setting page hash and initializing resize and periodic checks...\");\n        setInitialPageHash();\n        initOnResizeCheck();\n        initPeriodicPageCheck();\n\n        XpoMusic.log(\"Initializing libraries...\");\n        Lib.FocusVisible.init();\n\n        XpoMusic.log(\"Initializing MouseWheelListener...\");\n        MouseWheelListener.init();\n\n        XpoMusic.log(\"Initializing KeyboardShortcutListener...\");\n        KeyboardShortcutListener.init();\n\n        XpoMusic.log(\"Initializing RequestIntercepter...\");\n        RequestIntercepter.startInterceptingFetch();\n\n        XpoMusic.log(\"Initializing StatusReport...\");\n        StatusReport.initRegularStatusReport();\n\n        XpoMusic.log(\"Initializing themed scrollbars...\");\n        initThemedScrollbars();\n\n        XpoMusic.log(\"Initializing StartupAnimation...\");\n        StartupAnimation.init();\n\n        // @ts-ignore\n        if (window.XpoMusicScript === undefined)\n            // @ts-ignore\n            window.XpoMusicScript = XpoMusicScript;\n\n        XpoMusic.log(\"Common.init() finished. errors = '\" + errors + \"'\");\n        return errors;\n    }\n\n    function initThemedScrollbars() {\n        if (document.querySelectorAll(\".main-view-container__scroll-node\").length == 0\n            || document.querySelectorAll(\".Rootlist__playlists-scroll-node\").length == 0) {\n            setTimeout(initThemedScrollbars, 200);\n            return;\n        }\n\n        var adsBar = document.querySelector(\".Root__main-view--has-ads > div:nth-child(3)\");\n        ThemedScrollbar.initScrollbar(\".main-view-container__scroll-node\", 1000, function (el) {\n            if (adsBar != null) {\n                el.style.bottom = (adsBar.clientHeight) + \"px\";\n            } else {\n                el.style.bottom = \"0px\";\n            }\n\n            var headerIsBlurred = !(<HTMLElement>document.querySelector('.Root__top-bar header div:nth-child(1)')).classList.contains('xpo-transparent-top-bar-background');\n            if (headerIsBlurred)\n                el.style.top = \"85px\";\n            else\n                el.style.top = (32.0 / getCurrentZoomLevel()) + \"px\";\n        });\n\n        ThemedScrollbar.initScrollbar(\".Rootlist__playlists-scroll-node\", 1000, function (el) {\n            el.style.top = \"130px\";\n        });\n    }\n\n    function removeTopUpgradeButton() {\n        try {\n            var itemCandidate = document.querySelectorAll('.main-view-container__scroll-node-child > div > button');\n            if (itemCandidate.length == 0) {\n                return;\n            } else if (itemCandidate.length > 1) {\n                XpoMusic.log(\"Too many candidates for removeTopUpgradeButton. Will not remove.\");\n                return;\n            }\n\n            var item = itemCandidate[0].parentElement;\n            var css = \".\" + item.classList[0] + \" { display: none; }\";\n            injectCustomCssContent(css);\n        } catch (ex) {\n            XpoMusic.log('RemoveTopUpgradeButton failed: ' + ex);\n        }\n    }\n\n    function markPageAsInjected() {\n        var body = document.getElementsByTagName('body')[0];\n        body.setAttribute('data-scriptinjection', '1');\n    }\n\n    function initDragDrop() {\n        var body = document.getElementsByTagName('body')[0];\n        body.ondrop = DragDrop.drop;\n        body.ondragover = DragDrop.allowDrop;\n    }\n\n    function injectCss() {\n        var css = '{{XPOTIFYCSSBASE64CONTENT}}';\n        return injectCustomCssContent(atob(css));\n    }\n\n    function injectCustomCssContent(content) {\n        try {\n            var style = document.createElement('style');\n            document.getElementsByTagName('head')[0].appendChild(style);\n            style.type = 'text/css';\n            style.appendChild(document.createTextNode(content));\n        }\n        catch (ex) {\n            return \"injectCssFailed,\";\n        }\n        return \"\";\n    }\n\n    function initNowPlayingBarCheck() {\n        // Check and set now playing bar background color when now playing album art changes\n        try {\n            Lib.Vibrant.init();\n\n            setInterval(function () {\n                try {\n                    var url = (<HTMLElement>document.querySelectorAll(\".Root__now-playing-bar .now-playing .cover-art-image\")[0]).style.backgroundImage.slice(5, -2);\n                    var lightTheme = isLightTheme();\n\n                    if (window[\"xpotifyNowPlayingIconUrl\"] !== url || window[\"xpotifyNowPlayingLastSetLightTheme\"] !== lightTheme) {\n                        window[\"xpotifyNowPlayingIconUrl\"] = url;\n                        window[\"xpotifyNowPlayingLastSetLightTheme\"] = lightTheme;\n\n                        Color.setNowPlayingBarColor(url, lightTheme);\n                    }\n                }\n                catch (ex) { }\n            }, 1000);\n        } catch (ex) {\n            return \"nowPlayingBarColorPollInitFailed,\";\n        }\n\n        return \"\";\n    }\n\n    function setInitialPageHash() {\n        setTimeout(function () {\n            window.location.hash = \"xpotifyInitialPage\";\n\n            setInterval(function () {\n                var backButtonDivC = document.querySelectorAll(\".backButtonContainer\");\n                if (backButtonDivC.length === 0) {\n                    return;\n                }\n                var backButtonDiv = <HTMLElement>backButtonDivC[0];\n\n                if (BrowserHistory.canGoBack()) {\n                    backButtonDiv.classList.remove(\"backButtonContainer-disabled\");\n                } else {\n                    backButtonDiv.classList.add(\"backButtonContainer-disabled\");\n                }\n            }, 500);\n        }, 1000);\n    }\n\n    function initOnResizeCheck() {\n        window.addEventListener(\"resize\", Resize.onResize, true);\n        setInterval(Resize.onResize, 5000); // Sometimes an OnResize is necessary when users goes to a new page.\n    }\n\n    /*\n    function forceRedrawItem1(item: HTMLElement) {\n        item.style.paddingRight = \"0.1px\";\n        setTimeout(function () {\n            item.style.paddingRight = \"0px\";\n        }, 100);\n    }\n\n\n    function forceRedrawItem2(item: HTMLElement) {\n        item.style.opacity = \"0.999\";\n        setTimeout(function () {\n            item.style.opacity = \"1\";\n        }, 100);\n    }\n\n    function forceRedrawScreen() {\n        forceRedrawItem1(document.querySelector('.Root__now-playing-bar'));\n\n        var navs = document.querySelectorAll('nav');\n        for (var i = 0; i < navs.length; i++) {\n            forceRedrawItem1(navs[i]);\n        }\n\n        var imgs = document.querySelectorAll('.cover-art-image, img');\n        for (var i = 0; i < imgs.length; i++) {\n            forceRedrawItem2(<HTMLElement>imgs[i]);\n        }\n    }\n    */\n\n    function InjectTopBarCustomStyles() {\n        var topBarBackground = document.querySelectorAll('.Root__top-bar header > div:nth-child(1)');\n        if (topBarBackground.length !== 1)\n            return;\n\n        var element = <HTMLElement>(topBarBackground[0]);\n        element.style.backgroundColor = \"rgba(18, 18, 18, 0.6)\";\n        element.style.setProperty('backdrop-filter', 'blur(30px)');\n        element.style.setProperty('-webkit-backdrop-filter', 'blur(30px)');\n    }\n\n    function expandPivotInTopBar() {\n        try {\n            var childNodesList = document.querySelectorAll('.Root__top-bar nav ul li ul li');\n            document.querySelectorAll('.xpo-modified-pivot-item').forEach(x => x.parentNode.removeChild(x));\n\n            if (childNodesList.length === 0)\n                return;\n\n            var childNodes = Array.prototype.slice.call(childNodesList);\n            var correctNodes = Array.prototype.slice.call(document.querySelectorAll('.Root__top-bar nav ul li')).filter(el => !childNodes.includes(el));\n            var correctClassName = correctNodes[0].className;\n            childNodes.forEach(x => x.className = correctClassName);\n            var correctAClassName = correctNodes[0].querySelector('a').className;\n            childNodes.forEach(x => x.querySelector('a').className = correctAClassName);\n            var containingLiElement = childNodes[0].closest('ul').closest('li');\n            var correctUl = containingLiElement.closest('ul');\n            childNodes.forEach(x => {\n                var newNode = <HTMLElement>correctUl.appendChild(x.cloneNode(true));\n                newNode.classList.add('xpo-modified-pivot-item');\n\n                var newA = newNode.querySelector('a');\n                var href = newA.href;\n                newA.href = \"#\";\n\n                newA.onclick = function () {\n                    Common.Action.navigateToPage(href);\n                    return false;\n                };\n            });\n            containingLiElement.style.display = 'none';\n        }\n        catch (ex) {\n            XpoMusic.log(ex);\n        }\n    }\n\n    var pagePrevLocation = \"\";\n    var redrawFixPrevLocation = \"\";\n    function periodicPageCheck() {\n        try {\n            // Temporarily disable tracklist mod\n            //if (document.querySelectorAll(\".tracklist\").length > 0) {\n            //    TracklistExtended.initTracklistMod();\n            //}\n\n            InjectTopBarCustomStyles();\n            expandPivotInTopBar();\n\n            //if (isLightTheme()) {\n            //    // Fix Edge glitches where css invert() stops working sometimes after page change.\n            //    if (redrawFixPrevLocation !== window.location.href) {\n            //        setTimeout(forceRedrawScreen, 700);\n            //        setTimeout(forceRedrawScreen, 1250);\n            //        redrawFixPrevLocation = window.location.href;\n            //    }\n            //}\n\n            if (pagePrevLocation !== window.location.href) {\n                // Color.addXpotifyClassToSectionBackground(4);\n\n                if (window.location.href.startsWith('https://open.spotify.com/search')) {\n                    (<HTMLElement>document.querySelector('.Root__top-bar input')).focus();\n                    (<HTMLElement>document.querySelector('.Root__main-view')).classList.remove('xpo-collection-page');\n                    (<HTMLElement>document.querySelector('.Root__top-bar')).classList.remove('xpo-top-bar-hidden');\n                    (<HTMLElement>document.querySelector('.Root__top-bar header div:nth-child(1)')).classList.remove('xpo-transparent-top-bar-background');\n\n                } else if (window.location.href.startsWith('https://open.spotify.com/artist')\n                    || window.location.href.startsWith('https://open.spotify.com/album')\n                    || window.location.href.startsWith('https://open.spotify.com/show')\n                    || window.location.href.startsWith('https://open.spotify.com/playlist')\n                    || window.location.href.startsWith('https://open.spotify.com/collection/tracks')) {\n\n                    (<HTMLElement>document.querySelector('.Root__main-view')).classList.remove('xpo-collection-page');\n                    (<HTMLElement>document.querySelector('.Root__top-bar')).classList.add('xpo-top-bar-hidden');\n                    (<HTMLElement>document.querySelector('.Root__top-bar header div:nth-child(1)')).classList.add('xpo-transparent-top-bar-background');\n\n                } else if (window.location.href.startsWith('https://open.spotify.com/collection')) {\n                    (<HTMLElement>document.querySelector('.Root__main-view')).classList.add('xpo-collection-page');\n                    (<HTMLElement>document.querySelector('.Root__top-bar')).classList.remove('xpo-top-bar-hidden');\n                    (<HTMLElement>document.querySelector('.Root__top-bar header div:nth-child(1)')).classList.remove('xpo-transparent-top-bar-background');\n\n                } else {\n                    (<HTMLElement>document.querySelector('.Root__main-view')).classList.remove('xpo-collection-page');\n                    (<HTMLElement>document.querySelector('.Root__top-bar')).classList.remove('xpo-top-bar-hidden');\n                    (<HTMLElement>document.querySelector('.Root__top-bar header div:nth-child(1)')).classList.add('xpo-transparent-top-bar-background');\n                }\n\n                pagePrevLocation = window.location.href;\n            }\n        }\n        catch (ex) {\n            XpoMusic.log(ex);\n        }\n    }\n\n    function initPeriodicPageCheck() {\n        setInterval(periodicPageCheck, 1000);\n\n        // Fix Edge glitches where css invert() stops working sometimes after page change.\n        //if (isLightTheme()) {\n        //    setInterval(forceRedrawScreen, 2000);\n        //}\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/Common/keyboardShortcutListener.ts",
    "content": "﻿/// <reference path=\"statusReport.ts\" />\n/// <reference path=\"action.ts\" />\n\nnamespace XpoMusicScript.Common.KeyboardShortcutListener {\n\n    declare var XpoMusic: any;\n\n    function copyToClipboard(str) {\n        // From https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f\n\n        const el = document.createElement('textarea');\n        el.value = str;\n        el.setAttribute('readonly', '');\n        el.style.position = 'absolute';\n        el.style.left = '-9999px';\n        document.body.appendChild(el);\n        const selected =\n            document.getSelection().rangeCount > 0\n                ? document.getSelection().getRangeAt(0)\n                : false;\n        el.select();\n        document.execCommand('copy');\n        document.body.removeChild(el);\n        if (selected) {\n            document.getSelection().removeAllRanges();\n            document.getSelection().addRange(selected);\n        }\n    }\n\n    function getKeyboardFocusableElements() {\n        return document.querySelectorAll(\"a.mo-info-name, li[role=button], .Root__main-view nav ul li a, a.search-history-result, input[type=text]\");\n    }\n\n    function getElementsPreferredForInitialFocus() {\n        return document.querySelectorAll(\"a.mo-info-name, li[role=button], a.search-history-result\");\n    }\n\n    function getScrollParent(element, includeHidden) {\n        let style = getComputedStyle(element);\n        const excludeStaticParent = style.position === 'absolute';\n        const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\n\n        if (style.position === 'fixed') {\n            return document.body;\n        }\n        let parent = element.parentElement;\n        while (parent) {\n            style = getComputedStyle(parent);\n            if (excludeStaticParent && style.position === 'static') {\n                continue;\n            }\n            if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) {\n                return parent;\n            }\n            parent = parent.parentElement;\n        }\n\n        return document.body;\n    }\n\n\n    function scrollIntoViewEx(element: HTMLElement) {\n        var bounds = element.getBoundingClientRect();\n        if (bounds.top > (window.innerHeight - 200)) {\n            element.scrollIntoView(false);\n\n            bounds = element.getBoundingClientRect();\n            if (bounds.top > (window.innerHeight - 300)) {\n                var parent = <HTMLElement>getScrollParent(element, false);\n                parent.scrollTop += 300;\n            }\n        } else if (bounds.top < 30) {\n            element.scrollIntoView(true);\n\n            bounds = element.getBoundingClientRect();\n            if (bounds.top < 200) {\n                var parent = <HTMLElement>getScrollParent(element, false);\n                parent.scrollTop -= 200;\n            }\n        }\n    }\n\n    function keyboardSelect(offset: number) {\n        var focusableElements = getKeyboardFocusableElements();\n        var activeElement = document.activeElement;\n        var idx = -1;\n\n        for (var i = 0; i < focusableElements.length; i++) {\n            if (activeElement == focusableElements[i]) {\n                idx = i;\n                break;\n            }\n        }\n\n        if (idx == -1) {\n            idx = 0;\n\n            var preferredForFocus = getElementsPreferredForInitialFocus()[0];\n            for (var i = 0; i < focusableElements.length; i++) {\n                if (focusableElements[i] == preferredForFocus) {\n                    idx = i;\n                    break;\n                }\n            }\n        } else {\n            idx += offset;\n            idx = Math.min(idx, focusableElements.length - 1);\n            idx = Math.max(idx, 0);\n        }\n\n        var selectedElement = (<HTMLElement>focusableElements[idx]);\n\n        selectedElement.focus();\n        scrollIntoViewEx(selectedElement);\n    }\n\n    export function keyDownExternalCall(charCode, shiftPressed, ctrlPressed, altPressed): boolean {\n        // @ts-ignore\n        return processKeyDown({\n            which: charCode,\n            altKey: altPressed,\n            shiftKey: shiftPressed,\n            ctrlKey: ctrlPressed,\n        }) ? \"1\" : \"0\";\n    }\n\n    function processKeyDown(e: KeyboardEvent): boolean {\n        // Ignore if focus is on a textbox and the selected key is anything other than arrow up/down keys\n        var isInputFocused = document.activeElement.tagName.toLowerCase() === \"input\";\n        if (isInputFocused && e.which != 38 && e.which != 40 && !e.ctrlKey && !e.altKey)\n            return;\n\n        var shortcutKeyProcessed = true;\n\n        // Spotify style shortcuts\n        if (e.ctrlKey && e.which == 'N'.charCodeAt(0)) {\n            // Ctrl+N -> New Playlist\n            Action.newPlaylist();\n\n        } else if (e.ctrlKey && e.which == 'C'.charCodeAt(0) && !isInputFocused) {\n            // Ctrl+C -> Copy\n            copyToClipboard(window.location.href.replace(\"#xpotifyInitialPage\", \"\"));\n\n        } else if (e.ctrlKey && e.which == 'V'.charCodeAt(0) && !isInputFocused) {\n            // Ctrl+V -> Paste\n            XpoMusic.navigateToClipboardUri();\n\n            //} else if (e.which == 46) {\n            // Delete key -> Delete\n\n        } else if (e.which == ' '.charCodeAt(0)) {\n            // Space -> Play/pause\n            if (StatusReport.getIsPlaying())\n                Action.pause();\n            else\n                Action.play();\n\n        } else if (e.ctrlKey && e.which == 39) {\n            // Ctrl+ArrowRight -> Next Track\n            Action.nextTrack();\n\n        } else if (e.ctrlKey && e.which == 37) {\n            // Ctrl+ArrowLeft -> Prev Track\n            Action.prevTrack();\n\n        } else if (e.ctrlKey && e.shiftKey && e.which == 38) {\n            // Ctrl+Shift+ArrowUp -> Max volume\n            Action.seekVolume(1);\n\n        } else if (e.ctrlKey && e.shiftKey && e.which == 40) {\n            // Ctrl+Shift+ArrowDown -> Mute\n            Action.seekVolume(0);\n\n        } else if (e.ctrlKey && e.which == 38) {\n            // Ctrl+ArrowUp -> Volume up\n            var volume = StatusReport.getVolume();\n            var newVolume = Math.min(volume + 0.1, 1);\n            Action.seekVolume(newVolume);\n\n        } else if (e.ctrlKey && e.which == 40) {\n            // Ctrl+ArrowDown -> Volume down\n            var volume = StatusReport.getVolume();\n            var newVolume = Math.max(volume - 0.1, 0);\n            Action.seekVolume(newVolume);\n\n        } else if (e.ctrlKey && e.which == 'L'.charCodeAt(0)) {\n            // Ctrl+L -> Search\n            Action.navigateToPage(\"/search\");\n\n            //} else if (e.ctrlKey && e.which == 'F'.charCodeAt(0)) {\n            // Ctrl+F -> Filter (in Songs and Playlists) -- not present at the moment\n\n        } else if (e.altKey && e.which == 37) {\n            // Alt+ArrowLeft -> Go back\n            Action.goBackIfPossible();\n\n        } else if (e.altKey && e.which == 39) {\n            // Alt+ArrowRight -> Go forward\n            Action.goForwardIfPossible();\n\n            //} else if (e.which == 13) {\n            // Enter -> Play selected row -- not present at the moment\n            // Enter key is handled automatically by the PWA\n\n        } else if (e.which == 38 || e.which == 37) {\n            // ArrowUp or ArrowLeft -> \n            // If not selected, select the first item in track list\n            // and if selected, go one up.\n            keyboardSelect(-1);\n\n        } else if (e.which == 40 || e.which == 39) {\n            // ArrowDown or ArrowRight -> \n            // If not selected, select the first item in track list\n            // and if selected, go one down.\n            keyboardSelect(1);\n\n        } else if (e.ctrlKey && e.which == 'P'.charCodeAt(0)) {\n            // Ctrl+P -> Settings\n            XpoMusic.openSettings();\n        }\n        // Custom shortcuts\n        else if (e.ctrlKey && e.which == 'M'.charCodeAt(0)) {\n            // Ctrl+M -> Go to mini view\n            XpoMusic.openMiniView();\n\n        } else if (e.ctrlKey && e.which == 188) {\n            // Ctrl+, -> Go to now playing\n            XpoMusic.openNowPlaying();\n\n        } else if (e.ctrlKey && e.which == 'Q'.charCodeAt(0)) {\n            // Ctrl+Q -> Open playing queue\n            Action.navigateToPage(\"/queue\");\n\n        } else if (e.altKey && (e.which == '1'.charCodeAt(0) || e.which == 97)) {\n            // Alt+1 -> Home\n            Action.navigateToPage(\"/browse\");\n\n        } else if (e.altKey && (e.which == '2'.charCodeAt(0) || e.which == 98)) {\n            // Alt+2 -> Search\n            Action.navigateToPage(\"/search\");\n\n        } else if (e.altKey && (e.which == '3'.charCodeAt(0) || e.which == 99)) {\n            // Alt+3 -> Your Library\n            Action.navigateToPage(\"/collection\");\n\n        } else if (e.altKey && (e.which == '4'.charCodeAt(0) || e.which == 100)) {\n            // Alt+4 -> Now Playing\n            XpoMusic.openNowPlaying();\n\n        } else {\n            shortcutKeyProcessed = false;\n        }\n\n        return shortcutKeyProcessed;\n    }\n\n    function onKeyDown(e: KeyboardEvent) {\n        var shortcutKeyProcessed = processKeyDown(e);\n\n        if (shortcutKeyProcessed) {\n            e.preventDefault();\n            return false;\n        }\n    }\n\n    export function init() {\n        window.onkeydown = onKeyDown;\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/mouseWheelListener.ts",
    "content": "﻿/// <reference path=\"statusReport.ts\" />\n/// <reference path=\"action.ts\" />\n\nnamespace XpoMusicScript.Common.MouseWheelListener {\n   \n    function volumeMouseWheelHandler(e) {\n        var { deltaY } = e;\n        var currentVolume = StatusReport.getVolume();\n        var newVolume = Math.max(Math.min(currentVolume - (deltaY / 2000), 1), 0);\n\n        Action.seekVolume(newVolume);\n    }\n\n    function setVolumeBarListener() {\n        var volumeBar = document.querySelector(\".Root__top-container .Root__now-playing-bar .now-playing-bar__right__inner .volume-bar > div\");\n\n        if (volumeBar === null) {\n            // Volume bar not present yet. Will try again later.\n            setTimeout(setVolumeBarListener, 1000);\n            return;\n        }\n\n        volumeBar.addEventListener(\"mousewheel\", (e) => { volumeMouseWheelHandler(e) });\n    }\n\n    export function init() {\n        setVolumeBarListener();\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/pageTitleFinder.ts",
    "content": "﻿namespace XpoMusicScript.Common.PageTitleFinder {\n\n    function titleCase(str) {\n        var splitStr = str.toLowerCase().split(' ');\n        for (var i = 0; i < splitStr.length; i++) {\n            // You do not need to check if i is larger than splitStr length, as your for does that for you\n            // Assign it back to the array\n            splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n        }\n        // Directly return the joined string\n        return splitStr.join(' ');\n    }\n\n    function searchForNavBarSelectedItem() {\n        var candidates = document.querySelectorAll(\".Root__main-view nav a\");\n\n        var selIndex = -1;\n\n        for (var i = 0; i < candidates.length; i++) {\n            if (candidates[i].classList.length == 1) {\n                continue;\n            } else if (candidates[i].classList.length == 2) {\n                if (selIndex == -1) {\n                    selIndex = i;\n                } else {\n                    return '';\n                }\n            } else {\n                return '';\n            }\n        }\n\n        if (selIndex == -1) {\n            return '';\n        } else {\n            return titleCase((<HTMLElement>candidates[selIndex]).innerText);\n        }\n    }\n\n    function searchForHTag(selector) {\n        var candidates = document.querySelectorAll(\".Root__main-view \" + selector);\n        for (var i = 0; i < candidates.length; i++) {\n            var s = (<HTMLElement>candidates[i]).innerText;\n            if (s.length > 0 && s.length < 80) {\n                return s;\n            }\n        }\n        return '';\n    }\n\n    export function getTitle() {\n        var h1AndNav = document.querySelectorAll('.Root__main-view h1, .Root__main-view nav');\n        var result;\n\n        if (h1AndNav.length > 0) {\n\n            // Between h1 and nav tags, prioritise the one that comes first\n            if (h1AndNav[0].tagName.toLowerCase() == \"nav\") {\n                result = searchForNavBarSelectedItem();\n                if (result != '')\n                    return result;\n\n                result = searchForHTag('h1');\n                if (result != '')\n                    return result;\n            } else {\n                result = searchForHTag('h1');\n                if (result != '')\n                    return result;\n\n                result = searchForNavBarSelectedItem();\n                if (result != '')\n                    return result;\n            }\n        }\n\n        result = searchForHTag('h2');\n        if (result != '')\n            return result;\n\n        return window.location.href.substring(window.location.href.lastIndexOf('/') + 1).replace(/-/g, ' ');\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/Common/playbackStuckHelper.ts",
    "content": "﻿namespace XpoMusicScript.Common.PlaybackStuckHelper\n{\n    async function resolveStart() {\n        var initialElapsedTime = StatusReport.getElapsedTime();\n\n        if (Action.nextTrack() == '0')\n            return;\n\n        while (!StatusReport.getIsPlaying() || StatusReport.getElapsedTime() === 0 || StatusReport.getElapsedTime() === initialElapsedTime)\n            await Common.sleep(500);\n        \n        if (Action.prevTrack() == '0')\n            return;\n\n        do {\n            await Common.sleep(500);\n        } while (!StatusReport.getIsPlaying())\n        \n        if (Action.prevTrack() == '0')\n            return;\n\n        var newInitialElapsedTime = StatusReport.getElapsedTime();\n        while (!StatusReport.getIsPlaying() || StatusReport.getElapsedTime() === 0 || StatusReport.getElapsedTime() === newInitialElapsedTime)\n            await Common.sleep(100);\n    }\n\n    export async function tryResolveStart() {\n        // @ts-ignore\n        if (window.xpotifyStuckStartResolvingInProgress === true)\n            return;\n\n        // @ts-ignore\n        window.xpotifyStuckStartResolvingInProgress = true;\n\n        var volume = StatusReport.getVolume();\n        try {\n            Action.seekVolume(0);\n\n            await resolveStart();\n        } finally {\n            Action.seekVolume(volume);\n\n            // @ts-ignore\n            window.xpotifyStuckStartResolvingInProgress = false;\n        }\n    }\n\n\n    export async function tryResolveMiddle() {\n        var elapsedTime = StatusReport.getElapsedTime();\n        var totalTime = StatusReport.getTotalTime();\n\n        var changeTime = Math.max(1000, totalTime / 200);\n\n        var newElapsedTime = elapsedTime - changeTime;\n        if (newElapsedTime <= 0)\n            newElapsedTime = elapsedTime + changeTime;\n\n        Action.seekPlayback(newElapsedTime / totalTime);\n\n        await Common.sleep(1000);\n        Action.play();\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/Common/requestIntercepter.ts",
    "content": "﻿/// <reference path=\"indeterminateProgressBarHandler.ts\" />\n\nnamespace XpoMusicScript.Common.RequestIntercepter {\n\n    export function startInterceptingFetch() {\n\n        const fetch = window.fetch;\n        window.fetch = (...args) => (async (args) => {\n\n            // Request interception\n            if (args[0].toString().endsWith('/state')) {\n                console.log(args);\n                var reqJson = JSON.stringify(args);\n                if (reqJson.indexOf(\"before_track_load\") >= 0) {\n                    IndeterminateProgressBarHandler.onTrackLoadBegin();\n                }\n            } else if (args[0].toString().endsWith('/v1/devices')) {\n                console.log(args);\n                console.log(args[1].body);\n                var appName = Common.getAppName();\n                var spotifyConnectName = Common.getDeviceName() + ' (' + appName + ')';\n\n                // On 1809+, we try to change 'Web Player([browser])' to 'Xpo Music' in web-player.xxx.js. But it might fail\n                // in case of code change, and also this feature is not supported on 1803 and below, so we replace both\n                // 'Web Player (Microsoft Edge)' and 'Xpo Music' to the desired name.\n                args[1].body = args[1].body.toString().replace('Web Player (Microsoft Edge)', spotifyConnectName).replace('Xpo Music', spotifyConnectName);\n            }\n\n            // Sending the real request\n            var result = await fetch(...args);\n\n            // Response interception\n\n            // Returning response\n            return result;\n        })(args);\n    }\n\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/resize.ts",
    "content": "﻿namespace XpoMusicScript.Common.Resize {\n    export function onResize() {\n        try {\n            /* \n             *  I couldn't fix the width of the new track list for Edge (Works fine in Chrome but not in Edge),\n             *  so I use a javascript workaround for that.\n             */\n            var contentDiv = document.querySelectorAll(\".main-view-container__content\");\n            if (contentDiv.length === 0) {\n                contentDiv = document.querySelectorAll(\".main-view-container__scroll-node\");\n            }\n\n            // 230px is added because it's added in css as well, for acrylic behind artist page.\n            (<HTMLElement>contentDiv[0]).style.width = 230 + (window.innerWidth - (<HTMLElement>document.querySelectorAll(\".Root__nav-bar\")[0]).offsetWidth) + \"px\";\n\n\n            var adContainerDiv = document.querySelectorAll(\".AdsContainer\");\n            if (adContainerDiv.length > 0)\n                (<HTMLElement>adContainerDiv[0]).style.width = (window.innerWidth - (<HTMLElement>document.querySelectorAll(\".Root__nav-bar\")[0]).offsetWidth) + \"px\";\n        }\n        catch (ex) {\n            console.log(\"resize event failed\");\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/startupAnimation.ts",
    "content": "﻿namespace XpoMusicScript.Common.StartupAnimation {\n    export function init() {\n        try {\n            var pivotItems = document.querySelectorAll(\".Root__main-view nav ul li\");\n            var entranceItems = document.querySelectorAll(\".container-fluid\");\n\n            for (var i = 0; i < pivotItems.length; i++) {\n                (<HTMLElement>pivotItems[i]).style.animation = 'none';\n            }\n            for (var i = 0; i < entranceItems.length; i++) {\n                (<HTMLElement>entranceItems[i]).style.animation = 'none';\n                (<HTMLElement>entranceItems[i]).style.opacity = '0';\n            }\n\n            setTimeout(function () {\n                try {\n                    for (var i = 0; i < pivotItems.length; i++) {\n                        (<HTMLElement>pivotItems[i]).style.animation = '';\n                    }\n                }\n                catch (ex2) {\n                    console.log(ex2);\n                }\n            }, 400);\n\n            setTimeout(function () {\n                try {\n                    for (var i = 0; i < entranceItems.length; i++) {\n                        (<HTMLElement>entranceItems[i]).style.animation = '';\n                        (<HTMLElement>entranceItems[i]).style.opacity = '1';\n                    }\n                }\n                catch (ex2) {\n                    console.log(ex2);\n                }\n            }, 400);\n        }\n        catch (ex) {\n            console.log(ex);\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/statusReport.ts",
    "content": "﻿/// <reference path=\"../SpotifyApi/player.ts\" />\n\nnamespace XpoMusicScript.Common.StatusReport {\n\n    declare var XpoMusic: any;\n\n    function getTextContent(element, index) {\n        var e = document.querySelectorAll(element);\n\n        if (e.length > index) {\n            return (e[index]).innerText;\n        } else {\n            throw \"Couldn't find element.\";\n        }\n    }\n\n    export function getTrackFingerprint() {\n        return getTextContent('.Root__now-playing-bar .now-playing-bar__left', 0);\n    }\n\n    export function getTrackName() {\n        return getTextContent('.Root__now-playing-bar .now-playing-bar__left .ellipsis-one-line', 1);\n    }\n\n    export function getTrackArtist() {\n        return getTextContent('.Root__now-playing-bar .now-playing-bar__left .ellipsis-one-line', 2);\n    }\n\n    export function getTrackAlbumId() {\n        var artistUri = (<HTMLLinkElement>((document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__left a\")[1]))).href;\n        return artistUri.substring(artistUri.lastIndexOf('/') + 1);\n    }\n\n    export function getTrackArtistId() {\n        var artistUri = (<HTMLLinkElement>((document.querySelectorAll(\".Root__now-playing-bar .now-playing-bar__left a\")[2]))).href;\n        return artistUri.substring(artistUri.lastIndexOf('/') + 1);\n    }\n\n    export function timeStringToMilliseconds(time) {\n        if (time.match('^[0-9]+\\:[0-9][0-9]?$') === null)\n            throw \"Invalid time format\";\n\n        var parts = time.split(':');\n\n        return (Number.parseInt(parts[0]) * 60 + Number.parseInt(parts[1])) * 1000;\n    }\n\n    export function getElapsedTime() {\n        var time = getTextContent('.Root__now-playing-bar .now-playing-bar__center .playback-bar .playback-bar__progress-time', 0);\n        return timeStringToMilliseconds(time);\n    }\n\n    export function getTotalTime() {\n        var time = getTextContent('.Root__now-playing-bar .now-playing-bar__center .playback-bar .playback-bar__progress-time', 1);\n        return timeStringToMilliseconds(time);\n    }\n\n    export function getIsSavedToLibrary() {\n        var e = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__left .spoticon-heart-active-16');\n        return (e.length > 0);\n\n        // This is not fatal, so we don't throw exception if this fails.\n    }\n\n    export function getIsPlaying() {\n        var pauseButton = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__center .spoticon-pause-16');\n        if (pauseButton.length > 0) {\n            return true;\n        }\n\n        var playButton = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__center .spoticon-play-16');\n        if (playButton.length > 0) {\n            return false;\n        }\n\n        throw \"Can't find play/pause buttons\";\n    }\n\n    export function getIsPrevTrackAvailable() {\n        var prevButton = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__center .spoticon-skip-back-16');\n        if (prevButton.length === 0) {\n            throw \"Can't find prevTrackButton\";\n        }\n        if (((prevButton[0])).classList.contains(\"control-button--disabled\")) {\n            return false;\n        }\n        return true;\n    }\n\n    export function getIsNextTrackAvailable() {\n        var nextButton = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__center .spoticon-skip-forward-16');\n        if (nextButton.length === 0) {\n            throw \"Can't find nextTrackButton\";\n        }\n        if (((nextButton[0])).classList.contains(\"control-button--disabled\")) {\n            return false;\n        }\n        return true;\n    }\n\n    export async function getTrackIdViaApi() {\n        var fingerprint = getTrackFingerprint() + \"\\n\" + (getIsPlaying() ? \"playing\" : \"paused\");\n        // @ts-ignore\n        if (window.xpotify_prevFingerprint === fingerprint) {\n            // @ts-ignore\n            return window.xpotify_prevTrackId;\n        }\n        // @ts-ignore\n        window.xpotify_prevTrackId = \"\"; // Return empty at least until we get a response from api.\n        // @ts-ignore\n        window.xpotify_prevFingerprint = fingerprint;\n\n        XpoMusic.log(\"getTrackIdViaApi(): getting track id... local fingerprint: \" + fingerprint);\n\n        var playerApi = new SpotifyApi.Player();\n        var result = await playerApi.getCurrentlyPlaying();\n\n        var trackName = result.item.name;\n        var trackId = result.item.id;\n        XpoMusic.log(\"getTrackIdViaApi() result: track name = '\" + trackName + \"'; id = '\" + trackId + \"'\");\n\n        if (trackName == getTrackName()) {\n            XpoMusic.log(\"getTrackIdViaApi(): retrieved name matches local name. Will return its id.\");\n\n            // @ts-ignore\n            window.xpotify_prevTrackId = trackId;\n            return trackId;\n        }\n\n        return \"\";\n    }\n\n    export async function getTrackId() {\n\n        return await getTrackIdViaApi(); // right clicking on current playing song is broken in PWA!\n\n        \n        var tracks = document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__left .ellipsis-one-line a');\n        if (tracks.length === 0)\n            return \"\";\n\n        var element = tracks[0];\n\n        var menus = document.querySelectorAll(\"nav[role=menu]\");\n        for (var i = 0; i < menus.length; i++) {\n            (<HTMLElement>menus[i]).style.display = 'none';\n        }\n\n        // Open context menu on track name on now playing bar\n        var e = element.ownerDocument.createEvent('MouseEvents');\n        e.initMouseEvent('contextmenu', true, true,\n            element.ownerDocument.defaultView, 1, 0, 0, 0, 0, false,\n            false, false, false, 2, null);\n        element.dispatchEvent(e);\n\n        var trackId = \"\";\n\n        var tas = document.querySelectorAll(\"nav[role=menu] textarea\");\n        for (var j = 0; j < tas.length; j++) {\n            if (tas[j].textContent.toLowerCase().startsWith(\"https://open.spotify.com/track/\")) {\n                trackId = tas[j].textContent.substr(\"https://open.spotify.com/track/\".length);\n            }\n        }\n\n        // Close context menu\n        var clickX = 1;\n        var clickY = window.innerHeight - 1;\n        var e2 = document.createEvent('MouseEvents');\n        e2.initMouseEvent(\n            'mousedown', true, true, window, 0,\n            0, 0, clickX, clickY, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(clickX, clickY).dispatchEvent(e2);\n        e2 = document.createEvent('MouseEvents');\n        e2.initMouseEvent(\n            'mouseup', true, true, window, 0,\n            0, 0, clickX, clickY, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(clickX, clickY).dispatchEvent(e2);\n\n        setTimeout(function () {\n            for (var i = 0; i < menus.length; i++) {\n                (<HTMLElement>menus[i]).style.opacity = '0';\n                (<HTMLElement>menus[i]).style.display = 'unset';\n            }\n        }, 500);\n\n        // @ts-ignore\n        window.xpotify_prevFingerprint = fingerprint;\n        // @ts-ignore\n        window.xpotify_prevTrackId = trackId;\n\n        // We will ignore (not throw exception) if we can't find trackId, as this is not fatal anyway.\n\n        return trackId;\n    }\n\n    export function getVolume() {\n        try {\n            var element = <HTMLElement>(document.querySelectorAll('.Root__now-playing-bar .now-playing-bar__right .volume-bar .progress-bar .progress-bar__fg')[0]);\n            return (100 - Number.parseFloat(element.style.transform.replace(/[^\\d.]/g, ''))) / 100.0;\n        }\n        catch (ex) {\n            return 1.0;\n            // This is not critical, will ignore if fails.\n        }\n    }\n\n    async function getNowPlaying() {\n        var trackName, trackId, albumId, artistName, artistId, elapsedTime, totalTime, trackFingerprint;\n        var isPrevTrackAvailable, isNextTrackAvailable, isPlaying, isSavedToLibrary, volume;\n        var success = true;\n\n        try {\n            trackName = getTrackName();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get trackName.\");\n            success = false;\n        }\n        try {\n            trackId = await getTrackId();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get trackId.\");\n            trackId = \"\";\n            success = false;\n        }\n        try {\n            albumId = getTrackAlbumId();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get albumId.\");\n            success = false;\n        }\n        try {\n            artistName = getTrackArtist();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get artistName.\");\n            success = false;\n        }\n        try {\n            artistId = getTrackArtistId();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get artistId.\");\n            success = false;\n        }\n        try {\n            elapsedTime = getElapsedTime();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get elapsedTime.\");\n            success = false;\n        }\n        try {\n            totalTime = getTotalTime();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get totalTime.\");\n            success = false;\n        }\n        try {\n            trackFingerprint = getTrackFingerprint();\n        } catch (ex) {\n            console.log(\"Failed to get trackFingerprint.\");\n            success = false;\n        }\n        try {\n            isPrevTrackAvailable = getIsPrevTrackAvailable();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get isPrevTrackAvailable.\");\n            success = false;\n        }\n        try {\n            isNextTrackAvailable = getIsNextTrackAvailable();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get isNextTrackAvailable.\");\n            success = false;\n        }\n        try {\n            isPlaying = getIsPlaying();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get isPlaying.\");\n            success = false;\n        }\n        try {\n            isSavedToLibrary = getIsSavedToLibrary();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get isSavedToLibrary.\");\n            success = false;\n        }\n        try {\n            volume = getVolume();\n        } catch (ex) {\n            XpoMusic.log(\"Failed to get volume.\");\n            success = false;\n        }\n\n        var data = {\n            TrackName: trackName,\n            TrackId: trackId,\n            AlbumId: albumId,\n            ArtistName: artistName,\n            ArtistId: artistId,\n            ElapsedTime: elapsedTime,\n            TotalTime: totalTime,\n            TrackFingerprint: trackFingerprint,\n            IsPrevTrackAvailable: isPrevTrackAvailable,\n            IsNextTrackAvailable: isNextTrackAvailable,\n            IsPlaying: isPlaying,\n            IsTrackSavedToLibrary: isSavedToLibrary,\n            Volume: volume,\n            Success: success,\n        };\n\n        // XpoMusic.log(\"getNowPlaying(): sending data: \" + JSON.stringify(data));\n\n        return data;\n    }\n\n    export function isBackPossible() {\n        var backButtonDiv = document.querySelectorAll(\".backButtonContainer\");\n\n        if (backButtonDiv.length === 0) {\n            return true;\n        } else if (backButtonDiv[0].classList.contains(\"backButtonContainer-disabled\")) {\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    async function sendStatusReport() {\n        var data = JSON.stringify({\n            BackButtonEnabled: isBackPossible(),\n            NowPlaying: await getNowPlaying(),\n        });\n\n        XpoMusic.statusReport(data);\n    }\n\n    export function initRegularStatusReport() {\n        setInterval(sendStatusReport, 1000);\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/themedScrollbar.ts",
    "content": "﻿namespace XpoMusicScript.Common.ThemedScrollbar {\n\n    var currentScrollbars = [];\n\n    function getRandomId() {\n        return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n    }\n\n    function scrollContainerMainScroll(event) {\n        var element = event.currentTarget;\n        var id = element.getAttribute('data-xpo-scroll-unique-id');\n\n        window.clearTimeout(currentScrollbars[id].mainElementTimeout);\n\n        var overlay = currentScrollbars[id].overlayElement;\n\n        overlay.removeEventListener('scroll', scrollContainerOverlayScroll);\n        overlay.scrollTop = (overlay.scrollHeight - overlay.clientHeight) * (element.scrollTop / (element.scrollHeight - element.clientHeight));\n\n        currentScrollbars[id].mainElementTimeout = setTimeout(function () {\n            currentScrollbars[id].overlayElement.addEventListener('scroll', scrollContainerOverlayScroll);\n        }, 500);\n    }\n\n    function scrollContainerOverlayScroll(event) {\n        var overlay = event.currentTarget;\n        var id = overlay.getAttribute('data-xpo-scroll-unique-id');\n\n        window.clearTimeout(currentScrollbars[id].overlayElementTimeout);\n\n        var element = currentScrollbars[id].mainElement;\n\n        element.removeEventListener('scroll', scrollContainerMainScroll);\n        element.scrollTop = (element.scrollHeight - element.clientHeight) * (overlay.scrollTop / (overlay.scrollHeight - overlay.clientHeight));\n\n        currentScrollbars[id].overlayElementTimeout = setTimeout(function () {\n            currentScrollbars[id].mainElement.addEventListener('scroll', scrollContainerMainScroll);\n        }, 500);\n    }\n\n    function insertAfter(newNode, referenceNode) {\n        referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\n    }\n\n    export function initScrollbar(elementsSelector, updateInterval, positionEvaluatorFunction = undefined) {\n        var elements = document.querySelectorAll(elementsSelector);\n\n        for (var i = 0; i < elements.length; i++) {\n            var element: HTMLElement = elements[i];\n\n            var uniqueId = getRandomId();\n\n            element.classList.add(\"xpo-scroll-container\");\n            element.setAttribute('data-xpo-scroll-unique-id', uniqueId);\n            element.addEventListener('scroll', scrollContainerMainScroll);\n\n            var overlay = document.createElement('div');\n            overlay.classList.add(\"xpo-scroll-container\");\n            overlay.classList.add(\"xpo-extra-scrollbar-fixed\");\n            overlay.setAttribute('data-xpo-scroll-unique-id', uniqueId);\n            overlay.addEventListener('scroll', scrollContainerOverlayScroll);\n\n            var overlayContent = document.createElement('div');\n            overlayContent.style.height = element.scrollHeight + \"px\";\n\n            overlay.append(overlayContent);\n\n            if (positionEvaluatorFunction !== undefined) {\n                positionEvaluatorFunction(overlay);\n            }\n\n            insertAfter(overlay, element);\n\n            setInterval(function () {\n                if (positionEvaluatorFunction !== undefined) {\n                    positionEvaluatorFunction(overlay);\n                }\n\n                var height = element.scrollHeight / (element.clientHeight / overlay.clientHeight);\n                overlayContent.style.height = height + \"px\";\n            }, updateInterval);\n\n            currentScrollbars[uniqueId] = {\n                mainElement: element,\n                overlayElement: overlay,\n                overlayContentElement: overlayContent,\n                mainElementTimeout: undefined,\n                overlayElementTimeout: undefined,\n            };\n        }\n    }\n\n\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/tracklistExtended.ts",
    "content": "﻿namespace XpoMusicScript.Common.TracklistExtended {\n\n    declare var XpoMusic: any;\n\n    export function injectTrackIdsToTrackList() {\n\n        // Hide menus\n        var menus = document.querySelectorAll(\"nav[role=menu]\");\n        for (var i = 0; i < menus.length; i++) {\n            (<HTMLElement>menus[i]).style.display = 'none';\n        }\n\n        var tracks = document.querySelectorAll(\".Root__main-view .tracklist-container .tracklist-row\")\n\n        var counter = 0;\n\n        // Find track url for each tracklist-row and add it to data-trackid\n        for (var i = 0; i < tracks.length; i++) {\n\n            var element = tracks[i];\n\n            if (element.getAttribute('data-trackid') !== null)\n                continue;\n\n            counter++;\n\n            var e = element.ownerDocument.createEvent('MouseEvents');\n            e.initMouseEvent('contextmenu', true, true,\n                element.ownerDocument.defaultView, 1, 0, 0, 0, 0, false,\n                false, false, false, 2, null);\n            element.dispatchEvent(e);\n\n            var tas = document.querySelectorAll(\"nav[role=menu] textarea\");\n            for (var j = 0; j < tas.length; j++) {\n                if (tas[j].textContent.toLowerCase().startsWith(\"https://open.spotify.com/track/\")) {\n                    element.setAttribute('data-trackid', tas[j].textContent.substr(\"https://open.spotify.com/track/\".length));\n                }\n            }\n        }\n\n        XpoMusic.log(counter.toString() + \" trackIds extracted.\");\n\n        // Close context menu\n        var clickX = 1;\n        var clickY = window.innerHeight - 1;\n        var e2 = document.createEvent('MouseEvents');\n        e2.initMouseEvent(\n            'mousedown', true, true, window, 0,\n            0, 0, clickX, clickY, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(clickX, clickY).dispatchEvent(e2);\n        e2 = document.createEvent('MouseEvents');\n        e2.initMouseEvent(\n            'mouseup', true, true, window, 0,\n            0, 0, clickX, clickY, false, false,\n            false, false, 0, null\n        );\n        document.elementFromPoint(clickX, clickY).dispatchEvent(e2);\n\n\n        // Don't let menu to be visible\n        setTimeout(function () {\n            for (var i = 0; i < menus.length; i++) {\n                (<HTMLElement>menus[i]).style.opacity = '0';\n                (<HTMLElement>menus[i]).style.display = 'unset';\n            }\n        }, 1000);\n    }\n\n    export async function setAddRemoveButtons() {\n        var tracklist = document.querySelectorAll(\".Root__main-view .tracklist\");\n        var rows = tracklist[0].querySelectorAll('.tracklist-row');\n        var trackIds = [];\n        for (var i = 0; i < rows.length; i++) {\n            if (rows[i].classList.contains(\"tracklistSongExistsInLibrary\") || rows[i].classList.contains(\"tracklistSongNotExistsInLibrary\")) {\n                // Don't ask server for the items we already know the status\n                continue;\n            }\n\n            var attr = rows[i].getAttribute('data-trackid');\n            if (attr !== undefined && attr.length > 0) {\n                if (trackIds.indexOf(attr) < 0) { \n                    // Add each track id once\n                    trackIds.push(attr);\n                }\n            }\n        }\n\n        var api = new SpotifyApi.Library();\n        var result = await api.isTracksSaved(trackIds);\n\n        result.forEach(function (item: boolean, index: number) {\n            var element = document.querySelectorAll('.tracklist-row[data-trackid=\"' + trackIds[index] + '\"]');\n            if (element.length < 1)\n                return;\n\n            for (var i = 0; i < element.length; i++) {\n                if (item) {\n                    (<HTMLElement>element[i]).classList.remove('tracklistSongNotExistsInLibrary');\n                    (<HTMLElement>element[i]).classList.add('tracklistSongExistsInLibrary');\n                } else {\n                    (<HTMLElement>element[i]).classList.remove('tracklistSongExistsInLibrary');\n                    (<HTMLElement>element[i]).classList.add('tracklistSongNotExistsInLibrary');\n                }\n            }\n        });\n    }\n\n    export async function initTracklistMod() {\n        var tracklist = document.querySelectorAll(\".Root__main-view .tracklist\");\n\n        if (tracklist.length === 0)\n            return; // No tracklist found\n\n        if (window.location.href.startsWith(\"https://open.spotify.com/collection/tracks\"))\n            return; // No tracklist add remove button for Liked Songs page (they're all liked by definition!)\n\n        if (tracklist[0].querySelectorAll(\".tracklist-row\").length === 0)\n            return; // List not loaded yet\n\n        if (!UiElementModifier.createTrackListAddRemoveButtons())\n            return; // No new elements present\n\n        XpoMusic.log('Some new track list elements found. will try to find track ids.');\n\n        await Common.sleep(500); // Make sure animations and UI is completely loaded (avoid lag)\n        injectTrackIdsToTrackList();\n        await setAddRemoveButtons(); \n    }\n\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/Common/uiElementModifier.ts",
    "content": "﻿/// <reference path=\"action.ts\" />\n/// <reference path=\"browserHistory.ts\" />\n/// <reference path=\"uiInjector.ts\" />\n/// <reference path=\"color.ts\" />\n\nnamespace XpoMusicScript.Common.UiElementModifier {\n\n    declare var XpoMusic: any;\n\n    export function createBackButton(): string {\n        try {\n            var body = <HTMLElement>document.getElementsByTagName('body')[0];\n            var backButtonDiv = document.createElement('div');\n            backButtonDiv.classList.add(\"backButtonContainer\");\n            backButtonDiv.classList.add(\"backButtonContainer-disabled\");\n            backButtonDiv.innerHTML = \"<span>&#xE72B;</span>\";\n            backButtonDiv.onclick = BrowserHistory.goBack;\n            body.appendChild(backButtonDiv);\n        }\n        catch (ex) {\n            XpoMusic.log(\"injectBackFailed\");\n            XpoMusic.log(ex.toString());\n            return \"injectBackFailed,\";\n        }\n        return \"\";\n    }\n\n    export function createNavBarButtons(): string {\n        try {\n            var pinToStartButton = document.createElement('div');\n            pinToStartButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifypintostart-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n                + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xE718;</span></div>'\n                + '<span class=\"navbar-link__text\">Pin this page to Start</span></div></a></div>';\n            pinToStartButton.querySelector('a').onclick = function () {\n                XpoMusic.pinToStart();\n                return false;\n            };\n\n            var settingsButton = document.createElement('div');\n            settingsButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifysettings-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n                + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xE115;</span></div>'\n                + '<span class=\"navbar-link__text\">Settings</span></div></a></div>';\n            settingsButton.querySelector('a').onclick = function () {\n                XpoMusic.openSettings();\n                return false;\n            };\n\n            //var accountButton = document.createElement('div');\n            //accountButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifysettings-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n            //    + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xE8D4;</span></div>'\n            //    + '<span class=\"navbar-link__text\">Account</span></div></a></div>';\n            //accountButton.querySelector('a').onclick = function () {\n            //    Action.navigateToPage('/settings/account');\n            //    return false;\n            //};\n\n            //var logOutButton = document.createElement('div');\n            //logOutButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifysettings-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n            //    + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xF3B1;</span></div>'\n            //    + '<span class=\"navbar-link__text\">Log out</span></div></a></div>';\n            //logOutButton.querySelector('a').onclick = function () {\n            //    (<HTMLElement>(document.querySelectorAll(\".Root__top-bar a[role=button]\")[0])).click();\n            //    document.body.style.opacity = '0';\n            //    return false;\n            //};\n\n            var aboutButton = document.createElement('div');\n            aboutButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifysettings-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n                + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xE946;</span></div>'\n                + '<span class=\"navbar-link__text\">About</span></div></a></div>';\n            aboutButton.querySelector('a').onclick = function () {\n                XpoMusic.openAbout();\n                return false;\n            };\n\n            var donateButton = document.createElement('div');\n            donateButton.innerHTML = '<div class=\"navBar-item navBar-item--with-icon-left NavBar__xpotifysettings-item\"><a class=\"link-subtle navBar-link ellipsis-one-line\" href=\"#\">'\n                + '<div class=\"navBar-link-text-with-icon-wrapper\"><div class=\"icon segoe-icon NavBar__icon\"><span style=\"font-family:Segoe MDL2 Assets;\">&#xE719;</span></div>'\n                + '<span class=\"navbar-link__text\">Donate</span></div></a></div>';\n            donateButton.querySelector('a').onclick = function () {\n                XpoMusic.openDonate();\n                return false;\n            };\n\n            // UiInjector.injectNavbarDownButton(logOutButton);\n            UiInjector.injectNavbarDownButton(settingsButton);\n            UiInjector.injectNavbarDownButton(pinToStartButton);\n            //UiInjector.injectNavbarDownButton(aboutButton);\n            //if (!Common.isProVersion())\n            //    UiInjector.injectNavbarDownButton(donateButton);\n        }\n        catch (ex) {\n            XpoMusic.log(\"injectNavBarFooterFailed\");\n            XpoMusic.log(ex.toString());\n            return \"injectNavBarFooterFailed,\";\n        }\n        return \"\";\n    }\n\n    export function createCompactOverlayButton(): string {\n        // Inject compact overlay button to now playing bar\n        try {\n            var compactOverlayButton = document.createElement('div');\n            compactOverlayButton.classList.add(\"CompactOverlayButton\");\n            compactOverlayButton.classList.add(\"CompactOverlayButton-disabled\");\n            compactOverlayButton.innerHTML = '<a style=\"border-bottom: 0px;\" href=\"#\"><button title=\"Mini view\" class=\"control-button\">'\n                + '<div style=\"font-family: Segoe MDL2 Assets; position:relative; cursor: default;\">'\n                + '<div style=\"left: 6px; top: -3px; font-size: 19px; position: absolute;\">&#xE7FB;</div>'\n                + '<div style=\"left: 12px; top: -1px; font-size: 9px; position: absolute;\">&#xEB9F;</div>'\n                + '</div></button></a>';\n            compactOverlayButton.querySelector('a').onclick = function () {\n                XpoMusic.openMiniView();\n                return false;\n            };\n            UiInjector.injectNowPlayingRightButton(compactOverlayButton);\n        }\n        catch (ex) {\n            XpoMusic.log(\"injectCompactOverlayFailed\");\n            XpoMusic.log(ex.toString());\n            return \"injectCompactOverlayFailed,\";\n        }\n        return \"\";\n    }\n\n    export function addNowPlayingButton() {\n        try {\n            var nowPlayingButton = document.createElement('div');\n            nowPlayingButton.innerHTML = '<li class=\"navBar-group\"><div class=\"GlueDropTarget\">'\n                + '<div class=\"navBar-item navBar-item--with-icon-left nowPlaying-navBar-item nowPlaying-navBar-item-disabled\">'\n                + '<a class=\"link-subtle navBar-link ellipsis-one-line\" aria-label=\"Now Playing\" href=\"#\"><div class=\"navBar-link-text-with-icon-wrapper\">'\n                + '<div class=\"icon NavBar__icon nowPlaying-icon\"></div>'\n                + '<span class=\"navbar-link__text\">Now Playing</span></div></a></div></div></li>';\n            nowPlayingButton.querySelector('a').onclick = function () {\n                XpoMusic.openNowPlaying();\n                return false;\n            };\n            UiInjector.injectNowPlayingNavBarButton(nowPlayingButton);\n        }\n        catch (ex) {\n            XpoMusic.log(\"addNowPlayingButtonFailed\");\n            XpoMusic.log(ex.toString());\n            return \"addNowPlayingButtonFailed,\";\n        }\n        return \"\";\n        \n    }\n\n    export function addBackgroundClass() {\n        // Find and add necessary class to background div\n        try {\n            setTimeout(function () {\n                Color.addXpotifyClassToBackground(12);\n            }, 250);\n\n            // Sometimes the PWA changes the background element on loading, causing the \n            // background class to be removed. We'll do this again after a few seconds \n            // to make sure that does not happen.\n            setTimeout(function () {\n                Color.addXpotifyClassToBackground(0);\n            }, 4000);\n        }\n        catch (ex) {\n            XpoMusic.log(\"findBackgroundDivFailed\");\n            XpoMusic.log(ex.toString());\n            return \"findBackgroundDivFailed,\";\n        }\n        return \"\";\n    }\n\n    export function createTrackListAddRemoveButtons(): boolean {\n        try {\n            var count = 0;\n            var needsRefresh = false;\n            var tracks = document.querySelectorAll(\".tracklist .tracklist-row\");\n            for (var i = 0; i < tracks.length; i++) {\n                if (tracks[i].getAttribute(\"data-xpotify-addremovebuttonsadded\") !== null) {\n                    if (!tracks[i].classList.contains(\"tracklistSongExistsInLibrary\") && !tracks[i].classList.contains(\"tracklistSongNotExistsInLibrary\") && tracks[i].getAttribute(\"data-trackid\") !== null && tracks[i].querySelectorAll('.more').length > 0) {\n                        needsRefresh = true;\n                    }\n                    continue;\n                }\n\n                var addSongDiv = document.createElement('button');\n                addSongDiv.classList.add(\"tracklist-middle-align\");\n                addSongDiv.classList.add(\"control-button\");\n                addSongDiv.classList.add(\"spoticon-add-16\");\n                addSongDiv.classList.add(\"trackListAddRemoveSongButton\");\n                addSongDiv.classList.add(\"trackListAddSongButton\");\n                addSongDiv.setAttribute(\"title\", \"Add to your Liked Songs\");\n                addSongDiv.addEventListener('click', async function (e) {\n                    var row = (<HTMLElement>e.target).closest('.tracklist-row');\n                    var trackId = row.getAttribute(\"data-trackid\");\n\n                    row.classList.add('tracklistSongExistsInLibrary');\n                    row.classList.remove('tracklistSongNotExistsInLibrary');\n\n                    var libraryApi = new SpotifyApi.Library();\n                    var result = await libraryApi.saveTrack(trackId);\n\n                    if (!result) {\n                        row.classList.add('tracklistSongNotExistsInLibrary');\n                        row.classList.remove('tracklistSongExistsInLibrary');\n                    }\n                });\n\n                var removeSongDiv = document.createElement('button');\n                removeSongDiv.classList.add(\"tracklist-middle-align\");\n                removeSongDiv.classList.add(\"control-button\");\n                removeSongDiv.classList.add(\"spoticon-added-16\");\n                removeSongDiv.classList.add(\"trackListAddRemoveSongButton\");\n                removeSongDiv.classList.add(\"trackListRemoveSongButton\");\n                removeSongDiv.setAttribute(\"title\", \"Remove from your Liked Songs\");\n                removeSongDiv.addEventListener('click', async function (e) {\n                    var row = (<HTMLElement>e.target).closest('.tracklist-row');\n                    var trackId = row.getAttribute(\"data-trackid\");\n\n                    row.classList.add('tracklistSongNotExistsInLibrary');\n                    row.classList.remove('tracklistSongExistsInLibrary');\n\n                    var libraryApi = new SpotifyApi.Library();\n                    var result = await libraryApi.removeTrack(trackId);\n\n                    if (!result) {\n                        row.classList.add('tracklistSongExistsInLibrary');\n                        row.classList.remove('tracklistSongNotExistsInLibrary');\n                    }\n                });\n\n                var destContainer = tracks[i].querySelectorAll('.more')[0];\n\n                if (destContainer !== undefined) {\n                    destContainer.appendChild(addSongDiv);\n                    destContainer.appendChild(removeSongDiv);\n                    count++;\n                }\n\n                tracks[i].setAttribute(\"data-xpotify-addremovebuttonsadded\", \"1\");\n            }\n\n            return (count > 0) || needsRefresh;\n        } catch (ex) {\n            XpoMusic.log(ex.toString());\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/uiInjector.ts",
    "content": "﻿namespace XpoMusicScript.Common.UiInjector {\n    export function injectNavbarDownButton(button) {\n        var sessionInfo = document.querySelectorAll(\".Root__nav-bar nav > div:last-child\");\n        if (sessionInfo.length === 0) {\n            setTimeout(function () {\n                injectNavbarDownButton(button);\n            }, 500);\n        } else {\n            var navbar = sessionInfo[0].parentElement;\n            navbar.insertBefore(button, sessionInfo[0]);\n\n            (<HTMLElement>(sessionInfo[0])).style.display = 'none';\n        }\n    }\n\n    export function injectNowPlayingRightButton(button) {\n        var extraControlsBar = document.querySelectorAll('.Root__now-playing-bar .ExtraControls');\n        if (extraControlsBar.length === 0) {\n            setTimeout(function () {\n                injectNowPlayingRightButton(button);\n            }, 500);\n        } else {\n            extraControlsBar[0].prepend(button);\n        }\n    }\n\n    export function injectNowPlayingNavBarButton(button) {\n        var extraControlsBar = document.querySelectorAll('.Root__top-container .Root__nav-bar nav ul');\n        if (extraControlsBar.length === 0) {\n            setTimeout(function () {\n                injectNowPlayingNavBarButton(button);\n            }, 500);\n        } else {\n            extraControlsBar[0].append(button);\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/uriHelper.ts",
    "content": "﻿namespace XpoMusicScript.Common.UriHelper {\n\n    export function getPwaUri(uri) {\n        if (uri === undefined || uri.trim() === \"\") {\n            return \"\";\n        }\n\n        uri = uri.replace('http://', 'https://');\n        var uriLowerCase = uri.toLowerCase();\n\n        if (uriLowerCase.startsWith(\"https://open.spotify.com\"))\n            return uri;\n\n        if (uriLowerCase.startsWith(\"spotify:\")) {\n            if (uriLowerCase.indexOf(\"spotify:artist:\") >= 0) {\n                var idx = uriLowerCase.indexOf(\"spotify:artist:\") + \"spotify:artist:\".length;\n                return \"https://open.spotify.com/artist/\" + uri.substring(idx);\n            }\n            else if (uriLowerCase.indexOf(\"spotify:album:\") >= 0) {\n                var idx = uriLowerCase.indexOf(\"spotify:album:\") + \"spotify:album:\".length;\n                return \"https://open.spotify.com/album/\" + uri.substring(idx);\n            }\n            else if (uriLowerCase.indexOf(\"spotify:playlist:\") >= 0) {\n                var idx = uriLowerCase.indexOf(\"spotify:playlist:\") + \"spotify:playlist:\".length;\n                return \"https://open.spotify.com/playlist/\" + uri.substring(idx);\n            }\n            else if (uriLowerCase.indexOf(\"spotify:track:\") >= 0) {\n                var idx = uriLowerCase.indexOf(\"spotify:track:\") + \"spotify:track:\".length;\n                return \"https://open.spotify.com/track/\" + uri.substring(idx);\n            }\n        }\n\n        return \"\";\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Common/web-player-backup.ts",
    "content": "﻿namespace XpoMusicScript.Common.WebPlayerBackup {\n\n    declare var XpoMusic: any;\n\n    export function runWebPlayerBackup() {\n        if (document.querySelectorAll(\"#main\").length > 0) {\n            XpoMusic.log(\"runWebPlayerBackup requested but #main already exists.\");\n            return;\n        }\n        XpoMusic.log(\"web-player-backup is not present in the current script version.\");\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/DarkTheme/initScript-dark.ts",
    "content": "﻿/// <reference path=\"../Common/initScript-common.ts\" />\n\nnamespace XpoMusicScript {\n\n    document.getElementsByTagName('body')[0].setAttribute('data-xpotifyTheme', 'dark');\n\n    var errors = \"\";\n\n    errors += Common.init();\n\n    if (errors.length > 0) {\n        try {\n            // @ts-ignore\n            XpoMusic.initFailed(errors);\n        }\n        catch (ex) { }\n\n        throw errors;\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/DarkTheme/tsconfig.json",
    "content": "{\n  \"compileOnSave\": true,\n  \"compilerOptions\": {\n    \"noImplicitAny\": false,\n    \"noEmitOnError\": true,\n    \"removeComments\": false,\n    \"sourceMap\": true,\n    \"module\": \"system\",\n    \"outFile\": \"../../InjectedAssets/init-dark.js\",\n    \"target\": \"es6\"\n  },\n  \"include\": [\n    \"*.ts\",\n    \"../Common/*.ts\",\n    \"../Lib/*.ts\",\n    \"../SpotifyApi/*.ts\"\n  ]\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/Lib/focus-visible.ts",
    "content": "﻿\nnamespace XpoMusicScript.Lib.FocusVisible {\n\n    export function init() {\n        /**\n         * Applies the :focus-visible polyfill at the given scope.\n         * A scope in this case is either the top-level Document or a Shadow Root.\n         *\n         * @param {(Document|ShadowRoot)} scope\n         * @see https://github.com/WICG/focus-visible\n         */\n        function applyFocusVisiblePolyfill(scope) {\n            var hadKeyboardEvent = true;\n            var hadFocusVisibleRecently = false;\n            var hadFocusVisibleRecentlyTimeout = null;\n\n            var inputTypesWhitelist = {\n                text: true,\n                search: true,\n                url: true,\n                tel: true,\n                email: true,\n                password: true,\n                number: true,\n                date: true,\n                month: true,\n                week: true,\n                time: true,\n                datetime: true,\n                'datetime-local': true\n            };\n\n            /**\n             * Helper function for legacy browsers and iframes which sometimes focus\n             * elements like document, body, and non-interactive SVG.\n             * @param {Element} el\n             */\n            function isValidFocusTarget(el) {\n                if (\n                    el &&\n                    el !== document &&\n                    el.nodeName !== 'HTML' &&\n                    el.nodeName !== 'BODY' &&\n                    'classList' in el &&\n                    'contains' in el.classList\n                ) {\n                    return true;\n                }\n                return false;\n            }\n\n            /**\n             * Computes whether the given element should automatically trigger the\n             * `focus-visible` class being added, i.e. whether it should always match\n             * `:focus-visible` when focused.\n             * @param {Element} el\n             * @return {boolean}\n             */\n            function focusTriggersKeyboardModality(el) {\n                var type = el.type;\n                var tagName = el.tagName;\n\n                if (tagName == 'INPUT' && inputTypesWhitelist[type] && !el.readOnly) {\n                    return true;\n                }\n\n                if (tagName == 'TEXTAREA' && !el.readOnly) {\n                    return true;\n                }\n\n                if (el.isContentEditable) {\n                    return true;\n                }\n\n                return false;\n            }\n\n            /**\n             * Add the `focus-visible` class to the given element if it was not added by\n             * the author.\n             * @param {Element} el\n             */\n            function addFocusVisibleClass(el) {\n                if (el.classList.contains('focus-visible')) {\n                    return;\n                }\n                el.classList.add('focus-visible');\n                el.setAttribute('data-focus-visible-added', '');\n            }\n\n            /**\n             * Remove the `focus-visible` class from the given element if it was not\n             * originally added by the author.\n             * @param {Element} el\n             */\n            function removeFocusVisibleClass(el) {\n                if (!el.hasAttribute('data-focus-visible-added')) {\n                    return;\n                }\n                el.classList.remove('focus-visible');\n                el.removeAttribute('data-focus-visible-added');\n            }\n\n            /**\n             * If the most recent user interaction was via the keyboard;\n             * and the key press did not include a meta, alt/option, or control key;\n             * then the modality is keyboard. Otherwise, the modality is not keyboard.\n             * Apply `focus-visible` to any current active element and keep track\n             * of our keyboard modality state with `hadKeyboardEvent`.\n             * @param {KeyboardEvent} e\n             */\n            function onKeyDown(e) {\n                if (e.metaKey || e.altKey || e.ctrlKey) {\n                    return;\n                }\n\n                if (isValidFocusTarget(scope.activeElement)) {\n                    addFocusVisibleClass(scope.activeElement);\n                }\n\n                hadKeyboardEvent = true;\n            }\n\n            /**\n             * If at any point a user clicks with a pointing device, ensure that we change\n             * the modality away from keyboard.\n             * This avoids the situation where a user presses a key on an already focused\n             * element, and then clicks on a different element, focusing it with a\n             * pointing device, while we still think we're in keyboard modality.\n             * @param {Event} e\n             */\n            function onPointerDown(e) {\n                hadKeyboardEvent = false;\n            }\n\n            /**\n             * On `focus`, add the `focus-visible` class to the target if:\n             * - the target received focus as a result of keyboard navigation, or\n             * - the event target is an element that will likely require interaction\n             *   via the keyboard (e.g. a text box)\n             * @param {Event} e\n             */\n            function onFocus(e) {\n                // Prevent IE from focusing the document or HTML element.\n                if (!isValidFocusTarget(e.target)) {\n                    return;\n                }\n\n                if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n                    addFocusVisibleClass(e.target);\n                }\n            }\n\n            /**\n             * On `blur`, remove the `focus-visible` class from the target.\n             * @param {Event} e\n             */\n            function onBlur(e) {\n                if (!isValidFocusTarget(e.target)) {\n                    return;\n                }\n\n                if (\n                    e.target.classList.contains('focus-visible') ||\n                    e.target.hasAttribute('data-focus-visible-added')\n                ) {\n                    // To detect a tab/window switch, we look for a blur event followed\n                    // rapidly by a visibility change.\n                    // If we don't see a visibility change within 100ms, it's probably a\n                    // regular focus change.\n                    hadFocusVisibleRecently = true;\n                    window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n                    hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n                        hadFocusVisibleRecently = false;\n                        window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n                    }, 100);\n                    removeFocusVisibleClass(e.target);\n                }\n            }\n\n            /**\n             * If the user changes tabs, keep track of whether or not the previously\n             * focused element had .focus-visible.\n             * @param {Event} e\n             */\n            function onVisibilityChange(e) {\n                if (document.visibilityState == 'hidden') {\n                    // If the tab becomes active again, the browser will handle calling focus\n                    // on the element (Safari actually calls it twice).\n                    // If this tab change caused a blur on an element with focus-visible,\n                    // re-apply the class when the user switches back to the tab.\n                    if (hadFocusVisibleRecently) {\n                        hadKeyboardEvent = true;\n                    }\n                    addInitialPointerMoveListeners();\n                }\n            }\n\n            /**\n             * Add a group of listeners to detect usage of any pointing devices.\n             * These listeners will be added when the polyfill first loads, and anytime\n             * the window is blurred, so that they are active when the window regains\n             * focus.\n             */\n            function addInitialPointerMoveListeners() {\n                document.addEventListener('mousemove', onInitialPointerMove);\n                document.addEventListener('mousedown', onInitialPointerMove);\n                document.addEventListener('mouseup', onInitialPointerMove);\n                document.addEventListener('pointermove', onInitialPointerMove);\n                document.addEventListener('pointerdown', onInitialPointerMove);\n                document.addEventListener('pointerup', onInitialPointerMove);\n                document.addEventListener('touchmove', onInitialPointerMove);\n                document.addEventListener('touchstart', onInitialPointerMove);\n                document.addEventListener('touchend', onInitialPointerMove);\n            }\n\n            function removeInitialPointerMoveListeners() {\n                document.removeEventListener('mousemove', onInitialPointerMove);\n                document.removeEventListener('mousedown', onInitialPointerMove);\n                document.removeEventListener('mouseup', onInitialPointerMove);\n                document.removeEventListener('pointermove', onInitialPointerMove);\n                document.removeEventListener('pointerdown', onInitialPointerMove);\n                document.removeEventListener('pointerup', onInitialPointerMove);\n                document.removeEventListener('touchmove', onInitialPointerMove);\n                document.removeEventListener('touchstart', onInitialPointerMove);\n                document.removeEventListener('touchend', onInitialPointerMove);\n            }\n\n            /**\n             * When the polfyill first loads, assume the user is in keyboard modality.\n             * If any event is received from a pointing device (e.g. mouse, pointer,\n             * touch), turn off keyboard modality.\n             * This accounts for situations where focus enters the page from the URL bar.\n             * @param {Event} e\n             */\n            function onInitialPointerMove(e) {\n                // Work around a Safari quirk that fires a mousemove on <html> whenever the\n                // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n                if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n                    return;\n                }\n\n                hadKeyboardEvent = false;\n                removeInitialPointerMoveListeners();\n            }\n\n            // For some kinds of state, we are interested in changes at the global scope\n            // only. For example, global pointer input, global key presses and global\n            // visibility change should affect the state at every scope:\n            document.addEventListener('keydown', onKeyDown, true);\n            document.addEventListener('mousedown', onPointerDown, true);\n            document.addEventListener('pointerdown', onPointerDown, true);\n            document.addEventListener('touchstart', onPointerDown, true);\n            document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n            addInitialPointerMoveListeners();\n\n            // For focus and blur, we specifically care about state changes in the local\n            // scope. This is because focus / blur events that originate from within a\n            // shadow root are not re-dispatched from the host element if it was already\n            // the active element in its own scope:\n            scope.addEventListener('focus', onFocus, true);\n            scope.addEventListener('blur', onBlur, true);\n\n            // We detect that a node is a ShadowRoot by ensuring that it is a\n            // DocumentFragment and also has a host property. This check covers native\n            // implementation and polyfill implementation transparently. If we only cared\n            // about the native implementation, we could just check if the scope was\n            // an instance of a ShadowRoot.\n            if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n                // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n                // have a root element to add a class to. So, we add this attribute to the\n                // host element instead:\n                scope.host.setAttribute('data-js-focus-visible', '');\n            } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n                document.documentElement.classList.add('js-focus-visible');\n            }\n        }\n\n        // It is important to wrap all references to global window and document in\n        // these checks to support server-side rendering use cases\n        // @see https://github.com/WICG/focus-visible/issues/199\n        if (typeof window !== 'undefined') {\n            // Make the polyfill helper globally available. This can be used as a signal\n            // to interested libraries that wish to coordinate with the polyfill for e.g.,\n            // applying the polyfill to a shadow root:\n            // @ts-ignore\n            window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n            // Notify interested libraries of the polyfill's presence, in case the\n            // polyfill was loaded lazily:\n            var event;\n\n            try {\n                event = new CustomEvent('focus-visible-polyfill-ready');\n            } catch (error) {\n                // IE11 does not support using CustomEvent as a constructor directly:\n                event = document.createEvent('CustomEvent');\n                event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n            }\n\n            window.dispatchEvent(event);\n        }\n\n        if (typeof document !== 'undefined') {\n            // Apply the polyfill to the global document, so that no JavaScript\n            // coordination is required to use the polyfill in the top-level document:\n            applyFocusVisiblePolyfill(document);\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/Lib/vibrant.ts",
    "content": "﻿\nnamespace XpoMusicScript.Lib.Vibrant {\n\n    export function init() {\n        //@ts-ignore\n        (function e$$0(x,z,l){function h(p,b){if(!z[p]){if(!x[p]){var a=\"function\"==typeof require&&require;if(!b&&a)return a(p,!0);if(g)return g(p,!0);a=Error(\"Cannot find module '\"+p+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a;}a=z[p]={exports:{}};x[p][0].call(a.exports,function(a){var b=x[p][1][a];return h(b?b:a)},a,a.exports,e$$0,x,z,l)}return z[p].exports}for(var g=\"function\"==typeof require&&require,w=0;w<l.length;w++)h(l[w]);return h})({1:[function(A,x,z){if(!l)var l={map:function(h,g){var l={};return g?\n            //@ts-ignore\n            h.map(function(h,b){l.index=b;return g.call(l,h)}):h.slice()},naturalOrder:function(h,g){return h<g?-1:h>g?1:0},sum:function(h,g){var l={};return h.reduce(g?function(h,b,a){l.index=a;return h+g.call(l,b)}:function(h,b){return h+b},0)},max:function(h,g){return Math.max.apply(null,g?l.map(h,g):h)}};A=function(){function h(f,c,a){return(f<<2*d)+(c<<d)+a}function g(f){function c(){a.sort(f);b=!0}var a=[],b=!1;return{push:function(c){a.push(c);b=!1},peek:function(f){b||c();void 0===f&&(f=a.length-1);return a[f]},\n            //@ts-ignore\n            pop:function(){b||c();return a.pop()},size:function(){return a.length},map:function(c){return a.map(c)},debug:function(){b||c();return a}}}function w(f,c,a,b,m,e,q){this.r1=f;this.r2=c;this.g1=a;this.g2=b;this.b1=m;this.b2=e;this.histo=q}function p(){this.vboxes=new g(function(f,c){return l.naturalOrder(f.vbox.count()*f.vbox.volume(),c.vbox.count()*c.vbox.volume())})}function b(f){var c=Array(1<<3*d),a,b,m,r;f.forEach(function(f){b=f[0]>>e;m=f[1]>>e;r=f[2]>>e;a=h(b,m,r);c[a]=(c[a]||0)+1});return c}\n            function a(f,c){var a=1E6,b=0,m=1E6,d=0,q=1E6,n=0,h,k,l;f.forEach(function(c){h=c[0]>>e;k=c[1]>>e;l=c[2]>>e;h<a?a=h:h>b&&(b=h);k<m?m=k:k>d&&(d=k);l<q?q=l:l>n&&(n=l)});return new w(a,b,m,d,q,n,c)}function n(a,c){function b(a){var f=a+\"1\";a+=\"2\";var v,d,m,e;d=0;for(k=c[f];k<=c[a];k++)if(y[k]>n/2){m=c.copy();e=c.copy();v=k-c[f];d=c[a]-k;for(v=v<=d?Math.min(c[a]-1,~~(k+d/2)):Math.max(c[f],~~(k-1-v/2));!y[v];)v++;for(d=s[v];!d&&y[v-1];)d=s[--v];m[a]=v;e[f]=m[a]+1;return[m,e]}}if(c.count()){var d=c.r2-\n            //@ts-ignore\n            c.r1+1,m=c.g2-c.g1+1,e=l.max([d,m,c.b2-c.b1+1]);if(1==c.count())return[c.copy()];var n=0,y=[],s=[],k,g,t,u,p;if(e==d)for(k=c.r1;k<=c.r2;k++){u=0;for(g=c.g1;g<=c.g2;g++)for(t=c.b1;t<=c.b2;t++)p=h(k,g,t),u+=a[p]||0;n+=u;y[k]=n}else if(e==m)for(k=c.g1;k<=c.g2;k++){u=0;for(g=c.r1;g<=c.r2;g++)for(t=c.b1;t<=c.b2;t++)p=h(g,k,t),u+=a[p]||0;n+=u;y[k]=n}else for(k=c.b1;k<=c.b2;k++){u=0;for(g=c.r1;g<=c.r2;g++)for(t=c.g1;t<=c.g2;t++)p=h(g,t,k),u+=a[p]||0;n+=u;y[k]=n}y.forEach(function(a,c){s[c]=n-a});return e==\n            //@ts-ignore\n            d?b(\"r\"):e==m?b(\"g\"):b(\"b\")}}var d=5,e=8-d;w.prototype={volume:function(a){if(!this._volume||a)this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1);return this._volume},count:function(a){var c=this.histo;if(!this._count_set||a){a=0;var b,d,n;for(b=this.r1;b<=this.r2;b++)for(d=this.g1;d<=this.g2;d++)for(n=this.b1;n<=this.b2;n++)index=h(b,d,n),a+=c[index]||0;this._count=a;this._count_set=!0}return this._count},copy:function(){return new w(this.r1,this.r2,this.g1,this.g2,this.b1,\n            //@ts-ignore\n            this.b2,this.histo)},avg:function(a){var c=this.histo;if(!this._avg||a){a=0;var b=1<<8-d,n=0,e=0,g=0,q,l,s,k;for(l=this.r1;l<=this.r2;l++)for(s=this.g1;s<=this.g2;s++)for(k=this.b1;k<=this.b2;k++)q=h(l,s,k),q=c[q]||0,a+=q,n+=q*(l+0.5)*b,e+=q*(s+0.5)*b,g+=q*(k+0.5)*b;this._avg=a?[~~(n/a),~~(e/a),~~(g/a)]:[~~(b*(this.r1+this.r2+1)/2),~~(b*(this.g1+this.g2+1)/2),~~(b*(this.b1+this.b2+1)/2)]}return this._avg},contains:function(a){var c=a[0]>>e;gval=a[1]>>e;bval=a[2]>>e;return c>=this.r1&&c<=this.r2&&\n            //@ts-ignore\n            gval>=this.g1&&gval<=this.g2&&bval>=this.b1&&bval<=this.b2}};p.prototype={push:function(a){this.vboxes.push({vbox:a,color:a.avg()})},palette:function(){return this.vboxes.map(function(a){return a.color})},size:function(){return this.vboxes.size()},map:function(a){for(var c=this.vboxes,b=0;b<c.size();b++)if(c.peek(b).vbox.contains(a))return c.peek(b).color;return this.nearest(a)},nearest:function(a){for(var c=this.vboxes,b,n,d,e=0;e<c.size();e++)if(n=Math.sqrt(Math.pow(a[0]-c.peek(e).color[0],2)+Math.pow(a[1]-\n            //@ts-ignore\n            c.peek(e).color[1],2)+Math.pow(a[2]-c.peek(e).color[2],2)),n<b||void 0===b)b=n,d=c.peek(e).color;return d},forcebw:function(){var a=this.vboxes;a.sort(function(a,b){return l.naturalOrder(l.sum(a.color),l.sum(b.color))});var b=a[0].color;5>b[0]&&5>b[1]&&5>b[2]&&(a[0].color=[0,0,0]);var b=a.length-1,n=a[b].color;251<n[0]&&251<n[1]&&251<n[2]&&(a[b].color=[255,255,255])}};return{quantize:function(d,c){function e(a,b){for(var c=1,d=0,f;1E3>d;)if(f=a.pop(),f.count()){var m=n(h,f);f=m[0];m=m[1];if(!f)break;\n            //@ts-ignore\n            a.push(f);m&&(a.push(m),c++);if(c>=b)break;if(1E3<d++)break}else a.push(f),d++}if(!d.length||2>c||256<c)return!1;var h=b(d),m=0;h.forEach(function(){m++});var r=a(d,h),q=new g(function(a,b){return l.naturalOrder(a.count(),b.count())});q.push(r);e(q,0.75*c);for(r=new g(function(a,b){return l.naturalOrder(a.count()*a.volume(),b.count()*b.volume())});q.size();)r.push(q.pop());e(r,c-r.size());for(q=new p;r.size();)q.push(r.pop());return q}}}();x.exports=A.quantize},{}],2:[function(A,x,z){(function(){var l,\n            //@ts-ignore\n            h,g,w=function(b,a){return function(){return b.apply(a,arguments)}},p=[].slice;window.Swatch=h=function(){function b(a,b){this.rgb=a;this.population=b}b.prototype.hsl=void 0;b.prototype.rgb=void 0;b.prototype.population=1;b.yiq=0;b.prototype.getHsl=function(){return this.hsl?this.hsl:this.hsl=g.rgbToHsl(this.rgb[0],this.rgb[1],this.rgb[2])};b.prototype.getPopulation=function(){return this.population};b.prototype.getRgb=function(){return this.rgb};b.prototype.getHex=function(){return\"#\"+(16777216+\n            //@ts-ignore\n            (this.rgb[0]<<16)+(this.rgb[1]<<8)+this.rgb[2]).toString(16).slice(1,7)};b.prototype.getTitleTextColor=function(){this._ensureTextColors();return 200>this.yiq?\"#fff\":\"#000\"};b.prototype.getBodyTextColor=function(){this._ensureTextColors();return 150>this.yiq?\"#fff\":\"#000\"};b.prototype._ensureTextColors=function(){if(!this.yiq)return this.yiq=(299*this.rgb[0]+587*this.rgb[1]+114*this.rgb[2])/1E3};return b}();window.Vibrant=g=function(){function b(a,b,d){this.swatches=w(this.swatches,this);var e,f,\n            c,g,p,m,r,q;\"undefined\"===typeof b&&(b=64);\"undefined\"===typeof d&&(d=5);p=new l(a);r=p.getImageData().data;m=p.getPixelCount();a=[];for(g=0;g<m;)e=4*g,q=r[e+0],c=r[e+1],f=r[e+2],e=r[e+3],125<=e&&(250<q&&250<c&&250<f||a.push([q,c,f])),g+=d;this._swatches=this.quantize(a,b).vboxes.map(function(a){return function(a){return new h(a.color,a.vbox.count())}}(this));this.maxPopulation=this.findMaxPopulation;this.generateVarationColors();this.generateEmptySwatches();p.removeCanvas()}b.prototype.quantize=\n            A(\"quantize\");b.prototype._swatches=[];b.prototype.TARGET_DARK_LUMA=0.26;b.prototype.MAX_DARK_LUMA=0.45;b.prototype.MIN_LIGHT_LUMA=0.55;b.prototype.TARGET_LIGHT_LUMA=0.74;b.prototype.MIN_NORMAL_LUMA=0.3;b.prototype.TARGET_NORMAL_LUMA=0.5;b.prototype.MAX_NORMAL_LUMA=0.7;b.prototype.TARGET_MUTED_SATURATION=0.3;b.prototype.MAX_MUTED_SATURATION=0.4;b.prototype.TARGET_VIBRANT_SATURATION=1;b.prototype.MIN_VIBRANT_SATURATION=0.35;b.prototype.WEIGHT_SATURATION=3;b.prototype.WEIGHT_LUMA=6;b.prototype.WEIGHT_POPULATION=\n            1;b.prototype.VibrantSwatch=void 0;b.prototype.MutedSwatch=void 0;b.prototype.DarkVibrantSwatch=void 0;b.prototype.DarkMutedSwatch=void 0;b.prototype.LightVibrantSwatch=void 0;b.prototype.LightMutedSwatch=void 0;b.prototype.HighestPopulation=0;b.prototype.generateVarationColors=function(){this.VibrantSwatch=this.findColorVariation(this.TARGET_NORMAL_LUMA,this.MIN_NORMAL_LUMA,this.MAX_NORMAL_LUMA,this.TARGET_VIBRANT_SATURATION,this.MIN_VIBRANT_SATURATION,1);this.LightVibrantSwatch=this.findColorVariation(this.TARGET_LIGHT_LUMA,\n            this.MIN_LIGHT_LUMA,1,this.TARGET_VIBRANT_SATURATION,this.MIN_VIBRANT_SATURATION,1);this.DarkVibrantSwatch=this.findColorVariation(this.TARGET_DARK_LUMA,0,this.MAX_DARK_LUMA,this.TARGET_VIBRANT_SATURATION,this.MIN_VIBRANT_SATURATION,1);this.MutedSwatch=this.findColorVariation(this.TARGET_NORMAL_LUMA,this.MIN_NORMAL_LUMA,this.MAX_NORMAL_LUMA,this.TARGET_MUTED_SATURATION,0,this.MAX_MUTED_SATURATION);this.LightMutedSwatch=this.findColorVariation(this.TARGET_LIGHT_LUMA,this.MIN_LIGHT_LUMA,1,this.TARGET_MUTED_SATURATION,\n            0,this.MAX_MUTED_SATURATION);return this.DarkMutedSwatch=this.findColorVariation(this.TARGET_DARK_LUMA,0,this.MAX_DARK_LUMA,this.TARGET_MUTED_SATURATION,0,this.MAX_MUTED_SATURATION)};b.prototype.generateEmptySwatches=function(){var a;void 0===this.VibrantSwatch&&void 0!==this.DarkVibrantSwatch&&(a=this.DarkVibrantSwatch.getHsl(),a[2]=this.TARGET_NORMAL_LUMA,this.VibrantSwatch=new h(b.hslToRgb(a[0],a[1],a[2]),0));if(void 0===this.DarkVibrantSwatch&&void 0!==this.VibrantSwatch)return a=this.VibrantSwatch.getHsl(),\n            a[2]=this.TARGET_DARK_LUMA,this.DarkVibrantSwatch=new h(b.hslToRgb(a[0],a[1],a[2]),0)};b.prototype.findMaxPopulation=function(){var a,b,d,e,f;d=0;e=this._swatches;a=0;for(b=e.length;a<b;a++)f=e[a],d=Math.max(d,f.getPopulation());return d};b.prototype.findColorVariation=function(a,b,d,e,f,c){var g,h,m,l,q,p,s,k;l=void 0;q=0;p=this._swatches;g=0;for(h=p.length;g<h;g++)if(k=p[g],s=k.getHsl()[1],m=k.getHsl()[2],s>=f&&s<=c&&m>=b&&m<=d&&!this.isAlreadySelected(k)&&(m=this.createComparisonValue(s,e,m,a,\n            k.getPopulation(),this.HighestPopulation),void 0===l||m>q))l=k,q=m;return l};b.prototype.createComparisonValue=function(a,b,d,e,f,c){return this.weightedMean(this.invertDiff(a,b),this.WEIGHT_SATURATION,this.invertDiff(d,e),this.WEIGHT_LUMA,f/c,this.WEIGHT_POPULATION)};b.prototype.invertDiff=function(a,b){return 1-Math.abs(a-b)};b.prototype.weightedMean=function(){var a,b,d,e,f,c;f=1<=arguments.length?p.call(arguments,0):[];for(a=d=b=0;a<f.length;)e=f[a],c=f[a+1],b+=e*c,d+=c,a+=2;return b/d};b.prototype.swatches=\n            function(){return{Vibrant:this.VibrantSwatch,Muted:this.MutedSwatch,DarkVibrant:this.DarkVibrantSwatch,DarkMuted:this.DarkMutedSwatch,LightVibrant:this.LightVibrantSwatch,LightMuted:this.LightMuted}};b.prototype.isAlreadySelected=function(a){return this.VibrantSwatch===a||this.DarkVibrantSwatch===a||this.LightVibrantSwatch===a||this.MutedSwatch===a||this.DarkMutedSwatch===a||this.LightMutedSwatch===a};b.rgbToHsl=function(a,b,d){var e,f,c,g,h;a/=255;b/=255;d/=255;g=Math.max(a,b,d);h=Math.min(a,b,d);\n            //@ts-ignore\n            f=void 0;c=(g+h)/2;if(g===h)f=h=0;else{e=g-h;h=0.5<c?e/(2-g-h):e/(g+h);switch(g){case a:f=(b-d)/e+(b<d?6:0);break;case b:f=(d-a)/e+2;break;case d:f=(a-b)/e+4}f/=6}return[f,h,c]};b.hslToRgb=function(a,b,d){var e,f,c;e=f=c=void 0;e=function(a,b,c){0>c&&(c+=1);1<c&&(c-=1);return c<1/6?a+6*(b-a)*c:0.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a};0===b?c=f=e=d:(b=0.5>d?d*(1+b):d+b-d*b,d=2*d-b,c=e(d,b,a+1/3),f=e(d,b,a),e=e(d,b,a-1/3));return[255*c,255*f,255*e]};return b}();window.CanvasImage=l=function(){function b(a){this.canvas=\n            document.createElement(\"canvas\");this.context=this.canvas.getContext(\"2d\");document.body.appendChild(this.canvas);this.width=this.canvas.width=a.width;this.height=this.canvas.height=a.height;this.context.drawImage(a,0,0,this.width,this.height)}b.prototype.clear=function(){return this.context.clearRect(0,0,this.width,this.height)};b.prototype.update=function(a){return this.context.putImageData(a,0,0)};b.prototype.getPixelCount=function(){return this.width*this.height};b.prototype.getImageData=function(){return this.context.getImageData(0,\n            0,this.width,this.height)};b.prototype.removeCanvas=function(){return this.canvas.parentNode.removeChild(this.canvas)};return b}()}).call(this)},{quantize:1}]},{},[2]);\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/LightTheme/initScript-light.ts",
    "content": "﻿/// <reference path=\"../Common/initScript-common.ts\" />\n/// <reference path=\"pageOverlay.ts\" />\n\nnamespace XpoMusicScript {\n\n    document.getElementsByTagName('body')[0].setAttribute('data-xpotifyTheme', 'light');\n\n    var errors = \"\";\n\n    errors += Common.init();\n    errors += Light.PageOverlay.createPageOverlay();\n\n    if (errors.length > 0) {\n        try {\n            // @ts-ignore\n            XpoMusic.initFailed(errors);\n        }\n        catch (ex) { }\n\n        throw errors;\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/LightTheme/pageOverlay.ts",
    "content": "﻿namespace XpoMusicScript.Light.PageOverlay {\n\n    export function createPageOverlay() {\n        try {\n            var body = <HTMLElement>document.getElementsByTagName('body')[0];\n            var overlayDiv = document.createElement('div');\n            overlayDiv.classList.add(\"whole-page-overlay\");\n            body.appendChild(overlayDiv);\n        }\n        catch (ex) {\n            return \"injectOverlayFailed,\";\n        }\n        return \"\";\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/LightTheme/tsconfig.json",
    "content": "{\n  \"compileOnSave\": true,\n  \"compilerOptions\": {\n    \"noImplicitAny\": false,\n    \"noEmitOnError\": true,\n    \"removeComments\": false,\n    \"sourceMap\": true,\n    \"module\": \"system\",\n    \"outFile\": \"../../InjectedAssets/init-light.js\",\n    \"target\": \"es6\"\n  },\n  \"include\": [\n    \"*.ts\",\n    \"../Common/*.ts\",\n    \"../Lib/*.ts\",\n    \"../SpotifyApi/*.ts\"\n  ]\n}\n"
  },
  {
    "path": "XpoMusic/Scripts/SpotifyApi/apiBase.ts",
    "content": "﻿namespace XpoMusicScript.SpotifyApi {\n\n    declare var XpoMusic: any;\n    var accessToken = \"{{SPOTIFYACCESSTOKEN}}\";\n\n    export abstract class ApiBase {\n\n        protected async sendJsonRequestWithToken(uri, method, body = undefined): Promise<Response> {\n            if (accessToken.length === 0) {\n                accessToken = await XpoMusic.getNewAccessTokenAsync();\n            }\n\n            return await this.sendJsonRequestWithTokenInternal(uri, method, body, true);\n        }\n\n        private async sendJsonRequestWithTokenInternal(uri, method, body, allowRefreshingToken): Promise<Response> {\n            var response = await fetch(uri, {\n                method: method,\n                body: JSON.stringify(body),\n                headers: {\n                    'Authorization': 'Bearer ' + accessToken,\n                },\n            });\n\n            XpoMusic.log(\"SpotifyApi: \" + uri + \" (\" + method + \") -> result status = \" + response.status);\n\n            if (response.status == 401 && allowRefreshingToken) {\n                // Refresh access token and retry\n                XpoMusic.log(\"Will ask for new token.\");\n                accessToken = await XpoMusic.getNewAccessTokenAsync();\n                return await this.sendJsonRequestWithTokenInternal(uri, method, body, false);\n            }\n\n            return response;\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/SpotifyApi/library.ts",
    "content": "﻿/// <reference path=\"apiBase.ts\" />\n\nnamespace XpoMusicScript.SpotifyApi {\n    export class Library extends ApiBase {\n        public async isTrackSaved(trackId: string): Promise<boolean> {\n            return (await this.isTracksSaved([trackId]))[0];\n        }\n\n        public async isTracksSaved(trackIds: string[]): Promise<boolean[]> {\n            var output = [];\n            for (var i = 0; i < trackIds.length; i += 50) {\n                var slice = trackIds.slice(i, i + 50);\n                output = output.concat(await this.isTracksSavedInternal(slice));\n            }\n            return output;\n        }\n\n        private async isTracksSavedInternal(trackIds: string[]): Promise<boolean[]> {\n            var url = 'https://api.spotify.com/v1/me/tracks/contains?ids=' + trackIds.join(',');\n            var result = await this.sendJsonRequestWithToken(url, 'get');\n\n            var data = await result.json();\n            return data;\n        }\n\n        public async saveTrack(trackId: string): Promise<boolean> {\n            var url = \"https://api.spotify.com/v1/me/tracks?ids=\" + trackId;\n            var result = await this.sendJsonRequestWithToken(url, 'put');\n\n            return result.status >= 200 && result.status <= 299;\n        }\n\n        public async removeTrack(trackId: string): Promise<boolean> {\n            var url = \"https://api.spotify.com/v1/me/tracks?ids=\" + trackId;\n            var result = await this.sendJsonRequestWithToken(url, 'delete');\n\n            return result.status >= 200 && result.status <= 299;\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/Scripts/SpotifyApi/player.ts",
    "content": "﻿/// <reference path=\"apiBase.ts\" />\n\nnamespace XpoMusicScript.SpotifyApi {\n    export class Player extends ApiBase {\n        public async getCurrentlyPlaying(): Promise<any> {\n            var url = 'https://api.spotify.com/v1/me/player';\n            var result = await this.sendJsonRequestWithToken(url, 'get');\n\n            var data = await result.json();\n            return data;\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Album.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class Album : ApiBase\n    {\n        public async Task<Model.AlbumSimplified> GetAlbum(string albumId)\n        {\n            var result = await SendRequestWithTokenAsync($\"https://api.spotify.com/v1/albums/{albumId}\", HttpMethod.Get);\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"getalbum::\" + result.StatusCode.ToString());\n\n            return JsonConvert.DeserializeObject<Model.AlbumSimplified>(resultString);\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/ApiBase.cs",
    "content": "﻿using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.SpotifyApi.Model;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class ApiBase\n    {\n        protected static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        public Task<HttpResponseMessage> SendRequestWithTokenAsync(string url, HttpMethod httpMethod)\n        {\n            return SendRequestWithTokenAsync(url, httpMethod, new Dictionary<string, string>(), canUseRefreshToken: true);\n        }\n\n        public Task<HttpResponseMessage> SendRequestWithTokenAsync(string url, HttpMethod httpMethod, Dictionary<string, string> data)\n        {\n            return SendRequestWithTokenAsync(url, httpMethod, data, canUseRefreshToken: true);\n        }\n\n        private async Task<HttpResponseMessage> SendRequestWithTokenAsync(string url, HttpMethod httpMethod, Dictionary<string, string> data, bool canUseRefreshToken)\n        {\n            try\n            {\n                var httpClient = new HttpClient();\n\n                HttpRequestMessage msg = new HttpRequestMessage(httpMethod, url);\n                msg.Headers.Clear();\n                msg.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", TokenHelper.GetTokens().AccessToken);\n                msg.Content = new FormUrlEncodedContent(data.Select(x => x).ToList());\n\n                var response = await httpClient.SendAsync(msg);\n\n                if ((response.IsSuccessStatusCode == false) && (response.StatusCode == System.Net.HttpStatusCode.Unauthorized))\n                    throw new UnauthorizedAccessException();\n\n                if (response.IsSuccessStatusCode)\n                    logger.Info($\"{httpMethod.Method} request to {url} returned with status code {response.StatusCode}.\");\n                else\n                    logger.Warn($\"{httpMethod.Method} request to {url} returned with status code {response.StatusCode}.\");\n\n                return response;\n            }\n            catch (UnauthorizedAccessException)\n            {\n                if (!canUseRefreshToken)\n                    throw;\n\n                await TokenHelper.GetAndSaveNewTokenAsync();\n                return await SendRequestWithTokenAsync(url, httpMethod, data, false);\n            }\n        }\n\n        public Task<HttpResponseMessage> SendJsonRequestWithTokenAsync(string url, HttpMethod httpMethod, string data)\n        {\n            return SendJsonRequestWithTokenAsync(url, httpMethod, data, canUseRefreshToken: true);\n        }\n\n        private async Task<HttpResponseMessage> SendJsonRequestWithTokenAsync(string url, HttpMethod httpMethod, string data, bool canUseRefreshToken)\n        {\n            try\n            {\n                var httpClient = new HttpClient();\n\n                HttpRequestMessage msg = new HttpRequestMessage(httpMethod, url);\n                msg.Headers.Clear();\n                msg.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", TokenHelper.GetTokens().AccessToken);\n                msg.Content = new StringContent(data, Encoding.UTF8, \"application/json\");\n\n                var response = await httpClient.SendAsync(msg);\n\n                if ((response.IsSuccessStatusCode == false) && (response.StatusCode == System.Net.HttpStatusCode.Unauthorized))\n                    throw new UnauthorizedAccessException();\n\n                if (response.IsSuccessStatusCode)\n                    logger.Info($\"{httpMethod.Method} [json] request to {url} returned with status code {response.StatusCode}.\");\n                else\n                    logger.Warn($\"{httpMethod.Method} [json] request to {url} returned with status code {response.StatusCode}.\");\n\n\n                return response;\n            }\n            catch (UnauthorizedAccessException)\n            {\n                if (!canUseRefreshToken)\n                    throw;\n\n                await TokenHelper.GetAndSaveNewTokenAsync();\n                return await SendJsonRequestWithTokenAsync(url, httpMethod, data, false);\n            }\n        }\n\n        public async Task<Paging<T>> GetNextPage<T>(Paging<T> page)\n        {\n            if (!page.hasNext)\n                return null;\n\n            var result = await SendRequestWithTokenAsync(\n                page.next, HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<Paging<T>>(resultString);\n        }\n\n        public async Task<Paging<T>> GetPrevPage<T>(Paging<T> page)\n        {\n            if (!page.hasPrev)\n                return null;\n\n            var result = await SendRequestWithTokenAsync(\n                page.previous, HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<Paging<T>>(resultString);\n        }\n\n        public async Task<Paging<Model.Artist>> GetNextPage(Paging<Model.Artist> page)\n        {\n            if (!page.hasNext)\n                return null;\n\n            var result = await SendRequestWithTokenAsync(\n                page.next, HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<FollowedArtistsResponse>(resultString).artists;\n        }\n\n        public async Task<Paging<Model.Artist>> GetPrevPage(Paging<Model.Artist> page)\n        {\n            if (!page.hasPrev)\n                return null;\n\n            var result = await SendRequestWithTokenAsync(\n                page.previous, HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<FollowedArtistsResponse>(resultString).artists;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Artist.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class Artist : ApiBase\n    {\n        public async Task<Model.Artist> GetArtist(string artistId)\n        {\n            var result = await SendRequestWithTokenAsync($\"https://api.spotify.com/v1/artists/{artistId}\", HttpMethod.Get);\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"getartist::\" + result.StatusCode.ToString());\n\n            return JsonConvert.DeserializeObject<Model.Artist>(resultString);\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Authorization.cs",
    "content": "﻿using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.Classes;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public static class Authorization\n    {\n        internal static readonly string Scopes = \"user-read-recently-played playlist-read-private playlist-read-collaborative playlist-modify-private playlist-modify-public user-read-email user-library-read user-library-modify user-read-playback-state user-modify-playback-state user-read-private user-read-currently-playing user-follow-read user-follow-modify streaming user-top-read app-remote-control\";\n        internal static readonly string SpotifyLoginUri = \"https://accounts.spotify.com/\";\n        internal static readonly string FacebookLoginFinishRedirectUri = \"https://accounts.spotify.com/api/facebook/oauth/access_token\";\n        internal static readonly string RedirectUri = \"https://xpomusic.ghiasi.net/login/redirect\";\n        internal static readonly string FacebookLoginUri = \"https://www.facebook.com/login.php\";\n\n        public static string GetAuthorizationUrl(string state)\n        {\n            return \"https://accounts.spotify.com/authorize?\"\n                + $\"client_id={WebUtility.UrlEncode(Secrets.SpotifyClientId)}&\"\n                + $\"response_type=code&\"\n                + $\"redirect_uri={WebUtility.UrlEncode(RedirectUri)}&\"\n                + $\"state={WebUtility.UrlEncode(state)}&\"\n                + $\"scope={WebUtility.UrlEncode(Scopes)}&\"\n                + $\"show_dialog=false\";\n        }\n\n        public static async Task RetrieveAndSaveTokensFromAuthCode(string code)\n        {\n            var httpClient = new HttpClient();\n\n            HttpRequestMessage msg = new HttpRequestMessage(HttpMethod.Post, \"https://accounts.spotify.com/api/token\");\n            msg.Headers.Clear();\n            msg.Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] \n            {\n                new KeyValuePair<string, string>(\"grant_type\", \"authorization_code\"),\n                new KeyValuePair<string, string>(\"code\", code),\n                new KeyValuePair<string, string>(\"redirect_uri\", RedirectUri),\n                new KeyValuePair<string, string>(\"client_id\", Secrets.SpotifyClientId),\n                new KeyValuePair<string, string>(\"client_secret\", Secrets.SpotifyClientSecret),\n            });\n\n            var response = await httpClient.SendAsync(msg);\n            var responseString = await response.Content.ReadAsStringAsync();\n            var responseData = JsonConvert.DeserializeObject<Dictionary<string, object>>(responseString);\n\n            var accessToken = responseData[\"access_token\"].ToString();\n            var refreshToken = responseData[\"refresh_token\"].ToString();\n\n            TokenHelper.SaveTokens(accessToken, refreshToken);\n\n            LocalConfiguration.ApiTokenVersion = 2;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Library.cs",
    "content": "﻿using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing XpoMusic.SpotifyApi.Model;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class Library : ApiBase\n    {\n        public async Task<bool> IsTrackSaved(string trackId)\n        {\n            return (await IsTrackSaved(new[] { trackId }))[0];\n        }\n\n        public async Task<bool[]> IsTrackSaved(string[] trackIds)\n        {\n            List<bool> output = new List<bool>();\n\n            for (int i = 0; i < trackIds.Length; i += 50)\n            {\n                var slice = trackIds.Skip(i).Take(50).ToArray();\n                output.AddRange(await IsTrackSavedInternal(slice));\n            }\n\n            return output.ToArray();\n        }\n\n        private async Task<bool[]> IsTrackSavedInternal(string[] trackIds)\n        {\n            trackIds = trackIds.Where(x => x != null && x.Length > 0).ToArray();\n\n            if (trackIds.Length == 0)\n                return new bool[] { };\n\n            var result = await SendRequestWithTokenAsync(\n                \"https://api.spotify.com/v1/me/tracks/contains?\" +\n                $\"ids={string.Join(',', trackIds)}\", HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<bool[]>(resultString);\n        }\n\n        public async Task<bool> SaveTrackToLibrary(string trackId)\n        {\n            var result = await SendRequestWithTokenAsync(\n                \"https://api.spotify.com/v1/me/tracks?\" +\n                $\"ids={trackId}\", HttpMethod.Put);\n\n            return result.IsSuccessStatusCode;\n        }\n\n        public async Task<bool> RemoveTrackFromLibrary(string trackId)\n        {\n            var result = await SendRequestWithTokenAsync(\n                \"https://api.spotify.com/v1/me/tracks?\" +\n                $\"ids={trackId}\", HttpMethod.Delete);\n\n            return result.IsSuccessStatusCode;\n        }\n\n\n        public async Task<Paging<SavedAlbum>> GetAlbums(int offset, int limit = 50)\n        {\n            var result = await SendRequestWithTokenAsync(\n                $\"https://api.spotify.com/v1/me/albums?limit={limit}&offset={offset}\", HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<Paging<SavedAlbum>>(resultString);\n        }\n\n        public async Task<Paging<Model.Playlist>> GetPlaylists(int offset, int limit = 50)\n        {\n            var result = await SendRequestWithTokenAsync(\n                $\"https://api.spotify.com/v1/me/playlists?limit={limit}&offset={offset}\", HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<Paging<Model.Playlist>>(resultString);\n        }\n\n        public async Task<Paging<Model.Artist>> GetArtists(int offset, int limit = 50)\n        {\n            var result = await SendRequestWithTokenAsync(\n                $\"https://api.spotify.com/v1/me/following?type=artist&limit={limit}&offset={offset}\", HttpMethod.Get);\n\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            return JsonConvert.DeserializeObject<FollowedArtistsResponse>(resultString).artists;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/AlbumSimplified.cs",
    "content": "﻿namespace XpoMusic.SpotifyApi.Model\n{\n    public class AlbumSimplified\n    {\n        public ArtistSimplified[] artists;\n        public string href;\n        public string id;\n        public Image[] images;\n        public string name;\n        public string uri;\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Artist.cs",
    "content": "﻿namespace XpoMusic.SpotifyApi.Model\n{\n    public class Artist\n    {\n        public string href;\n        public string id;\n        public string name;\n        public string uri;\n        public Image[] images;\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/ArtistSimplified.cs",
    "content": "﻿namespace XpoMusic.SpotifyApi.Model\n{\n    public class ArtistSimplified\n    {\n        public string href;\n        public string id;\n        public string name;\n        public string uri;\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/CurrentlyPlayingContext.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class CurrentlyPlayingContext\n    {\n        public int progress_ms;\n        public bool is_playing;\n        public string currently_playing_type;\n        public Track item;\n        public Device device;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Device.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class Device\n    {\n        public string id;\n        public bool is_active;\n        public bool is_private_session;\n        public bool is_restricted;\n        public string name;\n        public string type;\n        public int? volume_percent;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Devices.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class Devices\n    {\n        public Device[] devices;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/FollowedArtistsResponse.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class FollowedArtistsResponse\n    {\n        public Paging<Artist> artists { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Image.cs",
    "content": "﻿namespace XpoMusic.SpotifyApi.Model\n{\n    public class Image\n    {\n        public string url;\n        public int? height;\n        public int? width;\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Paging.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class Paging<T>\n    {\n        public string href { get; set; }\n        public T[] items { get; set; }\n        public int limit { get; set; }\n        public int offset { get; set; }\n        public string next { get; set; }\n        public string previous { get; set; }\n        public int total { get; set; }\n        public bool hasNext => next != null;\n        public bool hasPrev => previous != null;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Playlist.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class Playlist\n    {\n        public bool collaborative;\n        public string description;\n        public string href;\n        public string id;\n        public Image[] images;\n        public string name;\n        public string uri;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/SavedAlbum.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi.Model\n{\n    public class SavedAlbum\n    {\n        public string added_at { get; set; }\n        public AlbumSimplified album { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/Model/Track.cs",
    "content": "﻿namespace XpoMusic.SpotifyApi.Model\n{\n    public class Track\n    {\n        public int duration_ms;\n        public string id;\n        public string name;\n        public ArtistSimplified[] artists;\n        public AlbumSimplified album;\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Player.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing XpoMusic.SpotifyApi.Model;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class Player : ApiBase\n    {\n        public async Task<CurrentlyPlayingContext> GetCurrentlyPlaying()\n        {\n            //AnalyticsHelper.Log(\"api:me/getplayer\");\n\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player\", HttpMethod.Get);\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/getplayer::\" + result.StatusCode.ToString());\n\n            return JsonConvert.DeserializeObject<CurrentlyPlayingContext>(resultString);\n        }\n\n        public async Task<bool> NextTrack()\n        {\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player/next\", HttpMethod.Post);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player/next::\" + result.StatusCode.ToString());\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n\n        public async Task<bool> PreviousTrack()\n        {\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player/previous\", HttpMethod.Post);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player/previous::\" + result.StatusCode.ToString());\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n\n        public async Task<bool> ResumePlaying()\n        {\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player/play\", HttpMethod.Put);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player/play::\" + result.StatusCode.ToString());\n\n            if (result.StatusCode == System.Net.HttpStatusCode.NotFound)\n            {\n                logger.Info(\"ResumePlaying api returned NotFound.\");\n\n                var resultText = await result.Content.ReadAsStringAsync();\n                if (resultText.Contains(\"NO_ACTIVE_DEVICE\"))\n                {\n                    logger.Info(\"ResumePlaying api content included NO_ACTIVE_DEVICE. The complete text was:\\n\" + resultText);\n                    logger.Info(\"Will try to mark current device as active.\");\n\n                    var devices = await GetDevices();\n                    var thisDevice = devices.devices.FirstOrDefault(x => x.name.Contains(\"Edge\") && x.name.Contains(\"Web\"));\n\n                    if (thisDevice != null)\n                    {\n                        logger.Info(\"Guessed \" + thisDevice.name + \" to be the current device. Will try to transfer playback to it.\");\n                        var transferResult = await TransferPlayback(thisDevice.id, ensurePlayback: true);\n\n                        logger.Info(\"Transfer playback to \" + thisDevice.name + \" \" + (transferResult ? \"succeded.\" : \"failed.\"));\n\n                        return transferResult;\n                    }\n                }\n            }\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n\n        public async Task<bool> Pause()\n        {\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player/pause\", HttpMethod.Put);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player/pause::\" + result.StatusCode.ToString());\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n\n        public async Task<Devices> GetDevices()\n        {\n            var result = await SendRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player/devices\", HttpMethod.Get);\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player/getdevices::\" + result.StatusCode.ToString());\n\n            return JsonConvert.DeserializeObject<Devices>(resultString);\n        }\n\n        public async Task<bool> TransferPlayback(string deviceId, bool ensurePlayback)\n        {\n            var ensurePlaybackString = ensurePlayback ? \"true\" : \"false\";\n            var data = $\"{{\\\"device_ids\\\":[\\\"{deviceId}\\\"], \\\"play\\\": \\\"{ensurePlaybackString}\\\"}}\";\n\n            var result = await SendJsonRequestWithTokenAsync(\"https://api.spotify.com/v1/me/player\", HttpMethod.Put, data);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player:transferplayback::\" + result.StatusCode.ToString());\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n\n        public async Task<bool> SetVolume(string deviceId, double volume)\n        {\n            var volume_percent = (int)Math.Round(volume * 100.0);\n\n            var result = await SendRequestWithTokenAsync($\"https://api.spotify.com/v1/me/player/volume?volume_percent={volume_percent}&device_id={deviceId}\", HttpMethod.Put);\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"me/player:setvolume::\" + result.StatusCode.ToString());\n\n            return (result.StatusCode == System.Net.HttpStatusCode.NoContent);\n        }\n    }\n}"
  },
  {
    "path": "XpoMusic/SpotifyApi/Playlist.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public class Playlist : ApiBase\n    {\n        public async Task<Model.Playlist> GetPlaylist(string playlistId)\n        {\n            var result = await SendRequestWithTokenAsync($\"https://api.spotify.com/v1/playlists/{playlistId}\", HttpMethod.Get);\n            var resultString = await result.Content.ReadAsStringAsync();\n\n            if (result.IsSuccessStatusCode == false)\n                AnalyticsHelper.Log(\"api\", \"getplaylist::\" + result.StatusCode.ToString());\n\n            return JsonConvert.DeserializeObject<Model.Playlist>(resultString);\n        }\n\n    }\n}\n"
  },
  {
    "path": "XpoMusic/SpotifyApi/TokenHelper.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing Plugin.SecureStorage;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.SpotifyApi\n{\n    public static class TokenHelper\n    {\n        const string accessTokenKey = \"accessToken\";\n        const string refreshTokenKey = \"refreshToken\";\n\n        public static async Task GetAndSaveNewTokenAsync()\n        {\n            var formContent = new FormUrlEncodedContent(new[]\n            {\n                new KeyValuePair<string, string>(\"grant_type\", \"refresh_token\"),\n                new KeyValuePair<string, string>(\"refresh_token\", GetTokens().RefreshToken),\n                new KeyValuePair<string, string>(\"client_id\", Secrets.SpotifyClientId),\n                new KeyValuePair<string, string>(\"client_secret\", Secrets.SpotifyClientSecret),\n            });\n\n            var httpClient = new HttpClient();\n            var response = await httpClient.PostAsync(\"https://accounts.spotify.com/api/token\", formContent);\n            var json = await response.Content.ReadAsStringAsync();\n            var results = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(json);\n\n            if (!results.ContainsKey(\"access_token\"))\n                throw new UnauthorizedAccessException();\n\n            var accessToken = results[\"access_token\"].ToString();\n\n            SaveTokens(accessToken, GetTokens().RefreshToken);\n        }\n\n        internal static void ClearTokens()\n        {\n            if (CrossSecureStorage.Current.HasKey(accessTokenKey))\n                CrossSecureStorage.Current.DeleteKey(accessTokenKey);\n\n            if (CrossSecureStorage.Current.HasKey(refreshTokenKey))\n                CrossSecureStorage.Current.DeleteKey(refreshTokenKey);\n        }\n\n        public static TokenResult GetTokens()\n        {\n            return new TokenResult\n            {\n                AccessToken = CrossSecureStorage.Current.GetValue(accessTokenKey) ?? \"\",\n                RefreshToken = CrossSecureStorage.Current.GetValue(refreshTokenKey) ?? \"\",\n            };\n        }\n\n        public static void SaveTokens(string newAccessToken, string newRefreshToken)\n        {\n            CrossSecureStorage.Current.SetValue(accessTokenKey, newAccessToken);\n            CrossSecureStorage.Current.SetValue(refreshTokenKey, newRefreshToken);\n        }\n\n        private static bool isLoggedHasTokensException = false;\n        public static bool HasTokens()\n        {\n            try\n            {\n                return CrossSecureStorage.Current.HasKey(accessTokenKey)\n                    && CrossSecureStorage.Current.HasKey(refreshTokenKey);\n            }\n            catch (Exception ex)\n            {\n                if (!isLoggedHasTokensException)\n                {\n                    AnalyticsHelper.Log(\"hasTokensException\", ex.Message, ex.ToString());\n                    isLoggedHasTokensException = true;\n                }\n                return false;\n            }\n        }\n\n    }\n\n    public class TokenResult\n    {\n        public string AccessToken { get; set; }\n        public string RefreshToken { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Styles/CircleButtonStyle.xaml",
    "content": "﻿<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Styles\">\n    <Style x:Key=\"CircleButtonStyle\" TargetType=\"Button\">\n        <Setter Property=\"Background\" Value=\"{ThemeResource SystemControlBackgroundBaseLowBrush}\"/>\n        <Setter Property=\"Foreground\" Value=\"{ThemeResource SystemControlForegroundBaseHighBrush}\"/>\n        <Setter Property=\"BorderBrush\" Value=\"{ThemeResource SystemControlForegroundTransparentBrush}\"/>\n        <Setter Property=\"BorderThickness\" Value=\"{ThemeResource ButtonBorderThemeThickness}\"/>\n        <Setter Property=\"Padding\" Value=\"8,4,8,4\"/>\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\"/>\n        <Setter Property=\"VerticalAlignment\" Value=\"Center\"/>\n        <Setter Property=\"FontFamily\" Value=\"{ThemeResource ContentControlThemeFontFamily}\"/>\n        <Setter Property=\"FontWeight\" Value=\"Normal\"/>\n        <Setter Property=\"FontSize\" Value=\"{ThemeResource ControlContentThemeFontSize}\"/>\n        <Setter Property=\"UseSystemFocusVisuals\" Value=\"True\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"Button\">\n                    <Grid x:Name=\"RootGrid\">\n                        <VisualStateManager.VisualStateGroups>\n                            <VisualStateGroup x:Name=\"CommonStates\">\n                                <VisualState x:Name=\"Normal\">\n                                    <Storyboard>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"Opacity\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"0\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleX)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"0.7\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleY)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"0.7\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"PointerOver\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Foreground\" Storyboard.TargetName=\"ContentPresenter\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlHighlightBaseHighBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"Opacity\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"1\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleX)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 From=\"1.3\"\n                                                                 To=\"1\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleY)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 From=\"1.3\"\n                                                                 To=\"1\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Pressed\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Stroke\" Storyboard.TargetName=\"BorderCircle\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlHighlightBaseMediumLowBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Fill\" Storyboard.TargetName=\"BorderCircle\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlBackgroundBaseMediumLowBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Foreground\" Storyboard.TargetName=\"ContentPresenter\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlHighlightBaseHighBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerDownThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleX)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"0.95\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                        <DoubleAnimation Storyboard.TargetProperty=\"(UIElement.RenderTransform).(ScaleTransform.ScaleY)\" \n                                                                 Storyboard.TargetName=\"BorderCircle\"\n                                                                 Duration=\"0:0:0.15\"\n                                                                 To=\"0.95\">\n                                            <DoubleAnimation.EasingFunction>\n                                                <ExponentialEase />\n                                            </DoubleAnimation.EasingFunction>\n                                        </DoubleAnimation>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Disabled\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Opacity\" Storyboard.TargetName=\"BorderCircle\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"0\" />\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Foreground\" Storyboard.TargetName=\"ContentPresenter\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlDisabledBaseMediumLowBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                        </VisualStateManager.VisualStateGroups>\n                        <ContentPresenter x:Name=\"ContentPresenter\" VerticalAlignment=\"Center\" AutomationProperties.AccessibilityView=\"Raw\" ContentTemplate=\"{TemplateBinding ContentTemplate}\" ContentTransitions=\"{TemplateBinding ContentTransitions}\" Content=\"{TemplateBinding Content}\" HorizontalContentAlignment=\"{TemplateBinding HorizontalContentAlignment}\" Padding=\"{TemplateBinding Padding}\" VerticalContentAlignment=\"{TemplateBinding VerticalContentAlignment}\"/>\n                        <Ellipse x:Name=\"BorderCircle\"\n                                         Fill=\"#01FFFFFF\"\n                                         RenderTransformOrigin=\"0.5, 0.5\"\n                                         Stroke=\"{ThemeResource SystemControlHighlightBaseMediumLowBrush}\" \n                                         StrokeThickness=\"1\">\n                            <Ellipse.RenderTransform>\n                                <ScaleTransform />\n                            </Ellipse.RenderTransform>\n                        </Ellipse>\n                    </Grid>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "XpoMusic/Styles/MinimalButtonStyle.xaml",
    "content": "﻿<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Styles\">\n    <Style x:Key=\"MinimalButtonStyle\" TargetType=\"Button\">\n        <Setter Property=\"Background\" Value=\"{ThemeResource SystemControlBackgroundBaseLowBrush}\"/>\n        <Setter Property=\"Foreground\" Value=\"{ThemeResource SystemControlForegroundBaseHighBrush}\"/>\n        <Setter Property=\"BorderBrush\" Value=\"{ThemeResource SystemControlForegroundTransparentBrush}\"/>\n        <Setter Property=\"BorderThickness\" Value=\"{ThemeResource ButtonBorderThemeThickness}\"/>\n        <Setter Property=\"Padding\" Value=\"8,4,8,4\"/>\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\"/>\n        <Setter Property=\"VerticalAlignment\" Value=\"Center\"/>\n        <Setter Property=\"FontFamily\" Value=\"{ThemeResource ContentControlThemeFontFamily}\"/>\n        <Setter Property=\"FontWeight\" Value=\"Normal\"/>\n        <Setter Property=\"FontSize\" Value=\"{ThemeResource ControlContentThemeFontSize}\"/>\n        <Setter Property=\"UseSystemFocusVisuals\" Value=\"True\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"Button\">\n                    <Grid x:Name=\"RootGrid\" Background=\"#01FFFFFF\">\n                        <VisualStateManager.VisualStateGroups>\n                            <VisualStateGroup x:Name=\"CommonStates\">\n                                <VisualState x:Name=\"Normal\">\n                                    <Storyboard>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"PointerOver\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Foreground\" Storyboard.TargetName=\"ContentPresenter\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlHighlightBaseMediumBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Pressed\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"Foreground\" Storyboard.TargetName=\"ContentPresenter\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SystemControlHighlightBaseMediumLowBrush}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerDownThemeAnimation Storyboard.TargetName=\"RootGrid\"/>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                        </VisualStateManager.VisualStateGroups>\n                        <ContentPresenter x:Name=\"ContentPresenter\" VerticalAlignment=\"Center\" AutomationProperties.AccessibilityView=\"Raw\" ContentTemplate=\"{TemplateBinding ContentTemplate}\" ContentTransitions=\"{TemplateBinding ContentTransitions}\" Content=\"{TemplateBinding Content}\" HorizontalContentAlignment=\"{TemplateBinding HorizontalContentAlignment}\" Padding=\"{TemplateBinding Padding}\" VerticalContentAlignment=\"{TemplateBinding VerticalContentAlignment}\"/>\n                    </Grid>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "XpoMusic/Styles/TopBarDarkButtonStyle.xaml",
    "content": "﻿<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Styles\">\n    <Style x:Key=\"TopBarDarkButtonStyle\" TargetType=\"Button\">\n        <Setter Property=\"Background\" Value=\"Transparent\" />\n        <Setter Property=\"Foreground\" Value=\"#dddddd\" />\n        <Setter Property=\"BorderBrush\" Value=\"Transparent\"/>\n        <Setter Property=\"BorderThickness\" Value=\"0\"/>\n        <Setter Property=\"Padding\" Value=\"8,4,8,5\"/>\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\"/>\n        <Setter Property=\"VerticalAlignment\" Value=\"Center\"/>\n        <Setter Property=\"FontFamily\" Value=\"{ThemeResource ContentControlThemeFontFamily}\"/>\n        <Setter Property=\"FontWeight\" Value=\"Normal\"/>\n        <Setter Property=\"FontSize\" Value=\"{ThemeResource ControlContentThemeFontSize}\"/>\n        <Setter Property=\"UseSystemFocusVisuals\" Value=\"{StaticResource UseSystemFocusVisuals}\"/>\n        <Setter Property=\"FocusVisualMargin\" Value=\"-3\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"Button\">\n                    <ContentPresenter x:Name=\"ContentPresenter\" AutomationProperties.AccessibilityView=\"Raw\" Background=\"{TemplateBinding Background}\" BorderThickness=\"{TemplateBinding BorderThickness}\" BorderBrush=\"{TemplateBinding BorderBrush}\" ContentTemplate=\"{TemplateBinding ContentTemplate}\" Content=\"{TemplateBinding Content}\" ContentTransitions=\"{TemplateBinding ContentTransitions}\" HorizontalContentAlignment=\"{TemplateBinding HorizontalContentAlignment}\" Padding=\"{TemplateBinding Padding}\" VerticalContentAlignment=\"{TemplateBinding VerticalContentAlignment}\">\n                        <VisualStateManager.VisualStateGroups>\n                            <VisualStateGroup x:Name=\"CommonStates\">\n                                <VisualState x:Name=\"Normal\">\n                                    <Storyboard>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"PointerOver\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"ContentPresenter\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"#80646464\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Pressed\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"ContentPresenter\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"#808C8C8C\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerDownThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                        </VisualStateManager.VisualStateGroups>\n                    </ContentPresenter>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "XpoMusic/Styles/TopBarLightButtonStyle.xaml",
    "content": "﻿<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Styles\">\n    <Style x:Key=\"TopBarLightButtonStyle\" TargetType=\"Button\">\n        <Setter Property=\"Background\" Value=\"Transparent\" />\n        <Setter Property=\"Foreground\" Value=\"#222222\" />\n        <Setter Property=\"BorderBrush\" Value=\"Transparent\"/>\n        <Setter Property=\"BorderThickness\" Value=\"0\"/>\n        <Setter Property=\"Padding\" Value=\"8,4,8,5\"/>\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\"/>\n        <Setter Property=\"VerticalAlignment\" Value=\"Center\"/>\n        <Setter Property=\"FontFamily\" Value=\"{ThemeResource ContentControlThemeFontFamily}\"/>\n        <Setter Property=\"FontWeight\" Value=\"Normal\"/>\n        <Setter Property=\"FontSize\" Value=\"{ThemeResource ControlContentThemeFontSize}\"/>\n        <Setter Property=\"UseSystemFocusVisuals\" Value=\"{StaticResource UseSystemFocusVisuals}\"/>\n        <Setter Property=\"FocusVisualMargin\" Value=\"-3\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"Button\">\n                    <ContentPresenter x:Name=\"ContentPresenter\" AutomationProperties.AccessibilityView=\"Raw\" Background=\"{TemplateBinding Background}\" BorderThickness=\"{TemplateBinding BorderThickness}\" BorderBrush=\"{TemplateBinding BorderBrush}\" ContentTemplate=\"{TemplateBinding ContentTemplate}\" Content=\"{TemplateBinding Content}\" ContentTransitions=\"{TemplateBinding ContentTransitions}\" HorizontalContentAlignment=\"{TemplateBinding HorizontalContentAlignment}\" Padding=\"{TemplateBinding Padding}\" VerticalContentAlignment=\"{TemplateBinding VerticalContentAlignment}\">\n                        <VisualStateManager.VisualStateGroups>\n                            <VisualStateGroup x:Name=\"CommonStates\">\n                                <VisualState x:Name=\"Normal\">\n                                    <Storyboard>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"PointerOver\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"ContentPresenter\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"#80C8C8C8\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerUpThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Pressed\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"ContentPresenter\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"#80A0A0A0\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <PointerDownThemeAnimation Storyboard.TargetName=\"ContentPresenter\"/>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                        </VisualStateManager.VisualStateGroups>\n                    </ContentPresenter>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/artistPage.scss",
    "content": "﻿\n\n\n.artist h1 {\n    opacity: 0;\n    animation: animation-entrance-artist-section-header-item 0.4s ease-out 0s forwards;\n}\n\n.artist header {\n    opacity: 0;\n    animation: animation-entrance-artist-header 0.5s ease-out 0.2s forwards;\n}\n\n.artist header h1 {\n    opacity: 0;\n    animation: animation-entrance-artist-header-content 0.5s ease-out 0.4s forwards;\n}\n\n.artist header button {\n    opacity: 0;\n    animation: animation-entrance-artist-header-content 0.5s ease-out 0.7s forwards;\n}\n\n/* Keyframes */\n@keyframes animation-entrance-artist-section-header-item {\n    0% {\n        opacity: 0;\n        transform: translateX(-24px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateX(0);\n    }\n}\n\n\n@keyframes animation-entrance-artist-header {\n    0% {\n        opacity: 0;\n        transform: translateY(-100px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n\n\n@keyframes animation-entrance-artist-header-content {\n    0% {\n        opacity: 0;\n        transform: translateY(-24px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/navbarStartup.scss",
    "content": "﻿@for $i from 1 through 3 {\n    .Root__nav-bar .navBar ul li:nth-child(#{$i}) {\n        opacity: 0;\n        animation: animation-entrance-nav-bar-item 0.4s ease #{0.5 + ($i - 1) * 0.05}s forwards;\n    }\n}\n\n.Root__nav-bar .navBar .recently-played ul li {\n    opacity: 1;\n    animation: none !important;\n}\n\n.Root__nav-bar .navBar .recently-played,\n.Root__nav-bar .navBar .Rootlist {\n    opacity: 0;\n    animation: animation-entrance-nav-bar-item 0.4s ease 0.75s forwards;\n}\n\n.NavBarFooter .navBar-item {\n    opacity: 0;\n    animation: animation-entrance-nav-bar-item 0.4s ease 0.85s forwards;\n}\n\n/* Keyframes */\n@keyframes animation-entrance-nav-bar-item {\n    0% {\n        opacity: 0;\n        transform: translateY(-12px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/nowPlayingStartup.scss",
    "content": "﻿.now-playing-bar__left {\n    opacity: 0;\n    animation: animation-entrance-now-playing-item 0.4s ease forwards;\n}\n\n.playback-bar {\n    opacity: 0;\n    animation: animation-entrance-now-playing-item 0.4s ease 0.7s forwards;\n}\n\n@for $i from 1 through 5 {\n    .player-controls__buttons > .control-button:nth-child(#{$i}),\n    .player-controls__buttons > .react-contextmenu-wrapper:nth-child(#{$i}) {\n        opacity: 0;\n        animation: animation-entrance-now-playing-item 0.4s ease #{0.6 + ($i - 1) * 0.05}s forwards;\n    }\n}\n\n@for $i from 1 through 4 {\n    .now-playing-bar__right .ExtraControls > div:nth-child(#{$i}) {\n        opacity: 0;\n        animation: animation-entrance-now-playing-item 0.4s ease #{0.9 + ($i - 1) * 0.05}s forwards;\n    }\n}\n\n/* Keyframes */\n@keyframes animation-entrance-now-playing-item {\n    0% {\n        opacity: 0;\n        transform: translateX(-12px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/pageEntrance.scss",
    "content": "﻿/* Tab/page change entrance animation */\n\n.HeaderedGrid__header,\n.container-fluid,\n.search-history {\n    animation: animation-entrance-content 0.4s ease;\n}\n\n.asideButton {\n    animation: animation-entrance-fade-in 0.4s ease;\n}\n\n.TrackListHeader__entity-long-description {\n    animation: animation-entrance-fade-in-60 0.4s ease forwards;\n}\n\n@for $i from 1 through 32 {\n    .Root__main-view section > div > div:nth-child(#{$i}) {\n        opacity: 0;\n        animation: animation-entrance-content 0.4s ease #{($i - 1) * 0.03}s forwards;\n    }\n}\n\n\n/* Keyframes */\n@keyframes animation-entrance-fade-in {\n    0% {\n        opacity: 0;\n    }\n\n    100% {\n        opacity: 1;\n    }\n}\n\n@keyframes animation-entrance-fade-in-60 {\n    0% {\n        opacity: 0;\n    }\n\n    100% {\n        opacity: .6;\n    }\n}\n\n@keyframes animation-entrance-content {\n    0%, 25% {\n        opacity: 0;\n        transform: translateY(32px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/pivotEntrance.scss",
    "content": "﻿/* Pivot item animation */\n\n.Root__main-view nav ul li {\n    opacity: 0;\n}\n\n@for $i from 1 through 12 {\n    .Root__main-view nav ul li:nth-child(#{$i}) {\n        animation: animation-entrance-pivot-item 0.4s ease #{($i - 1) * 0.05}s forwards;\n    }\n}\n\n@for $i from 1 through 12 {\n    .Root__main-view .artist nav ul li:nth-child(#{$i}) {\n        animation: animation-entrance-pivot-item 0.4s ease #{($i - 1) * 0.05 + 0.2}s forwards;\n    }\n}\n\n\n/* Keyframes */\n@keyframes animation-entrance-pivot-item {\n    0% {\n        opacity: 0;\n        transform: translateX(-16px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/searchPage.scss",
    "content": "﻿\n@for $i from 1 through 5 {\n    #searchPage section:nth-child(#{$i}) {\n        opacity: 0;\n        animation: animation-entrance-search-section 0.3s ease #{($i - 1) * 0.1}s forwards;\n    }\n}\n\n@keyframes animation-entrance-search-section {\n    0% {\n        opacity: 0;\n        transform: translateY(32px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/Animation/tracklistEntrance.scss",
    "content": "﻿/* Tracklist item animation */\n@for $i from 1 through 11 {\n    .tracklist > div:nth-child(#{$i}) .tracklist-row {\n        opacity: 0;\n        animation: animation-entrance-tracklist-item 0.4s ease #{($i - 1) * 0.03}s forwards;\n    }\n}\n@for $i from 12 through 30 {\n    .tracklist > div:nth-child(#{$i}) .tracklist-row {\n        opacity: 0;\n        animation: animation-entrance-tracklist-item 0.4s ease #{0.30 + ($i - 11) * 0.02}s forwards;\n    }\n}\n\n/* Keyframes */\n@keyframes animation-entrance-tracklist-item {\n    0% {\n        opacity: 0;\n        transform: translateX(-24px);\n    }\n\n    100% {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/adsContainer.scss",
    "content": "﻿\n.Root__main-view--has-ads > div:nth-child(3) {\n    z-index: 10000;\n}\n\n.Root__main-view--has-ads > div:nth-child(3) > div {\n    background-color: rgba(24, 24, 24, 0.6);\n    backdrop-filter: blur(30px);\n    -webkit-backdrop-filter: blur(30px);\n    border-top: 0px;\n}\n\n.AdsContainer {\n    background-color: transparent;\n    overflow: hidden;\n}\n\n.now-playing-bar__right {\n    padding-right: 8px;\n}\n\n@media (min-width: 721px) {\n    .now-playing-bar__right__inner {\n        width: 200px;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/artistPage.scss",
    "content": "﻿\n.content.artist header::before {\n    /* background: -webkit-gradient(linear,left top,left bottom,color-stop(-30%,transparent),to(#121212)); */\n    background: linear-gradient(transparent 40%, #121212);\n}\n\n.content.artist header h1 {\n    max-width: 100% !important;\n    font-weight: bolder !important;\n    text-shadow: 0 0 10px #000, 0 0 20px #000, 0 0 30px #000, 0 0 40px #000, 0 0 50px #000, 0 0 60px #000, 0 0 70px #000;\n}\n\n.Root__main-view .artist .contentSpacing > span {\n    /* Monthly listeners */\n    text-align: center;\n    color: white;\n    text-shadow: 0 0 10px #000, 0 0 20px #000, 0 0 30px #000, 0 0 40px #000, 0 0 50px #000, 0 0 60px #000, 0 0 70px #000;\n    font-weight: 500;\n}\n\n.content.artist header h1, .content.artist header .contentSpacing > div {\n    text-align: center;\n}\n\n.Root__main-view .artist .contentSpacing {\n    margin-bottom: 0 !important;\n    padding-top: 0 !important;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/backButton.scss",
    "content": "﻿\n.backButtonContainer {\n    position: fixed;\n    left: 0;\n    top: 0;\n    z-index: 10;\n    width: 46px;\n    height: 32px;\n    text-align: center;\n    cursor: default;\n}\n\n.backButtonContainer:hover {\n    background: rgba(70, 70, 70, 0.5);\n}\n\n.backButtonContainer-disabled {\n    opacity: 0.4;\n    pointer-events: none;\n    cursor: default;\n}\n\n.backButtonContainer-disabled:hover {\n    background: unset;\n}\n\n.backButtonContainer span {\n    font-family: Segoe MDL2 Assets;\n    font-size: 14px;\n    padding-top: 6px;\n    display: inline-block;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/common.scss",
    "content": "﻿@import \"general.scss\";\n@import \"adsContainer.scss\";\n@import \"backButton.scss\";\n@import \"contextMenu.scss\";\n@import \"fontStyle.scss\";\n@import \"navBar.scss\";\n@import \"nowPlayingBar.scss\";\n@import \"pivotTabStyle.scss\";\n@import \"smallWidthWindow.scss\";\n@import \"windowTitle.scss\";\n@import \"trackList.scss\";\n@import \"searchPage.scss\";\n@import \"artistPage.scss\";\n@import \"themedScrollbar.scss\";\n@import \"Animation/pageEntrance.scss\";\n@import \"Animation/pivotEntrance.scss\";\n@import \"Animation/tracklistEntrance.scss\";\n@import \"Animation/nowPlayingStartup.scss\";\n@import \"Animation/navBarStartup.scss\";\n@import \"Animation/searchPage.scss\";\n@import \"Animation/artistPage.scss\";\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/contextMenu.scss",
    "content": "﻿/* Context menu */\n.react-contextmenu {\n    border: 0;\n    border: 1px solid #505050;\n    border-radius: 0;\n    background-color: rgba(30, 30, 30, 0.7);\n}\n\n.react-contextmenu.react-contextmenu--visible {\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n    box-shadow: 0 0 20px 4px rgba(0,0,0,0.25);\n}\n\n.react-contextmenu-item {\n    color: #eeeeee;\n    opacity: 0;\n    transition: opacity ease-out .15s;\n}\n\n.react-contextmenu.react-contextmenu--visible .react-contextmenu-item {\n    opacity: 1;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/fontStyle.scss",
    "content": "﻿/* Font style changes */\n\nbody {\n    --glue-font-weight-normal: 400;\n    --glue-font-weight-bold: 500;\n    --glue-font-weight-black: 700;\n    -webkit-font-smoothing: antialiased;\n    font-family: Segoe UI,spotify-circular,spotify-circular-cyrillic,spotify-circular-arabic,spotify-circular-hebrew,Helvetica Neue,Helvetica,Arial,Hiragino Kaku Gothic Pro,Meiryo,MS Gothic,sans-serif;\n}\n\nh1 {\n    font-family: Segoe UI !important;\n    font-weight: 100 !important;\n    font-size: 40px !important;\n    line-height: 60px !important;\n}\n\n.navBar-item {\n    font-weight: var(--glue-font-weight-black);\n}\n\n.ResponsiveViewMoreButton {\n    margin-top: 10px;\n}\n\n.artist-header h1.large {\n    font-size: 72px !important;\n    font-weight: var(--glue-font-weight-black) !important;\n}\n\n.artist-header h1.medium {\n    font-size: 48px !important;\n    font-weight: var(--glue-font-weight-black) !important;\n}\n\n.view-header__header-title--xxxl {\n    font-size: 48px !important;\n    font-weight: var(--glue-font-weight-black) !important;\n}\n\n.TrackListHeader__entity-name h2 {\n    font-weight: 300;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/general.scss",
    "content": "﻿\nhtml {\n    /* \n        Color of the bounce effect of page when using touch or touchpad.\n    */\n    background-color: #181818;\n\n    /* Disable horizontal scrollbar which appears occasionally */\n    overflow-x: hidden;\n\n    /* Disable overscrolling navbar and now playing bar */\n    overflow-y: hidden;\n}\n\nbody {\n    background-color: #181818;\n\n    /* Disable zooming by pinch on touch screen or presicion touchpad */\n    -ms-content-zooming: none;\n\n    /* Disable text selection */\n    -webkit-user-select: none;\n\n    /* Disable horizontal scrollbar which appears occasionally */\n    overflow-x: hidden;\n\n    /* Disable overscrolling navbar and now playing bar */\n    overflow-y: hidden;\n}\n\n.main-view-container__content, .main-view-container__scroll-node {\n    /* Auto hide new scrollbar */\n    -ms-overflow-style: -ms-autohiding-scrollbar;\n\n    /* Don't show scrollbar when not necessary */\n    overflow-y: auto;\n}\n\n.logo {\n    display: none;\n}\n\ndiv[role=banner] {\n    min-height: 30px;\n}\n\n.Root__main-view .row .contentSpacing {\n    margin-bottom: 0 !important;\n    padding-top: 0 !important;\n}\n\n.Root__main-view .Search .contentSpacing {\n    margin-bottom: 0px !important;\n    padding-top: 20px !important;\n}\n\n.Root__main-view .view-header {\n    margin-top: -20px;\n}\n\n.Root__main-view h2 {\n    font-weight: 100;\n}\n\n.cover-art {\n    /* Fixed a bug where some images show up as inverted in Edge. */\n    filter: invert(0);\n}\n\n.NavBar__download-item {\n    display: none;\n}\n\n.navBar-item .segoe-icon, .nowPlaying-icon {\n    float: left;\n    padding: 0px 20px;\n}\n\n.navBar-link-text-with-icon-wrapper {\n    padding: 10px 0px;\n}\n\n.segoe-icon {\n    font-size: 16px;\n}\n\n@media (max-width: 720px) {\n    .segoe-icon {\n        font-size: 18px;\n    }\n}\n\n.btn {\n    font-size: 14px;\n    font-family: Segoe UI;\n    text-transform: lowercase;\n    letter-spacing: unset;\n}\n\n.btn:first-letter {\n    text-transform: uppercase;\n}\n\n.btn:not(.disabled):hover {\n    transform: scale(1);\n}\n\n.btn.btn-transparent:not(.disabled):hover {\n    opacity: 0.7;\n}\n\n/* By [artistName] padding */\n.TrackListHeader__entity-by {\n    margin-right: 4px;\n}\n\n.nowPlaying-icon {\n    width: 22px;\n    height: 22px;\n    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYCAYAAABxlTA0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAYtJREFUeF7t3D1OA0EQBWHfgIPwEziGgANCBFchdQa3WngrhoCRZhwsJZt2fdIk3l6rp1JL3kmSJEk6T8uyPOW8dee5PdZWifn+2clnH+2xtjIwzMAwA8MMDDMwzMAwA8MMDDMwzMAwA8MMDDMwzMAwA8MMDDMwzMAwA8MMDNsaOLPXOf2v0uu5aSOXLSE2Bc74/fdbv+U7HtrIZTMwzMAwA8MMDDMwzMAwA8MMDDMwzMAwA8MMDDMwzMATucdVLvLYn/XzNnJU5k8eOLP7de/u7Nvj08k9/uJy5xB40w6Y7GFgUvYwMCl7GJiUPQxMyh4GJmUPA5Oyh4FJ2cPApOxhYFL2MDApexiYlD0MTMoeBiZlDwOTsoeBZ/Ilm/5SK3sYeKbC5TJu4JkKOwxVuFzGDTxTYYehCpfLuIFnKuwwVOFyGTfwTIUdhipcLuMGnqmww1CFy2XcwDMVdhiqcLmMG3imwg5DFS6X8bMO/JJz6M5re3xUZm+7d3/OXRs5KrP/fgdJkiTpcux2X+XA1jrUxBuXAAAAAElFTkSuQmCC');\n    background-size: contain;\n    background-repeat: no-repeat;\n    opacity: 0.7;\n    transition: opacity ease-out .2s;\n}\n\n.nowPlaying-navBar-item {\n    transition: opacity .3s ease-out;\n    margin-left: 22px;\n}\n\n.nowPlaying-navBar-item:hover .nowPlaying-icon {\n    opacity: 1;\n}\n\n.nowPlaying-navBar-item-disabled {\n    opacity: 0.35;\n}\n\n.nowPlaying-navBar-item-disabled .navBar-link {\n    cursor: default;\n}\n\n.nowPlaying-navBar-item-disabled:hover .nowPlaying-icon {\n    opacity: 0.7;\n}\n\n.nowPlaying-navBar-item-disabled .navbar-link__text,\n.nowPlaying-navBar-item-disabled:hover .navbar-link__text {\n    color: #b3b3b3;\n}\n\na.focus-visible, button.focus-visible {  \n    outline-color: #555;\n    outline-style: solid;\n    outline-width: 1px;\n}\n\nli[role=button].focus-visible {\n    outline-color: #555;\n    outline-style: solid;\n    outline-width: 1px;\n    background: #333;\n}\n\na.mo-info-name.focus-visible {\n    outline-color: transparent;\n    outline-width: 0;\n    color: #222;\n    background-color: #eee;\n}\n\n.Root__main-view nav ul li a.focus-visible {\n    outline-color: #eee;\n    outline-style: solid;\n    outline-width: 2px;\n}\n\na.search-history-result.focus-visible h1, a.search-history-result.focus-visible span {\n    opacity: 1;\n    border-left: 3px solid #fff;\n    padding-left: 10px;\n}\n\n.Root__top-bar header {\n    padding-top: 60px;\n    padding-bottom: 25px;\n    /*background: rgba(30, 30, 30, 0.7);\n    backdrop-filter: blur(30px);\n    -webkit-backdrop-filter: blur(30px);\n        */\n}\n\n.xpo-top-bar-hidden {\n    display: none !important;\n}\n\n.xpo-transparent-top-bar-background {\n    /* Hide background */\n    display: none !important;\n}\n\n.Root__top-bar header > div:nth-child(2) > button:nth-child(1), .Root__top-bar header > div:nth-child(2) > button:nth-child(2) {\n    /* Hide back/forward buttons in top menu */\n    display: none !important;\n}\n\n.xpo-collection-page {\n    /* Added to .Root__main-view when on /collection/* pages */\n    padding-top: 40px;\n}\n\n.xpo-collection-page h1 {\n    display: none;\n}\n\n[aria-label='Upgrade to Premium'] {\n    display:none;\n}\n\n.main-view-container__scroll-node-child > section {\n    /* Add padding to page content because of top-bar shift */\n    padding-top: 60px !important;\n}\n\n.main-view-container__scroll-node-child #searchPage {\n    /* Add padding to page content because of top-bar shift */\n    padding-top: 80px !important;\n}\n\n.main-view-container__scroll-node-child-spacer {\n    height: 0px;\n}\n\n.Rootlist {\n    /* Navbar bottom items placement fix on short window size */\n    min-height: 0;\n    margin-bottom: 16px;\n}\n\n.NowPlayingCoverSlotExpanded__container {\n    display: none;\n}\n\n/* Recently played items */\n@media (max-height:820px) {\n    .recently-played__item-5 {\n        display: none;\n    }\n}\n\n@media (max-height:766px) {\n    .recently-played__item-4 {\n        display: none;\n    }\n}\n\n@media (max-height:717px) {\n    .recently-played__item-3 {\n        display: none;\n    }\n}\n\n@media (max-height:673px) {\n    .recently-played__item-2 {\n        display: none;\n    }\n}\n\n@media (max-height:630px) {\n    .recently-played {\n        display: none;\n    }\n}\n\n@media (max-height:660px) {\n    .Rootlist__playlists {\n        display: none;\n    }\n}\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/navBar.scss",
    "content": "﻿\n.Root__nav-bar {\n    background-color: rgba(45, 45, 45, 0.45) !important;\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n    position: relative;\n    overflow: hidden;\n    z-index: 1;\n}\n\n.navBar {\n    position: absolute;\n    bottom: 0;\n    top: 0;\n    padding-top: 36px;\n    width: 100%;\n}\n\n.main-view-container__content, .main-view-container__scroll-node {\n    /* Acrylic behind navbar in artist page */\n    margin-left: -230px;\n    padding-left: 230px;\n}\n\n.navBar-header {\n    margin-bottom: 12px;\n}\n\n@media (max-width: 720px) {\n    .Root__nav-bar .sessionInfo .UserWidget__user-link {\n        display: none;\n    }\n}\n\n.navBar-logo--size-large {\n    display: none;\n}\n\n.navBar-logo--size-small {\n    display: none;\n}\n\n.NavBarFooter {\n    margin-top: 16px;\n}\n\n@media (max-width: 720px) {\n    .navBar ul {\n        margin-bottom: 40px;\n    }\n}\n\n@media (max-height: 560px) {\n    .navBar ul {\n        margin-bottom: 10px;\n    }\n}\n\nli.navBar-item span {\n    font-weight: 500 !important;\n}\n\n.Rootlist__playlists-header {\n    font-weight: 700 !important;\n    font-size: 16px !important;\n    letter-spacing: 0 !important;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/nowPlayingBar.scss",
    "content": "﻿\n.Root__now-playing-bar {\n    background-color: transparent;\n    z-index: 10;\n}\n\n.now-playing-bar-container {\n    border: 0;\n    z-index: 10;\n}\n\n.now-playing-bar {\n    background-color: rgba(40, 40, 40, 0.6);\n    transition: background-color ease-in-out 2s;\n    z-index: 10;\n    backdrop-filter: blur(30px);\n    -webkit-backdrop-filter: blur(30px);\n}\n\n.now-playing-bar__right__inner .CompactOverlayButton {\n    margin-top: -1px;\n}\n\n.now-playing-bar__right__inner .CompactOverlayButton a {\n    transition: opacity .3s ease-out;\n}\n\n.now-playing-bar__right__inner .CompactOverlayButton-disabled a {\n    opacity: 0.35;\n}\n\n.now-playing-bar__right__inner .CompactOverlayButton-disabled .control-button:hover {\n    color: #b3b3b3;\n}\n\n/* Fluent blur behind now playing bar */\n.main-view-container {\n    margin-bottom: -90px;\n}\n\n.main-view-container__scroll-node,\n.main-view-container__scroll-node-child {\n    padding-bottom: 90px;\n}\n\n.Root__main-view--has-ads .main-view-container {\n    margin-bottom: -190px;\n}\n\n.Root__main-view--has-ads .main-view-container__scroll-node,\n.Root__main-view--has-ads .main-view-container__scroll-node-child {\n    padding-bottom: 190px;\n}\n/* END Fluent blur behind now playing bar */\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/pivotTabStyle.scss",
    "content": "﻿/* Pivot tab style */\n\n.Root__main-view nav ul li a, .Root__top-bar nav ul li a {\n    /* text-transform: lowercase !important; */\n    font-family: Segoe UI !important;\n    font-weight: 400 !important;\n    font-size: 16px !important;\n    letter-spacing: normal !important;\n    margin: 10px 12px !important;\n    background: transparent !important;\n    border-bottom: 2px transparent solid;\n    border-radius: 0;\n    padding: 0 !important;\n    width: auto !important;\n    color: white;\n    line-height: 28px !important;\n}\n\n/*\n.Root__main-view nav ul li a::first-letter {\n    text-transform: uppercase !important;\n}\n*/\n\n.Root__main-view nav ul li a[aria-current=page], .Root__top-bar nav ul li a[aria-current=page] {\n    border-bottom-color: #1DB954;\n}\n\n.Root__main-view nav ul, .Root__top-bar nav ul {\n    text-align: left !important;\n}\n\n.Root__main-view .Search__content nav ul, .Root__top-bar .Search__content nav ul {\n    margin-left: 16px;\n}\n\n.Root__main-view .artist-header nav ul, .Root__top-bar .artist-header nav ul {\n    margin-left: -12px;\n}\n\n@media (min-width: 1100px) {\n    .asideButton {\n        position: absolute;\n        right: 0;\n        top: 8px;\n    }\n\n    .Root__main-view nav ul, .Root__top-bar nav ul {\n        margin-right: 150px !important;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/searchPage.scss",
    "content": "﻿\n#searchPage h2 {\n    font-weight: 100;\n}\n\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/smallWidthWindow.scss",
    "content": "﻿/* Making UI usable for width < 720px, as UWP needs to support 500px+ */\nbody {\n    min-width: 500px;\n    min-height: 500px;\n}\n\n.now-playing-bar-container {\n    min-width: 500px;\n}\n\n@media (max-width: 720px) {\n    .now-playing-bar__center .player-controls__buttons {\n        width: 180px;\n    }\n\n    .now-playing-bar__center .playback-bar {\n        width: 214px;\n    }\n\n    .now-playing-bar__left .track-info {\n        margin-right: 4px;\n        margin-left: 8px;\n    }\n\n    .now-playing-bar__left .control-button {\n        width: 22px;\n        min-width: 22px;\n    }\n\n    .Root__main-view {\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n        width: 100%;\n    }\n\n    .Root__nav-bar {\n        width: 46px;\n    }\n\n    .Root__nav-bar .navBar-item .navbar-link__text {\n        display: none;\n    }\n\n    .sessionInfo {\n        margin-left: 7px;\n        margin-right: 0px;\n    }\n\n    .Root__nav-bar .navBar-item .icon, .UserWidget__container {\n        transform: scale(0.75);\n    }\n\n    [dir=ltr] .SearchInputBox {\n        left: 80px;\n    }\n\n    .navBar-link {\n        padding: 0 11px;\n    }\n\n    .navBar-item--with-icon-left .navBar-link-text-with-icon-wrapper,\n    .navBar-item--with-icon-right .navBar-link-text-with-icon-wrapper {\n        justify-content: initial;\n    }\n\n    .recently-played {\n        display: none;\n    }\n\n    .Rootlist__playlists {\n        display: none;\n    }\n\n    .NavBar__xpotifysettings-item {\n        padding-left: 2px;\n    }\n\n    .xpotifyWindowTitle {\n        display: none;\n    }\n}\n\n@media (max-width: 640px) {\n    .now-playing-bar__left {\n        width: 45%;\n    }\n\n    .now-playing-bar__center {\n        width: 50%;\n    }\n\n    .now-playing-bar__right {\n        width: 90px;\n        min-width: 90px;\n    }\n\n    .now-playing-bar__right__inner {\n        width: 90px;\n        min-width: 90px;\n    }\n\n    .now-playing-bar__right__inner .ExtraControls {\n        flex-wrap: wrap;\n        margin-top: 4px;\n    }\n\n    .now-playing-bar__right__inner .control-button {\n        width: 22px;\n        min-width: 22px;\n        margin-right: 2px;\n        margin-left: 2px;\n    }\n\n    .now-playing-bar__right__inner .volume-bar {\n        width: 81px;\n        margin-top: 4px;\n    }\n\n    .now-playing-bar__right__inner .CompactOverlayButton {\n        margin-right: 6px;\n    }\n\n    .now-playing-bar__right__inner .ExtraControls__connect-device-picker .connect-device-list-container {\n        right: 0;\n        bottom: 72px;\n    }\n\n    .now-playing-bar__right__inner .ExtraControls__connect-device-picker .connect-device-list-container:before {\n        width: 0;\n        height: 0;\n        bottom: 0;\n    }\n\n    .HeaderedGrid__header h1 {\n        font-size: 30px;\n    }\n\n    .HeaderedGrid__header .ResponsiveViewMoreButton {\n        padding-top: 6px;\n    }\n}\n\n@media (max-width: 820px) {\n    header.artist-header h1.large {\n        font-size: 48px !important;\n    }\n}\n\n@media (max-width: 550px) {\n    .now-playing-bar__right {\n        width: 80px;\n        min-width: 80px;\n    }\n\n    .now-playing-bar__right__inner {\n        width: 80px;\n        min-width: 80px;\n    }\n\n    .now-playing-bar__right__inner .control-button {\n        width: 22px;\n        min-width: 22px;\n        margin-right: 0px;\n        margin-left: 0px;\n    }\n\n    .now-playing-bar__right__inner .volume-bar {\n        width: 69px;\n    }\n\n    .now-playing-bar__right__inner .volume-bar .control-button {\n        margin-right: 2px;\n    }\n\n    .contentSpacing {\n        padding-left: 24px !important;\n        padding-right: 24px !important;\n    }\n}\n\n\n@media (max-width: 870px) and (min-width: 771px) {\n    .TrackListHeader {\n        width: 400px;\n    }\n}\n\n@media (max-width: 770px) {\n    .Root__main-view .TrackListHeader {\n        display: block;\n    }\n\n    .Root__main-view .TrackListHeader__body {\n        text-align: center;\n        margin-left: auto;\n        margin-right: auto;\n        width: 320px;\n    }\n\n    .Root__main-view .TrackListHeader__children {\n        margin-left: auto;\n        margin-right: auto;\n        max-width: 320px;\n        justify-content: center;\n    }\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/themedScrollbar.scss",
    "content": "﻿\n.xpo-scroll-container {\n    overflow-y: auto;\n    overflow-x: hidden;\n    -ms-overflow-style: none;\n}\n\n.xpo-extra-scrollbar-fixed {\n    position: absolute;\n    top: 0px;\n    right: 0px;\n    bottom: 0px;\n    width: 20px;\n    /*-ms-overflow-style: -ms-autohiding-scrollbar;*/\n    -ms-overflow-style: scrollbar;\n    filter: invert(1) /*brightness(1.25)*/;\n    transform: translate3d(0, 0, 0);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/trackList.scss",
    "content": "﻿\n.tracklist-top-align {\n    /* No top align, will always be middle aligned. */\n    position: relative;\n    top: 50%;\n    -webkit-transform: translateY(-50%);\n    transform: translateY(-50%);\n    margin-top: 0;\n}\n\n.tracklist-col.more > div:nth-child(1) {\n    float: left;\n}\n\n.trackListAddRemoveSongButton {\n    float: right;\n    padding: 8px;\n    margin-top: -2px;\n    animation: animation-tracklist-addremove-entrance 0.3s ease-out;\n    display: none;\n}\n\n.trackListAddRemoveSongButton:hover {\n    opacity: 0.8;\n}\n\n.tracklistSongNotExistsInLibrary .trackListAddSongButton {\n    display: block;\n}\n\n.tracklistSongExistsInLibrary .trackListRemoveSongButton {\n    display: block;\n    color: #1DB954;\n}\n\n\n/* Keyframes */\n@keyframes animation-tracklist-addremove-entrance {\n    0% {\n        opacity: 0;\n    }\n\n    100% {\n        opacity: 1;\n    }\n}\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/Common/windowTitle.scss",
    "content": "﻿/* Window title */\n.xpotifyWindowTitle {\n    position: fixed;\n    font-family: Segoe UI;\n    font-weight: 400;\n    padding-top: 5px;\n    padding-left: 54px;\n    color: white;\n    font-size: 12px;\n    pointer-events: none;\n    z-index: 100;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/DarkTheme/dark.scss",
    "content": "﻿@import \"../Common/common.scss\";\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/artistPage.scss",
    "content": "﻿\n.content.artist > div:nth-child(1) {\n    filter: invert(1);\n}\n\n.content.artist button[aria-label=Play], .content.artist button[title=Play] {\n    filter: invert(1);\n}\n\n.content.artist img {\n    filter: invert(0);\n}\n\n.Root__main-view .react-contextmenu-wrapper button {\n    filter: invert(0);\n}\n\n.content.artist header > div {\n    filter: invert(1);\n}\n\n.content.artist header::before {\n    /* background: -webkit-gradient(linear,left top,left bottom,color-stop(-30%,transparent),to(#121212)); */\n    background: linear-gradient(transparent 40%,#f2f2f2);\n}\n\n.content.artist header h1, .content.artist header .contentSpacing > div {\n    filter: invert(1);\n}\n\n.Root__main-view .artist .contentSpacing > span {\n    /* Monthly listeners */\n    filter: invert(1);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/contextMenu.scss",
    "content": "﻿.react-contextmenu.react-contextmenu--visible {\n    /* Context menu shadow should be dark in light mode as well */\n    box-shadow: 0 0 28px 4px rgba(255,255,255,0.2) !important;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/general.scss",
    "content": "﻿html {\n    /* \n        Color of the bounce effect of page when using touch or touchpad.\n    */\n    background-color: #E7E7E7;\n}\n\n#main div[data-xpoBackground] {\n    /* \n        Make background the same color as the original one, not inverted of it.\n        (As Spotify PWA chooses color based on the page that is currently open,\n        with 'invert + hueRotate' we can have almost the same color, only lightened)\n    */\n    filter: hue-rotate(180deg) brightness(0.7);\n}\n\n\n.cover-art, .artist-header, .view-header, .ConnectBar, .btn-green, .btn-fg-green,\ndiv[aria-live=polite], .control-button--active, .Root__nav-bar .sessionInfo .avatar,\n.UserWidget__link--is-active span, .AdsContainer__inner, img[src*=profilepic],\nimg[src*=p200x200], .akh8GUlQiyVVqyYbwYzyr {\n    filter: invert(1);\n}\n\n.tracklist-row--active .position, .tracklist-row--active .tracklist-duration, .tracklist-row--active .tracklist-name, .tracklist-row--active .tracklist-play-pause {\n    color: #1DB954 !important;\n    filter: invert(1);\n}\n\n.navBar-link--active:after, .RecentlyPlayedWidget__link--active:after {\n    background-color: #1DB954;\n    filter: invert(1);\n}\n\n#searchPage .react-contextmenu-wrapper button {\n    filter: invert(1);\n}\n\n.Root__main-view nav {\n    filter: invert(1);\n}\n\n.Root__main-view nav a {\n    color: black !important;\n}\n\n.media-object .media-object-hoverable.playing .cover-art-image,\n.media-object .media-object-hoverable.playing .daily-mix-decoration,\n.media-object .media-object-hoverable:focus .cover-art-image,\n.media-object .media-object-hoverable:focus .daily-mix-decoration,\n.media-object .media-object-hoverable:hover .cover-art-image,\n.media-object .media-object-hoverable:hover .daily-mix-decoration {\n    filter: brightness(.6);\n}\n\n.Search__content nav ul li a {\n    /* Fixed a bug in search page content header in white theme in Edge. */\n    color: white !important;\n}\n\n.Search__content nav ul li a::before {\n    /* Fixed a bug in search page content header in white theme in Edge. */\n    background-color: #e246ab !important;\n}\n\n.Root__main-view nav ul li a:focus {\n    outline-color: #111;\n}\n\n.Root__top-bar figure {\n    filter: invert(1);\n}\n\n.Root__main-view img {\n    filter: invert(1);\n}\n\n.Root__main-view .react-contextmenu-wrapper button {\n    filter: invert(1);\n}\n\n.Root__main-view .TrackListHeader .react-contextmenu-wrapper button {\n    filter: invert(0);\n}\n\ninput, svg[role=img] {\n    /* Search input box */\n    filter: invert(1);\n}\n\n.dialog input {\n    /* New playlist input box */\n    filter: invert(0);\n}\n\n/* Workaround for an Edge bug where Search page comes in front of now playing bar on tall screens */\n.Search, .Search__content {\n    position: initial;\n    z-index: initial;\n}\n\n/* Ad */\n.Root__main-view iframe {\n    filter: invert(1);\n}\n\n/* Error page image */\n#main .dialog img {\n    filter: invert(1);\n    transform: translate3d(0, 0, 0);\n}\n\n/* Show emojis in playlist names correctly */\n/* DISABLED BECAUSE OF EDGE FILTER RENDERING BUG */\n/*\n.RootlistItemPlaylist__text-wrapper,\n.mo-info-name,\n.TrackListHeader .mo-info-name,\n.TrackListHeader__entity-name h2 {\n    color: black;\n    filter: invert(1);\n    transform: translate3d(0, 0, 0);\n}\n*/"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/light.scss",
    "content": "﻿@import \"../Common/common.scss\";\n@import \"general.scss\";\n@import \"artistPage.scss\";\n@import \"contextMenu.scss\";\n@import \"navBar.scss\";\n@import \"nowPlayingBar.scss\";\n@import \"progressBar.scss\";\n@import \"windowTitle.scss\";\n@import \"podcastEpisodeDetails.scss\";\n@import \"searchPage.scss\";\n@import \"trackList.scss\";\n@import \"pivotTabStyle.scss\";\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/navBar.scss",
    "content": "﻿.Root__nav-bar {\n    background-color: rgba(40, 40, 40, 0.6) !important;\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n}\n\n.RootlistItem--is-active:before {\n    background-color: #E246AB;\n}\n\n.navBar-link--active:before {\n    background-color: #E246AB;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/nowPlayingBar.scss",
    "content": "﻿.now-playing-bar-container {\n    background-color: rgba(30, 33, 40, 0.65);\n}\n\n.connect-device-list-item--active .connect-device-list-item__icon,\n.connect-device-list-item--active .connect-device-list-item__info,\n.connect-device-list-content .btn-blue {\n    filter: invert(1);\n}\n\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/pivotTabStyle.scss",
    "content": "﻿.Root__main-view nav ul li a[aria-current=page], .Root__top-bar nav ul li a[aria-current=page] {\n    border-bottom-color: #E246AB;\n}\n\n.Root__main-view .artist nav ul li a[aria-current=page] {\n    border-bottom-color: #1DB954;\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/podcastEpisodeDetails.scss",
    "content": "﻿.ad6f7074db563f98f848cc3ffdbd8190\\.scss img, .ad6f7074db563f98f848cc3ffdbd8190\\.scss button {\n    filter: invert(1);\n}\n\n.ad6f7074db563f98f848cc3ffdbd8190\\.scss button._81a88e0d61622b328f181589e4074b12\\.scss {\n    filter: invert(0);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/progressBar.scss",
    "content": "﻿.progress-bar .progress-bar__fg {\n    transition-duration: 0s;\n    background-color: #b3b3b3;\n}\n\n.progress-bar--is-active .progress-bar__fg {\n    background-color: #1db954;\n    filter: invert(1);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/searchPage.scss",
    "content": "﻿\n#searchPage div[role=search] {\n    filter: invert(1);\n}\n\n#searchPage img {\n    filter: invert(1);\n}\n\n#searchPage a[href^=\"/genre\"] {\n    filter: invert(1);\n}\n\n#searchPage a[href^=\"/genre\"] img {\n    filter: invert(0);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/trackList.scss",
    "content": "﻿\n.tracklistSongExistsInLibrary .trackListRemoveSongButton {\n    color: #E246AB;\n}\n\n.tracklist-row .more {\n    filter: invert(1);\n}\n\n.TrackListHeader__actions > button {\n    filter: invert(1);\n}\n"
  },
  {
    "path": "XpoMusic/Stylesheets/LightTheme/windowTitle.scss",
    "content": "﻿\n.xpotifyWindowTitle {\n    font-weight: 300;\n}\n"
  },
  {
    "path": "XpoMusic/Themes/Generic.xaml",
    "content": "<ResourceDictionary\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:XpoMusic.Controls\">\n\n    <Style TargetType=\"local:SliderExtended\">\n        <Setter Property=\"Background\" Value=\"{ThemeResource SliderTrackFill}\"/>\n        <Setter Property=\"BorderThickness\" Value=\"{ThemeResource SliderBorderThemeThickness}\"/>\n        <Setter Property=\"Foreground\" Value=\"{ThemeResource SliderTrackValueFill}\"/>\n        <Setter Property=\"FontFamily\" Value=\"{ThemeResource ContentControlThemeFontFamily}\"/>\n        <Setter Property=\"FontSize\" Value=\"{ThemeResource ControlContentThemeFontSize}\"/>\n        <Setter Property=\"ManipulationMode\" Value=\"None\"/>\n        <Setter Property=\"UseSystemFocusVisuals\" Value=\"{StaticResource UseSystemFocusVisuals}\"/>\n        <Setter Property=\"FocusVisualMargin\" Value=\"-7,0,-7,0\"/>\n        <Setter Property=\"IsFocusEngagementEnabled\" Value=\"True\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"local:SliderExtended\">\n                    <Grid Margin=\"{TemplateBinding Padding}\">\n                        <Grid.Resources>\n                            <Style x:Key=\"SliderThumbStyle\" TargetType=\"Thumb\">\n                                <Setter Property=\"BorderThickness\" Value=\"0\"/>\n                                <Setter Property=\"Background\" Value=\"{ThemeResource SliderThumbBackground}\"/>\n                                <Setter Property=\"Template\">\n                                    <Setter.Value>\n                                        <ControlTemplate TargetType=\"Thumb\">\n                                            <Border Background=\"Transparent\" BorderThickness=\"2\" BorderBrush=\"White\" CornerRadius=\"8\" Height=\"16\" Width=\"16\"/>\n                                        </ControlTemplate>\n                                    </Setter.Value>\n                                </Setter>\n                            </Style>\n                        </Grid.Resources>\n                        <Grid.RowDefinitions>\n                            <RowDefinition Height=\"Auto\"/>\n                            <RowDefinition Height=\"*\"/>\n                        </Grid.RowDefinitions>\n                        <VisualStateManager.VisualStateGroups>\n                            <VisualStateGroup x:Name=\"CommonStates\">\n                                <VisualState x:Name=\"Normal\"/>\n                                <VisualState x:Name=\"Pressed\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"SliderContainer\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderContainerBackgroundPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillPressed}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"Disabled\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HeaderContentPresenter\" Storyboard.TargetProperty=\"Foreground\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderHeaderForegroundDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"TopTickBar\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTickBarFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"BottomTickBar\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTickBarFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"LeftTickBar\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTickBarFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"RightTickBar\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTickBarFillDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"SliderContainer\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderContainerBackgroundDisabled}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"PointerOver\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalTrackRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackFillPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalThumb\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderThumbBackgroundPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"SliderContainer\" Storyboard.TargetProperty=\"Background\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderContainerBackgroundPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalDecreaseRect\" Storyboard.TargetProperty=\"Fill\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"{ThemeResource SliderTrackValueFillPointerOver}\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                            <VisualStateGroup x:Name=\"FocusEngagementStates\">\n                                <VisualState x:Name=\"FocusDisengaged\"/>\n                                <VisualState x:Name=\"FocusEngagedHorizontal\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"SliderContainer\" Storyboard.TargetProperty=\"(Control.IsTemplateFocusTarget)\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"False\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"HorizontalThumb\" Storyboard.TargetProperty=\"(Control.IsTemplateFocusTarget)\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                                <VisualState x:Name=\"FocusEngagedVertical\">\n                                    <Storyboard>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"SliderContainer\" Storyboard.TargetProperty=\"(Control.IsTemplateFocusTarget)\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"False\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName=\"VerticalThumb\" Storyboard.TargetProperty=\"(Control.IsTemplateFocusTarget)\">\n                                            <DiscreteObjectKeyFrame KeyTime=\"0\" Value=\"True\"/>\n                                        </ObjectAnimationUsingKeyFrames>\n                                    </Storyboard>\n                                </VisualState>\n                            </VisualStateGroup>\n                        </VisualStateManager.VisualStateGroups>\n                        <ContentPresenter x:Name=\"HeaderContentPresenter\" ContentTemplate=\"{TemplateBinding HeaderTemplate}\" Content=\"{TemplateBinding Header}\" FontWeight=\"{ThemeResource SliderHeaderThemeFontWeight}\" Foreground=\"{ThemeResource SliderHeaderForeground}\" Margin=\"{StaticResource SliderTopHeaderMargin}\" Grid.Row=\"0\" TextWrapping=\"Wrap\" Visibility=\"Collapsed\" x:DeferLoadStrategy=\"Lazy\"/>\n                        <Grid x:Name=\"SliderContainer\" Background=\"{ThemeResource SliderContainerBackground}\" Control.IsTemplateFocusTarget=\"True\" Grid.Row=\"1\">\n                            <Grid x:Name=\"HorizontalTemplate\" MinHeight=\"{ThemeResource SliderHorizontalHeight}\">\n                                <Grid.ColumnDefinitions>\n                                    <ColumnDefinition Width=\"Auto\"/>\n                                    <ColumnDefinition Width=\"Auto\"/>\n                                    <ColumnDefinition Width=\"*\"/>\n                                </Grid.ColumnDefinitions>\n                                <Grid.RowDefinitions>\n                                    <RowDefinition Height=\"{ThemeResource SliderPreContentMargin}\"/>\n                                    <RowDefinition Height=\"Auto\"/>\n                                    <RowDefinition Height=\"{ThemeResource SliderPostContentMargin}\"/>\n                                </Grid.RowDefinitions>\n                                <Rectangle x:Name=\"HorizontalTrackRect\" Grid.ColumnSpan=\"3\" Fill=\"{TemplateBinding Background}\" Height=\"{ThemeResource SliderTrackThemeHeight}\" Grid.Row=\"1\"/>\n                                <Rectangle x:Name=\"HorizontalDecreaseRect\" Fill=\"{TemplateBinding Foreground}\" Grid.Row=\"1\"/>\n                                <TickBar x:Name=\"TopTickBar\" Grid.ColumnSpan=\"3\" Fill=\"{ThemeResource SliderTickBarFill}\" Height=\"{ThemeResource SliderOutsideTickBarThemeHeight}\" Margin=\"0,0,0,4\" VerticalAlignment=\"Bottom\" Visibility=\"Collapsed\"/>\n                                <TickBar x:Name=\"HorizontalInlineTickBar\" Grid.ColumnSpan=\"3\" Fill=\"{ThemeResource SliderInlineTickBarFill}\" Height=\"{ThemeResource SliderTrackThemeHeight}\" Grid.Row=\"1\" Visibility=\"Collapsed\"/>\n                                <TickBar x:Name=\"BottomTickBar\" Grid.ColumnSpan=\"3\" Fill=\"{ThemeResource SliderTickBarFill}\" Height=\"{ThemeResource SliderOutsideTickBarThemeHeight}\" Margin=\"0,4,0,0\" Grid.Row=\"2\" VerticalAlignment=\"Top\" Visibility=\"Collapsed\"/>\n                                <Thumb x:Name=\"HorizontalThumb\" AutomationProperties.AccessibilityView=\"Raw\" Grid.Column=\"1\" DataContext=\"{TemplateBinding Value}\" FocusVisualMargin=\"-14,-6,-14,-6\" Height=\"16\" Grid.RowSpan=\"3\" Grid.Row=\"0\" Style=\"{StaticResource SliderThumbStyle}\" Width=\"16\"/>\n                            </Grid>\n                            <Grid x:Name=\"VerticalTemplate\" MinWidth=\"{ThemeResource SliderVerticalWidth}\" Visibility=\"Collapsed\">\n                                <Grid.ColumnDefinitions>\n                                    <ColumnDefinition Width=\"{ThemeResource SliderPreContentMargin}\"/>\n                                    <ColumnDefinition Width=\"Auto\"/>\n                                    <ColumnDefinition Width=\"{ThemeResource SliderPostContentMargin}\"/>\n                                </Grid.ColumnDefinitions>\n                                <Grid.RowDefinitions>\n                                    <RowDefinition Height=\"*\"/>\n                                    <RowDefinition Height=\"Auto\"/>\n                                    <RowDefinition Height=\"Auto\"/>\n                                </Grid.RowDefinitions>\n                                <Rectangle x:Name=\"VerticalTrackRect\" Grid.Column=\"1\" Fill=\"{TemplateBinding Background}\" Grid.RowSpan=\"3\" Width=\"{ThemeResource SliderTrackThemeHeight}\"/>\n                                <Rectangle x:Name=\"VerticalDecreaseRect\" Grid.Column=\"1\" Fill=\"{TemplateBinding Foreground}\" Grid.Row=\"2\"/>\n                                <TickBar x:Name=\"LeftTickBar\" Fill=\"{ThemeResource SliderTickBarFill}\" HorizontalAlignment=\"Right\" Margin=\"0,0,4,0\" Grid.RowSpan=\"3\" Visibility=\"Collapsed\" Width=\"{ThemeResource SliderOutsideTickBarThemeHeight}\"/>\n                                <TickBar x:Name=\"VerticalInlineTickBar\" Grid.Column=\"1\" Fill=\"{ThemeResource SliderInlineTickBarFill}\" Grid.RowSpan=\"3\" Visibility=\"Collapsed\" Width=\"{ThemeResource SliderTrackThemeHeight}\"/>\n                                <TickBar x:Name=\"RightTickBar\" Grid.Column=\"2\" Fill=\"{ThemeResource SliderTickBarFill}\" HorizontalAlignment=\"Left\" Margin=\"4,0,0,0\" Grid.RowSpan=\"3\" Visibility=\"Collapsed\" Width=\"{ThemeResource SliderOutsideTickBarThemeHeight}\"/>\n                                <Thumb x:Name=\"VerticalThumb\" AutomationProperties.AccessibilityView=\"Raw\" Grid.ColumnSpan=\"3\" Grid.Column=\"0\" DataContext=\"{TemplateBinding Value}\" FocusVisualMargin=\"-6,-14,-6,-14\" Height=\"8\" Grid.Row=\"1\" Style=\"{StaticResource SliderThumbStyle}\" Width=\"24\"/>\n                            </Grid>\n                        </Grid>\n                    </Grid>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>\n"
  },
  {
    "path": "XpoMusic/ViewModels/MainPageViewModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.ViewManagement;\n\nnamespace XpoMusic.ViewModels\n{\n    public class MainPageViewModel : ViewModelBase\n    {\n        private double topBarButtonWidth;\n        public double TopBarButtonWidth\n        {\n            get => topBarButtonWidth;\n            set\n            {\n                topBarButtonWidth = value;\n                FirePropertyChangedEvent(nameof(TopBarButtonWidth));\n                FirePropertyChangedEvent(nameof(TopBarBehindSystemControlsAreaWidth));\n            }\n        }\n\n        private double topBarButtonHeight;\n        public double TopBarButtonHeight\n        {\n            get => topBarButtonHeight;\n            set\n            {\n                topBarButtonHeight = value;\n                FirePropertyChangedEvent(nameof(TopBarButtonHeight));\n            }\n        }\n\n        public double TopBarBehindSystemControlsAreaWidth\n        {\n            get\n            {\n                var isTabletMode = (UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Touch);\n\n                return TopBarButtonWidth * (isTabletMode ? 1.0 : 3.0);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/ViewModels/NowPlayingViewModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Media.Imaging;\nusing XpoMusic.Classes;\nusing static XpoMusic.Controls.NowPlayingView;\n\nnamespace XpoMusic.ViewModels\n{\n    public class NowPlayingViewModel : ViewModelBase\n    {\n        private NowPlayingViewMode viewMode;\n        public NowPlayingViewMode ViewMode\n        {\n            get\n            {\n                return viewMode;\n            }\n            set\n            {\n                viewMode = value;\n                FirePropertyChangedEvent(nameof(ViewMode));\n                FirePropertyChangedEvent(nameof(IsCompactOverlayViewMode));\n                FirePropertyChangedEvent(nameof(IsNormalViewMode));\n                FirePropertyChangedEvent(nameof(ShowArtistArt));\n            }\n        }\n\n        public bool IsCompactOverlayViewMode => ViewMode == NowPlayingViewMode.CompactOverlay;\n        public bool IsNormalViewMode => ViewMode == NowPlayingViewMode.Normal;\n\n        private string artistName;\n        public string ArtistName\n        {\n            get\n            {\n                return artistName;\n            }\n            set\n            {\n                if (artistName != value)\n                {\n                    artistName = value;\n                    FirePropertyChangedEvent(nameof(ArtistName));\n                }\n            }\n        }\n\n        private string albumName;\n        public string AlbumName\n        {\n            get\n            {\n                return albumName;\n            }\n            set\n            {\n                if (albumName != value)\n                {\n                    albumName = value;\n                    FirePropertyChangedEvent(nameof(AlbumName));\n                }\n            }\n        }\n\n        private string songName;\n        public string SongName\n        {\n            get\n            {\n                return songName;\n            }\n            set\n            {\n                if (songName != value)\n                {\n                    songName = value;\n                    FirePropertyChangedEvent(nameof(SongName));\n                }\n            }\n        }\n\n        private Uri backgroundArtUri;\n        public Uri BackgroundArtUri\n        {\n            get\n            {\n                return backgroundArtUri;\n            }\n            set\n            {\n                if (backgroundArtUri != value)\n                {\n                    backgroundArtUri = value;\n                    backgroundArt = (value == null) ? null : new BitmapImage(value);\n\n                    FirePropertyChangedEvent(nameof(BackgroundArtUri));\n                    FirePropertyChangedEvent(nameof(BackgroundArt));\n                }\n            }\n        }\n\n        private ImageSource backgroundArt;\n        public ImageSource BackgroundArt\n        {\n            get\n            {\n                return backgroundArt;\n            }\n        }\n\n        private Uri albumArtUri;\n        public Uri AlbumArtUri\n        {\n            get\n            {\n                return albumArtUri;\n            }\n            set\n            {\n                if (albumArtUri != value)\n                {\n                    AlbumArtContainerOpacity = 0.0;\n\n                    albumArtUri = value;\n                    albumArt = (value == null) ? null : new BitmapImage(value);\n\n                    FirePropertyChangedEvent(nameof(AlbumArtUri));\n                    FirePropertyChangedEvent(nameof(AlbumArt));\n                }\n            }\n        }\n\n        private ImageSource albumArt;\n        public ImageSource AlbumArt\n        {\n            get\n            {\n                return albumArt;\n            }\n        }\n\n        private bool isPlaying = false;\n        public bool IsPlaying\n        {\n            get\n            {\n                return isPlaying;\n            }\n            set\n            {\n                isPlaying = value;\n                FirePropertyChangedEvent(nameof(PlayButtonVisibility));\n                FirePropertyChangedEvent(nameof(PauseButtonVisibility));\n            }\n        }\n\n        public Visibility PlayButtonVisibility => IsPlaying ? Visibility.Collapsed : Visibility.Visible;\n        public Visibility PauseButtonVisibility => IsPlaying ? Visibility.Visible : Visibility.Collapsed;\n\n        private double progressBarValue = 0.0;\n        public double ProgressBarValue\n        {\n            get\n            {\n                return progressBarValue;\n            }\n            set\n            {\n                progressBarValue = value;\n\n                if (progressBarValue <= ProgressBarMaximum)\n                {\n                    FirePropertyChangedEvent(nameof(ProgressBarValue));\n                    FirePropertyChangedEvent(nameof(ProgressBarMaximum));\n                }\n            }\n        }\n\n        private double progressBarMaximum = 100.0;\n        public double ProgressBarMaximum\n        {\n            get\n            {\n                return progressBarMaximum;\n            }\n            set\n            {\n                progressBarMaximum = value;\n\n                if (ProgressBarValue <= progressBarMaximum)\n                {\n                    FirePropertyChangedEvent(nameof(ProgressBarValue));\n                    FirePropertyChangedEvent(nameof(ProgressBarMaximum));\n                }\n            }\n        }\n\n        private bool progressRingActive = false;\n        public bool ProgressRingActive\n        {\n            get\n            {\n                return progressRingActive;\n            }\n            set\n            {\n                progressRingActive = value;\n                FirePropertyChangedEvent(nameof(ProgressRingActive));\n            }\n        }\n\n        private bool prevButtonEnabled = true;\n        public bool PrevButtonEnabled\n        {\n            get\n            {\n                return prevButtonEnabled;\n            }\n            set\n            {\n                prevButtonEnabled = value;\n                FirePropertyChangedEvent(nameof(PrevButtonEnabled));\n            }\n        }\n\n        private bool nextButtonEnabled = true;\n        public bool NextButtonEnabled\n        {\n            get\n            {\n                return nextButtonEnabled;\n            }\n            set\n            {\n                nextButtonEnabled = value;\n                FirePropertyChangedEvent(nameof(NextButtonEnabled));\n            }\n        }\n\n\n        private bool playPauseButtonEnabled = true;\n        public bool PlayPauseButtonEnabled\n        {\n            get\n            {\n                return playPauseButtonEnabled;\n            }\n            set\n            {\n                playPauseButtonEnabled = value;\n                FirePropertyChangedEvent(nameof(PlayPauseButtonEnabled));\n            }\n        }\n\n        private double albumArtContainerOpacity = 0.0;\n        public double AlbumArtContainerOpacity\n        {\n            get\n            {\n                return albumArtContainerOpacity;\n            }\n            set\n            {\n                albumArtContainerOpacity = value;\n                FirePropertyChangedEvent(nameof(AlbumArtContainerOpacity));\n            }\n        }\n\n        double storyboardOffset;\n        public double StoryboardOffset\n        {\n            get => storyboardOffset;\n            set\n            {\n                storyboardOffset = value;\n                FirePropertyChangedEvent(nameof(StoryboardOffset));\n                FirePropertyChangedEvent(nameof(StoryboardOffsetNegative));\n            }\n        }\n\n        public double StoryboardOffsetNegative => -StoryboardOffset;\n\n        public bool ShowArtistArt\n        {\n            get\n            {\n                if (ViewMode == NowPlayingViewMode.CompactOverlay)\n                    return LocalConfiguration.MiniViewShowArtistArt;\n                else\n                    return LocalConfiguration.NowPlayingShowArtistArt;\n            }\n            set\n            {\n                if (ViewMode == NowPlayingViewMode.CompactOverlay)\n                    LocalConfiguration.MiniViewShowArtistArt = value;\n                else\n                    LocalConfiguration.NowPlayingShowArtistArt = value;\n\n                FirePropertyChangedEvent(nameof(ShowArtistArt));\n            }\n        }\n\n        private bool blurEnabled = false;\n        public bool BlurEnabled\n        {\n            get => blurEnabled;\n            set\n            {\n                blurEnabled = value;\n                FirePropertyChangedEvent(nameof(BlurEnabled));\n            }\n        }\n\n        public double volume = 50;\n        public double Volume\n        {\n            get => volume;\n            set\n            {\n                volume = value;\n                FirePropertyChangedEvent(nameof(Volume));\n                FirePropertyChangedEvent(nameof(VolumeIconGlyph));\n            }\n        }\n\n        public string VolumeIconGlyph\n        {\n            get\n            {\n                if (Volume > 66)\n                    return \"\\uE995\";\n                else if (Volume > 33)\n                    return \"\\uE994\";\n                else if (Volume > 0)\n                    return \"\\uE993\";\n                else\n                    return \"\\uE992\";\n            }\n        }\n\n        private bool isSavedToLibrary = false;\n        public bool IsSavedToLibrary\n        {\n            get => isSavedToLibrary;\n            set\n            {\n                isSavedToLibrary = value;\n                FirePropertyChangedEvent(nameof(IsSavedToLibrary));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/ViewModels/ProxyConfigurationViewModel.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.ViewModels\n{\n    public class ProxyConfigurationViewModel : ViewModelBase\n    {\n        private bool customProxyEnabled = LocalConfiguration.IsCustomProxyEnabled;\n        public bool IsCustomProxyEnabled\n        {\n            get => customProxyEnabled;\n            set\n            {\n                customProxyEnabled = value;\n\n                // But if true, it'll be set on Apply Settings button click.\n                if (value == false)\n                    LocalConfiguration.IsCustomProxyEnabled = false;\n\n                FirePropertyChangedEvent(nameof(IsCustomProxyEnabled));\n                FirePropertyChangedEvent(nameof(RestartNeededNoticeVisibility));\n                FirePropertyChangedEvent(nameof(ProxyConfigurationVisibility));\n                FirePropertyChangedEvent(nameof(SystemProxyNoticeVisibility));\n            }\n        }\n\n        public Visibility RestartNeededNoticeVisibility => (ProxyHelper.IsCustomProxyEverEnabledInThisSession && !IsCustomProxyEnabled) ? Visibility.Visible : Visibility.Collapsed;\n        public Visibility ProxyConfigurationVisibility => IsCustomProxyEnabled ? Visibility.Visible : Visibility.Collapsed;\n        public Visibility SystemProxyNoticeVisibility => IsCustomProxyEnabled ? Visibility.Collapsed : Visibility.Visible;\n\n        public ProxyHelper.ProxyType ProxyType { get; private set; } = LocalConfiguration.CustomProxyType;\n\n        public bool IsSocksProxy\n        {\n            get => ProxyType == ProxyHelper.ProxyType.Socks;\n            set\n            {\n                if (value)\n                {\n                    ProxyType = ProxyHelper.ProxyType.Socks;\n                }\n            }\n        }\n\n        public bool IsHttpProxy\n        {\n            get => ProxyType == ProxyHelper.ProxyType.HttpHttps;\n            set\n            {\n                if (value)\n                {\n                    ProxyType = ProxyHelper.ProxyType.HttpHttps;\n                }\n            }\n        }\n\n        private string proxyAddress = LocalConfiguration.CustomProxyAddress;\n        public string ProxyAddress\n        {\n            get => proxyAddress;\n            set\n            {\n                if (value != ProxyAddress)\n                {\n                    proxyAddress = value;\n                    FirePropertyChangedEvent(nameof(ProxyAddress));\n                }\n            }\n        }\n\n        private string proxyPort = LocalConfiguration.CustomProxyPort;\n        public string ProxyPort\n        {\n            get => proxyPort;\n            set\n            {\n                if (value != ProxyPort)\n                {\n                    proxyPort = value;\n                    FirePropertyChangedEvent(nameof(ProxyPort));\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/ViewModels/SettingsViewModel.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Classes.Model;\nusing XpoMusic.Helpers;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.ViewModels\n{\n    public class SettingsViewModel : ViewModelBase\n    {\n        public SettingsViewModel()\n        {\n            Themes = ThemeHelper.GetThemes();\n            Languages = LanguageHelper.GetLanguages();\n            LiveTileDesigns = LiveTileHelper.GetLiveTileDesigns().ToList();\n\n            CheckPrimaryTileStatus();\n        }\n\n        public async void CheckPrimaryTileStatus()\n        {\n            PinToStartLinkVisibility = (await LiveTileHelper.CanPinToStart() &&\n                !await LiveTileHelper.IsPinnedToStart()) ? Visibility.Visible : Visibility.Collapsed;\n        }\n\n        public List<Language> Languages { get; set; }\n\n        private Language selectedLanguage = LocalConfiguration.Language;\n        public Language SelectedLanguage\n        {\n            get\n            {\n                return selectedLanguage;\n            }\n            set\n            {\n                if (selectedLanguage == value)\n                    return;\n\n                selectedLanguage = value;\n                FirePropertyChangedEvent(nameof(SelectedLanguage));\n                LocalConfiguration.Language = value;\n                LanguageRestartNeededNoticeVisibility = Visibility.Visible;\n                AnalyticsHelper.Log(\"settingChange\", \"language\", value.ToString());\n            }\n        }\n\n        private Visibility languageRestartNeededNoticeVisibility = Visibility.Collapsed;\n        public Visibility LanguageRestartNeededNoticeVisibility\n        {\n            get\n            {\n                return languageRestartNeededNoticeVisibility;\n            }\n            set\n            {\n                languageRestartNeededNoticeVisibility = value;\n                FirePropertyChangedEvent(nameof(LanguageRestartNeededNoticeVisibility));\n            }\n        }\n\n        public List<Theme> Themes { get; set; }\n\n        private Theme selectedTheme = LocalConfiguration.Theme;\n        public Theme SelectedTheme\n        {\n            get\n            {\n                return selectedTheme;\n            }\n            set\n            {\n                if (selectedTheme == value)\n                    return;\n\n                selectedTheme = value;\n                FirePropertyChangedEvent(nameof(SelectedTheme));\n                LocalConfiguration.Theme = value;\n                ThemeRestartNeededNoticeVisibility = Visibility.Visible;\n                AnalyticsHelper.Log(\"settingChange\", \"theme\", value.ToString());\n            }\n        }\n\n        private Visibility themeRestartNeededNoticeVisibility = Visibility.Collapsed;\n        public Visibility ThemeRestartNeededNoticeVisibility\n        {\n            get\n            {\n                return themeRestartNeededNoticeVisibility;\n            }\n            set\n            {\n                themeRestartNeededNoticeVisibility = value;\n                FirePropertyChangedEvent(nameof(ThemeRestartNeededNoticeVisibility));\n            }\n        }\n\n        public bool OpenInMiniViewByCortana\n        {\n            get\n            {\n                return LocalConfiguration.OpenInMiniViewByCortana;\n            }\n            set\n            {\n                LocalConfiguration.OpenInMiniViewByCortana = value;\n                FirePropertyChangedEvent(nameof(OpenInMiniViewByCortana));\n                AnalyticsHelper.Log(\"settingChange\", \"openInMiniViewByCortana\", value.ToString());\n            }\n        }\n\n        public List<LiveTileHelper.LiveTileDesign> LiveTileDesigns { get; set; }\n\n        private LiveTileHelper.LiveTileDesign selectedLiveTileDesign = LocalConfiguration.LiveTileDesign;\n        public LiveTileHelper.LiveTileDesign SelectedLiveTileDesign\n        {\n            get\n            {\n                return selectedLiveTileDesign;\n            }\n            set\n            {\n                if (selectedLiveTileDesign == value)\n                    return;\n\n                selectedLiveTileDesign = value;\n                FirePropertyChangedEvent(nameof(SelectedLiveTileDesign));\n                LocalConfiguration.LiveTileDesign = value;\n                LiveTileHelper.UpdateLiveTile();\n                AnalyticsHelper.Log(\"settingChange\", \"liveTileDesign\", value.ToString());\n            }\n        }\n\n        private Visibility pinToStartLinkVisibility = Visibility.Collapsed;\n        public Visibility PinToStartLinkVisibility\n        {\n            get\n            {\n                return pinToStartLinkVisibility;\n            }\n            set\n            {\n                pinToStartLinkVisibility = value;\n                FirePropertyChangedEvent(nameof(PinToStartLinkVisibility));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/ViewModels/TopBarViewModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.UI.ViewManagement;\nusing Windows.UI.Xaml;\n\nnamespace XpoMusic.ViewModels\n{\n    public class TopBarViewModel : ViewModelBase\n    {\n        private double topBarButtonWidth;\n        public double TopBarButtonWidth\n        {\n            get => topBarButtonWidth;\n            set\n            {\n                topBarButtonWidth = value;\n                FirePropertyChangedEvent(nameof(TopBarButtonWidth));\n                FirePropertyChangedEvent(nameof(TopBarBehindSystemControlsAreaWidth));\n            }\n        }\n\n        private double topBarButtonHeight;\n        public double TopBarButtonHeight\n        {\n            get => topBarButtonHeight;\n            set\n            {\n                topBarButtonHeight = value;\n                FirePropertyChangedEvent(nameof(TopBarButtonHeight));\n            }\n        }\n\n        public double TopBarBehindSystemControlsAreaWidth\n        {\n            get\n            {\n                var isTabletMode = (UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Touch);\n\n                return TopBarButtonWidth * (isTabletMode ? 1.0 : 3.0);\n            }\n        }\n\n        private Visibility openLinkFromClipboardVisibility;\n        public Visibility OpenLinkFromClipboardVisibility\n        {\n            get\n            {\n                if (!ShowExtraButtons)\n                    return Visibility.Collapsed;\n\n                return openLinkFromClipboardVisibility;\n            }\n            set\n            {\n                openLinkFromClipboardVisibility = value;\n                FirePropertyChangedEvent(nameof(OpenLinkFromClipboardVisibility));\n            }\n        }\n\n        private bool showExtraButtons;\n        public bool ShowExtraButtons\n        {\n            get => showExtraButtons;\n            set\n            {\n                showExtraButtons = value;\n                FirePropertyChangedEvent(nameof(ShowExtraButtons));\n                FirePropertyChangedEvent(nameof(OpenLinkFromClipboardVisibility));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/ViewModels/ViewModelBase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.ViewModels\n{\n    public abstract class ViewModelBase : INotifyPropertyChanged\n    {\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        protected void FirePropertyChangedEvent(string propertyName)\n        {\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpoMusic.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <ProjectGuid>{CF732FD1-9200-423A-8BB6-1685B598A3DC}</ProjectGuid>\n    <OutputType>AppContainerExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>XpoMusic</RootNamespace>\n    <AssemblyName>XpoMusic</AssemblyName>\n    <DefaultLanguage>en-US</DefaultLanguage>\n    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>\n    <TargetPlatformVersion Condition=\" '$(TargetPlatformVersion)' == '' \">10.0.18362.0</TargetPlatformVersion>\n    <TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>\n    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>\n    <PackageCertificateKeyFile>XpoMusic_TemporaryKey.pfx</PackageCertificateKeyFile>\n    <GenerateAppInstallerFile>True</GenerateAppInstallerFile>\n    <AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>\n    <AppxBundle>Always</AppxBundle>\n    <AppxBundlePlatforms>x86</AppxBundlePlatforms>\n    <PackageCertificateThumbprint>8F18CEE4DB82F386156DD07A482E2A743846E045</PackageCertificateThumbprint>\n    <AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>\n    <AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>\n    <AppxPackageDir>C:\\Users\\Mahdi\\source\\repos\\ModernSpotifyUWP\\XpoMusic\\AppPackages\\Sideload</AppxPackageDir>\n    <AppInstallerUri>https://xpomusic.com/get/</AppInstallerUri>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|ARM'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\ARM\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>ARM</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|ARM'\">\n    <OutputPath>bin\\ARM\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>ARM</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|ARM64'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\ARM64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>ARM64</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|ARM64'\">\n    <OutputPath>bin\\ARM64\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>ARM64</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x64'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x64'\">\n    <OutputPath>bin\\x64\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <Prefer32Bit>true</Prefer32Bit>\n    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>\n  </PropertyGroup>\n  <PropertyGroup>\n    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"Classes\\Cache\\GlobalCache.cs\" />\n    <Compile Include=\"Classes\\Cache\\PlaylistStore.cs\" />\n    <Compile Include=\"Classes\\Cache\\ArtistStore.cs\" />\n    <Compile Include=\"Classes\\Cache\\AlbumStore.cs\" />\n    <Compile Include=\"Classes\\Cache\\CacheStore.cs\" />\n    <Compile Include=\"Classes\\Converters\\BooleanToVisibilityConverter.cs\" />\n    <Compile Include=\"Classes\\Model\\SongExtraInfo.cs\" />\n    <Compile Include=\"Classes\\Model\\WebResourceModifications\\WebResourceModificationRule.cs\" />\n    <Compile Include=\"Classes\\Model\\WebResourceModifications\\WebResourceModificationRuleType.cs\" />\n    <Compile Include=\"Classes\\Model\\WebResourceModifications\\WebResourceStringModificationRule.cs\" />\n    <Compile Include=\"Classes\\SemaphoreQueue.cs\" />\n    <Compile Include=\"Classes\\Cache\\SongExtraInfoStore.cs\" />\n    <Compile Include=\"Controls\\FlyoutContainer.xaml.cs\">\n      <DependentUpon>FlyoutContainer.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Controls\\SliderExtended.cs\" />\n    <Compile Include=\"Controls\\SplashScreen.xaml.cs\">\n      <DependentUpon>SplashScreen.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Controls\\TopBar.xaml.cs\">\n      <DependentUpon>TopBar.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Controls\\XpoMusicWebApp.xaml.cs\">\n      <DependentUpon>XpoMusicWebApp.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Helpers\\DeviceInfoHelper.cs\" />\n    <Compile Include=\"Helpers\\KeyboardShortcutHelper.cs\" />\n    <Compile Include=\"Helpers\\MediaControlsHelper.cs\" />\n    <Compile Include=\"Helpers\\StoryboardExtensions.cs\" />\n    <Compile Include=\"Helpers\\StuckResolveHelper.cs\" />\n    <Compile Include=\"Helpers\\WebResourceModificationHelper.cs\" />\n    <Compile Include=\"Pages\\AboutPage.xaml.cs\">\n      <DependentUpon>AboutPage.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"App.xaml.cs\">\n      <DependentUpon>App.xaml</DependentUpon>\n    </Compile>\n    <Content Include=\"Assets\\ReauthorizeForV2.html\" />\n    <Content Include=\"Assets\\TileTemplates\\LiveTileArtistArtOnly.xml\">\n      <SubType>Designer</SubType>\n    </Content>\n    <Content Include=\"Assets\\TileTemplates\\LiveTileAlbumArtOnly.xml\">\n      <SubType>Designer</SubType>\n    </Content>\n    <Content Include=\"Assets\\TileTemplates\\LiveTileAlbumAndArtistArt.xml\">\n      <SubType>Designer</SubType>\n    </Content>\n    <Compile Include=\"Classes\\AppConstants.cs\" />\n    <Compile Include=\"Classes\\Converters\\LiveTileDesignToStringConverter.cs\" />\n    <Compile Include=\"Classes\\Converters\\MillisecondsToMinSecConverter.cs\" />\n    <Compile Include=\"Classes\\Converters\\ThemeToStringConverter.cs\" />\n    <Compile Include=\"Classes\\Converters\\LanguageToStringConverter.cs\" />\n    <Compile Include=\"Classes\\Model\\AutoPlayAction.cs\" />\n    <Compile Include=\"Classes\\Model\\Language.cs\" />\n    <Compile Include=\"Classes\\Model\\LocalStoragePlayback.cs\" />\n    <Compile Include=\"Classes\\Model\\LyricsViewer\\CurrentPlayingSongInfo.cs\" />\n    <Compile Include=\"Classes\\Model\\Theme.cs\" />\n    <Compile Include=\"Classes\\PlayStatusTracker.cs\" />\n    <Compile Include=\"Controls\\ProxyConfiguration.xaml.cs\">\n      <DependentUpon>ProxyConfiguration.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Pages\\DonatePage.xaml.cs\">\n      <DependentUpon>DonatePage.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Flyouts\\DeveloperMessageFlyout.xaml.cs\">\n      <DependentUpon>DeveloperMessageFlyout.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Flyouts\\IFlyout.cs\" />\n    <Compile Include=\"Flyouts\\SettingsFlyout.xaml.cs\">\n      <DependentUpon>SettingsFlyout.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Flyouts\\WhatsNewFlyout.xaml.cs\">\n      <DependentUpon>WhatsNewFlyout.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Helpers\\AssetManager.cs\" />\n    <Compile Include=\"Helpers\\ClipboardHelper.cs\" />\n    <Compile Include=\"Helpers\\CropBitmap.cs\" />\n    <Compile Include=\"Helpers\\DeveloperMessageHelper.cs\" />\n    <Compile Include=\"Helpers\\ImageSaveHelper.cs\" />\n    <Compile Include=\"Classes\\LocalConfiguration.cs\" />\n    <Compile Include=\"Helpers\\Integration\\LyricsViewerIntegrationHelper.cs\" />\n    <Compile Include=\"Helpers\\JumpListHelper.cs\" />\n    <Compile Include=\"Helpers\\LanguageHelper.cs\" />\n    <Compile Include=\"Helpers\\LiveTileHelper.cs\" />\n    <Compile Include=\"Helpers\\PackageHelper.cs\" />\n    <Compile Include=\"Helpers\\PlaybackActionHelper.cs\" />\n    <Compile Include=\"Helpers\\ProxyHelper.cs\" />\n    <Compile Include=\"Helpers\\SongImageProvider.cs\" />\n    <Compile Include=\"Helpers\\AnalyticsHelper.cs\" />\n    <Compile Include=\"Helpers\\SpotifyShareUriHelper.cs\" />\n    <Compile Include=\"Helpers\\ThemeHelper.cs\" />\n    <Compile Include=\"Helpers\\TileHelper.cs\" />\n    <Compile Include=\"Helpers\\ToastHelper.cs\" />\n    <Compile Include=\"Helpers\\UnauthorizedHelper.cs\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\action.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\browserHistory.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\color.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\dragDrop.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\mouseWheelListener.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\playbackStuckHelper.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\themedScrollbar.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\tracklistExtended.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\web-player-backup.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Lib\\focus-visible.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\indeterminateProgressBarHandler.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\keyboardShortcutListener.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\pageTitleFinder.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\requestIntercepter.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\startupAnimation.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\statusReport.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Lib\\vibrant.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\resize.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\uriHelper.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\uiElementModifier.ts\" />\n    <Compile Include=\"Pages\\HelpPage.xaml.cs\">\n      <DependentUpon>HelpPage.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"SpotifyApi\\Library.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\FollowedArtistsResponse.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\SavedAlbum.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Paging.cs\" />\n    <Compile Include=\"ViewModels\\TopBarViewModel.cs\" />\n    <Compile Include=\"XpotifyApi\\AppConstantsApi.cs\" />\n    <Compile Include=\"XpotifyApi\\AssetUpdatesApi.cs\" />\n    <Compile Include=\"XpotifyApi\\DeveloperMessageApi.cs\" />\n    <Compile Include=\"XpotifyApi\\Model\\AssetPackage.cs\" />\n    <Compile Include=\"XpotifyApi\\Model\\AssetPackageInfo.cs\" />\n    <Compile Include=\"XpotifyApi\\Model\\DeveloperMessage.cs\" />\n    <Compile Include=\"XpotifyApi\\Model\\DeveloperMessageCollection.cs\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.altform-unplated_targetsize-24.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.altform-unplated_targetsize-24.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.altform-unplated_targetsize-24.png\" />\n    <Content Include=\"Assets\\TransparentSquare.png\" />\n    <Content Include=\"Assets\\xpotify-white.png\" />\n    <Content Include=\"Assets\\xpotify.png\" />\n    <Compile Include=\"Classes\\WebViewController.cs\" />\n    <Compile Include=\"Secrets.cs\" />\n    <Compile Include=\"Pages\\SettingsPage.xaml.cs\">\n      <DependentUpon>SettingsPage.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"SpotifyApi\\ApiBase.cs\" />\n    <Compile Include=\"SpotifyApi\\Album.cs\" />\n    <Compile Include=\"SpotifyApi\\Artist.cs\" />\n    <Compile Include=\"SpotifyApi\\Authorization.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\AlbumSimplified.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Artist.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\ArtistSimplified.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\CurrentlyPlayingContext.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Device.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Devices.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Image.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Playlist.cs\" />\n    <Compile Include=\"SpotifyApi\\Model\\Track.cs\" />\n    <Compile Include=\"SpotifyApi\\Player.cs\" />\n    <Compile Include=\"SpotifyApi\\Playlist.cs\" />\n    <Compile Include=\"SpotifyApi\\TokenHelper.cs\" />\n    <Compile Include=\"ViewModels\\NowPlayingViewModel.cs\" />\n    <Compile Include=\"ViewModels\\MainPageViewModel.cs\" />\n    <Compile Include=\"ViewModels\\ProxyConfigurationViewModel.cs\" />\n    <Compile Include=\"ViewModels\\SettingsViewModel.cs\" />\n    <Compile Include=\"ViewModels\\ViewModelBase.cs\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\LargeTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\LargeTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\LargeTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\LargeTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\LargeTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\SmallTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\SmallTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\SmallTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\SmallTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\SmallTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square150x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square150x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square150x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square150x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square150x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.altform-unplated_targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.altform-unplated_targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.altform-unplated_targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.altform-unplated_targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.targetsize-24.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Square44x44Logo.targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\StoreLogo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\StoreLogo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\StoreLogo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\StoreLogo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\StoreLogo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Wide310x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Wide310x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Wide310x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Wide310x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-black\\Wide310x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\LargeTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\LargeTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\LargeTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\LargeTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\LargeTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\SmallTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\SmallTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\SmallTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\SmallTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\SmallTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square150x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square150x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square150x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square150x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square150x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.altform-unplated_targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.altform-unplated_targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.altform-unplated_targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.altform-unplated_targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.targetsize-24.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Square44x44Logo.targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\StoreLogo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\StoreLogo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\StoreLogo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\StoreLogo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\StoreLogo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Wide310x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Wide310x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Wide310x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Wide310x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-standard\\Wide310x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\LargeTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\LargeTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\LargeTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\LargeTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\LargeTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\SmallTile.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\SmallTile.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\SmallTile.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\SmallTile.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\SmallTile.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square150x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square150x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square150x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square150x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square150x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.altform-unplated_targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.altform-unplated_targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.altform-unplated_targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.altform-unplated_targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.targetsize-16.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.targetsize-24.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.targetsize-256.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.targetsize-32.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Square44x44Logo.targetsize-48.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\StoreLogo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\StoreLogo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\StoreLogo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\StoreLogo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\StoreLogo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Wide310x150Logo.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Wide310x150Logo.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Wide310x150Logo.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Wide310x150Logo.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\contrast-white\\Wide310x150Logo.scale-400.png\" />\n    <Content Include=\"Assets\\Logo\\SplashScreen.scale-100.png\" />\n    <Content Include=\"Assets\\Logo\\SplashScreen.scale-125.png\" />\n    <Content Include=\"Assets\\Logo\\SplashScreen.scale-150.png\" />\n    <Content Include=\"Assets\\Logo\\SplashScreen.scale-200.png\" />\n    <Content Include=\"Assets\\Logo\\SplashScreen.scale-400.png\" />\n    <Content Include=\"InjectedAssets\\clearPlaybackLocalStorage.js\" />\n    <Content Include=\"InjectedAssets\\clickOnFacebookLogin.js\" />\n    <Compile Include=\"Helpers\\WhatsNewHelper.cs\" />\n    <Compile Include=\"Pages\\MainPage.xaml.cs\">\n      <DependentUpon>MainPage.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Controls\\NowPlayingView.xaml.cs\">\n      <DependentUpon>NowPlayingView.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Content Include=\"InjectedAssets\\init-dark.js\" />\n    <Content Include=\"InjectedAssets\\init-light.js\" />\n    <TypeScriptCompile Include=\"Scripts\\LightTheme\\pageOverlay.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\SpotifyApi\\apiBase.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\SpotifyApi\\player.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\SpotifyApi\\library.ts\" />\n  </ItemGroup>\n  <ItemGroup>\n    <AppxManifest Include=\"Package.appxmanifest\" Condition=\"'$(Configuration)'=='Release'\">\n      <SubType>Designer</SubType>\n    </AppxManifest>\n    <AppxManifest Include=\"Package.debug.appxmanifest\" Condition=\"'$(Configuration)'=='Debug'\">\n      <SubType>Designer</SubType>\n    </AppxManifest>\n    <None Include=\"compilerconfig.json\" />\n    <None Include=\"compilerconfig.json.defaults\">\n      <DependentUpon>compilerconfig.json</DependentUpon>\n    </None>\n    <None Include=\"InjectedAssets\\style-dark.css\" />\n    <Content Include=\"InjectedAssets\\style-dark.min.css\" />\n    <None Include=\"InjectedAssets\\style-light.css\" />\n    <Content Include=\"InjectedAssets\\style-light.min.css\" />\n    <None Include=\"Package.StoreAssociation.xml\" />\n    <Content Include=\"Scripts\\DarkTheme\\tsconfig.json\" />\n    <Content Include=\"Scripts\\LightTheme\\tsconfig.json\" />\n    <None Include=\"Stylesheets\\Common\\adsContainer.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\artistPage.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\navBarStartup.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\pageEntrance.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\pivotEntrance.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\nowPlayingStartup.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\searchPage.scss\" />\n    <None Include=\"Stylesheets\\Common\\Animation\\tracklistEntrance.scss\" />\n    <None Include=\"Stylesheets\\Common\\artistPage.scss\" />\n    <None Include=\"Stylesheets\\Common\\backButton.scss\" />\n    <None Include=\"Stylesheets\\Common\\contextMenu.scss\" />\n    <None Include=\"Stylesheets\\Common\\fontStyle.scss\" />\n    <None Include=\"Stylesheets\\Common\\general.scss\" />\n    <None Include=\"Stylesheets\\Common\\navBar.scss\" />\n    <None Include=\"Stylesheets\\Common\\nowPlayingBar.scss\" />\n    <None Include=\"Stylesheets\\Common\\pivotTabStyle.scss\" />\n    <None Include=\"Stylesheets\\Common\\searchPage.scss\" />\n    <None Include=\"Stylesheets\\Common\\smallWidthWindow.scss\" />\n    <None Include=\"Stylesheets\\Common\\themedScrollbar.scss\" />\n    <None Include=\"Stylesheets\\Common\\trackList.scss\" />\n    <None Include=\"Stylesheets\\Common\\windowTitle.scss\" />\n    <None Include=\"Stylesheets\\DarkTheme\\dark.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\artistPage.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\contextMenu.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\general.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\light.scss\" />\n    <None Include=\"Stylesheets\\Common\\common.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\navBar.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\nowPlayingBar.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\pivotTabStyle.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\podcastEpisodeDetails.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\progressBar.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\searchPage.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\trackList.scss\" />\n    <None Include=\"Stylesheets\\LightTheme\\windowTitle.scss\" />\n    <None Include=\"XpoMusic_TemporaryKey.pfx\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Assets\\Media\\silent.wav\" />\n    <Content Include=\"InjectedAssets\\isLoggedInCheck.js\" />\n    <Content Include=\"NLog.config\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Properties\\Default.rd.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"App.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </ApplicationDefinition>\n    <Page Include=\"Controls\\FlyoutContainer.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Controls\\SplashScreen.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Controls\\TopBar.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Controls\\XpoMusicWebApp.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pages\\AboutPage.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Controls\\ProxyConfiguration.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pages\\DonatePage.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Flyouts\\DeveloperMessageFlyout.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Flyouts\\SettingsFlyout.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Flyouts\\WhatsNewFlyout.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pages\\HelpPage.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pages\\MainPage.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"Controls\\NowPlayingView.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pages\\SettingsPage.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Styles\\CircleButtonStyle.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Styles\\MinimalButtonStyle.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Styles\\TopBarDarkButtonStyle.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Styles\\TopBarLightButtonStyle.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Themes\\Generic.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"BuildWebCompiler\">\n      <Version>1.12.394</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.AppCenter.Analytics\">\n      <Version>3.2.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.AppCenter.Crashes\">\n      <Version>3.2.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NETCore.UniversalWindowsPlatform\">\n      <Version>6.2.10</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.TypeScript.MSBuild\">\n      <Version>3.5.2</Version>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.UI.Xaml\">\n      <Version>2.1.190405004.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"Newtonsoft.Json\">\n      <Version>12.0.2</Version>\n    </PackageReference>\n    <PackageReference Include=\"UWP.SDKforGoogleAnalytics.Managed\">\n      <Version>1.5.2</Version>\n    </PackageReference>\n    <SDKReference Include=\"Microsoft.Services.Store.Engagement, Version=10.0\">\n      <Name>Microsoft Engagement Framework</Name>\n    </SDKReference>\n    <PackageReference Include=\"Microsoft.Services.Store.Engagement\">\n      <Version>10.1901.28001</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Services.Store.SDK\">\n      <Version>10.1705.16001</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Toolkit.Uwp\">\n      <Version>5.1.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Toolkit.Uwp.UI.Animations\">\n      <Version>5.1.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.Toolkit.Uwp.UI.Controls\">\n      <Version>5.1.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"NLog\">\n      <Version>4.6.2</Version>\n    </PackageReference>\n    <PackageReference Include=\"NLog.Schema\">\n      <Version>4.6.2</Version>\n    </PackageReference>\n    <PackageReference Include=\"sameerIOTApps.Plugin.SecureStorage\">\n      <Version>2.5.0</Version>\n    </PackageReference>\n  </ItemGroup>\n  <ItemGroup>\n    <TypeScriptCompile Include=\"Scripts\\Common\\initScript-common.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\Common\\uiInjector.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\DarkTheme\\initScript-dark.ts\" />\n    <TypeScriptCompile Include=\"Scripts\\LightTheme\\initScript-light.ts\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\XpoMusicWebAgent\\XpoMusicWebAgent.csproj\">\n      <Project>{15faca69-c86a-4447-97dc-b6cb59056075}</Project>\n      <Name>XpoMusicWebAgent</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <PropertyGroup Condition=\" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' \">\n    <VisualStudioVersion>14.0</VisualStudioVersion>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\WindowsXaml\\v$(VisualStudioVersion)\\Microsoft.Windows.UI.Xaml.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "XpoMusic/XpotifyApi/AppConstantsApi.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.XpotifyApi\n{\n    public static class AppConstantsApi\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static string UpdateUri\n        {\n            get\n            {\n                var endpoint = \"https://xpomusic.com/constants\";\n                var version = PackageHelper.GetAppVersion().ToString(3);\n                var fileName = \"constants.json\";\n                var query = \"?date=\" + DateTime.Now.ToString(\"yyyyMMddHHmmss\");\n                var proSuffix = PackageHelper.IsProVersion ? \"pro\" : \"\";\n\n                return $\"{endpoint}/{version}{proSuffix}/{fileName}{query}\";\n            }\n        }\n\n        public static async Task<string> GetAppConstantsString()\n        {\n            try\n            {\n                using (var client = new HttpClient())\n                {\n                    var response = await client.GetAsync(UpdateUri);\n                    if (response.IsSuccessStatusCode == false)\n                    {\n                        if (response.StatusCode == System.Net.HttpStatusCode.NotFound)\n                        {\n                            // If this happens, first session will contain the previous updated values since it's cached. \n                            // But the next sessions will have the values defined in code.\n                            logger.Info(\"GetAppConstantsString could not find a constants file on the server. Will return an empty json.\");\n                            return \"{}\";\n                        }\n                        else\n                        {\n                            logger.Warn($\"GetAppConstantsString failed because request failed with status code {response.StatusCode}.\");\n                            return null;\n                        }\n                    }\n\n                    var result = await response.Content.ReadAsStringAsync();\n                    return result;\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetAppConstantsString failed: \" + ex.ToString());\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/AssetUpdatesApi.cs",
    "content": "﻿using XpoMusic.Classes;\nusing XpoMusic.Helpers;\nusing XpoMusic.XpotifyApi.Model;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Storage;\n\nnamespace XpoMusic.XpotifyApi\n{\n    public static class AssetUpdatesApi\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n        private static readonly string assetUpdateCacheFolderName = \"AssetUpdateDownloadCache\";\n\n        private static string UpdateUri\n        {\n            get\n            {\n                var endpoint = \"https://xpomusic.com/assets\";\n                var version = PackageHelper.GetAppVersion().ToString(3);\n                var fileName = \"assetPackageInfo.json\";\n                var query = \"?date=\" + DateTime.Now.ToString(\"yyyyMMddHHmmss\");\n                var proSuffix = PackageHelper.IsProVersion ? \"pro\" : \"\";\n\n                return $\"{endpoint}/{version}{proSuffix}/{fileName}{query}\";\n            }\n        }\n\n        private static async Task<AssetPackageInfo> GetLatestAssetPackageUri()\n        {\n            try\n            {\n                using (var client = new HttpClient())\n                {\n                    var response = await client.GetAsync(UpdateUri);\n                    if (response.IsSuccessStatusCode == false)\n                    {\n                        logger.Warn($\"GetLatestAssetPackageUri failed because request failed with status code {response.StatusCode}.\");\n                        return null;\n                    }\n\n                    var result = await response.Content.ReadAsStringAsync();\n                    return JsonConvert.DeserializeObject<AssetPackageInfo>(result);\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetLatestAssetPackageUri failed: \" + ex.ToString());\n                return null;\n            }\n        }\n\n        public static async Task<AssetPackage> GetLatestAssetPackage()\n        {\n            try\n            {\n                var assetPackageInfo = await GetLatestAssetPackageUri();\n\n                if (assetPackageInfo == null)\n                    return null;\n\n                if (assetPackageInfo.version <= LocalConfiguration.LatestAssetUpdateVersion)\n                {\n                    logger.Info($\"Latest asset package version is {assetPackageInfo.version} and the latest downloaded version is {LocalConfiguration.LatestAssetUpdateVersion}. Will not download.\");\n                    return null;\n                }\n\n                using (var client = new HttpClient())\n                {\n                    var response = await client.GetAsync(assetPackageInfo.downloadUri);\n                    if (response.IsSuccessStatusCode == false)\n                    {\n                        logger.Warn($\"GetLatestAssetPackage failed because request failed with status code {response.StatusCode}.\");\n                        return null;\n                    }\n\n                    var result = await response.Content.ReadAsByteArrayAsync();\n\n                    var folder = await GetAssetUpdateCacheFolder();\n                    var file = await folder.CreateFileAsync($\"{assetPackageInfo.version}.zip\");\n                    await FileIO.WriteBytesAsync(file, result);\n\n                    return new AssetPackage\n                    {\n                        AssetPackageInfo = assetPackageInfo,\n                        File = file,\n                    };\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetLatestAssetPackage failed: \" + ex.ToString());\n                return null;\n            }\n        }\n\n        private static async Task<StorageFolder> GetAssetUpdateCacheFolder()\n        {\n            var folder = (await ApplicationData.Current.LocalFolder.TryGetItemAsync(assetUpdateCacheFolderName)) as StorageFolder;\n            if (folder == null)\n                folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(assetUpdateCacheFolderName);\n\n            return folder;\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/DeveloperMessageApi.cs",
    "content": "﻿using XpoMusic.Helpers;\nusing XpoMusic.XpotifyApi.Model;\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.XpotifyApi\n{\n    public static class DeveloperMessageApi\n    {\n        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();\n\n        private static string DevMessagesUri\n        {\n            get\n            {\n                var endpoint = \"https://xpomusic.com/devmessages\";\n                var version = PackageHelper.GetAppVersion().ToString(3);\n                var fileName = \"messages.json\";\n                var query = \"?date=\" + DateTime.Now.ToString(\"yyyyMMddHHmmss\");\n                var proSuffix = PackageHelper.IsProVersion ? \"pro\" : \"\";\n\n                return $\"{endpoint}/{version}{proSuffix}/{fileName}{query}\";\n            }\n        }\n\n        public static async Task<DeveloperMessageCollection> GetDeveloperMessages()\n        {\n            try\n            {\n                using (var client = new HttpClient())\n                {\n                    var response = await client.GetAsync(DevMessagesUri);\n                    if (response.IsSuccessStatusCode == false)\n                    {\n                        logger.Warn($\"GetDeveloperMessages failed because request failed with status code {response.StatusCode}.\");\n                        return null;\n                    }\n\n                    var result = await response.Content.ReadAsStringAsync();\n                    return JsonConvert.DeserializeObject<DeveloperMessageCollection>(result);\n                }\n            }\n            catch (Exception ex)\n            {\n                logger.Warn(\"GetDeveloperMessages failed: \" + ex.ToString());\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/Model/AssetPackage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Storage;\n\nnamespace XpoMusic.XpotifyApi.Model\n{\n    public class AssetPackage\n    {\n        public AssetPackageInfo AssetPackageInfo { get; set; }\n        public StorageFile File { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/Model/AssetPackageInfo.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.XpotifyApi.Model\n{\n    public class AssetPackageInfo\n    {\n        public int version { get; set; }\n        public string downloadUri { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/Model/DeveloperMessage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.XpotifyApi.Model\n{\n    public class DeveloperMessage\n    {\n        public string id { get; set; }\n        public string title { get; set; }\n        public string content { get; set; }\n        public long timestamp { get; set; }\n        public DateTime messageDate => DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime.ToLocalTime();\n    }\n}\n"
  },
  {
    "path": "XpoMusic/XpotifyApi/Model/DeveloperMessageCollection.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusic.XpotifyApi.Model\n{\n    public class DeveloperMessageCollection\n    {\n        public DeveloperMessage[] messages { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusic/compilerconfig.json",
    "content": "﻿[\n  {\n    \"outputFile\": \"InjectedAssets/style-light.css\",\n    \"inputFile\": \"Stylesheets/LightTheme/light.scss\",\n    \"includeInProject\": true\n  },\n  {\n    \"outputFile\": \"InjectedAssets/style-dark.css\",\n    \"inputFile\": \"Stylesheets/DarkTheme/dark.scss\",\n    \"includeInProject\": true\n  }\n]"
  },
  {
    "path": "XpoMusic/compilerconfig.json.defaults",
    "content": "{\n  \"compilers\": {\n    \"less\": {\n      \"autoPrefix\": \"\",\n      \"cssComb\": \"none\",\n      \"ieCompat\": true,\n      \"strictMath\": false,\n      \"strictUnits\": false,\n      \"relativeUrls\": true,\n      \"rootPath\": \"\",\n      \"sourceMapRoot\": \"\",\n      \"sourceMapBasePath\": \"\",\n      \"sourceMap\": false\n    },\n    \"sass\": {\n      \"autoPrefix\": \"\",\n      \"includePath\": \"\",\n      \"indentType\": \"space\",\n      \"indentWidth\": 2,\n      \"outputStyle\": \"nested\",\n      \"Precision\": 5,\n      \"relativeUrls\": true,\n      \"sourceMapRoot\": \"\",\n      \"lineFeed\": \"\",\n      \"sourceMap\": false\n    },\n    \"stylus\": {\n      \"sourceMap\": false\n    },\n    \"babel\": {\n      \"sourceMap\": false\n    },\n    \"coffeescript\": {\n      \"bare\": false,\n      \"runtimeMode\": \"node\",\n      \"sourceMap\": false\n    },\n    \"handlebars\": {\n      \"root\": \"\",\n      \"noBOM\": false,\n      \"name\": \"\",\n      \"namespace\": \"\",\n      \"knownHelpersOnly\": false,\n      \"forcePartial\": false,\n      \"knownHelpers\": [],\n      \"commonjs\": \"\",\n      \"amd\": false,\n      \"sourceMap\": false\n    }\n  },\n  \"minifiers\": {\n    \"css\": {\n      \"enabled\": true,\n      \"termSemicolons\": true,\n      \"gzip\": false\n    },\n    \"javascript\": {\n      \"enabled\": true,\n      \"termSemicolons\": true,\n      \"gzip\": false\n    }\n  }\n}"
  },
  {
    "path": "XpoMusic.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28306.52\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"XpoMusic\", \"XpoMusic\\XpoMusic.csproj\", \"{CF732FD1-9200-423A-8BB6-1685B598A3DC}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"XpoMusicWebAgent\", \"XpoMusicWebAgent\\XpoMusicWebAgent.csproj\", \"{15FACA69-C86A-4447-97DC-B6CB59056075}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"XpoMusicInstaller\", \"XpoMusicInstaller\\XpoMusicInstaller.csproj\", \"{36C336EE-BE94-4085-9F0F-262F7B200DBD}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|ARM = Debug|ARM\n\t\tDebug|ARM64 = Debug|ARM64\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|ARM = Release|ARM\n\t\tRelease|ARM64 = Release|ARM64\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|Any CPU.ActiveCfg = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|Any CPU.Build.0 = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|Any CPU.Deploy.0 = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM.ActiveCfg = Debug|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM.Build.0 = Debug|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM.Deploy.0 = Debug|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM64.ActiveCfg = Debug|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM64.Build.0 = Debug|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|ARM64.Deploy.0 = Debug|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x64.Build.0 = Debug|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x64.Deploy.0 = Debug|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x86.Build.0 = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Debug|x86.Deploy.0 = Debug|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|Any CPU.ActiveCfg = Release|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM.ActiveCfg = Release|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM.Build.0 = Release|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM.Deploy.0 = Release|ARM\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM64.ActiveCfg = Release|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM64.Build.0 = Release|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|ARM64.Deploy.0 = Release|ARM64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x64.ActiveCfg = Release|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x64.Build.0 = Release|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x64.Deploy.0 = Release|x64\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x86.ActiveCfg = Release|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x86.Build.0 = Release|x86\n\t\t{CF732FD1-9200-423A-8BB6-1685B598A3DC}.Release|x86.Deploy.0 = Release|x86\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|ARM.ActiveCfg = Debug|ARM\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|ARM.Build.0 = Debug|ARM\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|ARM64.ActiveCfg = Debug|ARM64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|ARM64.Build.0 = Debug|ARM64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|x64.Build.0 = Debug|x64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Debug|x86.Build.0 = Debug|x86\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|ARM.ActiveCfg = Release|ARM\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|ARM.Build.0 = Release|ARM\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|ARM64.ActiveCfg = Release|ARM64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|ARM64.Build.0 = Release|ARM64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|x64.ActiveCfg = Release|x64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|x64.Build.0 = Release|x64\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|x86.ActiveCfg = Release|x86\n\t\t{15FACA69-C86A-4447-97DC-B6CB59056075}.Release|x86.Build.0 = Release|x86\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|x64.Build.0 = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{36C336EE-BE94-4085-9F0F-262F7B200DBD}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {E0099F66-369A-4936-A6B9-64A0DB688C4D}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "XpoMusicInstaller/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.7.1\" />\n    </startup>\n</configuration>"
  },
  {
    "path": "XpoMusicInstaller/App.xaml",
    "content": "﻿<Application x:Class=\"XpoMusicInstaller.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:local=\"clr-namespace:XpoMusicInstaller\"\n             StartupUri=\"MainWindow.xaml\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "XpoMusicInstaller/App.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Data;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nnamespace XpoMusicInstaller\n{\n    /// <summary>\n    /// Interaction logic for App.xaml\n    /// </summary>\n    public partial class App : Application\n    {\n    }\n}\n"
  },
  {
    "path": "XpoMusicInstaller/MainWindow.xaml",
    "content": "﻿<Window x:Class=\"XpoMusicInstaller.MainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:local=\"clr-namespace:XpoMusicInstaller\"\n        mc:Ignorable=\"d\"\n        Title=\"XpoMusic Installer\" \n        Height=\"300\" \n        Width=\"300\" \n        Topmost=\"True\" \n        WindowStartupLocation=\"CenterScreen\" \n        AllowsTransparency=\"True\" \n        Background=\"Transparent\"\n        ShowInTaskbar=\"False\"\n        WindowStyle=\"None\"\n        ContentRendered=\"Window_ContentRendered\">\n    <Window.Resources>\n        <ResourceDictionary>\n            <Storyboard x:Key=\"mainLogoStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"mainLogoGlow\"\n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 To=\"0.9\"\n                                 AutoReverse=\"True\"\n                                 RepeatBehavior=\"Forever\"\n                                 Duration=\"0:0:1\">\n                    <DoubleAnimation.EasingFunction>\n                        <QuadraticEase EasingMode=\"EaseInOut\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n            </Storyboard>\n            <Storyboard x:Key=\"mainLogoExitStoryboard\">\n                <DoubleAnimation Storyboard.TargetName=\"mainLogoScale\"\n                                 Storyboard.TargetProperty=\"ScaleX\"\n                                 To=\"0.5\"\n                                 AutoReverse=\"False\"\n                                 Duration=\"0:0:0.6\">\n                    <DoubleAnimation.EasingFunction>\n                        <BackEase EasingMode=\"EaseIn\" Amplitude=\"0.5\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"mainLogoScale\"\n                                 Storyboard.TargetProperty=\"ScaleY\"\n                                 To=\"0.5\"\n                                 AutoReverse=\"False\"\n                                 Duration=\"0:0:0.6\">\n                    <DoubleAnimation.EasingFunction>\n                        <BackEase EasingMode=\"EaseIn\" Amplitude=\"0.5\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"mainLogoAngle\"\n                                 Storyboard.TargetProperty=\"Angle\"\n                                 To=\"180\"\n                                 AutoReverse=\"False\"\n                                 Duration=\"0:0:0.6\">\n                    <DoubleAnimation.EasingFunction>\n                        <BackEase EasingMode=\"EaseIn\" Amplitude=\"0.5\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n                <DoubleAnimation Storyboard.TargetName=\"mainLogo\"\n                                 Storyboard.TargetProperty=\"Opacity\"\n                                 To=\"0\"\n                                 AutoReverse=\"False\"\n                                 Duration=\"0:0:0.6\">\n                    <DoubleAnimation.EasingFunction>\n                        <QuadraticEase EasingMode=\"EaseIn\" />\n                    </DoubleAnimation.EasingFunction>\n                </DoubleAnimation>\n            </Storyboard>\n        </ResourceDictionary>\n    </Window.Resources>\n    <Grid>\n        <Image x:Name=\"mainLogo\" \n               HorizontalAlignment=\"Stretch\"\n               VerticalAlignment=\"Stretch\"\n               RenderTransformOrigin=\"0.5, 0.5\"\n               Margin=\"80\"\n               Source=\"Assets/XpoMusicInstallerLogo.png\">\n            <Image.Effect>\n                <DropShadowEffect x:Name=\"mainLogoGlow\" \n                                  ShadowDepth=\"0\"\n                                  Color=\"LightGreen\"\n                                  Opacity=\"0.6\"\n                                  BlurRadius=\"100\"\n                                  />\n            </Image.Effect>\n            <Image.RenderTransform>\n                <TransformGroup>\n                    <ScaleTransform x:Name=\"mainLogoScale\" ScaleX=\"1\" ScaleY=\"1\" />\n                    <RotateTransform x:Name=\"mainLogoAngle\" Angle=\"0\" />\n                </TransformGroup>\n            </Image.RenderTransform>\n        </Image>\n\n    </Grid>\n</Window>\n"
  },
  {
    "path": "XpoMusicInstaller/MainWindow.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Security.Cryptography;\nusing System.Security.Cryptography.X509Certificates;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Animation;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nnamespace XpoMusicInstaller\n{\n    /// <summary>\n    /// Interaction logic for MainWindow.xaml\n    /// </summary>\n    public partial class MainWindow : Window\n    {\n        private readonly string appInstallerUri = \"ms-appinstaller:?source=https://ghiasi.net/XpoMusic/install/XpoMusic.appinstaller\";\n\n        public MainWindow()\n        {\n            InitializeComponent();\n        }\n\n        private void Window_ContentRendered(object sender, EventArgs e)\n        {\n            (this.FindResource(\"mainLogoStoryboard\") as Storyboard).Begin();\n            StartInstallation();\n        }\n\n        private async void StartInstallation()\n        {\n            if (!VerifyOSVersion())\n                return;\n            if (!InstallCertificate())\n                return;\n            OpenAppInstaller();\n            (this.FindResource(\"mainLogoExitStoryboard\") as Storyboard).Begin();\n            await Task.Delay(1500);\n            Application.Current.Shutdown();\n        }\n\n        private static void ShowOSVersionAlertAndExit()\n        {\n            MessageBox.Show(\"To install Xpo Music, you must first update your operating system to Windows 10 version 1803 or above.\", \"Xpo Music Installer\", MessageBoxButton.OK, MessageBoxImage.Exclamation);\n            Application.Current.Shutdown();\n        }\n\n        private static void ShowPermissionAlertAndExit()\n        {\n            MessageBox.Show(\"Please run Xpo Music Installer as an administrator.\", \"Xpo Music Installer\", MessageBoxButton.OK, MessageBoxImage.Exclamation);\n            Application.Current.Shutdown();\n        }\n\n        private bool VerifyOSVersion()\n        {\n            var osVersion = Environment.OSVersion.Version;\n            var minSupportedVersion = new Version(\"10.0.17134.0\");\n            return osVersion >= minSupportedVersion;\n        }\n\n        private void OpenAppInstaller()\n        {\n            Process.Start(appInstallerUri);\n        }\n\n        private bool InstallCertificate()\n        {\n            try\n            {\n                var cert = new X509Certificate2(Properties.Resources.XpoMusic);\n                X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);\n                store.Open(OpenFlags.ReadWrite);\n                store.Add(cert);\n                store.Close();\n                return true;\n            }\n            catch (CryptographicException)\n            {\n                ShowPermissionAlertAndExit();\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusicInstaller/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"XpoMusicInstaller\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"XpoMusicInstaller\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2020\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set\n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n                                     //(used if a resource is not found in the page,\n                                     // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n                                              //(used if a resource is not found in the page,\n                                              // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "XpoMusicInstaller/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace XpoMusicInstaller.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"XpoMusicInstaller.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Byte[].\n        /// </summary>\n        internal static byte[] XpoMusic {\n            get {\n                object obj = ResourceManager.GetObject(\"XpoMusic\", resourceCulture);\n                return ((byte[])(obj));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusicInstaller/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"XpoMusic\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>..\\Resources\\XpoMusic.cer;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n</root>"
  },
  {
    "path": "XpoMusicInstaller/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace XpoMusicInstaller.Properties\n{\n\n\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\n    {\n\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n\n        public static Settings Default\n        {\n            get\n            {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusicInstaller/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "XpoMusicInstaller/XpoMusicInstaller.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{36C336EE-BE94-4085-9F0F-262F7B200DBD}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <RootNamespace>XpoMusicInstaller</RootNamespace>\n    <AssemblyName>XpoMusicInstaller</AssemblyName>\n    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <Deterministic>true</Deterministic>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>XpoMusicInstallerLogo.ico</ApplicationIcon>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Net.Http\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"App.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </ApplicationDefinition>\n    <Page Include=\"MainWindow.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Compile Include=\"App.xaml.cs\">\n      <DependentUpon>App.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"MainWindow.xaml.cs\">\n      <DependentUpon>MainWindow.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"app.manifest\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <None Include=\"Resources\\XpoMusic.cer\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Resource Include=\"Assets\\XpoMusicInstallerLogo.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Resource Include=\"XpoMusicInstallerLogo.ico\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "XpoMusicInstaller/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"MyApplication.app\"/>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    <security>\n      <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <!-- UAC Manifest Options\n             If you want to change the Windows User Account Control level replace the \n             requestedExecutionLevel node with one of the following.\n\n        <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n            Specifying requestedExecutionLevel element will disable file and registry virtualization. \n            Remove this element if your application requires this virtualization for backwards\n            compatibility.\n        -->\n        <requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"false\" />\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of the Windows versions that this application has been tested on\n           and is designed to work with. Uncomment the appropriate elements\n           and Windows will automatically select the most compatible environment. -->\n\n      <!-- Windows Vista -->\n      <!--<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" />-->\n\n      <!-- Windows 7 -->\n      <!--<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\" />-->\n\n      <!-- Windows 8 -->\n      <!--<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" />-->\n\n      <!-- Windows 8.1 -->\n      <!--<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\" />-->\n\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\" />\n\n    </application>\n  </compatibility>\n\n  <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher\n       DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need \n       to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should \n       also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->\n  <!--\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>\n    </windowsSettings>\n  </application>\n  -->\n\n  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n  <!--\n  <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n          type=\"win32\"\n          name=\"Microsoft.Windows.Common-Controls\"\n          version=\"6.0.0.0\"\n          processorArchitecture=\"*\"\n          publicKeyToken=\"6595b64144ccf1df\"\n          language=\"*\"\n        />\n    </dependentAssembly>\n  </dependency>\n  -->\n\n</assembly>\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/ActionRequestedEventArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class ActionRequestedEventArgs\n    {\n        public Action Action { get; set; }\n    }\n\n    public enum Action\n    {\n        PinToStart,\n        OpenSettings,\n        OpenDonate,\n        OpenAbout,\n        OpenMiniView,\n        OpenNowPlaying,\n        NavigateToClipboardUri,\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/InitFailedEventArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class InitFailedEventArgs\n    {\n        public string Errors { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/LogMessageReceivedEventArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class LogMessageReceivedEventArgs\n    {\n        public string Message { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/NowPlayingData.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class NowPlayingData\n    {\n        public string TrackName { get; set; }\n        public string TrackId { get; set; }\n        public string AlbumId { get; set; }\n        public string ArtistName { get; set; }\n        public string ArtistId { get; set; }\n        public string TrackFingerprint { get; set; }\n        public double Volume { get; set; }\n        public int ElapsedTime { get; set; }\n        public int TotalTime { get; set; }\n        public bool IsPrevTrackAvailable { get; set; }\n        public bool IsNextTrackAvailable { get; set; }\n        public bool IsPlaying { get; set; }\n        public bool IsTrackSavedToLibrary { get; set; }\n        public bool Success { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/ProgressBarCommandEventArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class ProgressBarCommandEventArgs\n    {\n        public ProgressBarCommand Command { get; set; }\n        public double Left { get; set; }\n        public double Top { get; set; }\n        public double Width { get; set; }\n    }\n\n    public enum ProgressBarCommand\n    {\n        Show,\n        Hide,\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/StatusReportReceivedEventArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class StatusReportReceivedEventArgs\n    {\n        public WebAppStatus Status { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Model/WebAppStatus.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace XpoMusicWebAgent.Model\n{\n    public sealed class WebAppStatus\n    {\n        public bool BackButtonEnabled { get; set; }\n        public NowPlayingData NowPlaying { get; set; }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"XpotifyWebAgent\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"XpotifyWebAgent\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2019\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n[assembly: ComVisible(false)]"
  },
  {
    "path": "XpoMusicWebAgent/WebAgent.cs",
    "content": "﻿using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.Foundation;\nusing Windows.Foundation.Metadata;\nusing XpoMusicWebAgent.Model;\n\nnamespace XpoMusicWebAgent\n{\n    [AllowForWeb]\n    public sealed class WebAgent\n    {\n        // NOTE:\n        // It seems that WebView automatically changes PascalCase method names to \n        // camelCase on the Javascript side.\n\n        public event EventHandler<ProgressBarCommandEventArgs> ProgressBarCommandReceived;\n        public event EventHandler<StatusReportReceivedEventArgs> StatusReportReceived;\n        public event EventHandler<ActionRequestedEventArgs> ActionRequested;\n        public event EventHandler<InitFailedEventArgs> InitializationFailed;\n        public event EventHandler<LogMessageReceivedEventArgs> LogMessageReceived;\n        public event EventHandler<object> NewAccessTokenRequested;\n\n        private TaskCompletionSource<string> newAccessTokenTcs;\n\n        public bool WebPlayerBackupEnabled { get; set; }\n        public string OSVersion { get; set; }\n\n        public void ShowProgressBar(double left, double top, double width)\n        {\n            ProgressBarCommandReceived?.Invoke(this, new ProgressBarCommandEventArgs\n            {\n                Command = ProgressBarCommand.Show,\n                Left = left,\n                Top = top,\n                Width = width,\n            });\n        }\n\n        public void HideProgressBar()\n        {\n            ProgressBarCommandReceived?.Invoke(this, new ProgressBarCommandEventArgs\n            {\n                Command = ProgressBarCommand.Hide,\n            });\n        }\n\n        public void StatusReport(string data)\n        {\n            StatusReportReceived?.Invoke(this, new StatusReportReceivedEventArgs\n            {\n                Status = JsonConvert.DeserializeObject<WebAppStatus>(data),\n            });\n        }\n\n        public void OpenSettings()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.OpenSettings,\n            });\n        }\n\n        public void OpenAbout()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.OpenAbout,\n            });\n        }\n\n        public void OpenDonate()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.OpenDonate,\n            });\n        }\n\n        public void OpenMiniView()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.OpenMiniView,\n            });\n        }\n\n        public void OpenNowPlaying()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.OpenNowPlaying,\n            });\n        }\n\n        public void PinToStart()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.PinToStart,\n            });\n        }\n\n        public void NavigateToClipboardUri()\n        {\n            ActionRequested?.Invoke(this, new ActionRequestedEventArgs\n            {\n                Action = Model.Action.NavigateToClipboardUri,\n            });\n        }\n\n        public void InitFailed(string errors)\n        {\n            InitializationFailed?.Invoke(this, new InitFailedEventArgs\n            {\n                Errors = errors,\n            });\n        }\n\n        public IAsyncOperation<string> GetNewAccessTokenAsync()\n        {\n            return GetNewAccessToken().AsAsyncOperation();\n        }\n\n        private Task<string> GetNewAccessToken()\n        {\n            newAccessTokenTcs = new TaskCompletionSource<string>();\n            NewAccessTokenRequested?.Invoke(this, new EventArgs());\n            return newAccessTokenTcs.Task;\n        }\n\n        public void SetNewAccessToken(string accessToken)\n        {\n            newAccessTokenTcs.TrySetResult(accessToken);\n        }\n\n        public void Log(string message)\n        {\n            LogMessageReceived?.Invoke(this, new LogMessageReceivedEventArgs\n            {\n                Message = message,\n            });\n        }\n\n        public bool IsWebPlayerBackupEnabled()\n        {\n            return WebPlayerBackupEnabled;\n        }\n\n        public int GetOSBuildVersion()\n        {\n            try\n            {\n                return new Version(OSVersion).Build;\n            }\n            catch (Exception ex)\n            {\n                Log(\"Exception in WebAgent.GetOSBuildVersion(): \" + ex.ToString());\n                return 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "XpoMusicWebAgent/XpoMusicWebAgent.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{15FACA69-C86A-4447-97DC-B6CB59056075}</ProjectGuid>\n    <OutputType>winmdobj</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>XpoMusicWebAgent</RootNamespace>\n    <AssemblyName>XpoMusicWebAgent</AssemblyName>\n    <DefaultLanguage>en-US</DefaultLanguage>\n    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>\n    <TargetPlatformVersion Condition=\" '$(TargetPlatformVersion)' == '' \">10.0.18362.0</TargetPlatformVersion>\n    <TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>\n    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x86'\">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <PlatformTarget>x86</PlatformTarget>\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|ARM'\">\n    <PlatformTarget>ARM</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\ARM\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|ARM'\">\n    <PlatformTarget>ARM</PlatformTarget>\n    <OutputPath>bin\\ARM\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|ARM64'\">\n    <PlatformTarget>ARM64</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\ARM64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|ARM64'\">\n    <PlatformTarget>ARM64</PlatformTarget>\n    <OutputPath>bin\\ARM64\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Debug|x64'\">\n    <PlatformTarget>x64</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x64\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>full</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x64'\">\n    <PlatformTarget>x64</PlatformTarget>\n    <OutputPath>bin\\x64\\Release\\</OutputPath>\n    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>\n    <Optimize>true</Optimize>\n    <NoWarn>;2008</NoWarn>\n    <DebugType>pdbonly</DebugType>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n  </PropertyGroup>\n  <PropertyGroup>\n    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"Model\\ActionRequestedEventArgs.cs\" />\n    <Compile Include=\"Model\\InitFailedEventArgs.cs\" />\n    <Compile Include=\"Model\\LogMessageReceivedEventArgs.cs\" />\n    <Compile Include=\"Model\\NowPlayingData.cs\" />\n    <Compile Include=\"Model\\ProgressBarCommandEventArgs.cs\" />\n    <Compile Include=\"Model\\StatusReportReceivedEventArgs.cs\" />\n    <Compile Include=\"Model\\WebAppStatus.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"WebAgent.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NETCore.UniversalWindowsPlatform\">\n      <Version>6.2.10</Version>\n    </PackageReference>\n    <PackageReference Include=\"Newtonsoft.Json\">\n      <Version>12.0.2</Version>\n    </PackageReference>\n  </ItemGroup>\n  <PropertyGroup Condition=\" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' \">\n    <VisualStudioVersion>14.0</VisualStudioVersion>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\WindowsXaml\\v$(VisualStudioVersion)\\Microsoft.Windows.UI.Xaml.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  }
]