soundwave/frontend/dist/assets/index-ChIfYXgy.js

10 lines
196 KiB
JavaScript
Raw Normal View History

var zn=Object.defineProperty;var Wn=(t,r,s)=>r in t?zn(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var ke=(t,r,s)=>Wn(t,typeof r!="symbol"?r+"":r,s);import{u as Dn,i as B,j as e,B as d,T as c,a as J,I as Xe,b as U,F as oe,C as Fn,c as E,d as Pt,P as Fe,e as It,f as Rt,g as me,h as W,k as Ot,S as Te,l as Is,m as Be,n as Re,L as Pe,o as he,p as qe,q as jt,A as ze,r as ce,s as ee,G as F,t as ne,v as Jr,w as ae,x as st,Y as Kr,y as V,z as Rs,R as lt,D as nt,E as je,H as ve,J as we,K as Se,M as Xr,O as Ve,W as Os,N as Ce,Q as Es,U as Zr,V as Nt,X as Mn,Z as Bt,_ as Et,$ as Ae,a0 as $n,a1 as ct,a2 as es,a3 as Ln,a4 as Ts,a5 as zs,a6 as Ws,a7 as Ne,a8 as He,a9 as le,aa as Un,ab as Nn,ac as at,ad as ot,ae as be,af as qt,ag as Ds,ah as Bn,ai as wt,aj as ts,ak as qn,al as Hn,am as Vn,an as Gn,ao as Yn,ap as Qn,aq as Jn,ar as rs,as as Kn,at as ss,au as Xn,av as Zn,aw as ea,ax as ns,ay as ta,az as as,aA as ra,aB as sa,aC as na,aD as aa}from"./mui-DW1KyNMb.js";import{c as oa,g as ia,r as y,u as Le,d as la,a as pe,N as Fs,e as ca,f as da,h as fe,B as ua}from"./vendor-Bv7lQTk9.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function s(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(a){if(a.ep)return;a.ep=!0;const o=s(a);fetch(a.href,o)}})();var Ht={},os=oa;Ht.createRoot=os.createRoot,Ht.hydrateRoot=os.hydrateRoot;var tr={},Mt={};const ha=ia(Dn);var is;function q(){return is||(is=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=ha}(Mt)),Mt}var fa=B;Object.defineProperty(tr,"__esModule",{value:!0});var _e=tr.default=void 0,xa=fa(q()),pa=e;_e=tr.default=(0,xa.default)((0,pa.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var rr={},ma=B;Object.defineProperty(rr,"__esModule",{value:!0});var sr=rr.default=void 0,ga=ma(q()),ya=e;sr=rr.default=(0,ga.default)((0,ya.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause");var nr={},ba=B;Object.defineProperty(nr,"__esModule",{value:!0});var Ms=nr.default=void 0,ja=ba(q()),va=e;Ms=nr.default=(0,ja.default)((0,va.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutline");var ar={},wa=B;Object.defineProperty(ar,"__esModule",{value:!0});var Vt=ar.default=void 0,Sa=wa(q()),_a=e;Vt=ar.default=(0,Sa.default)((0,_a.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined");var or={},Ca=B;Object.defineProperty(or,"__esModule",{value:!0});var $s=or.default=void 0,ka=Ca(q()),Aa=e;$s=or.default=(0,ka.default)((0,Aa.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}),"VisibilityOutlined");var ir={},Pa=B;Object.defineProperty(ir,"__esModule",{value:!0});var Ls=ir.default=void 0,Ia=Pa(q()),Ra=e;Ls=ir.default=(0,Ia.default)((0,Ra.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.
`).forEach(function(i){a=i.indexOf(":"),s=i.substring(0,a).trim().toLowerCase(),n=i.substring(a+1).trim(),!(!s||r[s]&&Do[s])&&(s==="set-cookie"?r[s]?r[s].push(n):r[s]=[n]:r[s]=r[s]?r[s]+", "+n:n)}),r},hs=Symbol("internals");function Ke(t){return t&&String(t).trim().toLowerCase()}function _t(t){return t===!1||t==null?t:v.isArray(t)?t.map(_t):String(t)}function Mo(t){const r=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(t);)r[n[1]]=n[2];return r}const $o=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function $t(t,r,s,n,a){if(v.isFunction(n))return n.call(this,r,s);if(a&&(r=s),!!v.isString(r)){if(v.isString(n))return r.indexOf(n)!==-1;if(v.isRegExp(n))return n.test(r)}}function Lo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,s,n)=>s.toUpperCase()+n)}function Uo(t,r){const s=v.toCamelCase(" "+r);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+s,{value:function(a,o,i){return this[n].call(this,r,a,o,i)},configurable:!0})})}let ue=class{constructor(r){r&&this.set(r)}set(r,s,n){const a=this;function o(l,b,f){const p=Ke(b);if(!p)throw new Error("header name must be a non-empty string");const _=v.findKey(a,p);(!_||a[_]===void 0||f===!0||f===void 0&&a[_]!==!1)&&(a[_||b]=_t(l))}const i=(l,b)=>v.forEach(l,(f,p)=>o(f,p,b));if(v.isPlainObject(r)||r instanceof this.constructor)i(r,s);else if(v.isString(r)&&(r=r.trim())&&!$o(r))i(Fo(r),s);else if(v.isObject(r)&&v.isIterable(r)){let l={},b,f;for(const p of r){if(!v.isArray(p))throw TypeError("Object iterator must return a key-value pair");l[f=p[0]]=(b=l[f])?v.isArray(b)?[...b,p[1]]:[b,p[1]]:p[1]}i(l,s)}else r!=null&&o(s,r,n);return this}get(r,s){if(r=Ke(r),r){const n=v.findKey(this,r);if(n){const a=this[n];if(!s)return a;if(s===!0)return Mo(a);if(v.isFunction(s))return s.call(this,a,n);if(v.isRegExp(s))return s.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,s){if(r=Ke(r),r){const n=v.findKey(this,r);return!!(n&&this[n]!==void 0&&(!s||$t(this,this[n],n,s)))}return!1}delete(r,s){const n=this;let a=!1;function o(i){if(i=Ke(i),i){const l=v.findKey(n,i);l&&(!s||$t(n,n[l],l,s))&&(delete n[l],a=!0)}}return v.isArray(r)?r.forEach(o):o(r),a}clear(r){const s=Object.keys(this);let n=s.length,a=!1;for(;n--;){const o=s[n];(!r||$t(this,this[o],o,r,!0))&&(delete this[o],a=!0)}return a}normalize(r){const s=this,n={};return v.forEach(this,(a,o)=>{const i=v.findKey(n,o);if(i){s[i]=_t(a),delete s[o];return}const l=r?Lo(o):String(o).trim();l!==o&&delete s[o],s[l]=_t(a),n[l]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const s=Object.create(null);return v.forEach(this,(n,a)=>{n!=null&&n!==!1&&(s[a]=r&&v.isArray(n)?n.join(", "):n)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,s])=>r+": "+s).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...s){const n=new this(r);return s.forEach(a=>n.set(a)),n}static accessor(r){const n=(this[hs]=this[hs]={accessors:{}}).accessors,a=this.prototype;function o(i){const l=Ke(i);n[l]||(Uo(a,i),n[l]=!0)}return v.isArray(r)?r.forEach(o):o(r),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(ue.prototype,({value:t},r)=>{let s=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(n){this[s]=n}}});v.freezeMethods(ue);function Lt(t,r){const s=this||ft,n=r||s,a=ue.from(n.headers);let o=n.data;return v.forEach(t,function(l){o=l.call(s,o,a.normalize(),r?r.status:void 0)}),a.normalize(),o}function sn(t){return!!(t&&t.__CANCEL__)}function Qe(t,r,s){L.call(this,t??"canceled",L.ERR_CANCELED,r,s),this.name="CanceledError"}v.inherits(Qe,L,{__CANCEL__:!0});function nn(t,r,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):r(new L("Request failed with status code "+s.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function No(t){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}function Bo(t,r){t=t||10;const s=new Array(t),n=new Array(t);let a=0,o=0,i;return r=r!==void 0?r:1e3,function(b){const f=Date.now(),p=n[o];i||(i=f),s[a]=b,n[a]=f;let _=o,w=0;for(;_!==a;)w+=s[_++],_=_%t;if(a=(a+1)%t,a===o&&(o=(o+1)%t),f-i<r)return;const k=p&&f-p;return k?Math.round(w*1e3/k):void 0}}function qo(t,r){let s=0,n=1e3/r,a,o;const i=(f,p=Date.now())=>{s=p,a=null,o&&(clearTimeout(o),o=null),t(...f)};return[(...f)=>{const p=Date.now(),_=p-s;_>=n?i(f,p):(a=f,o||(o=setTimeout(()=>{o=null,i(a)},n-_)))},()=>a&&i(a)]}const At=(t,r,s=3)=>{let n=0;const a=Bo(50,250);return qo(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,b=i-n,f=a(b),p=i<=l;n=i;const _={loaded:i,total:l,progress:l?i/l:void 0,bytes:b,rate:f||void 0,estimated:f&&l&&p?(l-i)/f:void 0,event:o,lengthComputable:l!=null,[r?"download":"upload"]:!0};t(_)},s)},fs=(t,r)=>{const s=t!=null;return[n=>r[0]({lengthComputable:s,total:t,loaded:n}),r[1]]},xs=t=>(...r)=>v.asap(()=>t(...r)),Ho=ie.hasStandardBrowserEnv?((t,r)=>s=>(s=new URL(s,ie.origin),t.protocol===s.protocol&&t.host===s.host&&(r||t.port===s.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,Vo=ie.hasStandardBrowserEnv?{write(t,r,s,n,a,o,i){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(r)}`];v.isNumber(s)&&l.push(`expires=${new Date(s).toUTCString()}`),v.isString(n)&&l.push(`path=${n}`),v.isString(a)&&l.push(`domain=${a}`),o===!0&&l.push("secure"),v.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Go(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Yo(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function an(t,r,s){let n=!Go(r);return t&&(n||s==!1)?Yo(t,r):r}const ps=t=>t instanceof ue?{...t}:t;function $e(t,r){r=r||{};const s={};function n(f,p,_,w){return v.isPlainObject(f)&&v.isPlainObject(p)?v.merge.call({caseless:w},f,p):v.isPlainObject(p)?v.merge({},p):v.isArray(p)?p.slice():p}function a(f,p,_,w){if(v.isUndefined(p)){if(!v.isUndefined(f))return n(void 0,f,_,w)}else return n(f,p,_,w)}function o(f,p){if(!v.isUndefined(p))return n(void 0,p)}function i(f,p){if(v.isUndefined(p)){if(!v.isUndefined(f))return n(void 0,f)}else return n(void 0,p)}function l(f,p,_){if(_ in r)return n(f,p);if(_ in t)return n(void 0,f)}const b={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompr
`+i.map(vs).join(`
`):" "+vs(i[0]):"as no adapter specified";throw new L("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}const cn={getAdapter:ai,adapters:hr};function Ut(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Qe(null,t)}function ws(t){return Ut(t),t.headers=ue.from(t.headers),t.data=Lt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),cn.getAdapter(t.adapter||ft.adapter,t)(t).then(function(n){return Ut(t),n.data=Lt.call(t,t.transformResponse,n),n.headers=ue.from(n.headers),n},function(n){return sn(n)||(Ut(t),n&&n.response&&(n.response.data=Lt.call(t,t.transformResponse,n.response),n.response.headers=ue.from(n.response.headers))),Promise.reject(n)})}const dn="1.13.2",Ft={};["object","boolean","number","function","string","symbol"].forEach((t,r)=>{Ft[t]=function(n){return typeof n===t||"a"+(r<1?"n ":" ")+t}});const Ss={};Ft.transitional=function(r,s,n){function a(o,i){return"[Axios v"+dn+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,l)=>{if(r===!1)throw new L(a(i," has been removed"+(s?" in "+s:"")),L.ERR_DEPRECATED);return s&&!Ss[i]&&(Ss[i]=!0,console.warn(a(i," has been deprecated since v"+s+" and will be removed in the near future"))),r?r(o,i,l):!0}};Ft.spelling=function(r){return(s,n)=>(console.warn(`${n} is likely a misspelling of ${r}`),!0)};function oi(t,r,s){if(typeof t!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let a=n.length;for(;a-- >0;){const o=n[a],i=r[o];if(i){const l=t[o],b=l===void 0||i(l,o,t);if(b!==!0)throw new L("option "+o+" must be "+b,L.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new L("Unknown option "+o,L.ERR_BAD_OPTION)}}const Ct={assertOptions:oi,validators:Ft},ye=Ct.validators;let Me=class{constructor(r){this.defaults=r||{},this.interceptors={request:new us,response:new us}}async request(r,s){try{return await this._request(r,s)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
`+o):n.stack=o}catch{}}throw n}}_request(r,s){typeof r=="string"?(s=s||{},s.url=r):s=r||{},s=$e(this.defaults,s);const{transitional:n,paramsSerializer:a,headers:o}=s;n!==void 0&&Ct.assertOptions(n,{silentJSONParsing:ye.transitional(ye.boolean),forcedJSONParsing:ye.transitional(ye.boolean),clarifyTimeoutError:ye.transitional(ye.boolean)},!1),a!=null&&(v.isFunction(a)?s.paramsSerializer={serialize:a}:Ct.assertOptions(a,{encode:ye.function,serialize:ye.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Ct.assertOptions(s,{baseUrl:ye.spelling("baseURL"),withXsrfToken:ye.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let i=o&&v.merge(o.common,o[s.method]);o&&v.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),s.headers=ue.concat(i,o);const l=[];let b=!0;this.interceptors.request.forEach(function(j){typeof j.runWhen=="function"&&j.runWhen(s)===!1||(b=b&&j.synchronous,l.unshift(j.fulfilled,j.rejected))});const f=[];this.interceptors.response.forEach(function(j){f.push(j.fulfilled,j.rejected)});let p,_=0,w;if(!b){const u=[ws.bind(this),void 0];for(u.unshift(...l),u.push(...f),w=u.length,p=Promise.resolve(s);_<w;)p=p.then(u[_++],u[_++]);return p}w=l.length;let k=s;for(;_<w;){const u=l[_++],j=l[_++];try{k=u(k)}catch(h){j.call(this,h);break}}try{p=ws.call(this,k)}catch(u){return Promise.reject(u)}for(_=0,w=f.length;_<w;)p=p.then(f[_++],f[_++]);return p}getUri(r){r=$e(this.defaults,r);const s=an(r.baseURL,r.url,r.allowAbsoluteUrls);return en(s,r.params,r.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(r){Me.prototype[r]=function(s,n){return this.request($e(n||{},{method:r,url:s,data:(n||{}).data}))}});v.forEach(["post","put","patch"],function(r){function s(n){return function(o,i,l){return this.request($e(l||{},{method:r,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Me.prototype[r]=s(),Me.prototype[r+"Form"]=s(!0)});let ii=class un{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(o){s=o});const n=this;this.promise.then(a=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](a);n._listeners=null}),this.promise.then=a=>{let o;const i=new Promise(l=>{n.subscribe(l),o=l}).then(a);return i.cancel=function(){n.unsubscribe(o)},i},r(function(o,i,l){n.reason||(n.reason=new Qe(o,i,l),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const s=this._listeners.indexOf(r);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const r=new AbortController,s=n=>{r.abort(n)};return this.subscribe(s),r.signal.unsubscribe=()=>this.unsubscribe(s),r.signal}static source(){let r;return{token:new un(function(a){r=a}),cancel:r}}};function li(t){return function(s){return t.apply(null,s)}}function ci(t){return v.isObject(t)&&t.isAxiosError===!0}const Jt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,Una
`)],{type:"text/plain"}),S=URL.createObjectURL(I),T=document.createElement("a");T.href=S,T.download="soundwave-backup-codes.txt",T.click()},sx:{mb:2},children:"Download Backup Codes"}),e.jsx(E,{fullWidth:!0,variant:"text",onClick:()=>g(!1),children:"Back to Setup"})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),e.jsx(d,{sx:{display:"flex",justifyContent:"center",mb:2},children:e.jsx("img",{src:f.qr_code,alt:"QR Code",style:{width:200,height:200}})}),e.jsx(c,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Or enter this code manually:"}),e.jsx(J,{fullWidth:!0,value:f.secret,InputProps:{readOnly:!0},sx:{mb:2}}),e.jsx(c,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Enter the 6-digit code from your app to verify:"}),e.jsx(J,{fullWidth:!0,placeholder:"000000",value:_,onChange:I=>w(I.target.value),inputProps:{maxLength:6}}),j&&e.jsx(V,{severity:"error",sx:{mt:2},children:j}),e.jsx(E,{fullWidth:!0,variant:"text",onClick:()=>g(!0),sx:{mt:2},children:"View Backup Codes"})]})})}),e.jsxs(Se,{children:[e.jsx(E,{onClick:()=>i(!1),children:"Cancel"}),!C&&e.jsx(E,{onClick:H,variant:"contained",disabled:_.length!==6,children:"Verify and Enable"})]})]}),e.jsxs(je,{open:l,onClose:()=>b(!1),maxWidth:"sm",fullWidth:!0,children:[e.jsx(ve,{children:"Disable Two-Factor Authentication"}),e.jsxs(we,{children:[e.jsx(V,{severity:"warning",sx:{mb:2},children:"Disabling two-factor authentication will make your account less secure."}),e.jsx(c,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Enter a verification code from your authenticator app or use a backup code:"}),e.jsx(J,{fullWidth:!0,placeholder:"000000",value:k,onChange:I=>u(I.target.value),inputProps:{maxLength:6}}),j&&e.jsx(V,{severity:"error",sx:{mt:2},children:j})]}),e.jsxs(Se,{children:[e.jsx(E,{onClick:()=>b(!1),children:"Cancel"}),e.jsx(E,{onClick:K,variant:"contained",color:"error",disabled:k.length!==6,children:"Disable 2FA"})]})]}),e.jsx(ne,{sx:{maxWidth:600,bgcolor:"background.paper",mb:2},children:e.jsxs(qn,{defaultExpanded:!0,children:[e.jsx(Hn,{expandIcon:e.jsx(yn,{}),children:e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(gn,{sx:{mr:1,color:"primary.main"}}),e.jsx(c,{variant:"h6",children:"Quick Sync - Adaptive Streaming"})]})}),e.jsx(Vn,{children:e.jsx(Pl,{})})]})}),e.jsx(Dl,{}),A&&e.jsx(ne,{sx:{maxWidth:600,bgcolor:"background.paper",mb:2},children:e.jsxs(ae,{children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:2},children:[e.jsx(Zt,{sx:{mr:1,color:"primary.main"}}),e.jsx(c,{variant:"h6",children:"User Management"})]}),e.jsx(c,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage all users in the system. Create, edit, or delete user accounts and monitor system statistics."}),e.jsx(E,{variant:"contained",startIcon:e.jsx(Zt,{}),onClick:()=>t("/admin/users"),fullWidth:!0,sx:{minHeight:{xs:"44px",sm:"48px"}},children:"Open User Management"})]})})]})}const Ml="SoundWaveLocalAudio",xe="audioFiles",$l=1;class Ll{constructor(){ke(this,"db",null)}async init(){return new Promise((r,s)=>{const n=indexedDB.open(Ml,$l);n.onerror=()=>s(n.error),n.onsuccess=()=>{this.db=n.result,r()},n.onupgradeneeded=a=>{const o=a.target.result;if(!o.objectStoreNames.contains(xe)){const i=o.createObjectStore(xe,{keyPath:"id"});i.createIndex("title","title",{unique:!1}),i.createIndex("artist","artist",{unique:!1}),i.createIndex("album","album",{unique:!1}),i.createIndex("addedDate","addedDate",{unique:!1})}}})}async addFiles(r){this.db||await this.init();const s=this.db.transaction([xe],"readwrite"),n=s.objectStore(xe);for(const a of r)n.put(a);return new Promise((a,o)=>{s.oncomplete=()=>a(),s.onerror=()=>o(s.error)})}async getAll(){this.db||await this.init();const n=this.db.transaction([xe],"readonly").objectStore(xe).getAll();return new Promise((a,o)=>{n.onsuccess=()=>a(n.result),n.onerror=()=>o(n.error)})}async getById(r){this.db||await this.init();const a=this.db.transaction([xe],"readonly")
`);for(const K of H){const Q=K.match(/\[(\d{2}):(\d{2})\.(\d{2,3})\](.*)/);if(Q){const N=parseInt(Q[1]),I=parseInt(Q[2]),S=parseInt(Q[3].padEnd(2,"0").substring(0,2)),T=N*60+I+S/100,G=Q[4].trim();G&&P.push({time:T,text:G})}}return P.sort((K,Q)=>K.time-Q.time)},$=()=>{let z=-1;for(let P=p.length-1;P>=0;P--)if(r>=p[P].time){z=P;break}k(z)};return i?e.jsxs(d,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s&&e.jsx(d,{sx:{display:"flex",justifyContent:"flex-end",p:1},children:e.jsx(U,{size:"small",onClick:s,children:e.jsx(Ee,{})})}),e.jsx(d,{sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(Re,{})})]}):b?e.jsxs(d,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s&&e.jsx(d,{sx:{display:"flex",justifyContent:"flex-end",p:1},children:e.jsx(U,{size:"small",onClick:s,children:e.jsx(Ee,{})})}),e.jsxs(d,{sx:{flex:1,p:2},children:[e.jsx(V,{severity:"error",sx:{mb:2},children:b}),e.jsx(E,{variant:"contained",onClick:A,startIcon:e.jsx(rt,{}),children:"Try Fetch Lyrics"})]})]}):a?a.is_instrumental?e.jsxs(d,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s&&e.jsx(d,{sx:{display:"flex",justifyContent:"flex-end",p:1},children:e.jsx(U,{size:"small",onClick:s,children:e.jsx(Ee,{})})}),e.jsxs(d,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:4},children:[e.jsx(et,{sx:{fontSize:64,color:"text.secondary",mb:2}}),e.jsx(c,{variant:"h6",color:"text.secondary",children:"Instrumental Track"})]})]}):a.has_lyrics?e.jsxs(ne,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[e.jsxs(d,{sx:{borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",px:2,pt:1},children:[e.jsx(c,{variant:"h6",sx:{flexGrow:1},children:"Lyrics"}),e.jsx(U,{size:"small",onClick:A,sx:{mr:1},children:e.jsx(rt,{})}),s&&e.jsx(U,{size:"small",onClick:s,children:e.jsx(Ee,{})})]}),a.is_synced&&e.jsxs(d,{sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(c,{variant:"caption",color:"text.secondary",children:["Source: ",a.source," ",a.language&&` ${a.language}`]}),e.jsx(oe,{control:e.jsx(le,{size:"small",checked:u,onChange:z=>j(z.target.checked)}),label:e.jsx(c,{variant:"caption",children:"Auto-scroll"})})]}),a.is_synced&&a.plain_lyrics&&e.jsxs(Is,{value:h,onChange:(z,P)=>x(P),sx:{px:2,minHeight:40},children:[e.jsx(Be,{label:"Synced",sx:{minHeight:40,py:.5}}),e.jsx(Be,{label:"Plain Text",sx:{minHeight:40,py:.5}})]}),e.jsx(ae,{ref:m,sx:{flexGrow:1,overflow:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"rgba(0,0,0,0.1)"},"&::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.3)",borderRadius:"4px"}},children:h===0&&a.is_synced?e.jsx(d,{children:p.map((z,P)=>e.jsx(d,{ref:P===w?C:null,sx:{py:1.5,px:2,borderRadius:1,transition:"all 0.3s ease",backgroundColor:P===w?"primary.main":"transparent",color:P===w?"primary.contrastText":"text.primary",opacity:P===w?1:.5,transform:P===w?"scale(1.02)":"scale(1)",fontWeight:P===w?600:400},children:e.jsx(c,{variant:"body1",sx:{fontSize:P===w?"1.1rem":"1rem",lineHeight:1.6},children:z.text})},P))}):e.jsx(d,{sx:{px:1},children:a.plain_lyrics.split(`
`).map((z,P)=>e.jsx(c,{variant:"body1",sx:{py:.5,lineHeight:1.8,color:"text.primary"},children:z||" "},P))})}),a.last_error&&e.jsxs(V,{severity:"warning",sx:{m:2,mt:0},children:["Last fetch error: ",a.last_error]})]}):e.jsxs(d,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[s&&e.jsx(d,{sx:{display:"flex",justifyContent:"flex-end",p:1},children:e.jsx(U,{size:"small",onClick:s,children:e.jsx(Ee,{})})}),e.jsxs(d,{sx:{flex:1,p:2},children:[e.jsxs(V,{severity:"info",sx:{mb:2},children:["No lyrics available for this track",a.fetch_attempted&&` (Attempted ${a.fetch_attempts} times)`]}),e.jsx(E,{variant:"contained",onClick:A,startIcon:e.jsx(rt,{}),children:"Fetch Lyrics"})]})]}):null}class Lc{constructor(){ke(this,"isSupported");this.isSupported="mediaSession"in navigator}setMetadata(r){if(!this.isSupported)return;const s=r.artwork||[{src:"/img/icon-96x96.png",sizes:"96x96",type:"image/png"},{src:"/img/icon-128x128.png",sizes:"128x128",type:"image/png"},{src:"/img/icon-192x192.png",sizes:"192x192",type:"image/png"},{src:"/img/icon-256x256.png",sizes:"256x256",type:"image/png"},{src:"/img/icon-384x384.png",sizes:"384x384",type:"image/png"},{src:"/img/icon-512x512.png",sizes:"512x512",type:"image/png"}];navigator.mediaSession.metadata=new MediaMetadata({title:r.title,artist:r.artist,album:r.album||"",artwork:s})}setActionHandlers(r){if(!this.isSupported)return;["play","pause","previoustrack","nexttrack","seekbackward","seekforward","seekto"].forEach(n=>{try{r[n]?navigator.mediaSession.setActionHandler(n,r[n]):navigator.mediaSession.setActionHandler(n,null)}catch{console.warn(`Media Session API doesn't support ${n} action`)}})}setPlaybackState(r){this.isSupported&&(navigator.mediaSession.playbackState=r)}setPositionState(r){if(this.isSupported)try{"setPositionState"in navigator.mediaSession&&navigator.mediaSession.setPositionState(r)}catch(s){console.warn("Failed to set position state:",s)}}clear(){if(!this.isSupported)return;navigator.mediaSession.metadata=null,this.setPlaybackState("none"),["play","pause","previoustrack","nexttrack","seekbackward","seekforward","seekto"].forEach(s=>{try{navigator.mediaSession.setActionHandler(s,null)}catch{}})}isAPISupported(){return this.isSupported}}const yt=new Lc,Uc=t=>yt.setMetadata(t),Nc=t=>yt.setActionHandlers(t),ks=t=>yt.setPlaybackState(t),As=t=>yt.setPositionState(t),Bc=()=>yt.clear();function Ps({audio:t,isPlaying:r,setIsPlaying:s,onClose:n,onNext:a,onPrevious:o,hasNext:i=!1,hasPrevious:l=!1}){const[b,f]=y.useState(0),[p,_]=y.useState(80),[w,k]=y.useState(!1),[u,j]=y.useState(!1),[h,x]=y.useState(""),[m,C]=y.useState(!0),g=y.useRef(null),A=y.useRef(r),R=y.useRef(!1),$=y.useRef(t.id);$.current!==t.id&&($.current=t.id,x(""),C(!0)),y.useEffect(()=>{(async()=>{if(t.media_url){x(t.media_url),C(!1);return}if(t.youtube_id)try{C(!0);const S=await(await fetch(`/api/audio/${t.youtube_id}/player/`,{headers:{Authorization:`Token ${localStorage.getItem("token")}`}})).json();x(S.stream_url),C(!1)}catch(I){console.error("Failed to fetch stream URL:",I),C(!1)}})()},[t.id]),y.useEffect(()=>(Uc({title:t.title,artist:t.artist||"Unknown Artist",album:t.album,artwork:t.cover_art_url?[{src:t.cover_art_url,sizes:"96x96",type:"image/png"},{src:t.cover_art_url,sizes:"128x128",type:"image/png"},{src:t.cover_art_url,sizes:"192x192",type:"image/png"},{src:t.cover_art_url,sizes:"256x256",type:"image/png"},{src:t.cover_art_url,sizes:"384x384",type:"image/png"},{src:t.cover_art_url,sizes:"512x512",type:"image/png"}]:void 0}),Nc({play:()=>{A.current||s(!0)},pause:()=>{A.current&&s(!1)},previoustrack:()=>{l&&o&&o()},nexttrack:()=>{i&&a&&a()},seekbackward:()=>{g.current&&(R.current=!0,g.current.currentTime=Math.max(0,g.current.currentTime-10),setTimeout(()=>{R.current=!1},100))},seekforward:()=>{g.current&&(R.current=!0,g.current.currentTime=Math.min(t.duration,g.current.currentTime+10),setTimeout(()=>{R.current=!1},100))},seekto:N=>{g.current&&N.seekTime!==void 0&&(R.current=!0,g.current.currentTime=N.seekTime,setTimeout(()=>{R.current=!1},100))}}),()=>{Bc()}),[t,i,l,a,o,s]),y.useEffect(()=>{g.cu