dotfiles/.config/spicetify/Extracted/Raw/xpui/xpui-routes-queue-page.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[7521],{6261:(e,i,t)=>{t.d(i,{n:()=>U});var n=t(59496),a=t(84875),s=t.n(a),r=t(89605),l=t(56162),o=t(16004),u=t(77675),c=t(3802),d=t(85830),m=t(21524),x=t(22345);var g=t(59200),h=t(1996),p=t(99308);const j="main-topBar-contentArea",y="queue-tabBar-headerIsCentered",f="queue-tabBar-headerItem",b="queue-tabBar-moreButton",v="queue-tabBar-moreButtonActive",C="yxf_6IsQEmHjijEBUMTP",k="queue-tabBar-active",N="queue-tabBar-headerItemLink",I="queue-tabBar-header",P="queue-tabBar-chevron";var w=t(4637);const E=({items:e,activeItemId:i})=>(0,w.jsx)(h.v,{children:e.map((e=>e.disabled?(0,w.jsx)(p.s,{disabled:!0,role:"menuitemradio",className:C,onClick:e.handleClick,children:e.title},e.uri):(0,w.jsx)(p.s,{role:"menuitemradio",to:e.to,end:!0,"aria-checked":e.itemId===i,className:({isActive:e})=>s()(C,{[k]:e}),onClick:e.handleClick,children:e.title},e.uri)))});var D=t(40495);const U=(0,n.memo)((function({isCentered:e,links:i,landmarkLabel:t,className:a}){const h=(0,n.useRef)(null),[p,C]=(0,n.useState)([]),[U,S]=(0,n.useState)(0),[A,q]=(0,n.useState)([]),O=function(){const[e,i]=(0,n.useState)(window.innerWidth),{scrollNodeChildRef:t}=(0,n.useContext)(m.VX),a=(0,d.y1)((e=>{e?.width&&i(e.width)}),250);return(0,x.y)({refOrElement:t,observeOnly:"width",onResize:a}),e}()??1/0,{pathname:R}=(0,r.TH)(),T=i.find((e=>e.to===R));return(0,n.useEffect)((()=>{h.current&&S(h.current.clientWidth)}),[O]),(0,n.useEffect)((()=>{if(!h.current)return;const e=Array.from(h.current.children).map((e=>e.clientWidth));C(e)}),[i]),(0,n.useEffect)((()=>{if(!h.current)return;if(p.slice(0,-1).reduce(((e,i)=>e+i),0)<=U)return void q([]);const e=p.reduce(((e,i)=>e>i?e:i),0),i=[];let t=e;p.forEach(((e,n)=>{U>=t+e?t+=e:i.push(n)})),q(i)}),[U,p]),(0,w.jsx)("nav",{className:s()(a,j),"aria-label":t,children:(0,w.jsxs)("ul",{className:e?y:I,ref:h,children:[i.filter(((e,i)=>!A.includes(i))).map((e=>{const i=e?.render??(e=>e);return(0,w.jsx)(n.Fragment,{children:i((0,w.jsx)("li",{className:f,children:e.disabled?(0,w.jsx)("div",{className:N,children:(0,w.jsx)(l.D,{variant:"mestoBold",children:e.title})}):(0,w.jsx)(D.O,{end:!0,className:({isActive:e})=>s()(N,{[k]:e}),to:e.to,onClick:e.handleClick,children:(0,w.jsx)(l.D,{variant:"mestoBold",children:e.title})})}))},e.to)})),A.length||0===p.length?(0,w.jsx)("li",{className:f,children:(0,w.jsx)(g.xV,{renderInline:!0,menu:(0,w.jsx)(E,{items:i.filter(((e,i)=>A.includes(i))),activeItemId:T?.itemId}),children:(e,i,t)=>(0,w.jsxs)("button",{className:s()(b,{[v]:T}),type:"button",onClick:i,ref:t,children:[(0,w.jsx)(l.D,{variant:"mestoBold",children:T?T.title:c.ag.get("more")}),e?(0,w.jsx)(o.U,{iconSize:16,className:P,"aria-hidden":"true"}):(0,w.jsx)(u.i,{iconSize:16,className:P,"aria-hidden":"true"})]})})}):null]})})}))},68827:(e,i,t)=>{t.d(i,{I:()=>x});var n=t(61922),a=t(59496),s=t(3802),r=t(6261),l=t(91577),o=t(20882),u=t(11611);const c="queue-tabBar-nav";var d=t(4637);const m=()=>{const e=(0,u.Y)(),i=(0,a.useCallback)((e=>(0,d.jsx)(o.v,{placement:"bottomEnd",arrow:"topStart",title:s.ag.get("pick-and-shuffle.upsell.title.queue"),children:e})),[]),t=(0,a.useMemo)((()=>[{title:s.ag.get("playback-control.queue"),itemId:"queue",to:"/queue",uri:"spotify:app:queue",render:i,disabled:e},{title:s.ag.get("view.recently-played"),itemId:"history",to:"/history",uri:"spotify:app:history"}]),[e,i]);return(0,d.jsx)(l.w,{children:(0,d.jsx)(r.n,{className:c,links:t})})},x=({children:e})=>{const i=(0,n.nF)();return(0,d.jsxs)("section",{className:"contentSpacing",children:[e,i&&(0,d.jsx)(m,{})]})}},85015:(e,i,t)=>{t.r(i),t.d(i,{default:()=>je});var n=t(59496),a=t(84875),s=t.n(a),r=t(56162),l=t(26636),o=t(47792),u=t(3802),c=t(91703),d=t(63120),m=t(98340),x=t(37409),g=t(48607),h=t(97134),p=t(72933),j=t(96170),y=t(63082),f=t(4637);const b=({onClick:e})=>(0,f.jsx)(y.P,{onClick:e,buttonSize:"sm",children:u.ag.get("queue.clear-queue")});var v=t(58706),C=t(30366),k=t(79475),N=(t(62505),t(83185));const I="i9rTNwKyT_NMDghd8q65"
//# sourceMappingURL=xpui-routes-queue-page.js.map