dotfiles/.config/spicetify/Extracted/Raw/xpui/5647.js

2 lines
7.2 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([[5647],{34223:(e,a,t)=>{t.d(a,{o:()=>_});var i=t(59496),n=t(56162),l=t(3802),r=t(70925),s=t(4637);const c=i.memo((function({text:e,onTimeStampClick:a,children:t,className:l,enableTimestamps:c=!1}){const m=(0,i.useMemo)((()=>(0,s.jsx)(r.w,{html:e,onTimeStampClick:a,enableTimestamps:c})),[e,c,a]);return(0,s.jsxs)(n.D,{as:"div",variant:"ballad",className:l,children:[m,t]})})),m="EBLEo2u6UDcK37liXPVw",o=(0,i.memo)((function({text:e,onTimeStampClick:a,onToggle:t,className:i,enableTimestamps:r}){return(0,s.jsx)(c,{className:i,text:e,onTimeStampClick:a,enableTimestamps:r,children:(0,s.jsx)("button",{"aria-expanded":!1,className:m,onClick:t,children:(0,s.jsxs)(n.D,{variant:"balladBold",children:["… ",l.ag.get("mwp.see.more")]})})})})),d=(e,a,t)=>{const i=l.ag.get("mwp.see.more").length,n=e.length+i+6;return t<=1&&n<a},h=(0,i.memo)((function({paragraphs:e,clickHandler:a,maxCharactersPerLine:t,maxLines:i,toggleExpandedState:n,className:r,enableTimestamps:m}){let h=!1,u=0;const g=e.map(((g,p)=>{const x=Math.round(g.length/t);if(u+=x>0?x:1,h)return null;const f=i-(u-x);if(!(p+1===e.length&&(d(g,t,f)||x<=f))&&u>=i){h=!0;const e=((e,a,t)=>{const i=l.ag.get("mwp.see.more").length;if(d(e,a,t))return e;const n=a*t-i-6;return e.slice(0,n)})(g,t,f);return(0,s.jsx)(o,{text:e,onTimeStampClick:a,onToggle:n,className:r,enableTimestamps:m},p)}return(0,s.jsx)(c,{className:r,text:g,onTimeStampClick:a,enableTimestamps:m},p)})).filter((e=>null!==e)).map(((e,a,t)=>a+1===t.length?e:[e," "])).flat();return(0,s.jsx)(s.Fragment,{children:g})}));var u=t(21718);const g="TQXhY8PT8v1vogxO85c_",p="RKzJftL6TOVUXkXOPykT",x="PEODYhy3IOufoACR6vf2",f="mCKPqUiNNAO6GM3nRBXe",b={isOpen:null,contentWidth:0},j=(e,a)=>({...e,...a}),v=(e="")=>e.split(/[ \u00a0]{2}/).filter(Boolean),C=(e="")=>e.replace("<p>","").split(/(?:<\/p>)/).filter(Boolean),_=(0,i.memo)((function({content:e,htmlContent:a,maxLines:t=2,className:m,onTimeStampClick:o=(()=>{}),onExpanded:d,enableTimestamps:_=!1}){const[k,T]=(0,i.useReducer)(j,b),{isOpen:N,contentWidth:w}=k,S=(0,i.useRef)(null),y=(0,i.useCallback)((()=>{T({isOpen:!N}),d&&d(!N)}),[N,d]);(0,i.useEffect)((()=>{T({isOpen:null})}),[e]),(0,i.useEffect)((()=>{null!==k.isOpen&&S.current?.querySelector("button[aria-expanded]")?.focus()}),[k.isOpen]);const L=w?w/7.8:Number.MAX_VALUE,D=(0,i.useCallback)((e=>{e&&(S.current=e,T({contentWidth:e.clientWidth}))}),[]),O=(0,i.useMemo)((()=>a?C(a).map((e=>(0,s.jsx)(r.w,{html:e,onTimeStampClick:o,enableTimestamps:_},e))):((e,a,t)=>v(e).map(((e,i)=>(0,s.jsx)(c,{className:p,text:e,onTimeStampClick:a,enableTimestamps:t},i))))(e,o,_)),[e,_,a,o]),P=(0,i.useMemo)((()=>a?C(a):v(e)),[e,a]);return(0,u.a)((()=>{S.current&&T({contentWidth:S.current.clientWidth})})),(0,s.jsx)("div",{className:m,children:(0,s.jsxs)("div",{ref:D,className:g,children:[N&&(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("button",{"aria-expanded":!0,className:f,onClick:y,children:(0,s.jsx)(n.D,{className:x,variant:"balladBold",children:l.ag.get("show_less")})})]}),!N&&(0,s.jsx)(h,{className:p,paragraphs:P,clickHandler:o,enableTimestamps:_,maxCharactersPerLine:L,maxLines:t,toggleExpandedState:y})]})})}))},70925:(e,a,t)=>{t.d(a,{w:()=>h});var i=t(59496),n=t(4417),l=t.n(n),r=t(56162),s=t(66432);const c=/(\((?:[0-9]{1,3}:){1,2}[0-9]{2}\))/g;var m=t(63120);const o={Heading:"playlist-playlist-heading",HTMLDescription:"playlist-playlist-playlistDescription",List:"playlist-playlist-list",ListItem:"playlist-playlist-listItem",Paragraph:"playlist-playlist-paragraph"};var d=t(4637);const h=i.memo((function({html:e,onTimeStampClick:a,enableTimestamps:t=!1,semanticColor:n="textSubdued"}){const r=(0,i.useMemo)((()=>{const i=t?e.split(c).map((e=>e.match(c)?`(<time>${e.replace("(","").replace(")","")}</time>)`:e)).join(""):e;let r;try{r=l()(i,{transform:u(a,n),dangerouslySetChildren:[]})}catch{r=e}return r}),[t,e,a,n]);return(0,d.jsx)("div",{className:o.HTMLDescription,children:r})}));function u(e,a){let t=0;return{p:e=>(
//# sourceMappingURL=5647.js.map