@stronk-tech/react-librespot-controller 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +71 -0
- package/dist/index.cjs.js +15 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +15 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e,{useState as t,useRef as r,useEffect as n}from"react";function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,i={exports:{}},c={exports:{}},l={};var s,p,u,d,f,y,m,h,b,g,v,x,w,k,z,E={};
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/function O(){return p||(p=1,"production"===process.env.NODE_ENV?c.exports=function(){if(o)return l;o=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var o=e.$$typeof;switch(o){case t:switch(e=e.type){case p:case u:case n:case i:case a:case f:return e;default:switch(e=e&&e.$$typeof){case s:case d:case h:case m:case c:return e;default:return o}}case r:return o}}}function k(e){return w(e)===u}return l.AsyncMode=p,l.ConcurrentMode=u,l.ContextConsumer=s,l.ContextProvider=c,l.Element=t,l.ForwardRef=d,l.Fragment=n,l.Lazy=h,l.Memo=m,l.Portal=r,l.Profiler=i,l.StrictMode=a,l.Suspense=f,l.isAsyncMode=function(e){return k(e)||w(e)===p},l.isConcurrentMode=k,l.isContextConsumer=function(e){return w(e)===s},l.isContextProvider=function(e){return w(e)===c},l.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},l.isForwardRef=function(e){return w(e)===d},l.isFragment=function(e){return w(e)===n},l.isLazy=function(e){return w(e)===h},l.isMemo=function(e){return w(e)===m},l.isPortal=function(e){return w(e)===r},l.isProfiler=function(e){return w(e)===i},l.isStrictMode=function(e){return w(e)===a},l.isSuspense=function(e){return w(e)===f},l.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===a||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===c||e.$$typeof===s||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===x||e.$$typeof===b)},l.typeOf=w,l}():c.exports=(s||(s=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var m=e.type;switch(m){case l:case s:case n:case o:case a:case u:return m;default:var h=m&&m.$$typeof;switch(h){case c:case p:case y:case f:case i:return h;default:return d}}case r:return d}}}var x=l,w=s,k=c,z=i,O=t,S=p,j=n,C=y,N=f,P=r,M=o,T=a,_=u,V=!1;function $(e){return v(e)===s}E.AsyncMode=x,E.ConcurrentMode=w,E.ContextConsumer=k,E.ContextProvider=z,E.Element=O,E.ForwardRef=S,E.Fragment=j,E.Lazy=C,E.Memo=N,E.Portal=P,E.Profiler=M,E.StrictMode=T,E.Suspense=_,E.isAsyncMode=function(e){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(e)||v(e)===l},E.isConcurrentMode=$,E.isContextConsumer=function(e){return v(e)===c},E.isContextProvider=function(e){return v(e)===i},E.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},E.isForwardRef=function(e){return v(e)===p},E.isFragment=function(e){return v(e)===n},E.isLazy=function(e){return v(e)===y},E.isMemo=function(e){return v(e)===f},E.isPortal=function(e){return v(e)===r},E.isProfiler=function(e){return v(e)===o},E.isStrictMode=function(e){return v(e)===a},E.isSuspense=function(e){return v(e)===u},E.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===o||e===a||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===f||e.$$typeof===i||e.$$typeof===c||e.$$typeof===p||e.$$typeof===h||e.$$typeof===b||e.$$typeof===g||e.$$typeof===m)},E.typeOf=v}()),E)),c.exports}
|
|
10
|
+
/*
|
|
11
|
+
object-assign
|
|
12
|
+
(c) Sindre Sorhus
|
|
13
|
+
@license MIT
|
|
14
|
+
*/function S(){if(d)return u;d=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return u=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,a){for(var o,i,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),l=1;l<arguments.length;l++){for(var s in o=Object(arguments[l]))t.call(o,s)&&(c[s]=o[s]);if(e){i=e(o);for(var p=0;p<i.length;p++)r.call(o,i[p])&&(c[i[p]]=o[i[p]])}}return c},u}function j(){if(y)return f;y=1;return f="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function C(){return h?m:(h=1,m=Function.call.bind(Object.prototype.hasOwnProperty))}function N(){if(g)return b;g=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=j(),r={},n=C();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function a(a,o,i,c,l){if("production"!==process.env.NODE_ENV)for(var s in a)if(n(a,s)){var p;try{if("function"!=typeof a[s]){var u=Error((c||"React class")+": "+i+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}p=a[s](o,s,c,i,null,t)}catch(e){p=e}if(!p||p instanceof Error||e((c||"React class")+": type specification of "+i+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in r)){r[p.message]=!0;var d=l?l():"";e("Failed "+i+" type: "+p.message+(null!=d?d:""))}}}return a.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},b=a}function P(){if(x)return v;x=1;var e=O(),t=S(),r=j(),n=C(),a=N(),o=function(){};function i(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),v=function(c,l){var s="function"==typeof Symbol&&Symbol.iterator;var p="<<anonymous>>",u={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:y(i),arrayOf:function(e){return y((function(t,n,a,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+a+"` has invalid PropType notation inside arrayOf.");var c=t[n];if(!Array.isArray(c))return new f("Invalid "+o+" `"+i+"` of type `"+g(c)+"` supplied to `"+a+"`, expected an array.");for(var l=0;l<c.length;l++){var s=e(c,l,a,o,i+"["+l+"]",r);if(s instanceof Error)return s}return null}))},element:y((function(e,t,r,n,a){var o=e[t];return c(o)?null:new f("Invalid "+n+" `"+a+"` of type `"+g(o)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:y((function(t,r,n,a,o){var i=t[r];return e.isValidElementType(i)?null:new f("Invalid "+a+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(t,r,n,a,o){if(!(t[r]instanceof e)){var i=e.name||p;return new f("Invalid "+a+" `"+o+"` of type `"+(((c=t[r]).constructor&&c.constructor.name?c.constructor.name:p)+"` supplied to `")+n+"`, expected instance of `"+i+"`.")}var c;return null}))},node:y((function(e,t,r,n,a){return b(e[t])?null:new f("Invalid "+n+" `"+a+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(t,a,o,i,c){if("function"!=typeof e)return new f("Property `"+c+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var l=t[a],s=g(l);if("object"!==s)return new f("Invalid "+i+" `"+c+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var p in l)if(n(l,p)){var u=e(l,p,o,i,c+"."+p,r);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i;return y((function(t,r,n,a,o){for(var i=t[r],c=0;c<e.length;c++)if(d(i,e[c]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===v(t)?String(t):t}));return new f("Invalid "+a+" `"+o+"` of value `"+String(i)+"` supplied to `"+n+"`, expected one of "+l+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t<e.length;t++){var a=e[t];if("function"!=typeof a)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(a)+" at index "+t+"."),i}return y((function(t,a,o,i,c){for(var l=[],s=0;s<e.length;s++){var p=(0,e[s])(t,a,o,i,c,r);if(null==p)return null;p.data&&n(p.data,"expectedType")&&l.push(p.data.expectedType)}return new f("Invalid "+i+" `"+c+"` supplied to `"+o+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return y((function(t,n,a,o,i){var c=t[n],l=g(c);if("object"!==l)return new f("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");for(var s in e){var p=e[s];if("function"!=typeof p)return h(a,o,i,s,v(p));var u=p(c,s,a,o,i+"."+s,r);if(u)return u}return null}))},exact:function(e){return y((function(a,o,i,c,l){var s=a[o],p=g(s);if("object"!==p)return new f("Invalid "+c+" `"+l+"` of type `"+p+"` supplied to `"+i+"`, expected `object`.");var u=t({},a[o],e);for(var d in u){var y=e[d];if(n(e,d)&&"function"!=typeof y)return h(i,c,l,d,v(y));if(!y)return new f("Invalid "+c+" `"+l+"` key `"+d+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(a[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(s,d,i,c,l+"."+d,r);if(m)return m}return null}))}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function a(a,i,c,s,u,d,y){if(s=s||p,d=d||c,y!==r){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=s+":"+c;!t[h]&&n<3&&(o("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==i[c]?a?null===i[c]?new f("The "+u+" `"+d+"` is marked as required in `"+s+"`, but its value is `null`."):new f("The "+u+" `"+d+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(i,c,s,u,d)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function m(e){return y((function(t,r,n,a,o,i){var c=t[r];return g(c)!==e?new f("Invalid "+a+" `"+o+"` of type `"+v(c)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,a){return new f((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||c(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!b(r.value))return!1}else for(;!(r=n.next()).done;){var a=r.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function v(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=v(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return f.prototype=Error.prototype,u.checkPropTypes=a,u.resetWarningCache=a.resetWarningCache,u.PropTypes=u,u},v}function M(){if(k)return w;k=1;var e=j();function t(){}function r(){}return r.resetWarningCache=t,w=function(){function n(t,r,n,a,o,i){if(i!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function a(){return n}n.isRequired=n;var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o}}function T(){if(z)return i.exports;if(z=1,"production"!==process.env.NODE_ENV){var e=O();i.exports=P()(e.isElement,true)}else i.exports=M()();return i.exports}var _=a(T());function V(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}document.head.appendChild(document.createElement("style")).textContent='.spotify-player-album-card-wrapper{position:relative;margin:1em;flex-shrink:1;border-radius:0.4em;overflow:visible;display:flex;align-items:center;justify-content:center;z-index:1;transition:width 0.3s ease,height 0.3s ease,filter 0.3s ease,z-index 0s;background:var(--gradient-border,linear-gradient(to right,#000,#333));}.spotify-player-album-card-wrapper::after{content:"";position:absolute;top:-6px;left:-6px;right:-6px;bottom:-6px;border:3px solid var(--darkest);border-radius:inherit;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,0.4),transparent);box-shadow:inset 0px 4px 15px rgba(0,0,0,0.8);z-index:4;pointer-events:none;overflow:hidden;}.spotify-player-album-card-wrapper::before{content:"";position:absolute;background:var(--gradient-border);border-radius:inherit;z-index:1;opacity:0.6;animation:pulsate-glow 4s infinite alternate ease-in-out;transition:all 0.3s ease;}@keyframes pulsate-glow{0%{filter:blur(10px);top:-0.20em;left:-0.20em;right:-0.20em;bottom:-0.2em;}50%{filter:blur(30px);top:-0.30em;left:-0.30em;right:-0.30em;bottom:-0.3em;}100%{filter:blur(10px);top:-0.20em;left:-0.20em;right:-0.20em;bottom:-0.2em;}}.spotify-player-album-card-wrapper:hover{filter:brightness(1.25);}.spotify-player-album-card-container{position:relative;width:100%;height:auto;padding:0;overflow:visible;box-sizing:border-box;z-index:5;border-radius:inherit;}.spotify-player-album-card-container-border{position:absolute;top:-4px;left:-4px;right:-4px;bottom:-4px;border-radius:inherit;background:var(--gradient-border,linear-gradient(to right,var(--blue),var(--lighter)));pointer-events:none;z-index:3;}.spotify-player-album-card-image-container{position:relative;width:100%;height:100%;border-radius:inherit;box-sizing:border-box;overflow:hidden;z-index:6;}.spotify-player-album-card-image-container::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background:linear-gradient(to right,rgba(0,0,0,0.5),rgba(0,0,0,0.2) 15%,rgba(0,0,0,0) 30%,rgba(0,0,0,0) 70%,rgba(0,0,0,0.2) 85%,rgba(0,0,0,0.5));pointer-events:none;z-index:9;}.spotify-player-album-card-image{width:100%;height:auto;object-fit:cover;display:block;border-radius:inherit;box-sizing:border-box;position:relative;z-index:7;transition:all 0.3s ease;}.spotify-player-album-card-title-container{position:absolute;top:0;left:0;right:0;background:linear-gradient(to bottom,rgba(10,10,10,0.8),rgba(20,20,20,0.8),rgba(30,30,30,0.7),rgba(40,40,40,0.5),rgba(50,50,50,0.3));border-top-left-radius:0.1em;border-top-right-radius:0.1em;padding:0.5em;box-sizing:border-box;z-index:10;transition:all 0.3s ease;border-top-left-radius:inherit;border-top-right-radius:inherit;}.spotify-player-album-card-title{position:relative;font-size:1em;font-weight:bold;text-align:center;background:linear-gradient(135deg,#f5f5dc,#e6e6e6,#d4d4d4);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;font-family:\'Cinzel\',serif;box-sizing:border-box;z-index:11;transition:all 0.3s ease;overflow:visible;filter:drop-shadow(2px 2px 4px rgba(0,0,0,0.6));}@supports not (-webkit-background-clip:text){.spotify-player-album-card-title{color:#d4af37;}}.spotify-player-album-card-subtitle{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(0deg,var(--darkest),rgba(20,20,30,0.9));background-color:var(--darker);background-blend-mode:overlay;background-size:cover;opacity:0.8;color:var(--lighter);font-style:italic;font-size:0.6em;text-align:center;padding:0.3em;padding-left:0.1em;padding-right:0.1em;border-top:2px solid var(--darkest);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;transition:all 0.3s ease;font-family:\'Cinzel\',serif;box-sizing:border-box;z-index:10;}';const I=a=>{let{title:o,subtitle:i,image:c}=a;const[l,s]=t(!1),[p,u]=t(""),d=r(),[f,y]=t((()=>(new Date).getTime()/200%360));n((()=>{if(c){const e=new Image;e.crossOrigin="Anonymous",e.src=c,e.onload=()=>{const t=(e=>{const t=d.current,r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,t.width,t.height);const n=r.getImageData(0,0,t.width,t.height).data,a={},o=50;for(let e=0;e<n.length;e+=4){const t=Math.round(n[e]/o)*o,r=Math.round(n[e+1]/o)*o,i=Math.round(n[e+2]/o)*o,c="rgb(".concat(t,",").concat(r,",").concat(i,")");a[c]=(a[c]||0)+1}const i=Object.entries(a).sort(((e,t)=>t[1]-e[1])).slice(0,3).map((e=>e[0]));return i.length>1?"linear-gradient(to right, ".concat(i.join(", "),")"):"linear-gradient(to right, ".concat(i[0],", ").concat(i[0],")")})(e);u(t),s(!0)},e.onerror=()=>{console.error("Failed to load album art."),u("linear-gradient(to right, #000, #333)"),s(!0)}}}),[c]),n((()=>{const e=setInterval((()=>{const e=(new Date).getTime();y(e/200%360)}),300);return()=>clearInterval(e)}),[]);const m="".concat(p.replace("to right","".concat(f,"deg")));return e.createElement("div",{className:"spotify-player-album-card-wrapper",style:{"--gradient-border":m,opacity:l?1:0}},e.createElement("canvas",{ref:d,style:{display:"none"}}),e.createElement("div",{className:"spotify-player-album-card-container"},e.createElement("div",{className:"spotify-player-album-card-container-border"}),e.createElement("div",{className:"spotify-player-album-card-image-container"},e.createElement("img",{className:"spotify-player-album-card-image",alt:"".concat(o," - ").concat(i),src:c})),e.createElement("div",{className:"spotify-player-album-card-title-container"},e.createElement("div",{className:"spotify-player-album-card-title"},o)),e.createElement("div",{className:"spotify-player-album-card-subtitle"},i)))};var A={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},L=e.createContext&&e.createContext(A),R=["attr","size","title"];function D(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},B.apply(this,arguments)}function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){U(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(t){return t&&t.map(((t,r)=>e.createElement(t.tag,F({key:r},t.attr),q(t.child))))}function J(t){return r=>e.createElement(Y,B({attr:F({},t.attr)},r),q(t.child))}function Y(t){var r=r=>{var n,{attr:a,size:o,title:i}=t,c=D(t,R),l=o||r.size||"1em";return r.className&&(n=r.className),t.className&&(n=(n?n+" ":"")+t.className),e.createElement("svg",B({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,c,{className:n,style:F(F({color:t.color||r.color},r.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&e.createElement("title",null,i),t.children)};return void 0!==L?e.createElement(L.Consumer,null,(e=>r(e))):r(A)}function G(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M336.77 30.56A240 240 0 0 0 137.145 48 240 240 0 0 0 20.162 298.94l142.405-25.665c-6.87-38.47 10.598-78.89 46.42-99.323 25.063-14.296 53.977-15.877 79.228-6.808L336.77 30.56zm52.936 26.914l-80.56 120.245c11.773 7.904 21.943 18.56 29.43 31.683 25.942 45.482 10.03 103.645-35.452 129.588-43.752 24.957-99.236 11.178-126.487-30.395L55.644 388a240 240 0 0 0 319.322 76.943 240 240 0 0 0 89.56-327.382 240 240 0 0 0-74.82-80.086zM290.19 187.387c-22.148-10.942-49.142-11-72.286 2.2-30.09 17.163-44.195 51.33-37.098 83.402 1.637 7.4 4.404 14.687 8.364 21.63 21.123 37.033 68.003 49.86 105.035 28.737s49.858-68.003 28.736-105.035c-7.92-13.887-19.463-24.37-32.75-30.935zm-15.607 33.635a40 40 0 0 1 16.218 15.632 40 40 0 0 1-14.927 54.563 40 40 0 0 1-54.56-14.927 40 40 0 0 1-4.31-11.153 40 40 0 0 1 19.232-43.41 40 40 0 0 1 38.348-.705zm-109.206 63.764L27.33 327.966a240 240 0 0 0 13.3 34.151L170.765 298.3c-2.17-4.418-3.96-8.937-5.388-13.514z"},child:[]}]})(e)}function K(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M73 25v238h366V25H283v16h140v192H89V41h140V25H73zm174 0v16h18V25h-18zM107 59v156h298V59H107zM71.03 281l-43.5 174H484.5L441 281h-29.9l20 96h-99.6l16 64H163.8l20-64H80.93l19.97-96H71.03zm48.27 0l-2.9 14H147l2.3-14h-30zm48.4 0l-2.3 14h30.7l1.7-14h-30.1zm48.2 0l-1.7 14H247v-14h-31.1zm49.1 0v14h32.8l-1.7-14H265zm49.2 0l1.7 14h30.7l-2.3-14h-30.1zm48.5 0l2.3 14h30.6l-2.9-14h-30zm-250 32l-3 14h31.9l2.4-14h-31.3zm49.7 0l-2.4 14h32.1l1.7-14h-31.4zm49.5 0l-1.7 14H247v-14h-35.1zm53.1 0v14h36.8l-1.7-14H265zm53.2 0l1.7 14H352l-2.4-14h-31.4zm49.8 0l2.4 14h31.9l-3-14H368zm-262 32l-2.9 14h33.2l2.3-14H106zm51 0l-2.3 14h33.4l1.7-14H157zm50.9 0l-1.7 14H247v-14h-39.1zm57.1 0v14h40.8l-1.7-14H265zm57.2 0l1.7 14h33.4l-2.3-14h-32.8zm51.2 0l2.3 14h33.2l-2.9-14h-32.6zm-170.8 32l-14.4 46h136.3L313 377H202.6zM28 473v18h456v-18H28z"},child:[]}]})(e)}function Q(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M60.307 17.998A201.117 201.117 0 0 0 55.002 64c0 78.375 45.002 146.35 110.539 179.486-8.783-10.556-16.478-22.658-23.1-35.912-42.318-33.5-69.443-85.327-69.443-143.574 0-15.895 2.035-31.305 5.832-46.002H60.307zm66.644 0c-5.142 14.384-7.949 29.87-7.949 46.002 0 51.245 28.27 95.989 70.031 119.482-6.264-10.227-11.17-21.604-15.023-33.158C151.2 128.657 136.998 98.02 136.998 64c0-16.319 3.275-31.856 9.193-46.002h-19.24zm72.445 0C189.156 30.565 183.002 46.585 183.002 64c0 26.543 14.293 49.845 35.572 62.623-3.806-9.484-6.58-20.417-8.332-32.014-5.84-8.738-9.244-19.259-9.244-30.609 0-11.35 3.403-21.87 9.244-30.61a168.14 168.14 0 0 1 3.053-15.392h-13.899zm99.31 0a168.14 168.14 0 0 1 3.052 15.393c5.84 8.738 9.244 19.259 9.244 30.609 0 11.35-3.403 21.87-9.244 30.61-1.751 11.596-4.526 22.529-8.332 32.013 21.279-12.778 35.572-36.08 35.572-62.623 0-17.415-6.153-33.435-16.394-46.002h-13.899zm67.103 0c5.918 14.146 9.193 29.683 9.193 46.002 0 34.02-14.202 64.657-37.012 86.324-3.852 11.554-8.76 22.93-15.023 33.158C364.728 159.99 392.998 115.245 392.998 64c0-16.132-2.807-31.618-7.95-46.002h-19.24zm67.36 0A183.653 183.653 0 0 1 439.003 64c0 58.247-27.125 110.074-69.443 143.574-6.622 13.254-14.317 25.356-23.1 35.912C411.996 210.35 456.998 142.375 456.998 64c0-15.825-1.837-31.226-5.305-46.002H433.17zM256 40.998c-12.81 0-23.002 10.192-23.002 23.002 0 12.81 10.192 23.002 23.002 23.002 12.81 0 23.002-10.192 23.002-23.002 0-12.81-10.192-23.002-23.002-23.002zm-20.35 58.537L119.398 477.354l17.204 5.292 13.15-42.74L256 415.39l106.248 24.517 13.15 42.74 17.204-5.292L276.35 99.535a40.612 40.612 0 0 1-17.192 5.328l49.654 161.381L256 283.848l-52.813-17.604 49.655-161.38a40.612 40.612 0 0 1-17.192-5.329zM197.893 283.45l29.65 9.885-36.428 12.143 6.778-22.028zm116.214 0l6.778 22.028-36.428-12.143 29.65-9.885zM256 302.82l52.652 17.55L256 339.516l-52.65-19.147L256 302.82zm-73.074 29.275l46.74 16.998-58.518 21.28 11.778-38.278zm146.148 0l11.778 38.277-58.52-21.28 46.742-16.997zM256 358.666l64.354 23.402L256 396.92l-64.355-14.852L256 358.666zm-92.16 35.455l52.144 12.033-60.115 13.873 7.97-25.906zm184.318 0l7.973 25.904-60.113-13.87 52.14-12.034z"},child:[]}]})(e)}function X(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M499.99 176h-59.87l-16.64-41.6C406.38 91.63 365.57 64 319.5 64h-127c-46.06 0-86.88 27.63-103.99 70.4L71.87 176H12.01C4.2 176-1.53 183.34.37 190.91l6 24C7.7 220.25 12.5 224 18.01 224h20.07C24.65 235.73 16 252.78 16 272v48c0 16.12 6.16 30.67 16 41.93V416c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-32h256v32c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-54.07c9.84-11.25 16-25.8 16-41.93v-48c0-19.22-8.65-36.27-22.07-48H494c5.51 0 10.31-3.75 11.64-9.09l6-24c1.89-7.57-3.84-14.91-11.65-14.91zm-352.06-17.83c7.29-18.22 24.94-30.17 44.57-30.17h127c19.63 0 37.28 11.95 44.57 30.17L384 208H128l19.93-49.83zM96 319.8c-19.2 0-32-12.76-32-31.9S76.8 256 96 256s48 28.71 48 47.85-28.8 15.95-48 15.95zm320 0c-19.2 0-48 3.19-48-15.95S396.8 256 416 256s32 12.76 32 31.9-12.8 31.9-32 31.9z"},child:[]}]})(e)}function Z(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},child:[]}]})(e)}function ee(e){return J({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"},child:[]}]})(e)}function te(e){return J({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function re(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"},child:[]}]})(e)}function ne(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"},child:[]}]})(e)}function ae(e){return J({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M64 468V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v176.4l195.5-181C352.1 22.3 384 36.6 384 64v384c0 27.4-31.9 41.7-52.5 24.6L136 292.7V468c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12z"},child:[]}]})(e)}function oe(e){return J({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M384 44v424c0 6.6-5.4 12-12 12h-48c-6.6 0-12-5.4-12-12V291.6l-195.5 181C95.9 489.7 64 475.4 64 448V64c0-27.4 31.9-41.7 52.5-24.6L312 219.3V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12z"},child:[]}]})(e)}function ie(e){return J({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.03 72.04L126.06 161H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V89.02c0-21.47-25.96-31.98-40.97-16.98zm123.2 108.08c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 229.28 336 242.62 336 257c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.87z"},child:[]}]})(e)}function ce(e){return J({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},child:[]}]})(e)}const le={computer:K,tablet:function(e){return J({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"},child:[]}]})(e)},smartphone:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M160 32c-16 0-32 16-32 32v384c0 16 16 32 32 32h192c16 0 32-16 32-32V64c0-16-16-32-32-32H160zm21.68 23h96v18h-96V55zM304 55h32v18h-32V55zM154 96h204v320H154V96zm70 342h63.984c16 0 16 16 16 16v6H208v-6s0-16 16-16z"},child:[]}]})(e)},speaker:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M275.5 96l-96 96h-96v128h96l96 96V96zm51.46 27.668l-4.66 17.387c52.066 13.95 88.2 61.04 88.2 114.945 0 53.904-36.134 100.994-88.2 114.945l4.66 17.387C386.81 372.295 428.5 317.962 428.5 256c0-61.963-41.69-116.295-101.54-132.332zm-12.425 46.365l-4.658 17.387C340.96 195.748 362.5 223.822 362.5 256s-21.54 60.252-52.623 68.58l4.658 17.387C353.402 331.552 380.5 296.237 380.5 256c0-40.238-27.098-75.552-65.965-85.967zm-12.424 46.363l-4.657 17.387C307.55 236.49 314.5 245.547 314.5 256s-6.95 19.51-17.047 22.217l4.658 17.387c17.884-4.792 30.39-21.09 30.39-39.604 0-18.513-12.506-34.812-30.39-39.604z"},child:[]}]})(e)},tv:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M132.992 48.756l-9.984 14.976 77.287 51.524c4.32-4.192 9.542-8.012 15.703-11.162l-83.006-55.338zm246.016 0l-83.006 55.338c6.16 3.15 11.383 6.97 15.703 11.162l77.287-51.524-9.984-14.976zM256 113.244c-22 0-35.334 7.06-43.637 15.363-4.703 4.704-7.58 9.97-9.316 14.637h105.906c-1.736-4.668-4.613-9.933-9.316-14.637-8.303-8.303-21.637-15.363-43.637-15.363zm-191.936 48c-5.044 0-11.106 2.784-15.697 7.37-4.59 4.584-7.367 10.63-7.367 15.63v279h430V184.2c.026-5.457-2.764-11.393-7.227-15.87-4.463-4.477-10.346-7.086-14.826-7.086H64.064zm30.295 23h257.745c10.374 0 20.79 6.818 26.776 16H112c-16 0-32 16-32 32v160c25.924-162.54 145.877-185.697 299.016-191.795 3.106 4.836 4.984 10.315 4.984 15.794v192c0 16-16 32-33.88 32H95.35c-15.35 0-31.35-16-31.35-32v-192c0-16 16-32 30.36-32zm328.663 7c13.7 0 25 11.3 25 25s-11.3 25-25 25-25-11.3-25-25 11.3-25 25-25zm-23.023 144h48v18h-48v-18zm0 32h48v18h-48v-18zm0 32h48v18h-48v-18z"},child:[]}]})(e)},avr:Q,stb:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M470.38 1.51L150.41 96A32 32 0 0 0 128 126.51v261.41A139 139 0 0 0 96 384c-53 0-96 28.66-96 64s43 64 96 64 96-28.66 96-64V214.32l256-75v184.61a138.4 138.4 0 0 0-32-3.93c-53 0-96 28.66-96 64s43 64 96 64 96-28.65 96-64V32a32 32 0 0 0-41.62-30.49z"},child:[]}]})(e)},audio_dongle:G,game_console:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M155.084 125.945c-.46 0-.926.01-1.397.034-5.646.285-12.097 2.464-20.707 8.204-21.824 14.55-51.912 60.395-67.834 110.005-15.92 49.61-18.046 102.25 5.936 132.966 4.142 5.306 13.387 8.93 23.756 8.846 10.216-.084 20.682-3.838 26.482-9.44 1.022-1.47 9.296-13.336 21.39-27.404 12.863-14.96 28.716-31.686 45.835-38.777 41.863-17.34 93.024-17.34 134.887 0 17.118 7.092 32.97 23.818 45.834 38.778 12.095 14.068 20.37 25.933 21.39 27.404 5.8 5.602 16.267 9.356 26.483 9.44 10.368.085 19.612-3.54 23.755-8.846 23.973-30.704 21.885-83.575 5.978-133.287-15.907-49.713-46.054-95.526-67.783-109.624-11.498-7.46-19.198-8.73-26.285-7.64-7.088 1.093-14.347 5.197-22.866 11.07-17.038 11.746-38.898 30.02-73.952 30.02-35.212 0-57.115-18.514-74.13-30.356-8.505-5.92-15.73-10.025-22.743-11.078-1.315-.198-2.65-.312-4.03-.317zm212.904 48.75a16 16 0 0 1 16 16 16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16zM135 183h18v32h32v18h-32v32h-18v-32h-32v-18h32v-32zm200.988 23.695a16 16 0 0 1 16 16 16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16zm64 0a16 16 0 0 1 16 16 16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16zm-32 32a16 16 0 0 1 16 16 16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16zm-160 7h32v18h-32v-18zm64 0h27.897v18h-27.897v-18z"},child:[]}]})(e)},cast_video:function(e){return J({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M447.8,64H64c-23.6,0-42.7,19.1-42.7,42.7v63.9H64v-63.9h383.8v298.6H298.6V448H448c23.6,0,42.7-19.1,42.7-42.7V106.7 C490.7,83.1,471.4,64,447.8,64z M21.3,383.6L21.3,383.6l0,63.9h63.9C85.2,412.2,56.6,383.6,21.3,383.6L21.3,383.6z M21.3,298.6V341 c58.9,0,106.6,48.1,106.6,107h42.7C170.7,365.6,103.7,298.7,21.3,298.6z M213.4,448h42.7c-0.5-129.5-105.3-234.3-234.8-234.6l0,42.4 C127.3,255.6,213.3,342,213.4,448z"},child:[]}]})(e)},cast_audio:G,automobile:X,smartwatch:function(e){return J({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z",opacity:".1"},child:[]},{tag:"path",attr:{d:"M20 12c0-2.54-1.19-4.81-3.04-6.27L16 0H8l-.95 5.73C5.19 7.19 4 9.45 4 12s1.19 4.81 3.05 6.27L8 24h8l.96-5.73A7.976 7.976 0 0 0 20 12zM6 12c0-3.31 2.69-6 6-6s6 2.69 6 6-2.69 6-6 6-6-2.69-6-6z"},child:[]}]})(e)},chromebook:K,car_thing:X,observer:re,home_thing:Q},se=t=>{let{isConnected:r,deviceName:n,isPlaying:a,deviceType:o}=t;const i=null==o?void 0:o.toLowerCase(),c=le[i]||re;return e.createElement("div",{className:"spotify-player-device-title"},r?e.createElement(c,{className:a?"spotify-player-connected-icon rotating":"spotify-player-connected-icon"}):e.createElement(Z,{className:"spotify-player-connected-icon disconnected"}),e.createElement("h4",null,n))},pe=t=>{var r;let{track:n,formatReleaseDate:a}=t;return e.createElement("div",{className:"spotify-player-track-details"},e.createElement("table",{className:"spotify-player-track-details-table"},e.createElement("tbody",null,e.createElement("tr",{className:"spotify-player-track-details-row"},e.createElement("td",{className:"track-details-cell key-cell"},"Title"),e.createElement("td",{className:"track-details-cell value-cell"},(null==n?void 0:n.name)||"N/A")),e.createElement("tr",{className:"spotify-player-track-details-row"},e.createElement("td",{className:"track-details-cell key-cell"},"Artist"),e.createElement("td",{className:"track-details-cell value-cell"},(null==n||null===(r=n.artist_names)||void 0===r?void 0:r.join(", "))||"N/A")),e.createElement("tr",{className:"spotify-player-track-details-row"},e.createElement("td",{className:"track-details-cell key-cell"},"Released"),e.createElement("td",{className:"track-details-cell value-cell"},null!=n&&n.release_date?a(n.release_date):"N/A")))))},ue=t=>{let{isPlaying:r,handlePlayPause:n,handleNextTrack:a,handlePreviousTrack:o,shuffleContext:i,toggleShuffle:c,track:l,currentPosition:s,handleSeek:p,handleVolumeChange:u,volume:d,maxVolume:f}=t;return e.createElement("div",{className:"spotify-player-controls-container"},e.createElement("div",{className:"spotify-player-playback-controls"},e.createElement("button",{onClick:o,className:"spotify-player-control-button"},e.createElement(ae,null)),e.createElement("button",{onClick:n,className:"spotify-player-control-button"},r?e.createElement(ee,null):e.createElement(te,null)),e.createElement("button",{onClick:a,className:"spotify-player-control-button"},e.createElement(oe,null)),i?e.createElement("div",{className:"spotify-player-toggle-container on",onClick:c},e.createElement("div",{className:"spotify-player-toggle-track-text"},"ON"),e.createElement("div",{className:"spotify-player-toggle-thumb"},e.createElement(ne,{className:"spotify-player-toggle-thumb-icon"}))):e.createElement("div",{className:"spotify-player-toggle-container off",onClick:c},e.createElement("div",{className:"spotify-player-toggle-thumb"},e.createElement(ne,{className:"spotify-player-toggle-thumb-icon"})),e.createElement("div",{className:"spotify-player-toggle-track-text"},"OFF"))),l&&e.createElement("div",{className:"spotify-player-seek-container"},e.createElement("span",null,Math.floor(s/1e3),"s"),e.createElement("input",{type:"range",min:"0",max:"100",value:s/l.duration*100,onChange:p,className:"spotify-player-seek-bar"}),e.createElement("span",null,Math.floor(l.duration/1e3),"s")),e.createElement("div",{className:"spotify-player-volume-control"},e.createElement("span",null,e.createElement(ie,null)),e.createElement("input",{type:"range",min:"0",max:"100",value:d/f*100,onChange:u,className:"spotify-player-volume-slider"}),e.createElement("span",null,e.createElement(ce,null))))},de=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const n=await fetch(e,t);return n.ok?n:(console.error("API call failed: ".concat(n.status," ").concat(n.statusText)),r)}catch(e){return console.error("Error in API call:",e),r}};let fe="";const ye=async e=>{fe!==e&&(fe=e);return(await de("".concat(fe,"/status"),{},{})).json()},me=async()=>await de("".concat(fe,"/player/resume"),{method:"POST"}),he=async()=>await de("".concat(fe,"/player/pause"),{method:"POST"}),be=async()=>await de("".concat(fe,"/player/prev"),{method:"POST"}),ge=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return await de("".concat(fe,"/player/seek"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({position:e,relative:t})})},ve=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return await de("".concat(fe,"/player/volume"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({volume:e,relative:t})})},xe=async e=>await de("".concat(fe,"/player/shuffle_context"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shuffle_context:e})});document.head.appendChild(document.createElement("style")).textContent=".spotify-player-spotify-card{display:flex;flex-direction:column;gap:0.8em;background-color:var(--darker);transition:all 0.3s ease;margin:0 auto;border:1px solid var(--dark);border-radius:0.3em;position:relative;padding:1.2em;z-index:1;overflow:visible;box-shadow:rgba(40,44,52,0.5) 2px 4px 6px 2px;}.spotify-player-spotify-card:hover{box-shadow:0 12px 24px rgba(0,0,0,0.3);z-index:3;position:relative;}.spotify-player-info-container{display:flex;gap:1.2em;align-items:center;justify-content:center;transition:width 0.3s ease,height 0.3s ease,filter 0.3s ease,z-index 0s;width:100%;}.spotify-player-spotify-details{display:flex;flex-direction:column;width:100%;transition:width 0.3s ease,height 0.3s ease,filter 0.3s ease,z-index 0s;white-space:nowrap;}.spotify-player-spotify-details:hover{white-space:unset;}.spotify-player-device-title{display:flex;flex-direction:row;gap:1em;text-align:center;background-color:var(--dark);width:100%;transition:width 0.3s ease,height 0.3s ease,filter 0.3s ease,z-index 0s;justify-content:center;box-shadow:0 0 10px rgba(0,0,0,0.5);align-items:center;padding:0.5em;padding-left:0.3em;padding-right:0.3em;border-radius:0.2em;margin:0;margin-bottom:0.5em;}.spotify-player-device-title h4{font-weight:bold;text-align:center;font-size:1.5rem;color:var(--weird);text-align:center;margin:20px 0;transition:transform 0.2s,color 0.3s ease;}.spotify-player-device-title:hover h4{transform:scale(1.1);color:var(--yellow);}.spotify-player-controls-container{display:flex;flex-direction:column;gap:1em;text-align:center;width:100%;margin-top:1em;transition:width 0.3s ease,height 0.3s ease,filter 0.3s ease,z-index 0s;justify-content:center;align-items:center;}.spotify-player-track-details{flex:1;margin-top:0.5em;background-color:var(--darkest);padding:0.3em;border-radius:0.5em;border:1px solid var(--grey);box-shadow:inset 0 0 5px rgba(0,0,0,0.5);}.spotify-player-track-details-table{width:100%;border-collapse:collapse;table-layout:fixed;}.spotify-player-track-details-row{display:flex;justify-content:space-between;padding:0.1em 0;}.spotify-player-track-details-cell{padding:0.1em;word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;font-size:0.8em;}.spotify-player-key-cell{font-weight:bold;color:var(--lightest);flex-basis:30%;}.spotify-player-value-cell{flex-basis:70%;color:var(--lightest);user-select:text;}@media (max-width:500px){.spotify-player-info-container{flex-direction:column-reverse;}.spotify-player-track-info{flex-direction:column;}.spotify-player-album-cover{max-width:100%;}.spotify-player-seek-container{width:100%;padding:0 1rem;}.spotify-player-volume-control{width:100%;padding:0 1rem;}}.spotify-player-track-info{display:flex;align-items:center;margin:0.4em;gap:1.5rem;}.spotify-player-album-cover{width:120px;height:120px;border-radius:0.4em;}.spotify-player-seek-container{display:flex;align-items:center;gap:1rem;width:100%;margin:0.4em;max-width:500px;}.spotify-player-seek-container span{flex:1;justify-content:center;align-items:center;display:flex;}.spotify-player-seek-bar{-webkit-appearance:none;flex:4;height:8px;border-radius:0.4em;background-color:var(--blue);transition:background 0.3s ease;}.spotify-player-seek-bar:hover{background:var(--cyan);cursor:pointer;}.spotify-player-seek-bar::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;border-radius:0.4em;background:var(--lighter);height:18px;}.spotify-player-seek-bar::-webkit-slider-runnable-track:hover{background:var(--lightest);cursor:pointer;}.spotify-player-seek-bar::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:24px;border-radius:0.4em;background:var(--grey);cursor:pointer;position:relative;top:-3px;transition:all 0.2s ease;}.spotify-player-seek-bar::-webkit-slider-thumb:hover{background:var(--blue);transform:scale(1.2);}.spotify-player-playback-controls{display:flex;align-items:center;justify-content:space-between;background:var(--button-background);border-radius:0.4em;padding-left:0.4em;padding-right:0.4em;max-width:500px;}.spotify-player-control-button{font-family:'Roboto',sans-serif;text-decoration:none;outline:none;border:none;transition:all 0.3s ease;flex:1;display:flex;align-items:center;justify-content:center;height:36px;width:36px;font-size:1.5rem;background:var(--button-background);border-radius:0.4em;cursor:pointer;}.spotify-player-control-button:hover{transform:scale(1.1);box-shadow:0 5px 15px rgba(0,0,0,0.2);background:var(--button-hover-background);}.spotify-player-volume-control{display:flex;flex:3;align-items:center;gap:1rem;width:100%;margin:0.4em;max-width:500px;}.spotify-player-volume-control span{flex:1;justify-content:center;align-items:center;display:flex;}.spotify-player-volume-slider{-webkit-appearance:none;flex:4;height:8px;border-radius:0.4em;background:var(--green);transition:background 0.3s ease;}.spotify-player-volume-slider:hover{background:var(--cyan);cursor:pointer;}.spotify-player-volume-slider::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;border-radius:0.4em;background:var(--lighter);height:18px;}.spotify-player-volume-slider::-webkit-slider-runnable-track:hover{background:var(--lightest);cursor:pointer;}.spotify-player-volume-slider::-webkit-slider-runnable-track:hover{background:var(--lightest);cursor:pointer;}.spotify-player-volume-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:24px;border-radius:0.4em;background:var(--grey);position:relative;top:-3px;cursor:pointer;transition:all 0.2s ease;}.spotify-player-volume-slider::-webkit-slider-thumb:hover{background:var(--blue);transform:scale(1.2);}.spotify-player-toggle-container{display:flex;align-items:center;justify-content:space-between;padding-left:0.5em;padding-right:0.5em;width:90px;height:36px;border-radius:0.4em;background:var(--darker);position:relative;cursor:pointer;transition:all 0.3s ease;margin:0.4em;}.spotify-player-toggle-container:hover{transform:scale(1.1);}.spotify-player-toggle-container.on{background:var(--blue);}.spotify-player-toggle-container.off{background:var(--darkest);}.spotify-player-toggle-track-text{flex:1;font-size:0.85rem;font-weight:bold;color:var(--text-color);padding:0 8px;text-align:center;user-select:none;}.spotify-player-toggle-thumb{top:4px;width:28px;height:28px;border-radius:0.4em;background:var(--light);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0,0,0,0.3);flex:1;}.spotify-player-toggle-thumb-icon{font-size:1rem;color:var(--darker);}.spotify-player-connected-icon{font-size:2rem;color:var(--blue);}.spotify-player-connected-icon.disconnected{color:var(--red);}.spotify-player-connected-icon.rotating{animation:spin 2s linear infinite;}@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}@media (min-width:900px){.spotify-player-spotify-details{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:1em;}.spotify-player-details-container{flex:2;display:flex;flex-direction:column;gap:0.5em;}.spotify-player-controls-container{flex:1;max-width:300px;margin-top:0;}}";const we=a=>{let{websocketUrl:o=process.env.REACT_APP_WS_URL||"ws://localhost:3678/events",apiBaseUrl:i="http://apollo:3678",hideOnDisconnect:c=!1}=a;const[l,s]=t(null),[p,u]=t(null),[d,f]=t(0),[y,m]=t(100),[h,b]=t(!1),[g,v]=t(!1),[x,w]=t(0),k=r(null),{isConnected:z,error:E}=((e,a)=>{const[o,i]=t({isConnected:!1,error:null}),c=r(0),l=r(null),s=r(null),p=()=>{if(c.current>10)return i({isConnected:!1,error:"Max reconnection attempts reached."}),void console.warn("Max WebSocket reconnection attempts reached.");if(l.current)return void console.warn("WebSocket instance already exists. Skipping connect.");console.log("Connecting to WebSocket at ".concat(e," (Retry: ").concat(c.current,")"));const t=new WebSocket(e);l.current=t,t.onopen=()=>{console.log("WebSocket connected successfully."),i({isConnected:!0,error:null}),c.current=0},t.onmessage=e=>{try{const t=JSON.parse(e.data);a&&a(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=e=>{console.error("WebSocket encountered an error:",e.message||e),i((t=>H(H({},t),{},{error:e.message||"WebSocket encountered an error"})))},t.onclose=e=>{if(console.warn("WebSocket closed (code: ".concat(e.code,", reason: ").concat(e.reason||"none",")")),1e3===e.code)return console.log("WebSocket closed normally."),i({isConnected:!1,error:null}),void(l.current=null);i({isConnected:!1,error:e.reason||"Connection closed"}),l.current=null;const t=Math.min(1e3*2**c.current,3e4);console.log("Reconnecting in ".concat(t/1e3," seconds...")),s.current=setTimeout((()=>{c.current+=1,p()}),t)}};return n((()=>(p(),()=>{s.current&&clearTimeout(s.current),l.current&&(console.log("Closing WebSocket due to component unmount."),l.current.close(1e3,"Component unmounted"),l.current=null)})),[e]),o})(o,(e=>{switch(e.type){case"metadata":u(e.data),w(0);break;case"playing":b(!0);break;case"paused":b(!1);break;case"seek":w(e.data.position);break;case"volume":f(e.data.value);break;case"shuffle_context":v(e.data.value)}}));n((()=>{(async()=>{var e;const t=await ye(i);s(t),u(t.track),f(t.volume),m(t.volume_steps),b(!t.paused),v(t.shuffle_context),w((null===(e=t.track)||void 0===e?void 0:e.position)||0)})()}),[i]),n((()=>(h&&p?k.current=setInterval((()=>{w((e=>{const t=e+1e3;return t<p.duration?t:p.duration}))}),1e3):clearInterval(k.current),()=>clearInterval(k.current))),[h,p]);if(!c||z)return e.createElement("div",{className:"spotify-player-spotify-card"},e.createElement("div",{className:"spotify-player-info-container"},e.createElement(I,{title:(null==p?void 0:p.album_name)||"N/A",subtitle:"Disc ".concat((null==p?void 0:p.disc_number)||"N/A",", Track ").concat((null==p?void 0:p.track_number)||"N/A"),image:null==p?void 0:p.album_cover_url}),e.createElement("div",{className:"spotify-player-spotify-details"},e.createElement("div",{className:"spotify-player-details-container"},e.createElement(se,{isConnected:z,deviceName:null==l?void 0:l.device_name,deviceType:null==l?void 0:l.device_type,isPlaying:h}),e.createElement(pe,{track:p,formatReleaseDate:e=>{const t=e.match(/year:\s*(\d+)\s*month:\s*(\d+)\s*day:\s*(\d+)/);if(t){const e=t[1],r=t[2].padStart(2,"0"),n=t[3].padStart(2,"0");return"".concat(e,"-").concat(r,"-").concat(n)}return"Invalid Date"}})),e.createElement(ue,{isPlaying:h,handlePlayPause:()=>{h?he():me(),b(!h)},handleNextTrack:()=>{p&&(ge(p.duration-50),w(p.duration-50))},handlePreviousTrack:be,shuffleContext:g,toggleShuffle:()=>{xe(!g),v(!g)},track:p,currentPosition:x,handleSeek:e=>{const t=e.target.value/100*p.duration;ge(Math.floor(t)),w(t)},volume:d,maxVolume:y,handleVolumeChange:e=>{const t=e.target.value/100*y;ve(Math.round(t)),f(Math.round(t))}}))),E&&e.createElement("span",{className:"error"},"Error: ",E))};we.propTypes={websocketUrl:_.string,apiBaseUrl:_.string,hideOnDisconnect:_.bool},document.head.appendChild(document.createElement("style")).textContent=":root{--red:#f7768e;--orange:#ff9e64;--yellow:#e0af68;--weird:#cfc9c2;--green:#73daca;--cyan:#7dcfff;--blue:#7aa2f7;--magenta:#bb9af7;--lightest:#c0caf5;--lighter:#a9b1d6;--light:#9aa5ce;--grey:#565f89;--dark:#414868;--darker:#24283b;--darkest:#1a1b26;--body-background-color:var(--darkest);--section-background:var(--darker);--button-background:var(--grey);--button-border:var(--dark);--button-text-color:var(--lightest);--button-hover-background:var(--dark);--visitor-counter-background:var(--dark);--text-color:var(--lightest);--heading-color:var(--lightest);--heading-color-alt:var(--lighter);--scrollbar-track-color:var(--darker);--scrollbar-thumb-color:var(--grey);--scrollbar-thumb-hover-color:var(--blue);--accent-color:var(--yellow);--link-color:var(--cyan);--link-hover-color:var(--magenta);--subtext-color:var(--light);--description-color:var(--grey);--scroll-factor:0.2;}*{margin:0;padding:0;box-sizing:border-box;}#root{overflow-x:hidden;overflow-y:hidden;font-family:'Roboto',sans-serif;background:var(--body-background-color);color:var(--text-color);overflow-x:hidden;overflow-y:hidden;padding:0;margin:0;width:100%;height:100%;}";export{we as default};
|
|
15
|
+
//# sourceMappingURL=index.esm.js.map
|