=e.scrollHeight&&this.loadMore()}setActiveTheme(e){this.CONFIG.theme.activeThemeKey=e,this.setState({activeThemeKey:e})}getActiveScheme(){return this.state.activeScheme}render(){const r=this.props["t"];return f.default.createElement("section",{className:"contentSpacing"},f.default.createElement("div",{className:"marketplace-header"},f.default.createElement("div",{className:"marketplace-header__left"},f.default.createElement("h1",null,this.props.title),this.state.newUpdate?f.default.createElement("button",{type:"button",title:r("grid.newUpdate"),className:"marketplace-header-icon-button",id:"marketplace-update",onClick:()=>window.location.href="https://github.com/spicetify/spicetify-marketplace/releases/latest"},f.default.createElement(_a,null)," ",this.state.version):null),f.default.createElement("div",{className:"marketplace-header__right"},this.CONFIG.visual.themeDevTools?f.default.createElement(Ja.ReactComponent.TooltipWrapper,{label:r("devTools.title"),renderInline:!0,placement:"bottom"},f.default.createElement("button",{type:"button","aria-label":r("devTools.title"),className:"marketplace-header-icon-button",onClick:()=>ca("THEME_DEV_TOOLS")},f.default.createElement(Ca,null))):null,this.state.activeScheme?f.default.createElement(zn,{onChange:e=>this.updateColourSchemes(this.state.schemes,e),sortBoxOptions:En(this.state.schemes),sortBySelectedFn:e=>e.key===this.getActiveScheme()}):null,f.default.createElement("div",{className:"searchbar--bar__wrapper"},f.default.createElement("input",{className:"searchbar-bar",type:"text",placeholder:`${r("grid.search")} ${r("tabs."+this.CONFIG.activeTab)}...`,value:this.state.searchValue,onChange:e=>{this.setState({searchValue:e.target.value})}})),f.default.createElement(Ja.ReactComponent.TooltipWrapper,{label:r("settings.title"),renderInline:!0,placement:"bottom"},f.default.createElement("button",{type:"button","aria-label":r("settings.title"),className:"marketplace-header-icon-button",id:"marketplace-settings-button",onClick:()=>ca("SETTINGS",this.CONFIG,this.updateAppConfig)},f.default.createElement(ka,null))))),[{handle:"extension",name:"Extensions"},{handle:"theme",name:"Themes"},{handle:"snippet",name:"Snippets"},{handle:"app",name:"Apps"}].map(t=>{var e=this.cardList.filter(e=>e.props.type===t.handle).filter(e=>{const t=this.state.searchValue.trim().toLowerCase();var{title:e,user:r,authors:n}=e.props.item;return!t||e.toLowerCase().includes(t)||(null==r?void 0:r.toLowerCase().includes(t))||(null==n?void 0:n.some(e=>e.name.toLowerCase().includes(t)))}).map(e=>f.default.cloneElement(e,{activeThemeKey:this.state.activeThemeKey,key:e.key})).filter((t,e,r)=>r.findIndex(e=>e.key===t.key)===e);return e.length?f.default.createElement(f.default.Fragment,null,f.default.createElement("h2",{className:"marketplace-card-type-heading"},r("tabs."+t.name)),f.default.createElement("div",{className:"marketplace-grid main-gridContainer-gridContainer main-gridContainer-fixedWidth","data-tab":this.CONFIG.activeTab,"data-card-type":r("tabs."+t.name)},e)):null}),"Snippets"===this.CONFIG.activeTab?f.default.createElement(S,{classes:["marketplace-add-snippet-btn"],onClick:()=>ca("ADD_SNIPPET")},"+ ",r("grid.addCSS")):null,f.default.createElement("footer",{className:"marketplace-footer"},!this.state.endOfList&&(this.state.rest?f.default.createElement(ya,{onClick:this.loadMore.bind(this)}):f.default.createElement(wa,null))),f.default.createElement(La,{switchCallback:this.switchTo.bind(this),links:this.CONFIG.tabs,activeLink:this.CONFIG.activeTab}))}},Wa=qr()(r),A=t(b()),Ue=class extends A.default.Component{constructor(){super(...arguments),this.state={isInstalled:this.props.data.isInstalled(),html:`${this.props.t("readmePage.loading")}
`},this.getReadmeHTML=async()=>fetch(this.props.data.readmeURL).then(e=>{if(e.ok)return e.text();throw Spicetify.showNotification(`${this.props.t("readmePage.errorLoading")} (HTTP ${e.status})`,!0)}).then(e=>Cn(e,this.props.data.user,this.props.data.repo)).then(e=>(e||Spicetify.Platform.History.goBack(),e)).catch(e=>(console.error(e),Spicetify.Platform.History.goBack(),null))}componentDidMount(){this.getReadmeHTML().then(e=>{null!=e&&this.setState({html:e})})}componentDidUpdate(){var e;const t=null==(e=document.querySelector("#marketplace-readme"))?void 0:e.closest("main");if(t){const r=setInterval(()=>{document.querySelector("#marketplace-readme")?(t.style.overflowY="visible",t.style.overflowY="auto"):(clearInterval(r),t.style.removeProperty("overflow-y"))},1e3)}document.querySelectorAll("#marketplace-readme img").forEach(e=>{e.addEventListener("error",e=>{var e=e.target,t=e.getAttribute("src"),t="/"===(null==t?void 0:t.charAt(0))?`https://raw.githubusercontent.com/${this.props.data.user}/${this.props.data.repo}/${this.props.data.branch}/`+(null==t?void 0:t.slice(1)):this.props.data.readmeURL.substring(0,this.props.data.readmeURL.lastIndexOf("/"))+"/"+t;e.setAttribute("src",t)},{once:!0})})}buttonContent(){return"app"===this.props.data.type?{icon:A.default.createElement(Ma,null),text:this.props.t("github")}:this.state.isInstalled?{icon:A.default.createElement(Aa,null),text:this.props.t("remove")}:{icon:A.default.createElement(_a,null),text:this.props.t("install")}}render(){return A.default.createElement("section",{className:"contentSpacing"},A.default.createElement("div",{className:"marketplace-header"},A.default.createElement("div",{className:"marketplace-header__left"},A.default.createElement("h1",null,this.props.title)),A.default.createElement("div",{className:"marketplace-header__right"},A.default.createElement(S,{classes:["marketplace-header__button"],onClick:e=>{e.preventDefault(),this.props.data.install(),this.setState({isInstalled:!this.state.isInstalled})},label:this.buttonContent().text},this.buttonContent().icon," ",this.buttonContent().text))),"Loading...
"===this.state.html?A.default.createElement("footer",{className:"marketplace-footer"},A.default.createElement(wa,null)):A.default.createElement("div",{id:"marketplace-readme",className:"marketplace-readme__container",dangerouslySetInnerHTML:{__html:this.state.html}}))}},Xa=qr()(Ue),Ge=(h.use(X).use(zr).init({resources:{ca:{translation:{settings:{title:"Configuració",optionsHeading:"Opcions",starCountLabel:"Número d'estrelles",tagsLabel:"Etiquetes",devToolsLabel:"Eines per a desenvolupadors de temes",hideInstalledLabel:"Amagar instal·lats",colourShiftLabel:"Canviar colors cada minut",albumArtBasedColors:"Canviar colors a partir de la portada de l'àlbum",albumArtBasedColorsMode:"Mode esquema de colors (ColorApi)",albumArtBasedColorsVibrancy:"Colors agafats de la portada de l'àlbum",albumArtBasedColorsVibrancyToolTip:"Desaturat:El color més destacat però amb molta menys bror \n Vibrant Clar: El color més villantibrant amb la brillantor augmentada una mica \n Prominent: El color més destacat a la portada de l'Àlbum \n Vibrant: El color més vibrant a la portada de l'Àlbum",almbumArtColorsModeToolTip:"Monochrome Dark: Un esquema de colors basat en el color principal seleccionat, emprant diferentes tonalitats i barrejant tons grisos per crear l'esquema de colors, aquest és l'invers de Monochrome Light. \n Monochrome Light: Un esquema de colors basat en el color principal seleccionat, emprant diferentes tonalitats i barrejant tons grisos per crear l'esquema de colors. El colors del fins de Monochrome light seria el color de primer pla en Monochrome Dark i viceversa. \n Analògic: Un esquema de colors basat en el color principal seleccionat, emprant els colors adjacents en la roda de colors. \n Analògic Complementari: Un esquema de colors basat en el color principal seleccionat, emprant els colors adjacents en la roda de colors i el color complementari. \n Tríada: Un esquema de colors basat en el color principal seleccionat, emprant els colors de la roda de colors que estan separats de manera equidistant del color principal. \n Quad: Un esquema de colors basat en el color principal seleccionat, emprant els colors que es troben separats 90 graus entre si en la roda de colors.",tabsHeading:"Pestanyes",resetHeading:"Restablir",resetBtn:"$t(settings.resetHeading)",resetDescription:"Borrar totes les extensions, temes i preferències",backupHeading:"Fer una còpia/Reestablir des d'una còpia",backupLabel:"Fer una còpia o restablir totes les dades de Marketplace des d'una còpia. Això no inclou la configuració per els elements instal·lats amb Marketplace.",backupBtn:"Obrir",versionHeading:"Versió",versionBtn:"Copiar",versionCopied:"Copiat"},tabs:{Extensions:"Extensions",Themes:"Temes",Snippets:"Fragments",Apps:"Aplicacions",Installed:"Instal·lats"},snippets:{addTitle:"Afegir fragment",editTitle:"Editar fragment",viewTitle:"Veure fragment",customCSS:"CSS personalitzat",customCSSPlaceholder:"Crea el teu propi CSS aqui! Pots trobar-los a la pestanya d'instal·lats per administrar-los.",snippetName:"Nom del fragment de codi",snippetNamePlaceholder:"Afegeix un nom al teu codi personalitzat",snippetDesc:"Descripció del codi",snippetDescPlaceholder:"Crea una descripció per al teu codi personalitzat",snippetPreview:"Vista prèvia del fragment",optional:"Opcional",addImage:"Afegir imatge",changeImage:"Canviar imatge",saveCSS:"Guardar CSS"},reloadModal:{title:"Recarregar",description:"És necessari recarregar la finestra per completar aquesta operació.",reloadNow:"Fes-ho ara",reloadLater:"Després"},backupModal:{title:"$t(settings.backupHeading)",settingsCopied:"Configuració copiada al portapapers",noDataPasted:"No s'han enganxat dades",invalidJSON:"JSON invàlid",inputLabel:"Configuració de Marketplace",inputPlaceholder:"Còpia/enganxa la teva configuració aquí",exportBtn:"Exportar",importBtn:"Importar",fileImportBtn:"Importar des d'un arxiu"},devTools:{title:"Eines de desenvolupador de temes",noThemeInstalled:"Error: No hi ha cap tema de Marketplace instal·lat",noThemeManifest:"Error: No s'ha trobat el manifest",colorIniEditor:"Editor de Color.ini",colorIniEditorPlaceholder:"[nom-de-esquema-de-color]",invalidCSS:"CSS invàlid"},grid:{spicetifyMarketplace:"Marketplace de Spicetify",newUpdate:"Nova Actualització",addCSS:"Afegir CSS",search:"Buscar",installed:"Instal·lat",lastUpdated:"Última actualizació {{val, datetime}}",externalJS:"JS extern",dark:"fosc",light:"clar"},readmePage:{title:"$t(grid.spicetifyMarketplace) - Readme",loading:"Carregant...",errorLoading:"Error carregant el README"},github:"GitHub",install:"Instal·lar",remove:"Borrar",save:"Guardar",colour_one:"color",colour_other:"colors",favourite:"preferit"}},en:{translation:{settings:{title:"Settings",optionsHeading:"Options",starCountLabel:"Stars count",tagsLabel:"Tags",devToolsLabel:"Theme developer tools",hideInstalledLabel:"Hide installed when browsing",colourShiftLabel:"Shift colours every minute",albumArtBasedColors:"Change colours based on album art",albumArtBasedColorsMode:"Colour scheme (ColorApi) mode",albumArtBasedColorsVibrancy:"Colour grabbed from album art",albumArtBasedColorsVibrancyToolTip:"Desaturated: The colour that is the most prominent but with much less brightness \n Light Vibrant: The most Vibrant colour but with the brightness amped up a tad \n Prominent: The colour that pops the most in the album art \n Vibrant: The most vibrant colour in the album art",almbumArtColorsModeToolTip:"Monochrome Dark: A colour scheme based directly on the main colour selected, using different shades of the main colour and mixing in greys to create a colour scheme, this is the inverse of Monochrome Light. \n Monochrome Light: A colour scheme based directly on the main colour selected, using different shades of the main colour and mixing in greys to create a colour scheme. The background of monochrome light would be the foreground or text colour on Monochrome Dark and vice versa. \n Analogic: A colour scheme based on the main colour selected, using the colours adjacent to the main colour on the colour wheel. \n Analogic Complementary: A colour scheme based on the main colour selected, using the colours adjacent to the main colour on the colour wheel and the complementary colour. \n Triad: A colour scheme based on the main colour selected, using the colours on the colour wheel that are equidistant from the main colour. \n Quad: A colour scheme based on the main colour selected, using the colours on the colour wheel that are 90 degrees from the main colour.",tabsHeading:"Tabs",resetHeading:"Reset",resetBtn:"$t(settings.resetHeading)",resetDescription:"Uninstall all extensions and themes, and reset preferences",backupHeading:"Back up/Restore",backupLabel:"Back up or restore all Marketplace data. This does not include settings for anything installed via Marketplace.",backupBtn:"Open",versionHeading:"Version",versionBtn:"Copy",versionCopied:"Copied"},tabs:{Extensions:"Extensions",Themes:"Themes",Snippets:"Snippets",Apps:"Apps",Installed:"Installed"},snippets:{addTitle:"Add Snippet",editTitle:"Edit Snippet",viewTitle:"View Snippet",customCSS:"Custom CSS",customCSSPlaceholder:"Input your own custom CSS here! You can find them in the installed tab for management.",snippetName:"Snippet Name",snippetNamePlaceholder:"Enter a name for your custom snippet",snippetDesc:"Snippet Description",snippetDescPlaceholder:"Enter a description for your custom snippet",snippetPreview:"Snippet Preview",optional:"Optional",addImage:"Add image",changeImage:"Change image",saveCSS:"Save CSS"},reloadModal:{title:"Reload",description:"A page reload is required to complete this operation.",reloadNow:"Reload now",reloadLater:"Reload later"},backupModal:{title:"$t(settings.backupHeading)",settingsCopied:"Settings copied to clipboard",noDataPasted:"No data pasted",invalidJSON:"Invalid JSON",inputLabel:"Marketplace Settings",inputPlaceholder:"Copy/paste your settings here",exportBtn:"Export",importBtn:"Import",fileImportBtn:"Import from file"},devTools:{title:"Theme Dev Tools",noThemeInstalled:"Error: No marketplace theme installed",noThemeManifest:"Error: No theme manifest found",colorIniEditor:"Color.ini Editor",colorIniEditorPlaceholder:"[your-colour-scheme-name]",invalidCSS:"Invalid CSS"},grid:{spicetifyMarketplace:"Spicetify Marketplace",newUpdate:"New update",addCSS:"Add CSS",search:"Search",installed:"Installed",lastUpdated:"Last updated {{val, datetime}}",externalJS:"external JS",dark:"dark",light:"light"},readmePage:{title:"$t(grid.spicetifyMarketplace) - Readme",loading:"Loading...",errorLoading:"Error loading README"},github:"GitHub",install:"Install",remove:"Remove",save:"Save",colour_one:"colour",colour_other:"colours",favourite:"favourite"}},"en-US":{translation:{settings:{colourShiftLabel:"Shift colors every minute",albumArtBasedColors:"Change colors based on album art",albumArtBasedColorsMode:"Color scheme (ColorApi) mode",albumArtBasedColorsVibrancy:"Color grabbed from album art",albumArtBasedColorsVibrancyToolTip:"Desaturated: The color that is the most prominent but with much less brightness \n Light Vibrant: The most Vibrant color but with the brightness amped up a tad \n Prominent: The color that pops the most in the album art \n Vibrant: The most vibrant color in the album art",almbumArtColorsModeToolTip:"Monochrome Dark: A color scheme based directly on the main color selected, using different shades of the main color and mixing in greys to create a color scheme, this is the inverse of Monochrome Light. \n Monochrome Light: A color scheme based directly on the main color selected, using different shades of the main color and mixing in greys to create a color scheme. The background of monochrome light would be the foreground or text color on Monochrome Dark and vice versa. \n Analogic: A color scheme based on the main color selected, using the colors adjacent to the main color on the color wheel. \n Analogic Complementary: A color scheme based on the main color selected, using the colors adjacent to the main color on the color wheel and the complementary color. \n Triad: A color scheme based on the main color selected, using the colors on the color wheel that are equidistant from the main color. \n Quad: A color scheme based on the main color selected, using the colors on the color wheel that are 90 degrees from the main color."},devTools:{colorIniEditorPlaceholder:"[your-color-scheme-name]"},colour_one:"color",colour_other:"colors",favourite:"favorite"}},es:{translation:{settings:{title:"Ajustes",optionsHeading:"Opciones",starCountLabel:"Numero de estrellas",tagsLabel:"Etiquetas",devToolsLabel:"Herramientas para desarrolladores de temas",hideInstalledLabel:"Esconder instalado cuando buscando",colourShiftLabel:"Cambiar colores cada minuto",tabsHeading:"Pestañas",resetHeading:"Reestablecer",resetBtn:"$t(settings.resetHeading)",resetDescription:"Borrar todas estensiones and temas, y borrar preferencias",backupHeading:"Haz una copia/Reestablecer desde una copia",backupLabel:"Haz una copia o reestablece todos los datos de Marketplace desde una copia. Esto no incluye ajustes para las cosas instaladas con Marketplace.",backupBtn:"Abrir"},tabs:{Extensions:"Extensiónes",Themes:"Temas",Snippets:"Codigos",Apps:"Aplicaciones",Installed:"Instalados"},snippets:{addTitle:"Añadir Codigo",editTitle:"Editar Codigo",viewTitle:"Ver Codigo",customCSS:"Custom CSS",customCSSPlaceholder:"¡Crea tu propio CSS aqui! Puedes encontrarlos en la pestaña de instalados para administrarlos.",snippetName:"Nombre del codigo",snippetNamePlaceholder:"Asignale un nombre para tu codigo personalizado",snippetDesc:"Descripcion del codigo",snippetDescPlaceholder:"Crea una description para tu codigo personalizado",snippetPreview:"Codigo",optional:"Opcional",addImage:"Añadir imagen",changeImage:"Cambiar imagen",saveCSS:"Guardar CSS"},reloadModal:{title:"Recargar",description:"Una recarga de ventada es necesaria para completar esta operación.",reloadNow:"Recargar ahora",reloadLater:"Recargar después"},backupModal:{title:"$t(settings.backupHeading)",settingsCopied:"Ajustes copiados al portapapeles",noDataPasted:"No data pegado",invalidJSON:"JSON invalido",inputLabel:"Ajustes de Marketplace",inputPlaceholder:"Copia/pega tus ajustes aqui",exportBtn:"Exportar",importBtn:"Importar",fileImportBtn:"Importar desde un archivo"},devTools:{title:"Herramientas de desarrollador de temas",noThemeInstalled:"Error: No tema de marketplace instalado",noThemeManifest:"Error: No manifiesto de tema encontrado",colorIniEditor:"Editor de Color.ini",colorIniEditorPlaceholder:"[nombre-de-esquema-de-color]",invalidCSS:"CSS invalido"},grid:{spicetifyMarketplace:"Marketplace de Spicetify",newUpdate:"Nueva actualización",addCSS:"Añadir CSS",search:"Buscar",installed:"Instalado",lastUpdated:"Ultima actualización {{val, datetime}}",externalJS:"JS external",dark:"oscuro",light:"claro"},readmePage:{title:"$t(grid.spicetifyMarketplace) - Readme",loading:"Cargando...",errorLoading:"Error cargando README"},github:"GitHub",install:"Instalar",remove:"Borrar",save:"Guardar",colour_one:"color",colour_other:"colores",favourite:"favorito"}},fr:{translation:{settings:{title:"Réglages",optionsHeading:"Options",starCountLabel:"Nombres d’étoiles",tagsLabel:"Tags",devToolsLabel:"Outils pour les développeurs de thèmes",hideInstalledLabel:"Masquer ceux étant installés lors de la navigation",colourShiftLabel:"Changer de couleure chaque minutes",tabsHeading:"Onglets",resetHeading:"Réinitialiser",resetBtn:"$t(settings.resetHeading)",resetDescription:"Désinstaller toutes les extensions et tous les thèmes, ainsi que l’ensemble des réglages",backupHeading:"Sauvegarde/Restauration",backupLabel:"Sauvegarder ou restaurer toutes les données du Marché. Celà n'inclue pas les réglages pour quoi que ce soit installé depuis le Marché.",backupBtn:"Ouvrir"},tabs:{Extensions:"Extensions",Themes:"Thèmes",Snippets:"Bribes",Apps:"Applications",Installed:"Installé(s)"},snippets:{addTitle:"Ajouter Bribe",editTitle:"Éditer Bribe",viewTitle:"Voir Bribe",customCSS:"CSS personnalisé",customCSSPlaceholder:"Insérez votre propre CSS personnalisé ici! Vous pouvez les retrouver dans l’onglet Installé pour les gérrer.",snippetName:"Nom de la bribe",snippetNamePlaceholder:"Entrer un nom pour votre bribe personnalisée",snippetDesc:"Description de la bribe",snippetDescPlaceholder:"Entrez une description pour votre bribe personnalisée",snippetPreview:"Prévisualiser la bribe",optional:"Optionnel",addImage:"Ajouter une image",changeImage:"Changer l’image",saveCSS:"Enregistrer le CSS"},reloadModal:{title:"Recharger",description:"Un rechargement de la page est requis pour finaliser cette opération.",reloadNow:"Recharger maintenant",reloadLater:"Recharger plus tard"},backupModal:{title:"Sauvegarder/Restaurer",settingsCopied:"Réglages copiés dans le presse-papier",noDataPasted:"Aucune donnée collée",invalidJSON:"JSON invalide",inputLabel:"Réglages du Marché",inputPlaceholder:"Copier/coller vos réglages ici",exportBtn:"Exporter",importBtn:"Importer",fileImportBtn:"Importer depuis un fichier"},devTools:{title:"Outils de développeurs de thèmes",noThemeInstalled:"Erreur: Aucun thème du marché n’est installé",noThemeManifest:"Erreur: Aucun manifeste de thème trouvé",colorIniEditor:"Éditeur Color.ini",colorIniEditorPlaceholder:"[nom-de-votre-schéma-de-couleur]",invalidCSS:"CSS invalide"},grid:{spicetifyMarketplace:"Marché Spicetify",newUpdate:"Nouvelle mise à jour",addCSS:"Ajouter CSS",search:"Rechercher",installed:"Installé",lastUpdated:"Dernière mise à jour {{val, datetime}}",externalJS:"JS externe",dark:"sombre",light:"clair"},readmePage:{title:"$t(grid.spicetifyMarketplace) - Readme",loading:"Chargement…",errorLoading:"Erreur lors du chargement du README"},github:"GitHub",install:"Installer",remove:"Supprimer",save:"Enregistrer",colour_one:"couleure",colour_other:"couleures",favourite:"favoris"}},"zh-TW":{translation:{settings:{title:"設定",optionsHeading:"選項",starCountLabel:"收藏數",tagsLabel:"標籤",devToolsLabel:"主題開發者工具",hideInstalledLabel:"瀏覽時隱藏已安裝項目",colourShiftLabel:"每分鐘進行色調偏移",tabsHeading:"分頁",resetHeading:"重設",resetBtn:"$t(settings.resetHeading)",resetDescription:"解除安裝所有擴充套件和主題, 並重設偏好設定",backupHeading:"備份與還原",backupLabel:"備份或還原所有 Marketplace 中的資料(不包含從 Marketplace 安裝的擴充元件的設定)。",backupBtn:"開啟"},tabs:{Extensions:"擴充套件",Themes:"主題",Snippets:"微調片段",Apps:"功能模組",Installed:"已安裝項目"},snippets:{addTitle:"加入微調片段",editTitle:"編輯微調片段",viewTitle:"檢視微調片段",customCSS:"自訂 CSS",customCSSPlaceholder:"這裡可以輸入您的自訂 CSS!您可以在「已安裝項目」分頁中看到這些片段,進而進行管理。",snippetName:"微調片段名稱",snippetNamePlaceholder:"輸入自訂微調片段的名稱",snippetDesc:"微調片段描述",snippetDescPlaceholder:"輸入自訂微調片段的描述",snippetPreview:"微調片段預覽圖",optional:"非必須",addImage:"加入影像",changeImage:"更改影像",saveCSS:"儲存 CSS"},reloadModal:{title:"重新載入",description:"需要重新載入頁面,才能完成這個操作。",reloadNow:"立即重新載入",reloadLater:"稍後重新載入"},backupModal:{title:"$t(settings.backupHeading)",settingsCopied:"已將設定複製至剪貼簿",noDataPasted:"沒有貼上資料",invalidJSON:"JSON 無效",inputLabel:"Marketplace 設定",inputPlaceholder:"在此複製或貼上設定",exportBtn:"匯出",importBtn:"匯入",fileImportBtn:"從檔案匯入"},devTools:{title:"主題開發者工具",noThemeInstalled:"錯誤:沒有安裝 Marketplace 主題",noThemeManifest:"錯誤:找不到主題資訊清單",colorIniEditor:"Color.ini 編輯器",colorIniEditorPlaceholder:"[您的色彩配置名稱]",invalidCSS:"CSS 無效"},grid:{spicetifyMarketplace:"Spicetify Marketplace",newUpdate:"有更新",addCSS:"加入 CSS",search:"搜尋",installed:"已經安裝",lastUpdated:"上次更新於 {{val, datetime}}",externalJS:"有外部 JS",dark:"暗色",light:"亮色"},readmePage:{title:"$t(grid.spicetifyMarketplace) – 說明",loading:"正在載入……",errorLoading:"載入 README 時發生錯誤"},github:"GitHub",install:"安裝",remove:"移除",save:"儲存",colour_one:"色彩",colour_other:"色彩",favourite:"收藏"}},"zh-CN":{translation:{settings:{title:"设置",optionsHeading:"选项",starCountLabel:"收藏数",tagsLabel:"标签",devToolsLabel:"主題开发者工具",hideInstalledLabel:"浏览时隐藏已安装项目",colourShiftLabel:"每分钟进行色调偏移",tabsHeading:"分页",resetHeading:"重置",resetBtn:"$t(settings.resetHeading)",resetDescription:"卸载所有扩展插件和主题,并重置设置"},tabs:{Extensions:"扩展插件",Themes:"主题",Snippets:"微调片段",Apps:"功能模组",Installed:"已安裝项目"},snippets:{addTitle:"加入微调片段",editTitle:"编辑微调片段",viewTitle:"检视微调片段",customCSS:"自定义 CSS",customCSSPlaceholder:"这里可以输入您的自定义 CSS!您可以在「已安裝项目」标签页中看到这些片段,进而进行管理。",snippetName:"微调片段名称",snippetNamePlaceholder:"输入自定义微调片段的名称",snippetDesc:"微调片段描述",snippetDescPlaceholder:"输入自定义微调片段的描述",snippetPreview:"微调片段预览图",optional:"非必要",addImage:"加入影像",changeImage:"更改影像",saveCSS:"保存 CSS"},reloadModal:{title:"重新加载",description:"需要重新加载页面,才能完成这个操作。",reloadNow:"立即重新加载",reloadLater:"稍后重新加载"},devTools:{title:"主題开发者工具",noThemeInstalled:"错误:未安装商场主题",noThemeManifest:"错误:找不到主题内容清单",colorIniEditor:"Color.ini 编辑器",colorIniEditorPlaceholder:"[您的色彩配置名称]",invalidCSS:"CSS 无效"},grid:{spicetifyMarketplace:"Spicetify 商场",newUpdate:"有更新",addCSS:"加入 CSS",search:"搜索",installed:"已安装",lastUpdated:"上次更新于 {{val, datetime}}",externalJS:"有外部 JS",dark:"暗色模式",light:"亮色模式"},readmePage:{title:"$t(grid.spicetifyMarketplace) – 说明",loading:"正在加载……",errorLoading:"加载 README 时发生错误"},github:"GitHub",install:"安裝",remove:"移除",save:"保存",colour_one:"色彩",colour_other:"色彩",favourite:"收藏"}}},detection:{order:["navigator","htmlTag"]},fallbackLng:"en",interpolation:{escapeValue:!1}}),class extends rt.default.Component{constructor(e){super(e),this.state={count:0,CONFIG:{}},this.updateConfig=e=>{this.CONFIG=l({},e),console.debug("updated config",this.CONFIG),this.setState({CONFIG:l({},e)})};e=w(E.tabs,null);let t=[];try{if(t=JSON.parse(e),!Array.isArray(t))throw new Error("Could not parse marketplace tabs key");if(0===t.length)throw new Error("Empty marketplace tabs key");if(0!e).length)throw new Error("Falsey marketplace tabs key")}catch(e){t=hn,localStorage.setItem(E.tabs,JSON.stringify(t))}let r={},n=null;try{var a=w(E.themeInstalled,null);if(a){var o=w(a,null);if(!o)throw new Error("No installed theme data");r=o.schemes,n=o.activeScheme}else console.debug("No theme set as installed")}catch(e){console.error(e)}this.CONFIG={visual:{stars:JSON.parse(w("marketplace:stars",!0)),tags:JSON.parse(w("marketplace:tags",!0)),hideInstalled:JSON.parse(w("marketplace:hideInstalled",!1)),colorShift:JSON.parse(w("marketplace:colorShift",!1)),themeDevTools:JSON.parse(w("marketplace:themeDevTools",!1)),albumArtBasedColors:JSON.parse(w("marketplace:albumArtBasedColors",!1)),albumArtBasedColorsMode:w("marketplace:albumArtBasedColorsMode")||"monochrome-light",albumArtBasedColorsVibrancy:w("marketplace:albumArtBasedColorsVibrancy")||"PROMINENT",type:JSON.parse(w("marketplace:type",!1)),followers:JSON.parse(w("marketplace:followers",!1))},tabs:t,activeTab:w(E.activeTab,t[0]),theme:{activeThemeKey:w(E.themeInstalled,null),schemes:r,activeScheme:n}},this.CONFIG.activeTab&&this.CONFIG.tabs.filter(e=>e.name===this.CONFIG.activeTab).length||(this.CONFIG.activeTab=this.CONFIG.tabs[0].name)}render(){var e,{location:t,replace:r}=Spicetify.Platform.History;return t.pathname===mn+"/readme"?null!=(e=t.state)&&e.data?rt.default.createElement(Xa,{title:g("readmePage.title"),data:t.state.data}):(r(mn),null):rt.default.createElement(Wa,{title:g("grid.spicetifyMarketplace"),CONFIG:this.CONFIG,updateAppConfig:this.updateConfig})}}),Ya=qr()(Ge),Qa=t(b());return Ve=Ze,W(j({},"__esModule",{value:!0}),Ve)})();const render=()=>marketplace.default();
\ No newline at end of file
+`,"");t.innerHTML=e,t.classList.add("marketplaceSnippets"),document.body.appendChild(t)},wa=(e,t)=>{let a=[];return e&&0({name:e.name,url:Pa(e.url)})):a.push({name:t,url:"https://github.com/"+t}),a},Ea=e=>e?Object.keys(e).map(e=>({key:e,value:e})):[],Ca=e=>[{key:"stars",value:e("grid.sort.stars")},{key:"newest",value:e("grid.sort.newest")},{key:"oldest",value:e("grid.sort.oldest")},{key:"lastUpdated",value:e("grid.sort.lastUpdated")},{key:"mostStale",value:e("grid.sort.mostStale")},{key:"a-z",value:e("grid.sort.aToZ")},{key:"z-a",value:e("grid.sort.zToA")}],Na=(...e)=>{console.debug("Resetting Marketplace");const t=[];0===e.length&&Object.keys(localStorage).forEach(e=>{e.startsWith("marketplace:")&&t.push(e)}),e.forEach(e=>{switch(e){case"extensions":t.push(...C(w.installedExtensions,[])),t.push(w.installedExtensions);break;case"snippets":t.push(...C(w.installedSnippets,[])),t.push(w.installedSnippets);break;case"theme":t.push(...C(w.installedThemes,[])),t.push(w.installedThemes),t.push(w.themeInstalled);break;default:console.error("Unknown category: "+e)}}),t.forEach(e=>{localStorage.removeItem(e),console.debug("Removed "+e)}),console.debug("Marketplace has been reset"),location.reload()},xa=a=>{var e=document.querySelector("style.marketplaceCSS.marketplaceScheme");if(e&&e.remove(),a){e=document.createElement("style");e.classList.add("marketplaceCSS"),e.classList.add("marketplaceScheme");let t=":root {";Object.keys(a).forEach(e=>{t=(t+=`--spice-${e}: #${a[e]};`)+`--spice-rgb-${e}: ${(e=>{if(3===e.length)e=e.split("").map(e=>e+e).join("");else{if(6!=e.length)throw"Only 3- or 6-digit hex colours are allowed.";if(e.match(/[^0-9a-f]/i))throw"Only hex colours are allowed."}e=e.match(/.{1,2}/g);if(e&&3===e.length)return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)];throw"Could not parse hex colour."})(a[e])};`}),t+="}",e.innerHTML=t,document.body.appendChild(e)}},Ia=e=>{try{var t,a,r=document.querySelector("link[href='user.css']"),n=(r&&r.remove(),document.querySelector("style.marketplaceCSS.marketplaceUserCSS"));n&&n.remove(),e?((t=document.createElement("style")).classList.add("marketplaceCSS"),t.classList.add("marketplaceUserCSS"),t.innerHTML=e,document.body.appendChild(t)):((a=document.createElement("link")).setAttribute("rel","stylesheet"),a.setAttribute("href","user.css"),a.classList.add("userCSS"),document.body.appendChild(a))}catch(e){console.warn(e)}},La=async(e,t)=>{if(!e.cssURL)throw new Error("No CSS URL provided");t||=await async function(){for(const e of["net","xyz"])try{if("opaqueredirect"===(await fetch("https://cdn.jsdelivr."+e,{redirect:"manual",cache:"no-cache"})).type)return e}catch(e){console.error(e);continue}}();var t=(e=>{const t=new URL(e);return t.host,t.host==="raw.githubusercontent.com"})(e.cssURL)?`https://cdn.jsdelivr.${t}/gh/${e.user}/${e.repo}@${e.branch}/`+e.manifest.usercss:e.cssURL,a=t.replace("/user.css","/assets/");console.debug("Parsing CSS: ",t);let r=await fetch(t+"?time="+Date.now()).then(e=>e.text());for(const i of r.matchAll(/url\(['|"](?.+?)['|"]\)/gm)||[]){var n,o=i?.groups?.path;!o||o.startsWith("http")||o.startsWith("data")||(n=a+o.replace(/\.\//g,""),r=r.replace(o,n))}return r};function Oa(e,r){e&&e.forEach(e=>{var t=r||e.user+"-"+e.repo,a=window.sessionStorage.getItem(t),a=a?JSON.parse(a):[];a.push(e),window.sessionStorage.setItem(t,JSON.stringify(a))})}async function Ta(e,t,a){try{var r={text:e,context:t+"/"+a,mode:"gfm"},n=await fetch("https://api.github.com/markdown",{method:"POST",body:JSON.stringify(r)});if(n.ok)return await n.text();throw Spicetify.showNotification(y("notifications.markdownParsingError",{status:n.status}),!0)}catch(e){return null}}function Aa(e){var t="snippet"===e.type?"snippet:":`${e.item.user}/${e.item.repo}/`;let a;switch(e.type){case"snippet":a=e.item.title.replaceAll(" ","-");break;case"theme":a=e.item.manifest?.usercss||"";break;case"extension":a=e.item.manifest?.main||"";break;case"app":a=e.item.manifest?.name?.replaceAll(" ","-")||""}return"marketplace:installed:"+t+a}var Pa=e=>{var t=decodeURI(e).trim().toLowerCase();return t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:")?"about:blank":e},_a=(e,t)=>{e=e.title||e?.manifest?.name||"",t=t.title||t?.manifest?.name||"";return e.localeCompare(t)},Ra=(e,t)=>{return void 0===e.created||void 0===t.created?0:(e=new Date(e.created),new Date(t.created).getTime()-e.getTime())},Ma=(e,t)=>{return void 0===e.lastUpdated||void 0===t.lastUpdated?0:(e=new Date(e.lastUpdated),new Date(t.lastUpdated).getTime()-e.getTime())},ja=(e,t)=>{switch(t){case"a-z":e.sort((e,t)=>_a(e,t));break;case"z-a":e.sort((e,t)=>_a(t,e));break;case"newest":e.sort((e,t)=>Ra(e,t));break;case"oldest":e.sort((e,t)=>Ra(t,e));break;case"lastUpdated":e.sort((e,t)=>Ma(e,t));break;case"mostStale":e.sort((e,t)=>Ma(t,e));break;default:e.sort((e,t)=>t.stars-e.stars)}};var c=t(b()),f=t(b()),$a=t(_e()),Da=t(Re()),za=(i=Prism,a=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+a.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+a.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+a.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+a.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:a,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css,(a=i.languages.markup)&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css")),t(b())),Ua="button-module__button___hf2qg_marketplace",Fa="button-module__circle___EZ88P_marketplace",g=e=>{var t=e.type||"round",a=[Ua];return"circle"===t&&a.push(Fa),e.classes&&a.push(...e.classes),za.default.createElement("button",{className:a.join(" "),onClick:e.onClick,"aria-label":e.label||"",disabled:e.disabled},e.children)},Ba=r=>{var e="marketplace-customCSS-preview";const[n,t]=f.default.useState("ADD_SNIPPET"!==r.type&&r.content?.item.code||""),[a,o]=f.default.useState("ADD_SNIPPET"!==r.type&&r.content?.item.title||""),[i,s]=f.default.useState("ADD_SNIPPET"!==r.type&&r.content?.item.description||""),[l,c]=f.default.useState("ADD_SNIPPET"!==r.type&&r.content?.item.imageURL||""),u=()=>a.replace(/\n/g,"").replaceAll(" ","-");const d="marketplace:installed:snippet:"+u(),[p,h]=f.default.useState(!!C(d));let m;return f.default.createElement("div",{id:"marketplace-add-snippet-container"},f.default.createElement("div",{className:"marketplace-customCSS-input-container"},f.default.createElement("label",{htmlFor:"marketplace-custom-css"},y("snippets.customCSS")),f.default.createElement("div",{className:"marketplace-code-editor-wrapper marketplace-code-editor"},f.default.createElement($a.default,{value:n,onValueChange:e=>t(e),highlight:e=>(0,Da.highlight)(e,Da.languages.css),textareaId:"marketplace-custom-css",textareaClassName:"snippet-code-editor",readOnly:"VIEW_SNIPPET"===r.type,placeholder:y("snippets.customCSSPlaceholder"),style:{}}))),f.default.createElement("div",{className:"marketplace-customCSS-input-container"},f.default.createElement("label",{htmlFor:"marketplace-customCSS-name-submit"},y("snippets.snippetName")),f.default.createElement("input",{id:"marketplace-customCSS-name-submit",className:"marketplace-code-editor",value:a,onChange:e=>{"VIEW_SNIPPET"!==r.type&&o(e.target.value)},placeholder:y("snippets.snippetNamePlaceholder")})),f.default.createElement("div",{className:"marketplace-customCSS-input-container"},f.default.createElement("label",{htmlFor:"marketplace-customCSS-description-submit"},y("snippets.snippetDesc")),f.default.createElement("input",{id:"marketplace-customCSS-description-submit",className:"marketplace-code-editor",value:i,onChange:e=>{"VIEW_SNIPPET"!==r.type&&s(e.target.value)},placeholder:y("snippets.snippetDescPlaceholder")})),f.default.createElement("div",{className:"marketplace-customCSS-input-container"},f.default.createElement("label",{htmlFor:e},y("snippets.snippetPreview")," ","VIEW_SNIPPET"!==r.type&&`(${y("snippets.optional")})`),l&&f.default.createElement("label",{htmlFor:e,style:{textAlign:"center"}},f.default.createElement("img",{className:"marketplace-customCSS-image-preview",src:l,alt:"Preview"}))),"VIEW_SNIPPET"!==r.type&&f.default.createElement(f.default.Fragment,null,f.default.createElement(g,{onClick:()=>{m.click()}},l.length?y("snippets.changeImage"):y("snippets.addImage"),f.default.createElement("input",{id:e,type:"file",style:{display:"none"},ref:e=>m=e,onChange:async e=>{if(e.target.files?.[0])try{r=e.target.files?.[0];var t=await new Promise((e,t)=>{const a=new FileReader;a.readAsDataURL(r),a.onload=()=>{e(a.result)},a.onerror=e=>{t(e)}});t&&c(t)}catch(e){console.error(e)}var r}})),f.default.createElement(g,{onClick:()=>{var e,t=u(),a=i.trim();p&&"EDIT_SNIPPET"!==r.type?Spicetify.showNotification(y("snippets.duplicateName"),!0):(console.debug("Installing snippet: "+t),r.content&&r.content.item.title!==t&&(console.debug("Deleting outdated snippet: "+r.content.item.title),localStorage.removeItem("marketplace:installed:snippet:"+r.content.item.title),e=C(w.installedSnippets,[]).filter(e=>e!=="marketplace:installed:snippet:"+r.content?.item.title),localStorage.setItem(w.installedSnippets,JSON.stringify(e))),localStorage.setItem(d,JSON.stringify({title:t,code:n,description:a,imageURL:l,custom:!0})),-1===(e=C(w.installedSnippets,[])).indexOf(d)&&(e.push(d),localStorage.setItem(w.installedSnippets,JSON.stringify(e))),t=e.map(e=>C(e)),ka(t),Spicetify.PopupModal.hide(),"EDIT_SNIPPET"===r.type&&location.reload())},disabled:!u()||!n.replace(/\n/g,"\\n")},y("snippets.saveCSS"))),"VIEW_SNIPPET"===r.type&&f.default.createElement(g,{onClick:()=>{r.callback&&r.callback(),h(!p)}},p?y("remove"):y("install")))},Va=t(b()),Ha=()=>Va.default.createElement("div",{id:"marketplace-reload-container"},Va.default.createElement("p",null,y("reloadModal.description")),Va.default.createElement("div",{className:"marketplace-reload-modal__button-container"},Va.default.createElement(g,{onClick:()=>{Spicetify.PopupModal.hide(),location.reload()}},y("reloadModal.reloadNow")),Va.default.createElement(g,{onClick:()=>{Spicetify.PopupModal.hide()}},y("reloadModal.reloadLater")))),u=t(b()),d=t(b()),qa=t(b()),Ga="toggle-module__toggle-wrapper___ocE5z_marketplace",Ka="toggle-module__disabled___OYAYf_marketplace",Ja="toggle-module__toggle-input___ceLM4_marketplace",Wa="toggle-module__toggle-indicator-wrapper___6Lcp0_marketplace",Xa="toggle-module__toggle-indicator___nCxwE_marketplace",Za=e=>{var t="toggle:"+e.storageKey,a=[Ga];return!1===e.clickable&&a.push(Ka),qa.default.createElement("label",{className:a.join(" ")},qa.default.createElement("input",{className:Ja,type:"checkbox",checked:e.enabled,"data-storage-key":e.storageKey,id:t,title:"Toggle for "+e.storageKey,onChange:e.onChange}),qa.default.createElement("span",{className:Wa},qa.default.createElement("span",{className:Xa})))},Ya=t(b()),Qa=t(e()),er=t=>{var e=t.sortBoxOptions.map(e=>({value:e.key,label:e.value})),a=t.sortBoxOptions.find(t.sortBySelectedFn);return Ya.default.createElement("div",{className:"marketplace-sortBox"},Ya.default.createElement("div",{className:"marketplace-sortBox-header"},Ya.default.createElement("div",{className:"marketplace-sortBox-header-title"}),Ya.default.createElement(Qa.default,{placeholder:"Select an option",options:e,value:a?.key,onChange:e=>{t.onChange(e.value)}})))},tr=t(b()),ar=()=>tr.default.createElement("svg",{role:"img",height:"16",width:"16",className:"Svg-sc-ytk21e-0 uPxdw nW1RKQOkzcJcX6aDCZB4",viewBox:"0 0 16 16"},tr.default.createElement("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8z"}),tr.default.createElement("path",{d:"M7.25 12.026v-1.5h1.5v1.5h-1.5zm.884-7.096A1.125 1.125 0 007.06 6.39l-1.431.448a2.625 2.625 0 115.13-.784c0 .54-.156 1.015-.503 1.488-.3.408-.7.652-.973.818l-.112.068c-.185.116-.26.203-.302.283-.046.087-.097.245-.097.57h-1.5c0-.47.072-.898.274-1.277.206-.385.507-.645.827-.846l.147-.092c.285-.177.413-.257.526-.41.169-.23.213-.397.213-.602 0-.622-.503-1.125-1.125-1.125z"})),rr=window.Spicetify,p=a=>{var e=a.type,t="dropdown"===e?"dropdown:"+a.storageKey:"toggle:"+a.storageKey,r=!!a.modalConfig.visual[a.storageKey];return void 0!==a.description&&null!==a.description||(a.description=""),"dropdown"===e&&a.options?d.default.createElement("div",{className:"settings-row"},d.default.createElement("label",{htmlFor:t,className:"col description"},a.name),d.default.createElement("div",{className:"col action"},d.default.createElement(er,{sortBoxOptions:a.options.map(e=>({key:e,value:e})),onChange:e=>{return e=e,t=a.storageKey,a.modalConfig.visual[t]=e,localStorage.setItem("marketplace:"+t,String(e)),void a.updateConfig(a.modalConfig);var t},sortBySelectedFn:e=>e.key==a.modalConfig.visual[a.storageKey]}),d.default.createElement(rr.ReactComponent.TooltipWrapper,{label:d.default.createElement(d.default.Fragment,null,a.description.split("\n").map(e=>d.default.createElement(d.default.Fragment,null,e,d.default.createElement("br",null)))),renderInline:!0,showDelay:10,placement:"top",labelClassName:"marketplace-settings-tooltip",disabled:!1},d.default.createElement("div",{className:"marketplace-tooltip-icon"},d.default.createElement(ar,null))))):d.default.createElement("div",{className:"settings-row"},d.default.createElement("label",{htmlFor:t,className:"col description"},a.name),d.default.createElement("div",{className:"col action"},d.default.createElement(Za,{name:a.name,storageKey:a.storageKey,enabled:r,onChange:e=>{var t=e.target.checked,e=e.target.dataset.storageKey;a.modalConfig.visual[e]=t,console.debug(`toggling ${e} to `+t),localStorage.setItem("marketplace:"+e,String(t)),a.updateConfig(a.modalConfig)}})))},h=t(b()),nr=r=>{var e="toggle:"+r.name;const t=r.modalConfig.tabs.reduce((e,t,a)=>t.name===r.name?a:e,-1);var a=r.modalConfig.tabs[t]["enabled"];function n(e,t){var t=e+t,a=r.modalConfig.tabs[t];r.modalConfig.tabs[t]=r.modalConfig.tabs[e],r.modalConfig.tabs[e]=a,localStorage.setItem(w.tabs,JSON.stringify(r.modalConfig.tabs)),r.updateConfig(r.modalConfig)}return h.default.createElement("div",{className:"settings-row"},h.default.createElement("label",{htmlFor:e,className:"col description"},y("tabs."+r.name)),h.default.createElement("div",{className:"col action"},h.default.createElement("button",{title:"Move up",className:"arrow-btn",disabled:0===t,onClick:()=>n(t,-1)},h.default.createElement("svg",{height:"16",width:"16",viewBox:"0 0 16 16",fill:"currentColor",dangerouslySetInnerHTML:{__html:String(Spicetify.SVGIcons["chart-up"])}})),h.default.createElement("button",{title:"Move down",className:"arrow-btn",disabled:t===r.modalConfig.tabs.length-1,onClick:()=>n(t,1)},h.default.createElement("svg",{height:"16",width:"16",viewBox:"0 0 16 16",fill:"currentColor",dangerouslySetInnerHTML:{__html:String(Spicetify.SVGIcons["chart-down"])}})),h.default.createElement(Za,{name:r.name,storageKey:"tab:"+r.name,clickable:"Extensions"!==r.name,enabled:a,onChange:e=>{r.modalConfig.tabs[t].enabled=e.target.checked,localStorage.setItem(w.tabs,JSON.stringify(r.modalConfig.tabs)),r.updateConfig(r.modalConfig)}})))},or=async()=>{const e=new MutationObserver(async()=>{var t;document.querySelector(".GenericModal[aria-label='Settings']")||(t=100,await new Promise(e=>setTimeout(e,t)),N("BACKUP"),e.disconnect())});e.observe(document.body,{childList:!0,subtree:!0}),Spicetify.PopupModal.hide()},ir=({CONFIG:e,updateAppConfig:t})=>{const[a,r]=u.default.useState({...e}),[n,o]=u.default.useState(y("settings.versionBtn")),i=e=>{t({...e}),r({...e})};e=document.querySelector("body > generic-modal button.main-trackCreditsModal-closeBtn");const s=document.querySelector("body > generic-modal > div");e&&s&&(e.onclick=()=>location.reload(),e.setAttribute("style","cursor: pointer;"),s.onclick=e=>{e.target===s&&location.reload()});e=C(w.albumArtBasedColor)?u.default.createElement(u.default.Fragment,null,u.default.createElement(p,{name:y("settings.albumArtBasedColorsMode"),storageKey:"albumArtBasedColorsMode",modalConfig:a,updateConfig:i,type:"dropdown",options:["monochromeDark","monochromeLight","analogicComplement","analogic","triad","quad"],description:y("settings.almbumArtColorsModeToolTip")}),u.default.createElement(p,{name:y("settings.albumArtBasedColorsVibrancy"),storageKey:"albumArtBasedColorsVibrancy",modalConfig:a,updateConfig:i,type:"dropdown",options:["desaturated","lightVibrant","prominent","vibrant"],description:y("settings.albumArtBasedColorsVibrancyToolTip")})):null;return u.default.createElement("div",{id:"marketplace-config-container"},u.default.createElement("h2",{className:"settings-heading"},y("settings.optionsHeading")),u.default.createElement(p,{name:y("settings.starCountLabel"),storageKey:"stars",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.tagsLabel"),storageKey:"tags",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.showArchived"),storageKey:"showArchived",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.devToolsLabel"),storageKey:"themeDevTools",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.hideInstalledLabel"),storageKey:"hideInstalled",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.colourShiftLabel"),storageKey:"colorShift",modalConfig:a,updateConfig:i}),u.default.createElement(p,{name:y("settings.albumArtBasedColors"),storageKey:"albumArtBasedColors",modalConfig:a,updateConfig:i}),e,u.default.createElement("h2",{className:"settings-heading"},y("settings.tabsHeading")),u.default.createElement("div",{className:"tabs-container"},a.tabs.map(({name:e},t)=>u.default.createElement(nr,{key:t,name:e,modalConfig:a,updateConfig:i}))),u.default.createElement("h2",{className:"settings-heading"},y("settings.resetHeading")),u.default.createElement("div",{className:"settings-row"},u.default.createElement("label",{className:"col description"},y("settings.resetDescription")),u.default.createElement("div",{className:"col action"},u.default.createElement(g,{onClick:()=>Na()},y("settings.resetBtn")))),u.default.createElement("h2",{className:"settings-heading"},y("settings.backupHeading")),u.default.createElement("div",{className:"settings-row"},u.default.createElement("label",{className:"col description"},y("settings.backupLabel")),u.default.createElement("div",{className:"col action"},u.default.createElement(g,{onClick:or},y("settings.backupBtn")))),u.default.createElement("h2",null,y("settings.versionHeading")),u.default.createElement("div",{className:"setting-row"},u.default.createElement("label",{className:"col description"},y("grid.spicetifyMarketplace")," ",ma),u.default.createElement("div",{className:"col action"},u.default.createElement(g,{onClick:()=>{Spicetify.Platform.ClipboardAPI.copy(ma),o(y("settings.versionCopied")),setTimeout(()=>o(y("settings.versionBtn")),3e3)}},n))))},m=t(b()),sr=t(_e()),lr=t(Re()),cr=(Prism.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/},localStorage.getItem(w.themeInstalled)),ur=cr?C(cr):null,dr=()=>{const[a,t]=m.default.useState(ur?(e=>{let t="";for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a))if("object"==typeof e[a]){t+=`[${a}]
+`;for(const r in e[a])Object.prototype.hasOwnProperty.call(e[a],r)&&(t+=`${r}=${e[a][r]}
+`)}else t+=`${a}=${e[a]}
+`;return t})(ur.schemes):y("devTools.noThemeInstalled"));return m.default.createElement("div",{id:"marketplace-theme-dev-tools-container",className:"marketplace-theme-dev-tools-container"},m.default.createElement("div",{className:"devtools-column"},m.default.createElement("label",{htmlFor:"color-ini-editor"},m.default.createElement("h2",{className:"devtools-heading"},y("devTools.colorIniEditor"))),m.default.createElement("div",{className:"marketplace-code-editor-wrapper marketplace-code-editor"},m.default.createElement(sr.default,{value:a,onValueChange:e=>t(e),highlight:e=>(0,lr.highlight)(e,lr.languages.ini),textareaId:"color-ini-editor",textareaClassName:"color-ini-editor",readOnly:!ur,placeholder:y("devTools.colorIniEditorPlaceholder"),style:{fontFamily:"monospace",resize:"none"}})),m.default.createElement(g,{onClick:()=>{var e=a;{var t;cr?(t=Sa(e),ur.schemes=t,localStorage.setItem(cr,JSON.stringify(ur))):Spicetify.showNotification(y("devTools.noThemeManifest"),!0)}}},y("save"))),m.default.createElement("div",{className:"devtools-column"},m.default.createElement("h2",{className:"devtools-heading"},y("devTools.invalidCSS")),m.default.createElement("div",{className:"marketplace-code-editor-wrapper marketplace-code-editor"},function(){var e=document.querySelector("body > style.marketplaceCSS.marketplaceUserCSS")?.innerHTML,t=new RegExp(".-?[_a-zA-Z]+[_a-zA-Z0-9-]*\\s*{","g");if(!e)return["Error: Class name list not found; please create an issue"];var a=[];for(const o of e.matchAll(t)){var r=o[0].replace(/{/g,"").trim(),n=r.split(" ");let t;for(let e=0;em.default.createElement("div",{key:t,className:"invalid-css-text"},e)))))},v=t(b()),pr=t(_e()),hr=t(Re()),mr=(Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,()=>{const[e,t]=v.default.useState("");const a=t=>{if(t){let e;try{e=JSON.parse(t)}catch(e){return void Spicetify.showNotification(y("backupModal.invalidJSON"))}var a;a=e,console.debug("Importing Marketplace"),Na(),Object.keys(a).forEach(e=>{localStorage.setItem(e,a[e]),console.debug("Imported "+e)}),location.reload()}else Spicetify.showNotification(y("backupModal.noDataPasted"))};return v.default.createElement("div",{id:"marketplace-backup-container"},v.default.createElement("div",{className:"marketplace-backup-input-container"},v.default.createElement("label",{htmlFor:"marketplace-backup"},y("backupModal.inputLabel")),v.default.createElement("div",{className:"marketplace-code-editor-wrapper marketplace-code-editor"},v.default.createElement(pr.default,{value:e,onValueChange:e=>t(e),highlight:e=>(0,hr.highlight)(e,hr.languages.css),textareaId:"marketplace-import-text",textareaClassName:"import-textarea",readOnly:!1,className:"marketplace-code-editor-textarea",placeholder:y("backupModal.inputPlaceholder"),style:{}}))),v.default.createElement(v.default.Fragment,null,v.default.createElement(g,{classes:["marketplace-backup-button"],onClick:()=>{var e=(()=>{const t={};return Object.keys(localStorage).forEach(e=>{e.startsWith("marketplace:")&&(t[e]=localStorage.getItem(e))}),t})();Spicetify.Platform.ClipboardAPI.copy(JSON.stringify(e)),Spicetify.showNotification(y("backupModal.settingsCopied")),Spicetify.PopupModal.hide()}},y("backupModal.exportBtn")),v.default.createElement(g,{classes:["marketplace-backup-button"],onClick:()=>{a(e)}},y("backupModal.importBtn")),v.default.createElement(g,{classes:["marketplace-backup-button"],onClick:async()=>{var e=await(await(await window.showOpenFilePicker())[0].getFile()).text();a(e)}},y("backupModal.fileImportBtn"))))}),S=t(b());var fr=function(){const[e,t]=S.default.useState(null);return S.default.useEffect(()=>{!async function(){try{var{body:e,tag_name:t,message:a}=await(await fetch(ba)).json();return e&&t&&!a?{version:t.replace("v",""),changelog:await Ta(e.match(/## What's Changed([\s\S]*?)(\r\n\r|\n\n##)/)[1],"spicetify","spicetify-marketplace")}:null}catch(e){return console.error(e),null}}().then(e=>t(e))},[]),S.default.createElement("div",{id:"marketplace-update-container"},S.default.createElement("div",{id:"marketplace-update-description"},S.default.createElement("h4",null,y("updateModal.description")),S.default.createElement("a",{href:va+"/tag/v1.0.1"},y("updateModal.currentVersion",{version:ma})),S.default.createElement("a",{href:va+"/tag/v"+e?.version},y("updateModal.latestVersion",{version:e?.version}))),S.default.createElement("hr",null),S.default.createElement("div",{id:"marketplace-update-whats-changed"},S.default.createElement("h3",{className:"marketplace-update-header"},y("updateModal.whatsChanged")),S.default.createElement("details",null,S.default.createElement("summary",null,y("updateModal.seeChangelog")),S.default.createElement("ul",{dangerouslySetInnerHTML:{__html:e?.changelog??""}}))),S.default.createElement("hr",null),S.default.createElement("div",{id:"marketplace-update-guide"},S.default.createElement("h3",{className:"marketplace-update-header"},y("updateModal.howToUpgrade")),S.default.createElement("a",{href:"https://github.com/spicetify/spicetify-marketplace/wiki/Installation"},y("updateModal.viewGuide"))))},N=(e,t,a,r,n)=>{e=((e,t,a,r,n)=>{switch(e){case"ADD_SNIPPET":return{title:y("snippets.addTitle"),content:c.default.createElement(Ba,{type:e}),isLarge:!0};case"EDIT_SNIPPET":return{title:y("snippets.editTitle"),content:c.default.createElement(Ba,{type:e,content:r}),isLarge:!0};case"VIEW_SNIPPET":return{title:y("snippets.viewTitle"),content:c.default.createElement(Ba,{type:e,content:r,callback:n}),isLarge:!0};case"RELOAD":return{title:y("reloadModal.title"),content:c.default.createElement(Ha,null),isLarge:!1};case"SETTINGS":return{title:y("settings.title"),content:c.default.createElement(ir,{CONFIG:t,updateAppConfig:a}),isLarge:!0};case"THEME_DEV_TOOLS":return{title:y("devTools.title"),content:c.default.createElement(dr,null),isLarge:!0};case"BACKUP":return{title:y("backupModal.title"),content:c.default.createElement(mr,null),isLarge:!0};case"UPDATE":return{title:y("updateModal.title"),content:c.default.createElement(fr,null),isLarge:!0};default:return{title:"",content:c.default.createElement("div",null),isLarge:!1}}})(e,t,a,r,n),Spicetify.PopupModal.display(e)};async function gr(e,t=1,a=[],r=!1){let n=`https://api.github.com/search/repositories?q=${encodeURIComponent("topic:"+e)}&per_page=100`;t&&(n+="&page="+t);var o=JSON.parse(window.sessionStorage.getItem(e+"-page-"+t)||"null")||await fetch(n).then(e=>e.json()).catch(()=>null);return o?.items?(window.sessionStorage.setItem(e+"-page-"+t,JSON.stringify(o)),{...o,page_count:o.items.length,items:o.items.filter(e=>!a.includes(e.html_url)&&(r||!e.archived))}):(Spicetify.showNotification(y("notifications.tooManyRequests"),!0,5e3),{items:[]})}var Pe=new Blob([`
+ self.addEventListener('message', async (event) => {
+ const url = event.data;
+ const response = await fetch(url);
+ const data = await response.json().catch(() => null);
+ self.postMessage(data);
+ });
+`],{type:"application/javascript"}),vr=URL.createObjectURL(Pe);async function br(e,t,a){var r=e+"-"+t,n=window.sessionStorage.getItem(r),o=JSON.parse(window.sessionStorage.getItem("noManifests")||"[]");if(n)return JSON.parse(n);n=`https://raw.githubusercontent.com/${e}/${t}/${a}/manifest.json`;if(o.includes(n))return null;let i=await async function(e){const r=new Worker(vr);return new Promise(t=>{const a=e=>{r.terminate(),t(e)};r.postMessage(e),r.addEventListener("message",e=>a(e.data),{once:!0}),r.addEventListener("error",()=>a(null),{once:!0})})}(n);return i?(Oa(i=Array.isArray(i)?i:[i],r),i):Oa([n],"noManifests")}async function yr(e,r,n,o=!1){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?.+)\/(?.+)\/contents/);if(!t||!t.groups)return null;const{user:i,repo:s}=t.groups;return(await br(i,s,r)).reduce((e,t)=>{var a=t.branch||r,a={manifest:t,title:t.name,subtitle:t.description,authors:wa(t.authors,i),user:i,repo:s,branch:a,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${i}/${s}/${a}/`+t.preview,extensionURL:t.main.startsWith("http")?t.main:`https://raw.githubusercontent.com/${i}/${s}/${a}/`+t.main,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${i}/${s}/${a}/`+t.readme,stars:n,tags:t.tags};return t&&t.name&&t.description&&t.main&&(o&&localStorage.getItem(`marketplace:installed:${i}/${s}/`+t.main)||e.push(a)),e},[])}catch{return null}}async function Sr(e,r,n){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?.+)\/(?.+)\/contents/);if(!t||!t.groups)return null;const{user:o,repo:i}=t.groups;return(await br(o,i,r)).reduce((e,t)=>{var a=t.branch||r,a={manifest:t,title:t.name,subtitle:t.description,authors:wa(t.authors,o),user:o,repo:i,branch:a,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.preview,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.readme,stars:n,tags:t.tags,cssURL:t.usercss.startsWith("http")?t.usercss:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.usercss,schemesURL:t.schemes?t.schemes.startsWith("http")?t.schemes:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.schemes:null,include:t.include};return t?.name&&t?.usercss&&t?.description&&e.push(a),e},[])}catch{return null}}async function kr(e,r,n){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?.+)\/(?.+)\/contents/);if(!t||!t.groups)return null;const{user:o,repo:i}=t.groups;return(await br(o,i,r)).reduce((e,t)=>{var a=t.branch||r,a={manifest:t,title:t.name,subtitle:t.description,authors:wa(t.authors,o),user:o,repo:i,branch:a,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.preview,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${o}/${i}/${a}/`+t.readme,stars:n,tags:t.tags};return t&&t.name&&t.description&&e.push(a),e},[])}catch{return null}}var wr=async()=>{return(await fetch("https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/blacklist.json").then(e=>e.json()).catch(()=>({}))).repos},Er=async()=>{var e=await fetch("https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/snippets.json").then(e=>e.json()).catch(()=>[]);return e.length?e.reduce((e,t)=>{t={...t};return t.preview&&(t.imageURL=t.preview.startsWith("http")?t.preview:"https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/"+t.preview,delete t.preview),e.push(t),e},[]):[]},Cr=t(b()),Nr=class extends Cr.default.Component{render(){return Cr.default.createElement("div",{onClick:this.props.onClick},Cr.default.createElement("p",{style:{fontSize:100,lineHeight:"65px"}},"»"),Cr.default.createElement("span",{style:{fontSize:20}},"Load more"))}},x=t(b()),xr=()=>x.default.createElement("svg",{width:"100px",height:"100px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},x.default.createElement("circle",{cx:"50",cy:"50",r:"0",fill:"none",stroke:"currentColor",strokeWidth:"2"},x.default.createElement("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"0s"}),x.default.createElement("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"0s"})),x.default.createElement("circle",{cx:"50",cy:"50",r:"0",fill:"none",stroke:"currentColor",strokeWidth:"2"},x.default.createElement("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"-0.5s"}),x.default.createElement("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"-0.5s"}))),Ir=t(b()),Lr=()=>Ir.default.createElement("svg",{role:"img",width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},Ir.default.createElement("path",{d:"M24 13.616v-3.232c-1.651-.587-2.694-.752-3.219-2.019v-.001c-.527-1.271.1-2.134.847-3.707l-2.285-2.285c-1.561.742-2.433 1.375-3.707.847h-.001c-1.269-.526-1.435-1.576-2.019-3.219h-3.232c-.582 1.635-.749 2.692-2.019 3.219h-.001c-1.271.528-2.132-.098-3.707-.847l-2.285 2.285c.745 1.568 1.375 2.434.847 3.707-.527 1.271-1.584 1.438-3.219 2.02v3.232c1.632.58 2.692.749 3.219 2.019.53 1.282-.114 2.166-.847 3.707l2.285 2.286c1.562-.743 2.434-1.375 3.707-.847h.001c1.27.526 1.436 1.579 2.019 3.219h3.232c.582-1.636.75-2.69 2.027-3.222h.001c1.262-.524 2.12.101 3.698.851l2.285-2.286c-.744-1.563-1.375-2.433-.848-3.706.527-1.271 1.588-1.44 3.221-2.021zm-12 2.384c-2.209 0-4-1.791-4-4s1.791-4 4-4 4 1.791 4 4-1.791 4-4 4z",fill:"currentColor"})),Or=t(b()),Tr=()=>Or.default.createElement("svg",{className:"devtools-icon",version:"1.1",viewBox:"1 1 22 22",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg"},Or.default.createElement("g",{className:"devtools-icon-internal",id:"grid_system"}),Or.default.createElement("g",{id:"_icons"},Or.default.createElement("path",{d:"M18,12v-0.9l0.7-5.7C18.8,4.5,18.6,3.7,18,3c-0.6-0.6-1.4-1-2.2-1H8.3C7.4,2,6.6,2.4,6,3C5.4,3.7,5.2,4.5,5.3,5.4L6,11.1 V12c0,1.6,1.3,2.9,2.8,3l-0.4,2.9c-0.1,1,0.2,2.1,0.8,2.9S11,22,12,22s2-0.5,2.7-1.2s1-1.8,0.8-2.9L15.2,15 C16.7,14.9,18,13.6,18,12z M7.5,4.3C7.7,4.1,8,4,8.3,4H13v2c0,0.6,0.4,1,1,1s1-0.4,1-1V4h0.7c0.3,0,0.6,0.1,0.8,0.3 c0.2,0.2,0.3,0.5,0.2,0.8L16.1,10H7.9L7.3,5.1C7.2,4.8,7.3,4.6,7.5,4.3z M13.2,19.4c-0.6,0.7-1.8,0.7-2.4,0 c-0.3-0.4-0.4-0.8-0.4-1.3l0.5-3.2h2.3l0.5,3.2C13.7,18.6,13.5,19.1,13.2,19.4z M15,13h-1h-4H9c-0.6,0-1-0.4-1-1h8 C16,12.6,15.6,13,15,13z"}))),I=t(b()),Ar=t(e()),i=class extends I.default.Component{constructor(e){super(e)}render(){var e=this.props["t"];return this.props.item.enabled?I.default.createElement("li",{className:"marketplace-tabBar-headerItem","data-tab":this.props.item.value,onClick:e=>{e.preventDefault(),this.props.switchTo(this.props.item)}},I.default.createElement("a",{"aria-current":"page",className:"marketplace-tabBar-headerItemLink "+(this.props.item.active?"marketplace-tabBar-active":""),draggable:"false",href:""},I.default.createElement("span",{className:"main-type-mestoBold"},e("tabs."+this.props.item.value)))):null}},Pr=qt()(i),_r=I.default.memo(function({items:e,switchTo:t}){return I.default.createElement("li",{className:"marketplace-tabBar-headerItem"},I.default.createElement(Ar.default,{className:"main-type-mestoBold",options:e,value:"More",placeholder:"More",onChange:t}))}),Rr=e=>{const t=document.querySelector(".Root__main-view .os-resize-observer-host")??document.querySelector(".Root__main-view .os-size-observer");if(!t)return null;const[a,r]=(0,I.useState)(t.clientWidth),n=()=>r(t.clientWidth),o=()=>{var e=document.querySelector(".marketplace-tabBar"),t=document.querySelector(".main-topBar-topbarContentWrapper");e&&t?(e&&t&&"/marketplace"===Spicetify.Platform.History.location.pathname&&(t.appendChild(e),document.querySelector(".main-topBar-container")?.setAttribute("style","contain: unset;")),Spicetify.Platform.History.listen(({pathname:e})=>{"/marketplace"!=e&&(document.querySelector(".marketplace-tabBar")?.remove(),document.querySelector(".main-topBar-container")?.removeAttribute("style"))})):setTimeout(o,100)};return(0,I.useEffect)(()=>{const e=new ResizeObserver(n);return e.observe(t),()=>{e.disconnect()}}),(0,I.useEffect)(()=>{o()}),I.default.createElement(Mr,{windowSize:a,links:e.links,activeLink:e.activeLink,switchCallback:e.switchCallback})},Mr=I.default.memo(function({links:e,activeLink:a,switchCallback:t,windowSize:r=1/0}){const n=I.default.useRef(null),[o,i]=(0,I.useState)([]),[s,l]=(0,I.useState)(0),[c,u]=(0,I.useState)([]),d=e.map(({name:e,enabled:t})=>{return{label:e,value:e,active:e===a,enabled:t}});return(0,I.useEffect)(()=>{n.current&&l(n.current.clientWidth)},[r,n.current?.clientWidth]),(0,I.useEffect)(()=>{var e;n.current&&(e=Array.from(n.current.children).map(e=>e.clientWidth),i(e))},[e]),(0,I.useEffect)(()=>{if(n.current)if(o.reduce((e,t)=>e+t,0)<=s)u([]);else{var e=Math.max(...o);const r=[];let a=e;o.forEach((e,t)=>{s>=a+e?a+=e:r.push(t)}),u(r)}},[s,o]),I.default.createElement("nav",{className:"marketplace-tabBar marketplace-tabBar-nav"},I.default.createElement("ul",{className:"marketplace-tabBar-header",ref:n},d.filter((e,t)=>!c.includes(t)).map(e=>I.default.createElement(Pr,{key:e.value,item:e,switchTo:t})),c.length||0===o.length?I.default.createElement(_r,{items:c.map(e=>d[e]).filter(e=>e),switchTo:t}):null))}),L=t(b()),jr=t(b()),$r=()=>jr.default.createElement("svg",{role:"img",width:"16",height:"16",viewBox:"0 0 448 512","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},jr.default.createElement("path",{d:"M53.21 467c1.562 24.84 23.02 45 47.9 45h245.8c24.88 0 46.33-20.16 47.9-45L416 128H32L53.21 467zM432 32H320l-11.58-23.16c-2.709-5.42-8.25-8.844-14.31-8.844H153.9c-6.061 0-11.6 3.424-14.31 8.844L128 32H16c-8.836 0-16 7.162-16 16V80c0 8.836 7.164 16 16 16h416c8.838 0 16-7.164 16-16V48C448 39.16 440.8 32 432 32z",fill:"currentColor"})),Dr=t(b()),zr=()=>Dr.default.createElement("svg",{role:"img",width:"16",height:"16",viewBox:"0 0 512 512","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},Dr.default.createElement("path",{d:"M480 352h-133.5l-45.25 45.25C289.2 409.3 273.1 416 256 416s-33.16-6.656-45.25-18.75L165.5 352H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h448c17.67 0 32-14.33 32-32v-96C512 366.3 497.7 352 480 352zM432 456c-13.2 0-24-10.8-24-24c0-13.2 10.8-24 24-24s24 10.8 24 24C456 445.2 445.2 456 432 456zM233.4 374.6C239.6 380.9 247.8 384 256 384s16.38-3.125 22.62-9.375l128-128c12.49-12.5 12.49-32.75 0-45.25c-12.5-12.5-32.76-12.5-45.25 0L288 274.8V32c0-17.67-14.33-32-32-32C238.3 0 224 14.33 224 32v242.8L150.6 201.4c-12.49-12.5-32.75-12.5-45.25 0c-12.49 12.5-12.49 32.75 0 45.25L233.4 374.6z",fill:"currentColor"})),Ur=t(b()),Fr=()=>Ur.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},Ur.default.createElement("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",fill:"currentColor"})),Br=t(b()),Vr=e=>{return Br.default.createElement("div",{className:"marketplace-card__authors"},e.authors.map((e,t)=>Br.default.createElement("a",{title:e.name,className:"marketplace-card__author",href:e.url,draggable:"false",dir:"auto",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),key:t},e.name)))},Hr=t(b()),qr=r=>{const[e,t]=Hr.default.useState(!1),n={[y("grid.externalJS")]:"external JS",[y("grid.archived")]:"archived",[y("grid.dark")]:"dark",[y("grid.light")]:"light"};var a=e=>{return e.filter((e,t,a)=>a.indexOf(e)===t).reduce((e,t)=>{var a=n[t]||t;return!r.showTags&&t!==y("grid.externalJS")&&t!==y("grid.archived")||e.push(Hr.default.createElement("li",{className:"marketplace-card__tag",draggable:!1,"data-tag":a},t)),e},[])};let o=r.tags.sort(e=>e===y("grid.externalJS")||e===y("grid.archived")?-1:1),i=[];return 1{e.stopPropagation(),t(!0)}},"..."):null)},O=window.Spicetify,Gr=class extends L.default.Component{tags;menuType;localStorageKey;key=null;type=Gr;constructor(e){super(e),this.menuType=O.ReactComponent.Menu,this.localStorageKey=Aa(e),Object.assign(this,e),this.tags=e.item.tags||[],e.item.include&&this.tags.push(y("grid.externalJS")),e.item.archived&&this.tags.push(y("grid.archived")),this.state={installed:null!==localStorage.getItem(this.localStorageKey),stars:this.props.item.stars||0,tagsExpanded:!1,externalUrl:this.props.item.user&&this.props.item.repo?`https://github.com/${this.props.item.user}/`+this.props.item.repo:"",lastUpdated:this.props.item.user&&this.props.item.repo?this.props.item.lastUpdated:void 0,created:this.props.item.user&&this.props.item.repo?this.props.item.created:void 0}}isInstalled(){return null!==localStorage.getItem(this.localStorageKey)}async componentDidMount(){if("Installed"===this.props.CONFIG.activeTab&&"snippet"!==this.props.type){var e=`https://api.github.com/repos/${this.props.item.user}/`+this.props.item.repo,{stargazers_count:e,pushed_at:t}=await fetch(e).then(e=>e.json());if(this.state.stars!==e&&this.props.CONFIG.visual.stars&&console.debug("Stars updated to: "+e),this.state.lastUpdated!==t)switch(console.debug("New update pushed at: "+t),this.props.type){case"extension":this.installExtension();break;case"theme":this.installTheme(!0)}}}buttonClicked(){if("extension"===this.props.type)this.isInstalled()?(console.debug("Extension already installed, removing"),this.removeExtension()):this.installExtension(),N("RELOAD");else if("theme"===this.props.type){var e=localStorage.getItem(w.themeInstalled),e=e?C(e,{}):{};if(this.isInstalled())console.debug("Theme already installed, removing"),this.removeTheme(this.localStorageKey);else{var t=localStorage.getItem(w.localTheme);if(null!=t&&"marketplace"!==t.toLowerCase())return void O.showNotification(y("notifications.wrongLocalTheme"),!0,5e3);this.removeTheme(),this.installTheme()}(this.props.item.manifest?.include||e.include)&&N("RELOAD")}else"app"===this.props.type?window.open(this.state.externalUrl,"_blank"):"snippet"===this.props.type?this.isInstalled()?(console.debug("Snippet already installed, removing"),this.removeSnippet()):this.installSnippet():console.error("Unknown card type")}installExtension(){var e,t,a,r,n,o,i,s,l,c,u,d;console.debug("Installing extension "+this.localStorageKey),this.props.item?({manifest:d,title:e,subtitle:t,authors:a,user:r,repo:n,branch:o,imageURL:i,extensionURL:s,readmeURL:l,lastUpdated:c,created:u}=this.props.item,localStorage.setItem(this.localStorageKey,JSON.stringify({manifest:d,type:this.props.type,title:e,subtitle:t,authors:a,user:r,repo:n,branch:o,imageURL:i,extensionURL:s,readmeURL:l,stars:this.state.stars,lastUpdated:c,created:u})),-1===(d=C(w.installedExtensions,[])).indexOf(this.localStorageKey)&&(d.push(this.localStorageKey),localStorage.setItem(w.installedExtensions,JSON.stringify(d))),console.debug("Installed"),this.setState({installed:!0})):O.showNotification(y("notifications.extensionInstallationError"),!0)}removeExtension(){var e;localStorage.getItem(this.localStorageKey)&&(console.debug("Removing extension "+this.localStorageKey),localStorage.removeItem(this.localStorageKey),e=C(w.installedExtensions,[]).filter(e=>e!==this.localStorageKey),localStorage.setItem(w.installedExtensions,JSON.stringify(e)),console.debug("Removed"),this.setState({installed:!1}))}async installTheme(a=!1){var r=this.props["item"];if(r){console.debug("Installing theme "+this.localStorageKey);let e={},t=null;a?({schemes:a,activeScheme:n}=C(this.localStorageKey,{}),e=a,t=n):r.schemesURL&&(a=await(await fetch(r.schemesURL)).text(),e=Sa(a));var n=t||Object.keys(e)[0]||null,{manifest:a,title:o,subtitle:i,authors:s,user:l,repo:c,branch:u,imageURL:d,extensionURL:p,readmeURL:h,cssURL:m,schemesURL:f,include:g,lastUpdated:v,created:b}=(console.debug(e,n),r),a=(localStorage.setItem(this.localStorageKey,JSON.stringify({manifest:a,type:this.props.type,title:o,subtitle:i,authors:s,user:l,repo:c,branch:u,imageURL:d,extensionURL:p,readmeURL:h,stars:this.state.stars,tags:this.tags,cssURL:m,schemesURL:f,include:g,schemes:e,activeScheme:n,lastUpdated:v,created:b})),C(w.installedThemes,[]));-1===a.indexOf(this.localStorageKey)&&(a.push(this.localStorageKey),localStorage.setItem(w.installedThemes,JSON.stringify(a)),localStorage.setItem(w.themeInstalled,this.localStorageKey)),console.debug("Installed"),r.include||(this.fetchAndInjectUserCSS(this.localStorageKey),this.props.updateActiveTheme(this.localStorageKey),this.props.updateColourSchemes(e,n),(o=this.props.item.manifest?.name)&&(O.Config.current_theme=o),n&&(O.Config.color_scheme=n)),this.setState({installed:!0})}else O.showNotification(y("notifications.themeInstallationError"),!0)}removeTheme(t){var e=(t=t||localStorage.getItem(w.themeInstalled))&&localStorage.getItem(t);t&&e&&(console.debug("Removing theme "+t),localStorage.removeItem(t),localStorage.removeItem(w.themeInstalled),e=C(w.installedThemes,[]).filter(e=>e!==t),localStorage.setItem(w.installedThemes,JSON.stringify(e)),console.debug("Removed"),this.fetchAndInjectUserCSS(null),this.props.updateActiveTheme(null),this.props.updateColourSchemes(null,null),O.Config.current_theme="marketplace",O.Config.color_scheme="marketplace",this.setState({installed:!1}))}installSnippet(){console.debug("Installing snippet "+this.localStorageKey),localStorage.setItem(this.localStorageKey,JSON.stringify({code:this.props.item.code,title:this.props.item.title,description:this.props.item.description,imageURL:this.props.item.imageURL}));var e=C(w.installedSnippets,[]),e=(-1===e.indexOf(this.localStorageKey)&&(e.push(this.localStorageKey),localStorage.setItem(w.installedSnippets,JSON.stringify(e))),e.map(e=>C(e)));ka(e),this.setState({installed:!0})}removeSnippet(){localStorage.removeItem(this.localStorageKey);var e=C(w.installedSnippets,[]).filter(e=>e!==this.localStorageKey),e=(localStorage.setItem(w.installedSnippets,JSON.stringify(e)),e.map(e=>C(e)));ka(e),this.setState({installed:!1})}async fetchAndInjectUserCSS(e){try{var t=window.sessionStorage.getItem("marketplace-request-tld")||void 0,a=e?await La(this.props.item,t):void 0;Ia(a)}catch(e){console.warn(e)}}openReadme(){this.props.item?.manifest?.readme?O.Platform.History.push({pathname:ga+"/readme",state:{data:{title:this.props.item.title,user:this.props.item.user,repo:this.props.item.repo,branch:this.props.item.branch,readmeURL:this.props.item.readmeURL,type:this.props.type,install:this.buttonClicked.bind(this),isInstalled:this.isInstalled.bind(this)}}}):O.showNotification(y("notifications.noReadmeFile"),!0)}render(){var e,t,a=this.isInstalled();return"Installed"!==this.props.CONFIG.activeTab||a?(e=["main-card-card","marketplace-card--"+this.props.type],a&&e.push("marketplace-card--installed"),t=[],"snippet"!==this.props.type&&this.props.visual.stars&&t.push("★ "+this.state.stars),L.default.createElement("div",{className:e.join(" "),onClick:()=>{if("snippet"===this.props.type){var e=this.props.item.title.replace(/\n/g,"");if(C("marketplace:installed:snippet:"+e)?.custom)return N("EDIT_SNIPPET",void 0,void 0,this.props);N("VIEW_SNIPPET",void 0,void 0,this.props,this.buttonClicked.bind(this))}else this.openReadme()}},L.default.createElement("div",{className:"main-card-draggable",draggable:"true"},L.default.createElement("div",{className:"main-card-imageContainer"},L.default.createElement("div",{className:"main-cardImage-imageWrapper"},L.default.createElement("div",null,L.default.createElement("img",{alt:"","aria-hidden":"false",draggable:"false",loading:"lazy",src:this.props.item.imageURL,className:"main-image-image main-cardImage-image",onError:e=>{e.currentTarget.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII"),e.currentTarget.closest(".main-cardImage-imageWrapper")?.classList.add("main-cardImage-imageWrapper--error")}})))),L.default.createElement("div",{className:"main-card-cardMetadata"},L.default.createElement("a",{draggable:"false",title:"snippet"===this.props.type?this.props.item.title:this.props.item.manifest?.name,className:"main-cardHeader-link",dir:"auto",href:"snippet"!==this.props.type?this.state.externalUrl:"https://github.com/spicetify/spicetify-marketplace/blob/main/src/resources/snippets.ts",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation()},L.default.createElement("div",{className:"main-cardHeader-text main-type-balladBold"},this.props.item.title)),L.default.createElement("div",{className:"main-cardSubHeader-root main-type-mestoBold marketplace-cardSubHeader"},this.props.item.authors&&L.default.createElement(Vr,{authors:this.props.item.authors}),L.default.createElement("span",null,t.join(" ‒ "))),L.default.createElement("p",{className:"marketplace-card-desc"},"snippet"===this.props.type?this.props.item.description:this.props.item.manifest?.description),this.props.item.lastUpdated&&L.default.createElement("p",{className:"marketplace-card-desc"},y("grid.lastUpdated",{val:new Date(this.props.item.lastUpdated),formatParams:{val:{year:"numeric",month:"long",day:"numeric"}}})),this.tags.length?L.default.createElement("div",{className:"marketplace-card__bottom-meta main-type-mestoBold"},L.default.createElement(qr,{tags:this.tags,showTags:this.props.CONFIG.visual.tags})):null,a&&L.default.createElement("div",{className:"marketplace-card__bottom-meta main-type-mestoBold"},"✓ ",y("grid.installed")),L.default.createElement(O.ReactComponent.TooltipWrapper,{label:"app"===this.props.type?y("github"):y(a?"remove":"install"),renderInline:!0},L.default.createElement("div",{className:"main-card-PlayButtonContainer"},L.default.createElement(g,{classes:["marketplace-installButton"],type:"circle",label:"app"===this.props.type?y("github"):y(a?"remove":"install"),onClick:e=>{e.stopPropagation(),this.buttonClicked()}},"app"===this.props.type?L.default.createElement(Fr,null):a?L.default.createElement($r,null):L.default.createElement(zr,null)))))))):(console.debug("Card item not installed"),null)}},Kr=qt()(Gr),Jr=window.Spicetify,a=class extends s.default.Component{constructor(e){super(e),Object.assign(this,e),this.updateAppConfig=e.updateAppConfig.bind(this),this.sortConfig={by:C(w.sort,"top")},this.state={version:ma,newUpdate:!1,searchValue:"",cards:[],tabs:e.CONFIG.tabs,rest:!0,endOfList:!1,schemes:e.CONFIG.theme.schemes,activeScheme:e.CONFIG.theme.activeScheme,activeThemeKey:e.CONFIG.theme.activeThemeKey}}searchRequested;endOfList=!1;lastScroll=0;requestQueue=[];requestPage=0;cardList=[];sortConfig;gridUpdateTabs;gridUpdatePostsVisual;checkScroll;CONFIG;updateAppConfig;BLACKLIST;SNIPPETS;getInstalledTheme(){var e=localStorage.getItem(w.themeInstalled);return(e=e&&localStorage.getItem(e))?JSON.parse(e):null}newRequest(e){this.cardList=[];var t=[];this.requestQueue.unshift(t),this.loadAmount(t,e)}appendCard(e,t,a){a===this.props.CONFIG.activeTab&&(a=s.default.createElement(Kr,{item:e,key:`${this.props.CONFIG.activeTab}:${e.user}:`+e.title,CONFIG:this.CONFIG,visual:this.props.CONFIG.visual,type:t,activeThemeKey:this.state.activeThemeKey,updateColourSchemes:this.updateColourSchemes.bind(this),updateActiveTheme:this.setActiveTheme.bind(this)}),this.cardList.push(a))}updateSort(e){e&&(this.sortConfig.by=e,localStorage.setItem(w.sort,e)),this.requestPage=0,this.cardList=[],this.setState({cards:[],rest:!1,endOfList:!1}),this.endOfList=!1,this.newRequest(E)}updateTabs(){this.setState({tabs:[...this.props.CONFIG.tabs]})}updatePostsVisual(){this.cardList=this.cardList.map((e,t)=>s.default.createElement(Kr,{...e.props,key:t.toString(),CONFIG:this.CONFIG})),this.setState({cards:[...this.cardList]})}switchTo(e){this.CONFIG.activeTab=e.value,localStorage.setItem(w.activeTab,e.value),this.cardList=[],this.requestPage=0,this.setState({cards:[],rest:!1,endOfList:!1}),this.endOfList=!1,this.newRequest(E)}async loadPage(t){const a=this.CONFIG.activeTab;switch(a){case"Extensions":var e=await gr("spicetify-extensions",this.requestPage,this.BLACKLIST,this.CONFIG.visual.showArchived),r=[];for(const h of e.items){var n=await yr(h.contents_url,h.default_branch,h.stargazers_count,this.CONFIG.visual.hideInstalled);if(1({...e,archived:h.archived,lastUpdated:h.pushed_at,created:h.created_at})))}ja(r,localStorage.getItem("marketplace:sort")||"stars");for(const m of r)this.appendCard(m,"extension",a);this.setState({cards:this.cardList});var o=-1{e=C(e);if(1({...e,archived:b.archived,lastUpdated:b.pushed_at,created:b.created_at})))}this.setState({cards:this.cardList}),ja(c,localStorage.getItem("marketplace:sort")||"stars");for(const y of c)this.appendCard(y,"theme",a);e=-1({...e,archived:S.archived,lastUpdated:S.pushed_at,created:S.created_at})))}this.setState({cards:this.cardList}),ja(d,localStorage.getItem("marketplace:sort")||"stars");for(const k of d)this.appendCard(k,"app",a);i=-1this.appendCard(e,"snippet",a)),this.setState({cards:this.cardList}))}return this.setState({rest:!0,endOfList:!0}),this.endOfList=!0,0}async loadAmount(t,e=E){for(this.setState({rest:!1}),e+=this.cardList.length,this.requestPage=await this.loadPage(t);this.requestPage&&-1!==this.requestPage&&this.cardList.lengthe!==t):(this.requestQueue.shift(),this.setState({rest:!0}))}loadMore(){this.state.rest&&!this.endOfList&&this.loadAmount(this.requestQueue[0],E)}updateColourSchemes(e,t){console.debug("updateColourSchemes",e,t),this.CONFIG.theme.schemes=e,(this.CONFIG.theme.activeScheme=t)&&(Jr.Config.color_scheme=t),e&&t&&e[t]?xa(this.CONFIG.theme.schemes[t]):xa(null);var a=C(w.themeInstalled),r=C(a);r?(r.activeScheme=t,console.debug(r),localStorage.setItem(a,JSON.stringify(r))):console.debug("No installed theme data"),this.setState({schemes:e,activeScheme:t})}async componentDidMount(){fetch(ba).then(e=>e.json()).then(e=>{if(e.message)throw e;this.setState({version:e.name});try{this.setState({newUpdate:ya.default.gt(e.name,ma)})}catch(e){console.error(e)}},e=>{console.error("Failed to check for updates",e)}),this.gridUpdateTabs=this.updateTabs.bind(this),this.gridUpdatePostsVisual=this.updatePostsVisual.bind(this);var e=document.querySelector(".os-viewport")??document.querySelector("#main .main-view-container__scroll-node");this.checkScroll=this.isScrolledBottom.bind(this),e&&(e.addEventListener("scroll",this.checkScroll),this.cardList.length)?0=e.scrollHeight&&this.loadMore()}setActiveTheme(e){this.CONFIG.theme.activeThemeKey=e,this.setState({activeThemeKey:e})}getActiveScheme(){return this.state.activeScheme}render(){const a=this.props["t"];return s.default.createElement("section",{className:"contentSpacing"},s.default.createElement("div",{className:"marketplace-header"},s.default.createElement("div",{className:"marketplace-header__left"},this.state.newUpdate?s.default.createElement("button",{type:"button",title:a("grid.newUpdate"),className:"marketplace-header-icon-button",id:"marketplace-update",onClick:()=>N("UPDATE")},s.default.createElement(zr,null)," ",this.state.version):null,s.default.createElement("h2",{className:"marketplace-header__label"},a("grid.sort.label")),s.default.createElement(er,{onChange:e=>this.updateSort(e),sortBoxOptions:Ca(a),sortBySelectedFn:e=>e.key===this.CONFIG.sort})),s.default.createElement("div",{className:"marketplace-header__right"},this.CONFIG.visual.themeDevTools?s.default.createElement(Jr.ReactComponent.TooltipWrapper,{label:a("devTools.title"),renderInline:!0,placement:"bottom"},s.default.createElement("button",{type:"button","aria-label":a("devTools.title"),className:"marketplace-header-icon-button",onClick:()=>N("THEME_DEV_TOOLS")},s.default.createElement(Tr,null))):null,this.state.activeScheme?s.default.createElement(er,{onChange:e=>this.updateColourSchemes(this.state.schemes,e),sortBoxOptions:Ea(this.state.schemes),sortBySelectedFn:e=>e.key===this.getActiveScheme()}):null,s.default.createElement("div",{className:"searchbar--bar__wrapper"},s.default.createElement("input",{className:"searchbar-bar",type:"text",placeholder:`${a("grid.search")} ${a("tabs."+this.CONFIG.activeTab)}...`,value:this.state.searchValue,onChange:e=>{this.setState({searchValue:e.target.value})}})),s.default.createElement(Jr.ReactComponent.TooltipWrapper,{label:a("settings.title"),renderInline:!0,placement:"bottom"},s.default.createElement("button",{type:"button","aria-label":a("settings.title"),className:"marketplace-header-icon-button",id:"marketplace-settings-button",onClick:()=>N("SETTINGS",this.CONFIG,this.updateAppConfig)},s.default.createElement(Lr,null))))),[{handle:"extension",name:"Extensions"},{handle:"theme",name:"Themes"},{handle:"snippet",name:"Snippets"},{handle:"app",name:"Apps"}].map(t=>{var e=this.cardList.filter(e=>e.props.type===t.handle).filter(e=>{const t=this.state.searchValue.trim().toLowerCase();var{title:e,user:a,authors:r,tags:n}=e.props.item;return!t||e.toLowerCase().includes(t)||a?.toLowerCase().includes(t)||r?.some(e=>e.name.toLowerCase().includes(t))||n?.some(e=>e.toLowerCase().includes(t))}).map(e=>s.default.cloneElement(e,{activeThemeKey:this.state.activeThemeKey,key:e.key})).filter((t,e,a)=>a.findIndex(e=>e.key===t.key)===e);return e.length?s.default.createElement(s.default.Fragment,null,s.default.createElement("h2",{className:"marketplace-card-type-heading"},a("tabs."+t.name)),s.default.createElement("div",{className:"marketplace-grid main-gridContainer-gridContainer main-gridContainer-fixedWidth","data-tab":this.CONFIG.activeTab,"data-card-type":a("tabs."+t.name)},e)):null}),"Snippets"===this.CONFIG.activeTab?s.default.createElement(g,{classes:["marketplace-add-snippet-btn"],onClick:()=>N("ADD_SNIPPET")},"+ ",a("grid.addCSS")):null,s.default.createElement("footer",{className:"marketplace-footer"},!this.state.endOfList&&(this.state.rest&&0${this.props.t("readmePage.loading")}